| | |
| | | ></refer-config-dialog> |
| | | |
| | | </div> |
| | | <el-table v-if="this.crudArrayFlag" |
| | | ref="referAttrCrud" |
| | | v-loading="loading" |
| | | :data="ProData" |
| | | :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 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' )" |
| | | 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 |
| | | 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> |
| | |
| | | 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: "属性中文名称", |
| | |
| | | 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; |
| | |
| | | // 新函数用于执行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; |
| | |
| | | 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; |
| | | } |
| | | }, |
| | | //分类注入保存 |
| | |
| | | } 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; |
| | | }, |
| | | // 分类注入取消 |