提交 298b9176 编写于 作者: doc_wei's avatar doc_wei

解决团队模板的bug

上级 c783e1ce
...@@ -13,14 +13,15 @@ layui.config({ ...@@ -13,14 +13,15 @@ layui.config({
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
table = layui.table; table = layui.table;
objectKey = GetUrlParam("objectKey"); objectKey = GetUrlParam("objectKey");
objectId = GetUrlParam("objectId"); objectId = GetUrlParam("objectId");
if (isNull(objectKey) || isNull(objectId)) { if (isNull(objectKey) || isNull(objectId)) {
winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000});
return false; return false;
} }
var authPermission = teamObjectPermissionUtil.checkTeamBusinessAuthPermission(objectId, 'contactsAuthEnum');
authBtn('1596375844035'); authBtn('1596375844035');
table.render({ table.render({
id: 'messageTable', id: 'messageTable',
...@@ -45,8 +46,8 @@ layui.config({ ...@@ -45,8 +46,8 @@ layui.config({
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 }, { 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: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', width: 100}, { 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'} { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar' }
]], ]],
done: function(json) { done: function(json) {
matchingLanguage(); matchingLanguage();
......
...@@ -121,11 +121,14 @@ layui.config({ ...@@ -121,11 +121,14 @@ layui.config({
var layEvent = obj.event; var layEvent = obj.event;
if (layEvent === 'removeRole') { if (layEvent === 'removeRole') {
// 移除角色和该角色下的用户 // 移除角色和该角色下的用户
var tmp = [];
$.each(treeTableData, function(index, item) { $.each(treeTableData, function(index, item) {
if (item.id == data.id || item.pId == data.id) { if (item.id != data.id && item.pId != data.id) {
treeTableData.splice(index, 1); tmp.push(item);
} }
}); });
treeTableData = [].concat(tmp);
restCheckbox(); restCheckbox();
reloadTreeTable(); reloadTreeTable();
} else if (layEvent === 'addUser') { // 添加成员 } else if (layEvent === 'addUser') { // 添加成员
......
...@@ -49,11 +49,14 @@ layui.config({ ...@@ -49,11 +49,14 @@ layui.config({
var layEvent = obj.event; var layEvent = obj.event;
if (layEvent === 'removeRole') { if (layEvent === 'removeRole') {
// 移除角色和该角色下的用户 // 移除角色和该角色下的用户
var tmp = [];
$.each(treeTableData, function(index, item) { $.each(treeTableData, function(index, item) {
if (item.id == data.id || item.pId == data.id) { if (item.id != data.id && item.pId != data.id) {
treeTableData.splice(index, 1); tmp.push(item);
} }
}); });
treeTableData = [].concat(tmp);
reloadTreeTable(); reloadTreeTable();
} else if (layEvent === 'addUser') { // 添加成员 } else if (layEvent === 'addUser') { // 添加成员
var roleId = data.id; var roleId = data.id;
...@@ -184,6 +187,11 @@ layui.config({ ...@@ -184,6 +187,11 @@ layui.config({
loadAuthTreeTable(item.id, item.cols, data); 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) { form.on('checkbox(checkClick)', function(obj) {
var id = $(this).attr('id'); var id = $(this).attr('id');
var str = id.split('_'); var str = id.split('_');
......
...@@ -123,11 +123,14 @@ layui.config({ ...@@ -123,11 +123,14 @@ layui.config({
var layEvent = obj.event; var layEvent = obj.event;
if (layEvent === 'removeRole') { if (layEvent === 'removeRole') {
// 移除角色和该角色下的用户 // 移除角色和该角色下的用户
var tmp = [];
$.each(treeTableData, function(index, item) { $.each(treeTableData, function(index, item) {
if (item.id == data.id || item.pId == data.id) { if (item.id != data.id && item.pId != data.id) {
treeTableData.splice(index, 1); tmp.push(item);
} }
}); });
treeTableData = [].concat(tmp);
restCheckbox(); restCheckbox();
reloadTreeTable(); reloadTreeTable();
} else if (layEvent === 'addUser') { // 添加成员 } else if (layEvent === 'addUser') { // 添加成员
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<div class="winui-toolbar"> <div class="winui-toolbar">
<div class="winui-tool"> <div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button> <button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1596375844035"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button> <button id="addBean" class="winui-toolbtn search-table-btn-right" auth="add"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div> </div>
</div> </div>
<div style="margin:auto 10px;"> <div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar"> <script type="text/html" id="tableBar">
{{# if(auth('1596375844035')){ }} {{# if(authPermission['edit']) { }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a> <a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }} {{# } }}
{{# if(auth('1596375863370')){ }} {{# if(auth('1596375863370')){ }}
......
...@@ -37,9 +37,9 @@ layui.config({ ...@@ -37,9 +37,9 @@ layui.config({
teamObjectPermissionUtil.buildTeamTemplate('teamTemplateId', 1, json.bean.teamTemplateId); teamObjectPermissionUtil.buildTeamTemplate('teamTemplateId', 1, json.bean.teamTemplateId);
textool.init({eleId: 'addDesc', maxlength: 200}); textool.init({eleId: 'addDesc', maxlength: 200});
if (!isNull(json.bean.chargeUser)){ if (!isNull(json.bean.chargeUserMation)) {
userList = [].concat(json.bean.chargeUser); userList.push(json.bean.chargeUserMation);
$.each(json.bean.chargeUser, function(i, item) { $.each(userList, function(i, item) {
$("#relationUserId").val(item.name); $("#relationUserId").val(item.name);
}); });
} }
......
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">分类</label> <label class="layui-form-label">分类</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
{{typeId}} {{typeName}}
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">客户来源</label> <label class="layui-form-label">客户来源</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
{{fromId}} {{fromName}}
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属行业</label> <label class="layui-form-label">所属行业</label>
<div class="layui-input-block ver-center"> <div class="layui-input-block ver-center">
{{industryId}} {{industryName}}
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
......
...@@ -136,6 +136,23 @@ var teamObjectPermissionUtil = { ...@@ -136,6 +136,23 @@ var teamObjectPermissionUtil = {
$(`#${id}`).val(defaultValue); $(`#${id}`).val(defaultValue);
} }
}, async: false}); }, async: false});
},
checkTeamBusinessAuthPermission: function (objectId, enumKey) {
var params = {
objectId: objectId,
enumClassName: skyeyeClassEnum[enumKey].className
};
var authPermission = {};
AjaxPostUtil.request({url: reqBasePath + "checkTeamBusinessAuthPermission", params: params, type: 'json', method: "POST", callback: function(json) {
authPermission = json.bean;
$.each(authPermission, function (key, checkResult) {
if (!checkResult) {
$('[auth="' + key + '"]').remove();
}
});
}, async: false});
return authPermission;
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册