mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
任务抽屉样式修改
This commit is contained in:
@@ -207,22 +207,7 @@ import {createExamination,queryExaminationDetailById,updateExamination} from "@/
|
||||
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask"
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
console.log(
|
||||
`selectedRowKeys: ${selectedRowKeys}`,
|
||||
"selectedRows: ",
|
||||
selectedRows
|
||||
);
|
||||
},
|
||||
onSelect: (record, selected, selectedRows) => {
|
||||
console.log(record, selected, selectedRows);
|
||||
},
|
||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
||||
console.log(selected, selectedRows, changeRows);
|
||||
},
|
||||
});
|
||||
|
||||
export default {
|
||||
name: "AddTest",
|
||||
// components: {
|
||||
@@ -460,118 +445,51 @@ export default {
|
||||
}
|
||||
const updateTest = () => {
|
||||
state.addLoading = true;
|
||||
let obj = {
|
||||
"examinationDuration": formState.examinationDuration,
|
||||
"examinationEndTime": dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
"examinationExplain": formState.examinationExplain,
|
||||
"examinationId": props.edit?props.EditTestId : 0,
|
||||
"examinationLimit": formState.examinationLimit,
|
||||
"examinationName": formState.examinationName,
|
||||
"examinationPaperId": 0,
|
||||
"examinationPaperName": formState.choosedTest,
|
||||
"examinationStartTime": dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
|
||||
"passLine": formState.passLine,
|
||||
"questionArrangement": formState.questionArrangement,
|
||||
"scoringModel": formState.scoringModel,
|
||||
"showAnalysis": formState.showAnalysis,
|
||||
"showAnswers": formState.showAnswers,
|
||||
}
|
||||
if(props.edit) { // 编辑任务
|
||||
myUpdateExamination()
|
||||
updateExamination(obj)
|
||||
.then((res)=>{
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
}).catch(()=>{
|
||||
message.error(`编辑失败`)
|
||||
});
|
||||
}else { // 创建任务
|
||||
myCreateExamination()
|
||||
}
|
||||
createExamination(obj)
|
||||
.then((res)=>{
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
}).catch(()=>{
|
||||
message.error(`编辑失败`)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const myUpdateExamination = () => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
"examinationDuration": formState.examinationDuration,
|
||||
"examinationEndTime": dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
"examinationExplain": formState.examinationExplain,
|
||||
"examinationFlag": "",
|
||||
"examinationId": props.EditTestId,
|
||||
"examinationLimit": formState.examinationLimit,
|
||||
"examinationName": formState.examinationName,
|
||||
"examinationPaperId": 0,
|
||||
"examinationPaperName": formState.choosedTest,
|
||||
"examinationStartTime": dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
|
||||
"examinationTag": "",
|
||||
"passLine": formState.passLine,
|
||||
"questionArrangement": formState.questionArrangement,
|
||||
"scoringModel": formState.scoringModel,
|
||||
"showAnalysis": formState.showAnalysis,
|
||||
"showAnswers": formState.showAnswers,
|
||||
"updateTime": "",
|
||||
"updateUser": 0
|
||||
}
|
||||
updateExamination(obj).then((res)=>{
|
||||
console.log(res);
|
||||
// 如果是关卡页面进入 ---------------------------------
|
||||
if(props.isLevel) {
|
||||
myRouterEditTask(res.data.data.examinationId)
|
||||
}else {
|
||||
myProjectEditTask(res.data.data.examinationId)
|
||||
}
|
||||
}).catch(()=>{
|
||||
message.error(`编辑失败`)
|
||||
})
|
||||
|
||||
}
|
||||
const myCreateExamination = () => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
"examinationDuration": formState.examinationDuration,
|
||||
"examinationEndTime": dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
"examinationExplain": formState.examinationExplain,
|
||||
"examinationFlag": "",
|
||||
"examinationId": 0,
|
||||
"examinationLimit": formState.examinationLimit,
|
||||
"examinationName": formState.examinationName,
|
||||
"examinationPaperId": 0,
|
||||
"examinationPaperName": formState.choosedTest,
|
||||
"examinationStartTime": dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
|
||||
"examinationTag": "",
|
||||
"passLine": formState.passLine,
|
||||
"questionArrangement": formState.questionArrangement,
|
||||
"scoringModel": formState.scoringModel,
|
||||
"showAnalysis": formState.showAnalysis,
|
||||
"showAnswers": formState.showAnswers,
|
||||
"updateTime": "",
|
||||
"updateUser": 0
|
||||
}
|
||||
createExamination(obj).then((res)=>{
|
||||
if(props.isLevel) {
|
||||
myRouterEditTask(res.data.data.examinationId)
|
||||
}else {
|
||||
myProjectEditTask(res.data.data.examinationId)
|
||||
}
|
||||
}).catch((err)=>{
|
||||
message.error(`添加失败${err}`)
|
||||
})
|
||||
}
|
||||
const myProjectEditTask = (testId) => {
|
||||
let editObj = {
|
||||
"courseId": testId,
|
||||
"duration": 50,
|
||||
"flag": true,
|
||||
"name": formState.examinationName,
|
||||
"projectId": props.projectId,
|
||||
"projectTaskId": props.projectTaskId || null,
|
||||
"stageId": props.chooseStageId,
|
||||
"type": 5
|
||||
}
|
||||
// 新增编辑或新增项目
|
||||
ProjectEditTask(editObj).then(res => {
|
||||
console.log(` 编辑项目成功的打印 ${res}`);
|
||||
message.success(`${props.EditTestId? '编辑' : '新增'}阶段任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
closeDrawer();
|
||||
}).catch(err => {
|
||||
message.error(`${props.EditTestId? '编辑' : '新增'}阶段任务失败`)
|
||||
console.log(` 编辑项目失败的打印 ${err}`);
|
||||
})
|
||||
}
|
||||
|
||||
const myRouterEditTask = (testId) => {
|
||||
let editObj1 = {
|
||||
const updateTask = (res) => {
|
||||
if(props.isLevel){
|
||||
let editObj1 = {
|
||||
"chapterId": props.isactive,
|
||||
"courseId": testId,
|
||||
"duration": 30,
|
||||
"flag": true,
|
||||
"name": formState.examinationName,
|
||||
"courseId": res.data.data.examinationId,
|
||||
"name": res.data.data.examinationName,
|
||||
"routerId": props.routerId,
|
||||
"routerTaskId": props.routerTaskId || 0,
|
||||
"type": 5
|
||||
}
|
||||
|
||||
RouterEditTask(editObj1).then(res => {
|
||||
console.log(` 编辑关卡成功的打印 ${res}`);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
@@ -581,7 +499,26 @@ export default {
|
||||
}).catch(err => {
|
||||
message.error(`${props.edit ? '编辑' : '新增'}关卡任务失败`)
|
||||
console.log(` 编辑关卡失败的打印 ${err}`);
|
||||
})
|
||||
});
|
||||
}else{
|
||||
let editObj = {
|
||||
"courseId": res.data.data.examinationId,
|
||||
"duration": 0,
|
||||
"name": res.data.data.examinationName,
|
||||
"projectId": props.projectId,
|
||||
"projectTaskId": props.projectTaskId || 0,
|
||||
"stageId": props.chooseStageId,
|
||||
"type": 5
|
||||
}
|
||||
// 新增编辑或新增项目
|
||||
ProjectEditTask(editObj).then(() => {
|
||||
message.success(`${props.EditTestId? '编辑' : '新增'}阶段任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
}).catch(() => {
|
||||
message.error(`${props.EditTestId? '编辑' : '新增'}阶段任务失败`)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const cloradio1 = (value) => {
|
||||
@@ -608,7 +545,6 @@ export default {
|
||||
formState,
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
rowSelection,
|
||||
cloradio1,
|
||||
cloradio2,
|
||||
cloradio3,
|
||||
|
||||
Reference in New Issue
Block a user