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

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

@ -507,9 +507,10 @@ const addRecord = async (data: Record<string, any>) => {
data.whetherToSupportEarlyRepayment && lcRule.push(handleId(58, '', '', preIds + ',58', '')); data.whetherToSupportEarlyRepayment && lcRule.push(handleId(58, '', '', preIds + ',58', ''));
await addOperation({ await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds, parentId: preIds,
lcJudgmentRuleReq: lcRule, lcJudgmentRuleReq: lcRule,
projectId: 1, projectId: +Cookies.get('sand-projectId'),
}); });
}; };
onMounted(() => { 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)]; const lcRule = <Record<string, any>[]>[handleId(145, 69, data.status, preIds + ',145', 1), handleId(146, 70, data.opinionDescription, preIds + ',146', 3)];
await addOperation({ await addOperation({
checkpointId: +Cookies.get('sand-level'),
parentId: preIds, parentId: preIds,
lcJudgmentRuleReq: lcRule, lcJudgmentRuleReq: lcRule,
projectId: 1, projectId: +Cookies.get('sand-projectId'),
}); });
}; };
onMounted(() => { onMounted(() => {

@ -39,7 +39,7 @@
</ul> </ul>
</div> </div>
<div class="right flex-1 px-5 pt-2"> <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> @getList="getList"></component>
</div> </div>
</div> </div>

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

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

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

Loading…
Cancel
Save