mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
feat:合并
This commit is contained in:
@@ -255,6 +255,11 @@ export default {
|
|||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
// state.selectedRowKeys = [0];
|
// state.selectedRowKeys = [0];
|
||||||
for (let i = 0; i < res.data.data.list.length; i++) {
|
for (let i = 0; i < res.data.data.list.length; i++) {
|
||||||
|
console.log(
|
||||||
|
"res.data.data.list[i].casesId",
|
||||||
|
res.data.data.list[i].casesId,
|
||||||
|
props.EditCaseId
|
||||||
|
);
|
||||||
if (Number(res.data.data.list[i].casesId) == props.EditCaseId) {
|
if (Number(res.data.data.list[i].casesId) == props.EditCaseId) {
|
||||||
state.selectedRowKeys = [i];
|
state.selectedRowKeys = [i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer
|
||||||
:visible="addtestVisible"
|
:visible="addtestVisible"
|
||||||
class="drawerStyle addtestDrawer"
|
class="drawerStyle addtestDrawer"
|
||||||
width="80%"
|
width="80%"
|
||||||
placement="right"
|
placement="right"
|
||||||
@after-visible-change="afterVisibleChange"
|
@after-visible-change="afterVisibleChange"
|
||||||
>
|
>
|
||||||
<div class="drawerMain">
|
<div class="drawerMain">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}考试</div>
|
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}考试</div>
|
||||||
<img
|
<img
|
||||||
style="width: 29px; height: 29px; cursor: pointer"
|
style="width: 29px; height: 29px; cursor: pointer"
|
||||||
src="../../assets/images/basicinfo/close.png"
|
src="../../assets/images/basicinfo/close.png"
|
||||||
@click="closeDrawer2"
|
@click="closeDrawer2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 2022-11-30注释 后面放开 修改div的padding-topL:32 -->
|
<!-- 2022-11-30注释 后面放开 修改div的padding-topL:32 -->
|
||||||
@@ -34,127 +34,130 @@
|
|||||||
</button> -->
|
</button> -->
|
||||||
</div>
|
</div>
|
||||||
<a-form
|
<a-form
|
||||||
v-if="isOuter == 1"
|
v-if="isOuter == 1"
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
name="custom-validation"
|
name="custom-validation"
|
||||||
:model="formState"
|
:model="formState"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
v-bind="layout"
|
v-bind="layout"
|
||||||
@finish="handleFinish"
|
@finish="handleFinish"
|
||||||
@validate="handleValidate"
|
@validate="handleValidate"
|
||||||
@finishFailed="handleFinishFailed"
|
@finishFailed="handleFinishFailed"
|
||||||
>
|
>
|
||||||
<div class="contentMain">
|
<div class="contentMain">
|
||||||
<div class="main_left">
|
<div class="main_left">
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<div class="sign" style="margin-bottom:24px">
|
<div class="sign" style="margin-bottom: 24px">
|
||||||
<img
|
<img
|
||||||
src="@/assets/images/coursewareManage/asterisk.png"
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="考试名称"
|
label="考试名称"
|
||||||
name="examinationName"
|
name="examinationName"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formState.examinationName"
|
v-model:value="formState.examinationName"
|
||||||
style="width: 424px; height: 32px; margin-left: 35px"
|
style="width: 424px; height: 32px; margin-left: 35px"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="请输入考试名称"
|
placeholder="请输入考试名称"
|
||||||
show-count :maxlength="20"
|
show-count
|
||||||
|
:maxlength="20"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_item2">
|
<div class="main_item2">
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="考试说明"
|
label="考试说明"
|
||||||
name="examinationExplain"
|
name="examinationExplain"
|
||||||
>
|
>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="formState.examinationExplain"
|
v-model:value="formState.examinationExplain"
|
||||||
placeholder="请输入考试说明"
|
placeholder="请输入考试说明"
|
||||||
allow-clear
|
allow-clear
|
||||||
:rows="6"
|
:rows="6"
|
||||||
style="margin-left: 35px"
|
style="margin-left: 35px"
|
||||||
show-count :maxlength="200"
|
show-count
|
||||||
|
:maxlength="200"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<div class="sign" style="margin-bottom:24px">
|
<div class="sign" style="margin-bottom: 24px">
|
||||||
<img
|
<img
|
||||||
src="@/assets/images/coursewareManage/asterisk.png"
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a-form-item has-feedback label="选择考试" name="choosedTest">
|
<a-form-item has-feedback label="选择考试" name="choosedTest">
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
style="width: 100px; margin-left: 35px"
|
style="width: 100px; margin-left: 35px"
|
||||||
class="outer"
|
class="outer"
|
||||||
@click.prevent
|
@click.prevent
|
||||||
@click="selectTest()"
|
@click="selectTest()"
|
||||||
>
|
>
|
||||||
选择考试
|
选择考试
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a-tag v-if="paperName != ''" closable color="processing" @close="delTag">
|
<a-tag
|
||||||
<span style="font-size:14px;line-height: 33px;">{{paperName}}</span>
|
v-if="paperName != ''"
|
||||||
|
closable
|
||||||
|
color="processing"
|
||||||
|
@close="delTag"
|
||||||
|
>
|
||||||
|
<span style="font-size: 14px; line-height: 33px">{{
|
||||||
|
paperName
|
||||||
|
}}</span>
|
||||||
</a-tag>
|
</a-tag>
|
||||||
|
|
||||||
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<div class="sign" style="margin-bottom:24px">
|
<div class="sign" style="margin-bottom: 24px">
|
||||||
<img
|
<img
|
||||||
src="@/assets/images/coursewareManage/asterisk.png"
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a-form-item has-feedback label="考试时间" name="choosedTime">
|
<a-form-item has-feedback label="考试时间" name="choosedTime">
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model:value="formState.choosedTime"
|
v-model:value="formState.choosedTime"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
style="width: 424px; margin-left: 35px"
|
style="width: 424px; margin-left: 35px"
|
||||||
:placeholder="[' 开始时间', ' 结束时间']"
|
:placeholder="[' 开始时间', ' 结束时间']"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<div class="sign" style="margin-bottom:24px">
|
<div class="sign" style="margin-bottom: 24px">
|
||||||
<img
|
<img
|
||||||
src="@/assets/images/coursewareManage/asterisk.png"
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="考试时长"
|
label="考试时长"
|
||||||
name="examinationDuration"
|
name="examinationDuration"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formState.examinationDuration"
|
v-model:value="formState.examinationDuration"
|
||||||
type="number"
|
type="number"
|
||||||
style="width: 388px; height: 32px; margin-left: 35px"
|
style="width: 388px; height: 32px; margin-left: 35px"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<span style="transform: translateY(-50%)">分钟</span>
|
<span style="transform: translateY(-50%)">分钟</span>
|
||||||
@@ -164,16 +167,16 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<span style="margin-right: 43px">考试限制</span>
|
<span style="margin-right: 43px">考试限制</span>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="允许重复考试"
|
label="允许重复考试"
|
||||||
name="examinationLimit"
|
name="examinationLimit"
|
||||||
>
|
>
|
||||||
<a-input-number
|
<a-input-number
|
||||||
:min="-1"
|
:min="-1"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
type="number"
|
type="number"
|
||||||
v-model:value="formState.examinationLimit"
|
v-model:value="formState.examinationLimit"
|
||||||
style="
|
style="
|
||||||
width: 88px;
|
width: 88px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -182,7 +185,7 @@
|
|||||||
/>
|
/>
|
||||||
<span style="margin-left: 8px">次</span>
|
<span style="margin-left: 8px">次</span>
|
||||||
<span style="margin-left: 24px; color: #999999"
|
<span style="margin-left: 24px; color: #999999"
|
||||||
>-1表示无限制</span
|
>-1表示无限制</span
|
||||||
>
|
>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -191,23 +194,21 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item has-feedback label="显示答案" name="showAnswers">
|
<a-form-item has-feedback label="显示答案" name="showAnswers">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
style="margin-left: 35px; margin-right: 12px"
|
style="margin-left: 35px; margin-right: 12px"
|
||||||
v-model:value="formState.showAnswers"
|
v-model:value="formState.showAnswers"
|
||||||
>
|
>
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="1"
|
:value="1"
|
||||||
@click="cloradio1"
|
@click="cloradio1"
|
||||||
>允许查看
|
>允许查看
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="2"
|
:value="2"
|
||||||
@click="cloradio1"
|
@click="cloradio1"
|
||||||
>不允许查看
|
>不允许查看
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -216,23 +217,21 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item has-feedback label="显示解析" name="showAnalysis">
|
<a-form-item has-feedback label="显示解析" name="showAnalysis">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
style="margin-left: 35px; margin-right: 12px"
|
style="margin-left: 35px; margin-right: 12px"
|
||||||
v-model:value="formState.showAnalysis"
|
v-model:value="formState.showAnalysis"
|
||||||
>
|
>
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="1"
|
:value="1"
|
||||||
@click="cloradio2"
|
@click="cloradio2"
|
||||||
>允许查看
|
>允许查看
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="2"
|
:value="2"
|
||||||
@click="cloradio2"
|
@click="cloradio2"
|
||||||
>不允许查看
|
>不允许查看
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -241,23 +240,21 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item has-feedback label="评分模式" name="scoringModel">
|
<a-form-item has-feedback label="评分模式" name="scoringModel">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
style="margin-left: 35px; margin-right: 12px"
|
style="margin-left: 35px; margin-right: 12px"
|
||||||
v-model:value="formState.scoringModel"
|
v-model:value="formState.scoringModel"
|
||||||
>
|
>
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="1"
|
:value="1"
|
||||||
@click="cloradio3"
|
@click="cloradio3"
|
||||||
>最高一次
|
>最高一次
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="2"
|
:value="2"
|
||||||
@click="cloradio3"
|
@click="cloradio3"
|
||||||
>最后一次
|
>最后一次
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -266,9 +263,9 @@
|
|||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item has-feedback label="及格线" name="passLine">
|
<a-form-item has-feedback label="及格线" name="passLine">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formState.passLine"
|
v-model:value="formState.passLine"
|
||||||
type="number"
|
type="number"
|
||||||
style="width: 88px; height: 32px; margin-left: 35px"
|
style="width: 88px; height: 32px; margin-left: 35px"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<span style="margin-left: 8px">分</span>
|
<span style="margin-left: 8px">分</span>
|
||||||
@@ -277,35 +274,32 @@
|
|||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="作业要求"
|
label="作业要求"
|
||||||
name="questionArrangement"
|
name="questionArrangement"
|
||||||
>
|
>
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-model:value="formState.questionArrangement"
|
v-model:value="formState.questionArrangement"
|
||||||
>
|
>
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="1"
|
:value="1"
|
||||||
@click="cloradio4"
|
@click="cloradio4"
|
||||||
>试题乱序
|
>试题乱序
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="2"
|
:value="2"
|
||||||
@click="cloradio4"
|
@click="cloradio4"
|
||||||
>试题排序
|
>选项乱序
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
<a-radio
|
<a-radio
|
||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
:value="3"
|
:value="3"
|
||||||
@click="cloradio4"
|
@click="cloradio4"
|
||||||
>全部乱序
|
>全部乱序
|
||||||
</a-radio
|
</a-radio>
|
||||||
>
|
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -318,31 +312,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-form>
|
</a-form>
|
||||||
<a-form
|
<a-form
|
||||||
v-else
|
v-else
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
name="custom-validation"
|
name="custom-validation"
|
||||||
:model="formState"
|
:model="formState"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
v-bind="layout"
|
v-bind="layout"
|
||||||
@finish="handleFinish"
|
@finish="handleFinish"
|
||||||
@validate="handleValidate"
|
@validate="handleValidate"
|
||||||
@finishFailed="handleFinishFailed"
|
@finishFailed="handleFinishFailed"
|
||||||
>
|
>
|
||||||
<div class="contentMain">
|
<div class="contentMain">
|
||||||
<div class="main_left">
|
<div class="main_left">
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="考试名称"
|
label="考试名称"
|
||||||
name="examinationName"
|
name="examinationName"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formState.examinationName"
|
v-model:value="formState.examinationName"
|
||||||
style="width: 424px; height: 32px; margin-left: 35px"
|
style="width: 424px; height: 32px; margin-left: 35px"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="请输入考试名称"
|
placeholder="请输入考试名称"
|
||||||
show-count :maxlength="20"
|
show-count
|
||||||
|
:maxlength="20"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -350,16 +345,17 @@
|
|||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="数据来源"
|
label="数据来源"
|
||||||
name="examinationName"
|
name="examinationName"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="请输入数据来源"
|
v-model:value="请输入数据来源"
|
||||||
style="width: 424px; height: 32px; margin-left: 35px"
|
style="width: 424px; height: 32px; margin-left: 35px"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="数据来源"
|
placeholder="数据来源"
|
||||||
show-count :maxlength="20"
|
show-count
|
||||||
|
:maxlength="20"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -367,18 +363,19 @@
|
|||||||
|
|
||||||
<div class="main_item2">
|
<div class="main_item2">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
has-feedback
|
has-feedback
|
||||||
label="考试说明"
|
label="考试说明"
|
||||||
name="examinationExplain"
|
name="examinationExplain"
|
||||||
>
|
>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="formState.examinationExplain"
|
v-model:value="formState.examinationExplain"
|
||||||
placeholder="请输入考试说明"
|
placeholder="请输入考试说明"
|
||||||
allow-clear
|
allow-clear
|
||||||
:rows="6"
|
:rows="6"
|
||||||
style="margin-left: 35px"
|
style="margin-left: 35px"
|
||||||
show-count :maxlength="200"
|
show-count
|
||||||
|
:maxlength="200"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -393,23 +390,23 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 加载动画 -->
|
<!-- 加载动画 -->
|
||||||
<div class="aeLoading" :style="{ display: addLoading ? 'flex' : 'none' }">
|
<div class="aeLoading" :style="{ display: addLoading ? 'flex' : 'none' }">
|
||||||
<a-spin :spinning="addLoading" tip="添加中..."/>
|
<a-spin :spinning="addLoading" tip="添加中..." />
|
||||||
</div>
|
</div>
|
||||||
<!-- 选择考试抽屉 -->
|
<!-- 选择考试抽屉 -->
|
||||||
<s-test v-model:STvisible="STvisible" @getSTData="getData"/>
|
<s-test v-model:STvisible="STvisible" @getSTData="getData" />
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {reactive, ref, toRefs} from "vue";
|
import { reactive, ref, toRefs } from "vue";
|
||||||
import {message} from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import {
|
import {
|
||||||
createExamination,
|
createExamination,
|
||||||
queryExaminationDetailById,
|
queryExaminationDetailById,
|
||||||
updateExamination,
|
updateExamination,
|
||||||
} from "@/api/indexExam";
|
} from "@/api/indexExam";
|
||||||
import STest from "./SelectTest.vue";
|
import STest from "./SelectTest.vue";
|
||||||
import {ProjectEditTask, RouterEditTask} from "@/api/indexTask";
|
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
|
||||||
import {addTempTask} from "../../api/indexTaskadd";
|
import { addTempTask } from "../../api/indexTaskadd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -470,7 +467,7 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
testName:{
|
testName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
@@ -499,12 +496,12 @@ export default {
|
|||||||
paperName: "", //试卷名称 子组件传过来给考试抽屉选择试卷后框框用
|
paperName: "", //试卷名称 子组件传过来给考试抽屉选择试卷后框框用
|
||||||
id: "",
|
id: "",
|
||||||
testName: "",
|
testName: "",
|
||||||
TestName:"",
|
TestName: "",
|
||||||
testObj:{
|
testObj: {
|
||||||
name:"",
|
name: "",
|
||||||
paperId:"",
|
paperId: "",
|
||||||
choosedTime:"",
|
choosedTime: "",
|
||||||
duration:""
|
duration: "",
|
||||||
},
|
},
|
||||||
choosedTestList: [
|
choosedTestList: [
|
||||||
{
|
{
|
||||||
@@ -529,7 +526,7 @@ export default {
|
|||||||
updateTest();
|
updateTest();
|
||||||
};
|
};
|
||||||
const handleFinishFailed = () => {
|
const handleFinishFailed = () => {
|
||||||
// message.error("handleFinishFailed");
|
// message.error("handleFinishFailed");
|
||||||
};
|
};
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
@@ -542,12 +539,12 @@ export default {
|
|||||||
console.log(args);
|
console.log(args);
|
||||||
};
|
};
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
console.log('closeDrawer')
|
console.log("closeDrawer");
|
||||||
formState.choosedTime = "";
|
formState.choosedTime = "";
|
||||||
ctx.emit("update:addtestVisible", false);
|
ctx.emit("update:addtestVisible", false);
|
||||||
ctx.emit("update:edit", false);
|
ctx.emit("update:edit", false);
|
||||||
ctx.emit("update:EditTestId", state.EditTestId);
|
ctx.emit("update:EditTestId", state.EditTestId);
|
||||||
ctx.emit("update:testName", state.testName);
|
ctx.emit("update:testName", state.testName);
|
||||||
console.log("formState.testName", state.testName);
|
console.log("formState.testName", state.testName);
|
||||||
localStorage.setItem("stageId", props.chooseStageId);
|
localStorage.setItem("stageId", props.chooseStageId);
|
||||||
localStorage.setItem("chapterId", props.isactive);
|
localStorage.setItem("chapterId", props.isactive);
|
||||||
@@ -560,7 +557,7 @@ export default {
|
|||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
const afterVisibleChange = () => {
|
const afterVisibleChange = () => {
|
||||||
console.log('props', props)
|
console.log("props", props);
|
||||||
if (props.addtestVisible && props.edit) {
|
if (props.addtestVisible && props.edit) {
|
||||||
// 该页面显示同时 edit为true 时,发送查询请求,
|
// 该页面显示同时 edit为true 时,发送查询请求,
|
||||||
queryTest();
|
queryTest();
|
||||||
@@ -575,45 +572,45 @@ export default {
|
|||||||
};
|
};
|
||||||
const queryTest = () => {
|
const queryTest = () => {
|
||||||
// state.addLoading = true;
|
// state.addLoading = true;
|
||||||
queryExaminationDetailById({examinationId: props.EditTestId})
|
queryExaminationDetailById({ examinationId: props.EditTestId })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
formState.examinationName = res.data.data.examinationName;
|
formState.examinationName = res.data.data.examinationName;
|
||||||
formState.workRequirement = res.data.data.workRequirement;
|
formState.workRequirement = res.data.data.workRequirement;
|
||||||
formState.examinationDuration = res.data.data.examinationDuration;
|
formState.examinationDuration = res.data.data.examinationDuration;
|
||||||
formState.examinationLimit =
|
formState.examinationLimit =
|
||||||
Number(res.data.data.examinationLimit) || -1;
|
Number(res.data.data.examinationLimit) || -1;
|
||||||
formState.passLine = res.data.data.passLine;
|
formState.passLine = res.data.data.passLine;
|
||||||
formState.examinationExplain = res.data.data.examinationExplain;
|
formState.examinationExplain = res.data.data.examinationExplain;
|
||||||
formState.questionArrangement =
|
formState.questionArrangement =
|
||||||
Number(res.data.data.questionArrangement) || 1;
|
Number(res.data.data.questionArrangement) || 1;
|
||||||
formState.scoringModel = Number(res.data.data.scoringModel) || 1;
|
formState.scoringModel = Number(res.data.data.scoringModel) || 1;
|
||||||
formState.showAnalysis = Number(res.data.data.showAnalysis) || 1;
|
formState.showAnalysis = Number(res.data.data.showAnalysis) || 1;
|
||||||
formState.showAnswers = Number(res.data.data.showAnswers) || 1;
|
formState.showAnswers = Number(res.data.data.showAnswers) || 1;
|
||||||
formState.papaerName = res.data.data.examinationTestName;
|
formState.papaerName = res.data.data.examinationTestName;
|
||||||
state.paperName = res.data.data.examinationTestName;
|
state.paperName = res.data.data.examinationTestName;
|
||||||
if (
|
if (
|
||||||
res.data.data.examinationEndTime &&
|
res.data.data.examinationEndTime &&
|
||||||
res.data.data.examinationStartTime
|
res.data.data.examinationStartTime
|
||||||
) {
|
) {
|
||||||
formState.choosedTime = [
|
formState.choosedTime = [
|
||||||
dayjs(res.data.data.examinationStartTime, "YYYY-MM-DD"),
|
dayjs(res.data.data.examinationStartTime, "YYYY-MM-DD"),
|
||||||
dayjs(res.data.data.examinationEndTime, "YYYY-MM-DD"),
|
dayjs(res.data.data.examinationEndTime, "YYYY-MM-DD"),
|
||||||
];
|
];
|
||||||
state.addLoading = false;
|
state.addLoading = false;
|
||||||
} else {
|
} else {
|
||||||
formState.choosedTime = [];
|
formState.choosedTime = [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
//message.error(`查询失败`);
|
//message.error(`查询失败`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const updateTest = () => {
|
const updateTest = () => {
|
||||||
//state.addLoading = true;updateTask
|
//state.addLoading = true;updateTask
|
||||||
let obj = {
|
let obj = {
|
||||||
examinationDuration: formState.examinationDuration,
|
examinationDuration: formState.examinationDuration,
|
||||||
examinationEndTime: dayjs(formState.choosedTime[1]).format(
|
examinationEndTime: dayjs(formState.choosedTime[1]).format(
|
||||||
"YYYY-MM-DD"
|
"YYYY-MM-DD"
|
||||||
),
|
),
|
||||||
examinationExplain: formState.examinationExplain,
|
examinationExplain: formState.examinationExplain,
|
||||||
examinationId: props.edit ? props.EditTestId : 0,
|
examinationId: props.edit ? props.EditTestId : 0,
|
||||||
@@ -622,7 +619,7 @@ export default {
|
|||||||
examinationPaperId: 0,
|
examinationPaperId: 0,
|
||||||
// examinationPaperName: formState.choosedTest,
|
// examinationPaperName: formState.choosedTest,
|
||||||
examinationStartTime: dayjs(formState.choosedTime[0]).format(
|
examinationStartTime: dayjs(formState.choosedTime[0]).format(
|
||||||
"YYYY-MM-DD"
|
"YYYY-MM-DD"
|
||||||
),
|
),
|
||||||
passLine: formState.passLine,
|
passLine: formState.passLine,
|
||||||
questionArrangement: formState.questionArrangement,
|
questionArrangement: formState.questionArrangement,
|
||||||
@@ -632,7 +629,7 @@ export default {
|
|||||||
examinationTestId: state.paperId,
|
examinationTestId: state.paperId,
|
||||||
examinationTestName: state.paperName,
|
examinationTestName: state.paperName,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!formState.examinationName) {
|
if (!formState.examinationName) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入考试名称");
|
return message.warning("请输入考试名称");
|
||||||
@@ -649,29 +646,29 @@ export default {
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入考试时长");
|
return message.warning("请输入考试时长");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.edit) {
|
if (props.edit) {
|
||||||
// 编辑任务
|
// 编辑任务
|
||||||
updateExamination(obj)
|
updateExamination(obj)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
await updateTask(res);
|
await updateTask(res);
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
message.error(`编辑失败`);
|
message.error(`编辑失败`);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 创建任务
|
// 创建任务
|
||||||
createExamination(obj)
|
createExamination(obj)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
await updateTask(res);
|
await updateTask(res);
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
message.error(`创建失败`);
|
message.error(`创建失败`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const updateTask = (res) => {
|
const updateTask = (res) => {
|
||||||
@@ -690,15 +687,15 @@ export default {
|
|||||||
type: 5,
|
type: 5,
|
||||||
};
|
};
|
||||||
RouterEditTask(editObj1)
|
RouterEditTask(editObj1)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
//message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
//message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||||
ctx.emit("changeData", false);
|
ctx.emit("changeData", false);
|
||||||
state.addLoading = false;
|
state.addLoading = false;
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
//message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
//message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||||
});
|
});
|
||||||
} else if (props.isLevel == 2) {
|
} else if (props.isLevel == 2) {
|
||||||
let editObj = {
|
let editObj = {
|
||||||
courseId: res.data.data.examinationId,
|
courseId: res.data.data.examinationId,
|
||||||
@@ -711,13 +708,13 @@ export default {
|
|||||||
};
|
};
|
||||||
// 新增编辑或新增项目
|
// 新增编辑或新增项目
|
||||||
ProjectEditTask(editObj)
|
ProjectEditTask(editObj)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
//message.success(`${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
//message.success(`${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||||
ctx.emit("changeData", false);
|
ctx.emit("changeData", false);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||||
});
|
});
|
||||||
} else if (props.isLevel == 3) {
|
} else if (props.isLevel == 3) {
|
||||||
addTempTask({
|
addTempTask({
|
||||||
courseId: res.data.data.examinationId,
|
courseId: res.data.data.examinationId,
|
||||||
@@ -728,13 +725,13 @@ export default {
|
|||||||
stageId: props.chooseStageId || 0,
|
stageId: props.chooseStageId || 0,
|
||||||
type: 5,
|
type: 5,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
//message.success( `${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
//message.success( `${props.EditTestId ? "编辑" : "新增"}阶段任务成功`);
|
||||||
ctx.emit("changeData", false);
|
ctx.emit("changeData", false);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -761,12 +758,10 @@ export default {
|
|||||||
const changeOuter = (value) => {
|
const changeOuter = (value) => {
|
||||||
state.isOuter = value;
|
state.isOuter = value;
|
||||||
};
|
};
|
||||||
const chooseTest = () => {
|
const chooseTest = () => {};
|
||||||
|
|
||||||
};
|
|
||||||
const closeTag = (removedTag) => {
|
const closeTag = (removedTag) => {
|
||||||
const tags = state.choosedTestList.filter(
|
const tags = state.choosedTestList.filter(
|
||||||
(item) => item.key != removedTag
|
(item) => item.key != removedTag
|
||||||
);
|
);
|
||||||
state.choosedTestList = tags;
|
state.choosedTestList = tags;
|
||||||
};
|
};
|
||||||
@@ -795,7 +790,7 @@ export default {
|
|||||||
formRef,
|
formRef,
|
||||||
delTag,
|
delTag,
|
||||||
// layout,
|
// layout,
|
||||||
|
|
||||||
updateTest,
|
updateTest,
|
||||||
queryTest,
|
queryTest,
|
||||||
changeOuter,
|
changeOuter,
|
||||||
|
|||||||
Reference in New Issue
Block a user