ZaiZai 2 years ago
parent
commit
fc958e49a8

+ 6 - 0
components/hc-tree/hc-tree.vue

@@ -5,6 +5,7 @@
                           :check="isCheck"
                           :strictly="isStrictly"
                           :radio="isRadio"
+                          :counts="isCounts"
                           :currentKey="currentNodeKey"
                           @nodeLoad="treeLoadTap"
                           @nodeTap="treeNodeTap"
@@ -59,6 +60,10 @@ const props = defineProps({
         type: String,
         default: '',
     },
+    counts: {
+        type: Boolean,
+        default: false,
+    },
 })
 
 //节点数据
@@ -68,6 +73,7 @@ const nodeData = ref([]);
 const isCheck = ref(props.check)
 const isRadio = ref(props.radio)
 const isStrictly = ref(props.strictly)
+const isCounts = ref(props.counts)
 const currentNodeKey = ref(props.currentKey)
 
 //事件

+ 10 - 1
components/hc-tree/tree-node.vue

@@ -14,7 +14,10 @@
                 <text class="i-ri-checkbox-circle-fill c2" v-else/>
             </view>
             <text class="i-ri-loader-line cuIconfont-spin" v-if="nodeItem.loading"/>
-            <text class="label">{{nodeItem.label}}</text>
+            <view class="label">
+                <text>{{nodeItem.label}}</text>
+                <text class="text-gray-4" v-if="isCounts">【{{nodeItem.data?.submitCounts ?? 0}}】</text>
+            </view>
         </view>
         <template v-if="nodeItem.isExpand">
             <view class="children-bar" v-if="nodeItem.childNodes && nodeItem.childNodes.length > 0">
@@ -24,6 +27,7 @@
                                   :strictly="isStrictly"
                                   :radio="isRadio"
                                   :currentKey="currentNodeKey"
+                                  :counts="isCounts"
                                   @nodeLoad="getLazyLoad"
                                   @nodeTap="nodeTaps"
                     />
@@ -59,6 +63,10 @@ const props = defineProps({
         type: String,
         default: '',
     },
+    counts: {
+        type: Boolean,
+        default: false,
+    },
 })
 
 //事件
@@ -71,6 +79,7 @@ const nodeItem = ref(props.item)
 const isCheck = ref(props.check)
 const isRadio = ref(props.radio)
 const isStrictly = ref(props.strictly)
+const isCounts = ref(props.counts)
 const currentNodeKey = ref(props.currentKey)
 
 //监听

+ 2 - 2
httpApi/modules/image/index.js

@@ -11,14 +11,14 @@ export default {
     },
     async queryTreeList(form) {
         return httpApi({
-            url: '/api/blade-business/wbsTreeContract/image/lazyQueryContractWbsTree',
+            url: '/api/blade-manager/wbsTreeContract/image/lazyQueryContractWbsTree',
             method: 'get',
             params: form,
         });
     },
     async queryWorksTree(form) {
         return httpApi({
-            url: '/api/blade-business/wbsTreeContract/getConcealedWorksNodeTree',
+            url: '/api/blade-manager/wbsTreeContract/getConcealedWorksNodeTree',
             method: 'get',
             params: form,
         });

+ 19 - 4
pages/image/position.vue

@@ -14,7 +14,7 @@
         </template>
 
         <view class="relative" un-border-t="1 solid gray-2" v-if="typeIndex === 0">
-            <hc-tree @load="getAllLoad" @nodeTap="nodeAllTap"/>
+            <hc-tree counts @load="getAllLoad" @nodeTap="nodeAllTap"/>
         </view>
         <view class="relative" un-border-t="1 solid gray-2" v-if="typeIndex === 1">
             暂无接口
@@ -36,7 +36,7 @@
 <script setup>
 import {ref} from "vue";
 import {onLoad} from '@dcloudio/uni-app'
-import treeApi from '~api/ledger/index';
+import mainApi from '~api/image/index';
 import {useAppStore} from "@/store";
 import {getArrValue, getObjValue} from "js-fast-way";
 import {errorToast} from "@/utils/tools";
@@ -61,12 +61,13 @@ onLoad(({node}) => {
 const getAllLoad = async (node, resolve) => {
     const { contractType } = contractInfo.value
     const { id, contractIdRelation } = getObjValue(node.data)
-    const { data } = await treeApi.queryTreeList({
+    const { data } = await mainApi.queryTreeList({
         contractId: contractId.value,
         contractIdRelation: contractIdRelation ?? '',
         primaryKeyId: id ?? '',
         parentId: id ?? '',
         classifyType: contractType ?? '',
+        classId: pageNode.value?.id,
     })
     resolve(getArrValue(data))
 }
@@ -83,7 +84,21 @@ const nodeAllTap = ({data}) => {
 
 //数据类型
 const bindTypeChange = ({detail}) => {
-    typeIndex.value = detail.value
+    const val = detail.value
+    typeIndex.value = val
+    if (val === 1) {
+        queryWorksTree()
+    }
+}
+
+//获取隐蔽工程的节点
+const queryWorksTree = async () => {
+    const {id} = pageNode.value
+    const {data} = await mainApi.queryWorksTree({
+        contractId: contractId.value,
+        classId: id,
+    })
+    console.log(data)
 }
 
 const toPageNode = () => {