hyc #1
@@ -322,20 +322,35 @@
|
||||
<!-- <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">
|
||||
<!-- 如果 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>
|
||||
|
||||
<el-tree
|
||||
style="max-width: 600px"
|
||||
:data="wordPointsInfoList"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
show-checkbox
|
||||
@check-change="handleCheckChange"
|
||||
/>
|
||||
|
||||
<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 +501,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 +533,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)
|
||||
|
Reference in New Issue
Block a user