From 5a9b31f9dbd1ce22fe385f624a833228f01f319c Mon Sep 17 00:00:00 2001 From: xiejun <xj@2023> Date: 星期四, 17 八月 2023 16:03:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 79 ++++++++++++++++++++++++--------------- 1 files changed, 48 insertions(+), 31 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue index df97fda..1c94c45 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue @@ -71,19 +71,19 @@ 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> @@ -327,9 +327,11 @@ <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" @@ -372,6 +374,7 @@ 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", @@ -428,7 +431,7 @@ } }, crudArrayFlag: { - handler(newval, olaval) { + handler(newval, oldval) { console.log('crudArrayFlag', newval) } }, @@ -453,6 +456,16 @@ } } }, + // editingRows:{ + // handler(newval,oldval){ + // if(newval){ + // const inputElement = document.querySelector(`#inputRef${newval.oid}`); + // if (inputElement) { + // inputElement.focus(); + // }; + // } + // } + // }, ProData: { handler(newval, oldval) { if (newval) { @@ -1078,11 +1091,13 @@ column: [ { label: "灞炴�ц嫳鏂囧悕绉�", - prop: "id" + prop: "id", + width:100, }, { label: "灞炴�т腑鏂囧悕绉�", - prop: "name" + prop: "name", + width:100, }, { label: "闀垮害", @@ -1123,7 +1138,7 @@ prop: "precisionLength" }, { - label: "灏忕簿鍒诲害", + label: "灏忔暟鍒诲害", prop: "scaleLength" }, { @@ -1565,9 +1580,6 @@ //鍙緭鍙�変笅鎷� 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; }) @@ -1586,7 +1598,7 @@ 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) } @@ -1747,7 +1759,6 @@ 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; } @@ -1755,29 +1766,23 @@ 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) } //濡傛灉绌哄悗鍙拌繑鍥瀗one if (item.classifyInvokeLevel && item.classifyInvokeLevel != 'none') { //鍒嗙被娉ㄥ叆 num++ - console.log('classifyInvokeLevel', num) - console.log(item.classifyInvokeLevel) } if (num > 1 && ischeck) { this.$message({ @@ -1814,6 +1819,10 @@ 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 = { @@ -1845,8 +1854,9 @@ 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') { @@ -1871,6 +1881,11 @@ }, saveRows() { this.editingRows = null; + this.editShows = null; + // const inputElement = document.querySelector(`#inputRef${this.CurrentCell.oid}`); + // if (inputElement) { + // inputElement.blur(); + // } }, // 鏋氫妇娉ㄥ叆娣诲姞涓�琛岀┖鏁版嵁 addRow() { @@ -1974,6 +1989,7 @@ 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) @@ -2092,6 +2108,7 @@ this.editStyleFlag = true; this.attrEditVisible = true; this.attrFlag = true; + this.AddCellFlag=true; } }, @@ -2120,7 +2137,7 @@ this.$set(this.attrRow, 'referConfig', JSON.stringify(content)) } }, - // 鎺掑簭 + // 鎺掑簭 this.AddCellFlag=false; sortChange(val) { console.log(val) }, -- Gitblit v1.9.3