| | |
| | | <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block"> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button |
| | | v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" |
| | | icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">添加 {{ msg }} |
| | | <span v-if="permissionList.busineStatus"> |
| | | <el-button |
| | | v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" |
| | | icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">添加 {{ msg }} |
| | | </el-button> |
| | | </span> |
| | | <!-- 全屏编辑--> |
| | | <el-button |
| | | v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" |
| | | icon="el-icon-full-screen" size="small" @click="fullscreenHandle">全屏编辑 |
| | | <span v-if="permissionList.fullscreenStatus"> |
| | | <el-button |
| | | v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" |
| | | icon="el-icon-full-screen" size="small" @click="fullscreenHandle">全屏编辑 |
| | | </el-button> |
| | | <!-- 验证规则--> |
| | | </span> |
| | | <span v-if="permissionList.ruleStatus"> |
| | | <!-- 验证规则--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" |
| | | @click="ruleAddHandler">验证规则 |
| | | </el-button> |
| | | <!-- 属性分组--> |
| | | </span> |
| | | <span v-if="permissionList.attrStatus"> |
| | | <!-- 属性分组--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" |
| | | @click="attrVisibleHandle">属性分组 |
| | | </el-button> |
| | | </span> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 保存--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain size="small" |
| | | <span v-if="permissionList.saveStatus"> |
| | | <!-- 保存--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain |
| | | size="small" |
| | | type="success" @click.prevent="addsHandler">保存 |
| | | </el-button> |
| | | </span> |
| | | <!-- 预览排序--> |
| | | <el-button icon="el-icon-arrow-down" size="small" @click="orderHandle">预览排序</el-button> |
| | | <!-- 删除--> |
| | | <el-button v-if="permissionList.orderStatus" icon="el-icon-arrow-down" size="small" @click="orderHandle">预览排序 |
| | | </el-button> |
| | | <span v-if="permissionList.removeStatus"> |
| | | <!-- 删除--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-delete" size="small" |
| | | @click="CrudRemove">删除 |
| | | </el-button> |
| | | </span> |
| | | <!-- 重置--> |
| | | <el-button icon="el-icon-refresh-right" size="small" @click="reset">重置</el-button> |
| | | <el-button v-if="permissionList.resetStatus" icon="el-icon-refresh-right" size="small" @click="resetHandler"> |
| | | 重置 |
| | | </el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <!-- 分类注入--> |
| | | <span v-if="permissionList.injectStatus"><!-- 分类注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" |
| | | size="small" @click="injectBtn">分类注入 |
| | | </el-button> |
| | | <!-- 组合规则--> |
| | | </el-button></span> |
| | | <span v-if="permissionList.isShowStatus"> <!-- 组合规则--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" |
| | | @click="isShowHandler">组合规则 |
| | | </el-button> |
| | | <!-- 枚举注入--> |
| | | </el-button></span> |
| | | <span v-if="permissionList.enumStatus"> <!-- 枚举注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" |
| | | size="small" @click="enmuVisHandle">枚举注入 |
| | | </el-button> |
| | | <!-- 级联属性--> |
| | | size="small" @click="enumVisHandle">枚举注入 |
| | | </el-button></span> |
| | | |
| | | <span v-if="permissionList.cascadStatus"> |
| | | <!-- 级联属性--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" |
| | | @click="CascadeHandle">级联属性 |
| | | </el-button> |
| | | </span> |
| | | </el-button-group> |
| | | |
| | | <el-button-group> |
| | | <!-- 同步到其他模板--> |
| | | <el-button icon="el-icon-share" size="small" @click="syncHandle">同步到其他模板</el-button> |
| | | <el-button v-if="permissionList.syncStatus" icon="el-icon-share" size="small" @click="syncHandle">同步到其他模板 |
| | | </el-button> |
| | | </el-button-group> |
| | | |
| | | <el-button-group> |
| | | <!-- 编码申请预览--> |
| | | <el-button icon="el-icon-view" size="small" style="" @click="applicationHandle">编码申请预览</el-button> |
| | | <el-button v-if="permissionList.applicationStatus" icon="el-icon-view" size="small" style="" |
| | | @click="applicationHandle">编码申请预览 |
| | | </el-button> |
| | | |
| | | </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" |
| | |
| | | <!-- 全屏编辑--> |
| | | <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" |
| | | :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" :btnAuthList="btnAuthList" |
| | | @editCloseChildren="editClose"></attrCrud> |
| | | </el-dialog> |
| | | <!-- 组合规则--> |
| | |
| | | <el-button size="small" type="primary" @click="addVisible=false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 参照配置--> |
| | | <refer-config-dialog |
| | | :display="referConfigVisble" |
| | |
| | | ></refer-config-dialog> |
| | | |
| | | </div> |
| | | <el-table v-if="this.crudArrayFlag" |
| | | ref="referAttrCrud" |
| | | v-loading="loading" |
| | | :data="ProData" |
| | | :height="this.editStyleFlag? 800 : 343" |
| | | style="width: 100%" |
| | | @select="selectHandle" |
| | | @cell-click="handleCellClicks" |
| | | @selection-change="selectionChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <el-table-column |
| | | fixed |
| | | 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="item.fixed" |
| | | :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 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" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" |
| | | ref="inputRef" |
| | | :id="'inputRef' + row.oid" |
| | | v-show="!AddCellFlag" |
| | | v-model="row[item.prop]" |
| | | @blur="saveRows" |
| | | autofocus></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 |
| | | 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> |
| | | <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> |
| | | |
| | | <script> |
| | |
| | | import {getList} from "@/api/refer/table"; |
| | | import func from "@/util/func"; |
| | | import {getCurrentInstance} from "vue"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "attrCrud .vue", |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | btnAuthList: { |
| | | type:Array |
| | | } |
| | | }, |
| | | watch: { |
| | | crudOid: { |
| | |
| | | }, |
| | | crudArrayFlag: { |
| | | handler(newval, oldval) { |
| | | console.log('crudArrayFlag', newval) |
| | | // console.log('crudArrayFlag', newval) |
| | | } |
| | | }, |
| | | crudArray: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // editingRows:{ |
| | | // handler(newval,oldval){ |
| | | // if(newval){ |
| | | // const inputElement = document.querySelector(`#inputRef${newval.oid}`); |
| | | // if (inputElement) { |
| | | // inputElement.focus(); |
| | | // }; |
| | | // } |
| | | // } |
| | | // }, |
| | | ProData: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | |
| | | }, |
| | | editOpenFlag: { |
| | | handler(newval, oldval) { |
| | | console.log('editOpenFlag', newval) |
| | | // console.log('editOpenFlag', newval) |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //表格高度 |
| | | dynamicHeight: '', |
| | | // 保存单元格状态 |
| | | AddCellFlag:false, |
| | | AddCellFlag: false, |
| | | //全屏编辑高度状态 |
| | | editStyleFlag: false, |
| | | loading: false, |
| | |
| | | addBtn: false, |
| | | header: false, |
| | | align: 'center', |
| | | columnBtn: false, |
| | | menuAlign: 'center', |
| | | column: [{ |
| | | label: '', |
| | |
| | | { |
| | | label: "参照配置", |
| | | prop: "referConfig", |
| | | width: 105 |
| | | }, |
| | | { |
| | | label: "级联查询属性", |
| | |
| | | { |
| | | label: "取值范围", |
| | | prop: "valueArea", |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | // 存储表格数据 |
| | |
| | | indexClassName: "序号", |
| | | indexLabelClassName: '序号', |
| | | index: true, |
| | | indexFixed:false, |
| | | selectionFixed:false, |
| | | columnBtn: false, |
| | | refreshBtn:false, |
| | | border: true, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | { |
| | | label: "属性英文名称", |
| | | prop: "id", |
| | | width:100, |
| | | width: 130, |
| | | }, |
| | | { |
| | | label: "属性中文名称", |
| | | prop: "name", |
| | | width:100, |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "长度", |
| | |
| | | List: [], |
| | | option: { |
| | | index: false, |
| | | columnBtn: false, |
| | | border: true, |
| | | editBtn: false, |
| | | selection: true, |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | 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), |
| | | saveStatus: this.vaildData(this.btnAuthList.attr_save, false), |
| | | resetStatus: this.vaildData(this.btnAuthList.attr_reset, false), |
| | | injectStatus: this.vaildData(this.btnAuthList.attr_inject, false), |
| | | isShowStatus: this.vaildData(this.btnAuthList.attr_formrule, false), |
| | | enumStatus: this.vaildData(this.btnAuthList.attr_enum, false), |
| | | cascadStatus: this.vaildData(this.btnAuthList.attr_parentcode, false), |
| | | syncStatus: this.vaildData(this.btnAuthList.attr_sync, false), |
| | | applicationStatus: this.vaildData(this.btnAuthList.attr_application, false), |
| | | orderStatus: this.vaildData(this.btnAuthList.attr_sort, false), |
| | | removeStatus: this.vaildData(this.btnAuthList.attr_delete, false), |
| | | } |
| | | }, |
| | | attrOids() { |
| | | let oids = []; |
| | | this.attrSelectList.forEach(ele => { |
| | |
| | | }); |
| | | return oids.join(","); |
| | | }, |
| | | tableHeight() { |
| | | if (this.editStyleFlag) { |
| | | return '800px' |
| | | } else { |
| | | return 'calc(100vh - 565px)' |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | |
| | | attrTableWidth: 120, |
| | | ts: "" |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | // 将英文编号转换为小写 |
| | | let { id, ...res } = this.busineAddList; |
| | | this.busineAddList = { id: id.toLowerCase(), ...res }; |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))); |
| | | } |
| | | }) |
| | | this.addVisible = false; |
| | |
| | | addsHandler(event) { |
| | | this.$refs.referAttrCrud.sort("orderNum"); |
| | | var ischeck = true; |
| | | console.log('ProData',this.ProData) |
| | | this.ProData.forEach((item, index) => { |
| | | if ((item.requireFlag && item.requireFlag.toString() == 'true') && (item.readOnlyFlag && item.readOnlyFlag.toString() == 'true')) { |
| | | this.$message.warning(item.name + "(" + item.id + ")必输的属性不能是只读"); |
| | |
| | | // 新函数用于执行batchAddSave方法 |
| | | const executeBatchAddSave = () => { |
| | | batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { |
| | | this.$message.success('保存成功') |
| | | this.editOpenFlag = false; |
| | | this.$message.success('保存成功') |
| | | // 调用父组件修改按钮状态 |
| | | this.$emit('editCloseChildren') |
| | | this.AddCellFlag=true; |
| | | this.AddCellFlag = true; |
| | | }).catch(() => { |
| | | this.$message.warning('保存失败,请查看控制台输出!') |
| | | }); |
| | |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell = row; |
| | | // const inputElement = document.querySelector(`#inputRef${row.oid}`); |
| | | // if (inputElement) { |
| | | // inputElement.focus(); |
| | | // }; |
| | | if (column.property == 'referConfig') { |
| | | this.referConfigVisble = true; |
| | | this.referConfigOption = { |
| | | referConfig: this.CurrentCell.referConfig || '', |
| | | this.$nextTick(() => { |
| | | const inputs = this.$refs['input' + row.oid]; |
| | | const input = inputs && inputs.length > 0 ? inputs[0].$el : null; |
| | | if (input) { |
| | | input.focus(); |
| | | } |
| | | if (this.CurrentCell.referConfig == '') { |
| | | }); |
| | | const columnActions = { |
| | | referConfig: () => { |
| | | this.referConfigVisble = true; |
| | | this.referConfigOption = { |
| | | referConfig: '', |
| | | referConfig: this.CurrentCell.referConfig || '', |
| | | } |
| | | if (this.CurrentCell.referConfig == '') { |
| | | this.referConfigOption = { |
| | | referConfig: '', |
| | | } |
| | | } |
| | | }, |
| | | classifyInvokeText: () => { |
| | | this.injectVisible = true; |
| | | if (this.CurrentCell.classifyInvokeAttr != '') { |
| | | this.injectOption = { |
| | | classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, |
| | | classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, |
| | | classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, |
| | | classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', |
| | | classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel |
| | | }; |
| | | } |
| | | }, |
| | | componentRule: () => { |
| | | this.isShowformulaEdit = true; |
| | | }, |
| | | enumString: () => { |
| | | this.enumVisible = true; |
| | | this.tableData = []; |
| | | if (this.CurrentCell.enumString != "") { |
| | | this.tableData = JSON.parse(this.CurrentCell.enumString) |
| | | return; |
| | | } |
| | | }, |
| | | parentCode: () => { |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid, |
| | | limit: -1 |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible = true; |
| | | }, |
| | | verifyRule: () => { |
| | | this.RulesForm.expressionTextt = this.CurrentCell.verifyRule; |
| | | this.rulesVisible = true; |
| | | }, |
| | | attributeGroup: () => { |
| | | this.attrVisible = true; |
| | | if (this.CurrentCell.attributeGroup !== '') { |
| | | this.attrModel = this.CurrentCell.attributeGroup |
| | | } |
| | | } |
| | | // this.$refs.referConfigFormDialog.onloadAttrData(); |
| | | } else if (column.property == 'classifyInvokeText') { |
| | | this.injectVisible = true; |
| | | if (this.CurrentCell.classifyInvokeAttr != '') { |
| | | this.injectOption = { |
| | | classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, |
| | | classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, |
| | | classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, |
| | | classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', |
| | | classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel |
| | | }; |
| | | } else { |
| | | // this.injectHandleReset(); |
| | | } |
| | | } else if (column.property == 'componentRule') { |
| | | if (this.CurrentCell) { |
| | | // this.CurrentCell.componentRule = this.componentRuleText; |
| | | } |
| | | this.isShowformulaEdit = true; |
| | | } else if (column.property == 'enumString') { |
| | | this.enumVisible = true; |
| | | if (this.CurrentCell.enumString != "") { |
| | | this.tableData = JSON.parse(this.CurrentCell.enumString) |
| | | return |
| | | } |
| | | } else if (column.property == 'parentCode') { |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid, |
| | | limit: -1 |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible = true; |
| | | } else if (column.property == 'verifyRule') { |
| | | this.RulesForm.expressionTextt = this.CurrentCell.verifyRule; |
| | | this.rulesVisible = true; |
| | | } else if (column.property == 'attributeGroup') { |
| | | this.attrVisible = true; |
| | | if (this.CurrentCell.attributeGroup !== '') { |
| | | this.attrModel = this.CurrentCell.attributeGroup |
| | | } |
| | | }; |
| | | |
| | | if (column.property in columnActions) { |
| | | columnActions[column.property](); |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.tableData.splice(row.$index, 1) |
| | | }, |
| | | //枚举注入按钮 |
| | | enmuVisHandle() { |
| | | enumVisHandle() { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.attrSelectList < 1) { |
| | |
| | | const regex = new RegExp(this.rulesData.ruleRowBds); |
| | | if (regex.test(this.RulesForm.TestContent)) { |
| | | this.$message.success('校验成功') |
| | | }else { |
| | | this.$message.error('校验失败') |
| | | } |
| | | }, |
| | | //点击分类注入按钮 |
| | | injectBtn() { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板数据') |
| | | } else if (this.attrSelectList.length < 1) { |
| | | return; |
| | | } |
| | | if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板数据') |
| | | } else if (this.attrSelectList.length === 1) { |
| | | return;; |
| | | } |
| | | if (this.attrSelectList.length === 1) { |
| | | this.injectVisible = true; |
| | | return; |
| | | } |
| | | }, |
| | | //分类注入保存 |
| | | injectAddHandle() { |
| | | // 定义展示类型 |
| | | let data = { |
| | | "注入类型": this.injectOption.classifyInvokeAttr, |
| | | "注入类型名称": this.injectOption.classifyInvokeAttrName, |
| | | "层级设置": this.injectOption.classifyInvokeLevel == 'max' ? this.injectOption.classifyNumber : 'min', |
| | | "是否可修改": this.injectOption.classifyInvokeEditFlag |
| | | } |
| | | //勾选操作 |
| | | const { |
| | | classifyInvokeAttr, |
| | | classifyInvokeAttrName, |
| | | classifyInvokeLevel, |
| | | classifyInvokeEditFlag, |
| | | classifyNumber |
| | | } = this.injectOption; |
| | | |
| | | const data = { |
| | | "注入类型": classifyInvokeAttr, |
| | | "注入类型名称": classifyInvokeAttrName, |
| | | "层级设置": classifyInvokeLevel === 'max' ? classifyNumber : 'min', |
| | | "是否可修改": classifyInvokeEditFlag |
| | | }; |
| | | for (const key in this.injectOption) { |
| | | this.attrSelectList[0][key] = this.injectOption[key]; |
| | | //如果是指定层赋值为数字 |
| | | if (this.injectOption.classifyInvokeLevel !== 'min') { |
| | | this.attrSelectList[0].classifyInvokeLevel = this.injectOption.classifyNumber |
| | | if (classifyInvokeLevel !== 'min') { |
| | | this.attrSelectList[0].classifyInvokeLevel = classifyNumber; |
| | | } else { |
| | | this.attrSelectList[0].classifyInvokeLevel = 'min' |
| | | this.attrSelectList[0].classifyInvokeLevel = 'min'; |
| | | } |
| | | this.$set(this.attrSelectList[0], 'classifyInvokeText', data) |
| | | this.$set(this.attrSelectList[0], 'classifyInvokeText', data); |
| | | } |
| | | // this.injectHandleReset() |
| | | if (this.injectOption.classifyInvokeLevel !== 'min') { |
| | | this.injectOption.classifyInvokeLevel = this.injectOption.classifyNumber; |
| | | if (classifyInvokeLevel !== 'min') { |
| | | this.injectOption.classifyInvokeLevel = classifyNumber; |
| | | } else { |
| | | this.injectOption.classifyNumber = 0; |
| | | } |
| | | // console.log(this.ProData) |
| | | this.injectVisible = false; |
| | | |
| | | }, |
| | | //分类注入清空 |
| | | injectHandleReset() { |
| | | this.$set(this.CurrentCell, 'classifyInvokeText', '') |
| | | this.$set(this.CurrentCell, 'classifyInvokeAttr:', '') |
| | | this.$set(this.CurrentCell, 'classitwInvokeAttrName', '') |
| | | this.$set(this.CurrentCell, 'classifyInvokeEditFlag', 'false') |
| | | this.$set(this.CurrentCell, 'classifyInvokeLevel', 'none') |
| | | this.CurrentCell.classifyInvokeText = null; |
| | | this.CurrentCell.classifyInvokeAttr = ''; |
| | | this.CurrentCell.classifyInvokeAttrName = ''; |
| | | this.CurrentCell.classifyInvokeEditFlag = ''; |
| | | this.CurrentCell.classifyInvokeLevel = null; |
| | | // console.log(this.ProData) |
| | | this.injectVisible = false; |
| | | }, |
| | | // 分类注入取消 |
| | |
| | | }) |
| | | }, |
| | | //表格重置 |
| | | reset() { |
| | | resetHandler() { |
| | | this.CrudRend() |
| | | }, |
| | | //同步到其他模板 |
| | |
| | | this.editStyleFlag = true; |
| | | this.attrEditVisible = true; |
| | | this.attrFlag = true; |
| | | this.AddCellFlag=true; |
| | | this.AddCellFlag = true; |
| | | } |
| | | |
| | | }, |
| | |
| | | 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, '')) |
| | | } |
| | |
| | | }, |
| | | // 排序 this.AddCellFlag=false; |
| | | sortChange(val) { |
| | | console.log(val) |
| | | // console.log(val) |
| | | }, |
| | | //开启编辑 |
| | | editOpen() { |
| | | this.editOpenFlag = true; |
| | | this.AddCellFlag=false; |
| | | this.AddCellFlag = false; |
| | | }, |
| | | //定义一个关闭编辑的方法供子组件使用 |
| | | editClose() { |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | //固定列高度 |
| | | /deep/ .el-table__fixed { |
| | | height: calc(100vh - 584px) !important; |
| | | } |
| | | |
| | | ///deep/ .el-table__fixed[v-if='editStyleFlag'] { |
| | | // height: calc(100vh - 152px)!important; // 编辑状态下的高度 |
| | | //} |
| | | // 滚动条样式修改 |
| | | // 滚动条的宽度 |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar { |
| | | height: 15px; // 纵向滚动条 必写 |
| | | background: white; |
| | | border: white; |
| | | width: 10px; |
| | | |
| | | } |
| | | |
| | | // 滚动条的滑块 |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | background-color: #ececec; |
| | | border-radius: 20px; |
| | | border: #ececec; |
| | | } |
| | | |
| | | .app { |
| | | /deep/ .el-button { |
| | | //margin: 0 10px 10px 0; |