【修改】换题界面搜索试题关键字改为试题内容

【新增】出题界面排序,修改图标
This commit is contained in:
YOHO\20373
2025-06-24 10:34:24 +08:00
parent 8ffbff635b
commit ac9b210466
9 changed files with 701 additions and 283 deletions

View File

@@ -194,7 +194,7 @@
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="scoreRate" label="权值" width="90" />
<el-table-column prop="content" label="文件名(不带后缀)" width="260" />
<el-table-column prop="content" label="文件名" width="260" />
<el-table-column prop="contentIn" label="考察类型" width="300" />
</el-table>
</div>
@@ -219,9 +219,9 @@
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column type="index" label="序号" />
<el-table-column label="文件名(不带后缀)" width="260">
<el-table-column label="文件名" >
<template #default="scope">
<el-input
v-model="scope.row.content"
@@ -230,7 +230,7 @@
/>
</template>
</el-table-column>
<el-table-column label="权值" width="100">
<el-table-column label="权值" >
<template #default="scope">
<el-input
v-model="scope.row.scoreRate"
@@ -240,7 +240,7 @@
/>
</template>
</el-table-column>
<el-table-column label="考察类型" width="300">
<el-table-column label="考察类型" >
<template #default="scope">
<el-select
v-model="scope.row.contentIn"
@@ -253,17 +253,32 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-button
type="danger"
size="small"
@click="removeKaodian(scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="160">
<template #default="{ $index }">
<el-button
:icon="ArrowUp"
circle
size="small"
@click="moveUp($index)"
title="上移"
/>
<el-button
:icon="ArrowDown"
circle
size="small"
@click="moveDown($index)"
title="下移"
/>
<el-button
:icon="Delete"
circle
type="danger"
size="small"
@click="removeKaodian($index)"
title="删除"
/>
</template>
</el-table-column>
</el-table>
@@ -403,6 +418,7 @@
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { FormRules } from 'element-plus'
import * as QuestionApi from '@/api/paper/question'
import { ArrowUp, ArrowDown, Delete } from '@element-plus/icons-vue'
import FileForm from './components/FileForm.vue';
import * as SpecialtyApi from '@/api/points'
import { defaultProps, handleTree } from '@/utils/tree'
@@ -518,7 +534,29 @@ function removeKaodian(index: number) {
kaodiaRefList.value.splice(index, 1)
}
// 上移
function moveUp(index) {
if (index === 0) return;
const temp = this.kaodiaRefList[index];
this.kaodiaRefList.splice(index, 1);
this.kaodiaRefList.splice(index - 1, 0, temp);
this.updateSort();
}
// 下移
function moveDown(index) {
if (index === this.kaodiaRefList.length - 1) return;
const temp = this.kaodiaRefList[index];
this.kaodiaRefList.splice(index, 1);
this.kaodiaRefList.splice(index + 1, 0, temp);
this.updateSort();
}
// 重新赋值 sort 字段(保持顺序)
function updateSort() {
this.kaodiaRefList.forEach((item, index) => {
item.sort = index + 1;
});
}
// 增加行
function addKaodianRow() {

View File

@@ -244,7 +244,7 @@
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="scoreRate" label="权值" width="90" />
<el-table-column prop="content" label="文件/文件夹名(带后缀)" width="260" />
<el-table-column prop="content" label="文件/文件夹名(带后缀)" width="180" />
<el-table-column prop="contentIn" label="考察类型" width="300" />
</el-table>
</div>
@@ -266,9 +266,9 @@
row-key="answerId"
:default-expand-all="false"
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column type="index" label="序号" />
<el-table-column label="文件/文件夹名(带后缀)" width="260">
<el-table-column label="文件/文件夹名(带后缀)" >
<template #default="scope">
<el-input
v-model="scope.row.content"
@@ -279,7 +279,7 @@
/>
</template>
</el-table-column>
<el-table-column label="权值" width="100">
<el-table-column label="权值" >
<template #default="scope">
<el-input
v-model="scope.row.scoreRate"
@@ -289,7 +289,7 @@
/>
</template>
</el-table-column>
<el-table-column label="考察类型" width="300">
<el-table-column label="考察类型" >
<template #default="scope">
<el-select
v-model="scope.row.contentIn"
@@ -303,40 +303,50 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-table-column label="操作" width="160">
<template #default="{ $index }">
<el-button
:icon="ArrowUp"
circle
size="small"
@click="moveUp($index)"
title="上移"
/>
<el-button
:icon="ArrowDown"
circle
size="small"
@click="moveDown($index)"
title="下移"
/>
<el-button
:icon="Delete"
circle
type="danger"
size="small"
@click="removeKaodian(scope.$index)"
>
删除
</el-button>
@click="removeKaodian($index)"
title="删除"
/>
</template>
</el-table-column>
</el-table>
<!-- 增加按钮 -->
<div style="margin-top: 12px; text-align: center;">
<el-button type="primary" @click="setKaodianRow">
导入考点
</el-button>
<el-button type="primary" @click="addKaodianRow">
添加考点
</el-button>
</div>
</div>
<!-- 增加按钮 -->
<div style="margin-top: 12px; text-align: center;">
<el-button type="primary" @click="setKaodianRow">
导入考点
</el-button>
<el-button type="primary" @click="addKaodianRow">
添加考点
</el-button>
</div>
</div>
<template #footer>
<el-button @click="kaoDialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmKao">确定</el-button>
</template>
</el-dialog>
<el-button @click="kaoDialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmKao">确定</el-button>
</template>
</el-dialog>
@@ -459,6 +469,7 @@
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { FormRules } from 'element-plus'
import { ArrowUp, ArrowDown, Delete } from '@element-plus/icons-vue'
import * as QuestionApi from '@/api/paper/question'
import FileForm from './components/FileForm.vue';
import { defaultProps, handleTree } from '@/utils/tree'
@@ -662,7 +673,29 @@ function addKaodianRow() {
function removeKaodian(index: number) {
kaodiaRefList.value.splice(index, 1)
}
// 上移
function moveUp(index) {
if (index === 0) return;
const temp = this.kaodiaRefList[index];
this.kaodiaRefList.splice(index, 1);
this.kaodiaRefList.splice(index - 1, 0, temp);
this.updateSort();
}
// 下移
function moveDown(index) {
if (index === this.kaodiaRefList.length - 1) return;
const temp = this.kaodiaRefList[index];
this.kaodiaRefList.splice(index, 1);
this.kaodiaRefList.splice(index + 1, 0, temp);
this.updateSort();
}
// 重新赋值 sort 字段(保持顺序)
function updateSort() {
this.kaodiaRefList.forEach((item, index) => {
item.sort = index + 1;
});
}
const setKaodianRow =async () => {
const uploads = formData.value.fileUploads;

View File

@@ -459,6 +459,7 @@ const kaodianData = ref({
const formRules = reactive<FormRules>({
// specialtyName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }]
tname: [{ required: true, message: '数据库库名称不能为空', trigger: 'blur' }]
})
const formRef = ref() // 表单 Ref
// 左侧试题描述