From ef4ecf51d31bf07ba7cca66a44358f4974fe4f3c Mon Sep 17 00:00:00 2001 From: yuanwei <362142050@qq.com> Date: Tue, 28 Nov 2023 00:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=8B=E4=BB=B6=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/customConfig.js | 54 ++++++------------- .../basic/product/UdiInfoSelectLocalUdi.vue | 20 +++---- src/views/basic/product/product.vue | 20 +++---- .../system/customConfig/configDetail.vue | 29 ++++++---- 4 files changed, 55 insertions(+), 68 deletions(-) diff --git a/src/utils/customConfig.js b/src/utils/customConfig.js index 7ccea2b..ea087af 100644 --- a/src/utils/customConfig.js +++ b/src/utils/customConfig.js @@ -47,62 +47,42 @@ export async function getHead(businessType,type){ } -export function executeFuc(_this,row,number,type,clickFuc,value){ +export function executeFuc(_this,row,type,clickFuc,obj){ + // 0 列表点击事件 1 列表页按钮事件 2 编辑页表单事件 3 列表页复选框事件 4列表页颜色方法 5列表查询框方法 if("1" == type){ - //按钮事件 + //列表页按钮事件 return callModelFun(_this,clickFuc,row); - }else if("3" == type){ - //按钮是否禁用事件 - if(clickFuc){ - return callModelFun(_this,clickFuc,row); - }else{ - return false; - } }else if("4" == type){ - //颜色方法 - return getColer(clickFuc,value); + //列表页颜色方法 + if(clickFuc) { + return getColer(clickFuc, obj); + } }else if("5" == type){ - //查询input方法 + //列表查询条件查询input方法 if(clickFuc){ return callModelFun(_this,clickFuc,row); }else{ return false; } - }else if("6" == type){ - //查询input方法 + }else if("2" == type){ if(clickFuc){ + //编辑页表单事件 return callModelFun(_this,clickFuc,row); - }else{ - return false; - } - }else if("2" == type){ - if(number.clickFuc){ - //表单事件 - return callModelFun(_this,number.clickFuc,row); }else{ return true; } - }else if(number != null && number >= 0){ - //复选框事件 - var checkSelectableFuc = "" - _this.tableObj.tableList.forEach(obj => { - if(obj.columnType == "selection"){ - checkSelectableFuc = obj.clickFuc; - } - }) - // - if(checkSelectableFuc){ - return callModelFun(_this,checkSelectableFuc,row); + }else if("3" == type){ + //列表页复选框事件 + if(clickFuc){ + return callModelFun(_this,clickFuc,row); }else{ return true; } - }else{ - console.log(row); + }else if("0" == type){ //表单点击事件 - if(_this.tableObj.handleChangeFuc){ - return callModelFun(_this,_this.tableObj.handleChangeFuc,row); + if(clickFuc){ + return callModelFun(_this,clickFuc,row); } - return true; } } diff --git a/src/views/basic/product/UdiInfoSelectLocalUdi.vue b/src/views/basic/product/UdiInfoSelectLocalUdi.vue index 1e3917f..926c77a 100644 --- a/src/views/basic/product/UdiInfoSelectLocalUdi.vue +++ b/src/views/basic/product/UdiInfoSelectLocalUdi.vue @@ -10,7 +10,7 @@ v-model="filterQuery[item.columnName]" :placeholder="item.columnDesc" :disabled="executeEval(null,item.disabledFuc,false)" - @keyup.enter.native="executeFuc($event,null,'5',item.clickFuc)" + @keyup.enter.native="executeFuc($event,'5',item.clickFuc)" clearable > @@ -34,7 +34,7 @@ :disabled="executeEval(null,item.disabledFuc,false)" filterable remote - :remote-method="(query) => executeFuc(query, null,'6',item.clickFuc)" + :remote-method="(query) => executeFuc(query,'5',item.clickFuc)" clearable> @@ -256,7 +256,7 @@ :key="item.columnName" > @@ -840,8 +840,8 @@ export default { _this.options.findMethod = [] }); }, - executeFuc(row,number,type,clickFuc,value){ - return executeFuc(this,row,number,type,clickFuc,value); + executeFuc(row,type,clickFuc,value){ + return executeFuc(this,row,type,clickFuc,value); }, executeEval(row,expression,defaultRet){ if(expression){ diff --git a/src/views/basic/product/product.vue b/src/views/basic/product/product.vue index 5abd54e..a76e870 100644 --- a/src/views/basic/product/product.vue +++ b/src/views/basic/product/product.vue @@ -51,7 +51,7 @@ v-model="filterQuery[item.columnName]" :placeholder="item.columnDesc" :disabled="executeEval(null,item.disabledFuc,false)" - @keyup.enter.native="executeFuc($event,null,'5',item.clickFuc)" + @keyup.enter.native="executeFuc($event,'5',item.clickFuc)" clearable > @@ -75,7 +75,7 @@ :disabled="executeEval(null,item.disabledFuc,false)" filterable remote - :remote-method="(query) => executeFuc(query, null,'6',item.clickFuc)" + :remote-method="(query) => executeFuc(query,'5',item.clickFuc)" clearable> @@ -370,7 +370,7 @@ :key="item.columnName" > @@ -2425,8 +2425,8 @@ export default { .catch(() => { }); }, - executeFuc(row,number,type,clickFuc,value){ - return executeFuc(this,row,number,type,clickFuc,value); + executeFuc(row,type,clickFuc,value){ + return executeFuc(this,row,type,clickFuc,value); }, executeEval(row,expression,defaultRet){ if(expression){ diff --git a/src/views/system/customConfig/configDetail.vue b/src/views/system/customConfig/configDetail.vue index 7dc61ab..072f332 100644 --- a/src/views/system/customConfig/configDetail.vue +++ b/src/views/system/customConfig/configDetail.vue @@ -45,7 +45,7 @@ - +