|
|
@@ -60,7 +60,7 @@
|
|
|
<div class="page_jg_16"></div>
|
|
|
<div class="table_42">
|
|
|
<el-table :data="tableData" v-loading="tableLoading" element-loading-text="加载中……" element-loading-spinner="el-icon-loading" element-loading-background="#ffffff" style="width: 100%" :height="tableHeight">
|
|
|
- <el-table-column prop="questionName" label="题目名称" width="100">
|
|
|
+ <el-table-column prop="questionName" label="题目名称" width="80">
|
|
|
</el-table-column>
|
|
|
<!-- 题目类型 questionType 1 单校 2多选 -->
|
|
|
<el-table-column prop="questionType" label="题目类型" width="120">
|
|
|
@@ -71,7 +71,7 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="date" label="标注答案" width="242">
|
|
|
+ <el-table-column prop="date" label="标注答案" width="442">
|
|
|
<template v-slot="scope">
|
|
|
<div class="answer_input">
|
|
|
<!-- 单选题 -->
|
|
|
@@ -91,7 +91,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fullScore" label="满分" width="120">
|
|
|
+ <el-table-column prop="fullScore" label="满分" width="90">
|
|
|
<template v-slot="scope">
|
|
|
<div class="full_mark_input">
|
|
|
<el-input v-model="scope.row.fullScore" maxlength="3" @input="(val: any) => onScoreInput(scope.row, 'fullScore', val)"></el-input>
|
|
|
@@ -126,7 +126,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="操作" width="150">
|
|
|
+ <el-table-column prop="name" label="操作" width="100">
|
|
|
<template v-slot="scope">
|
|
|
<div class="ele_button table_row_button">
|
|
|
<span class="btn_editor" @click="EditorSingle(scope.row)">编辑</span>
|
|
|
@@ -520,10 +520,12 @@ const EditorAnswerEnter=async (item:any)=>{
|
|
|
//删除单个题目 需要二次弹窗确认提示
|
|
|
const DeleteSingle=(item:any)=>{
|
|
|
console.log("打印删除单个",item)
|
|
|
- ElMessageBox.confirm('确认删除该题目吗?', '提示', {
|
|
|
+ let msg = `确定要删除当前选择的<span style="color:#F56C6C;font-weight:600;">「${item.questionName}」</span>题吗?`;
|
|
|
+ ElMessageBox.confirm(msg, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
customClass:'page_dialog',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
type: 'warning'
|
|
|
}).then(async () => {
|
|
|
console.log('删除考试')
|
|
|
@@ -822,13 +824,32 @@ const GetSmartQuestionList=()=>{
|
|
|
// 增加空值保护,确保 tableData 始终是数组
|
|
|
tableData.value = Array.isArray(res.data) ? res.data : [];
|
|
|
let result={};
|
|
|
+ let maxQuestionNo = 0;//已有试题的最大题号
|
|
|
for (const item of tableData.value) {
|
|
|
// name转数字作为key
|
|
|
const key = (item.questionName);
|
|
|
result[key] = item.standardAnswer;
|
|
|
+ // 提取 questionName 中的数字题号,兼容 "1" / "第1题" 等格式
|
|
|
+ const match = String(item.questionName ?? '').match(/\d+/);
|
|
|
+ if (match) {
|
|
|
+ const no = Number(match[0]);
|
|
|
+ if (no > maxQuestionNo) maxQuestionNo = no;
|
|
|
+ }
|
|
|
}
|
|
|
previewAnswerData.value=result;
|
|
|
console.log("打印转换后的数据",result)
|
|
|
+
|
|
|
+ // 根据已有试题列表设置题目范围默认值
|
|
|
+ // 规则:已有题目 1-10,则 start 从 11 开始,end 为模板最大题数
|
|
|
+ const endMax = Number(templateQuestionEnd.value) || 0;
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
+ queryParams.value.start = maxQuestionNo + 1;
|
|
|
+ queryParams.value.end = endMax;
|
|
|
+ } else {
|
|
|
+ // 无已有试题时,回退为模板完整范围
|
|
|
+ queryParams.value.start = Number(templateQuestionStart.value) || 1;
|
|
|
+ queryParams.value.end = endMax;
|
|
|
+ }
|
|
|
}
|
|
|
}).finally(()=>{
|
|
|
tableLoading.value = false;//关闭表格loading
|