Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
de488c56
提交
de488c56
编写于
8月 25, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决表单动态隐藏和权限控制冲突问题
上级
54d26ae9
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
62 行增加
和
6 行删除
+62
-6
form-button.ts
src/model/form-detail/form-button.ts
+24
-2
form-detail.ts
src/model/form-detail/form-detail.ts
+34
-3
view-tool.ts
src/utils/view-tool/view-tool.ts
+4
-1
未找到文件。
src/model/form-detail/form-button.ts
浏览文件 @
de488c56
...
...
@@ -11,7 +11,7 @@ export class FormButtonModel extends FormDetailModel {
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
disabled
=
opts
.
disabled
;
this
.
$
disabled
=
opts
.
disabled
;
this
.
uiaction
=
opts
.
uiaction
;
}
...
...
@@ -21,7 +21,7 @@ export class FormButtonModel extends FormDetailModel {
* @type {boolean}
* @memberof FormButtonModel
*/
p
ublic
disabled
:
boolean
=
false
;
p
rivate
$
disabled
:
boolean
=
false
;
/**
* 按钮对应的界面行为
...
...
@@ -31,4 +31,26 @@ export class FormButtonModel extends FormDetailModel {
*/
public
uiaction
:
any
;
/**
* 是否启用
*
* @type {boolean}
* @memberof FormButtonModel
*/
public
get
disabled
():
boolean
{
return
this
.
$disabled
;
}
/**
* 设置是否启用
*
* @memberof FormButtonModel
*/
public
set
disabled
(
val
:
boolean
)
{
if
(
this
.
isPower
)
{
this
.
$disabled
=
val
;
}
}
}
\ No newline at end of file
src/model/form-detail/form-detail.ts
浏览文件 @
de488c56
...
...
@@ -6,6 +6,14 @@
*/
export
class
FormDetailModel
{
/**
* 是否有权限
*
* @type {boolean}
* @memberof FormDetailModel
*/
public
isPower
:
boolean
=
true
;
/**
* 成员标题
*
...
...
@@ -44,7 +52,7 @@ export class FormDetailModel {
* @type {boolean}
* @memberof FormDetailModel
*/
public
visible
:
boolean
=
true
;
public
$
visible
:
boolean
=
true
;
/**
* 成员是否显示(旧)
...
...
@@ -83,12 +91,33 @@ export class FormDetailModel {
this
.
detailType
=
!
Object
.
is
(
opts
.
detailType
,
''
)
?
opts
.
detailType
:
''
;
this
.
form
=
opts
.
form
?
opts
.
form
:
{};
this
.
name
=
!
Object
.
is
(
opts
.
name
,
''
)
?
opts
.
name
:
''
;
this
.
visible
=
opts
.
visible
?
true
:
false
;
this
.
$
visible
=
opts
.
visible
?
true
:
false
;
this
.
oldVisible
=
opts
.
visible
?
true
:
false
;
this
.
isShowCaption
=
opts
.
isShowCaption
?
true
:
false
;
this
.
isControlledContent
=
opts
.
isControlledContent
?
true
:
false
;
}
/**
* 设置成员是否隐藏
*
* @memberof FormDetailModel
*/
public
set
visible
(
val
:
boolean
)
{
if
(
this
.
isPower
)
{
this
.
$visible
=
val
;
}
}
/**
* 获取成员是否隐藏
*
* @memberof FormDetailModel
*/
public
get
visible
()
{
return
this
.
$visible
;
}
/**
* 设置显示与隐藏
*
...
...
@@ -96,7 +125,9 @@ export class FormDetailModel {
* @memberof FormDetailModel
*/
public
setVisible
(
state
:
boolean
):
void
{
this
.
visible
=
state
;
if
(
this
.
isPower
)
{
this
.
visible
=
state
;
}
}
/**
...
...
src/utils/view-tool/view-tool.ts
浏览文件 @
de488c56
...
...
@@ -252,9 +252,10 @@ export class ViewTool {
* @memberof ViewTool
*/
public
static
calcActionItemAuthState
(
data
:
any
,
ActionModel
:
any
,
UIService
:
any
){
let
result
:
any
[]
=
[];
for
(
const
key
in
ActionModel
)
{
if
(
!
ActionModel
.
hasOwnProperty
(
key
))
{
return
;
return
result
;
}
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
){
...
...
@@ -282,7 +283,9 @@ export class ViewTool {
_item
.
visabled
=
true
;
_item
.
disabled
=
false
;
}
result
.
push
(
dataActionResult
);
}
}
return
result
;
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录