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