【新增】mysql出题界面
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container " >
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:data="deptList"
|
:data="deptList"
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="章节名称" prop="chapteridDictText">
|
<el-form-item label="章节名称" prop="chapteridDictText">
|
||||||
<el-input v-model="formData.chapteridDictText" placeholder="请输入章节名称" />
|
<el-input v-model="formData.chapteridDictText" placeholder="请输入章节名称" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<el-form-item label="启用状态" prop="status">
|
<el-form-item label="启用状态" prop="status">
|
||||||
<el-radio-group v-model="formData.status">
|
<el-radio-group v-model="formData.status">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYS_STATUS)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
>
|
>
|
||||||
@@ -64,6 +64,8 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -80,100 +82,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="edit-right bottom-common">
|
<div class="edit-right bottom-common">
|
||||||
<el-tabs v-model="rightActiveName" class="demo-tabs" @tab-click="rightHandleClick">
|
<el-tabs v-model="rightActiveName" class="demo-tabs" @tab-click="rightHandleClick">
|
||||||
<!-- <el-tab-pane class="answer" label="试题答案" name="answer">
|
|
||||||
<div class="block">
|
|
||||||
<div class="tip">
|
|
||||||
<p>答案设置 | 选项数:</p>
|
|
||||||
<el-select
|
|
||||||
v-model="optionNumVal"
|
|
||||||
class="m-2"
|
|
||||||
placeholder="Select"
|
|
||||||
size="large"
|
|
||||||
style="width: 30%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in optionNumber"
|
|
||||||
:key="item"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<el-radio-group v-model="radio">
|
|
||||||
<div class="options" v-for="item in optionNumVal" :key="item">
|
|
||||||
<div class="content">
|
|
||||||
<el-radio :label="String.fromCharCode(64 + item)">
|
|
||||||
{{ String.fromCharCode(64 + item) }}
|
|
||||||
</el-radio>
|
|
||||||
<el-input
|
|
||||||
class="text"
|
|
||||||
v-model="optionsContent[item]"
|
|
||||||
:rows="3"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请输入答案内容"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<el-button class="more-btn" @click="moreEdit">更多…</el-button>
|
|
||||||
</div>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane> -->
|
|
||||||
<el-tab-pane label="试题解析" name="analysis">
|
<el-tab-pane label="试题解析" name="analysis">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<Editor v-model="formData.analysis" height="150px" />
|
<Editor v-model="formData.analysis" height="150px" />
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane name="keyword">
|
|
||||||
<template #label>
|
|
||||||
<div class="custom-tabs-label">
|
|
||||||
<p>关键字</p>
|
|
||||||
<el-dropdown>
|
|
||||||
<span class="el-dropdown-link" @click.stop="false">
|
|
||||||
<div class="setting_icon"></div>
|
|
||||||
</span>
|
|
||||||
<template #dropdown>
|
|
||||||
<el-dropdown-menu>
|
|
||||||
<el-dropdown-item @click="editKeyword('create')">新建</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click="editKeyword('create')">编辑</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click="editKeyword('delete')">删除</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click="editKeyword('deleteall')"
|
|
||||||
>删除全部</el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="block">
|
|
||||||
<el-table
|
|
||||||
:data="keywordList"
|
|
||||||
style="width: 100%"
|
|
||||||
@selection-change="handleKeywordSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column prop="keyword" label="关键字" />
|
|
||||||
</el-table>
|
|
||||||
<el-dialog
|
|
||||||
v-model="keyVisible"
|
|
||||||
title="编辑关键字"
|
|
||||||
width="50%"
|
|
||||||
:before-close="keyDialogClose"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:close-on-press-escape="false"
|
|
||||||
>
|
|
||||||
<div class="main" style="width: 100%; height: 100%">
|
|
||||||
<el-input v-model="keyWord" placeholder="请输入关键字" size="large" />
|
|
||||||
<div class="dialog-footer" style="margin-top: 20px;">
|
|
||||||
<el-button @click="keyDialogClose">取消</el-button>
|
|
||||||
<el-button type="primary" @click="confirmKeyDialogVisible">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane name="medium">
|
<el-tab-pane name="medium">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="custom-tabs-label">
|
<div class="custom-tabs-label">
|
||||||
@@ -237,15 +152,48 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 提示 -->
|
||||||
|
<el-alert type="warning" show-icon :closable="false">
|
||||||
|
<template #default>
|
||||||
|
<span>提示:文件名称可默认不设置</span>
|
||||||
|
</template>
|
||||||
|
</el-alert>
|
||||||
|
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-table
|
<el-table :data="documentList" style="width: 100%">
|
||||||
:data="documentList"
|
<el-table-column type="index" label="#" width="50" />
|
||||||
style="width: 100%"
|
<el-table-column label="文件名称" width="250">
|
||||||
@selection-change="handleDocumentSelectionChange"
|
<template #default="scope">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row.fileName"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入文件名称"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="fileType"
|
||||||
|
label="类型"
|
||||||
|
:formatter="fileTypeFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="url" label="地址" width="200">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div
|
||||||
|
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"
|
||||||
|
:title="row.url"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
{{ row.url }}
|
||||||
<el-table-column prop="type" label="附件" />
|
</div>
|
||||||
<el-table-column prop="size" label="大小" width="80" />
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" plain @click="openForm(scope.row.fileType)">
|
||||||
|
<Icon icon="ep:upload" class="mr-5px" /> 上传
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -260,12 +208,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<FileForm ref="FileRef" @success="handleUploadSuccess"/>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { FormRules } from 'element-plus'
|
import { FormRules } from 'element-plus'
|
||||||
import * as QuestionApi from '@/api/paper/question'
|
import * as QuestionApi from '@/api/paper/question'
|
||||||
|
import FileForm from './components/FileForm.vue';
|
||||||
defineOptions({ name: 'ChoiceForm' })
|
defineOptions({ name: 'ChoiceForm' })
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@@ -287,9 +239,30 @@ const formData = ref({
|
|||||||
pointNames: '',
|
pointNames: '',
|
||||||
audit: '',
|
audit: '',
|
||||||
subjectName: '',
|
subjectName: '',
|
||||||
status: '',
|
status: ' ',
|
||||||
resourceValue: ''
|
resourceValue: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function fileTypeFormatter(row, column, cellValue) {
|
||||||
|
if (cellValue === '1') return '考试文件'
|
||||||
|
if (cellValue === '2') return '结果文件'
|
||||||
|
return '未知类型'
|
||||||
|
}
|
||||||
|
const documentList = ref([
|
||||||
|
{
|
||||||
|
quId: '',
|
||||||
|
url: '',
|
||||||
|
fileType: '1',
|
||||||
|
fileName: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
quId: '',
|
||||||
|
url: '',
|
||||||
|
fileType: '2',
|
||||||
|
fileName: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
])
|
||||||
const formRules = reactive<FormRules>({
|
const formRules = reactive<FormRules>({
|
||||||
// specialtyName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }]
|
// specialtyName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
@@ -301,40 +274,23 @@ const rightActiveName = ref('answer')
|
|||||||
const rightHandleClick = (tab, e) => {
|
const rightHandleClick = (tab, e) => {
|
||||||
rightActiveName.value = tab.paneName.value
|
rightActiveName.value = tab.paneName.value
|
||||||
}
|
}
|
||||||
const optionNumVal = ref(4)
|
|
||||||
const optionNumber = ref(26)
|
|
||||||
const radio = ref('A')
|
const radio = ref('A')
|
||||||
const annexList = ref([])
|
|
||||||
// 保留选项的值
|
// 保留选项的值
|
||||||
const optionsContent = reactive({})
|
const optionsContent = reactive({})
|
||||||
|
|
||||||
// 关键字
|
// 关键字
|
||||||
|
|
||||||
const keywordList = ref([] as any)
|
|
||||||
const multipleKeywordSelection = ref([] as any)
|
const multipleKeywordSelection = ref([] as any)
|
||||||
const handleKeywordSelectionChange = (val: any) => {
|
const handleKeywordSelectionChange = (val: any) => {
|
||||||
multipleKeywordSelection.value = val
|
multipleKeywordSelection.value = val
|
||||||
}
|
}
|
||||||
const keyVisible = ref(false)
|
|
||||||
const keyEditType = ref('')
|
|
||||||
|
|
||||||
const keyWord = ref([null])
|
const keyWord = ref([null])
|
||||||
|
|
||||||
const editKeyword = (key) => {
|
/** 添加/修改操作 */
|
||||||
keyEditType.value = key
|
const FileRef = ref()
|
||||||
keyVisible.value = true
|
const openForm = (type: string) => {
|
||||||
}
|
FileRef.value.open(type)
|
||||||
const keyDialogClose = () => {
|
|
||||||
keyVisible.value = false
|
|
||||||
}
|
|
||||||
const confirmKeyDialogVisible = () => {
|
|
||||||
if (keyEditType.value === 'create') {
|
|
||||||
keywordList.value.push({
|
|
||||||
keyword: keyWord.value
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
keyVisible.value = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 媒体文件
|
// 媒体文件
|
||||||
@@ -345,13 +301,17 @@ const handleMediumSelectionChange = (val: any) => {
|
|||||||
}
|
}
|
||||||
const fileList = []
|
const fileList = []
|
||||||
|
|
||||||
// 媒体文件
|
|
||||||
const documentList = ref([] as any)
|
|
||||||
const multipleDocumentSelection = ref([] as any)
|
const multipleDocumentSelection = ref([] as any)
|
||||||
const handleDocumentSelectionChange = (val: any) => {
|
const handleDocumentSelectionChange = (val: any) => {
|
||||||
multipleDocumentSelection.value = val
|
multipleDocumentSelection.value = val
|
||||||
}
|
}
|
||||||
|
const handleUploadSuccess = ({ url, fileType }) => {
|
||||||
|
const index = documentList.value.findIndex(item => item.fileType === fileType)
|
||||||
|
if (index !== -1) {
|
||||||
|
documentList.value[index].url = url
|
||||||
|
}
|
||||||
|
}
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (queryParams: any ,type: string, id?: number) => {
|
const open = async (queryParams: any ,type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@@ -363,20 +323,10 @@ const open = async (queryParams: any ,type: string, id?: number) => {
|
|||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await QuestionApi.getQuestion(id)
|
const res = await QuestionApi.getQuestion(id)
|
||||||
// for (let i = 0; i < formData.value.answerList.length; i++) {
|
formData.value =res
|
||||||
// if (formData.value.answerList[i].isRight === '0') {
|
documentList.value=res.fileUploads
|
||||||
// let num = Number(i);
|
|
||||||
// let nums = '';
|
|
||||||
// if (num >= 0 && num <= 25) {
|
|
||||||
// nums = String.fromCharCode(num + 65);
|
|
||||||
// } else {
|
|
||||||
// return '请输入 0-25 之间的数字';
|
|
||||||
// }
|
|
||||||
// radio.value = nums;
|
|
||||||
// }
|
|
||||||
// optionsContent[i + 1] = formData.value.answerList[i].content;
|
|
||||||
// }
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -385,6 +335,9 @@ const open = async (queryParams: any ,type: string, id?: number) => {
|
|||||||
formData.value.courseName = queryParams.courseName
|
formData.value.courseName = queryParams.courseName
|
||||||
formData.value.subjectName = queryParams.subjectName
|
formData.value.subjectName = queryParams.subjectName
|
||||||
formData.value.pointNames=queryParams.pointNames
|
formData.value.pointNames=queryParams.pointNames
|
||||||
|
formData.value.chapteridDictText=queryParams.chapteridDictText
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
@@ -405,22 +358,7 @@ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成
|
|||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
const values = Object.values(optionsContent);
|
const values = Object.values(optionsContent);
|
||||||
console.log(values)
|
console.log(values)
|
||||||
// 组合数据 (选择题)
|
|
||||||
// 创建临时字段
|
|
||||||
for (let i = 0; i < values.length; i++) {
|
|
||||||
let data = {};
|
|
||||||
data.content = values[i];
|
|
||||||
data.sort = i;
|
|
||||||
// 判断正确答案
|
|
||||||
if (mappedNumber.value === i) {
|
|
||||||
data.isRight = '0';
|
|
||||||
} else {
|
|
||||||
data.isRight = '1';
|
|
||||||
}
|
|
||||||
answerData.value.push(data);
|
|
||||||
}
|
|
||||||
formData.value.answerList = answerData.value;
|
|
||||||
console.log(formData.value.answerList)
|
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
@@ -462,6 +400,7 @@ const resetForm = () => {
|
|||||||
resourceValue: ''
|
resourceValue: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
documentList.value=[]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container ">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:data="specialtyList"
|
:data="specialtyList"
|
||||||
|
107
src/views/paper/question/components/FileForm.vue
Normal file
107
src/views/paper/question/components/FileForm.vue
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog v-model="dialogVisible" title="上传文件">
|
||||||
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
v-model:file-list="fileList"
|
||||||
|
:action="uploadUrl"
|
||||||
|
:auto-upload="false"
|
||||||
|
:data="data"
|
||||||
|
:disabled="formLoading"
|
||||||
|
:limit="1"
|
||||||
|
:on-change="handleFileChange"
|
||||||
|
:on-error="submitFormError"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:on-success="submitFormSuccess"
|
||||||
|
:http-request="httpRequest"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text"> 将文件拖到此处,或 <em>点击上传</em></div>
|
||||||
|
<template #tip>
|
||||||
|
<!-- <div class="el-upload__tip" style="color: red">
|
||||||
|
提示:仅允许导入 jpg、png、gif 格式文件!
|
||||||
|
</div> -->
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
<template #footer>
|
||||||
|
<el-button :disabled="formLoading" type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useUpload } from '@/components/UploadFile/src/useUpload'
|
||||||
|
|
||||||
|
defineOptions({ name: 'InfraFileForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const fileList = ref([]) // 文件列表
|
||||||
|
const data = ref({ path: '' })
|
||||||
|
const uploadRef = ref()
|
||||||
|
|
||||||
|
const { uploadUrl, httpRequest } = useUpload()
|
||||||
|
const currentType = ref(null)
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type) => {
|
||||||
|
currentType.value = type // 记录类型
|
||||||
|
console.log(currentType.value+"123123")
|
||||||
|
dialogVisible.value = true
|
||||||
|
resetForm()
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 处理上传的文件发生变化 */
|
||||||
|
const handleFileChange = (file) => {
|
||||||
|
data.value.path = file.name
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const submitFileForm = () => {
|
||||||
|
if (fileList.value.length == 0) {
|
||||||
|
message.error('请上传文件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
unref(uploadRef)?.submit()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件上传成功处理 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitFormSuccess = (response: any, file: any) => {
|
||||||
|
// response 是后端接口返回的数据
|
||||||
|
// file 是当前上传的文件对象
|
||||||
|
|
||||||
|
// 假设后端返回格式:{ url: '文件地址', fileName: '文件名' }
|
||||||
|
const url = response.data
|
||||||
|
console.log(currentType.value+"v")
|
||||||
|
dialogVisible.value = false
|
||||||
|
formLoading.value = false
|
||||||
|
uploadRef.value?.clearFiles()
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
|
||||||
|
// 触发成功事件,携带文件信息传递给父组件
|
||||||
|
emit('success', { url, fileType: currentType.value })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 上传错误提示 */
|
||||||
|
const submitFormError = (): void => {
|
||||||
|
message.error('上传失败,请您重新上传!')
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
// 重置上传状态和文件
|
||||||
|
formLoading.value = false
|
||||||
|
uploadRef.value?.clearFiles()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件数超出提示 */
|
||||||
|
const handleExceed = (): void => {
|
||||||
|
message.error('最多只能上传一个文件!')
|
||||||
|
}
|
||||||
|
</script>
|
@@ -1,14 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 左侧部门树 -->
|
<!-- 左侧部门树 -->
|
||||||
<el-col :span="4" :xs="24">
|
<el-col :span="4" :xs="24">
|
||||||
<ContentWrap class="h-1/2">
|
<ContentWrap style="height: 50%; overflow-y: auto;">
|
||||||
<SpecialtyTree @node-click="handleSpecialtyNodeClick" />
|
<SpecialtyTree @node-click="handleSpecialtyNodeClick" />
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<ContentWrap class="h-1/2">
|
<ContentWrap style="height: 50%; overflow-y: auto;">
|
||||||
<DeptTree @node-click="handleDeptNodeClick" />
|
<DeptTree @node-click="handleDeptNodeClick" />
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="20" :xs="24">
|
<el-col :span="20" :xs="24">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
@@ -291,6 +292,7 @@ const queryParams = reactive({
|
|||||||
courseName: "",
|
courseName: "",
|
||||||
subjectName: "",
|
subjectName: "",
|
||||||
pointNames:"",
|
pointNames:"",
|
||||||
|
chapteridDictText:"",
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
})
|
})
|
||||||
@@ -348,20 +350,15 @@ const handleDeptNodeClick = async (row) => {
|
|||||||
// 判断点击的层级结构,进行入参
|
// 判断点击的层级结构,进行入参
|
||||||
if (!row.children != null){
|
if (!row.children != null){
|
||||||
}
|
}
|
||||||
console.log(respoint.value+"respoint.value")
|
|
||||||
const specArr: any = findNamePathFromTreeList(respoint.value, row.id)
|
const specArr: any = findNamePathFromTreeList(respoint.value, row.id)
|
||||||
console.log(specArr+"specArr")
|
|
||||||
// 判断长度赋值
|
// 判断长度赋值
|
||||||
if (specArr.length == 1) {
|
if (specArr.length == 1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
if (specArr.length == 2) {
|
if (specArr.length == 2) {
|
||||||
|
|
||||||
}
|
}
|
||||||
if (specArr.length == 3) {
|
if (specArr.length == 3) {
|
||||||
|
queryParams.chapteridDictText=specArr[1]
|
||||||
queryParams.pointNames = specArr[2]
|
queryParams.pointNames = specArr[2]
|
||||||
console.log(queryParams.pointNames +"queryParams.pointNames ")
|
|
||||||
}
|
}
|
||||||
await getList()
|
await getList()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user