mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 21:06:44 +08:00
-- 任务编辑问题
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="addtestVisible"
|
||||
class="drawerStyle addtestDrawer"
|
||||
width="80%"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
:visible="addtestVisible"
|
||||
class="drawerStyle addtestDrawer"
|
||||
width="80%"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}考试</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer2"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer2"
|
||||
/>
|
||||
</div>
|
||||
<!-- 2022-11-30注释 后面放开 修改div的padding-topL:32 -->
|
||||
@@ -34,60 +34,62 @@
|
||||
</button> -->
|
||||
</div>
|
||||
<a-form
|
||||
v-if="isOuter == 1"
|
||||
ref="formRef"
|
||||
name="custom-validation"
|
||||
:model="formState"
|
||||
:rules="rules"
|
||||
v-bind="layout"
|
||||
@finish="handleFinish"
|
||||
@validate="handleValidate"
|
||||
@finishFailed="handleFinishFailed"
|
||||
v-if="isOuter == 1"
|
||||
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="examinationName"
|
||||
has-feedback
|
||||
label="考试名称"
|
||||
name="examinationName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.examinationName"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="请输入考试名称"
|
||||
show-count :maxlength="50"
|
||||
v-model:value="formState.examinationName"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="请输入考试名称"
|
||||
show-count :maxlength="50"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="考试说明"
|
||||
name="examinationExplain"
|
||||
><div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formState.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
style="margin-left: 35px"
|
||||
show-count :maxlength="200"
|
||||
/></div>
|
||||
has-feedback
|
||||
label="考试说明"
|
||||
name="examinationExplain"
|
||||
>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formState.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
style="margin-left: 35px"
|
||||
show-count :maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="选择考试" name="choosedTest">
|
||||
<a-button
|
||||
type="primary"
|
||||
style="width: 100px; margin-left: 35px"
|
||||
class="outer"
|
||||
@click.prevent
|
||||
@click="selectTest()"
|
||||
type="primary"
|
||||
style="width: 100px; margin-left: 35px"
|
||||
class="outer"
|
||||
@click.prevent
|
||||
@click="selectTest()"
|
||||
>
|
||||
选择考试
|
||||
</a-button>
|
||||
@@ -115,28 +117,25 @@
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown> -->
|
||||
|
||||
<a-tag v-if="paperName != ''" closable color="processing" @close="delTag">
|
||||
<span style="font-size:14px;line-height: 33px;">删除考试</span>
|
||||
</a-tag>
|
||||
|
||||
|
||||
|
||||
<a-tag v-if="paperName != ''" closable color="processing" @close="delTag">
|
||||
<span style="font-size:14px;line-height: 33px;">删除考试</span>
|
||||
</a-tag>
|
||||
|
||||
|
||||
</a-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="考试时间" name="choosedTime">
|
||||
<a-range-picker
|
||||
v-model:value="formState.choosedTime"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 424px; margin-left: 35px"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
v-model:value="formState.choosedTime"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 424px; margin-left: 35px"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
@@ -144,14 +143,14 @@
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="考试时长"
|
||||
name="examinationDuration"
|
||||
has-feedback
|
||||
label="考试时长"
|
||||
name="examinationDuration"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.examinationDuration"
|
||||
type="number"
|
||||
style="width: 388px; height: 32px; margin-left: 35px"
|
||||
v-model:value="formState.examinationDuration"
|
||||
type="number"
|
||||
style="width: 388px; height: 32px; margin-left: 35px"
|
||||
/>
|
||||
</a-form-item>
|
||||
<span style="transform: translateY(-50%)">分钟</span>
|
||||
@@ -161,16 +160,16 @@
|
||||
<div class="btnbox">
|
||||
<span style="margin-right: 43px">考试限制</span>
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="允许重复考试"
|
||||
name="examinationLimit"
|
||||
has-feedback
|
||||
label="允许重复考试"
|
||||
name="examinationLimit"
|
||||
>
|
||||
<a-input-number
|
||||
:min="-1"
|
||||
:precision="0"
|
||||
type="number"
|
||||
v-model:value="formState.examinationLimit"
|
||||
style="
|
||||
:min="-1"
|
||||
:precision="0"
|
||||
type="number"
|
||||
v-model:value="formState.examinationLimit"
|
||||
style="
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
@@ -179,7 +178,7 @@
|
||||
/>
|
||||
<span style="margin-left: 8px">次</span>
|
||||
<span style="margin-left: 24px; color: #999999"
|
||||
>-1表示无限制</span
|
||||
>-1表示无限制</span
|
||||
>
|
||||
</a-form-item>
|
||||
</div>
|
||||
@@ -188,20 +187,22 @@
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="显示答案" name="showAnswers">
|
||||
<a-radio-group
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.showAnswers"
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.showAnswers"
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio1"
|
||||
>允许查看</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio1"
|
||||
>允许查看
|
||||
</a-radio
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio1"
|
||||
>不允许查看</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio1"
|
||||
>不允许查看
|
||||
</a-radio
|
||||
>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -211,20 +212,22 @@
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="显示解析" name="showAnalysis">
|
||||
<a-radio-group
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.showAnalysis"
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.showAnalysis"
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio2"
|
||||
>允许查看</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio2"
|
||||
>允许查看
|
||||
</a-radio
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio2"
|
||||
>不允许查看</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio2"
|
||||
>不允许查看
|
||||
</a-radio
|
||||
>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -234,20 +237,22 @@
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="评分模式" name="scoringModel">
|
||||
<a-radio-group
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.scoringModel"
|
||||
style="margin-left: 35px; margin-right: 12px"
|
||||
v-model:value="formState.scoringModel"
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio3"
|
||||
>最高一次</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio3"
|
||||
>最高一次
|
||||
</a-radio
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio3"
|
||||
>最后一次</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio3"
|
||||
>最后一次
|
||||
</a-radio
|
||||
>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -257,9 +262,9 @@
|
||||
<div class="btnbox">
|
||||
<a-form-item has-feedback label="及格线" name="passLine">
|
||||
<a-input
|
||||
v-model:value="formState.passLine"
|
||||
type="number"
|
||||
style="width: 88px; height: 32px; margin-left: 35px"
|
||||
v-model:value="formState.passLine"
|
||||
type="number"
|
||||
style="width: 88px; height: 32px; margin-left: 35px"
|
||||
/>
|
||||
</a-form-item>
|
||||
<span style="margin-left: 8px">分</span>
|
||||
@@ -268,31 +273,34 @@
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="作业要求"
|
||||
name="questionArrangement"
|
||||
has-feedback
|
||||
label="作业要求"
|
||||
name="questionArrangement"
|
||||
>
|
||||
<a-radio-group
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formState.questionArrangement"
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formState.questionArrangement"
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio4"
|
||||
>试题乱序</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="1"
|
||||
@click="cloradio4"
|
||||
>试题乱序
|
||||
</a-radio
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio4"
|
||||
>试题排序</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="2"
|
||||
@click="cloradio4"
|
||||
>试题排序
|
||||
</a-radio
|
||||
>
|
||||
<a-radio
|
||||
v-model:checked="checked"
|
||||
:value="3"
|
||||
@click="cloradio4"
|
||||
>全部乱序</a-radio
|
||||
v-model:checked="checked"
|
||||
:value="3"
|
||||
@click="cloradio4"
|
||||
>全部乱序
|
||||
</a-radio
|
||||
>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -306,31 +314,31 @@
|
||||
</div>
|
||||
</a-form>
|
||||
<a-form
|
||||
v-else
|
||||
ref="formRef"
|
||||
name="custom-validation"
|
||||
:model="formState"
|
||||
:rules="rules"
|
||||
v-bind="layout"
|
||||
@finish="handleFinish"
|
||||
@validate="handleValidate"
|
||||
@finishFailed="handleFinishFailed"
|
||||
v-else
|
||||
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="examinationName"
|
||||
has-feedback
|
||||
label="考试名称"
|
||||
name="examinationName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="formState.examinationName"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="请输入考试名称"
|
||||
show-count :maxlength="50"
|
||||
v-model:value="formState.examinationName"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="请输入考试名称"
|
||||
show-count :maxlength="50"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
@@ -338,16 +346,16 @@
|
||||
<div class="main_item">
|
||||
<div class="btnbox">
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="数据来源"
|
||||
name="examinationName"
|
||||
has-feedback
|
||||
label="数据来源"
|
||||
name="examinationName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="请输入数据来源"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="数据来源"
|
||||
show-count :maxlength="50"
|
||||
v-model:value="请输入数据来源"
|
||||
style="width: 424px; height: 32px; margin-left: 35px"
|
||||
autocomplete="off"
|
||||
placeholder="数据来源"
|
||||
show-count :maxlength="50"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
@@ -355,19 +363,20 @@
|
||||
|
||||
<div class="main_item2">
|
||||
<a-form-item
|
||||
has-feedback
|
||||
label="考试说明"
|
||||
name="examinationExplain"
|
||||
has-feedback
|
||||
label="考试说明"
|
||||
name="examinationExplain"
|
||||
>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formState.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
style="margin-left: 35px"
|
||||
show-count :maxlength="200"
|
||||
/></div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formState.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
style="margin-left: 35px"
|
||||
show-count :maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</div>
|
||||
@@ -380,24 +389,25 @@
|
||||
</div>
|
||||
<!-- 加载动画 -->
|
||||
<div class="aeLoading" :style="{ display: addLoading ? 'flex' : 'none' }">
|
||||
<a-spin :spinning="addLoading" tip="添加中..." />
|
||||
<a-spin :spinning="addLoading" tip="添加中..."/>
|
||||
</div>
|
||||
<!-- 选择考试抽屉 -->
|
||||
<s-test v-model:STvisible="STvisible" @getSTData="getData" />
|
||||
<s-test v-model:STvisible="STvisible" @getSTData="getData"/>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import {message} from "ant-design-vue";
|
||||
import {
|
||||
createExamination,
|
||||
queryExaminationDetailById,
|
||||
updateExamination,
|
||||
} from "@/api/indexExam";
|
||||
import STest from "./SelectTest.vue";
|
||||
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
|
||||
import { addTempTask } from "../../api/indexTaskadd";
|
||||
import {ProjectEditTask, RouterEditTask} from "@/api/indexTask";
|
||||
import {addTempTask} from "../../api/indexTaskadd";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
name: "AddTest",
|
||||
components: {
|
||||
@@ -519,7 +529,7 @@ export default {
|
||||
return Promise.reject("请选择时间");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let checkExaminationDuration = async (_rule, value) => {
|
||||
if (!value) {
|
||||
return Promise.reject("请输入考试时长");
|
||||
@@ -642,6 +652,7 @@ export default {
|
||||
console.log(args);
|
||||
};
|
||||
const closeDrawer = () => {
|
||||
console.log('closeDrawer')
|
||||
formState.choosedTime = "";
|
||||
ctx.emit("update:addtestVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
@@ -652,10 +663,12 @@ export default {
|
||||
};
|
||||
const closeDrawer2 = () => {
|
||||
formState.choosedTime = "";
|
||||
ctx.emit("update:edit", false);
|
||||
ctx.emit("update:addtestVisible", false);
|
||||
resetForm();
|
||||
};
|
||||
const afterVisibleChange = () => {
|
||||
console.log('props', props)
|
||||
if (props.addtestVisible && props.edit) {
|
||||
// 该页面显示同时 edit为true 时,发送查询请求,
|
||||
queryTest();
|
||||
@@ -669,46 +682,46 @@ export default {
|
||||
state.paperName = "";
|
||||
};
|
||||
const queryTest = () => {
|
||||
// state.addLoading = true;
|
||||
queryExaminationDetailById({ examinationId: props.EditTestId })
|
||||
.then((res) => {
|
||||
formState.examinationName = res.data.data.examinationName;
|
||||
formState.workRequirement = res.data.data.workRequirement;
|
||||
formState.examinationDuration = res.data.data.examinationDuration;
|
||||
formState.examinationLimit =
|
||||
Number(res.data.data.examinationLimit) || -1;
|
||||
formState.passLine = res.data.data.passLine;
|
||||
formState.examinationExplain = res.data.data.examinationExplain;
|
||||
formState.questionArrangement =
|
||||
Number(res.data.data.questionArrangement) || 1;
|
||||
formState.scoringModel = Number(res.data.data.scoringModel) || 1;
|
||||
formState.showAnalysis = Number(res.data.data.showAnalysis) || 1;
|
||||
formState.showAnswers = Number(res.data.data.showAnswers) || 1;
|
||||
formState.papaerName = res.data.data.examinationTestName;
|
||||
state.paperName = res.data.data.examinationTestName;
|
||||
if (
|
||||
res.data.data.examinationEndTime &&
|
||||
res.data.data.examinationStartTime
|
||||
) {
|
||||
formState.choosedTime = [
|
||||
dayjs(res.data.data.examinationStartTime, "YYYY-MM-DD"),
|
||||
dayjs(res.data.data.examinationEndTime, "YYYY-MM-DD"),
|
||||
];
|
||||
state.addLoading = false;
|
||||
} else {
|
||||
formState.choosedTime = [];
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`查询失败`);
|
||||
});
|
||||
// state.addLoading = true;
|
||||
queryExaminationDetailById({examinationId: props.EditTestId})
|
||||
.then((res) => {
|
||||
formState.examinationName = res.data.data.examinationName;
|
||||
formState.workRequirement = res.data.data.workRequirement;
|
||||
formState.examinationDuration = res.data.data.examinationDuration;
|
||||
formState.examinationLimit =
|
||||
Number(res.data.data.examinationLimit) || -1;
|
||||
formState.passLine = res.data.data.passLine;
|
||||
formState.examinationExplain = res.data.data.examinationExplain;
|
||||
formState.questionArrangement =
|
||||
Number(res.data.data.questionArrangement) || 1;
|
||||
formState.scoringModel = Number(res.data.data.scoringModel) || 1;
|
||||
formState.showAnalysis = Number(res.data.data.showAnalysis) || 1;
|
||||
formState.showAnswers = Number(res.data.data.showAnswers) || 1;
|
||||
formState.papaerName = res.data.data.examinationTestName;
|
||||
state.paperName = res.data.data.examinationTestName;
|
||||
if (
|
||||
res.data.data.examinationEndTime &&
|
||||
res.data.data.examinationStartTime
|
||||
) {
|
||||
formState.choosedTime = [
|
||||
dayjs(res.data.data.examinationStartTime, "YYYY-MM-DD"),
|
||||
dayjs(res.data.data.examinationEndTime, "YYYY-MM-DD"),
|
||||
];
|
||||
state.addLoading = false;
|
||||
} else {
|
||||
formState.choosedTime = [];
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`查询失败`);
|
||||
});
|
||||
};
|
||||
const updateTest = () => {
|
||||
//state.addLoading = true;updateTask
|
||||
let obj = {
|
||||
examinationDuration: formState.examinationDuration,
|
||||
examinationEndTime: dayjs(formState.choosedTime[1]).format(
|
||||
"YYYY-MM-DD"
|
||||
"YYYY-MM-DD"
|
||||
),
|
||||
examinationExplain: formState.examinationExplain,
|
||||
examinationId: props.edit ? props.EditTestId : 0,
|
||||
@@ -717,7 +730,7 @@ export default {
|
||||
examinationPaperId: 0,
|
||||
// examinationPaperName: formState.choosedTest,
|
||||
examinationStartTime: dayjs(formState.choosedTime[0]).format(
|
||||
"YYYY-MM-DD"
|
||||
"YYYY-MM-DD"
|
||||
),
|
||||
passLine: formState.passLine,
|
||||
questionArrangement: formState.questionArrangement,
|
||||
@@ -727,32 +740,32 @@ export default {
|
||||
examinationTestId: state.paperId,
|
||||
examinationTestName: state.paperName,
|
||||
};
|
||||
if(!(state.paperId >0)){
|
||||
if (!(state.paperId > 0)) {
|
||||
message.destroy();
|
||||
return message.error("请选择考试");
|
||||
}
|
||||
if (props.edit) {
|
||||
// 编辑任务
|
||||
updateExamination(obj)
|
||||
.then(async (res) => {
|
||||
await updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`编辑失败`);
|
||||
});
|
||||
.then(async (res) => {
|
||||
await updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`编辑失败`);
|
||||
});
|
||||
} else {
|
||||
// 创建任务
|
||||
createExamination(obj)
|
||||
.then(async (res) => {
|
||||
await updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`创建失败`);
|
||||
});
|
||||
.then(async (res) => {
|
||||
await updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`创建失败`);
|
||||
});
|
||||
}
|
||||
};
|
||||
const updateTask = (res) => {
|
||||
@@ -771,15 +784,15 @@ export default {
|
||||
type: 5,
|
||||
};
|
||||
RouterEditTask(editObj1)
|
||||
.then(() => {
|
||||
//message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
.then(() => {
|
||||
//message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
let editObj = {
|
||||
courseId: res.data.data.examinationId,
|
||||
@@ -792,13 +805,13 @@ export default {
|
||||
};
|
||||
// 新增编辑或新增项目
|
||||
ProjectEditTask(editObj)
|
||||
.then(() => {
|
||||
//message.success(`${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
.then(() => {
|
||||
//message.success(`${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
addTempTask({
|
||||
courseId: res.data.data.examinationId,
|
||||
@@ -809,13 +822,13 @@ export default {
|
||||
stageId: props.chooseStageId || 0,
|
||||
type: 5,
|
||||
})
|
||||
.then(() => {
|
||||
//message.success( `${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
.then(() => {
|
||||
//message.success( `${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch(() => {
|
||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -851,7 +864,7 @@ export default {
|
||||
};
|
||||
const closeTag = (removedTag) => {
|
||||
const tags = state.choosedTestList.filter(
|
||||
(item) => item.key != removedTag
|
||||
(item) => item.key != removedTag
|
||||
);
|
||||
state.choosedTestList = tags;
|
||||
};
|
||||
@@ -887,7 +900,7 @@ export default {
|
||||
chooseTest,
|
||||
closeTag,
|
||||
getData,
|
||||
|
||||
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
@@ -897,6 +910,7 @@ export default {
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.outer {
|
||||
background-color: #4ea6ff;
|
||||
color: #fff;
|
||||
@@ -905,6 +919,7 @@ export default {
|
||||
height: 36px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.notOuter {
|
||||
color: #000;
|
||||
border-radius: 5px;
|
||||
@@ -913,10 +928,12 @@ export default {
|
||||
margin-right: 10px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.tag-style {
|
||||
color: rgb(113, 113, 237);
|
||||
background-color: #d7d1f7;
|
||||
}
|
||||
|
||||
.addtestDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
@@ -926,6 +943,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
@@ -934,31 +952,38 @@ 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-top: 32px;
|
||||
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;
|
||||
@@ -971,10 +996,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.textarea {
|
||||
width: 423px;
|
||||
|
||||
@@ -996,24 +1023,29 @@ export default {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
@@ -1023,10 +1055,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
@@ -1043,6 +1077,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
@@ -1052,6 +1087,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;
|
||||
@@ -1061,6 +1097,7 @@ export default {
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
|
||||
Reference in New Issue
Block a user