ludc
2024-09-09 88c5cf35a5ea870378d7964086ed2c09ddc299c8
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -170,8 +170,9 @@
        if (newval ==0) {
          getBizTypes().then(res => {
            const data = res.data.data.map(item => {
              item.label=item.attributes.id;
              return item;
              this.processChildren(item); // 处理每个节点
              item.attributes.label = item.attributes.id;
              return item.attributes;
            });
            this.treeData = data;
            loading.close();
@@ -195,14 +196,24 @@
      const loading = this.$loading({});
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          item.label=item.attributes.id;
          return item;
          this.processChildren(item); // 处理每个节点
          item.attributes.label = item.attributes.id;
          return item.attributes;
        });
        this.treeData = data;
        loading.close();
      })
    },
    // 处理业务类型树形结构
    processChildren(item) {
      if (item.children && item.children.length > 0) {
        item.attributes.children = item.children.map(child => {
          child.attributes.label = child.attributes.id;
          this.processChildren(child); // 递归处理每个子节点
          return child.attributes; // 只返回子节点的 attributes
        });
      }
    },
    // 树点击
    nodeClick(row) {
      this.nodeRow = row;