提交 e9b73251 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 377de966
......@@ -19,8 +19,10 @@
"controlledRef": true,
"createApp": true,
"createEventHook": true,
"createGenericProjection": true,
"createGlobalState": true,
"createInjectionState": true,
"createProjection": true,
"createReactiveFn": true,
"createSharedComposable": true,
"createUnrefFn": true,
......@@ -42,6 +44,9 @@
"isReactive": true,
"isReadonly": true,
"isRef": true,
"logicAnd": true,
"logicNot": true,
"logicOr": true,
"makeDestructurable": true,
"markRaw": true,
"nextTick": true,
......@@ -101,6 +106,7 @@
"unref": true,
"unrefElement": true,
"until": true,
"useAbs": true,
"useActiveElement": true,
"useArrayEvery": true,
"useArrayFilter": true,
......@@ -113,6 +119,7 @@
"useAsyncQueue": true,
"useAsyncState": true,
"useAttrs": true,
"useAverage": true,
"useBase64": true,
"useBattery": true,
"useBluetooth": true,
......@@ -120,6 +127,8 @@
"useBroadcastChannel": true,
"useBrowserLocation": true,
"useCached": true,
"useCeil": true,
"useClamp": true,
"useClipboard": true,
"useCloned": true,
"useColorMode": true,
......@@ -156,6 +165,7 @@
"useFetch": true,
"useFileDialog": true,
"useFileSystemAccess": true,
"useFloor": true,
"useFocus": true,
"useFocusWithin": true,
"useFps": true,
......@@ -173,10 +183,13 @@
"useLocalStorage": true,
"useMagicKeys": true,
"useManualRefHistory": true,
"useMath": true,
"useMax": true,
"useMediaControls": true,
"useMediaQuery": true,
"useMemoize": true,
"useMemory": true,
"useMin": true,
"useMounted": true,
"useMouse": true,
"useMouseInElement": true,
......@@ -193,14 +206,17 @@
"usePermission": true,
"usePointer": true,
"usePointerSwipe": true,
"usePrecision": true,
"usePreferredColorScheme": true,
"usePreferredContrast": true,
"usePreferredDark": true,
"usePreferredLanguages": true,
"usePreferredReducedMotion": true,
"useProjection": true,
"useRafFn": true,
"useRefHistory": true,
"useResizeObserver": true,
"useRound": true,
"useRoute": true,
"useRouter": true,
"useScreenOrientation": true,
......@@ -217,6 +233,7 @@
"useStorage": true,
"useStorageAsync": true,
"useStyleTag": true,
"useSum": true,
"useSupported": true,
"useSwipe": true,
"useTemplateRefsList": true,
......@@ -232,10 +249,12 @@
"useTimeoutPoll": true,
"useTimestamp": true,
"useTitle": true,
"useToFixed": true,
"useToNumber": true,
"useToString": true,
"useToggle": true,
"useTransition": true,
"useTrunc": true,
"useUrlSearchParams": true,
"useUserMedia": true,
"useVModel": true,
......
......@@ -20,8 +20,10 @@ declare global {
const controlledRef: typeof import('@vueuse/core')['controlledRef']
const createApp: typeof import('vue')['createApp']
const createEventHook: typeof import('@vueuse/core')['createEventHook']
const createGenericProjection: typeof import('@vueuse/math')['createGenericProjection']
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
const createProjection: typeof import('@vueuse/math')['createProjection']
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
......@@ -43,6 +45,9 @@ declare global {
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const logicAnd: typeof import('@vueuse/math')['logicAnd']
const logicNot: typeof import('@vueuse/math')['logicNot']
const logicOr: typeof import('@vueuse/math')['logicOr']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
......@@ -102,6 +107,7 @@ declare global {
const unref: typeof import('vue')['unref']
const unrefElement: typeof import('@vueuse/core')['unrefElement']
const until: typeof import('@vueuse/core')['until']
const useAbs: typeof import('@vueuse/math')['useAbs']
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
......@@ -114,6 +120,7 @@ declare global {
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
const useAttrs: typeof import('vue')['useAttrs']
const useAverage: typeof import('@vueuse/math')['useAverage']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
......@@ -121,6 +128,8 @@ declare global {
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
const useCached: typeof import('@vueuse/core')['useCached']
const useCeil: typeof import('@vueuse/math')['useCeil']
const useClamp: typeof import('@vueuse/math')['useClamp']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
......@@ -157,6 +166,7 @@ declare global {
const useFetch: typeof import('@vueuse/core')['useFetch']
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFloor: typeof import('@vueuse/math')['useFloor']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useFps: typeof import('@vueuse/core')['useFps']
......@@ -174,10 +184,13 @@ declare global {
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
const useMath: typeof import('@vueuse/math')['useMath']
const useMax: typeof import('@vueuse/math')['useMax']
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
const useMemoize: typeof import('@vueuse/core')['useMemoize']
const useMemory: typeof import('@vueuse/core')['useMemory']
const useMin: typeof import('@vueuse/math')['useMin']
const useMounted: typeof import('@vueuse/core')['useMounted']
const useMouse: typeof import('@vueuse/core')['useMouse']
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
......@@ -194,14 +207,17 @@ declare global {
const usePermission: typeof import('@vueuse/core')['usePermission']
const usePointer: typeof import('@vueuse/core')['usePointer']
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePrecision: typeof import('@vueuse/math')['usePrecision']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
const useProjection: typeof import('@vueuse/math')['useProjection']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRound: typeof import('@vueuse/math')['useRound']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
......@@ -218,6 +234,7 @@ declare global {
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSum: typeof import('@vueuse/math')['useSum']
const useSupported: typeof import('@vueuse/core')['useSupported']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
......@@ -233,10 +250,12 @@ declare global {
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
const useTitle: typeof import('@vueuse/core')['useTitle']
const useToFixed: typeof import('@vueuse/math')['useToFixed']
const useToNumber: typeof import('@vueuse/core')['useToNumber']
const useToString: typeof import('@vueuse/core')['useToString']
const useToggle: typeof import('@vueuse/core')['useToggle']
const useTransition: typeof import('@vueuse/core')['useTransition']
const useTrunc: typeof import('@vueuse/math')['useTrunc']
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
const useVModel: typeof import('@vueuse/core')['useVModel']
......
......@@ -12,6 +12,7 @@
"@tinymce/tinymce-vue": "^5.0.0",
"@vant/area-data": "^1.3.2",
"@vueuse/core": "^9.2.0",
"@vueuse/math": "^9.3.0",
"ali-oss": "^6.17.1",
"axios": "^0.27.2",
"blueimp-md5": "^2.19.0",
......@@ -886,6 +887,54 @@
}
}
},
"node_modules/@vueuse/math": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@vueuse/math/-/math-9.3.0.tgz",
"integrity": "sha512-uCHxm9t3cNLQNKXZBHCxT9fJXDYiZcNn9PegpCei4bpxMcLR8QCbNzoAggxmI7m4M6qaFSz8am3cqAM+6Ecy8Q==",
"dependencies": {
"@vueuse/shared": "9.3.0",
"vue-demi": "*"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/math/node_modules/@vueuse/shared": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-9.3.0.tgz",
"integrity": "sha512-caGUWLY0DpPC6l31KxeUy6vPVNA0yKxx81jFYLoMpyP6cF84FG5Dkf69DfSUqL57wX8JcUkJDMnQaQIZPWFEQQ==",
"dependencies": {
"vue-demi": "*"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/math/node_modules/vue-demi": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
"integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/@vueuse/metadata": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-9.2.0.tgz",
......@@ -5501,6 +5550,31 @@
}
}
},
"@vueuse/math": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@vueuse/math/-/math-9.3.0.tgz",
"integrity": "sha512-uCHxm9t3cNLQNKXZBHCxT9fJXDYiZcNn9PegpCei4bpxMcLR8QCbNzoAggxmI7m4M6qaFSz8am3cqAM+6Ecy8Q==",
"requires": {
"@vueuse/shared": "9.3.0",
"vue-demi": "*"
},
"dependencies": {
"@vueuse/shared": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-9.3.0.tgz",
"integrity": "sha512-caGUWLY0DpPC6l31KxeUy6vPVNA0yKxx81jFYLoMpyP6cF84FG5Dkf69DfSUqL57wX8JcUkJDMnQaQIZPWFEQQ==",
"requires": {
"vue-demi": "*"
}
},
"vue-demi": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
"integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==",
"requires": {}
}
}
},
"@vueuse/metadata": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-9.2.0.tgz",
......
......@@ -18,6 +18,7 @@
"@tinymce/tinymce-vue": "^5.0.0",
"@vant/area-data": "^1.3.2",
"@vueuse/core": "^9.2.0",
"@vueuse/math": "^9.3.0",
"ali-oss": "^6.17.1",
"axios": "^0.27.2",
"blueimp-md5": "^2.19.0",
......
......@@ -127,8 +127,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
:on-preview="handlePreview"
:on-success="handleSuccess"
:file-list="fileList"
class="uploader"
>
class="uploader">
<slot>
<template v-if="showFileList">
<template v-if="$attrs['list-type'] === 'picture-card'">
......@@ -152,6 +151,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
<style lang="scss">
.uploader {
flex: 1;
overflow: hidden;
}
.avatar-uploader {
width: 178px;
......
......@@ -52,8 +52,7 @@ const logout = async () => {
:popper-offset="0"
popper-class="sub-menu-popper"
v-permission="item.tag"
v-if="item.children"
>
v-if="item.children">
<template #title>
{{ item.name }}
</template>
......@@ -61,8 +60,7 @@ const logout = async () => {
:index="subitem.path"
v-for="subitem in item.children"
:key="subitem.path"
v-permission="subitem.tag"
>
v-permission="subitem.tag">
{{ subitem.name }}
</el-menu-item>
</el-sub-menu>
......@@ -129,6 +127,7 @@ const logout = async () => {
font-weight: 500;
line-height: 30px;
border-left: 2px solid var(--main-color);
white-space: nowrap;
}
}
.app-header-nav {
......
......@@ -4,6 +4,7 @@ export function useCountdown(optionsSecond = 90) {
let timer: number | null = null
function start() {
second.value = optionsSecond
disabled.value = true
timer = window.setInterval(() => {
second.value--
......
......@@ -28,7 +28,13 @@ export function updateContest(data: ContestUpdateParams) {
}
// 获取指导老师列表
export function getTeacherList(params?: { name?: string }) {
export function getTeacherList(params?: {
name?: string
email?: string
sso_id?: string
page?: number
'per-page'?: number
}) {
return httpRequest.get('/api/resource/v1/backend/teacher/faculty-advisers', { params })
}
......
......@@ -133,11 +133,11 @@ function handleSubmit() {
...form,
organizer_ids: JSON.stringify(form.organizer_ids),
// teacher_ids: form.teacher_ids.join(','),
start_range: new Date(firstDate).getTime() / 1000,
end_range: new Date(secondDate).getTime() / 1000,
start_range: dayjs(firstDate).unix(),
end_range: dayjs(secondDate).endOf('date').unix(),
start_at: dayjs(firstDatetime).year(year).month(month).date(date).unix(),
end_at: dayjs(secondDatetime).year(year).month(month).date(date).unix(),
apply_expiration_date: new Date(form.apply_expiration_date).getTime() / 1000
apply_expiration_date: dayjs(form.apply_expiration_date).unix()
}
const params: ContestUpdateParams = pick(mergedForm, [
'id',
......@@ -193,8 +193,7 @@ function handleDateRangeChange(value: any) {
:close-on-click-modal="false"
align-center
width="600px"
@update:modelValue="$emit('update:modelValue')"
>
@update:modelValue="$emit('update:modelValue')">
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
<el-form-item label="赛项名称" prop="name">
<el-input v-model="form.name" :disabled="isUpdate" />
......@@ -215,8 +214,7 @@ function handleDateRangeChange(value: any) {
v-for="item in technicalSupportUnitList"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="赛项类型" prop="type">
......@@ -235,11 +233,10 @@ function handleDateRangeChange(value: any) {
range-separator="至"
v-model="form.dateRange"
style="width: 100%"
@change="handleDateRangeChange"
/>
@change="handleDateRangeChange" />
</el-form-item>
<el-form-item label="正式比赛日期" prop="date">
<el-date-picker v-model="form.date" style="width: 100%" />
<el-date-picker type="date" v-model="form.date" style="width: 100%" />
</el-form-item>
<el-form-item label="正式比赛时间" prop="datetimeRange">
<el-time-picker
......@@ -248,11 +245,10 @@ function handleDateRangeChange(value: any) {
start-placeholder="开始时间"
end-placeholder="结束时间"
v-model="form.datetimeRange"
style="width: 100%"
/>
style="width: 100%" />
</el-form-item>
<el-form-item label="报名截止日期" prop="apply_expiration_date">
<el-date-picker v-model="form.apply_expiration_date" style="width: 100%" />
<el-date-picker type="date" v-model="form.apply_expiration_date" style="width: 100%" />
</el-form-item>
<el-form-item label="训练平台地址" prop="train_platform_uri">
<el-input v-model="form.train_platform_uri" />
......
......@@ -21,7 +21,7 @@ const formRef = $ref<FormInstance>()
const form = reactive<any>({
name: detail.name,
competition_id: detail.id,
is_more_status: '1',
is_more_status: '0',
rule_type: '1',
lowest_number: undefined,
detail_list: []
......@@ -57,7 +57,7 @@ function fetchInfo() {
let examList = $ref<Record<string, any>[]>([])
// 获取关联考试列表
function fetchExamList() {
getExamList({ project: 'exam_x1', 'per-page': 1000 }).then(res => {
getExamList({ project: 'x1', 'per-page': 1000 }).then(res => {
examList = res.data.list || []
})
}
......@@ -145,8 +145,7 @@ function handleRatioChange(row: any, index: number) {
title="评分规则"
:close-on-click-modal="false"
width="800px"
@update:modelValue="$emit('update:modelValue')"
>
@update:modelValue="$emit('update:modelValue')">
<el-form ref="formRef" :model="form" :rules="rules" label-width="170px">
<el-form-item label="赛项名称">
<el-input v-model="form.name" disabled />
......@@ -188,8 +187,7 @@ function handleRatioChange(row: any, index: number) {
v-for="item in currentScoreMethods(row.type)"
:key="item.id"
:label="item.label"
:value="item.value"
></el-option>
:value="item.value"></el-option>
</el-select>
</template>
</el-table-column>
......@@ -200,8 +198,7 @@ function handleRatioChange(row: any, index: number) {
v-for="item in examList"
:key="item.exam_id"
:label="item.name"
:value="item.exam_id"
></el-option>
:value="item.exam_id"></el-option>
</el-select>
</template>
</el-table-column>
......@@ -212,8 +209,7 @@ function handleRatioChange(row: any, index: number) {
:min="0"
:controls="false"
:disabled="row.type === '2'"
style="width: 100%"
/>
style="width: 100%" />
</template>
</el-table-column>
<el-table-column prop="date" label="占比(%)" align="center" width="100">
......@@ -223,8 +219,7 @@ function handleRatioChange(row: any, index: number) {
:min="0"
:controls="false"
@change="handleRatioChange(row, $index)"
style="width: 100%"
/>
style="width: 100%" />
</template>
</el-table-column>
<el-table-column prop="date" label="操作" align="center" width="60">
......
......@@ -2,6 +2,7 @@
import type { ContestVideoItem } from '../types'
import { CirclePlus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useToFixed } from '@vueuse/math'
import AppList from '@/components/base/AppList.vue'
import ViewVideoPreviewDialog from './ViewVideoPreviewDialog.vue'
import { getContestVideoList, deleteContestVideo } from '../api'
......@@ -24,7 +25,14 @@ const listOptions = {
columns: [
{ label: '序号', type: 'index', width: 60 },
{ label: '操作视频名称', prop: 'name' },
{ label: '视频时长(分钟)', prop: 'duration' },
{
label: '视频时长(分钟)',
prop: 'duration',
computed({ row }: { row: ContestVideoItem }) {
const duration = parseInt(row.duration)
return duration ? useToFixed(duration / 60, 2).value : 0
}
},
{ label: '创建人', prop: 'create_user.real_name' },
{ label: '创建时间', prop: 'created_time' },
{ label: '更新时间', prop: 'updated_time' },
......
......@@ -8,7 +8,7 @@ const teachers = ref<TeacherType[]>([])
export function useGetTeacherList() {
!teachers.value.length &&
getTeacherList().then((res: any) => {
getTeacherList({ 'per-page': 1000 }).then((res: any) => {
teachers.value = res.data.list
})
return { teachers }
......
......@@ -11,6 +11,11 @@ export function getMyContestList() {
return httpRequest.get('/api/lab/v1/student/competition/my-list')
}
// 获取赛项详情
export function getContest(params: { id: string }) {
return httpRequest.get('/api/lab/v1/student/competition/detail', { params })
}
// 获取学员详情
export function getStudentInfo() {
return httpRequest.get('/api/lab/v1/student/competition/student-detail')
......
......@@ -10,8 +10,8 @@ const isMy = $computed(() => {
return !!props.data.login_id
})
const typeText = $computed(() => {
return contestMode[props.data.type]
const modeText = $computed(() => {
return contestMode[props.data.mode]
})
</script>
......@@ -20,12 +20,12 @@ const typeText = $computed(() => {
<div class="contest-item-main">
<div class="contest-item-main__bg"><img :src="data.cover" /></div>
<div class="contest-item-main__inner">
<img :src="data.logo" class="logo" />
<!-- <img :src="data.logo" class="logo" /> -->
<div class="cover">
<ul class="info-list" v-if="isMy">
<li>姓名:{{ data.student_name }}</li>
<li>参赛ID:{{ data.login_id }}</li>
<li>参赛形式:{{ typeText }}</li>
<li>参赛形式:{{ modeText }}</li>
<li>所属学校:{{ data.org_name }}</li>
</ul>
<router-link :to="`/student/contest/lab/${data.id}?name=${data.name}`" v-if="isMy">
......@@ -55,7 +55,7 @@ const typeText = $computed(() => {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.5;
// opacity: 0.5;
}
}
.contest-item-main__inner {
......
......@@ -20,6 +20,7 @@ export interface Contest {
technical_support_unit: SystemDictionary
train_platform_uri: string
type: string
mode: string
}
export type ContestJoinParams = {
......
<script setup lang="ts">
import type { ExperimentRecord } from '../types'
import type { ExperimentRecord, Contest } from '../types'
import { HomeFilled } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { upload } from '@/utils/upload'
import { getExperimentRecord, uploadExperimentPicture } from '../api'
import { getContest, getExperimentRecord, uploadExperimentPicture } from '../api'
import dayjs from 'dayjs'
const Book = defineAsyncComponent(() => import('../components/Book.vue'))
......@@ -16,6 +16,17 @@ interface Props {
}
const props = defineProps<Props>()
// 获取赛项信息
let competition = $ref<Contest>()
function fetchCompetition() {
getContest({ id: props.id }).then(res => {
competition = res.data.detail
})
}
onMounted(() => {
fetchCompetition()
})
// 左侧
const leftPanelVisible = $ref<boolean>(true)
......@@ -39,7 +50,6 @@ watchEffect(() => {
})
// 右侧
const LAB_URL = import.meta.env.VITE_LAB_URL
let iframeKey = $ref(Date.now())
// 返回首页
function handleBackHome() {
......@@ -99,7 +109,7 @@ function uploadPicture(url: string) {
<section class="lab">
<div class="lab-left" :class="{ 'is-hidden': !leftPanelVisible }">
<div class="lab-left__inner">
<h1>{{ $route.query.name }}</h1>
<h1>{{ competition?.name }}</h1>
<el-tabs type="border-card" stretch>
<el-tab-pane label="实训指导" lazy>
<Book :competition_id="id"></Book>
......@@ -141,7 +151,12 @@ function uploadPicture(url: string) {
</el-row>
</AppCard>
<div class="lab-box">
<iframe :src="LAB_URL" :key="iframeKey" frameborder="0" class="iframe" ref="iframeRef"></iframe>
<iframe
:src="competition?.train_platform_uri"
:key="iframeKey"
frameborder="0"
class="iframe"
ref="iframeRef"></iframe>
</div>
</div>
</section>
......
......@@ -12,7 +12,7 @@ export default defineConfig(({ mode }) => ({
plugins: [
vue({ reactivityTransform: true }),
AutoImport({
imports: ['vue', 'vue/macros', 'vue-router', '@vueuse/core'],
imports: ['vue', 'vue/macros', 'vue-router', '@vueuse/core', '@vueuse/math'],
dts: true,
eslintrc: { enabled: true }
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论