Răsfoiți Sursa

归档树管理

duy 9 luni în urmă
părinte
comite
0032bcbec1
2 a modificat fișierele cu 52 adăugiri și 11 ștergeri
  1. 44 10
      src/views/desk/wbs/entry-config.vue
  2. 8 1
      src/views/project/tree/drawer-temp.vue

+ 44 - 10
src/views/desk/wbs/entry-config.vue

@@ -8,8 +8,14 @@
         >
             文件入口配置
         </el-button>
-        <hc-data-tree :h-props="rightprops" :datas="rightData" tree-key="id">
-        </hc-data-tree>
+        <el-scrollbar v-loading="rightLoad" style="width: 80%">
+            <hc-data-tree
+                :h-props="rightprops"
+                :datas="rightData"
+                tree-key="id"
+            >
+            </hc-data-tree>
+        </el-scrollbar>
     </div>
 
     <!-- 上传文件入口配置 -->
@@ -20,7 +26,7 @@
         v-model="pushfileTap"
         @close="pushFileClose"
     >
-        <div style="width: 100%; overflow-x: auto">
+        <el-scrollbar v-loading="dialogLoad">
             <hc-data-tree
                 :h-props="dialogProps"
                 show-checkbox
@@ -29,7 +35,7 @@
                 ref="entryTreeRef"
             >
             </hc-data-tree>
-        </div>
+        </el-scrollbar>
         <template #footer>
             <el-button @click="pushfileTap = false">取 消</el-button>
             <el-button type="primary" @click="saveFile">确 定</el-button>
@@ -50,15 +56,37 @@ const props = defineProps({
         type: String,
         default: "",
     },
+    projectId: {
+        type: [String, Number],
+        default: 0,
+    },
+    tabKey: {
+        type: [String, Number],
+        default: 0,
+    },
 });
-const rightData = ref(props.rightData);
+const rightData = ref([]);
 const wbsId = ref(props.wbsId);
-
+const projectId = ref(props.projectId);
+const tabKey = ref(props.tabKey);
+const rightLoad = ref(false);
+const getRightData = async () => {
+    rightLoad.value = true;
+    const { data } = await archiveApi.archiveTreetree({
+        projectId: projectId.value,
+        nodeType: 2,
+        disPlayTree: 1,
+    });
+    rightLoad.value = false;
+    rightData.value = getArrValue(data);
+};
 watch(
-    () => [props.rightData, props.wbsId],
-    ([data, wid]) => {
-        rightData.value = data;
+    () => [props.wbsId, props.projectId, props.tabKey],
+    ([wid, pid, key]) => {
         wbsId.value = wid;
+        projectId.value = pid;
+        tabKey.value = key;
+        getRightData();
     },
     { immediate: true, deep: true }
 );
@@ -67,6 +95,7 @@ const pushfileTap = ref(false);
 watch(pushfileTap, (val) => {
     if (val) getDialogData();
 });
+
 //数据格式
 const rightprops = ref({ label: "title" });
 
@@ -80,10 +109,14 @@ const pushFileClose = () => {};
 const entryTreeRef = ref(null);
 const dialogProps = ref({ label: "title" });
 const dialogData = ref([]);
+const dialogLoad = ref(false);
 const getDialogData = async () => {
+    dialogLoad.value = true;
     const { data, code } = await archiveApi.archiveTreetree({
-        type: 2,
+        nodeType: 2,
+        projectId: projectId.value,
     });
+    dialogLoad.value = false;
     if (code == 200) {
         dialogData.value = getArrValue(data);
         saixuan(dialogData.value);
@@ -135,6 +168,7 @@ const saveFile = async () => {
             });
 
             pushfileTap.value = false;
+            getRightData();
         }
     } else {
         window.$message({

+ 8 - 1
src/views/project/tree/drawer-temp.vue

@@ -129,7 +129,13 @@
                         </el-scrollbar>
                     </div>
                 </template>
-                <template v-if="tabsKey === 'first'"> 内容区域 </template>
+                <template v-if="tabsKey === 'first'">
+                    <entryConfig
+                        :rightData="secondTreeData"
+                        :projectId="dataInfo.id"
+                        :tabKey="tabsKey"
+                    ></entryConfig>
+                </template>
             </hc-tab-card>
         </hc-body>
         <!-- 树节点新增 -->
@@ -217,6 +223,7 @@ import HcTreeNodeForm from "./tree-form.vue";
 import HcTreeNodeSort from "./tree-sort.vue";
 import mainApi from "~api/project/tree";
 import archiveApi from "~api/desk/archive-tree";
+import entryConfig from "../../desk/wbs/entry-config.vue";
 const props = defineProps({
     data: {
         type: Object,