From f5c6680c664d896cf506ff4437def846fa588d69 Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Fri, 17 May 2024 23:24:38 +0800
Subject: [PATCH] =?UTF-8?q?feat=20:=20=E6=96=B0=E5=A2=9E=E9=9C=80=E6=B1=82?=
=?UTF-8?q?=E5=BE=81=E9=9B=86=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DetailComponent/CollectionDetail.vue | 170 ++++++++++++++++++
src/utils/matterTree.js | 13 ++
.../project-demand/collection/detail.vue | 18 +-
.../project-management/initiation/detail.vue | 86 ++++++---
4 files changed, 250 insertions(+), 37 deletions(-)
create mode 100644 src/components/DetailComponent/CollectionDetail.vue
create mode 100644 src/utils/matterTree.js
diff --git a/src/components/DetailComponent/CollectionDetail.vue b/src/components/DetailComponent/CollectionDetail.vue
new file mode 100644
index 0000000..a6a3a26
--- /dev/null
+++ b/src/components/DetailComponent/CollectionDetail.vue
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/matterTree.js b/src/utils/matterTree.js
new file mode 100644
index 0000000..24f791d
--- /dev/null
+++ b/src/utils/matterTree.js
@@ -0,0 +1,13 @@
+export const matterTree = (array,data, id) => {
+ if (id) {
+ for (let i = 0; i < data.length; i++) {
+ if (data[i].value == id) {
+ array.push(data[i].label);
+ }
+ if (data[i].children && data[i].children.length > 0) {
+ matterTree(data[i].children)
+ }
+ }
+ return array;
+ }
+}
diff --git a/src/views/project-demand/collection/detail.vue b/src/views/project-demand/collection/detail.vue
index 6a708f2..f0d3f5a 100644
--- a/src/views/project-demand/collection/detail.vue
+++ b/src/views/project-demand/collection/detail.vue
@@ -80,8 +80,8 @@ import {useProcessStore} from '@/stores/processStore.js';
import {getInfo, agreeTask, rejectTask,downloadFile} from "@/api/project-demand/index.js";
import {getSubCompOpt} from '@/api/user/user.js'
import {ElMessage} from "element-plus";
-import {useRouter} from "vue-router";
import {useTagsView} from '@/stores/tagsview.js'
+import {matterTree} from '@/utils/matterTree.js';
const tagsViewStore = useTagsView()
const router = useRouter()
@@ -180,24 +180,10 @@ const getCompanyOption = async () => {
companyOption.value = res.data
}
-const matterTree = (data, id) => {
- if (id) {
- for (let i = 0; i < data.length; i++) {
- if (data[i].value == id) {
- companyNameArray.value.push(data[i].label);
- }
- if (data[i].children && data[i].children.length > 0) {
- matterTree(data[i].children)
- }
- }
- return companyNameArray.value;
- }
-}
-
const getDataSourceOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
- matterTree(companyOption.value, item)
+ matterTree(companyNameArray.value,companyOption.value, item)
})
}
return companyNameArray.value.join(',');
diff --git a/src/views/project-management/initiation/detail.vue b/src/views/project-management/initiation/detail.vue
index aeebf62..a6be3b1 100644
--- a/src/views/project-management/initiation/detail.vue
+++ b/src/views/project-management/initiation/detail.vue
@@ -1,48 +1,92 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+