田源
2023-10-12 b4c7c6a738f44afadbc388bb774ac044e7fafe38
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -23,7 +23,8 @@
      </el-button-group>
      <el-button-group>
        <!--    保存-->
        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain size="small"
        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain
                   size="small"
                   type="success" @click.prevent="addsHandler">保存
        </el-button>
        <!--    预览排序-->
@@ -67,11 +68,14 @@
      </el-button-group>
      <!-- 是否开启编辑     -->
      <el-button-group>
        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" icon="el-icon-view" plain
                   size="small"
                   @click="editOpen">开启编辑
        <el-button
          v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false"
          icon="el-icon-view" plain
          size="small"
          @click="editOpen">开启编辑
        </el-button>
        <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue" placeholder="请选择"
        <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue"
                   placeholder="请选择"
                   size="small">
          <el-option
            v-for="item in selectoptions"
@@ -325,17 +329,20 @@
                       align="center"
      >
        <template slot-scope="{ row }">
          <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )"
                    :ref="'input' + row.oid"
                    v-show="!AddCellFlag"
                    v-model="row[item.prop]"
                    @blur="saveRows(row)"
                    ></el-input>
          <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]"
          <el-input
            v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )"
            v-show="!AddCellFlag"
            :ref="'input' + row.oid"
            v-model="row[item.prop]"
            @blur="saveRows(row)"
          ></el-input>
          <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'"
                           v-model="row[item.prop]"
                           :style="{width:(item.width-10)+'px'}"
                           controls-position="right"
                           size="small" @blur="saveRows"></el-input-number>
          <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" v-model="row[item.prop]" allow-create default-first-option
          <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend"
                     v-model="row[item.prop]" allow-create default-first-option
                     filterable
                     @blur="selectChangeHandler(item.editConfig,index)">
            <el-option
@@ -431,7 +438,7 @@
    },
    crudArrayFlag: {
      handler(newval, oldval) {
        console.log('crudArrayFlag', newval)
        // console.log('crudArrayFlag', newval)
      }
    },
    crudArray: {
@@ -455,16 +462,6 @@
        }
      }
    },
    // editingRows:{
    //   handler(newval,oldval){
    //     if(newval){
    //       const inputElement = document.querySelector(`#inputRef${newval.oid}`);
    //       if (inputElement) {
    //         inputElement.focus();
    //       };
    //     }
    //   }
    // },
    ProData: {
      handler(newval, oldval) {
        if (newval) {
@@ -485,7 +482,7 @@
    },
    editOpenFlag: {
      handler(newval, oldval) {
        console.log('editOpenFlag', newval)
        // console.log('editOpenFlag', newval)
      },
      deep: true,
      immediate: true
@@ -495,7 +492,7 @@
  data() {
    return {
      // 保存单元格状态
      AddCellFlag:false,
      AddCellFlag: false,
      //全屏编辑高度状态
      editStyleFlag: false,
      loading: false,
@@ -642,6 +639,7 @@
        addBtn: false,
        header: false,
        align: 'center',
        columnBtn:false,
        menuAlign: 'center',
        column: [{
          label: '',
@@ -856,6 +854,7 @@
          {
            label: "参照配置",
            prop: "referConfig",
            width: 105
          },
          {
            label: "级联查询属性",
@@ -900,7 +899,7 @@
          {
            label: "取值范围",
            prop: "valueArea",
          },
          }
        ]
      },
      // 存储表格数据
@@ -1091,12 +1090,12 @@
          {
            label: "属性英文名称",
            prop: "id",
            width:100,
            width: 100,
          },
          {
            label: "属性中文名称",
            prop: "name",
            width:100,
            width: 100,
          },
          {
            label: "长度",
@@ -1177,6 +1176,7 @@
      List: [],
      option: {
        index: false,
        columnBtn:false,
        border: true,
        editBtn: false,
        selection: true,
@@ -1802,7 +1802,7 @@
          this.editOpenFlag = false;
          // 调用父组件修改按钮状态
          this.$emit('editCloseChildren')
          this.AddCellFlag=true;
          this.AddCellFlag = true;
        }).catch(() => {
          this.$message.warning('保存失败,请查看控制台输出!')
        });
@@ -2024,7 +2024,13 @@
    },
    //分类注入保存
    injectAddHandle() {
      const { classifyInvokeAttr, classifyInvokeAttrName, classifyInvokeLevel, classifyInvokeEditFlag, classifyNumber } = this.injectOption;
      const {
        classifyInvokeAttr,
        classifyInvokeAttrName,
        classifyInvokeLevel,
        classifyInvokeEditFlag,
        classifyNumber
      } = this.injectOption;
      const data = {
        "注入类型": classifyInvokeAttr,
@@ -2112,7 +2118,7 @@
        this.editStyleFlag = true;
        this.attrEditVisible = true;
        this.attrFlag = true;
        this.AddCellFlag=true;
        this.AddCellFlag = true;
      }
    },
@@ -2126,7 +2132,7 @@
    updataFormlaContent(val) {
      if (this.CurrentCell) {
        this.$set(this.CurrentCell, 'componentRule', val.replace(/"/g, ''))
        this.componentRuleText= this.CurrentCell.componentRule
        this.componentRuleText = this.CurrentCell.componentRule
      } else {
        this.$set(this.attrRow, 'componentRule', val.replace(/"/g, ''))
      }
@@ -2143,12 +2149,12 @@
    },
    // 排序 this.AddCellFlag=false;
    sortChange(val) {
      console.log(val)
      // console.log(val)
    },
    //开启编辑
    editOpen() {
      this.editOpenFlag = true;
      this.AddCellFlag=false;
      this.AddCellFlag = false;
    },
    //定义一个关闭编辑的方法供子组件使用
    editClose() {