Browse Source

隐藏节点修改

duy 1 month ago
parent
commit
5ffb59e841
1 changed files with 52 additions and 66 deletions
  1. 52 66
      src/views/other/hide-data.vue

+ 52 - 66
src/views/other/hide-data.vue

@@ -42,6 +42,7 @@
                             >
                                 <HcDataTree
                                  
+                                    :is-show-collect="true"
                                     :is-show-eye="true"
                                     :datas="searchTreeData"
                                     :is-mark="TreeMark"
@@ -64,7 +65,7 @@
                                 <HcLazyTree
                                     ref="wbstree"
                                  
-                                    :is-show-eye="true"
+                                
                                     :is-show-sync="userInfo?.role_id?.split(',').includes('1123598816738675201')"
                                     is-form-date
                                
@@ -73,21 +74,46 @@
                                     :menus="ElTreeMenu"
                                     is-counts
                                     is-type
-                                    show-checkbox
+                                  
                                     check-strictly
                                     @load="treeLoadNode"
                                     @menu-tap="ElTreeMenuClick"
                                     @node-loading="ElTreeNodeLoading"
                                     @node-tap="wbsElTreeClick"
-                                />
+                                >
+                                    <template #default="{ node, data, level }">
+                                        <div 
+                                            class="data-custom-tree-node" 
+                                            @mouseenter="handleNodeEnter(node, data)"
+                                            @mouseleave="handleNodeLeave(node, data)"
+                                        >
+                                            <!-- 树组件,节点名称 -->
+                                            <div :class="node.level === 1 ? 'level-name' : ''" class="label">
+                                                <span v-if="(data.type > 0 && data.majorDataType > 0) || (data.type > 0 && data.majorDataType <= 0)" class="hc-tree-node-type">
+                                                    {{ getTreeNodeType(data.type, data.majorDataType) }}
+                                                </span>
+
+                                                <span :class="data.isBussShow === '2' ? 'text-red' : ''">
+                                                    {{ node.label }}
+                                                </span>
+                                            </div>
+                                            <!-- 树组件,统计数量 -->
+                                            <div v-if="node.level !== 1 && showIcons[data.id]" class="tree-node-icons">
+                                                <HcIcon name="eye" ui="text-xl" @click.prevent.stop="handleEye(data)" />
+                                            </div>
+                                            <div class="submit-counts text-blue">【{{ data.submitCounts ?? 0 }}】</div>
+
+                                           
+                                        <!-- 树组件,操作菜单 END -->
+                                        </div>
+                                    </template>
+                                </HcLazyTree>
                             </el-scrollbar>
                         </div>
                     </div>
                     <div class="hc-tree-foot-tip-box">
-                        <div class="dot-view green">已审批</div>
-                        <div class="dot-view black">未填报</div>
-                        <div class="dot-view orange">已填报-待审批</div>
-                        <div class="dot-view blue">已填报-未上报</div>
+                        <div class="dot-view red">已隐藏</div>
+                        <div class="dot-view black">未隐藏</div>
                     </div>
                 </div>
             </template>
@@ -103,11 +129,6 @@
                 >
                     <CollapseForm
                         ref="ListItemRef"
-                        :contract-info="
-                            contractInfo?.contractType === 2
-                                ? nodeDataInfo?.contractIdRelation
-                                : contractId
-                        "
                         :tree-auto-expand-keys="TreeAutoExpandKeys"
                         :classify="authBtnTabKey"
                         :contract-id="contractId"
@@ -116,9 +137,7 @@
                         :primary-key-id="primaryKeyId"
                         :status="NodeStatus"
                         :tenant-id="userInfo?.tenant_id"
-                        :wbs-temp-id="
-                            projectInfo?.referenceWbsTemplateIdTrial
-                        "
+                        :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
                         :wbs-type="2"
                         :treenode-data-info="nodeDataInfo"
                         :newlistdata="newlistdata"
@@ -142,7 +161,7 @@ import CollapseForm from './collapse-form/index.vue'
 
 
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
-
+import { getTreeNodeType } from 'hc-vue3-ui'
 
 import {
     arrToKey,
@@ -183,7 +202,7 @@ const isCollapse = ref(useAppState.getCollapse)
 const userInfo = ref(useAppState.getUserInfo)
 const isLayout = ref(useAppState.isLayout)
 const leftWidth = ref(440)
-const isTemplateType = ref(useAppState.contractInfo?.templateType === 2)
+
 //路由参数
 const routerQuery = useRoutes?.query
 // const typeName = routerQuery?.type || 'map'
@@ -192,7 +211,17 @@ const typeName = routerQuery?.type || 'tree'
 const isDrawType = ref(true)
 //自动展开缓存
 const TreeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
+ const showIcons = ref({})
+ const treeNodeKey = ref('id')
+ // 鼠标移入节点时显示图标
+const handleNodeEnter = (node, data) => {
+  showIcons.value[data[treeNodeKey.value]] = true
+}
 
+// 鼠标移出节点时隐藏图标
+const handleNodeLeave = (node, data) => {
+  showIcons.value[data[treeNodeKey.value]] = false
+}
 //树搜索
 const isSearchTree = ref(false)
 const searchTreeHeight = ref()
@@ -204,6 +233,7 @@ const getSearchTreeData = async (type) => {
                 contractId: contractId.value,
                 tableOwner: authBtnTabKey.value,
                queryValue: searchTreeVal.value,
+                 description: 1,
             })
         
 
@@ -333,55 +363,8 @@ const authBtnTabdata = ref([
     { key: '1', name: '施工质检' },
     { key: '2', name: '监理质检' },
 ])
-const wbsTypeTabChange = (item) => {
-    wbsTypeTabKey.value = item?.key
-    ListItemDatas.value = []
-    isDrawer.value = false
-    treeLoading.value = typeName === 'tree'
-    setStoreValue('classifyType', classType.value)
-    setStoreValue('tableOwner', authBtnTabKey.value)
-    //路由跳转
-    router.push({
-        path: useRoutes.path,
-        query: {
-            type: item?.key,
-            classifyType: classType.value,
-            tableOwner: authBtnTabKey.value,
-        },
-    })
-    getSearchTreeData()
-}
-//切换导图结构
-const wbsMapTypeTab = () => {
-    wbsTypeTabChange({ key: 'map', name: '导图结构填报' })
-}
 
-//设置图纸数据
-const setUploadDrawingsData = async (echoParams, link) => {
-    const info = nodeDataInfo.value
-    const { error, code, data } = await wbsApi.saveContractTreeDrawings(
-        {
-            fileUrl: link,
-            id: echoParams['drawingsId'],
-            primaryKeyId: echoParams['primaryKeyId'],
-        },
-        false,
-    )
-    //处理数据
-    if (!error && code === 200) {
-        if (info['primaryKeyId'] === echoParams['primaryKeyId']) {
-            nodeDataInfo.value['drawingsId'] = data
-            nodeDataInfo.value['fileUrl'] = link
-            window?.$message?.success('图纸上传成功')
-        } else {
-            window?.$message?.success(
-                '图纸上传成功,由于您切换了其他节点,需要手动刷新才能查看到图纸',
-            )
-        }
-    } else {
-        window?.$message?.error('图纸保存失败')
-    }
-}
+
 
 
 
@@ -436,7 +419,7 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
         contractIdRelation,
         primaryKeyId,
         parentId,
-        // classifyType: authBtnTabKey.value,
+          description: 1,
         classifyType: classType.value,
         tableOwner: authBtnTabKey.value,
         dataTime:new Date(),
@@ -603,6 +586,9 @@ const setUserConfig = async (data) => {
     }
    
 
+}
+//显示节点
+const handleEye = async ()=>{ 
 }
 </script>