| | |
| | | <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]" |
| | | autofocus @blur="saveRows"></el-input> |
| | | @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" |
| | |
| | | import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag} from '@/api/template/templateAttr' |
| | | import {getList} from "@/api/refer/table"; |
| | | import func from "@/util/func"; |
| | | import {getCurrentInstance} from "vue"; |
| | | |
| | | export default { |
| | | name: "attrCrud .vue", |
| | |
| | | } |
| | | }, |
| | | crudArrayFlag: { |
| | | handler(newval, olaval) { |
| | | handler(newval, oldval) { |
| | | console.log('crudArrayFlag', newval) |
| | | } |
| | | }, |
| | |
| | | column: [ |
| | | { |
| | | label: "属性英文名称", |
| | | prop: "id" |
| | | prop: "id", |
| | | width:100, |
| | | }, |
| | | { |
| | | label: "属性中文名称", |
| | | prop: "name" |
| | | prop: "name", |
| | | width:100, |
| | | }, |
| | | { |
| | | label: "长度", |
| | |
| | | prop: "precisionLength" |
| | | }, |
| | | { |
| | | label: "小精刻度", |
| | | label: "小数刻度", |
| | | prop: "scaleLength" |
| | | }, |
| | | { |
| | |
| | | //可输可选下拉 |
| | | selectChangeHandler(editConfig, index) { |
| | | let that = this; |
| | | /*if(that.option.column[index].data && that.option.column[index].data.length>=0){ |
| | | return; |
| | | }*/ |
| | | listByFlag(editConfig.extraParams).then(res => { |
| | | that.option.column[index].data = res.data.data; |
| | | }) |
| | |
| | | item.attributeGroup = this.attrModel |
| | | }) |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'attributeGroup', this.attrModel) |
| | | this.$set(this.CurrentCell, 'attributeGroup', this.attrModel); |
| | | } else { |
| | | this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel) |
| | | } |
| | |
| | | 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(); |
| | | }; |
| | | } |
| | | if (column.property == 'referConfig') { |
| | | this.referConfigVisble = true; |
| | | this.referConfigOption = { |
| | |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | | this.editShows = null; |
| | | const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`); |
| | | if (inputElement) { |
| | | inputElement.blur(); |
| | | } |
| | | }, |
| | | // 枚举注入添加一行空数据 |
| | | addRow() { |
| | |
| | | rulesHandle() { |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'verifyRule', this.RulesForm.expressionText) |
| | | this.AddCellFlag = !this.AddCellFlag; |
| | | } else { |
| | | this.attrSelectList.forEach((item) => { |
| | | this.$set(item, 'verifyRule', this.RulesForm.expressionText) |
| | |
| | | this.editStyleFlag = true; |
| | | this.attrEditVisible = true; |
| | | this.attrFlag = true; |
| | | this.AddCellFlag=true; |
| | | } |
| | | |
| | | }, |
| | |
| | | this.$set(this.attrRow, 'referConfig', JSON.stringify(content)) |
| | | } |
| | | }, |
| | | // 排序 |
| | | // 排序 this.AddCellFlag=false; |
| | | sortChange(val) { |
| | | console.log(val) |
| | | }, |