diff --git a/src/api/wps/pptx/index.ts b/src/api/wps/pptx/index.ts index a5dcccd..b308da0 100644 --- a/src/api/wps/pptx/index.ts +++ b/src/api/wps/pptx/index.ts @@ -37,6 +37,7 @@ export const updatePptx = async (params: PptxVO) => { export const deletePptx = async (id: number) => { return await request.delete({ url: '/exam/pptx/delete?id=' + id }) } + // // 获取Word考点(大类) export const getPptxInfo = async (path: String) => { return await request.get({ url: '/tool/wps/runWpsPptx?path=' + path }) @@ -47,6 +48,7 @@ export const getPptxInfos = async (title: string) => { console.log(title) return await request.get({ url: '/exam/pptx/getByNameList?title=' + title }) } + // // 获取Pptx考点() export const getPptxListInfos = async (data: any) => { return await request.post({ url: '/tool/wps/runTestpptx' , data }) diff --git a/src/api/wps/word/index.ts b/src/api/wps/word/index.ts index 52a677c..f622e72 100644 --- a/src/api/wps/word/index.ts +++ b/src/api/wps/word/index.ts @@ -1,61 +1,57 @@ import request from '@/config/axios' -export interface WordVO { +export interface DocxVO { id?: number - nodeName: string parentId: number status: number sort: number - toChinese: string - nodeFunction: string createTime: Date } -// 查询Word节点(精简)列表 -export const getSimpleWordList = async (): Promise => { - return await request.get({ url: '/wps/word/simple-list' }) +// 查询Docx节点(精简)列表 +export const getSimpleDocxList = async (): Promise => { + return await request.get({ url: '/exam/docx/simple-list' }) } -// 查询Word节点列表(小类) -export const getWordInfos = async (params: any) => { - return await request.get({ url: '/wps/word/listInfo', params }) +// 查询Docx节点列表 +export const getDocxPage = async (params: PageParam) => { + return await request.get({ url: '/exam/docx/list', params }) } -// 查询Word节点列表 -export const getWordPage = async (params: PageParam) => { - return await request.get({ url: '/wps/word/list', params }) +// 查询Docx节点详情 +export const getDocx = async (id: number) => { + return await request.get({ url: '/exam/docx/get?id=' + id }) } -// 查询Word节点详情 -export const getWord = async (id: number) => { - return await request.get({ url: '/wps/word/get?id=' + id }) +// 新增Docx节点 +export const createDocx = async (data: DocxVO) => { + return await request.post({ url: '/exam/docx/create', data: data }) } -// 新增Word节点 -export const createWord = async (data: WordVO) => { - return await request.post({ url: '/wps/word/create', data: data }) +// 修改Docx节点 +export const updateDocx = async (params: DocxVO) => { + return await request.put({ url: '/exam/docx/update', data: params }) } -// 修改Word节点 -export const updateWord = async (params: WordVO) => { - return await request.put({ url: '/wps/word/update', data: params }) +// 删除Docx节点 +export const deleteDocx = async (id: number) => { + return await request.delete({ url: '/exam/docx/delete?id=' + id }) } -// 删除Word节点 -export const deleteWord = async (id: number) => { - return await request.delete({ url: '/wps/word/delete?id=' + id }) -} -// 获取Word考点(大类) -export const getWordInfo = async (path: String) => { - return await request.get({ url: '/tool/wps/runWpsWord?path=' + path }) -} -// 获取Word考点() -export const getWordListInfos = async (data: any) => { - return await request.post({ url: '/tool/wps/runWpsWordInfo' , data }) + +// 查询Word节点列表(小类) 根据title查询出来下面所有的数据 +export const getDocxInfos = async (title: string) => { + console.log(title) + return await request.get({ url: '/exam/docx/getByNameList?title=' + title }) } // 2025-07-04 word统一获取考点 export const getDocxMaster = async (path: String) => { - return await request.get({ url: '/tool/wps/docxMaster?path=' + path }) + return await request.get({ url: '/auto/wps/docxMaster?path=' + path }) +} + +// 上传文件 +export const getDocxDataInfo = (data: any) => { + return request.upload({ url: '/auto/wps/docxDataInfo', data }) } diff --git a/src/views/paper/question/WpsWordForm.vue b/src/views/paper/question/WpsWordForm.vue index c88450a..bf1f0e8 100644 --- a/src/views/paper/question/WpsWordForm.vue +++ b/src/views/paper/question/WpsWordForm.vue @@ -126,7 +126,7 @@ @@ -280,6 +280,8 @@ + +

考点

@@ -492,33 +494,38 @@ const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean) console.log(data, checked, indeterminate) } -const addWordInfo = async () => { - var filePath = '' - for (var i = 0; i < documentList.value.length; i++) { - if (documentList.value[i].fileType == '2') { - filePath = documentList.value[i].url - } - } - // http://115.120.213.238:9000/exam/9f7d8f5d7c68cc2bfd03a23c19045efe7ba13a4bebeb833abece146908bcd0c6.docx documentList.value[1].url - // if (filePath == '' || filePath == null) { - // return - // } - dialogFormVisibleWordInfo.value = true - isLoading.value = true - if (wordPointsList.value.length <= 0) { - const res = await WordApi.getWordInfo(filePath) - isLoading.value = false +// 获取docx文件,并使用文件流进行解析 +const getDocxDataInfo = async () => { + const fileInput = document.getElementById('docxFile') as HTMLInputElement + if (fileInput != null) { + const file = fileInput.files[0] + const res = await WordApi.getDocxDataInfo({ file: file }) wordPointsList.value = [] - wordPointsList.value.push(...handleTree(res)) + wordPointsList.value.push(...handleTree(res.data)) } } + +// 打开考点窗口 +const addWordForm = async () => { + dialogFormVisibleWordInfo.value = true +} + const queryParams = reactive({ nodeFunction: undefined }) const chineseName = ref('') const nodeFunctions = ref('') const englishNames = ref('') + + +// 打开 const handleNodelClick = async (row: any) => { + + + + + + queryParams.nodeFunction = row.selectName chineseName.value = '【' + row.name + '】' filePath.value = row.filePath @@ -528,6 +535,7 @@ const handleNodelClick = async (row: any) => { wordPointsInfoList.value = [] wordPointsInfoList.value.push(...handleTree(res)) dialogFormVisibleWordInfos.value = true + } const handleDelete = (row) => { console.log(row) diff --git a/src/views/task/exam/components/steps/step3/index.vue b/src/views/task/exam/components/steps/step3/index.vue index 2f4057c..bb4c75f 100644 --- a/src/views/task/exam/components/steps/step3/index.vue +++ b/src/views/task/exam/components/steps/step3/index.vue @@ -1,30 +1,34 @@