【修改】 wps出题页面优化
This commit is contained in:

committed by
陆光LG

parent
c0179d9bba
commit
5cd9e9dfbf
@@ -439,9 +439,11 @@ const addPptxInfo = async () => {
|
||||
if (filePath == '' || filePath == null) {
|
||||
return
|
||||
}
|
||||
if (pptxPointsList.value.length <= 0) {
|
||||
const res = await PptxApi.getPptxInfo(filePath)
|
||||
pptxPointsList.value = []
|
||||
pptxPointsList.value.push(...handleTree(res))
|
||||
}
|
||||
dialogFormVisiblePptxInfo.value = true
|
||||
}
|
||||
const queryParams = reactive({
|
||||
|
@@ -265,7 +265,7 @@
|
||||
</div>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<FileForm ref="FileRef" @success="handleUploadSuccess" />
|
||||
<el-dialog v-model="dialogFormVisibleWordInfo" title="考点设置(*暂不支持多选)" width="400px">
|
||||
<el-dialog v-model="dialogFormVisibleWordInfo" title="考点设置" width="400px">
|
||||
<el-skeleton :rows="5" animated v-if="wordPointsList.length < 0 && isLoading" />
|
||||
<el-tree
|
||||
style="max-width: 600px"
|
||||
@@ -362,17 +362,13 @@ const wordPointsFun = ref({
|
||||
function: ''
|
||||
})
|
||||
const wordPoints = ref({
|
||||
id: '',
|
||||
chineseName: '',
|
||||
name: '',
|
||||
englishName: '',
|
||||
filePath: '',
|
||||
type: '',
|
||||
belongTo: '',
|
||||
parameter: '',
|
||||
function: [] as {
|
||||
chineseName: string
|
||||
function: string
|
||||
}[]
|
||||
isboo: '',
|
||||
function: ''
|
||||
})
|
||||
let wordPointsInfosList: (typeof wordPoints)[] = []
|
||||
|
||||
@@ -419,18 +415,28 @@ const wordData = reactive({
|
||||
})
|
||||
|
||||
const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean) => {
|
||||
if (checked || indeterminate) {
|
||||
// if (checked || indeterminate) {
|
||||
// wordPoints.value.belongTo = data.belongTo
|
||||
// wordPoints.value.parameter = data.isboo
|
||||
// wordPoints.value.type = data.type
|
||||
// wordPointsFun.value = {
|
||||
// chineseName: '',
|
||||
// function: ''
|
||||
// }
|
||||
// wordPointsFun.value.chineseName = data.toChinese
|
||||
// wordPointsFun.value.function = data.nodeFunction
|
||||
// wordPoints.value.function.push(cloneDeep(wordPointsFun.value))
|
||||
// console.log(wordPoints)
|
||||
// }
|
||||
if (data.titleType == '2') {
|
||||
wordPoints.value.name = chineseName.value + data.toChinese
|
||||
wordPoints.value.filePath = filePath.value
|
||||
wordPoints.value.function = englishNames.value + data.nodeFunction
|
||||
wordPoints.value.englishName = englishNames.value
|
||||
wordPoints.value.belongTo = data.belongTo
|
||||
wordPoints.value.parameter = data.isboo
|
||||
wordPoints.value.isboo = data.isboo
|
||||
wordPoints.value.type = data.type
|
||||
wordPointsFun.value = {
|
||||
chineseName: '',
|
||||
function: ''
|
||||
}
|
||||
wordPointsFun.value.chineseName = data.name
|
||||
wordPointsFun.value.function = data.nodeFunction
|
||||
wordPoints.value.function.push(cloneDeep(wordPointsFun.value))
|
||||
console.log(wordPoints)
|
||||
wordPointsInfosList.push(cloneDeep(wordPoints.value))
|
||||
}
|
||||
console.log(data, checked, indeterminate)
|
||||
}
|
||||
@@ -448,21 +454,26 @@ const addWordInfo = async () => {
|
||||
}
|
||||
dialogFormVisibleWordInfo.value = true
|
||||
isLoading.value = true
|
||||
if (wordPointsList.value.length <= 0) {
|
||||
const res = await WordApi.getWordInfo(filePath)
|
||||
isLoading.value = false
|
||||
wordPointsList.value = []
|
||||
wordPointsList.value.push(...handleTree(res))
|
||||
}
|
||||
}
|
||||
const queryParams = reactive({
|
||||
nodeFunction: undefined
|
||||
})
|
||||
|
||||
const chineseName = ref('')
|
||||
const nodeFunctions = ref('')
|
||||
const englishNames = ref('')
|
||||
const handleNodelClick = async (row: any) => {
|
||||
console.log(row)
|
||||
queryParams.nodeFunction = row.selectName
|
||||
wordPoints.value.chineseName = row.name.split(':')[0]
|
||||
wordPoints.value.englishName = row.englishName
|
||||
wordPoints.value.filePath = row.filePath
|
||||
wordPoints.value.id = row.id
|
||||
chineseName.value = '【' + row.name + '】'
|
||||
filePath.value = row.filePath
|
||||
nodeFunctions.value = row.selectName
|
||||
englishNames.value = row.englishName
|
||||
const res = await WordApi.getWordInfos(queryParams)
|
||||
wordPointsInfoList.value = []
|
||||
wordPointsInfoList.value.push(...handleTree(res))
|
||||
@@ -478,17 +489,15 @@ const handleDelete = (row) => {
|
||||
}
|
||||
|
||||
const submitWordPoints = async () => {
|
||||
wordPointsInfosList.push(wordPoints.value)
|
||||
const res = await WordApi.getWordListInfos(wordPointsInfosList)
|
||||
wordPoints.value = {
|
||||
id: '',
|
||||
chineseName: '',
|
||||
name: '',
|
||||
englishName: '',
|
||||
filePath: '',
|
||||
type: '',
|
||||
belongTo: '',
|
||||
parameter: '',
|
||||
function: []
|
||||
isboo: '',
|
||||
function: ''
|
||||
}
|
||||
wordPointsInfosList = []
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
|
@@ -69,6 +69,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别" prop="titleType">
|
||||
<el-select v-model="formData.titleType" clearable placeholder="请选择级别">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.PPTX_TITLE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -103,7 +113,8 @@ const formData = ref({
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
type: CommonStatusEnum.ENABLE,
|
||||
belongTo: CommonStatusEnum.ENABLE,
|
||||
isboo: CommonStatusEnum.ENABLE
|
||||
isboo: CommonStatusEnum.ENABLE,
|
||||
titleType: CommonStatusEnum.ENABLE
|
||||
})
|
||||
const formRules = reactive<FormRules>({
|
||||
parentId: [{ required: true, message: '上级Word节点不能为空', trigger: 'blur' }],
|
||||
@@ -173,7 +184,8 @@ const resetForm = () => {
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
type: CommonStatusEnum.ENABLE,
|
||||
belongTo: CommonStatusEnum.ENABLE,
|
||||
isboo: CommonStatusEnum.ENABLE
|
||||
isboo: CommonStatusEnum.ENABLE,
|
||||
titleType: CommonStatusEnum.ENABLE
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
@@ -76,6 +76,11 @@
|
||||
<dict-tag :type="DICT_TYPE.WORD_ISBOO" :value="scope.row.isboo" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="titleType" label="级别" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PPTX_TITLE_TYPE" :value="scope.row.titleType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
|
Reference in New Issue
Block a user