From 69cf02da0ad0659d125172106f5045eca9309dd0 Mon Sep 17 00:00:00 2001
From: "YOHO\\20373" <2037305722@qq.com>
Date: Thu, 12 Jun 2025 11:23:43 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91ppt?=
=?UTF-8?q?=EF=BC=8Cword=E5=87=BA=E9=A2=98=E7=9F=A5=E8=AF=86=E7=82=B9?=
=?UTF-8?q?=E3=80=81=E5=AE=A1=E6=A0=B8=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/paper/question/WpsPptxForm.vue | 101 +++++++++++++++---
src/views/paper/question/WpsWordForm.vue | 129 ++++++++++++++++++-----
2 files changed, 186 insertions(+), 44 deletions(-)
diff --git a/src/views/paper/question/WpsPptxForm.vue b/src/views/paper/question/WpsPptxForm.vue
index bb676b3..08aa857 100644
--- a/src/views/paper/question/WpsPptxForm.vue
+++ b/src/views/paper/question/WpsPptxForm.vue
@@ -17,8 +17,8 @@
-
-
+
+
@@ -30,9 +30,13 @@
-
+
-
+
+
+
+
+
@@ -66,7 +83,7 @@
-
+
@@ -293,7 +310,7 @@ import * as PptxApi from '@/api/wps/pptx'
import FileForm from './components/FileForm.vue'
import { defaultProps, handleTree } from '@/utils/tree'
import { cloneDeep } from 'lodash-es'
-
+import * as SpecialtyApi from '@/api/points'
defineOptions({ name: 'WpsPptxFrom' })
const pptxPointsList = ref([]) // 树形结构
const pptxPointsInfoList = ref([]) // 树形结构
@@ -307,6 +324,8 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formData = ref({
+ pointNamesVo:'',
+ chapteridDictTextVo:'',
content: '',
specialtyName: '',
courseName: '',
@@ -314,9 +333,8 @@ const formData = ref({
required: '',
chapteridDictText: '',
analysis: '',
- quLevel: '',
+ quLevel: 0,
pointNames: '',
- audit: '',
subjectName: '',
status: ' ',
resourceValue: '',
@@ -633,9 +651,8 @@ const resetForm = () => {
required: '',
chapteridDictText: '',
analysis: '',
- quLevel: '',
+ quLevel: 0,
pointNames: '',
- audit: '',
subjectName: '',
status: '0',
resourceValue: '',
@@ -691,6 +708,60 @@ const resetForm = () => {
list.value = []
formRef.value?.resetFields()
}
+
+
+const dialogVisiblePoints = ref(false)
+
+// 添加层级信息
+const handleTreeWithLevel = (list, level = 1) => {
+ return list.map(item => {
+ const node = { ...item, level }
+ if (item.children && item.children.length > 0) {
+ node.children = handleTreeWithLevel(item.children, level + 1)
+ }
+ return node
+ })
+}
+
+// 只允许点击第三级节点
+const treeRef = ref() // 引用 el-tree
+const handleNodeClick = (data, node) => {
+ if (data.level === 3) {
+ formData.value.pointNames = data.id
+ formData.value.pointNamesVo = data.name
+
+ // 获取父节点(章节名称)
+ const currentNode = treeRef.value.getNode(data)
+ const parentNode = currentNode.parent
+ if (parentNode && parentNode.data) {
+ formData.value.chapteridDictTextVo = parentNode.data.name
+ formData.value.chapteridDictText = parentNode.data.id
+ } else {
+ formData.value.chapteridDictText = ''
+ }
+
+ dialogVisiblePoints.value = false
+ } else {
+ }
+}
+
+
+
+const deptList = ref([]) // 树形结构
+/** 获得部门树 */
+const getTree = async () => {
+ const res = await SpecialtyApi.listPoints()
+ const tree = handleTree(res)
+ deptList.value = []
+ deptList.value = handleTreeWithLevel(tree)
+
+
+}
+const openPoints = async () => {
+ await getTree();
+ dialogVisiblePoints.value = true;
+}
+