yujialong 1 year ago
parent 06a6fae1a8
commit 659da1c8dc
  1. 1
      src/api/bank.ts
  2. 2
      src/api/judgment.ts
  3. 317
      src/components/Panel/index.vue
  4. 2
      src/layout/index.vue
  5. 3
      src/views/product/bank/Add.vue
  6. 3
      src/views/product/bank/Approve.vue
  7. 2
      src/views/product/bank/CardList.vue
  8. 3
      src/views/product/bank/Config.vue
  9. 1
      src/views/product/strategy/150.vue
  10. 1
      src/views/product/strategy/151.vue

@ -20,3 +20,4 @@ export const examineAndApprove = async (id: number | string, opinionDescription:
export const update = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/product/bank/products/update`, data)).data;
export const cancelCollection = async (id: number): Promise<any> => (await axios.post(`/product/checkPointCollect/cancelCollection?favoriteId=${id}`)).data;
export const collect = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/checkPointCollect/collect`, data)).data;
export const submitOpe = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/product/bank/operation/submit`, data)).data;

@ -6,3 +6,5 @@ export const getProcessInformationBasedOnRoles = async (id: number): Promise<any
(await axios.post(`/judgment/judgment/stRecord/getProcessInformationBasedOnRoles?systemId=19&parentId=${id}`)).data;
export const addOperation = async (data: Record<string, any>): Promise<any> => (await axios.post('/product/product/bank/operation/addOperation', data)).data;
export const checkPointList = async (projectId: number): Promise<any> => (await axios.post(`/judgment/judgment/stRecord/checkPointList?projectId=${projectId}`)).data;
export const deleteCache = async (projectId: number, checkpoint: number): Promise<any> =>
(await axios.get(`/product/product/bank/operation/deleteCache?projectId=${projectId}&checkpoint=${checkpoint}`)).data;

@ -47,7 +47,7 @@
v-show="per == 0">重新开始</el-button>
<el-button type="primary"
class="submit btn"
@click="confirmSubmit"
@click="submit"
:disabled="isSubmit || !projectList.length">提交</el-button>
</div>
</div>
@ -101,13 +101,21 @@
width="60"
align="center">
<template v-slot="scope">
<template v-if="isSubmit">
<template v-if="!param.competitionId">
<i v-if="scope.row.finishedResult"
class="el-icon-check right"></i>
<i v-else
class="el-icon-close wrong"></i>
</template>
<div v-if="!param.competitionId"
class="flex items-center">
<el-icon v-if="scope.row.finishedResult"
color="#15d500"
:size="16">
<Check />
</el-icon>
<el-icon v-else
color="#f00"
:size="16">
<Close />
</el-icon>
</div>
<template v-else>-</template>
</template>
</template>
@ -201,14 +209,16 @@
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, toRefs } from 'vue';
import { submitOpe } from '@/api/bank';
import { deleteCache } from '@/api/judgment';
import { pageStuAssessment, getProjectBySystemId, getProjectDetail, getDetailById, getCompetition } from '@/api/system';
import { useRouter, useRoute } from 'vue-router';
import type { Action } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { Close, Check } from '@element-plus/icons-vue';
import dayjs from 'dayjs';
import Cookies from 'js-cookie';
import { mavonEditor } from 'mavon-editor';
import util from '@/libs/util';
import Setting from '@/setting';
import 'mavon-editor/dist/css/index.css';
const router = useRouter();
@ -253,6 +263,10 @@ if (param.token) {
param.mallId && Cookies.set('sand-mallId', param.mallId);
param.endTime && Cookies.set('sand-referrer', param.endTime);
param.referrer && Cookies.set('sand-referrer', param.referrer);
param.className && Cookies.set('sand-referrer', param.className);
param.startTime && Cookies.set('sand-referrer', param.startTime);
param.resultsDetails && Cookies.set('sand-referrer', param.resultsDetails);
param.resultAnnouncementTime && Cookies.set('sand-referrer', param.resultAnnouncementTime);
} else {
param.systemId = Cookies.get('sand-systemId');
param.projectId = Cookies.get('sand-projectId');
@ -264,6 +278,10 @@ if (param.token) {
param.teamId = Cookies.get('sand-teamId');
param.mallId = Cookies.get('sand-mallId');
param.endTime = Cookies.get('sand-endTime');
param.className = Cookies.get('sand-className');
param.startTime = Cookies.get('sand-startTime');
param.resultsDetails = Cookies.get('sand-resultsDetails');
param.resultAnnouncementTime = Cookies.get('sand-resultAnnouncementTime');
}
if (param.projectId) param.projectId = +param.projectId;
onMounted(() => {
@ -281,58 +299,37 @@ onMounted(() => {
}
});
//
const getList = async () => {
const data = {
systemId: param.systemId,
cId: param.cid ?? '',
mallId: param.mallId,
permissions: per.value,
//
const timeFormat = (num: number): string | number => {
return num < 10 ? `0${num}` : num;
};
const { projects } = await getProjectBySystemId(data);
projectList.value = projects;
if (!per.value && !param.projectId) param.projectId = projects[0]?.projectId ?? 0; //
getProDetail();
//
const reloadCount = () => {
clearInterval(counterTimer.value);
countVal.value = '';
day.value = '00';
seconds.value = '00';
minutes.value = '00';
hour.value = '00';
};
//
const counter = (counterTime: number) => {
const leave1 = counterTime % (24 * 3600); //
const leave2 = leave1 % 3600; //
const leave3 = leave2 % 60; //
//
const getProDetail = async () => {
const res = await getProjectDetail({
projectId: param.projectId,
stuAssessent: 1,
});
const points = res.projectJudgmentVos;
const project = res.projectManage;
// /
if (per.value) {
projectList.value = [
{
projectId: param.projectId,
projectName: project.projectName,
},
];
}
curReq.value = points.map((e) => e.judgmentId); // judgmentIditem
points.value = points;
taskList.value = points; //
judgmentId.value = points[0].judgmentId; //
pd.value = project;
hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 01
const isPrac = per.value === 0; //
text.value = isPrac ? '已用' : '剩余';
//
if (!param.competitionId) {
countVal.value = isPrac ? 0 : (new Date(param.endTime).getTime() - Date.now()) / 1000; // 0
startCount();
}
day.value = timeFormat(Math.floor(counterTime / (24 * 3600)));
hour.value = timeFormat(Math.floor(leave1 / 3600));
minutes.value = timeFormat(Math.floor(leave2 / 60));
seconds.value = timeFormat(Math.round(leave3));
};
//
const startCount = () => {
clearInterval(counterTimer.value);
counterTimer.value = setInterval(() => {
counter(per.value ? countVal.value-- : countVal.value++);
}, 1000);
};
// isSubmit
// setSubmit(status) {
// this.isSubmit = status;
// newmain.$emit('isSubmit', status);
// Cookies.set('admin-isSubmit', status);
// },
//
const getAssList = async () => {
const { list } = await pageStuAssessment({
@ -402,131 +399,131 @@ const selectProject = () => {
countVal.value = 0;
grade.value = '00';
pannelTab.value = 'first';
clearReport();
};
//
const reload = () => {
const reload = async () => {
await deleteCache(param.projectId, Cookies.get('sand-level') ?? '');
reloadCount();
grade.value = '00';
// this.setSubmit(false);
startCount();
};
//
const submit = () => {
const submit = async () => {
if (isSubmit.value) return false;
ElMessageBox.confirm('此操作将视为结束考试,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {})
.catch(() => {});
.then(async () => {
const date = new Date();
const timeSum = Math.ceil((date.getTime() - entryTime.value.getTime()) / 60000); //
const submitTime = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
reloadCount();
const { retMap } = await submitOpe({
classId: param.classId ? param.classId : '',
className: param.className ? param.className : '',
curriculumId: param.cid,
startTime: per.value ? param.startTime : dayjs(entryTime.value).format('YYYY-MM-DD HH:mm:ss'), //
endTime: per.value ? param.endTime : submitTime, //
submitTime, // 3
timeSum,
checkpointId: Cookies.get('sand-level') ?? '',
projectId: param.projectId,
lcId: curReq.value,
assessmentId: param.assessmentId,
systemId: curSystemId.value,
purpose: pd.value.experimentTarget, //
competitionId: param.competitionId,
stageId: param.stageId,
teamId: param.teamId,
mallId: param.mallId,
});
isSubmit.value = true;
clearInterval(statusTimer.value);
// if (isSubmit.value) return false;
// const date = new Date();
// const timeSum = Math.ceil((date.getTime() - entryTime.getTime()) / 60000); //
// const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date);
// const { projectId } = this;
// const pro = this.projectList.find((e) => e.projectId == projectId);
// const projectName = pro ? pro.projectName : ''; //
// this.reloadCount();
// //
// const attributesReqList = [];
// pointList.map((e) => {
// attributesReqList.push({
// codeId: e.codeId,
// bcId: e.judgmentId,
// isSubmit: e.codeId ? 1 : 0,
// answer: e.answer,
// retResult: e.retResult,
// });
// });
// const data = {
// classId: this.classId ? this.classId : '',
// className: this.className ? this.className : '',
// curriculumId: this.cid,
// startTime: this.per ? this.startTime : util.formatDate('yyyy-MM-dd hh:mm:ss', entryTime), //
// endTime: this.per ? this.endTime : submitTime, //
// submitTime, // 3
// timeSum,
// projectId,
// projectName,
// assessmentId: this.assessmentId ? this.assessmentId : '',
// totalScore: 100, // 100
// systemId: this.curSystemId,
// purpose: this.pd.experimentTarget, //
// attributesReqList,
// competitionId: this.competitionId,
// stageId: this.stageId,
// teamId: this.teamId,
// mallId: this.mallId,
// };
// this.$post(this.api.submit, data)
// .then(({ retInfo, reportId }) => {
// localStorage.removeItem('codeCache');
// this.setSubmit(true);
// clearInterval(this.statusTimer);
// this.reportVisible = false;
// const list = retInfo;
// const { taskList } = this;
// let score = 0;
// //
// taskList.map((e) => {
// const item = list.find((n) => n.judgmentPointsId === e.judgmentId);
// if (item) {
// e.examScore = item.score;
// e.finishedResult = item.finishedResult; // 12
// } else {
// e.examScore = 0;
// }
// score += e.examScore; //
// });
// this.grade = util.handleZero(score); // 0()
// this.reportId = reportId;
let score = 0;
//
taskList.value.map((e) => {
const item = retMap?.scoreInfo.find((n) => n.lcId === e.judgmentId);
if (item) {
e.examScore = item.questionScore;
e.finishedResult = item.calculate; // 12
score += item.questionScore; //
} else {
e.examScore = 0;
}
});
grade.value = score < 10 ? '0' + score : score;
reportId.value = retMap.reportId;
// this.$store.commit('setReportId', reportId);
// this.$store.commit('setTaskList', taskList);
// this.editReport(reportId);
// //
// this.competitionId &&
// this.resultsDetails == 0 &&
// this.$alert(`${this.resultAnnouncementTime != 0 ? `${this.resultAnnouncementTime}` : ''}`, '', {
//
// param.competitionId &&
// param.resultsDetails == 0 &&
// ElMessageBox.alert(`${param.resultAnnouncementTime != 0 ? `${param.resultAnnouncementTime}`, '', {
// // if you want to disable its autofocus
// // autofocus: false,
// confirmButtonText: '',
// callback: (action) => {
// this.$parent.back();
// callback: (action: Action) => {
// ElMessage({
// type: 'info',
// message: `action: ${action}`,
// })
// },
// });
// })
// .catch((err) => {});
};
//
const timeFormat = (num: number): string | number => {
return num < 10 ? `0${num}` : num;
})
.catch(() => {});
};
//
const reloadCount = () => {
clearInterval(counterTimer.value);
countVal.value = '';
day.value = '00';
seconds.value = '00';
minutes.value = '00';
hour.value = '00';
//
const getProDetail = async () => {
const res = await getProjectDetail({
projectId: param.projectId,
stuAssessent: 1,
});
const pointsList = res.projectJudgmentVos;
const project = res.projectManage;
// /
if (per.value) {
projectList.value = [
{
projectId: param.projectId,
projectName: project.projectName,
},
];
}
curReq.value = pointsList.map((e) => e.judgmentId); // judgmentIditem
points.value = pointsList;
taskList.value = pointsList; //
judgmentId.value = pointsList[0].judgmentId; //
pd.value = project;
curSystemId.value = project.systemId;
hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 01
const isPrac = per.value === 0; //
text.value = isPrac ? '已用' : '剩余';
//
if (!param.competitionId) {
countVal.value = isPrac ? 0 : (new Date(param.endTime).getTime() - Date.now()) / 1000; // 0
startCount();
}
};
//
const counter = (counterTime: number) => {
const leave1 = counterTime % (24 * 3600); //
const leave2 = leave1 % 3600; //
const leave3 = leave2 % 60; //
day.value = timeFormat(Math.floor(counterTime / (24 * 3600)));
hour.value = timeFormat(Math.floor(leave1 / 3600));
minutes.value = timeFormat(Math.floor(leave2 / 60));
seconds.value = timeFormat(Math.round(leave3));
//
const getList = async () => {
const data = {
systemId: param.systemId,
cId: param.cid ?? '',
mallId: param.mallId,
permissions: per.value,
};
//
const startCount = () => {
clearInterval(counterTimer.value);
counterTimer.value = setInterval(() => {
counter(per.value ? countVal.value-- : countVal.value++);
}, 1000);
const { projects } = await getProjectBySystemId(data);
projectList.value = projects;
if (!per.value && !param.projectId) param.projectId = projects[0]?.projectId ?? 0; //
getProDetail();
};
</script>

@ -7,6 +7,7 @@
:class="{ 'md:ml-sidebar': !hideNav }">
<app-main />
</div>
<!-- <Panel /> -->
</div>
</template>
@ -16,6 +17,7 @@ import { useRoute } from 'vue-router';
import Setting from '@/settings';
import { AppSidebar, AppHeader, AppMain } from './components';
import useResizeHandler from './composables/useResizeHandler';
// import Panel from '@/components/Panel/index.vue';
export default defineComponent({
name: 'Layout',

@ -507,9 +507,10 @@ const addRecord = async (data: Record<string, any>) => {
data.whetherToSupportEarlyRepayment && lcRule.push(handleId(58, '', '', preIds + ',58', ''));
await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds,
lcJudgmentRuleReq: lcRule,
projectId: 1,
projectId: +Cookies.get('sand-projectId'),
});
};
onMounted(() => {

@ -116,9 +116,10 @@ const addRecord = async (data: Record<string, any>, newId: number) => {
const lcRule = <Record<string, any>[]>[handleId(145, 69, data.status, preIds + ',145', 1), handleId(146, 70, data.opinionDescription, preIds + ',146', 3)];
await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds,
lcJudgmentRuleReq: lcRule,
projectId: 1,
projectId: +Cookies.get('sand-projectId'),
});
};
onMounted(() => {

@ -39,7 +39,7 @@
</ul>
</div>
<div class="right flex-1 px-5 pt-2">
<component :is="defineAsyncComponent(() => import('./' + action + '.vue'))"
<component :is="defineAsyncComponent({loader: () => import('./' + action + '.vue')})"
@getList="getList"></component>
</div>
</div>

@ -622,9 +622,10 @@ const addRecord = async (data: Record<string, any>) => {
}
await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds,
lcJudgmentRuleReq: lcRule,
projectId: 1,
projectId: +Cookies.get('sand-projectId'),
});
};
</script>

@ -300,6 +300,7 @@ const addRecord = async (data: Record<string, any>) => {
});
await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,

@ -242,6 +242,7 @@ const addRecord = async (data: Record<string, any>) => {
});
await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,

Loading…
Cancel
Save