|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<div v-if="!hidePanel" :class="['panel', { active: visible }]" id="panel" ref="container" :style="style"> |
|
|
|
|
<div v-if="!hidePanel" :class="['panel', { active: visible }]" id="panel" ref="container" :style="style" v-loading="loading"> |
|
|
|
|
<el-container class="scrollbar" id="container" v-show="visible"> |
|
|
|
|
<el-header class="panel-header" id="panelHeader"> |
|
|
|
|
<div class="project"> |
|
|
|
@ -130,7 +130,7 @@ |
|
|
|
|
<el-icon class="cursor-pointer" color="#f1772b" :size="24"> |
|
|
|
|
<Rank id="toggle" /> |
|
|
|
|
</el-icon> |
|
|
|
|
<div class="toggle-panel w-[40px] h-[175px] bg-[length:100%_100%] bg-no-repeat cursor-pointer" :class="{ active: visible }" ref="handle" @click="visible = !visible"></div> |
|
|
|
|
<div class="toggle-panel w-[40px] h-[175px] bg-[length:100%_100%] bg-no-repeat cursor-pointer" :class="{ active: visible }" ref="handle" @click="pannelToggle"></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="isSubmit && !isReport" class="z-[199] fixed top-[64px] right-0 bottom-0 left-0 bg-[rgba(0,0,0,.3)]"></div> |
|
|
|
@ -150,7 +150,7 @@ import Cookies from 'js-cookie'; |
|
|
|
|
import { mavonEditor } from 'mavon-editor'; |
|
|
|
|
import 'mavon-editor/dist/css/index.css'; |
|
|
|
|
import '@vueup/vue-quill/dist/vue-quill.snow.css'; |
|
|
|
|
import { useDraggable } from '@vueuse/core'; |
|
|
|
|
import { useDraggable, useWindowSize, Position } from '@vueuse/core'; |
|
|
|
|
import { logout } from '@/store/useCurrentUser'; |
|
|
|
|
import { getNow } from '@/utils/common'; |
|
|
|
|
|
|
|
|
@ -180,20 +180,23 @@ const judgmentId = ref<string | number>(''); |
|
|
|
|
const curReq = ref<Record<string, any>[]>([]); |
|
|
|
|
const taskList = ref<Record<string, any>[]>([]); |
|
|
|
|
const pannelTab = ref<string>('first'); |
|
|
|
|
const loading = ref<boolean>(false); |
|
|
|
|
const submiting = ref<boolean>(false); |
|
|
|
|
const reportId = ref<string | number>(''); |
|
|
|
|
const countVal = ref<any>(''); |
|
|
|
|
const getLevel = ref(); |
|
|
|
|
const container = ref<HTMLElement | null>(null); |
|
|
|
|
const handle = ref<HTMLElement | null>(null); |
|
|
|
|
const { width, height } = useWindowSize(); |
|
|
|
|
// 实验面板拖拽 |
|
|
|
|
const { x, y, style } = useDraggable(container, { |
|
|
|
|
initialValue: { x: 0, y: 200 }, |
|
|
|
|
stopPropagation: true, |
|
|
|
|
handle: handle.value, |
|
|
|
|
onStart(position, e) { |
|
|
|
|
onStart: (p: Position, e: PointerEvent): boolean => { |
|
|
|
|
const { id } = e.target; |
|
|
|
|
if (id !== 'panelHeader' && id !== 'toggle') return false; |
|
|
|
|
return true; |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -507,6 +510,11 @@ let reloadConfirm = async () => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
let pannelToggle = () => { |
|
|
|
|
visible.value = !visible.value; |
|
|
|
|
x.value = 0; |
|
|
|
|
y.value = 200; |
|
|
|
|
}; |
|
|
|
|
// 提交 |
|
|
|
|
let submit = async () => { |
|
|
|
|
if (!submiting.value) { |
|
|
|
@ -597,37 +605,42 @@ let confirmSubmit = () => { |
|
|
|
|
|
|
|
|
|
// 获取项目详情 |
|
|
|
|
let getProDetail = async () => { |
|
|
|
|
const res = await getProjectDetail({ |
|
|
|
|
projectId: param.projectId, |
|
|
|
|
stuAssessent: 1, |
|
|
|
|
}); |
|
|
|
|
const pointsList = res.projectJudgmentVos; |
|
|
|
|
const project = res.projectManage; |
|
|
|
|
Cookies.set('sand-projectId', param.projectId); |
|
|
|
|
// 考核/竞赛 |
|
|
|
|
if (per.value) { |
|
|
|
|
projectList.value = [ |
|
|
|
|
{ |
|
|
|
|
projectId: param.projectId, |
|
|
|
|
projectName: project.projectName, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
curReq.value = pointsList.map((e) => e.judgmentId); // 实验要求默认全部展开,通过judgmentId来选中item |
|
|
|
|
points.value = pointsList; |
|
|
|
|
taskList.value = isSubmit.value ? JSON.parse(localStorage.getItem('sand-taskList')) : pointsList; // 实验任务 |
|
|
|
|
grade.value = isSubmit.value ? Cookies.get('sand-score') : '00'; |
|
|
|
|
judgmentId.value = pointsList[0].judgmentId; // 默认取第一个判分点 |
|
|
|
|
pd.value = project; |
|
|
|
|
curSystemId.value = project.systemId; |
|
|
|
|
hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 0显示,1不显示,系统跟老师的禁用字段不一样 |
|
|
|
|
const isPrac = per.value === 0; // 是否是练习 |
|
|
|
|
text.value = isPrac ? '已用' : '剩余'; |
|
|
|
|
// 竞赛不需要 |
|
|
|
|
if (!param.competitionId && !isSubmit.value) { |
|
|
|
|
const now = await getNow(); |
|
|
|
|
countVal.value = (isPrac ? now - entryTime.value : new Date(param.stopTime).getTime() - now) / 1000; // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接取当前时间减去上次进来的时间做计时 |
|
|
|
|
startCount(); |
|
|
|
|
loading.value = true; |
|
|
|
|
try { |
|
|
|
|
const res = await getProjectDetail({ |
|
|
|
|
projectId: param.projectId, |
|
|
|
|
stuAssessent: 1, |
|
|
|
|
}); |
|
|
|
|
const pointsList = res.projectJudgmentVos; |
|
|
|
|
const project = res.projectManage; |
|
|
|
|
Cookies.set('sand-projectId', param.projectId); |
|
|
|
|
// 考核/竞赛 |
|
|
|
|
if (per.value) { |
|
|
|
|
projectList.value = [ |
|
|
|
|
{ |
|
|
|
|
projectId: param.projectId, |
|
|
|
|
projectName: project.projectName, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
curReq.value = pointsList.map((e) => e.judgmentId); // 实验要求默认全部展开,通过judgmentId来选中item |
|
|
|
|
points.value = pointsList; |
|
|
|
|
taskList.value = isSubmit.value ? JSON.parse(localStorage.getItem('sand-taskList')) : pointsList; // 实验任务 |
|
|
|
|
grade.value = isSubmit.value ? Cookies.get('sand-score') : '00'; |
|
|
|
|
judgmentId.value = pointsList[0].judgmentId; // 默认取第一个判分点 |
|
|
|
|
pd.value = project; |
|
|
|
|
curSystemId.value = project.systemId; |
|
|
|
|
hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 0显示,1不显示,系统跟老师的禁用字段不一样 |
|
|
|
|
const isPrac = per.value === 0; // 是否是练习 |
|
|
|
|
text.value = isPrac ? '已用' : '剩余'; |
|
|
|
|
// 竞赛不需要 |
|
|
|
|
if (!param.competitionId && !isSubmit.value) { |
|
|
|
|
const now = await getNow(); |
|
|
|
|
countVal.value = (isPrac ? now - entryTime.value : new Date(param.stopTime).getTime() - now) / 1000; // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接取当前时间减去上次进来的时间做计时 |
|
|
|
|
startCount(); |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
loading.value = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -722,6 +735,7 @@ onMounted(init); |
|
|
|
|
onUnmounted(() => { |
|
|
|
|
counter = null; |
|
|
|
|
submit = null; |
|
|
|
|
pannelToggle = null; |
|
|
|
|
setHeartbeatDetection = null; |
|
|
|
|
getProDetail = null; |
|
|
|
|
getCache = null; |
|
|
|
|