mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage
This commit is contained in:
@@ -1,85 +1,49 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="addhomeworkVisible"
|
||||
class="drawerStyle addhomeworkDrawer"
|
||||
width="80%"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<a-drawer :visible="addhomeworkVisible" class="drawerStyle addhomeworkDrawer" width="80%" placement="right"
|
||||
@after-visible-change="afterVisibleChange">
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{workId ? '编辑':'添加' }}作业</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
<div class="headerTitle">{{ EditWorkId ? '编辑' : '添加' }}作业</div>
|
||||
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer" />
|
||||
</div>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
name="custom-validation"
|
||||
:model="formState"
|
||||
:rules="rules"
|
||||
v-bind="layout"
|
||||
@finish="handleFinish"
|
||||
@validate="handleValidate"
|
||||
@finishFailed="handleFinishFailed"
|
||||
>
|
||||
<a-form ref="formRef" name="custom-validation" :model="formState" :rules="rules" v-bind="layout"
|
||||
@finish="handleFinish" @validate="handleValidate" @finishFailed="handleFinishFailed">
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="作业名称" name="workName">
|
||||
<a-input v-model:value="formState.workName"
|
||||
style="width: 424px; height: 32px;margin-left: 35px;"
|
||||
placeholder="请输入作业名称"
|
||||
autocomplete="off" />
|
||||
<a-input v-model:value="formState.workName" style="width: 424px; height: 32px;margin-left: 35px;"
|
||||
placeholder="请输入作业名称" autocomplete="off" />
|
||||
</a-form-item>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<a-form-item has-feedback label="作业要求" name="workRequirement">
|
||||
<a-textarea
|
||||
v-model:value="formState.workRequirement"
|
||||
placeholder="请输入作业要求"
|
||||
autocomplete="off"
|
||||
allow-clear
|
||||
style="margin-left: 35px"
|
||||
maxlength="150"
|
||||
/>
|
||||
<a-textarea v-model:value="formState.workRequirement" placeholder="请输入作业要求" autocomplete="off"
|
||||
allow-clear style="margin-left: 35px" maxlength="150" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="提交时间" name="choosedTime">
|
||||
<a-range-picker
|
||||
style="width: 424px;margin-left: 35px;"
|
||||
v-model:value="formState.choosedTime"
|
||||
format="YYYY-MM-DD"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
<a-range-picker style="width: 424px;margin-left: 35px;" v-model:value="formState.choosedTime"
|
||||
format="YYYY-MM-DD" :placeholder="[' 开始时间', ' 结束时间']" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/enclosure.png"
|
||||
alt=""
|
||||
/>
|
||||
<img src="@/assets/images/coursewareManage/enclosure.png" alt="" />
|
||||
</div>
|
||||
<span style="margin-right: 3px">附件:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-upload
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
action="/api/file/upload"
|
||||
@change="handleChange"
|
||||
>
|
||||
<a-upload v-model:file-list="fileList" name="file" action="/api/file/upload" @change="handleChange">
|
||||
<button class="xkbtn" type="button">上传附件</button>
|
||||
</a-upload>
|
||||
</div>
|
||||
@@ -135,18 +99,34 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
flag: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
edit: { // 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: {
|
||||
projectId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
default: null,
|
||||
},
|
||||
chooseStageId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerTaskId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
}
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
EditWorkId: { // 要编辑的workId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const formState = reactive({
|
||||
@@ -237,25 +217,32 @@ export default {
|
||||
fileList.value = [];
|
||||
formState.choosedTime = '';
|
||||
ctx.emit("update:addhomeworkVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
if(props.addhomeworkVisible && props.workId){
|
||||
queryWork({workId: props.workId})
|
||||
if (props.addhomeworkVisible && props.edit) { // 该页面显示同时 edit为true 时,发送查询请求,
|
||||
queryWork()
|
||||
}
|
||||
console.log("state", bool);
|
||||
};
|
||||
const queryWork = (data) => {
|
||||
queryWorkDetailById(data).then((res) => {
|
||||
console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD"));
|
||||
formState.workName = res.data.data.workName;
|
||||
formState.workRequirement = res.data.data.workRequirement;
|
||||
formState.choosedTime=[dayjs(res.data.data.submitStartTime,"YYYY-MM-DD"),dayjs(res.data.data.submitEndTime,"YYYY-MM-DD")]
|
||||
console.log(res);
|
||||
}).catch(() => {
|
||||
message.error(`查询失败`)
|
||||
})
|
||||
|
||||
const updateWork = () => {
|
||||
|
||||
// 如果是关卡页面进入 ---------------------------------
|
||||
if (props.isLevel) {
|
||||
myRouterEditTask()
|
||||
} else { // 任务页面进入------------------------------
|
||||
if (props.edit) { // 编辑任务
|
||||
myUpdateWorkTaskUsing()
|
||||
} else { // 创建任务
|
||||
console.log('创建任务***************');
|
||||
myCreateWorkTask()
|
||||
}
|
||||
}
|
||||
};
|
||||
const updateWork = (id) => {
|
||||
|
||||
// 新增任务
|
||||
const myCreateWorkTask = () => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
@@ -265,56 +252,88 @@ export default {
|
||||
"updateUser": 0,
|
||||
"workEnclosureAddress": "",
|
||||
"workFlag": "",
|
||||
"workId": id || 0,
|
||||
"workId": 0,
|
||||
"workName": formState.workName,
|
||||
"workRequirement": formState.workRequirement,
|
||||
"workTag": ""
|
||||
}
|
||||
if(id) {
|
||||
updateWorkTaskUsing(obj).then((res) => {
|
||||
console.log(res);
|
||||
}).catch((err) => {
|
||||
message.error(`编辑失败${err}`)
|
||||
})
|
||||
} else {
|
||||
createWorkTask(obj).then((res) => {
|
||||
console.log(res);
|
||||
myProjectEditTask(res.data.data.workId);
|
||||
}).catch((err) => {
|
||||
message.error(`添加失败${err}`)
|
||||
})
|
||||
}
|
||||
if(props.flag == 1) {
|
||||
// 编辑任务
|
||||
const myUpdateWorkTaskUsing = () => {
|
||||
let editObj = {
|
||||
"courseId": 0,
|
||||
"duration": 0,
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
"submitEndTime": dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
"submitStartTime": dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
|
||||
"updateTime": "",
|
||||
"updateUser": 0,
|
||||
"workEnclosureAddress": "",
|
||||
"workFlag": "",
|
||||
"workId": props.EditWorkId,
|
||||
"workName": formState.workName,
|
||||
"workRequirement": formState.workRequirement,
|
||||
"workTag": ""
|
||||
}
|
||||
updateWorkTaskUsing(editObj).then((res) => {
|
||||
console.log(res);
|
||||
myProjectEditTask(res.data.data.workId)
|
||||
}).catch((err) => {
|
||||
message.error(`编辑失败${err}`)
|
||||
})
|
||||
}
|
||||
// 查询任务
|
||||
const queryWork = () => {
|
||||
queryWorkDetailById({workId:props.EditWorkId}).then((res) => {
|
||||
console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD"));
|
||||
formState.workName = res.data.data.workName;
|
||||
formState.workRequirement = res.data.data.workRequirement;
|
||||
formState.choosedTime = [dayjs(res.data.data.submitStartTime, "YYYY-MM-DD"), dayjs(res.data.data.submitEndTime, "YYYY-MM-DD")]
|
||||
console.log(res);
|
||||
}).catch(() => {
|
||||
message.error(`查询失败`)
|
||||
})
|
||||
};
|
||||
// 新增编辑或新增项目任务
|
||||
const myProjectEditTask = (workId) => {
|
||||
let editObj = {
|
||||
"courseId": workId,
|
||||
"duration": 60,
|
||||
"flag": true,
|
||||
"name": formState.workName,
|
||||
"projectId": 0,
|
||||
"projectTaskId": props.workId || '',
|
||||
"stageId": 0,
|
||||
"projectId": props.projectId,
|
||||
"projectTaskId": props.projectTaskId || null,
|
||||
"stageId": props.chooseStageId,
|
||||
"type": 4
|
||||
}
|
||||
// 新增编辑或新增项目任务
|
||||
ProjectEditTask(editObj).then(res => {
|
||||
console.log(` 编辑项目成功的打印 ${res}`);
|
||||
message.success(`${props.workId? '编辑' : '新增'}阶段任务成功`)
|
||||
message.success(`${props.edit ? '编辑' : '新增'}阶段任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
}).catch(err => {
|
||||
message.error(`${props.workId? '编辑' : '新增'}阶段任务失败`)
|
||||
message.error(`${props.edit ? '编辑' : '新增'}阶段任务失败`)
|
||||
console.log(` 编辑项目失败的打印 ${err}`);
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
// 新增编辑或新增关卡任务
|
||||
const myRouterEditTask = () => {
|
||||
let editObj1 = {
|
||||
"chapterId":36,
|
||||
"chapterId": 70,
|
||||
"courseId": 0,
|
||||
"duration": 0,
|
||||
"flag": true,
|
||||
"name": formState.workName,
|
||||
"routerId": Number(storage.get('routerId')),
|
||||
"routerTaskId": '',
|
||||
"routerTaskId": 0,
|
||||
"type": 4
|
||||
}
|
||||
// 新增编辑或新增关卡任务
|
||||
|
||||
RouterEditTask(editObj1).then(res => {
|
||||
console.log(` 编辑关卡成功的打印 ${res}`);
|
||||
message.success(`${props.workId ? '编辑' : '新增'}关卡任务成功`)
|
||||
@@ -325,9 +344,6 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
return {
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
@@ -342,7 +358,6 @@ export default {
|
||||
formRef,
|
||||
// layout,
|
||||
rules,
|
||||
queryWork,
|
||||
updateWork,
|
||||
state,
|
||||
};
|
||||
@@ -353,6 +368,7 @@ export default {
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addhomeworkDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
@@ -362,6 +378,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
@@ -370,30 +387,37 @@ export default {
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
@@ -406,28 +430,34 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.kqszbox {
|
||||
.qdqtbox {
|
||||
margin-left: 56px;
|
||||
}
|
||||
|
||||
.setbox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
.timerbox {
|
||||
margin-top: 6px;
|
||||
margin-right: 32px;
|
||||
@@ -437,10 +467,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
@@ -457,6 +489,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
position: absolute;
|
||||
height: 72px;
|
||||
@@ -467,6 +500,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
@@ -476,6 +510,7 @@ export default {
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{examinationId ? "编辑" : "添加" }}考试</div>
|
||||
<div class="headerTitle">{{EditTestId ? "编辑" : "添加" }}考试</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -228,10 +228,34 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
examinationId: {
|
||||
EditTestId: { // 要编辑的考试id
|
||||
type: Number,
|
||||
default: -1,
|
||||
}
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
chooseStageId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerTaskId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { //
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const formState = reactive({
|
||||
@@ -368,7 +392,7 @@ export default {
|
||||
])
|
||||
const handleFinish = values => {
|
||||
console.log(values);
|
||||
updateTest(props.examinationId)
|
||||
updateTest();
|
||||
};
|
||||
|
||||
const handleFinishFailed = errors => {
|
||||
@@ -387,9 +411,18 @@ export default {
|
||||
resetForm();
|
||||
formState.choosedTime = '';
|
||||
ctx.emit("update:addtestVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
};
|
||||
const queryTest = (data) => {
|
||||
queryExaminationDetailById(data).then((res) => {
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log(props.edit);
|
||||
if (props.addtestVisible && props.edit) { // 该页面显示同时 edit为true 时,发送查询请求,
|
||||
queryTest()
|
||||
}
|
||||
console.log("formState", bool);
|
||||
};
|
||||
const queryTest = () => {
|
||||
console.log(props.EditTestId);
|
||||
queryExaminationDetailById({examinationId:props.EditTestId}).then((res) => {
|
||||
formState.examinationName = res.data.data.examinationName;
|
||||
formState.workRequirement = res.data.data.workRequirement;
|
||||
formState.examinationDuration = res.data.data.examinationDuration;
|
||||
@@ -408,7 +441,23 @@ export default {
|
||||
message.error(`查询失败`)
|
||||
})
|
||||
}
|
||||
const updateTest = (id) => {
|
||||
const updateTest = () => {
|
||||
|
||||
// 如果是关卡页面进入 ---------------------------------
|
||||
if (props.isLevel) {
|
||||
//.
|
||||
} else { // 从任务界面进入
|
||||
if(props.edit) { // 编辑任务
|
||||
myUpdateExamination()
|
||||
}else { // 创建任务
|
||||
myCreateExamination()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const myUpdateExamination = () => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
@@ -416,7 +465,7 @@ export default {
|
||||
"examinationEndTime": dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
"examinationExplain": formState.examinationExplain,
|
||||
"examinationFlag": "",
|
||||
"examinationId": id || 0,
|
||||
"examinationId": props.EditTestId,
|
||||
"examinationLimit": formState.examinationLimit,
|
||||
"examinationName": formState.examinationName,
|
||||
"examinationPaperId": 0,
|
||||
@@ -431,48 +480,66 @@ export default {
|
||||
"updateTime": "",
|
||||
"updateUser": 0
|
||||
}
|
||||
if(id) {
|
||||
updateExamination(obj).then((res)=>{
|
||||
console.log(res);
|
||||
myProjectEditTask(res.data.data.examinationId)
|
||||
}).catch(()=>{
|
||||
message.error(`编辑失败`)
|
||||
})
|
||||
} else {
|
||||
createExamination(obj).then(()=>{
|
||||
|
||||
}
|
||||
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)=>{
|
||||
myProjectEditTask(res.data.data.examinationId)
|
||||
}).catch((err)=>{
|
||||
message.error(`添加失败${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const myProjectEditTask = (testId) => {
|
||||
let editObj = {
|
||||
"courseId": 0,
|
||||
"duration": 0,
|
||||
"courseId": testId,
|
||||
"duration": 50,
|
||||
"flag": true,
|
||||
"name": "",
|
||||
"projectId": 0,
|
||||
"projectTaskId": props.examinationId || '',
|
||||
"stageId": 0,
|
||||
"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.examinationId? '编辑' : '新增'}阶段任务成功`)
|
||||
message.success(`${props.EditTestId? '编辑' : '新增'}阶段任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
}).catch(err => {
|
||||
message.error(`${props.examinationId? '编辑' : '新增'}阶段任务失败`)
|
||||
message.error(`${props.EditTestId? '编辑' : '新增'}阶段任务失败`)
|
||||
console.log(` 编辑项目失败的打印 ${err}`);
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("formState", bool);
|
||||
if(props.addtestVisible && props.examinationId){
|
||||
queryTest({examinationId: props.examinationId})
|
||||
}
|
||||
};
|
||||
|
||||
const cloradio1 = (value) => {
|
||||
if (value != "") {
|
||||
formState.showAnswers = "";
|
||||
|
||||
@@ -139,7 +139,16 @@
|
||||
</div>
|
||||
<!-- 添加作业侧弹窗 -->
|
||||
<div>
|
||||
<add-homework v-model:addhomeworkVisible="addhomeworkvisible" />
|
||||
<add-homework
|
||||
v-model:addhomeworkVisible="addhomeworkvisible"
|
||||
@changeData="updateTableData"
|
||||
:isLevel=false
|
||||
v-model:edit="edit"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:EditWorkId="EditWorkId"
|
||||
v-model:projectTaskId="projectTaskId"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加作业侧弹窗 -->
|
||||
<div class="lin"></div>
|
||||
@@ -153,7 +162,16 @@
|
||||
</div>
|
||||
<!-- 添加考试侧弹窗 -->
|
||||
<div>
|
||||
<add-test v-model:addtestVisible="addtestvisible" />
|
||||
<add-test
|
||||
v-model:addtestVisible="addtestvisible"
|
||||
@changeData="updateTableData"
|
||||
:isLevel=false
|
||||
v-model:edit="edit"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:EditTestId="EditTestId"
|
||||
v-model:projectTaskId="projectTaskId"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加考试侧弹窗 -->
|
||||
<div class="lin"></div>
|
||||
@@ -500,7 +518,7 @@
|
||||
margin-right: 25px;
|
||||
cursor: pointer;
|
||||
"
|
||||
@click="decideType(element.lei, element.courseId)"
|
||||
@click="decideType(element.lei, element.courseId,element.id)"
|
||||
>
|
||||
编辑
|
||||
</span>
|
||||
@@ -782,8 +800,8 @@ import * as apistage from "../../api/indexStage";
|
||||
import * as apimove from "../../api/indexMovetask";
|
||||
import draggable from "vuedraggable";
|
||||
import { storage } from "../../api/storage";
|
||||
import { updateExamination, deleteExaminationById } from "@/api/indexExam";
|
||||
import { updateWorkTaskUsing, deleteWorkTask } from "@/api/indexWork";
|
||||
import { deleteExaminationById } from "@/api/indexExam";
|
||||
import { deleteWorkTask } from "@/api/indexWork";
|
||||
|
||||
const drawercolumns = [
|
||||
{
|
||||
@@ -853,7 +871,10 @@ export default {
|
||||
EditRefId: null, //要编辑的外链的id
|
||||
EditLiveId: null, //要编辑的直播的id
|
||||
editDiscussId:null,//要编辑的讨论的id
|
||||
EditWorkId:null, // 要编辑的作业id
|
||||
EditTestId: null,// 要编辑的考试id
|
||||
EditEvalId:null,
|
||||
projectTaskId:null, // 要编辑的具体任务id
|
||||
projectNameList: [
|
||||
{
|
||||
id: 1,
|
||||
@@ -1281,43 +1302,10 @@ export default {
|
||||
console.log("添加数据", data);
|
||||
getTask(data);
|
||||
};
|
||||
// 编辑考试
|
||||
const updateTest = (id) => {
|
||||
let obj = {
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
examinationDuration: "",
|
||||
examinationEndTime: "",
|
||||
examinationExplain: "",
|
||||
examinationFlag: "",
|
||||
examinationId: id || 0,
|
||||
examinationLimit: "",
|
||||
examinationName: "",
|
||||
examinationPaperId: 0,
|
||||
examinationPaperName: "",
|
||||
examinationStartTime: "",
|
||||
examinationTag: "",
|
||||
passLine: "",
|
||||
questionArrangement: "",
|
||||
scoringModel: "",
|
||||
showAnalysis: "",
|
||||
showAnswers: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
};
|
||||
updateExamination(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
message.error(`编辑成功`);
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`编辑失败`);
|
||||
});
|
||||
};
|
||||
// 删除考试
|
||||
const deleteTest = () => {
|
||||
let obj = {
|
||||
examinationId: 0,
|
||||
examinationId: state.deleteID,
|
||||
};
|
||||
deleteExaminationById(obj)
|
||||
.then((res) => {
|
||||
@@ -1334,7 +1322,7 @@ export default {
|
||||
// 删除作业
|
||||
const deleteWork = () => {
|
||||
let obj = {
|
||||
workId: 0,
|
||||
workId: state.deleteID,
|
||||
};
|
||||
deleteWorkTask(obj)
|
||||
.then((res) => {
|
||||
@@ -1347,31 +1335,6 @@ export default {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
// 编辑作业
|
||||
const updateWork = () => {
|
||||
let obj = {
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
submitEndTime: "",
|
||||
submitStartTime: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
workEnclosureAddress: "",
|
||||
workFlag: "",
|
||||
workId: 0,
|
||||
workName: "",
|
||||
workRequirement: "",
|
||||
workTag: "",
|
||||
};
|
||||
|
||||
updateWorkTaskUsing(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`编辑失败${err}`);
|
||||
});
|
||||
};
|
||||
|
||||
//删除直播
|
||||
const deleteLiveBroadcast = () => {
|
||||
@@ -1730,10 +1693,14 @@ export default {
|
||||
const showDrawerAddCase = () => {
|
||||
state.addcasevisible = true;
|
||||
};
|
||||
const showDrawerAddHomework = () => {
|
||||
const showDrawerAddHomework = (id,eleId) => {
|
||||
state.EditWorkId = id
|
||||
state.projectTaskId = eleId;
|
||||
state.addhomeworkvisible = true;
|
||||
};
|
||||
const showDrawerAddTest = () => {
|
||||
const showDrawerAddTest = (id,eleId) => {
|
||||
state.EditTestId = id
|
||||
state.projectTaskId = eleId;
|
||||
state.addtestvisible = true;
|
||||
};
|
||||
const showDrawerAddLive = () => {
|
||||
@@ -1866,7 +1833,7 @@ export default {
|
||||
console.log(state.EditRefId);
|
||||
};
|
||||
//编辑的按钮
|
||||
const decideType = (type, id) => {
|
||||
const decideType = (type, id,eleId) => {
|
||||
state.edit = true;
|
||||
console.log(type, id);
|
||||
if (type == "外链") {
|
||||
@@ -1875,7 +1842,7 @@ export default {
|
||||
else if (type == "直播") {
|
||||
showEditLiveDrawer(id);
|
||||
} else if (type == "测评") {
|
||||
showDrawerAddEval(id);
|
||||
showEditEvalDrawer(id)
|
||||
} else if (type == "评估") {
|
||||
showDrawerAddInvist(id);
|
||||
} else if (type == "投票") {
|
||||
@@ -1884,6 +1851,10 @@ export default {
|
||||
showEditAddDiscuss(id);
|
||||
} else if (type == "活动") {
|
||||
showDrawerAddActive(id);
|
||||
}else if (type == "作业") {
|
||||
showDrawerAddHomework(id,eleId);
|
||||
}else if (type == "考试") {
|
||||
showDrawerAddTest(id,eleId);
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -1940,8 +1911,6 @@ export default {
|
||||
getStageData,
|
||||
moveTask,
|
||||
deleteTaskAll,
|
||||
updateTest,
|
||||
updateWork,
|
||||
deleteTest,
|
||||
deleteWork,
|
||||
decideType,
|
||||
|
||||
Reference in New Issue
Block a user