wangting
2023-09-08 bc796666e8267f1e47ff9451d9c105b6e327ecff
Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
@@ -16,6 +16,7 @@
                 @search-change="searchChange"
                 @search-reset="searchReset"
                 @selection-change="selectionChange"
                 @row-click="rowClick"
                 @current-change="currentChange"
                 @size-change="sizeChange"
                 @refresh-change="refreshChange"
@@ -74,6 +75,7 @@
        border: true,
        index: true,
        selection: true,
        reserveSelection:true,
        dialogClickModal: false,
        highlightCurrentRow: true,
        column: []
@@ -82,8 +84,6 @@
  },
  created() {
    this.getParams();
    // console.log('referConfig:')
    // console.log(this.referConfig)
  },
  mounted() {
    if(this.referConfig.options.page){
@@ -156,13 +156,13 @@
        this.option.column = [{
          prop: 'id',
          label: '英文名称',
          sort: true,
          sortable: true,
          width: 150,
          search: true
        }, {
          prop: 'name',
          label: '中文名称',
          sort: true,
          sortable: true,
          width: 150,
          search: true
        }, {
@@ -178,12 +178,18 @@
      } else {
        this.option.column = this.options.tableConfig.cols.map(item => {
          if (item.field != 'LAY_TABLE_INDEX' && item.field != 'LAY_CHECKED') {
            let formatter=item.template || item.templet;
            if(typeof formatter == "string" && formatter !=''){
              formatter=eval("(" + formatter + ")")
            }
            return {
              ...item,
              label: item.title,
              prop: item.field,
              formatter:item.template,
              search: true
              formatter:formatter,
              search:this.options.tableConfig.queryColumns.some(qItem=>{
                return qItem.field==item.field
              })
            }
          }
        })
@@ -216,7 +222,7 @@
      this.selectionList.forEach((item,_index) =>{
        if(isMutiValue){
          var valueFieldArray = _that.props.value.split(",");
          valueFieldArray.forEach((_indexField,_itemField)=>{
          valueFieldArray.forEach((_itemField,_indexField)=>{
            value.push( item[_itemField] + (_that.referConfig.valueSep?_that.referConfig.valueSep:' '));
          })
        }else {
@@ -224,7 +230,7 @@
        }
        if(isMutiRaw) {
          var rawFieldArray = _that.props.label.split(",");
          rawFieldArray.forEach((_indexField,_itemField)=>{
          rawFieldArray.forEach((_itemField,_indexFiel)=>{
            text.push(item[_itemField] + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ;
          })
        }else{
@@ -234,7 +240,7 @@
      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});
      this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:this.referConfig.fieldMap});
      this.visible=false;
    },
    searchReset() {
@@ -252,6 +258,11 @@
    },
    sizeChange(pageSize){
      this.page.pageSize = pageSize;
    },
    rowClick (row) {
      this.$refs.referDefalutCrud.toggleSelection();
      this.$refs.referDefalutCrud.toggleRowSelection(row); //选中当前行
      this.selectionList=[row]
    },
    selectionChange(list) {
      if (!this.isMuti && list.length > 1) {
@@ -277,8 +288,13 @@
          }
        }
        getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url, this.method).then(res => {
          this.data = res.data.records;
          this.page.total=res.data.total
          if(res.data.records){
            this.data = res.data.records
            this.page.total=res.data.total ;
          }else{
            this.data = res.data.data.records;
            this.page.total=res.data.data.total;
          }
          this.loading = false;
          this.selectionClear();
        }).catch(error=>{