Jelajahi Sumber

归档树配置修改

duy 9 bulan lalu
induk
melakukan
e902bd887e

+ 27 - 1
src/views/desk/wbs/archieveComponent/rightConfig.vue

@@ -114,7 +114,7 @@
                 </div>
             </div>
             <div v-if="tabsKey === '2'">
-                <entryConfig></entryConfig>
+                <entryConfig :rightData="rightData"></entryConfig>
             </div>
         </hc-tab-card>
         <!-- 设置最高层级 -->
@@ -186,6 +186,7 @@ import wbsApi from "~api/desk/wbs";
 import mainApi from "~api/project/tree";
 import archiveApi from "~api/desk/archiveTree";
 import { getArrValue } from "js-fast-way";
+import { HcDelMsg } from "hc-vue3-ui";
 onMounted(() => {
     getPublictreeoptions();
     getTesttreeOptions();
@@ -210,6 +211,7 @@ const testtreeValue = ref("");
 const treeSelectId = ref("");
 const treeIdChange = (val) => {
     getSecondTreeData(val);
+    getRightData(val);
     treeSelectId.value = val;
     if (testtreeValue.value) {
         testtreeValue.value = "";
@@ -292,6 +294,18 @@ const secondTreeMenuClick = async ({ key, data, node }) => {
             }
             configVisible.value = true;
         }
+    } else if (key === "del") {
+        HcDelMsg(async (resolve) => {
+            const { code } = await archiveApi.removeArchiveAutoRule({
+                nodeId: data.id,
+                iswbsNode: data.iswbsNode, //是否是wbs节点   flase 不是 true 是 (先false,具体怎么区分后面再看)
+                projectId: 0, //   系统级为0  项目级为项目id
+            });
+            resolve(); //关闭弹窗的回调
+            if (code !== 200) return;
+            window.$message.success("删除成功");
+            getSecondTreeData(treeSelectId.value);
+        }).then();
     }
 };
 const titleName = ref("");
@@ -390,6 +404,18 @@ const configInfo = ref({});
 const checkedKeys = ref([]);
 const configCheckChange = () => {};
 const changeConfig = () => {};
+
+//工程文件入口配置
+const rightData = ref([]);
+const getRightData = async (id) => {
+    const { data, code } = await archiveApi.archiveTreetree({
+        projectId: 0,
+        wbsId: id,
+    });
+    if (code == 200) {
+        rightData.value = data;
+    }
+};
 </script>
 
 <style scoped lang="scss">

+ 64 - 18
src/views/desk/wbs/entry-config.vue

@@ -1,26 +1,72 @@
 <template>
-    <div style="position: relative; height: 180px">
-        <hc-lazy-tree :h-props="treeProps" @load="treeLoadNode" />
+    <div style="position: relative; height: 100%">
+        <el-button
+            hc-btn
+            type="primary"
+            style="float: right"
+            @click="rightPushTree"
+        >
+            文件入口配置
+        </el-button>
+        <hc-data-tree :h-props="rightprops" :datas="rightData" tree-key="id">
+        </hc-data-tree>
     </div>
+
+    <!-- 上传文件入口配置 -->
+
+    <!-- 右侧树 -->
+    <hc-dialog
+        title="上传文件入口显示配置"
+        v-model="pushfileTap"
+        @close="pushFileClose"
+    >
+        <div style="width: 100%; overflow-x: auto" v-loading="rightTreeLoading">
+            <hc-data-tree
+                :h-props="dialogProps"
+                show-checkbox
+                :datas="dialogData"
+                tree-key="id"
+                ref="treeRef"
+            >
+            </hc-data-tree>
+        </div>
+        <template #footer>
+            <el-button @click="pushfileTap = false">取 消</el-button>
+            <el-button type="primary" @click="saveFile">确 定</el-button>
+        </template>
+    </hc-dialog>
 </template>
 <script setup>
+import { ref, watch } from "vue";
+import archiveApi from "~api/desk/archiveTree";
+
+const props = defineProps({
+    rightData: {
+        type: Object,
+        default: () => [],
+    },
+});
+const rightData = ref(props.rightData);
+
+watch(
+    () => props.rightData,
+    (data) => {
+        rightData.value = data;
+    },
+    { immediate: true, deep: true }
+);
 //数据格式
-const treeProps = {
-    label: "name",
-    children: "children",
-    isLeaf: "leaf",
-};
+const rightprops = ref({ label: "title" });
 
-//懒加载的数据
-const treeLoadNode = ({ node, item, level }, resolve) => {
-    if (level === 0) {
-        return resolve([{ name: "region" }]);
-    }
-    if (level > 3) {
-        return resolve([]);
-    }
-    setTimeout(() => {
-        resolve([{ name: "leaf", leaf: true }, { name: "zone" }]);
-    }, 500);
+const rightPushTree = () => {
+    pushfileTap.value = true;
 };
+
+// 入口配置弹窗
+const pushfileTap = ref(false);
+const pushFileClose = () => {};
+const treeRef = ref(null);
+const dialogProps = ref({ label: "title" });
+const dialogData = ref([]);
+const saveFile = () => {};
 </script>