From 298b91764686bd839898bb8d003724cce6d2ae99 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 10 Dec 2022 14:30:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=A2=E9=98=9F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/contacts/contactsList.js | 9 +++++---- .../js/teamBusiness/teamBusinessEdit.js | 7 +++++-- .../template/js/teamTemplate/teamTemplateAdd.js | 12 ++++++++++-- .../js/teamTemplate/teamTemplateEdit.js | 7 +++++-- .../template/tpl/contacts/contactsList.html | 4 ++-- .../template/js/customerManage/customerEdit.js | 6 +++--- .../tpl/customerManage/customerDetails.html | 6 +++--- .../layui/customer/teamObjectPermissionUtil.js | 17 +++++++++++++++++ 8 files changed, 50 insertions(+), 18 deletions(-) diff --git a/base-server/src/main/resources/template/js/contacts/contactsList.js b/base-server/src/main/resources/template/js/contacts/contactsList.js index 87414aadf..8c214bfb0 100644 --- a/base-server/src/main/resources/template/js/contacts/contactsList.js +++ b/base-server/src/main/resources/template/js/contacts/contactsList.js @@ -13,14 +13,15 @@ layui.config({ var $ = layui.$, form = layui.form, table = layui.table; - objectKey = GetUrlParam("objectKey"); objectId = GetUrlParam("objectId"); if (isNull(objectKey) || isNull(objectId)) { winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); return false; } - + + var authPermission = teamObjectPermissionUtil.checkTeamBusinessAuthPermission(objectId, 'contactsAuthEnum'); + authBtn('1596375844035'); table.render({ id: 'messageTable', @@ -45,8 +46,8 @@ layui.config({ { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 }, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, - { field: 'lastUpdateTime', title: '最后修改时间', align: 'center', width: 100}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'} + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar' } ]], done: function(json) { matchingLanguage(); diff --git a/base-server/src/main/resources/template/js/teamBusiness/teamBusinessEdit.js b/base-server/src/main/resources/template/js/teamBusiness/teamBusinessEdit.js index fb83e0f5a..d075b7668 100644 --- a/base-server/src/main/resources/template/js/teamBusiness/teamBusinessEdit.js +++ b/base-server/src/main/resources/template/js/teamBusiness/teamBusinessEdit.js @@ -121,11 +121,14 @@ layui.config({ var layEvent = obj.event; if (layEvent === 'removeRole') { // 移除角色和该角色下的用户 + var tmp = []; $.each(treeTableData, function(index, item) { - if (item.id == data.id || item.pId == data.id) { - treeTableData.splice(index, 1); + if (item.id != data.id && item.pId != data.id) { + tmp.push(item); } }); + treeTableData = [].concat(tmp); + restCheckbox(); reloadTreeTable(); } else if (layEvent === 'addUser') { // 添加成员 diff --git a/base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js index c96f582a4..cbcfa27e0 100644 --- a/base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js +++ b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js @@ -49,11 +49,14 @@ layui.config({ var layEvent = obj.event; if (layEvent === 'removeRole') { // 移除角色和该角色下的用户 + var tmp = []; $.each(treeTableData, function(index, item) { - if (item.id == data.id || item.pId == data.id) { - treeTableData.splice(index, 1); + if (item.id != data.id && item.pId != data.id) { + tmp.push(item); } }); + treeTableData = [].concat(tmp); + reloadTreeTable(); } else if (layEvent === 'addUser') { // 添加成员 var roleId = data.id; @@ -184,6 +187,11 @@ layui.config({ loadAuthTreeTable(item.id, item.cols, data); }); + $.each(checkTrueList, function (i, id) { + $(`input[id='${id}']`).prop("checked", true); + }); + form.render('checkbox'); + form.on('checkbox(checkClick)', function(obj) { var id = $(this).attr('id'); var str = id.split('_'); diff --git a/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js index 222405e03..d2cb111f6 100644 --- a/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js +++ b/base-server/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js @@ -123,11 +123,14 @@ layui.config({ var layEvent = obj.event; if (layEvent === 'removeRole') { // 移除角色和该角色下的用户 + var tmp = []; $.each(treeTableData, function(index, item) { - if (item.id == data.id || item.pId == data.id) { - treeTableData.splice(index, 1); + if (item.id != data.id && item.pId != data.id) { + tmp.push(item); } }); + treeTableData = [].concat(tmp); + restCheckbox(); reloadTreeTable(); } else if (layEvent === 'addUser') { // 添加成员 diff --git a/base-server/src/main/resources/template/tpl/contacts/contactsList.html b/base-server/src/main/resources/template/tpl/contacts/contactsList.html index 651b993f2..b6b6a1d83 100644 --- a/base-server/src/main/resources/template/tpl/contacts/contactsList.html +++ b/base-server/src/main/resources/template/tpl/contacts/contactsList.html @@ -10,13 +10,13 @@
- +