【修改】 wps出题页面优化

This commit is contained in:
DESKTOP-932OMT8\REN
2025-06-05 16:21:57 +08:00
committed by 陆光LG
parent c0179d9bba
commit 5cd9e9dfbf
5 changed files with 66 additions and 38 deletions

View File

@@ -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
const res = await WordApi.getWordInfo(filePath)
isLoading.value = false
wordPointsList.value = []
wordPointsList.value.push(...handleTree(res))
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++) {