| | |
| | | size="small" |
| | | @click="editOpen">开启编辑 |
| | | </el-button> |
| | | <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue" placeholder="请选择" |
| | | size="small"> |
| | | <el-option |
| | | v-for="item in selectoptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" |
| | | active-value="true" style="margin:6px 0 0 10px" @change="batchSetFlag"> |
| | | </el-switch> |
| | | </el-button-group> |
| | | <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue" placeholder="请选择" |
| | | size="small"> |
| | | <el-option |
| | | v-for="item in selectoptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" |
| | | active-value="true" style="margin:6px 0 0 10px" @change="batchSetFlag"> |
| | | </el-switch> |
| | | </div> |
| | | <!-- 弹窗--> |
| | | <div> |
| | |
| | | > |
| | | <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" |
| | | :ref="'input' + row.oid" |
| | | v-show="!AddCellFlag" |
| | | v-model="row[item.prop]" |
| | | @blur="saveRows" |
| | | autofocus></el-input> |
| | | @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" |
| | |
| | | } |
| | | } |
| | | }, |
| | | // editingRows:{ |
| | | // handler(newval,oldval){ |
| | | // if(newval){ |
| | | // const inputElement = document.querySelector(`#inputRef${newval.oid}`); |
| | | // if (inputElement) { |
| | | // inputElement.focus(); |
| | | // }; |
| | | // } |
| | | // } |
| | | // }, |
| | | ProData: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | |
| | | 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 + ")必输的属性不能是只读"); |
| | | console.log(item) |
| | | ischeck = false; |
| | | return; |
| | | } |
| | |
| | | if (item.componentRule) { |
| | | //组合规则 |
| | | num++ |
| | | console.log('componentRule', num) |
| | | } |
| | | if (item.enumString || item.enumId) { |
| | | //枚举 |
| | | num++ |
| | | console.log('enumString', num) |
| | | } |
| | | if (item.referConfig || item.referBtmId) { |
| | | //参照 |
| | | num++ |
| | | console.log('referConfig', num) |
| | | } |
| | | if (item.codeDateFormat) { |
| | | //时间格式 |
| | | num++ |
| | | console.log('codeDateFormat', num) |
| | | } |
| | | //如果空后台返回none |
| | | if (item.classifyInvokeLevel && item.classifyInvokeLevel != 'none') { |
| | | //分类注入 |
| | | num++ |
| | | console.log('classifyInvokeLevel', num) |
| | | console.log(item.classifyInvokeLevel) |
| | | } |
| | | if (num > 1 && ischeck) { |
| | | this.$message({ |
| | |
| | | }, |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | console.log(row,column) |
| | | if (this.editOpenFlag) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell = row; |
| | | if(this.editingRows){ |
| | | const inputElement = document.querySelector(`#inputRef${row.oid}`); |
| | | if (inputElement) { |
| | | inputElement.focus(); |
| | | }; |
| | | } |
| | | this.$nextTick(() => { |
| | | const inputs = this.$refs['input' + row.oid]; |
| | | const input = inputs && inputs.length > 0 ? inputs[0].$el : null; |
| | | if (input) { |
| | | input.focus(); |
| | | } |
| | | }); |
| | | if (column.property == 'referConfig') { |
| | | this.referConfigVisble = true; |
| | | this.referConfigOption = { |
| | |
| | | this.isShowformulaEdit = true; |
| | | } else if (column.property == 'enumString') { |
| | | this.enumVisible = true; |
| | | if (this.attrSelectList[0].enumString != "") { |
| | | this.tableData = JSON.parse(this.attrSelectList[0].enumString) |
| | | this.tableData=[]; |
| | | if (this.CurrentCell.enumString != "") { |
| | | this.tableData = JSON.parse(this.CurrentCell.enumString) |
| | | return |
| | | } |
| | | } else if (column.property == 'parentCode') { |
| | |
| | | saveRows() { |
| | | this.editingRows = null; |
| | | this.editShows = null; |
| | | const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`); |
| | | if (inputElement) { |
| | | inputElement.blur(); |
| | | } |
| | | // const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`); |
| | | // if (inputElement) { |
| | | // inputElement.blur(); |
| | | // } |
| | | }, |
| | | // 枚举注入添加一行空数据 |
| | | addRow() { |