mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
fix:考试任务-增加系统和外部考试区分-增加编辑区分
This commit is contained in:
@@ -18,25 +18,43 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;">
|
<div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;">
|
||||||
<div>
|
<div v-if="taskIndex >= 0">
|
||||||
|
<button
|
||||||
|
v-if="isOuter==1"
|
||||||
|
style="width: 100px; cursor: pointer;"
|
||||||
|
@click="changeOuter(1)"
|
||||||
|
:class="isOuter == 1 ? 'outer' : 'notOuter'"
|
||||||
|
>
|
||||||
|
系统考试
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-else
|
||||||
|
style="width: 100px; cursor: pointer;"
|
||||||
|
@click="changeOuter(2)"
|
||||||
|
:class="isOuter == 2 ? 'outer' : 'notOuter'"
|
||||||
|
>
|
||||||
|
外部考试
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
<button
|
<button
|
||||||
style="width: 100px; cursor: pointer;"
|
style="width: 100px; cursor: pointer;"
|
||||||
@click="changeOuter(1)"
|
@click="changeOuter(1)"
|
||||||
:class="formData.examType === 1 ? 'outer' : 'notOuter'"
|
:class="isOuter == 1 ? 'outer' : 'notOuter'"
|
||||||
>
|
>
|
||||||
系统考试
|
系统考试
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
style="width: 100px; cursor: pointer;"
|
style="width: 100px; cursor: pointer;"
|
||||||
@click="changeOuter(2)"
|
@click="changeOuter(2)"
|
||||||
:class="formData.examType === 2 ? 'outer' : 'notOuter'"
|
:class="isOuter == 2 ? 'outer' : 'notOuter'"
|
||||||
>
|
>
|
||||||
外部考试
|
外部考试
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="formData.examType===1" class="contentMain">
|
<div v-if="isOuter===1" class="contentMain">
|
||||||
<div class="main_left">
|
<div class="main_left">
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
@@ -50,6 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-input
|
<a-input
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
v-model:value="formData.examinationName"
|
v-model:value="formData.examinationName"
|
||||||
style="width: 400px; height: 40px; border-radius: 8px"
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入考试名称"
|
placeholder="请输入考试名称"
|
||||||
@@ -70,13 +89,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<s-test v-model:id="formData.examinationTestId" v-model:name="formData.examinationTestName">
|
<s-test v-model:id="formData.examinationTestId" v-model:name="formData.examinationTestName">
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<button class="xkbtn" @click="selectTest">
|
<button class="xkbtn" @click="selectTest" :disabled="taskIndex >= 0">
|
||||||
{{ formData.examinationTestId ? "重选" : "选择" }}试卷
|
{{ formData.examinationTestId ? "重选" : "选择" }}试卷
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</s-test>
|
</s-test>
|
||||||
<div v-if="formData.examinationTestId">
|
<div v-if="formData.examinationTestId">
|
||||||
<a-tag closable color="processing" @close="delTag">
|
<a-tag closable color="processing" @close="delTag" :closeIcon="taskIndex >= 0">
|
||||||
<span style="font-size: 14px; line-height: 33px">{{ formData.examinationTestName }}</span>
|
<span style="font-size: 14px; line-height: 33px">{{ formData.examinationTestName }}</span>
|
||||||
</a-tag>
|
</a-tag>
|
||||||
</div>
|
</div>
|
||||||
@@ -117,6 +136,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="300"
|
:max="300"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
@@ -138,6 +158,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-input
|
<a-input
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
v-model:value="formData.passLine"
|
v-model:value="formData.passLine"
|
||||||
type="number"
|
type="number"
|
||||||
style="width: 400px; height: 40px; border-radius: 8px"
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
@@ -152,6 +173,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
v-model:value="formData.examinationExplain"
|
v-model:value="formData.examinationExplain"
|
||||||
placeholder="请输入考试说明"
|
placeholder="请输入考试说明"
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -170,6 +192,7 @@
|
|||||||
<div class="timerbox">
|
<div class="timerbox">
|
||||||
<span>允许重复考试:</span>
|
<span>允许重复考试:</span>
|
||||||
<a-input-number
|
<a-input-number
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
:min="-1"
|
:min="-1"
|
||||||
:max="300"
|
:max="300"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
@@ -177,8 +200,7 @@
|
|||||||
width: 100px;
|
width: 100px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;"
|
||||||
"
|
|
||||||
v-model:value="formData.examinationLimit"
|
v-model:value="formData.examinationLimit"
|
||||||
></a-input-number>
|
></a-input-number>
|
||||||
<span style="color: #999999; margin-left: 8px"
|
<span style="color: #999999; margin-left: 8px"
|
||||||
@@ -195,6 +217,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-model:value="formData.showAnswers"
|
v-model:value="formData.showAnswers"
|
||||||
>
|
>
|
||||||
@@ -209,7 +232,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
:disabled="edit"
|
:disabled="taskIndex >= 0"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-model:value="formData.showAnalysis"
|
v-model:value="formData.showAnalysis"
|
||||||
>
|
>
|
||||||
@@ -224,6 +247,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-model:value="formData.scoringModel"
|
v-model:value="formData.scoringModel"
|
||||||
>
|
>
|
||||||
@@ -240,6 +264,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
|
:disabled="taskIndex >= 0"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
v-model:value="formData.questionArrangement"
|
v-model:value="formData.questionArrangement"
|
||||||
>
|
>
|
||||||
@@ -267,7 +292,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formData.examinationName"
|
v-model:value="formDataOuter.examinationName"
|
||||||
style="width: 400px; height: 40px; border-radius: 8px"
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入考试名称"
|
placeholder="请输入考试名称"
|
||||||
:maxlength="20"
|
:maxlength="20"
|
||||||
@@ -286,7 +311,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="formData.source"
|
v-model:value="formDataOuter.source"
|
||||||
style="width: 400px; height: 40px; border-radius: 8px"
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入数据来源"
|
placeholder="请输入数据来源"
|
||||||
:maxlength="20"
|
:maxlength="20"
|
||||||
@@ -299,7 +324,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="formData.externalExplain"
|
v-model:value="formDataOuter.externalExplain"
|
||||||
placeholder="请输入考试说明"
|
placeholder="请输入考试说明"
|
||||||
allow-clear
|
allow-clear
|
||||||
show-count
|
show-count
|
||||||
@@ -312,7 +337,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="main_btns">
|
<div class="main_btns">
|
||||||
<a-button class="btn1" @click="closeDrawer">取消</a-button>
|
<a-button class="btn1" @click="closeDrawer">取消</a-button>
|
||||||
<a-button class="btn2" @click="confirm">确定</a-button>
|
<a-button v-if="isOuter==1" class="btn2" @click="confirm">确定</a-button>
|
||||||
|
<a-button v-else class="btn2" @click="confirmouter">确定</a-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 加载动画 -->
|
<!-- 加载动画 -->
|
||||||
<div class="aeLoading" :style="{ display: addLoading ? 'flex' : 'none' }">
|
<div class="aeLoading" :style="{ display: addLoading ? 'flex' : 'none' }">
|
||||||
@@ -334,25 +360,52 @@ const props = defineProps({
|
|||||||
taskList: []
|
taskList: []
|
||||||
})
|
})
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const formData = ref({examType: 1})
|
const formData = ref({
|
||||||
|
examType: 1,
|
||||||
|
showAnswers: 2,
|
||||||
|
showAnalysis: 2,
|
||||||
|
scoringModel: 2,
|
||||||
|
questionArrangement: 4
|
||||||
|
})
|
||||||
|
|
||||||
|
const formDataOuter = ref({
|
||||||
|
examType: 2,
|
||||||
|
examinationName:"",
|
||||||
|
source:"",
|
||||||
|
externalExplain:""
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits({})
|
const emit = defineEmits({})
|
||||||
const taskIndex = ref(-1);
|
const taskIndex = ref(-1);
|
||||||
const dateTime = ref([]);
|
const dateTime = ref([]);
|
||||||
|
const isOuter = ref(1);
|
||||||
|
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
visible.value = false
|
visible.value = false
|
||||||
taskIndex.value = -1
|
taskIndex.value = -1
|
||||||
formData.value = {examType: 1}
|
formData.value = {
|
||||||
|
examType: 1,
|
||||||
|
showAnswers: 2,
|
||||||
|
showAnalysis: 2,
|
||||||
|
scoringModel: 2,
|
||||||
|
questionArrangement: 4
|
||||||
|
}
|
||||||
|
formDataOuter.value = ref({
|
||||||
|
examType: 2,
|
||||||
|
examinationName:"",
|
||||||
|
source:"",
|
||||||
|
externalExplain:""
|
||||||
|
})
|
||||||
dateTime.value = []
|
dateTime.value = []
|
||||||
};
|
};
|
||||||
|
|
||||||
const range = (start, end) => {
|
// const range = (start, end) => {
|
||||||
const result = [];
|
// const result = [];
|
||||||
for (let i = start; i < end; i++) {
|
// for (let i = start; i < end; i++) {
|
||||||
result.push(i);
|
// result.push(i);
|
||||||
}
|
// }
|
||||||
return result;
|
// return result;
|
||||||
};
|
// };
|
||||||
|
|
||||||
function timeChange(time, timeStr) {
|
function timeChange(time, timeStr) {
|
||||||
formData.value.examinationStartTime = timeStr[0]
|
formData.value.examinationStartTime = timeStr[0]
|
||||||
@@ -364,11 +417,12 @@ const disabledDate = (current) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const disabledRangeTime = () => ({
|
const disabledRangeTime = () => ({
|
||||||
disabledHours: () => range(0, 24).splice(4, 20),
|
// disabledHours: () => range(0, 24).splice(4, 20),
|
||||||
disabledMinutes: () => range(30, 60),
|
// disabledMinutes: () => range(30, 60),
|
||||||
disabledSeconds: () => [55, 56],
|
// disabledSeconds: () => [55, 56],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 系统考试
|
||||||
function confirm() {
|
function confirm() {
|
||||||
if (!formData.value.examinationName) {
|
if (!formData.value.examinationName) {
|
||||||
message.warning("请输入考试名称");
|
message.warning("请输入考试名称");
|
||||||
@@ -401,16 +455,43 @@ function confirm() {
|
|||||||
const data = props.taskList[taskIndex.value]
|
const data = props.taskList[taskIndex.value]
|
||||||
data.name = formData.value.examinationName
|
data.name = formData.value.examinationName
|
||||||
data.info = formData.value
|
data.info = formData.value
|
||||||
|
data.examType = formData.value == 1 ? 1 : 2
|
||||||
|
}
|
||||||
|
emit('update:taskList', [...props.taskList])
|
||||||
|
closeDrawer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外部考试
|
||||||
|
function confirmouter() {
|
||||||
|
if (!formDataOuter.value.examinationName) {
|
||||||
|
message.warning("请输入考试名称");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!formDataOuter.value.source) {
|
||||||
|
message.warning("请输入数据来源");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (taskIndex.value === -1) {
|
||||||
|
const list = props.taskList
|
||||||
|
list.push({name: formDataOuter.value.examinationName, type: props.type, info: formDataOuter.value})
|
||||||
|
} else {
|
||||||
|
const data = props.taskList[taskIndex.value]
|
||||||
|
data.name = formDataOuter.value.examinationName
|
||||||
|
data.info = formDataOuter.value
|
||||||
|
data.examType = 2
|
||||||
}
|
}
|
||||||
emit('update:taskList', [...props.taskList])
|
emit('update:taskList', [...props.taskList])
|
||||||
closeDrawer()
|
closeDrawer()
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDrawer(i, row) {
|
function openDrawer(i, row) {
|
||||||
row && (formData.value = row.info);
|
row && row.info.examType == 1 ? row && (formData.value = row.info) : row && (formDataOuter.value = row.info);
|
||||||
row && (dateTime.value = [dayjs(row.info.examinationStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.examinationEndTime, "YYYY-MM-DD HH:mm")]);
|
row ? isOuter.value = row.info.examType : isOuter.value = 1;
|
||||||
|
row && row.info.examType == 1 && (dateTime.value = [dayjs(row.info.examinationStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.examinationEndTime, "YYYY-MM-DD HH:mm")]);
|
||||||
(i >= 0) && (taskIndex.value = i);
|
(i >= 0) && (taskIndex.value = i);
|
||||||
visible.value = true
|
visible.value = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const delTag = () => {
|
const delTag = () => {
|
||||||
@@ -419,7 +500,7 @@ const delTag = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changeOuter(v) {
|
function changeOuter(v) {
|
||||||
formData.value.examType = v
|
isOuter.value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({openDrawer})
|
defineExpose({openDrawer})
|
||||||
|
|||||||
Reference in New Issue
Block a user