【修改】出题知识点可选择,数据时效性,MYSQL判分语句增加默认权值

【增加】试卷任务参数,在已有的试卷抽卷
This commit is contained in:
YOHO\20373
2025-06-09 10:31:14 +08:00
committed by 陆光LG
parent 5cd9e9dfbf
commit a54e22610d
49 changed files with 3727 additions and 2186 deletions

View File

@@ -74,8 +74,8 @@
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<!-- <el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> -->
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<!-- <el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> -->
<el-button
type="danger"
class="ele-btn-del"
@@ -158,7 +158,7 @@
<el-table-column
label="章节名称"
align="center"
prop="chapteridDictText"
prop="chapteridDictTextVo"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column
@@ -182,7 +182,7 @@
<el-table-column
label="知识点"
align="center"
prop="pointNames"
prop="pointNamesVo"
:show-overflow-tooltip="true"
/>
<el-table-column
@@ -286,7 +286,7 @@
<el-form-item label="学校" prop="name">
<el-input
v-model="queryParamsSchool.name"
placeholder="请输入试卷编号"
placeholder="请输入学校名称"
clearable
class="!w-240px"
@keyup.enter="handleQuerySchool"
@@ -381,6 +381,8 @@ const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数
const queryParams = reactive({
chapteridDictTextVo:'',
pointNamesVo:'',
specialtyName: "",
courseName: "",
subjectName: "",
@@ -414,7 +416,12 @@ const getList = async () => {
await getTreePoint();
loading.value = true
try {
const data = await QuestionApi.getQuestionList(queryParams);
const params = {
...queryParams,
pointNames: queryParams.pointNamesVo,
chapteridDictText: queryParams.chapteridDictTextVo,
};
const data = await QuestionApi.getQuestionList(params);
list.value = data.list
total.value = data.total
} finally {
@@ -444,15 +451,23 @@ const handleDeptNodeClick = async (row) => {
// 判断点击的层级结构,进行入参
if (!row.children != null){
}
const specArr: any = findNamePathFromTreeList(respoint.value, row.id)
const specArr: any = findIdPathFromTreeList(respoint.value, row.id)
console.log(specArr+"specArr")
console.log(specArr[1].name+"specArr[1].name")
console.log(specArr[1].id+"specArr[1].name")
// 判断长度赋值
if (specArr.length == 1) {
}
if (specArr.length == 2) {
}
if (specArr.length == 3) {
queryParams.chapteridDictText=specArr[1]
queryParams.pointNames = specArr[2]
queryParams.chapteridDictText=specArr[1].name;
queryParams.pointNames = specArr[2].name;
queryParams.chapteridDictTextVo = specArr[1].id;
queryParams.pointNamesVo = specArr[2].id;
}
await getList()
}
@@ -516,7 +531,7 @@ const handleAudit = async () => {
type: '0',
quIds: selectedRows.value
}
// await QuestionApi.auditQuestion(requestBody)
await QuestionApi.auditQuestion(requestBody)
message.success(t('推送成功'))
// 刷新列表
await getList()
@@ -560,6 +575,12 @@ const handleQuerySchool = () => {
queryParamsSchool.pageNo = 1
getSchoolList()
}
const resetQuerySchool = () => {
queryParamsSchool.name = ''
}
const handleCloseSyncDialog = () => {
syncDialogVisible.value = false
queryParamsSchool.name = ''
@@ -663,6 +684,26 @@ const findNamePath = (
}
return null
}
// 递归查找路径,返回包含 id 和 name 的路径数组
const findIdNamePath = (
node: Tree,
targetId: number,
path: Array<{ id: number, name: string }> = []
): Array<{ id: number, name: string }> | null => {
const currentPath = [...path, { id: node.id, name: node.name }]
if (node.id === targetId) {
return currentPath
}
if (node.children && node.children.length > 0) {
for (const child of node.children) {
const result = findIdNamePath(child, targetId, currentPath)
if (result) return result
}
}
return null
}
/** 入口函数:支持根节点是数组的情况 */
const findNamePathFromTreeList = (treeList: Tree[], targetId: number): string[] | null => {
for (const tree of treeList) {
@@ -671,6 +712,19 @@ const findNamePathFromTreeList = (treeList: Tree[], targetId: number): string[]
}
return null
}
// 遍历树列表查找路径
const findIdPathFromTreeList = (
treeList: Tree[],
targetId: number
): Array<{ id: number, name: string }> | null => {
for (const tree of treeList) {
const result = findIdNamePath(tree, targetId)
if (result) return result
}
return null
}
/** 添加/修改操作 */
const formRef = ref()
const cformRef = ref()
@@ -709,8 +763,9 @@ const importFormRef = ref()
const handleStatusChange = async (row: any) => {
try {
// 修改状态的二次确认
await message.confirm('确认要修改' + row.quId + '"试题状态吗?')
await message.confirm('确认要修改' + row.quNum + '"试题状态吗?')
// 发起修改状态
QuestionApi.updateQuStatus(row.quId,row.status);
// 刷新列表
await getList()
} catch {
@@ -744,7 +799,15 @@ const handleCommand = (command: string, row: UserApi.UserVO) => {
const handleDelete = async (id: number) => {
try {
// 删除的二次确认
await message.delConfirm()
await ElMessageBox.confirm(
'只能删除未被使用的试题,是否确认删除?',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
);
// 发起删除
await QuestionApi.removeQuestions(id)
message.success(t('common.delSuccess'))
@@ -760,7 +823,16 @@ const handleDeletes = async () => {
message.error('请至少选择一条数据');
return;
}
// 删除的二次确认
await ElMessageBox.confirm(
'只能删除未被使用的试题,是否确认删除?',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
);
selectedRows.value = rows.map((d: any) => d.quId); // 保存选中的行数据
await QuestionApi.removeQuestions(selectedRows.value)
message.success(t('common.delSuccess'))