From bf981ed7e4afc88c93432c12087aea10674d0d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 19 Nov 2021 23:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2=E5=88=86?= =?UTF-8?q?=E9=85=8D=E6=8C=89=E9=92=AE=E7=9A=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/modules/RolePushBtnModal.vue | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/jshERP-web/src/views/system/modules/RolePushBtnModal.vue b/jshERP-web/src/views/system/modules/RolePushBtnModal.vue index 339b6a0b..8c217fa0 100644 --- a/jshERP-web/src/views/system/modules/RolePushBtnModal.vue +++ b/jshERP-web/src/views/system/modules/RolePushBtnModal.vue @@ -19,6 +19,15 @@ {{ !checked ? '全选' : '全取消' }} + + {{ !editChecked ? '全选-编辑' : '全取消-编辑' }} + + + {{ !auditChecked ? '全选-审核' : '全取消-审核' }} + + + {{ !unAuditChecked ? '全选-反审核' : '全取消-反审核' }} + @@ -65,6 +74,9 @@ visible: false, model: {}, checked: false, + editChecked: false, + auditChecked: false, + unAuditChecked: false, disableMixinCreated: true, confirmLoading: false, form: this.$form.createForm(this), @@ -177,6 +189,73 @@ } } }, + editToggleChecked() { + this.editChecked = !this.editChecked; + let funArray = this.dataSource + if(this.editChecked) { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(1, item.btnStr, 1) + } + } else { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(1, item.btnStr, 0) + } + } + }, + auditToggleChecked() { + this.auditChecked = !this.auditChecked; + let funArray = this.dataSource + if(this.auditChecked) { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(2, item.btnStr, 1) + } + } else { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(2, item.btnStr, 0) + } + } + }, + unAuditToggleChecked() { + this.unAuditChecked = !this.unAuditChecked; + let funArray = this.dataSource + if(this.unAuditChecked) { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(7, item.btnStr, 1) + } + } else { + for(let item of funArray){ + item.btnStr = this.parseArrByParam(7, item.btnStr, 0) + } + } + }, + /** + * 格式转换,控制按钮的显示或隐藏 + * @param param + * @param btnStr + * @param type + * @returns {string} + */ + parseArrByParam(param, btnStr, type) { + if(type) { + btnStr = btnStr + ',' + if(btnStr.indexOf(param + ',') === -1) { + btnStr = btnStr + param + ',' + } + } else { + btnStr = btnStr + ',' + if(btnStr.indexOf(param + ',') > -1) { + btnStr = btnStr.replace(param + ',', '') + } + } + if(btnStr) { + btnStr = btnStr.replace('null', '') + btnStr = btnStr.substring(0, btnStr.length-1) + if(btnStr.substring(0,1) === ',') { + btnStr = btnStr.substring(1) + } + } + return btnStr + }, onChange(record,value) { let funArray = this.dataSource for(let item of funArray){