xiejun
2023-09-18 021db80b57a7bd79eda3ef718b33320ea4be2470
Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
@@ -88,6 +88,12 @@
          queryParams[key] = this.options.rootParams[key];
        }
      }
      if(this.options.sortField){
        queryParams['sort'] = this.options.sortField;//字段
      }
      if(this.options.sortType){
        queryParams['order'] = this.options.sortType;//方法
      }
      if (this.options.conditionParams) {
        //说明是扩展属性
        for (var key in this.options.conditionParams) {
@@ -123,10 +129,23 @@
      this.params=queryParams;
    },
    getTree(){
      getTree(this.params,this.treeUrl).then(res => {
          this.treeData=res.data
    getTree() {
      getTree(this.params, this.treeUrl).then(res => {
        res.data.map(item => {
          if (!item.attribute) {
            item.attribute = {
              data: {}
            }
          } else {
            item.attribute.data = item.attribute.data || {}
          }
          return {
            ...item,
            leaf: !item.hasChildren
          }
        })
        this.treeData = res.data
      })
    },
    treeLoad: function (treeNode, resolve) {
      const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid;
@@ -142,6 +161,13 @@
      }
      getLazyTree(this.params,this.treeUrl).then(res => {
        resolve(res.data.data.map(item => {
          if(!item.attribute){
            item.attribute={
              data:{}
            }
          }else{
            item.attribute.data=item.attribute.data || {}
          }
          return {
            ...item,
            leaf: !item.hasChildren
@@ -163,13 +189,13 @@
      const textSep =this.config.textSep;
      for(var j =0;j<checkedData.checkedNodes.length;j++){
        const item=checkedData.checkedNodes[j];
        var v=this.config.valueField.indexOf("attribute.")>=0?item.attributes[this.config.valueField.replace("attribute.","")]:(item.attributes[this.config.valueField] || item[this.config.valueField])
        var v=this.config.valueField.indexOf("attribute.")>=0?(item.attributes[this.config.valueField.replace("attribute.","")] || item.attributes.data[this.config.valueField.replace("attribute.","")]):(item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField])
        value.push(v);
        var tempRaw = [];
        var textFieldArray = this.config.textField.split(",");
        for (var i = 0; i < textFieldArray.length; i++) {//显示的字段可能有多个
          if (!validatenull(textFieldArray[i])) {
            var t=textFieldArray[i].indexOf("attribute.")>=0?item.attributes[textFieldArray[i].replace("attribute.","")]:(item.attributes[textFieldArray[i]] || item[textFieldArray[i]])
            var t=textFieldArray[i].indexOf("attribute.")>=0?(item.attributes[textFieldArray[i].replace("attribute.","")] ||item.attributes.data[textFieldArray[i].replace("attribute.","")]):(item.attributes[textFieldArray[i]] || item[textFieldArray[i]] || item.attributes.data[textFieldArray[i]])
            tempRaw.push(t);
          }
        }