wangting
2023-07-05 2ebaebe36e006e68aa15e02629fb18043add0618
修改列表展示
已修改2个文件
227 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Tree/attrCrud.vue 216 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue
@@ -277,7 +277,9 @@
          }else {
            if (record.templet && typeof (record.templet) == 'string' && !validatenull(record.templet) && record.templet.indexOf("function(row,column)")>-1) {
              record.formatter = eval("(" + record.templet + ")");
              //function(row,column){return row[column.property]=='true'?'是':'否'}
              //function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'}
            }else if(record.fieldType=="truefalse"){
              record.formatter = function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'}
            }
          }
        })
@@ -297,13 +299,6 @@
    },
  },
  methods: {
    // 转换数据true和false
    formatBoolean(row, column) {
      if (column.fieldType === "truefalse") {
        return row[column.property] =='true'? "是" : "否";
      }
      return row[column.property];
    },
    // 发布
    setHandler() {
      if (this.selectRow.length <= 0) {
Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -209,7 +209,7 @@
      ></formula-editor>
      <!--    新增  -->
      <el-dialog :visible.sync="addVisible" append-to-body title="从业务类型中选择属性">
        <avue-crud :data="businessData" :option="businessOption" @select="businessSelect">
        <avue-crud :data="businessData" :option="businessOption" @selection-change="businessSelect">
          <template slot="menuLeft">
            <div style="display: flex;">
              <el-select>
@@ -232,13 +232,14 @@
              style="width: 100%"
              @cell-click="handleCellClicks"
              @select="selectHandle"
              @selection-change="selectionChange"
              v-if="this.crudArrayFlag"
    >
      <el-table-column
        type="selection"
        width="55">
      </el-table-column>
      <el-table-column fixed label="序号" type="index" width="55"></el-table-column>
      <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>-->
      <el-table-column v-for="item in this.option.column" :key="item.id"
                       :label="item.label"
                       :prop="item.prop"
@@ -248,12 +249,13 @@
                       align="center"
      >
        <template slot-scope="{ row }">
          <el-input v-if="editingRows === row && editShows== item.prop" v-model="row[item.prop]"
          <el-input v-if="editingRows === row && editShows== item.prop && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer')" v-model="row[item.prop]"
                    @blur="saveRows"></el-input>
          <el-input-number controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]"
                           @blur="saveRows"></el-input-number>
          <el-switch
            v-if="item.label === 'true' || item.label === 'false'"
            active-color="#13ce66"
            inactive-color="#ff4949">
            v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true"
            inactive-value="false">
          </el-switch>
          <span v-else>{{ row[item.prop] }}</span>
        </template>
@@ -335,14 +337,14 @@
      },
      // 编码申请预览data
      applicationData: [],
      //业务类型单选数组
      //业务类型选择数组
      busineSelectList: [],
      //业务类型添加数据
      busineAddList: {},
      //表格单选数组
      CrudSelect: [],
      attrSelectList: [],
      //表格oid
      CrudOid: "",
      attrOid: "",
      //场景变量
      thisSceneTableData: [
        {
@@ -940,7 +942,7 @@
      rowCellList: [],
      List: [],
      option: {
        index: true,
        index: false,
        border: true,
        editBtn: false,
        selection: true,
@@ -953,8 +955,14 @@
          prop: 'name',
          order: 'descending'
        },
        column: [
          {
        column: [{
          prop: 'orderNum',
          label: '排序号',
          sortable: true,
          edit: 'number',
          width: 60,
          fixed: true
        }, {
            label: "属性英文编号",
            prop: "id",
            fixed: true,
@@ -969,6 +977,7 @@
            fixed: true,
            cell: false,
            width: 125,
            edit: 'text',
            sortable: true
          },
          {
@@ -976,6 +985,7 @@
            prop: "attributeGroup",
            cell: false,
            sortable: true,
            edit: 'text',
            width: 125,
          },
          {
@@ -990,78 +1000,90 @@
            cell: false,
            sortable: true,
            width: 105,
            edit: 'number'
          },
          {
            label: "关键属性",
            prop: "keyAttrFlag",
            cell: false,
            type: "switch",
            edit: "switch"
          },
          {
            label: "查询属性",
            prop: "queryAttrFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "高级查询属性",
            prop: "seniorQueryAttrFlag",
            width: 95,
            cell: false,
            edit: "switch"
          },
          {
            label: "相似查询属性",
            label: "相似查重属性",
            prop: "sameRepeatAttrFlag",
            width: 95,
            cell: false,
            edit: "switch"
          },
          {
            label: "必输",
            prop: "requireFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "表单显示",
            prop: "formDisplayFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "列表显示",
            prop: "tableDisplayFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "只读",
            prop: "readonlyFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "列表排序",
            prop: "sortAttrFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "多行文本",
            prop: "textareaFlag",
            cell: false,
            edit: "switch"
          },
          {
            label: "默认值",
            prop: "defaultValue",
            sortable: true,
            cell: false,
            edit: 'text',
            width: 95,
          },
          {
            label: "前缀",
            prop: "prefixValue",
            sortable: true,
            edit: 'select',
            cell: false,
          },
          {
            label: "后缀",
            prop: "suffixValue",
            sortable: true,
            edit: 'select',
            cell: false,
          },
          {
@@ -1069,6 +1091,7 @@
            prop: "componentRule",
            sortable: true,
            cell: false,
            edit: 'refer',
            width: 105,
          },
          {
@@ -1076,6 +1099,7 @@
            prop: "verifyRule",
            sortable: true,
            cell: false,
            edit: 'refer',
            width: 105,
          },
          {
@@ -1083,84 +1107,97 @@
            prop: "codeDateFormat",
            sortable: true,
            width: 105,
            edit: 'select',
            cell: false,
          },
          {
            label: "分类注入",
            prop: "classifyInvokeLevel",
            cell: false,
            edit: 'refer'
          },
          {
            label: "枚举注入",
            prop: "enumString",
            cell: false,
            edit: 'refer'
          },
          {
            label: "级联属性",
            prop: "parentCode",
            cell: false,
            edit: 'refer'
          },
          {
            label: "参照配置",
            prop: "referConfig",
            cell: false,
            edit: 'refer'
          },
          {
            label: "级联查询属性",
            prop: "parentQueryAttr",
            width: 105,
            cell: false,
            edit: 'text'
          },
          {
            label: "选择库标识",
            prop: "libraryIdentification",
            width: 105,
            cell: false,
            edit: 'text'
          },
          {
            label: "填写提示",
            prop: "explain",
            cell: false,
            edit: 'text'
          },
          {
            label: "表单显示样式",
            prop: "formDisplayStyle",
            width: 105,
            cell: false,
            edit: 'text'
          },
          {
            label: "表格显示样式",
            prop: "tableDisplayStyle",
            width: 105,
            cell: false,
            edit: 'text'
          },
          {
            label: "表单超链接",
            prop: "formHref",
            width: 95,
            cell: false,
            edit: 'text'
          },
          {
            label: "表格超链接",
            prop: "tableHref",
            width: 95,
            cell: false,
            edit: 'text'
          },
          {
            label: "表格显示js",
            prop: "tableDisplayJs",
            width: 95,
            cell: false,
            edit: 'text'
          },
          {
            label: "长度",
            prop: "controlLength",
            cell: false,
            cell: false
          },
          {
            label: "小数精度",
            prop: "precisionLength",
            cell: false,
            cell: false
          },
          {
            label: "取值范围",
@@ -1168,10 +1205,39 @@
            sortable: true,
            cell: false,
            width: 105,
            edit: 'text'
          },
        ],
        List: []
      },
      vciFieldTypeMap : {
        VTBoolean: "布尔型",
        VTClob: "长文本",
        VTDate: "日期",
        VTDateTime: "日期时间",
        VTTime: "时间",
        VTLong: "长整型",
        VTDouble: "金额/双精度",
        VTInteger: "整形",
        VTFilePath: "文件",
        VTString: "字符串"
      }
    }
  },
  computed:{
    attrOids() {
      let oids = [];
      this.attrSelectList.forEach(ele => {
        oids.push(ele.oid);
      });
      return oids.join(",");
    },
    busineOids() {
      let oids = [];
      this.busineSelectList.forEach(ele => {
        oids.push(ele.oid);
      });
      return oids.join(",");
    }
  },
  mounted() {
@@ -1186,11 +1252,11 @@
    //属性分组按钮
    attrVisibleHandle() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板属性')
      } else if (this.CrudSelect < 1) {
      } else if (this.attrSelectList < 1) {
        this.$message.warning('请选择一条模板属性')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        this.attrVisible = true;
      }
    },
@@ -1216,38 +1282,74 @@
    },
    //业务类型保存
    busineAddHandle() {
      if (this.busineSelectList.length > 1) {
        this.$message.warning('请选择一条业务类型数据')
      } else {
        this.$set(this.busineAddList, 'classifytemplateoid', this.crudOid)
        this.$set(this.busineAddList, 'oid', '')
        this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)))
        this.addVisible = false;
      if (this.busineSelectList.length == 0) {
        this.$message.warning('请选择属性集');
        return false;
      }
debugger;
      let ordernum = this.ProData.length;
      this.busineSelectList.forEach((citem) => {
        let isCopy = false;
        this.ProData.forEach((item) => {
          if (citem.id == item.id) {
            isCopy = true;
            return false;
          }
        })
        if (!isCopy) {
          citem.oid = ''
          this.busineAddList=Object.assign(citem, {
            orderNum: ++ordernum,
            attributedatatype: citem.attrDataType,
            attributeDataTypeText: this.vciFieldTypeMap[citem.attrDataType],
            controlLength: citem.attributeLength,
            valueArea: citem.range,
            referbtmid: citem.referBtmTypeId,
            referbtmname: citem.referBtmTypeName,
            referConfig: '',
            enumid: citem.enumId,
            precisionLength: (citem.precisionLength ? citem.precisionLength : '') + (citem.scaleLength ? '(' + citem.scaleLength + ')' : ''),
            classifyTemplateOid: this.crudOid,
            classifytemplateoid: this.crudOid,
            formDisplayFlag: true,
            tableDisplayFlag: true,
            sortAttrFlag: false,
            queryAttrFlag: true,
            seniorQueryAttrFlag: true,
            attrTableWidth: 120
          })
          this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)))
        }
      })
      this.addVisible = false;
    },
    //业务类型单选
    //业务类型选择
    businessSelect(selection, row) {
      this.busineSelectList = selection
      this.busineAddList = row
    },
    // 从业务类型中选择数据
    // 从业务类型中选择数据弹窗
    busineHandle() {
        this.addVisible = true;
        AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => {
          this.businessData = res.data.data;
        })
      this.addVisible = true;
      this.busineSelectList = []
      this.busineAddList = [];
      AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => {
        this.businessData = res.data.data;
      })
    },
    // 级联属性按钮
    CascadeHandle() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板属性')
      } else if (this.CrudSelect.length < 1) {
      } else if (this.attrSelectList.length < 1) {
        this.$message.warning('请选择一条模板属性')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        this.CascadeVisible = true;
        gridCodeClassifyTemplateAttr({
          'conditionMap[classifyTemplateOid]': this.Formlist[0].oid,
          'conditionMap[oid_notequal]': this.CrudOid
          'conditionMap[oid_notequal]': this.attrOid
        }).then(res => {
          this.CascadeData = res.data.data;
        })
@@ -1255,10 +1357,12 @@
    },
    //表格单选
    selectHandle(selection, row) {
      this.CrudOid = row.oid;
      this.CrudSelect = selection;
      this.attrOid = row.oid;
      this.attrRow = row;
      console.log('123',row,selection)
    },
    //表格选择
    selectionChange(list) {
      this.attrSelectList = list;
    },
    //保存
    addsHandler() {
@@ -1283,9 +1387,9 @@
    },
    //表格行编辑
    handleCellClicks(row, column) {
      this.editingRows = row;
      this.editShows = column.property;
      this.rowOid = row.oid;
        this.editingRows = row;
        this.editShows = column.property;
        this.rowOid = row.oid;
    },
    saveRows() {
      this.editingRows = null;
@@ -1308,11 +1412,11 @@
    },
    //枚举注入按钮
    enmuVisHandle() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板属性')
      } else if (this.CrudSelect < 1) {
      } else if (this.attrSelectList < 1) {
        this.$message.warning('请选择一条模板属性')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        this.enumVisible = true;
      }
    },
@@ -1354,11 +1458,11 @@
    },
    //点击分类注入按钮
    injectBtn() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板数据')
      } else if (this.CrudSelect.length < 1) {
      } else if (this.attrSelectList.length < 1) {
        this.$message.warning('请选择一条模板数据')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        this.injectVisible = true
      }
    },
@@ -1412,11 +1516,11 @@
    },
    //同步到其他模板
    syncHandle() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板属性数据')
      } else if (this.CrudSelect.length < 1) {
      } else if (this.attrSelectList.length < 1) {
        this.$message.warning('请选择一条模板属性数据')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        copyto({oid: this.attrRow.oid}).then(res => {
          this.$message.success('同步成功')
        })
@@ -1428,11 +1532,11 @@
    },
    //组合规则
    isShowHandler() {
      if (this.CrudSelect.length > 1) {
      if (this.attrSelectList.length > 1) {
        this.$message.warning('只能选择一条模板属性数据')
      } else if (this.CrudSelect.length < 1) {
      } else if (this.attrSelectList.length < 1) {
        this.$message.warning('请选择一条模板属性数据')
      } else if (this.CrudSelect.length === 1) {
      } else if (this.attrSelectList.length === 1) {
        this.isShowformulaEdit = true;
      }
    },