From 8a67d43920c287439c14fc47055b0d6a3ef24430 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 18 Apr 2023 22:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addDataPrivilegeStaff.html | 4 +- .../addDataPrivilegeStaff.js | 48 +++++++++---------- .../addDataPrivilegeUnit.html | 17 ++++--- .../addDataPrivilegeUnit.js | 48 ++++++++++--------- 4 files changed, 61 insertions(+), 56 deletions(-) diff --git a/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.html b/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.html index 198327196..23d71d310 100644 --- a/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.html +++ b/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.html @@ -35,8 +35,8 @@ - + diff --git a/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.js b/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.js index 9caa82102..a334c1f4c 100644 --- a/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.js +++ b/public/components/frame/addDataPrivilegeStaff/addDataPrivilegeStaff.js @@ -17,12 +17,12 @@ } }, watch: { // 监视双向绑定的数据数组 - checkData: { + addDataPrivilegeStaffInfo: { handler() { // 数据数组有变化将触发此函数 - if (vc.component.addDataPrivilegeStaffInfo.selectStaffs.length == vc.component.addDataPrivilegeStaffInfo.staffs.length) { - document.querySelector('#quan').checked = true; + if ($that.addDataPrivilegeStaffInfo.selectStaffs.length == $that.addDataPrivilegeStaffInfo.staffs.length) { + document.querySelector('#staffQuan').checked = true; } else { - document.querySelector('#quan').checked = false; + document.querySelector('#staffQuan').checked = false; } }, deep: true // 深度监视 @@ -32,13 +32,13 @@ }, _initEvent: function () { vc.on('addDataPrivilegeStaff', 'openAddDataPrivilegeStaffModal', function (_param) { - vc.component._refreshChooseOrgInfo(); + $that._refreshChooseOrgInfo(); $('#addDataPrivilegeStaffModel').modal('show'); - vc.copyObject(_param, vc.component.addDataPrivilegeStaffInfo); - vc.component._loadAllStaffInfo(1, 10, ''); + vc.copyObject(_param, $that.addDataPrivilegeStaffInfo); + $that._loadAllStaffInfo(1, 10, ''); }); vc.on('addDataPrivilegeStaff', 'paginationPlus', 'page_event', function (_currentPage) { - vc.component._loadAllStaffInfo(_currentPage, DEFAULT_ROWS); + $that._loadAllStaffInfo(_currentPage, DEFAULT_ROWS); }); }, methods: { @@ -47,8 +47,8 @@ params: { page: _page, row: _row, - userName: _name, - dpId: vc.component.addDataPrivilegeStaffInfo.dpId + staffName: _name, + dpId: $that.addDataPrivilegeStaffInfo.dpId } }; //发送get请求 @@ -56,12 +56,12 @@ param, function (json) { var _staffInfo = JSON.parse(json); - vc.component.addDataPrivilegeStaffInfo.total = _staffInfo.total; - vc.component.addDataPrivilegeStaffInfo.records = _staffInfo.records; - vc.component.addDataPrivilegeStaffInfo.staffs = _staffInfo.data; + $that.addDataPrivilegeStaffInfo.total = _staffInfo.total; + $that.addDataPrivilegeStaffInfo.records = _staffInfo.records; + $that.addDataPrivilegeStaffInfo.staffs = _staffInfo.data; vc.emit('addDataPrivilegeStaff', 'paginationPlus', 'init', { - total: vc.component.addDataPrivilegeStaffInfo.records, - dataCount: vc.component.addDataPrivilegeStaffInfo.total, + total: $that.addDataPrivilegeStaffInfo.records, + dataCount: $that.addDataPrivilegeStaffInfo.total, currentPage: _page }); }, @@ -71,8 +71,8 @@ ); }, addDataPrivilegeStaff: function (_org) { - var _selectStaffs = vc.component.addDataPrivilegeStaffInfo.selectStaffs; - var _tmpStaffs = vc.component.addDataPrivilegeStaffInfo.staffs; + var _selectStaffs = $that.addDataPrivilegeStaffInfo.selectStaffs; + var _tmpStaffs = $that.addDataPrivilegeStaffInfo.staffs; if (_selectStaffs.length < 1) { vc.toast("请选择员工"); return; @@ -89,7 +89,7 @@ } } let _objData = { - dpId: vc.component.addDataPrivilegeStaffInfo.dpId, + dpId: $that.addDataPrivilegeStaffInfo.dpId, staffs: _staffs, communityId: vc.getCurrentCommunity().communityId } @@ -115,10 +115,10 @@ $('#addDataPrivilegeStaffModel').modal('hide'); }, queryStaffs: function () { - vc.component._loadAllStaffInfo(1, 10, vc.component.addDataPrivilegeStaffInfo.staffName); + $that._loadAllStaffInfo(1, 10, $that.addDataPrivilegeStaffInfo.staffName); }, _refreshChooseOrgInfo: function () { - vc.component.addDataPrivilegeStaffInfo = { + $that.addDataPrivilegeStaffInfo = { staffs: [], staffName: '', dpId: '', @@ -126,16 +126,16 @@ selectStaffs: [] }; }, - checkAll: function (e) { - var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项 + checkStaffAll: function (e) { + let checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项 if (e.target.checked) { // 判定全选checkbox的勾选状态 for (var i = 0; i < checkObj.length; i++) { if (!checkObj[i].checked) { // 将未勾选的checkbox选项push到绑定数组中 - vc.component.addDataPrivilegeStaffInfo.selectStaffs.push(checkObj[i].value); + $that.addDataPrivilegeStaffInfo.selectStaffs.push(checkObj[i].value); } } } else { // 如果是去掉全选则清空checkbox选项绑定数组 - vc.component.addDataPrivilegeStaffInfo.selectStaffs = []; + $that.addDataPrivilegeStaffInfo.selectStaffs = []; } } } diff --git a/public/components/property/addDataPrivilegeUnit/addDataPrivilegeUnit.html b/public/components/property/addDataPrivilegeUnit/addDataPrivilegeUnit.html index 536c44df8..3473dccb3 100644 --- a/public/components/property/addDataPrivilegeUnit/addDataPrivilegeUnit.html +++ b/public/components/property/addDataPrivilegeUnit/addDataPrivilegeUnit.html @@ -4,7 +4,7 @@