wangting
2024-11-21 7a52011bb22079286c09fb20760173ac1c304bfc
Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-tree.vue
@@ -167,7 +167,7 @@
      if (!value) return true;
      return data[this.defaultProps.label].indexOf(value) !== -1;
    },
    sourceDataMap: function () {debugger;
    sourceDataMap: function () {
      const sourceDataMap = {};
      if (Object.keys(this.sourceData).length > 0) {
        if (this.sourceData.oid) {
@@ -180,7 +180,7 @@
        for (let i in this.sourceData) {
          const item = this.sourceData[i]
          if (item && item.constructor === Object) continue;
          if (i == 'type' || i == 'context' || i == 'content') continue;
          if (['type', 'context', 'content', 'querytemplate', 'querytype'].includes(i)) continue;
          sourceDataMap['sourceData["' + i + '"]'] = item
        }
      }
@@ -188,19 +188,19 @@
      if (Object.keys(this.paramVOS).length > 0) {
        for (let j in this.paramVOS) {
          if (this.paramVOS[j] && this.paramVOS[j].constructor === Object) continue;
          if (j == 'type' || j == 'context' || j == 'content' || j == "getdataurl" || j == "getdatamethod" || j == "url" || j == "method" || j == "uploadfileurl" || j == "title") continue;
          if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata','component'].includes(j)) continue;
          sourceDataMap['sourceData["' + j + '"]'] = this.paramVOS[j]
        }
      }
      return sourceDataMap;
    },
    getParams: function () {debugger;
    getParams: function () {
      let parentFieldName = "";
      if (this.componentVO.treeDefineVO.showLinkAbs) {
        parentFieldName = this.componentVO.treeDefineVO.showLinkAbs.split(",")[0];
      }
      const queryTemplate=this.sourceData.querytemplate || this.paramVOS.querytemplate;
      const linkTypeFlag=this.sourceData.queryType==0?false:(!validatenull(this.sourceData.linkType)?true:(this.paramVOS.querytype==0?false:true));
      const linkTypeFlag=this.sourceData.querytype==0?false:(!validatenull(this.sourceData.linktype)?true:(this.paramVOS.querytype==0?false:true));
      const treeParams = {
        queryAllLevel: !this.lazy,
        loadType: this.componentVO.treeDefineVO.loadType,
@@ -215,7 +215,7 @@
        textField: this.componentVO.treeDefineVO.treeNodeExpression,
        queryTemplate: queryTemplate,
        linkTypeFlag: linkTypeFlag,
        rootExpress: this.componentVO.treeDefineVO.rootExpress || ''
        rootExpress: this.componentVO.treeDefineVO.rootContent || ''
      }
      const sourceDataMapList = this.sourceDataMapParams;
@@ -241,13 +241,23 @@
      }
      const parentBtmName = (node.level === 0) ? '' : node.data.attributes.btmname;
      const params = this.params;
      let url='';
      if (node.level === 0) {
        params.queryRoot = true;
        if(this.paramVOS.querytemplate){
          //说明是通过按钮点击打开的,Action参数中配置有this.paramVOS.querytemplate
          url="/api/uiDataController/getDataByTemp";
        }
      } else {
        delete params.queryRoot;
        if(this.paramVOS.querytemplate){
          //说明是通过按钮点击打开的,Action参数中配置有this.paramVOS.querytemplate
          delete params.queryTemplate;
          delete params.linkTypeFlag;
        }
      }
      getTree(parentOid, parentBtmName, params).then(res => {
        resolve(res.data.treeData)
      getTree(parentOid, parentBtmName, params,url).then(res => {
        resolve(res.data.treeData || res.data.obj || [])
        this.$nextTick(()=>{
          if (this.isRefresh) {
            this.$refs.tree.setCurrentKey(this.currentClickNode.data.oid);