Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
7c623fe8
提交
7c623fe8
编写于
5月 22, 2020
作者:
laizhilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
父页面表单保存时保存当前嵌入视图数据
上级
524cd943
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
235 行增加
和
19 行删除
+235
-19
sys-role-permissioncustom-view.less
...permissioncustom-view/sys-role-permissioncustom-view.less
+2
-4
sys-role-permissioncustom-view.vue
...-permissioncustom-view/sys-role-permissioncustom-view.vue
+233
-15
未找到文件。
app_web/src/pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.less
浏览文件 @
7c623fe8
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
margin-top:30px;margin-bottom:20px;margin-left:40px;
margin-top:30px;margin-bottom:20px;margin-left:40px;
}
}
.roll{
.roll{
height:calc(100vh - 3
6
5px) ;overflow:hidden;overflow-x: hidden;overflow-y: auto;
height:calc(100vh - 3
0
5px) ;overflow:hidden;overflow-x: hidden;overflow-y: auto;
}
}
.tre{
.tre{
margin-left:20px;
margin-left:20px;
...
@@ -108,9 +108,7 @@
...
@@ -108,9 +108,7 @@
}
}
}
}
}
}
>.footer {
height: 64px;
}
}
}
...
...
app_web/src/pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue
浏览文件 @
7c623fe8
...
@@ -73,26 +73,18 @@
...
@@ -73,26 +73,18 @@
</context-menu-container>
</context-menu-container>
</div>
</div>
</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>
</row>
</card>
</div>
</div>
</div>
</card>
</card>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
'tsx'
>
<
script
lang=
'tsx'
>
import
{
Component
,
Vue
}
from
'vue-property-decorator'
;
import
{
Component
,
Prop
,
Vue
}
from
'vue-property-decorator'
;
import
view_pickupviewpanel
import
view_pickupviewpanel
from
'@widgets/sys-permission/mpickup-viewpickupviewpanel-pickupviewpanel/mpickup-viewpickupviewpanel-pickupviewpanel.vue'
;
from
'@widgets/sys-permission/mpickup-viewpickupviewpanel-pickupviewpanel/mpickup-viewpickupviewpanel-pickupviewpanel.vue'
;
import
ContextMenuContainer
from
"@components/context-menu-container/context-menu-container.vue"
;
import
ContextMenuContainer
from
"@components/context-menu-container/context-menu-container.vue"
;
import
{
Subject
}
from
"rxjs"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
...
@@ -153,21 +145,236 @@
...
@@ -153,21 +145,236 @@
*/
*/
protected
srfparentkey
:
any
;
protected
srfparentkey
:
any
;
/**
* 视图标识
*
* @type {string}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
viewtag
:
string
=
'e791be173ed0f4bbe9cce942b6edde63'
;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof SYS_USER_ROLEGridViewBase
*/
@
Prop
({
default
:
false
})
public
isformDruipart
?:
boolean
;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof SYS_USER_ROLEGridViewBase
*/
@
Prop
()
public
formDruipart
?:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
viewparams
:
any
=
{};
/**
* 传入视图上下文
*
* @type {string}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
customViewNavContexts
:
any
=
{};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
customViewParams
:
any
=
{};
/**
* 解析视图参数
*
* @public
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
parseViewParam
():
void
{
for
(
let
key
in
this
.
context
){
delete
this
.
context
[
key
];
}
if
(
!
this
.
viewDefaultUsage
&&
this
.
viewdata
&&
!
Object
.
is
(
this
.
viewdata
,
''
))
{
Object
.
assign
(
this
.
context
,
JSON
.
parse
(
this
.
viewdata
));
if
(
this
.
context
&&
this
.
context
.
srfparentdename
){
Object
.
assign
(
this
.
viewparams
,{
srfparentdename
:
this
.
context
.
srfparentdename
});
}
if
(
this
.
context
&&
this
.
context
.
srfparentkey
){
Object
.
assign
(
this
.
viewparams
,{
srfparentkey
:
this
.
context
.
srfparentkey
});
}
this
.
handleCustomViewData
();
return
;
}
const
path
=
(
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
]).
path
;
const
keys
:
Array
<
any
>
=
[];
const
curReg
=
this
.
$pathToRegExp
.
pathToRegexp
(
path
,
keys
);
const
matchArray
=
curReg
.
exec
(
this
.
$route
.
path
);
let
tempValue
:
Object
=
{};
keys
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
.
name
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
this
.
$viewTool
.
formatRouteParams
(
tempValue
,
this
.
$route
,
this
.
context
,
this
.
viewparams
);
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
//初始化视图唯一标识
Object
.
assign
(
this
.
context
,{
srfsessionid
:
this
.
$util
.
createUUID
()});
this
.
handleCustomViewData
();
}
/**
* 处理自定义视图数据
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
handleCustomViewData
(){
if
(
Object
.
keys
(
this
.
customViewNavContexts
).
length
>
0
){
Object
.
keys
(
this
.
customViewNavContexts
).
forEach
((
item
:
any
)
=>
{
let
tempContext
:
any
=
{};
let
curNavContext
:
any
=
this
.
customViewNavContexts
[
item
];
this
.
handleCustomDataLogic
(
curNavContext
,
tempContext
,
item
);
Object
.
assign
(
this
.
context
,
tempContext
);
})
}
if
(
Object
.
keys
(
this
.
customViewParams
).
length
>
0
){
Object
.
keys
(
this
.
customViewParams
).
forEach
((
item
:
any
)
=>
{
let
tempParam
:
any
=
{};
let
curNavParam
:
any
=
this
.
customViewParams
[
item
];
this
.
handleCustomDataLogic
(
curNavParam
,
tempParam
,
item
);
Object
.
assign
(
this
.
viewparams
,
tempParam
);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
handleCustomDataLogic
(
curNavData
:
any
,
tempData
:
any
,
item
:
string
){
// 直接值直接赋值
if
(
curNavData
.
isRawValue
){
if
(
Object
.
is
(
curNavData
.
value
,
"null"
)
||
Object
.
is
(
curNavData
.
value
,
""
)){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
curNavData
.
value
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
}
}
/**
/**
* vue 创建
* vue 创建
*/
*/
public
created
()
{
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof SYS_USER_ROLEGridViewBase
*/
public
afterCreated
(){
const
secondtag
=
this
.
$util
.
createUUID
();
this
.
$store
.
commit
(
'viewaction/createdView'
,
{
viewtag
:
this
.
viewtag
,
secondtag
:
secondtag
});
this
.
viewtag
=
secondtag
;
this
.
parseViewParam
();
const
_this
:
any
=
this
;
const
_this
:
any
=
this
;
// 获取父数据
// 获取父数据
if
(
_this
.
$attrs
&&
_this
.
$attr
s
.
viewdata
)
{
if
(
_this
&&
_thi
s
.
viewdata
)
{
_this
.
parentData
=
JSON
.
parse
(
_this
.
$attrs
.
viewdata
);
_this
.
parentData
=
JSON
.
parse
(
_this
.
viewdata
);
}
}
if
(
_this
.
parentData
&&
_this
.
parentData
.
sys_role
)
{
if
(
_this
.
parentData
&&
_this
.
parentData
.
sys_role
)
{
console
.
log
(
"当前角色id:"
+
_this
.
parentData
.
sys_role
);
//
console.log("当前角色id:" + _this.parentData.sys_role);
_this
.
srfparentkey
=
_this
.
parentData
.
sys_role
;
_this
.
srfparentkey
=
_this
.
parentData
.
sys_role
;
}
}
// 监听父页面
if
(
this
.
formDruipart
){
this
.
formDruipart
.
subscribe
((
res
:
any
)
=>
{
if
(
Object
.
is
(
res
.
action
,
'load'
)){
// 父数据保存时调用当前视图的点击确定事件
if
(
this
.
selectData
.
length
>
0
){
this
.
onClickOk
();
}
}
});
}
}
}
/**
/**
* vue 挂载
* vue 挂载
*/
*/
...
@@ -226,6 +433,16 @@
...
@@ -226,6 +433,16 @@
});
});
}
}
/**
* 销毁之前
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
/**
* 处理选中节点
* 处理选中节点
*/
*/
...
@@ -299,7 +516,8 @@
...
@@ -299,7 +516,8 @@
Object
.
assign
(
param
,{
roleid
:
this
.
srfparentkey
,
checkedNodes
:
this
.
viewSelections
});
Object
.
assign
(
param
,{
roleid
:
this
.
srfparentkey
,
checkedNodes
:
this
.
viewSelections
});
this
.
$http
.
post
(
url
,
param
).
then
((
response
:
any
)
=>
{
this
.
$http
.
post
(
url
,
param
).
then
((
response
:
any
)
=>
{
if
(
!
(
!
response
||
response
.
status
!==
200
))
{
if
(
!
(
!
response
||
response
.
status
!==
200
))
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
'操作成功!'
});
// 选中节点多,执行时间长,因此不需要success提示
// this.$Notice.success({title: '', desc: '保存权限成功!'});
}
else
{
}
else
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
return
;
return
;
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录