wangting
2023-09-21 afbaeaaba4f2e503d4c05d7c9259d43b29362bcc
修改参照
已修改6个文件
122 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
@@ -154,7 +154,6 @@
      handler(newval,oldval){
        if(newval){
          this.TreeValueForm=newval;
          // console.log(this.TreeValueForm)
        }
      },
      deep:true,
@@ -167,23 +166,18 @@
      if (this.eventList) {
        this.eventFlag= this.eventList.some(item => {
          if (item.classifyInvokeEditFlag === 'true') {
            console.log('even', item);
            this.eventObject = item;
            return true;
          }
        });
        // console.log('add',add)
      }
      // 无需分组数据
      let column = [];
      let group = [];
      let dictKeys = [];
      let slotColumnList = [];
      let value=''
      formItemList.forEach((formItem) => {
        formItem = this.resetFormConfig(formItem);
        console.log(formItem)
        // console.log('formItem.dicData.value',formItem.dicData)
        if (formItem.type === "line") {
          group.push({
            label: formItem.text,
@@ -283,9 +277,7 @@
            value: "key",
          },
        };
        // console.log('columnItem',columnItem)
        slotColumnList.push(columnItem);
        // console.log('slotColumnList',slotColumnList)
        if (group.length === 0) {
          column.push(columnItem);
        } else {
@@ -307,7 +299,6 @@
    },
    // 使用传入的表单数据配置
    resetFormConfig(formItem) {
      // console.log(this.selfColumnConfig)
      for (const configType in this.selfColumnConfig) {
        if (Object.hasOwnProperty.call(this.selfColumnConfig, configType)) {
          const element = this.selfColumnConfig[configType];
@@ -323,9 +314,6 @@
              if (Object.hasOwnProperty.call(element, newAttr)) {
                const oldAttr = element[newAttr];
                formItem[newAttr] = formItem[oldAttr];
                // console.log(formItem)
                // console.log(newAttr,oldAttr)
                // console.log(formItem[newAttr],formItem[oldAttr])
              }
            }
          } else if (configType === "directVoluation") {
@@ -416,7 +404,7 @@
      );
    },
    setReferValue(data) {
      // console.log(data)
      debugger;
      if (data.field) {
        this.form[data.field] = data.value || "";
        this.form[data.showField] = data.text || "";
@@ -430,21 +418,24 @@
              if (!_item.attributes) {
                _item.attributes = _item;
              }
              if (!_item.attributes.data) {
                _item.attributes.data = {};
              }
              if (mapFields.length == 1) {
                var mapField = mapFields[0];
                if (mapField.indexOf("attribute.") > -1) {
                  temp = _item['attributes'][mapField.subString("attribute.".length)];
                  temp = _item['attributes'][mapField.subString("attribute.".length)] || _item['attributes']['data'][mapField.subString("attribute.".length)];
                } else {
                  temp = _item['attributes'][mapField] || _item[mapField];
                  temp = _item['attributes'][mapField] ||_item['attributes']['data'][mapField] || _item[mapField];
                }
              } else {
                //有多个
                var mutiTemp = [];
                layui.each(mapFields, function (_indexField, _itemField) {
                  if (_itemField.indexOf("attribute.") > -1) {
                    mutiTemp.push(_item['attributes'][_itemField.subString("attribute.".length)]);
                    mutiTemp.push(_item['attributes'][_itemField.subString("attribute.".length)] || _item['attributes']['data'][_itemField.subString("attribute.".length)]);
                  } else {
                    mutiTemp.push(_item['attributes'][_itemField] || _item[_itemField]);
                    mutiTemp.push(_item['attributes'][_itemField] || _item['attributes']['data'][_itemField] || _item[_itemField]);
                  }
                });
                temp = mutiTemp.join(' ');
Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -253,7 +253,6 @@
            } else {
              this.showResembleQuery = false;
            }
            // console.log(this.hasResemble, "this.hasResemblethis.hasResemble");
            this.$nextTick(() => {
              this.$refs.FormTemplate.templateRender(
                res.data.formDefineVO.items
@@ -306,8 +305,6 @@
            that.showCodeApply = false;
          }
        }
        // console.log(' this.secVOList',that.secVOList)
        // console.log(' res.data.data.secVOList',res.data.data.secVOList)
      });
    },
    getFormData(form) {
@@ -484,8 +481,6 @@
      } else if (item.secType == "coderefersec") {
        //引用码段
        params = JSON.parse(item.referValueInfo);
        // console.log('item',item)
        console.log('params',params)
      }
      return params;
    },
Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue
@@ -193,15 +193,17 @@
        },
        // 参照组件数据变更
        referConfigDataUpdate(data) {
            const { field } = data;
            this.secVOList = this.secVOList.map((item) => {
                if (item.parentClassifySecOid === field) {
                    this.$refs.CodeApply.form[item.oid] = undefined;
                    this.$refs.CodeApply.form[item.name] = undefined;
                }
                return item;
            });
            this.$refs.CodeApply.templateRender(this.secVOList);
          const {field} = data;
          this.secVOList = this.secVOList.map((item) => {
            if (item.parentClassifySecOid === field) {
              this.$refs.CodeApply.form[item.oid] = undefined;
              this.$refs.CodeApply.form[item.name] = undefined;
              item.readOnly = false;
              item.referConfig.extraParams.parentClassifyValueOid = data.value;
            }
            return item;
          });
          this.$refs.CodeApply.templateRender(this.secVOList);
        },
        isRequired(item) {
            return item.nullableFlag != "true";
Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
@@ -30,8 +30,6 @@
    </el-dialog>
    <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input>
    <!--<avue-input-table ref="referTable"  :props="props"  :column="column" :on-load="onLoad" v-model="value"  :placeholder="title" ></avue-input-table>
  -->
  </div>
</template>
@@ -91,6 +89,8 @@
      this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage;
    }else if(!validatenull(this.referConfig.options.limit)){
      this.page.pageSize=this.referConfig.options.limit
    }else if(!validatenull(this.referConfig.options.tableConfig.limit)){
      this.page.pageSize=this.referConfig.options.tableConfig.limit
    }
  },
  computed:{
@@ -122,7 +122,7 @@
        queryParams['referBo'] = this.options['referBo'] || this.options['referType'];
      }
      queryParams['referType'] = queryParams['referBo']
      if (this.options.remoteSort && this.options.initSort) {
      if (this.options.initSort) {
        queryParams['order'] = this.options.initSort.type;//方法
        queryParams['sort'] = this.options.initSort.field;//字段
      }
@@ -286,11 +286,14 @@
          text.push(itemText);
        }
      })
      let mapFields;
      if (this.options.mapFields == "") {
        mapFields = this.referConfig.fieldMap;
      } else {
        mapFields = Object.assign(this.referConfig.fieldMap, JSON.parse(this.options.mapFields));
      let mapFields =this.referConfig.fieldMap || {};
      try {
        if(!validatenull(this.options.mapFields)){
          mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ;
        }
      }catch (e) {
      }
      this.value=value.join(',');
      this.text=text.join(',')
Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue
@@ -33,8 +33,6 @@
    </el-dialog>
    <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input>
    <!--<avue-input-table ref="referTable"  :props="props"  :column="column" :on-load="onLoad" v-model="value"  :placeholder="title" ></avue-input-table>
  -->
  </div>
</template>
@@ -95,6 +93,8 @@
      this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage;
    }else if(!validatenull(this.referConfig.options.limit)){
      this.page.pageSize=this.referConfig.options.limit
    }else if(!validatenull(this.referConfig.options.tableConfig.limit)){
      this.page.pageSize=this.referConfig.options.tableConfig.limit
    }
    this.$nextTick(() => {
      this.$refs.referCrud.doLayout()
@@ -130,7 +130,7 @@
        queryParams['referBo'] = this.options['referBo'] || this.options['referType'];
      }
      queryParams['referType']= queryParams['referBo']
      if (this.options.remoteSort && this.options.initSort) {
      if (this.options.initSort) {
        queryParams['order'] = this.options.initSort.type;//方法
        queryParams['sort'] = this.options.initSort.field;//字段
      }
@@ -340,7 +340,14 @@
          text.push(itemText);
        }
      })
      let mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ;
      let mapFields =this.referConfig.fieldMap || {};
      try {
        if(!validatenull(this.options.mapFields)){
          mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ;
        }
      }catch (e) {
      }
      this.value=value.join(',');
      this.text=text.join(',')
      this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields});
Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue
@@ -1,5 +1,5 @@
<template>
  <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree>
  <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :blur="valueChange" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree>
</template>
<script>
@@ -25,7 +25,7 @@
      },
      treeUrl: this.referConfig.options.url || '/api/ubcs-code/mdmEngineController/defaultReferTree',
      treeData: [],
      selectionList: [],
      checkedData:[],
      currentNode:{},
      params: {},
      loadType: {'all': 'all', 'node': 'node'},
@@ -34,8 +34,6 @@
  },
  created() {
    this.getParams();
    // console.log('referConfig:')
    // console.log(this.referConfig)
  },
  mounted() {
    if(!this.lazy){
@@ -79,20 +77,20 @@
      queryParams['loadType'] = this.options.loadType;
      queryParams['multipleSelect'] = this.isMuti;
      queryParams['isMuti'] = queryParams['multipleSelect'];
      if (this.options.remoteSort && this.options.initSort) {
      if (this.options.initSort) {
        queryParams['order'] = this.options.initSort.type;//方法
        queryParams['sort'] = this.options.initSort.field;//字段
      }
      if (this.options.rootParams) {
        for (var key in this.options.rootParams) {
          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.rootParams) {
        for (var key in this.options.rootParams) {
          queryParams[key] = this.options.rootParams[key];
        }
      }
      if (this.options.conditionParams) {
        //说明是扩展属性
@@ -125,7 +123,6 @@
          queryParams['replaceMap["' + key + '"]'] = this.options.replaceParams[key];//新的方式
        }
      }
      queryParams['parentValue']='\\IN(SELECT oid from PL_CODE_CLASSIFY where id =\'hesuanfenlei\')'
      this.params=queryParams;
    },
@@ -181,7 +178,12 @@
      }
     },
    checked(checkedNode, checkedData) {
      this.setValue(checkedData)
      this.checkedData=checkedData
    },
    valueChange(){
      if(this.isMuti){
       // this.setValue(this.checkedData)
      }
    },
    setValue:function (checkedData){
      var value = [];
@@ -201,8 +203,16 @@
        }
        text.push(tempRaw.join(textSep));
      }
      let mapFields =this.referConfig.fieldMap || {};
      try {
        if(!validatenull(this.options.mapFields)){
          mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ;
        }
      }catch (e) {
      }
      this.value = value.join(',');
      this.text = text.join(',')
      this.text = text.join(',');
      this.$emit("setValue", {
        field: this.referConfig.field,
        showField: this.referConfig.showField,
@@ -210,7 +220,7 @@
        text: this.text || '',
        isTreeMuti:this.isMuti,
        rawData: checkedData.checkedNodes,
        fieldMap:this.referConfig.fieldMap
        fieldMap:mapFields
      });
    }
  },