From 1c407a93546036bc0438fbe019aeaf03f6ef1805 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 05 七月 2023 19:15:38 +0800 Subject: [PATCH] 提交代码 --- Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue index 949c618..c40df95 100644 --- a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue @@ -59,7 +59,7 @@ :label="item.label" :prop="item.prop" :sortable="item.sortable" - :formatter="formatBoolean" + :formatter="item.formatter" :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'" :show-overflow-tooltip="true" align="center" @@ -143,6 +143,7 @@ import SetPersonnel from "@/components/template/SetPersonnel"; import ResembleQueryDialog from "@/components/FormTemplate/ResembleQueryDialog.vue"; import BatchImport from '@/components/BatchImport' +import { validatenull } from "@/util/validate"; export default { components: { integrationTransfer, @@ -269,6 +270,19 @@ }, tableHeadFindData: { handler(newval, oldval) { + newval.forEach((record,_index) =>{ + if(record.field == 'id' && validatenull(record.templet)){ + //浼佷笟缂栫爜鐨勯粯璁ゆ坊鍔犺秴閾炬帴,鏆傛湭瀹炵幇 + record.formatter = ''; + }else { + if (record.templet && typeof (record.templet) == 'string' && !validatenull(record.templet) && record.templet.indexOf("function(row,column)")>-1) { + record.formatter = eval("(" + record.templet + ")"); + //function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'鏄�':'鍚�'} + }else if(record.fieldType=="truefalse"){ + record.formatter = function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'鏄�':'鍚�'} + } + } + }) this.tableHeadFindDatas = newval; }, }, @@ -285,17 +299,6 @@ }, }, methods: { - // 杞崲鏁版嵁true鍜宖alse - formatBoolean(row, column) { - if (column.property === "xiaoshouwl" - ||column.property === "shifoupihaoguanli" - ||column.property === "caigouwl" - ||column.property === "kucunwl" - ||column.property === "passing") { - return row[column.property] =='true'? "鏄�" : "鍚�"; - } - return row[column.property]; - }, // 鍙戝竷 setHandler() { if (this.selectRow.length <= 0) { @@ -453,6 +456,7 @@ this.$message.warning("缂栫爜鐘舵�佷笉鏄�滅紪杈戜腑鈥�,涓嶅彲缂栬緫"); } else { this.editvisible = true; + this.rowOid = this.selectRow[0]['oid'] } }, //楂樼骇鏌ヨ鎸夐挳 -- Gitblit v1.9.3