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

解决团队模板的bug

上级 c783e1ce
......@@ -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();
......
......@@ -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') { // 添加成员
......
......@@ -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('_');
......
......@@ -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') { // 添加成员
......
......@@ -10,13 +10,13 @@
<div class="winui-toolbar">
<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="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 style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<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>
{{# } }}
{{# if(auth('1596375863370')){ }}
......
......@@ -37,9 +37,9 @@ layui.config({
teamObjectPermissionUtil.buildTeamTemplate('teamTemplateId', 1, json.bean.teamTemplateId);
textool.init({eleId: 'addDesc', maxlength: 200});
if (!isNull(json.bean.chargeUser)){
userList = [].concat(json.bean.chargeUser);
$.each(json.bean.chargeUser, function(i, item) {
if (!isNull(json.bean.chargeUserMation)) {
userList.push(json.bean.chargeUserMation);
$.each(userList, function(i, item) {
$("#relationUserId").val(item.name);
});
}
......
......@@ -33,13 +33,13 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">分类</label>
<div class="layui-input-block ver-center">
{{typeId}}
{{typeName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">客户来源</label>
<div class="layui-input-block ver-center">
{{fromId}}
{{fromName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......@@ -51,7 +51,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属行业</label>
<div class="layui-input-block ver-center">
{{industryId}}
{{industryName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......
......@@ -136,6 +136,23 @@ var teamObjectPermissionUtil = {
$(`#${id}`).val(defaultValue);
}
}, 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.
先完成此消息的编辑!
想要评论请 注册