【修改】 word和pptx出题页面
This commit is contained in:

committed by
陆光LG

parent
64780fbfdf
commit
ea32ac97c6
@@ -17,12 +17,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="章节名称" prop="chapteridDictText">
|
||||
<el-input
|
||||
v-model="formData.chapteridDictTextVo"
|
||||
placeholder="请输入章节名称"
|
||||
disabled
|
||||
/>
|
||||
<el-form-item label="知识点" prop="pointNames">
|
||||
<el-input v-model="formData.pointNames" placeholder="请输入知识点" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -34,13 +30,9 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="题型难度" prop="quLevel">
|
||||
<el-select
|
||||
v-model="formData.quLevel"
|
||||
placeholder="请选择题型难度"
|
||||
clearable
|
||||
>
|
||||
<el-select v-model="formData.quLevel" placeholder="请选择题型难度">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.EXAM_QUE_DIFF)"
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.EXAM_QUE_DIFF)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@@ -56,27 +48,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="知识点" prop="pointNames">
|
||||
<el-form-item label="章节名称" prop="chapteridDictText">
|
||||
<el-input
|
||||
v-model="formData.pointNamesVo"
|
||||
placeholder="请选择知识点"
|
||||
readonly
|
||||
@click="openPoints()"
|
||||
v-model="formData.chapteridDictText"
|
||||
placeholder="请输入章节名称"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-dialog v-model="dialogVisiblePoints" title="选择知识点" width="30%">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="deptList"
|
||||
node-key="id"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -87,7 +66,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核状态" prop="audit">
|
||||
<el-select v-model="formData.audit" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
@@ -98,7 +77,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="edit-bottom">
|
||||
@@ -314,7 +293,7 @@ import * as PptxApi from '@/api/wps/pptx'
|
||||
import FileForm from './components/FileForm.vue'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import * as SpecialtyApi from '@/api/points'
|
||||
|
||||
defineOptions({ name: 'WpsPptxFrom' })
|
||||
const pptxPointsList = ref<Tree[]>([]) // 树形结构
|
||||
const pptxPointsInfoList = ref<Tree[]>([]) // 树形结构
|
||||
@@ -328,8 +307,6 @@ const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
pointNamesVo:'',
|
||||
chapteridDictTextVo:'',
|
||||
content: '',
|
||||
specialtyName: '',
|
||||
courseName: '',
|
||||
@@ -337,7 +314,7 @@ const formData = ref({
|
||||
required: '',
|
||||
chapteridDictText: '',
|
||||
analysis: '',
|
||||
quLevel: 0,
|
||||
quLevel: '',
|
||||
pointNames: '',
|
||||
audit: '',
|
||||
subjectName: '',
|
||||
@@ -383,7 +360,8 @@ const pptxPoints = ref({
|
||||
type: '',
|
||||
belongTo: '',
|
||||
isboo: '',
|
||||
function: ''
|
||||
function: '',
|
||||
unit: ''
|
||||
})
|
||||
let pptxPointsInfosList: (typeof pptxPoints)[] = []
|
||||
|
||||
@@ -446,6 +424,7 @@ const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean)
|
||||
pptxPoints.value.belongTo = data.belongTo
|
||||
pptxPoints.value.isboo = data.isboo
|
||||
pptxPoints.value.type = data.type
|
||||
pptxPoints.value.unit = data.unit
|
||||
pptxPointsInfosList.push(cloneDeep(pptxPoints.value))
|
||||
}
|
||||
console.log(data, checked, indeterminate)
|
||||
@@ -654,7 +633,7 @@ const resetForm = () => {
|
||||
required: '',
|
||||
chapteridDictText: '',
|
||||
analysis: '',
|
||||
quLevel: 0,
|
||||
quLevel: '',
|
||||
pointNames: '',
|
||||
audit: '',
|
||||
subjectName: '',
|
||||
@@ -712,56 +691,6 @@ const resetForm = () => {
|
||||
list.value = []
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
const dialogVisiblePoints = ref(false)
|
||||
const openPoints = async () => {
|
||||
await getTree();
|
||||
dialogVisiblePoints.value = true;
|
||||
}
|
||||
// 只允许点击第三级节点
|
||||
const treeRef = ref() // 引用 el-tree
|
||||
const handleNodeClick = (data, node) => {
|
||||
if (data.level === 3) {
|
||||
formData.value.pointNames = data.id
|
||||
formData.value.pointNamesVo = data.name
|
||||
|
||||
// 获取父节点(章节名称)
|
||||
const currentNode = treeRef.value.getNode(data)
|
||||
const parentNode = currentNode.parent
|
||||
if (parentNode && parentNode.data) {
|
||||
formData.value.chapteridDictTextVo = parentNode.data.name
|
||||
formData.value.chapteridDictText = parentNode.data.id
|
||||
} else {
|
||||
formData.value.chapteridDictText = ''
|
||||
}
|
||||
|
||||
dialogVisiblePoints.value = false
|
||||
} else {
|
||||
}
|
||||
}
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
const res = await SpecialtyApi.listPoints()
|
||||
const tree = handleTree(res)
|
||||
deptList.value = []
|
||||
deptList.value = handleTreeWithLevel(tree)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 添加层级信息
|
||||
const handleTreeWithLevel = (list, level = 1) => {
|
||||
return list.map(item => {
|
||||
const node = { ...item, level }
|
||||
if (item.children && item.children.length > 0) {
|
||||
node.children = handleTreeWithLevel(item.children, level + 1)
|
||||
}
|
||||
return node
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.edit-dialog {
|
||||
|
@@ -16,18 +16,11 @@
|
||||
<el-input v-model="formData.specialtyName" placeholder="请输入专业" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="章节名称" prop="chapteridDictText">
|
||||
<el-input
|
||||
v-model="formData.chapteridDictTextVo"
|
||||
placeholder="请输入章节名称"
|
||||
disabled
|
||||
/>
|
||||
<el-form-item label="知识点" prop="pointNames">
|
||||
<el-input v-model="formData.pointNames" placeholder="请输入知识点" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -36,21 +29,21 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
||||
<el-form-item label="题型难度" prop="quLevel">
|
||||
<el-select
|
||||
v-model="formData.quLevel"
|
||||
placeholder="请选择题型难度"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.EXAM_QUE_DIFF)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="题型难度" prop="quLevel">
|
||||
<!-- <el-select v-model="formData.quLevel" placeholder="请选择题型难度" clearable>
|
||||
<el-option label="简单" :value="'0'" />
|
||||
<el-option label="一般" :value="'1'" />
|
||||
<el-option label="困难" :value="'2'" />
|
||||
</el-select> -->
|
||||
<el-select v-model="formData.quLevel" placeholder="请选择题型难度">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.EXAM_QUE_DIFF)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@@ -60,28 +53,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="知识点" prop="pointNames">
|
||||
<el-form-item label="章节名称" prop="chapteridDictText">
|
||||
<el-input
|
||||
v-model="formData.pointNamesVo"
|
||||
placeholder="请选择知识点"
|
||||
readonly
|
||||
@click="openPoints()"
|
||||
v-model="formData.chapteridDictText"
|
||||
placeholder="请输入章节名称"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-dialog v-model="dialogVisiblePoints" title="选择知识点" width="30%">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="deptList"
|
||||
node-key="id"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -92,7 +71,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核状态" prop="audit">
|
||||
<el-select v-model="formData.audit" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
@@ -103,7 +82,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="edit-bottom">
|
||||
@@ -321,7 +300,7 @@ import WordInfo from './components/WordInfo.vue'
|
||||
import WordInfos from './components/WordInfos.vue'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import * as SpecialtyApi from '@/api/points'
|
||||
|
||||
defineOptions({ name: 'WpsWordFrom' })
|
||||
const wordPointsList = ref<Tree[]>([]) // 树形结构
|
||||
const wordPointsInfoList = ref<Tree[]>([]) // 树形结构
|
||||
@@ -336,8 +315,6 @@ const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
pointNamesVo:'',
|
||||
chapteridDictTextVo:'',
|
||||
content: '',
|
||||
specialtyName: '',
|
||||
courseName: '',
|
||||
@@ -345,7 +322,7 @@ const formData = ref({
|
||||
required: '',
|
||||
chapteridDictText: '',
|
||||
analysis: '',
|
||||
quLevel: 0,
|
||||
quLevel: '',
|
||||
pointNames: '',
|
||||
audit: '',
|
||||
subjectName: '',
|
||||
@@ -391,7 +368,9 @@ const wordPoints = ref({
|
||||
type: '',
|
||||
belongTo: '',
|
||||
isboo: '',
|
||||
function: ''
|
||||
function: '',
|
||||
unit: '',
|
||||
isExam: ''
|
||||
})
|
||||
let wordPointsInfosList: (typeof wordPoints)[] = []
|
||||
|
||||
@@ -459,58 +438,12 @@ const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean)
|
||||
wordPoints.value.belongTo = data.belongTo
|
||||
wordPoints.value.isboo = data.isboo
|
||||
wordPoints.value.type = data.type
|
||||
wordPoints.value.unit = data.unit
|
||||
wordPoints.value.isExam = "0"
|
||||
wordPointsInfosList.push(cloneDeep(wordPoints.value))
|
||||
}
|
||||
console.log(data, checked, indeterminate)
|
||||
}
|
||||
const dialogVisiblePoints = ref(false)
|
||||
const openPoints = async () => {
|
||||
await getTree();
|
||||
dialogVisiblePoints.value = true;
|
||||
}
|
||||
// 只允许点击第三级节点
|
||||
const treeRef = ref() // 引用 el-tree
|
||||
const handleNodeClick = (data, node) => {
|
||||
if (data.level === 3) {
|
||||
formData.value.pointNames = data.id
|
||||
formData.value.pointNamesVo = data.name
|
||||
|
||||
// 获取父节点(章节名称)
|
||||
const currentNode = treeRef.value.getNode(data)
|
||||
const parentNode = currentNode.parent
|
||||
if (parentNode && parentNode.data) {
|
||||
formData.value.chapteridDictTextVo = parentNode.data.name
|
||||
formData.value.chapteridDictText = parentNode.data.id
|
||||
} else {
|
||||
formData.value.chapteridDictText = ''
|
||||
}
|
||||
|
||||
dialogVisiblePoints.value = false
|
||||
} else {
|
||||
}
|
||||
}
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
const res = await SpecialtyApi.listPoints()
|
||||
const tree = handleTree(res)
|
||||
deptList.value = []
|
||||
deptList.value = handleTreeWithLevel(tree)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 添加层级信息
|
||||
const handleTreeWithLevel = (list, level = 1) => {
|
||||
return list.map(item => {
|
||||
const node = { ...item, level }
|
||||
if (item.children && item.children.length > 0) {
|
||||
node.children = handleTreeWithLevel(item.children, level + 1)
|
||||
}
|
||||
return node
|
||||
})
|
||||
}
|
||||
|
||||
const addWordInfo = async () => {
|
||||
var filePath = ''
|
||||
@@ -539,7 +472,6 @@ const chineseName = ref('')
|
||||
const nodeFunctions = ref('')
|
||||
const englishNames = ref('')
|
||||
const handleNodelClick = async (row: any) => {
|
||||
console.log(row)
|
||||
queryParams.nodeFunction = row.selectName
|
||||
chineseName.value = '【' + row.name + '】'
|
||||
filePath.value = row.filePath
|
||||
@@ -568,7 +500,9 @@ const submitWordPoints = async () => {
|
||||
type: '',
|
||||
belongTo: '',
|
||||
isboo: '',
|
||||
function: ''
|
||||
function: '',
|
||||
unit: '',
|
||||
isExam: ''
|
||||
}
|
||||
wordPointsInfosList = []
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
@@ -691,10 +625,8 @@ const open = async (queryParams: any, type: string, id?: number) => {
|
||||
formData.value.specialtyName = queryParams.specialtyName
|
||||
formData.value.courseName = queryParams.courseName
|
||||
formData.value.subjectName = queryParams.subjectName
|
||||
formData.value.pointNames=queryParams.pointNamesVo
|
||||
formData.value.pointNamesVo=queryParams.pointNames
|
||||
formData.value.chapteridDictText=queryParams.chapteridDictTextVo
|
||||
formData.value.chapteridDictTextVo=queryParams.chapteridDictText
|
||||
formData.value.pointNames = queryParams.pointNames
|
||||
formData.value.chapteridDictText = queryParams.chapteridDictText
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
@@ -748,7 +680,7 @@ const resetForm = () => {
|
||||
required: '',
|
||||
chapteridDictText: '',
|
||||
analysis: '',
|
||||
quLevel: 0,
|
||||
quLevel: '',
|
||||
pointNames: '',
|
||||
audit: '',
|
||||
subjectName: '',
|
||||
|
Reference in New Issue
Block a user