develoop
youhang 5 months ago
parent 067ed5bdb6
commit 2766e17c03
  1. 37
      generated/core/OpenAPI.ts
  2. 41
      src/views/MyCourseStudy/ContainerCla.vue

@ -2,31 +2,34 @@
/* istanbul ignore file */ /* istanbul ignore file */
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
import type { ApiRequestOptions } from './ApiRequestOptions'; import type { ApiRequestOptions } from './ApiRequestOptions'
// 引入设置token的方法
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>; import { GET_TKOEN } from '@/utils/token'
type Headers = Record<string, string>; type Resolver<T> = (options: ApiRequestOptions) => Promise<T>
type Headers = Record<string, string>
export type OpenAPIConfig = { export type OpenAPIConfig = {
BASE: string; BASE: string
VERSION: string; VERSION: string
WITH_CREDENTIALS: boolean; WITH_CREDENTIALS: boolean
CREDENTIALS: 'include' | 'omit' | 'same-origin'; CREDENTIALS: 'include' | 'omit' | 'same-origin'
TOKEN?: string | Resolver<string> | undefined; TOKEN?: string | Resolver<string> | undefined
USERNAME?: string | Resolver<string> | undefined; USERNAME?: string | Resolver<string> | undefined
PASSWORD?: string | Resolver<string> | undefined; PASSWORD?: string | Resolver<string> | undefined
HEADERS?: Headers | Resolver<Headers> | undefined; HEADERS?: Headers | Resolver<Headers> | undefined
ENCODE_PATH?: ((path: string) => string) | undefined; ENCODE_PATH?: ((path: string) => string) | undefined
}; }
export const OpenAPI: OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = {
BASE: 'http://39.106.16.162:8080', BASE: 'http://39.106.16.162:8080',
VERSION: '1.0.0', VERSION: '1.0.0',
WITH_CREDENTIALS: false, WITH_CREDENTIALS: false,
CREDENTIALS: 'include', CREDENTIALS: 'include',
TOKEN: undefined, TOKEN: GET_TKOEN('TOKEN'),
USERNAME: undefined, USERNAME: undefined,
PASSWORD: undefined, PASSWORD: undefined,
HEADERS: undefined, HEADERS: {
Authorization: 'Bearer ' + GET_TKOEN('TOKEN'),
},
ENCODE_PATH: undefined, ENCODE_PATH: undefined,
}; }

@ -27,9 +27,15 @@
</div> </div>
</div> </div>
<div class="Page-1"> <div class="Page-1">
<el-pagination v-model:current-page="params.current" v-model:page-size="params.pageSize" <el-pagination
:page-sizes="[6, 8, 12, 15]" layout="total, sizes, prev, pager, next, jumper" :total="total" v-model:current-page="params.current"
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> v-model:page-size="params.pageSize"
:page-sizes="[6, 8, 12, 15]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
</el-tab-pane> </el-tab-pane>
</template> </template>
@ -42,21 +48,22 @@ const container = ref()
function handleResize() { function handleResize() {
const style = getComputedStyle(container.value) const style = getComputedStyle(container.value)
const width = Number(style.width.slice(0, -2)) const width = Number(style.width.slice(0, -2))
if (width >= 350 * 4.5) container.value.style.gridTemplateColumns = "repeat(4, 350px)" if (width >= 350 * 4.5)
else container.value.style.gridTemplateColumns = "repeat(auto-fill, 350px)" container.value.style.gridTemplateColumns = 'repeat(4, 350px)'
else container.value.style.gridTemplateColumns = 'repeat(auto-fill, 350px)'
} }
function debounce(func: any, delay: any) { function debounce(func: any, delay: any) {
let timer: any let timer: any
return function () { return function () {
clearTimeout(timer); clearTimeout(timer)
timer = setTimeout(() => { timer = setTimeout(() => {
// @ts-ignore // @ts-ignore
func.apply(this, arguments); func.apply(this, arguments)
}, delay); }, delay)
}; }
} }
const deHR = debounce(handleResize, 500) const deHR = debounce(handleResize, 500)
const myObserver = new ResizeObserver((deHR)) const myObserver = new ResizeObserver(deHR)
onMounted(() => myObserver.observe(container.value)) onMounted(() => myObserver.observe(container.value))
// =============================== // ===============================
const total = ref(0) const total = ref(0)
@ -92,7 +99,7 @@ let params = ref<CourseFavourQueryRequest>({
}) })
const getDatalist = async () => { const getDatalist = async () => {
const res = await SeCourseFavourControllerService.listPostByPageUsingPost( const res = await SeCourseFavourControllerService.listPostByPageUsingPost1(
params.value, params.value,
) )
datalist.value = res.data.records datalist.value = res.data.records
@ -121,7 +128,7 @@ const handleCurrentChange = (page: any) => {
justify-content: center; justify-content: center;
} }
.example-pagination-block+.example-pagination-block { .example-pagination-block + .example-pagination-block {
margin-top: 10px; margin-top: 10px;
} }
@ -180,7 +187,7 @@ const handleCurrentChange = (page: any) => {
border-bottom: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217);
} }
.ClassImg>img { .ClassImg > img {
width: 100%; width: 100%;
height: 180px; height: 180px;
} }
@ -214,14 +221,14 @@ const handleCurrentChange = (page: any) => {
justify-content: space-around; justify-content: space-around;
} }
.Con>h3 { .Con > h3 {
margin-left: 15px; margin-left: 15px;
font-size: 25px; font-size: 25px;
font-weight: 600; font-weight: 600;
cursor: pointer; cursor: pointer;
} }
.Con>p { .Con > p {
margin-left: 15px; margin-left: 15px;
margin-top: 5px; margin-top: 5px;
font-size: 13px; font-size: 13px;
@ -229,14 +236,14 @@ const handleCurrentChange = (page: any) => {
cursor: pointer; cursor: pointer;
} }
.Con>p>span { .Con > p > span {
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
color: rgb(94, 188, 231); color: rgb(94, 188, 231);
font-weight: 600; font-weight: 600;
} }
.Con>button { .Con > button {
width: 45px; width: 45px;
height: 20px; height: 20px;
font-size: 9px; font-size: 9px;

Loading…
Cancel
Save