diff --git a/src/api/indexTask.js b/src/api/indexTask.js index ec36f89c..7862f35b 100644 --- a/src/api/indexTask.js +++ b/src/api/indexTask.js @@ -19,3 +19,5 @@ export const IsExistenceProject = (obj) => http.post('/admin/project/queryTaskDo // 判断当前在线课是否已经添加到该模板库下 export const IsExistenceProjectTemplate = (obj) => http.post('/admin/project/template/queryTaskDoesItExistForTemplate',obj); +// 新建外部考试 +export const CreateExternalExam = (obj) => http.post('/external/exam/createExternalExam',obj); \ No newline at end of file diff --git a/src/components/drawers/ActiveAttendance.vue b/src/components/drawers/ActiveAttendance.vue index 7b780f05..63792181 100644 --- a/src/components/drawers/ActiveAttendance.vue +++ b/src/components/drawers/ActiveAttendance.vue @@ -382,6 +382,13 @@ export default { console.log("value", value, index); }; const closeDrawer = () => { + state.selectedRowKeys = []; + state.tableDataTotalLoading = true; + state.currentPage = 1; + state.name = null; + state.projectName2 = undefined; + state.tableDataTotal = -1; + state.tableDataTotal2 = 0; ctx.emit("update:AAvisible", false); }; @@ -462,6 +469,7 @@ export default { taskType: props.datasource.type, status: state.projectName, studentName: state.name, + signStatus: state.projectName2 }) .then((res) => { console.log(res); @@ -506,6 +514,7 @@ export default { taskType: props.datasource.type, status: state.projectName, studentName: state.name, + signStatus: state.projectName2 }) .then((res) => { console.log(res); @@ -899,7 +908,7 @@ export default { process.env.VUE_APP_BASE_API }/admin/student/exportTaskStudent?currentStageId=${ props.datasource.chapterId - }&type=2&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.routerTaskId}` + }&type=2&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.routerTaskId}&taskType=${props.datasource.type}` ); }else{ window.open( @@ -907,7 +916,7 @@ export default { process.env.VUE_APP_BASE_API }/admin/student/exportTaskStudent?currentStageId=${ props.datasource.stageId - }&type=1&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.projectTaskId}` + }&type=1&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.projectTaskId}&taskType=${props.datasource.type}` ); } diff --git a/src/components/drawers/AddTest.vue b/src/components/drawers/AddTest.vue index 6389e906..e1ee545c 100644 --- a/src/components/drawers/AddTest.vue +++ b/src/components/drawers/AddTest.vue @@ -303,7 +303,7 @@
@@ -335,7 +335,7 @@
{ - if (!state.test.examinationName) { - message.destroy(); - return message.warning("请输入考试名称"); - } - if (!state.paperId) { - message.destroy(); - return message.warning("请输入选择试卷"); - } - if (!state.test.chooseTime) { - message.destroy(); - return message.warning("请输入开始结束时间"); - } - if (!state.test.examinationDuration) { - message.destroy(); - return message.warning("请输入考试时长"); - } - if (!state.test.passLine) { - message.destroy(); - return message.warning("请输入及格线"); - } + if(state.isOuter==1){ + + if (!state.test.examinationName) { + message.destroy(); + return message.warning("请输入考试名称"); + } + if (!state.paperId) { + message.destroy(); + return message.warning("请输入选择试卷"); + } + if (!state.test.chooseTime) { + message.destroy(); + return message.warning("请输入开始结束时间"); + } + if (!state.test.examinationDuration) { + message.destroy(); + return message.warning("请输入考试时长"); + } + if (!state.test.passLine) { + message.destroy(); + return message.warning("请输入及格线"); + } + + state.addLoading = true; + console.log("test", state.test); + // state.test.examinationStartTime = toDate( + // new Date(state.test.chooseTime[0].$d).getTime() / 1000, + // "Y-M-D h:m" + // ); + // state.test.examinationEndTime =toDate( + // new Date(state.test.$slotschooseTime[1].$d).getTime() / 1000, + // "Y-M-D h:m" + // ); + (state.test.examinationStartTime = dayjs(state.test.chooseTime[0]).format( + "YYYY-MM-DD HH:mm" + )), + (state.test.examinationEndTime = dayjs(state.test.chooseTime[1]).format( + "YYYY-MM-DD HH:mm" + )), + (state.test.examinationPaperId = state.paperId); + //TODO缺少paperName字段 + state.test.examinationTestName = state.paperName; + //考试推送 + state.test.targetId = 0; + state.test.type = 0; + state.test.chapterId=0; + console.log("props.offCourseId",props.offCourseId); + if (props.faceLevel && props.offCourseId > 0) { + state.test.targetId = props.offCourseId; + state.test.type = 3; + }else{ + if(props.isLevel == 1){ + state.test.targetId = props.routerId; + state.test.chapterId = props.isactive; + state.test.type = 2; + + + } else if (props.isLevel == 2) { + state.test.targetId = props.projectId; + state.test.type = 1; + + } + } - state.addLoading = true; - console.log("test", state.test); - // state.test.examinationStartTime = toDate( - // new Date(state.test.chooseTime[0].$d).getTime() / 1000, - // "Y-M-D h:m" - // ); - // state.test.examinationEndTime =toDate( - // new Date(state.test.$slotschooseTime[1].$d).getTime() / 1000, - // "Y-M-D h:m" - // ); - (state.test.examinationStartTime = dayjs(state.test.chooseTime[0]).format( - "YYYY-MM-DD HH:mm" - )), - (state.test.examinationEndTime = dayjs(state.test.chooseTime[1]).format( - "YYYY-MM-DD HH:mm" - )), - (state.test.examinationPaperId = state.paperId); - //TODO缺少paperName字段 - state.test.examinationTestName = state.paperName; - //考试推送 - state.test.targetId = 0; - state.test.type = 0; - state.test.chapterId=0; - console.log("props.offCourseId",props.offCourseId); - if (props.faceLevel && props.offCourseId > 0) { - state.test.targetId = props.offCourseId; - state.test.type = 3; - }else{ - if(props.isLevel == 1){ - state.test.targetId = props.routerId; - state.test.chapterId = props.isactive; - state.test.type = 2; - } else if (props.isLevel == 2) { - state.test.targetId = props.projectId; - state.test.type = 1; - - } - } + // if (props.EditTestId > 0) { + // // 编辑任务 + // updateExamination(state.test) + // .then(async (res) => { + // await updateTask(res); + // // closeDrawer(); + // }) + // .catch(() => { + // message.destroy(); + // message.error(`编辑失败`); + // }); + // } else { + // 创建任务 + createExamination(state.test) + .then(async (res) => { + await updateTask(res); + // closeDrawer(); + }) + .catch(() => { + message.destroy(); + message.error(`创建失败`); + }); + // } + }else{ + // 创建外部考试 + console.log('我是点了外部考试') + if (!state.test1.externalName) { + message.destroy(); + message.warning("请输入考试名称"); + return + } + if (!state.test1.source) { + message.destroy(); + message.warning("请输入数据来源"); + return + } + //考试推送 + state.test1.targetId = 0; + state.test1.type = 0; + state.test1.chapterId=0; + console.log("props.offCourseId",props.offCourseId); + if (props.faceLevel && props.offCourseId > 0) { + state.test1.targetId = props.offCourseId; + state.test1.type = 3; + }else{ + if(props.isLevel == 1){ + state.test1.targetId = props.routerId; + state.test1.chapterId = props.isactive; + state.test1.type = 2; + } else if (props.isLevel == 2) { + state.test1.targetId = props.projectId; + state.test1.type = 1; - // if (props.EditTestId > 0) { - // // 编辑任务 - // updateExamination(state.test) - // .then(async (res) => { - // await updateTask(res); - // // closeDrawer(); - // }) - // .catch(() => { - // message.destroy(); - // message.error(`编辑失败`); - // }); - // } else { - // 创建任务 - createExamination(state.test) - .then(async (res) => { - await updateTask(res); - // closeDrawer(); - }) - .catch(() => { - message.destroy(); - message.error(`创建失败`); - }); - // } + } + } + // 新建外部考试 + CreateExternalExam(state.test1).then( async res=>{ + console.log(res) + // 添加更新到任务 + await updateTask1(res); + }).catch(err=>{ + console.log(err) + }) + } }; + // 系统考试 const updateTask = (res) => { state.EditTestId = res.data.data.examinationId; if (props.faceLevel) { @@ -734,6 +773,81 @@ export default { } } }; + // 外部考试 + const updateTask1 = (res) => { + state.EditTestId = res.data.data.externalId; + if (props.faceLevel) { + state.EditTestId = res.data.data.externalId; + state.paperName = ""; + closeDrawer(); + } else { + if (props.isLevel == 1) { + if (!props.isactive) { + message.destroy(); + return message.warning("请先选中关卡"); + } + let editObj1 = { + chapterId: props.isactive, + courseId: res.data.data.externalId, + name: res.data.data.externalName, + routerId: props.routerId, + routerTaskId: props.routerTaskId || 0, + type: 5, + }; + RouterEditTask(editObj1) + .then(() => { + console.log("props.edit", props.edit); + message.success(`${props.edit ? "编辑" : "新增"}任务成功`); + ctx.emit("changeData", false); + state.paperName = ""; + closeDrawer(); + }) + .catch(() => { + //message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`); + }); + } else if (props.isLevel == 2) { + let editObj = { + courseId: res.data.data.externalId, + name: res.data.data.externalName, + projectId: props.projectId, + projectTaskId: props.projectTaskId || 0, + stageId: props.chooseStageId || 0, + type: 5, + }; + // 新增编辑或新增项目 + ProjectEditTask(editObj) + .then(() => { + message.success(`${props.edit ? "编辑" : "新增"}任务成功`); + ctx.emit("changeData", false); + state.paperName = ""; + closeDrawer(); + }) + .catch(() => { + //message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`); + }); + } else if (props.isLevel == 3) { + addTempTask({ + courseId: res.data.data.externalId, + name: res.data.data.externalName, + projectTemplateId: props.projectTemplateId, + projectTaskId: props.projectTaskId || 0, + stageId: props.chooseStageId || 0, + type: 5, + }) + .then(() => { + message.success(`${props.edit ? "编辑" : "新增"}任务成功`); + ctx.emit("changeData", false); + state.paperName = ""; + closeDrawer(); + }) + .catch(() => { + //message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`); + }); + } + } + }; + + const cloradio1 = (value) => { if (value != "") { state.showAnswers = ""; diff --git a/src/components/student/CommonStudent.vue b/src/components/student/CommonStudent.vue index 35fbf5c7..a908f3d8 100644 --- a/src/components/student/CommonStudent.vue +++ b/src/components/student/CommonStudent.vue @@ -11,7 +11,7 @@
- {{ {1: "添加学员", 2: "添加学员", 3: "添加学员",4: "查看权",5: "管理权"}[type] || "" }} + {{ {1: "添加学员", 2: "添加学员", 3: "添加学员",4: "查看权",5: "管理权"}[type] || title }}
- +
@@ -146,7 +146,7 @@
- +
@@ -174,7 +174,7 @@
已选
-
-
快速选人
-
-
-
- {{ item.realName }} -
-
-
-
-
+
+
+
快速选人
+
+
{{ item.realName }}
-
-
-
-
查看更多>
-
-
-
收起<
-
-
添加组织
-
-
-
-
{{ item.name }}
-
+
+
+
+ {{ item.realName }} +
+
+
-
-
+
+
查看更多>
+
+
+
收起<
+
+
+
+
添加组织
+
+
{{ item.name }}
- -
- -
-
-
查看更多>
-
-
-
收起<
-
- -
受众关联
-
-
-
-
{{ item.audienceName }}
-
-
-
-
-
-
-
{{ item.audienceName }}
-
+
+
+
+
{{ item.name }}
+
+
+
+
查看更多>
+
+
+
收起<
+
-
-
查看更多>
-
-
-
收起<
-
+ +
+
受众关联
+
+
+
+
{{ item.audienceName }}
+
+
+
+
+
+
+
{{ item.audienceName }}
+
+
+
+
+
+
+
查看更多>
+
+
+
收起<
+
+
-
@@ -419,6 +387,22 @@ const emit = defineEmits({}); const props = defineProps({ type: Number, id: String, + title: { + type: String, + default: '', + }, + clear: { + type: Boolean, + default: false, + }, + selectStu: { + type: Boolean, + default: false, + }, + selectOne: { + type: Boolean, + default: false, + }, stage: { type: Array, default: () => [], @@ -577,6 +561,7 @@ const auditSelectKeys = ref([]); const screenHeight = ref(document.body.clientHeight); //const screenWidth = ref(document.body.clientWidth); const stuRowSelection = computed(() => ({ + type:props.selectOne?'radio':'checkbox', columnWidth: 20, selectedRowKeys: stuSelectKeys.value, onChange: onStuSelectChange, @@ -764,6 +749,7 @@ function handleStageOk() { saveStu({ targetId: props.id, type: props.type, + clear:props.clear, deptIds: selectsData.value.deptList?.map((e) => e.id), stageId: selectsData.value.stageId, groupIds: selectsData.value.groupList?.map((e) => e.id), diff --git a/src/components/student/OwnerTableModelStudent.vue b/src/components/student/OwnerTableModelStudent.vue new file mode 100644 index 00000000..ae453810 --- /dev/null +++ b/src/components/student/OwnerTableModelStudent.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/components/student/TableModelStudent.vue b/src/components/student/TableModelStudent.vue index 5749e8f7..e47a8e46 100644 --- a/src/components/student/TableModelStudent.vue +++ b/src/components/student/TableModelStudent.vue @@ -1,51 +1,61 @@