Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
75ee22f3
提交
75ee22f3
编写于
5月 21, 2020
作者:
laizhilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
恢复权限表实体多选视图
上级
315af86f
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
344 行删除
+9
-344
sys-permissionmpickup-view.less
...ys-permissionmpickup-view/sys-permissionmpickup-view.less
+3
-52
sys-permissionmpickup-view.vue
...sys-permissionmpickup-view/sys-permissionmpickup-view.vue
+6
-292
未找到文件。
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.less
浏览文件 @
75ee22f3
.sys-permissionmpickup-view{
.sys-permissionmpickup-view{
position: relative;
position: relative;
.tree-right-menu {
.ivu-divider-horizontal {
width: calc(100% - 32px);
min-width: calc(100% - 32px);
margin: 0 auto;
}
.ivu-dropdown-item {
position: relative;
padding-left: 32px;
> i {
position: absolute;
left: 16px;
top: 10px;
}
.ivu-icon-ios-arrow-forward {
left: initial;
right: 4px;
}
}
.ivu-dropdown {
.ivu-select-dropdown {
margin: 0;
}
}
}
.text{
font-weight: 700;color: #303133;font-size: 15px;margin-left:10px;margin-top:20px;
}
.col{
display: inline-block;
width: 400px;
}
.search{
width:200px;margin-left:20px;margin-top:30px;margin-bottom:20px;
}
.save{
margin-top:30px;margin-bottom:20px;margin-left:40px;
}
.roll{
height:calc(100vh - 282px) ;overflow:hidden;overflow-x: hidden;overflow-y: auto;
}
.tre{
margin-left:20px;
}
}
}
...
@@ -77,7 +32,7 @@
...
@@ -77,7 +32,7 @@
line-height: 1.6;
line-height: 1.6;
font-weight: bold;
font-weight: bold;
word-spacing: 10px;
word-spacing: 10px;
//
height: 100%;
height: 100%;
overflow: auto;
overflow: auto;
}
}
.mpicker-select > div {
.mpicker-select > div {
...
@@ -103,7 +58,7 @@
...
@@ -103,7 +58,7 @@
width: calc(100% - 380px);
width: calc(100% - 380px);
.pickupviewpanel {
.pickupviewpanel {
width: 100%;
width: 100%;
//
height: 100%;
height: 100%;
}
}
}
}
}
}
...
@@ -111,7 +66,3 @@
...
@@ -111,7 +66,3 @@
height: 64px;
height: 64px;
}
}
}
}
\ No newline at end of file
// this is less
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.vue
浏览文件 @
75ee22f3
<
template
>
<div
class=
"view-container dempickupview sys-permissionmpickup-view"
>
<card
class=
'view-card view-no-caption view-no-toolbar'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<div
class=
"content-container pickup-view"
>
<div
class=
"translate-contant"
>
<!--应用菜单-->
<div
class=
"center"
:style=
"
{width : '33%',border:'0px solid red' }">
<context-menu-container
class=
'design-tree-container'
>
<div>
<div
class=
"text"
>
应用菜单
</div>
<div
class=
"roll"
>
<el-tree
class=
"tre"
:data=
"this.CDdata"
ref=
"CDtree"
show-checkbox
node-key=
"id"
:default-expand-all=
"false"
highlight-current
:props=
"this.defaultProps"
@
check-change=
"handleCheckChange"
>
</el-tree>
</div>
</div>
</context-menu-container>
</div>
<!--数据能力-->
<div
class=
"center"
:style=
"
{width : '33%',border:'0px solid red' }">
<context-menu-container
class=
'design-tree-container'
>
<div>
<div
class=
"text"
>
数据能力
</div>
<div
class=
"roll"
>
<el-tree
class=
"tre"
:data=
"this.QXdata"
ref=
"QXtree"
show-checkbox
node-key=
"id"
:default-expand-all=
"false"
highlight-current
:props=
"this.defaultProps"
@
check-change=
"handleCheckChange"
>
</el-tree>
</div>
</div>
</context-menu-container>
</div>
<!--统一资源-->
<div
class=
"center"
:style=
"
{width : '33%',border:'0px solid red' }">
<context-menu-container
class=
'design-tree-container'
>
<div>
<div
class=
"text"
>
统一资源
</div>
<div
class=
"roll"
>
<el-tree
class=
"tre"
:data=
"this.ZYdata"
ref=
"ZYtree"
show-checkbox
node-key=
"id"
:default-expand-all=
"false"
highlight-current
:props=
"this.defaultProps"
@
check-change=
"handleCheckChange"
>
</el-tree>
</div>
</div>
</context-menu-container>
</div>
</div>
<div>
<!--操作按钮-->
<card
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<row
:style=
"
{ textAlign: 'right',border:'0px solid red' }">
<i-button
type=
"primary"
:disabled=
"this.selectData.length > 0 ? false : true"
@
click=
"onClickOk"
>
{{
this
.
containerModel
.
view_okbtn
.
text
}}
</i-button>
<i-button
@
click=
"onClickCancel"
>
{{
this
.
containerModel
.
view_cancelbtn
.
text
}}
</i-button>
</row>
</card>
</div>
</div>
</card>
</div>
</
template
>
<
script
lang=
'tsx'
>
<
script
lang=
'tsx'
>
import
{
Component
,
Vue
}
from
'vue-property-decorator'
;
import
{
Component
}
from
'vue-property-decorator'
;
import
view_pickupviewpanel
import
SYS_PERMISSIONMPickupViewBase
from
'./sys-permissionmpickup-view-base.vue'
;
from
'@widgets/sys-permission/mpickup-viewpickupviewpanel-pickupviewpanel/mpickup-viewpickupviewpanel-pickupviewpanel.vue'
;
import
ContextMenuContainer
from
"@components/context-menu-container/context-menu-container.vue"
;
import
view_pickupviewpanel
from
'@widgets/sys-permission/mpickup-viewpickupviewpanel-pickupviewpanel/mpickup-viewpickupviewpanel-pickupviewpanel.vue'
;
@
Component
({
@
Component
({
components
:
{
components
:
{
ContextMenuContainer
,
view_pickupviewpanel
,
view_pickupviewpanel
,
},
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
});
});
},
},
})
})
export
default
class
SYS_PERMISSIONMPickupView
extends
Vue
{
export
default
class
SYS_PERMISSIONMPickupView
extends
SYS_PERMISSIONMPickupViewBase
{
/*应用菜单数据*/
protected
CDdata
:
any
=
[];
/*数据能力数据*/
protected
QXdata
:
any
=
[];
/*统一资源数据*/
protected
ZYdata
:
any
=
[];
/*默认选中节点*/
protected
defaultCheckedNodes
:
any
=
[];
/**
* 树显示说明:子树为节点对象的children,节点标签为节点对象的label
*/
protected
defaultProps
:
any
=
{
children
:
'children'
,
label
:
'label'
}
/**
* 选中数据
*/
protected
selectData
:
any
=
{};
/**
* 初始选中的数据
*/
protected
ininselectData
:
any
=
{};
/**
* 视图选中数据
*/
public
viewSelections
:
any
[]
=
[];
/**
* 父数据
*/
protected
parentData
:
any
=
{};
/**
* 父数据主键
*/
protected
srfparentkey
:
any
;
/**
* vue 创建
*/
public
created
()
{
const
_this
:
any
=
this
;
// 获取父数据
if
(
_this
.
$attrs
&&
_this
.
$attrs
.
viewdata
)
{
_this
.
parentData
=
JSON
.
parse
(
_this
.
$attrs
.
viewdata
);
}
if
(
_this
.
parentData
&&
_this
.
parentData
.
srfparentkey
)
{
// console.log("父主键:" + _this.parentData.srfparentkey);
_this
.
srfparentkey
=
_this
.
parentData
.
srfparentkey
;
}
}
/**
* vue 挂载
*/
public
mounted
()
{
this
.
initTree
();
}
/**
* 初始化树
*/
private
initTree
()
{
const
_this
=
this
;
// get全部菜单和数据能力和统一资源的请求路径
const
url
=
`sys_permissions/getallMenuAndPermissionAndUnires?roleid=`
+
_this
.
srfparentkey
;
this
.
$http
.
get
(
url
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
return
;
}
else
{
// 给树赋值,数据结构在后台已经按照eltree格式化
_this
.
CDdata
=
response
.
data
[
0
];
_this
.
QXdata
=
response
.
data
[
1
];
_this
.
ZYdata
=
response
.
data
[
2
];
_this
.
defaultCheckedNodes
=
response
.
data
[
3
];
// 设置默认选中节点,即当前角色所有权限
this
.
$nextTick
(()
=>
{
const
CDtree
:
any
=
this
.
$refs
.
CDtree
;
const
QXtree
:
any
=
this
.
$refs
.
QXtree
;
const
ZYtree
:
any
=
this
.
$refs
.
ZYtree
;
CDtree
.
setCheckedNodes
(
_this
.
defaultCheckedNodes
);
QXtree
.
setCheckedNodes
(
_this
.
defaultCheckedNodes
);
ZYtree
.
setCheckedNodes
(
_this
.
defaultCheckedNodes
);
// 保存初始选中的节点数据,便于后续保存时比较
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
()).
concat
(
ZYtree
.
getCheckedNodes
());
this
.
ininselectData
=
arr
;
});
}
}).
catch
((
e
)
=>
{
console
.
log
(
e
);
});
}
/**
* 处理选中节点
*/
protected
handleCheckChange
()
{
// console.log("SYS_PERMISSIONMPickupView执行了handleCheckChange")
// 获取当前三棵树
const
CDtree
:
any
=
this
.
$refs
.
CDtree
;
const
QXtree
:
any
=
this
.
$refs
.
QXtree
;
const
ZYtree
:
any
=
this
.
$refs
.
ZYtree
;
// 获取选中状态的节点
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
()).
concat
(
ZYtree
.
getCheckedNodes
());
this
.
selectData
=
arr
;
// console.log("选中的node:" + JSON.stringify(this.selectData));
}
/**
* 容器模型
*/
public
containerModel
:
any
=
{
view_okbtn
:
{
name
:
'okbtn'
,
type
:
'button'
,
text
:
'确定'
,
disabled
:
true
},
view_cancelbtn
:
{
name
:
'cancelbtn'
,
type
:
'button'
,
text
:
'取消'
,
disabled
:
false
},
};
/**
* 确定
*/
public
onClickOk
():
void
{
// 处理选中的数据
if
(
this
.
selectData
&&
this
.
selectData
.
length
>
0
)
{
// 判断选中的数据和初始数据
if
(
JSON
.
stringify
(
this
.
selectData
)
==
JSON
.
stringify
(
this
.
ininselectData
))
{
this
.
$emit
(
'close'
,
null
);
return
;
}
// 先删除当前角色的所有角色权限关系
const
url
=
`sys_permissions/deleteRolePermissionByRoleid`
;
const
param
=
{
roleid
:
this
.
srfparentkey
};
this
.
$http
.
post
(
url
,
param
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
return
;
}
else
{
// 再重新添加新选中的权限
this
.
selectData
.
forEach
((
item
:
any
)
=>
{
let
_itemTemp
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
let
_item
:
any
=
{};
if
(
_itemTemp
.
sys_permissionId
)
{
// 应用菜单
_item
.
srfdataaccaction
=
_itemTemp
.
sys_permissionId
;
_item
.
srfkey
=
_itemTemp
.
sys_permissionId
;
_item
.
sys_permission
=
_itemTemp
.
sys_permissionId
;
_item
.
sys_permissionid
=
_itemTemp
.
sys_permissionId
;
_item
.
srfmajortext
=
_itemTemp
.
label
;
_item
.
sys_permissionname
=
_itemTemp
.
label
;
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
}
else
{
if
(
!
_itemTemp
.
children
)
{
// 数据能力或者统一资源
_item
.
srfdataaccaction
=
_itemTemp
.
id
;
_item
.
srfkey
=
_itemTemp
.
id
;
_item
.
sys_permission
=
_itemTemp
.
id
;
_item
.
sys_permissionid
=
_itemTemp
.
id
;
_item
.
srfmajortext
=
_itemTemp
.
label
;
_item
.
sys_permissionname
=
_itemTemp
.
label
;
Object
.
assign
(
_item
,
{
_select
:
false
})
this
.
viewSelections
.
push
(
_item
);
}
}
});
// 交给viewdataschange进行后续保存进库操作
this
.
$emit
(
'viewdataschange'
,
this
.
viewSelections
);
this
.
$emit
(
'close'
,
null
);
}
}).
catch
((
e
)
=>
{
console
.
log
(
e
);
});
}
else
{
this
.
$emit
(
'close'
,
null
);
}
}
/**
* 取消
*/
public
onClickCancel
():
void
{
this
.
$emit
(
'close'
,
null
);
}
}
}
</
script
>
</
script
>
\ No newline at end of file
<
style
lang=
'less'
>
@import './sys-permissionmpickup-view.less';
</
style
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录