【新增】试题知识点,mysql、文件、浏览器试题框架

This commit is contained in:
YOHO\20373
2025-05-20 13:54:03 +08:00
committed by 陆光LG
parent 8cfd7cccba
commit 52bff24959
5 changed files with 1881 additions and 8 deletions

View File

@@ -247,10 +247,17 @@
<ChoiceForm ref="formRef" @success="getList" />
<!-- 添加或修改C语言程序设计 -->
<CdesignForm ref="cformRef" @success="getList" />
<!-- 用户导入对话框 -->
<UserImportForm ref="importFormRef" @success="getList" />
<!-- 分配角色 -->
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" />
<MdesignForm ref="mformRef" @success="getList" />
<BdesignForm ref="bformRef" @success="getList" />
<FdesignForm ref="fformRef" @success="getList" />
</template>
<script lang="ts" setup>
import { checkPermi } from '@/utils/permission'
@@ -262,13 +269,15 @@ import * as QuestionApi from '@/api/paper/question'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import ChoiceForm from './ChoiceForm.vue'
import CdesignForm from './CdesignForm.vue'
import MdesignForm from './MysqlForm.vue'
import BdesignForm from './BrowerForm.vue'
import FdesignForm from './FileForm.vue'
import UserImportForm from './UserImportForm.vue'
import UserAssignRoleForm from './UserAssignRoleForm.vue'
import DeptTree from './DeptTree.vue'
import SpecialtyTree from './SpecialtyTree.vue'
import {handleTree} from "@/utils/tree";
import * as SpecialtyApi from '@/api/points'
defineOptions({ name: 'SystemUser' })
const message = useMessage() // 消息弹窗
@@ -281,21 +290,32 @@ const queryParams = reactive({
specialtyName: "",
courseName: "",
subjectName: "",
audit:"",
pointNames:"",
pageNo: 1,
pageSize: 10,
})
const queryFormRef = ref() // 搜索的表单
const specialtyList = ref<Tree[]>([]) // 树形结构
const respoint = ref<Tree[]>([]) // 树形结构
/** 获得部门树 */
const getTree = async () => {
const res = await UserApi.getSpecialtyByUserId()
specialtyList.value = []
specialtyList.value.push(...handleTree(res))
}
const getTreePoint = async () => {
const res = await SpecialtyApi.listPoints()
respoint.value = []
respoint.value.push(...handleTree(res))
}
/** 查询列表 */
const getList = async () => {
await getTree();
await getTreePoint();
loading.value = true
try {
const data = await QuestionApi.getQuestionList(queryParams);
@@ -321,10 +341,28 @@ const resetQuery = () => {
queryFormRef.value?.resetFields()
handleQuery()
}
const choosePointsType = ref('');
/** 处理部门被点击 */
const handleDeptNodeClick = async (row) => {
// queryParams.deptId = row.id
choosePointsType.value = row.name;
// 判断点击的层级结构,进行入参
if (!row.children != null){
}
console.log(respoint.value+"respoint.value")
const specArr: any = findNamePathFromTreeList(respoint.value, row.id)
console.log(specArr+"specArr")
// 判断长度赋值
if (specArr.length == 1) {
}
if (specArr.length == 2) {
}
if (specArr.length == 3) {
queryParams.pointNames = specArr[2]
console.log(queryParams.pointNames +"queryParams.pointNames ")
}
await getList()
}
@@ -441,6 +479,9 @@ const findNamePathFromTreeList = (treeList: Tree[], targetId: number): string[]
/** 添加/修改操作 */
const formRef = ref()
const cformRef = ref()
const mformRef = ref()
const bformRef = ref()
const fformRef = ref()
const openForm = (type: string, id?: number) => {
console.log(queryParams)
if (queryParams.subjectName == "") {
@@ -448,8 +489,14 @@ const openForm = (type: string, id?: number) => {
}
if (chooseQuestionType.value.includes("选择题")){
formRef.value.open(queryParams, type, id)
} else {
} else if(chooseQuestionType.value.includes("编程题")) {
cformRef.value.open(type, id)
}else if(chooseQuestionType.value.includes("程序设计")) {
mformRef.value.open(queryParams,type, id)
}else if(chooseQuestionType.value.includes("网络题")) {
bformRef.value.open(queryParams,type, id)
}else if(chooseQuestionType.value.includes("文件处理")) {
fformRef.value.open(queryParams,type, id)
}
}