Compare commits

..

3 Commits

Author SHA1 Message Date
hyc
a6edb33f1e Merge pull request 'hyc' (#1) from hyc into master
Reviewed-on: #1
2025-09-09 23:13:43 +08:00
huababa1
162a84840c 【修改】文字出题考点页面增加输入框 2025-09-09 23:12:24 +08:00
huababa1
79a7921102 【修改】文字考点出题页面增加输入框 2025-09-09 23:11:36 +08:00

View File

@@ -322,20 +322,33 @@
<!-- <el-skeleton :rows="5" animated v-if="wordPointsList.length < 0 && isLoading" />
-->
</el-dialog>
<el-dialog v-model="dialogFormVisibleWordInfos" :title="titles" width="300px">
<el-tree
style="max-width: 600px"
:data="wordPointsInfoList"
:props="defaultProps"
:expand-on-click-node="false"
show-checkbox
@check-change="handleCheckChange"
<el-dialog v-model="dialogFormVisibleWordInfos" :title="titles" width="300px">
<el-tree
style="max-width: 600px"
:data="wordPointsInfoList"
:props="defaultProps"
:expand-on-click-node="false"
show-checkbox
@check-change="handleCheckChange"
/>
<!-- 如果 row.type === 'file'显示输入框 -->
<div v-if="showFileInput" style="margin-bottom: 10px">
<el-input
v-model="fileName"
placeholder="请输入文件名"
clearable
style="width: 100%"
/>
<template #footer>
<el-button type="primary" @click="submitWordPoints"> </el-button>
<el-button @click="dialogFormVisibleWordInfos = false"> </el-button>
</template>
</el-dialog>
<div v-if="fileNameError" style="color: red; font-size: 12px; margin-top: 4px;">
文件名不能为空
</div>
</div>
<template #footer>
<el-button type="primary" @click="submitWordPoints"> </el-button>
<el-button @click="dialogFormVisibleWordInfos = false"> </el-button>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import * as QuestionApi from '@/api/paper/question'
@@ -486,12 +499,23 @@ const queryParams = reactive({
const chineseName = ref('')
const textIndex = ref()
const fileName = ref('')
const showFileInput = ref(false)
const fileNameError = ref(false)
// 打开
const handleNodelClick = async (row: any) => {
console.log(row)
// 获取名称
chineseName.value = '【' + row.name + '】'
textIndex.value = row.index
// 如果 type 是 file显示输入框
if (row.type === 'file') {
showFileInput.value = true
fileName.value = ''
} else {
showFileInput.value = false
}
const res = await WordApi.getDocxByNameList(row.type)
wordPointsInfoList.value = []
wordPointsInfoList.value.push(...handleTree(res))
@@ -507,10 +531,18 @@ const handleDelete = (row) => {
}
const submitWordPoints = async () => {
if (showFileInput.value && !fileName.value.trim()) {
fileNameError.value = true
return
}
fileNameError.value = false
// TODO: 提交逻辑
console.log('提交的文件名:', fileName.value)
console.log(wordPointsInfosList)
const res = await WordApi.getdocxMaster({
data: JSON.stringify(wordPointsInfosList),
file: file.value
file: file.value,
name:fileName.value
})
wordPointsInfosList = []
console.log(res)