田源
2024-01-24 7521100425838f0ce8d4ef8005861ef4941f961b
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -276,8 +276,8 @@
      </el-dialog>
      <!--        全屏编辑-->
      <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true">
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"
                  :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" :btnAuthList="btnAuthList"
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :btnAuthList="btnAuthList"
                  :crudArrayFlag="this.crudArrayFlag" :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag"
                  @editCloseChildren="editClose"></attrCrud>
      </el-dialog>
      <!--      组合规则-->
@@ -321,82 +321,83 @@
    </div>
      <el-table v-if="this.crudArrayFlag"
                ref="referAttrCrud"
                v-loading="loading"
                :data="ProData"
                :height="this.tableHeight"
                :header-cell-style="{background:'#FAFAFA',color:'#505050'}"
                border
                style="width: 100%"
                @select="selectHandle"
                @cell-click="handleCellClicks"
                @selection-change="selectionChange"
                @row-click="rowClick"
    <el-table v-if="this.crudArrayFlag"
              ref="referAttrCrud"
              v-loading="loading"
              :data="ProData"
              :header-cell-style="{background:'#FAFAFA',color:'#505050'}"
              :height="this.tableHeight"
              border
              style="width: 100%"
              @select="selectHandle"
              @cell-click="handleCellClicks"
              @selection-change="selectionChange"
              @row-click="rowClick"
    >
      <el-table-column
        :fixed="!editStyleFlag ? 'left' : undefined"
        type="selection" width="55">
      </el-table-column>
      <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>-->
      <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'"
                       :key="item.id"
                       :fixed="!editStyleFlag ? item.fixed : undefined"
                       :formatter="formAttr"
                       :label="item.label"
                       :prop="item.prop"
                       :show-overflow-tooltip="true"
                       :sortable="item.sortable"
                       :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')"
                       align="center"
      >
        <el-table-column
          :fixed="!editStyleFlag ? 'left' : undefined"
          type="selection" width="55">
        </el-table-column>
        <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>-->
        <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'"
                         :key="item.id"
                         :fixed="!editStyleFlag ? item.fixed : undefined"
                         :formatter="formAttr"
                         :label="item.label"
                         :prop="item.prop"
                         :show-overflow-tooltip="true"
                         :sortable="item.sortable"
                         :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')"
                         align="center"
        >
          <template slot-scope="{ row }">
            <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-show="!AddCellFlag"
                             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" :clearable="true"
                       v-model="row[item.prop]" allow-create default-first-option
                       filterable v-show="!AddCellFlag"
                       @blur="selectChangeHandler(item.editConfig,index)">
              <el-option
                v-for="optionItem in item.data"
                :key="optionItem.dictValue"
                :label="optionItem.dictValue"
                :value="optionItem.dictValue">
              </el-option>
            </el-select>
            <el-switch
              v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true"
              inactive-value="false">
            </el-switch>
            <span v-else>{{ row[item.prop] }}</span>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          width="70">
          <template slot-scope="scope">
            <el-button
              size="small"
              type="text"
              @click.native.prevent="CrudRowDel(scope.$index)">
              移除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
        <template slot-scope="{ row }">
          <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-show="!AddCellFlag"
                           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' " v-show="!AddCellFlag"
                     slot="prepend"
                     v-model="row[item.prop]" :clearable="true" allow-create
                     default-first-option filterable
                     @blur="selectChangeHandler(item.editConfig,index)">
            <el-option
              v-for="optionItem in item.data"
              :key="optionItem.dictValue"
              :label="optionItem.dictValue"
              :value="optionItem.dictValue">
            </el-option>
          </el-select>
          <el-switch
            v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true"
            inactive-value="false">
          </el-switch>
          <span v-else>{{ row[item.prop] }}</span>
        </template>
      </el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="70">
        <template slot-scope="scope">
          <el-button
            size="small"
            type="text"
            @click.native.prevent="CrudRowDel(scope.$index)">
            移除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
@@ -452,7 +453,7 @@
      default: false
    },
    btnAuthList: {
      type:Array
      type: Array
    }
  },
  watch: {
@@ -1110,10 +1111,10 @@
        indexClassName: "序号",
        indexLabelClassName: '序号',
        index: true,
        indexFixed:false,
        selectionFixed:false,
        indexFixed: false,
        selectionFixed: false,
        columnBtn: false,
        refreshBtn:false,
        refreshBtn: false,
        border: true,
        addBtn: false,
        menu: false,
@@ -1563,7 +1564,7 @@
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        busineStatus: this.vaildData(this.btnAuthList.attr_add, false) ,
        busineStatus: this.vaildData(this.btnAuthList.attr_add, false),
        fullscreenStatus: this.vaildData(this.btnAuthList.attr_view_edit, false),
        ruleStatus: this.vaildData(this.btnAuthList.attr_rule, false),
        attrStatus: this.vaildData(this.btnAuthList.attr_group, false),
@@ -1724,8 +1725,8 @@
            ts: ""
          })
          // 将英文编号转换为小写
          let { id, ...res } = this.busineAddList;
          this.busineAddList = { id: id.toLowerCase(), ...res };
          let {id, ...res} = this.busineAddList;
          this.busineAddList = {id: id.toLowerCase(), ...res};
          this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)));
        }
      })
@@ -2072,7 +2073,7 @@
      const regex = new RegExp(this.rulesData.ruleRowBds);
      if (regex.test(this.RulesForm.TestContent)) {
        this.$message.success('校验成功')
      }else {
      } else {
        this.$message.error('校验失败')
      }
    },
@@ -2084,7 +2085,8 @@
      }
      if (this.attrSelectList.length < 1) {
        this.$message.warning('请选择一条模板数据')
        return;;
        return;
        ;
      }
      if (this.attrSelectList.length === 1) {
        this.injectVisible = true;