Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
07f2c312
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1283
Star
158
Fork
129
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
07f2c312
编写于
11月 27, 2022
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
团队权限静态页面完成
上级
ba704782
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
147 addition
and
103 deletion
+147
-103
common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js
...ain/resources/template/js/teamTemplate/teamTemplateAdd.js
+97
-12
common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html
.../resources/template/tpl/teamTemplate/teamTemplateAdd.html
+5
-23
web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js
...ate/assets/lib/layui/customer/teamObjectPermissionUtil.js
+41
-45
web/src/main/resources/template/assets/lib/layui/lay/modules/treetable/tableTreeDj.js
...ate/assets/lib/layui/lay/modules/treetable/tableTreeDj.js
+0
-5
web/src/main/resources/template/js/common/sysusersel.js
web/src/main/resources/template/js/common/sysusersel.js
+4
-12
web/src/main/resources/template/json/skyeyeClassEnum.json
web/src/main/resources/template/json/skyeyeClassEnum.json
+0
-1
web/src/main/resources/template/json/teamObjectLink.json
web/src/main/resources/template/json/teamObjectLink.json
+0
-5
未找到文件。
common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js
浏览文件 @
07f2c312
...
...
@@ -22,13 +22,14 @@ layui.config({
tableTree
.
render
({
id
:
'
messageTable
'
,
elem
:
'
#messageTable
'
,
data
:
[{
"
id
"
:
"
123qwe
"
,
"
name
"
:
"
阿萨斯多
"
,
"
pId
"
:
"
0
"
,
"
lay_is_open
"
:
true
},
{
"
id
"
:
"
123qwe1
"
,
"
name
"
:
"
阿萨斯多qqq
"
,
"
pId
"
:
"
123qwe
"
,
"
lay_is_open
"
:
true
}],
data
:
[],
// 该参数不能删除,分页参数无效,目前只能通过设置10000来保证当前页最大的数据量
limit
:
10000
,
cols
:
[[
{
field
:
'
name
'
,
title
:
'
名称
'
,
width
:
1
2
0
},
{
field
:
'
menuNameEn
'
,
title
:
'
部门
'
,
width
:
15
0
},
{
field
:
'
orderNum
'
,
title
:
'
邮箱
'
,
width
:
15
0
},
{
field
:
'
desktopName
'
,
title
:
'
联系方式
'
,
width
:
12
0
},
{
field
:
'
name
'
,
title
:
'
名称
'
,
width
:
1
6
0
},
{
field
:
'
departmentName
'
,
title
:
'
部门
'
,
width
:
12
0
},
{
field
:
'
phone
'
,
title
:
'
联系方式
'
,
width
:
14
0
},
{
field
:
'
email
'
,
title
:
'
邮箱
'
,
width
:
20
0
},
{
title
:
systemLanguage
[
"
com.skyeye.operation
"
][
languageType
],
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
150
,
toolbar
:
'
#tableBar
'
}
]],
done
:
function
(
json
)
{
...
...
@@ -44,26 +45,52 @@ layui.config({
tableTree
.
getTable
().
on
(
'
tool(messageTable)
'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
var
layEvent
=
obj
.
event
;
if
(
layEvent
===
'
removeRole
'
)
{
// 移除角色
if
(
layEvent
===
'
removeRole
'
)
{
// 移除角色和该角色下的用户
$
.
each
(
treeTableData
,
function
(
index
,
item
)
{
if
(
item
.
id
==
data
.
id
)
{
if
(
item
.
id
==
data
.
id
||
item
.
pId
==
data
.
id
)
{
treeTableData
.
splice
(
index
,
1
);
}
});
reloadTreeTable
();
}
else
if
(
layEvent
===
'
addUser
'
)
{
// 添加成员
var
roleId
=
data
.
id
;
systemCommonUtil
.
userReturnList
=
[];
systemCommonUtil
.
chooseOrNotMy
=
"
1
"
;
// 人员列表中是否包含自己--1.包含;其他参数不包含
systemCommonUtil
.
chooseOrNotEmail
=
"
2
"
;
// 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要
systemCommonUtil
.
checkType
=
"
1
"
;
// 人员选择类型,1.多选;其他。单选
systemCommonUtil
.
openSysUserStaffChoosePage
(
function
(
userReturnList
)
{
console
.
log
(
userReturnList
)
var
userList
=
[].
concat
(
userReturnList
);
$
.
each
(
userList
,
function
(
i
,
item
)
{
// 一个用户在一个团队中只能属于一个角色
var
checkParams
=
getInPoingArr
(
treeTableData
,
"
id
"
,
item
.
id
);
if
(
checkParams
==
null
)
{
item
[
'
pId
'
]
=
roleId
;
treeTableData
.
push
(
item
);
}
});
reloadTreeTable
();
});
}
else
if
(
layEvent
===
'
removeUser
'
)
{
// 移除成员
var
roleId
=
data
.
pId
;
var
userId
=
data
.
id
;
$
.
each
(
treeTableData
,
function
(
index
,
item
)
{
if
(
!
isNull
(
item
)
&&
item
.
pId
==
roleId
&&
item
.
id
==
userId
)
{
treeTableData
.
splice
(
index
,
1
);
}
});
reloadTreeTable
();
}
});
}
// 刷新成员树表格
function
reloadTreeTable
()
{
var
data
=
$
.
extend
(
true
,
[],
treeTableData
);
tableTree
.
reload
(
"
messageTable
"
,
{
data
:
data
});
loadAuthList
();
}
loadAuthList
();
form
.
on
(
'
select(objectType)
'
,
function
(
data
)
{
loadAuthList
();
...
...
@@ -72,6 +99,7 @@ layui.config({
matchingLanguage
();
form
.
render
();
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
console
.
log
(
treeTableData
)
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
params
=
{
dictName
:
$
(
"
#dictName
"
).
val
(),
...
...
@@ -88,8 +116,65 @@ layui.config({
});
function
loadAuthList
()
{
var
data
=
$
.
extend
(
true
,
[],
treeTableData
);
var
objectType
=
$
(
'
#objectType
'
).
val
();
teamObjectPermissionUtil
.
insertPageShow
(
objectType
,
'
authList
'
,
form
);
// 加载该受用类型的团队可以设置哪些权限
var
colsList
=
teamObjectPermissionUtil
.
getAuthCols
(
objectType
);
$
(
'
#authList
'
).
html
(
getDataUseHandlebars
(
$
(
'
#authTableTemplate
'
).
html
(),
{
list
:
colsList
}));
$
.
each
(
colsList
,
function
(
i
,
item
)
{
// 给数据设置权限组的key,
$
.
each
(
data
,
function
(
j
,
bean
)
{
bean
.
authGroupKey
=
item
.
id
;
});
loadAuthTreeTable
(
item
.
id
,
item
.
cols
,
data
);
});
form
.
on
(
'
checkbox(checkClick)
'
,
function
(
obj
)
{
// var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']:checked");
var
id
=
$
(
this
).
attr
(
'
id
'
);
var
str
=
id
.
split
(
'
_
'
);
var
authGroupKey
=
str
[
0
];
var
authKey
=
str
[
1
];
var
roleId
=
str
[
2
];
var
userId
=
str
[
3
];
var
checkBoxId
=
authGroupKey
+
'
_
'
+
authKey
+
'
_
'
+
roleId
+
'
_
'
+
userId
;
var
name
=
authGroupKey
+
'
_
'
+
authKey
+
'
_
'
+
roleId
;
var
_table
=
$
(
`div[lay-id='
${
authGroupKey
}
']`
);
if
(
isNull
(
userId
))
{
// 如果用户id为空,代表点击的是角色的选择box,需要把name是这个的都选中
if
(
obj
.
elem
.
checked
)
{
_table
.
find
(
`input[name='
${
name
}
']`
).
prop
(
"
checked
"
,
true
);
}
else
{
_table
.
find
(
`input[name='
${
name
}
']`
).
prop
(
"
checked
"
,
false
);
}
}
else
{
if
(
obj
.
elem
.
checked
)
{
if
(
_table
.
find
(
`input[name='
${
name
}
']:checked`
).
length
==
_table
.
find
(
`input[name='
${
name
}
']`
).
length
-
1
)
{
$
(
`input[id='
${
name
}
_']`
).
prop
(
"
checked
"
,
true
);
}
}
else
{
$
(
`input[id='
${
name
}
_']`
).
prop
(
"
checked
"
,
false
);
}
}
form
.
render
(
'
checkbox
'
);
});
}
function
loadAuthTreeTable
(
id
,
cols
,
data
)
{
tableTree
.
render
({
id
:
id
,
elem
:
'
#
'
+
id
,
data
:
data
,
// 该参数不能删除,分页参数无效,目前只能通过设置10000来保证当前页最大的数据量
limit
:
10000
,
cols
:
[
cols
],
},
{
keyId
:
'
id
'
,
keyPid
:
'
pId
'
,
title
:
'
name
'
,
defaultShow
:
true
,
});
}
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRole
"
,
function
()
{
...
...
@@ -104,7 +189,7 @@ layui.config({
turnData
[
"
pId
"
]
=
'
0
'
;
turnData
[
"
lay_is_open
"
]
=
true
;
treeTableData
.
push
(
turnData
);
tableTree
.
reload
(
"
messageTable
"
,
{
data
:
treeTableData
}
);
reloadTreeTable
(
);
}
else
{
winui
.
window
.
msg
(
"
角色重复
"
,
{
icon
:
2
,
time
:
2000
});
}
...
...
common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html
浏览文件 @
07f2c312
...
...
@@ -44,6 +44,7 @@
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
成员信息:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"winui-tip alert-info"
id=
"showInfo"
>
一个用户在一个团队中只能属于一个角色。
</div>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
style=
"text-align: left;"
>
<button
id=
"addRole"
class=
"winui-toolbtn"
type=
"button"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加角色
</button>
...
...
@@ -80,33 +81,14 @@
</script>
<script
type=
"text/x-handlebars-template"
id=
"authTableTemplate"
>
{{
#
json
}}
{{
#
list
}}
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
{{
bean
.
nam
e
}}
<
i
class
=
"
red
"
>*<
/i></
label
>
<
label
class
=
"
layui-form-label
"
>
{{
titl
e
}}
<
i
class
=
"
red
"
>*<
/i></
label
>
<
div
class
=
"
layui-input-block
"
>
<
table
class
=
"
layui-table
"
>
<
thead
>
<
tr
>
<
th
>
成员
<
/th
>
{{
#
each
rows
}}
<
th
>
{{
name
}}
<
/th
>
{{
/
each
}}
<
/tr
>
<
/thead
>
<
tbody
id
=
"
{{bean.key}}
"
class
=
"
insurance-table
"
>
{{
#
each
roleList
}}
<
tr
>
<
td
>
{{
name
}}
<
/td
>
{{
#
each
..
/
rows
}}
<
th
>
{{
name
}}
<
/th
>
{{
/
each
}}
<
/tr
>
{{
/
each
}}
<
/tbody
>
<
/table
>
<
table
id
=
"
{{id}}
"
lay
-
filter
=
"
{{id}}
"
><
/table
>
<
/div
>
<
/div
>
{{
/
json
}}
{{
/
list
}}
</script>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
...
...
web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js
浏览文件 @
07f2c312
...
...
@@ -2,55 +2,51 @@
// 团队成员权限工具
var
teamObjectPermissionUtil
=
{
template
:
`{{#json}}
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">{{bean.name}}<i class="red">*</i></label>
<div class="layui-input-block">
<table class="layui-table">
<thead>
<tr>
<th>成员</th>
{{#each rows}}
<th>{{name}}</th>
{{/each}}
</tr>
</thead>
<tbody id="{{bean.key}}" class="insurance-table">
{{#each roleList}}
<tr>
<td>{{name}}</td>
{{#each ../rows}}
<th>{{name}}</th>
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/json}}`
,
// 新增时的展示
insertPageShow
:
function
(
objectType
,
showBoxId
,
form
)
{
getAuthCols
:
function
(
objectType
)
{
if
(
isNull
(
objectType
))
{
$
(
`#
${
showBoxId
}
`
).
html
(
''
);
}
else
{
jsGetJsonFile
(
"
../../json/teamObjectLink.json
"
,
function
(
data
)
{
var
authStrList
=
data
[
objectType
];
var
str
=
``
;
$
.
each
(
authStrList
,
function
(
i
,
item
)
{
var
bean
=
{
key
:
item
,
name
:
skyeyeClassEnum
[
item
].
name
};
var
authBtnJson
=
skyeyeClassEnumUtil
.
getEnumDataListByClassName
(
item
);
authBtnJson
[
"
bean
"
]
=
bean
;
str
+=
getDataUseHandlebars
(
$
(
'
#authTableTemplate
'
).
html
(),
{
json
:
authBtnJson
});
return
[];
}
else
{
var
teamObjectType
=
skyeyeClassEnumUtil
.
getEnumDataListByClassName
(
"
teamObjectType
"
).
rows
;
var
pageAuthList
=
getInPoingArr
(
teamObjectType
,
"
id
"
,
objectType
,
"
pageAuth
"
);
if
(
pageAuthList
==
null
)
{
return
[];
}
var
result
=
[];
$
.
each
(
pageAuthList
,
function
(
i
,
enumKey
)
{
var
map
=
{
id
:
enumKey
,
title
:
skyeyeClassEnum
[
enumKey
].
name
};
// 获取枚举中需要鉴权的内容
var
authBtnJson
=
skyeyeClassEnumUtil
.
getEnumDataListByClassName
(
enumKey
).
rows
;
var
cols
=
[];
cols
.
push
({
field
:
'
name
'
,
title
:
'
名称
'
,
width
:
160
});
$
.
each
(
authBtnJson
,
function
(
j
,
item
)
{
cols
.
push
({
field
:
item
.
id
,
title
:
item
.
name
,
align
:
'
center
'
,
width
:
140
,
templet
:
function
(
row
)
{
var
roleId
=
row
.
pId
==
'
0
'
?
row
.
id
:
row
.
pId
;
var
authGroupKey
=
row
.
authGroupKey
;
var
authKey
=
$
(
this
)[
0
].
field
;
var
userId
=
row
.
pId
==
'
0
'
?
''
:
row
.
id
;
var
checkBoxId
=
authGroupKey
+
'
_
'
+
authKey
+
'
_
'
+
roleId
+
'
_
'
+
userId
;
var
name
=
authGroupKey
+
'
_
'
+
authKey
+
'
_
'
+
roleId
;
return
`<input type="checkbox" id="
${
checkBoxId
}
" name="
${
name
}
" lay-filter="checkClick"/>`
;
}
});
});
$
(
`#
${
showBoxId
}
`
).
html
(
str
);
map
[
'
cols
'
]
=
cols
;
result
.
push
(
map
);
});
return
result
;
}
form
.
render
();
}
}
web/src/main/resources/template/assets/lib/layui/lay/modules/treetable/tableTreeDj.js
浏览文件 @
07f2c312
...
...
@@ -67,7 +67,6 @@ layui.define(['table', 'jquery'], function (exports) {
}
// 整理数据初始状态
var
loadData
=
false
;
const
parseData
=
obj
.
parseData
||
{};
obj
.
parseData
=
(
res
)
=>
{
if
(
JSON
.
stringify
(
parseData
)
!==
"
{}
"
)
{
...
...
@@ -75,7 +74,6 @@ layui.define(['table', 'jquery'], function (exports) {
}
this
.
_initDo
()
res
.
rows
=
this
.
_parse
(
res
.
rows
);
loadData
=
true
;
return
res
;
}
...
...
@@ -88,9 +86,6 @@ layui.define(['table', 'jquery'], function (exports) {
}
}
table
.
render
(
obj
);
if
(
!
loadData
)
{
this
.
_initDo
()
}
}
// 重载
...
...
web/src/main/resources/template/js/common/sysusersel.js
浏览文件 @
07f2c312
...
...
@@ -433,12 +433,9 @@ layui.config({
//获取选中节点
var
zTree
=
ztr
.
getCheckedNodes
(
true
);
for
(
var
i
=
0
;
i
<
zTree
.
length
;
i
++
)
{
if
(
zTree
[
i
].
folderType
===
'
isPeople
'
){
//选中节点是人
addToArray
({
id
:
zTree
[
i
].
id
,
name
:
zTree
[
i
].
name
,
email
:
zTree
[
i
].
email
});
if
(
zTree
[
i
].
folderType
===
'
isPeople
'
){
// 选中节点是人
addToArray
(
zTree
[
i
]);
setUpTreeNodeCheckOrNot
(
zTree
[
i
].
id
,
true
);
}
}
...
...
@@ -504,12 +501,7 @@ layui.config({
//如果该元素在集合中不存在
if
(
!
inArray
)
{
var
j
=
{
id
:
data
.
id
,
name
:
data
.
name
,
email
:
data
.
email
};
userOperatorReturnList
.
push
(
j
);
userOperatorReturnList
.
push
(
data
);
showPeople
();
}
}
...
...
web/src/main/resources/template/json/skyeyeClassEnum.json
浏览文件 @
07f2c312
...
...
@@ -23,7 +23,6 @@
"skyeyeView"
:
{
"name"
:
"视图枚举"
,
"className"
:
"skyeye-pro#com.skyeye.common.SkyeyeViewEnum"
},
"teamObjectType"
:
{
"name"
:
"团队适用对象枚举"
,
"className"
:
"skyeye-pro#com.skyeye.team.classenum.TeamObjectTypeEnum"
},
"contactsAuthEnum"
:
{
"name"
:
"联系人"
,
"className"
:
"skyeye-pro#com.skyeye.contacts.classenum.ContactsAuthEnum"
}
}
\ No newline at end of file
web/src/main/resources/template/json/teamObjectLink.json
已删除
100644 → 0
浏览文件 @
ba704782
{
"1"
:
[
"contactsAuthEnum"
],
"2"
:
[
"contactsAuthEnum"
],
"3"
:
[]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录