|
@@ -17,7 +17,7 @@
|
|
|
<hc-tree counts @load="getAllLoad" @nodeTap="nodeAllTap"/>
|
|
|
</view>
|
|
|
<view class="relative" un-border-t="1 solid gray-2" v-if="typeIndex === 1">
|
|
|
- 暂无接口
|
|
|
+ <hc-tree @load="getWorksLoad" @nodeTap="nodeWorksTap"/>
|
|
|
</view>
|
|
|
|
|
|
<!--底部操作栏-->
|
|
@@ -84,21 +84,31 @@ const nodeAllTap = ({data}) => {
|
|
|
|
|
|
//数据类型
|
|
|
const bindTypeChange = ({detail}) => {
|
|
|
- const val = detail.value
|
|
|
- typeIndex.value = val
|
|
|
- if (val === 1) {
|
|
|
- queryWorksTree()
|
|
|
- }
|
|
|
+ typeIndex.value = detail.value
|
|
|
}
|
|
|
|
|
|
//获取隐蔽工程的节点
|
|
|
-const queryWorksTree = async () => {
|
|
|
- const {id} = pageNode.value
|
|
|
- const {data} = await mainApi.queryWorksTree({
|
|
|
+const getWorksLoad = async(node, resolve) => {
|
|
|
+ const { contractType } = contractInfo.value
|
|
|
+ const { id, contractIdRelation } = getObjValue(node.data)
|
|
|
+ const { data } = await mainApi.queryWorksTree({
|
|
|
contractId: contractId.value,
|
|
|
- classId: id,
|
|
|
+ contractIdRelation: contractIdRelation ?? '',
|
|
|
+ primaryKeyId: id ?? '',
|
|
|
+ parentId: id ?? '',
|
|
|
+ classifyType: contractType ?? '',
|
|
|
+ classId: pageNode.value?.id,
|
|
|
})
|
|
|
- console.log(data)
|
|
|
+ resolve(getArrValue(data))
|
|
|
+}
|
|
|
+
|
|
|
+//树节点被点击
|
|
|
+const nodeWorksTap = ({data}) => {
|
|
|
+ if (data?.notExsitChild) {
|
|
|
+ treeItem.value = getObjValue(data);
|
|
|
+ } else {
|
|
|
+ treeItem.value = {};
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const toPageNode = () => {
|