Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzrt
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzrt
提交
0d279c66
提交
0d279c66
编写于
5月 27, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_qyk 发布系统代码
上级
90138f50
变更
57
隐藏空白字符变更
内嵌
并排
正在显示
57 个修改的文件
包含
9626 行增加
和
32 行删除
+9626
-32
data-dictionary.json
app_Web/public/assets/json/data-dictionary.json
+60
-0
view-config.json
app_Web/public/assets/json/view-config.json
+16
-0
en-US.ts
app_Web/src/locale/lang/en-US.ts
+10
-1
zh-CN.ts
app_Web/src/locale/lang/zh-CN.ts
+10
-1
codelist_en_US.ts
app_Web/src/locale/lanres/codelist/codelist_en_US.ts
+8
-0
codelist_zh_CN.ts
app_Web/src/locale/lanres/codelist/codelist_zh_CN.ts
+8
-0
sys-auth-log_en_US.ts
app_Web/src/locale/lanres/sys-auth-log/sys-auth-log_en_US.ts
+47
-0
sys-auth-log_zh_CN.ts
app_Web/src/locale/lanres/sys-auth-log/sys-auth-log_zh_CN.ts
+46
-0
wfremodel_en_US.ts
app_Web/src/locale/lanres/wfremodel/wfremodel_en_US.ts
+37
-0
wfremodel_zh_CN.ts
app_Web/src/locale/lanres/wfremodel/wfremodel_zh_CN.ts
+36
-0
index-appmenu.ts
app_Web/src/mock/app/index-appmenu/index-appmenu.ts
+110
-14
codelist.ts
app_Web/src/mock/codelist/codelist.ts
+60
-0
sys-auth-logs.ts
app_Web/src/mock/entity/sys-auth-logs/sys-auth-logs.ts
+380
-0
wfremodels.ts
app_Web/src/mock/entity/wfremodels/wfremodels.ts
+380
-0
index.ts
app_Web/src/mock/index.ts
+2
-0
viewconfig.ts
app_Web/src/mock/viewconfig/viewconfig.ts
+16
-0
page-register.ts
app_Web/src/pages/rt/index/page-register.ts
+2
-0
router.ts
app_Web/src/pages/rt/index/router.ts
+50
-0
sys-auth-log-grid-view-base.vue
...aa/sys-auth-log-grid-view/sys-auth-log-grid-view-base.vue
+768
-0
sys-auth-log-grid-view.less
...es/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.less
+5
-0
sys-auth-log-grid-view.vue
...ges/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.vue
+21
-0
wfremodel-edit-view-base.vue
...workflow/wfremodel-edit-view/wfremodel-edit-view-base.vue
+617
-0
wfremodel-edit-view.less
...ges/workflow/wfremodel-edit-view/wfremodel-edit-view.less
+26
-0
wfremodel-edit-view.vue
...ages/workflow/wfremodel-edit-view/wfremodel-edit-view.vue
+19
-0
entity-service-register.ts
app_Web/src/service/entity-service-register.ts
+2
-0
sys-auth-log-service-base.ts
...Web/src/service/sys-auth-log/sys-auth-log-service-base.ts
+179
-0
sys-auth-log-service.ts
app_Web/src/service/sys-auth-log/sys-auth-log-service.ts
+25
-0
wfremodel-service-base.ts
app_Web/src/service/wfremodel/wfremodel-service-base.ts
+179
-0
wfremodel-service.ts
app_Web/src/service/wfremodel/wfremodel-service.ts
+25
-0
state.ts
app_Web/src/store/modules/view-action/state.ts
+20
-0
sys-auth-log-ui-service-base.ts
...rc/uiservice/sys-auth-log/sys-auth-log-ui-service-base.ts
+211
-0
sys-auth-log-ui-service.ts
...Web/src/uiservice/sys-auth-log/sys-auth-log-ui-service.ts
+21
-0
ui-service-register.ts
app_Web/src/uiservice/ui-service-register.ts
+2
-0
wfremodel-ui-service-base.ts
app_Web/src/uiservice/wfremodel/wfremodel-ui-service-base.ts
+211
-0
wfremodel-ui-service.ts
app_Web/src/uiservice/wfremodel/wfremodel-ui-service.ts
+21
-0
index-appmenu-base.vue
app_Web/src/widgets/app/index-appmenu/index-appmenu-base.vue
+43
-1
index-appmenu-model.ts
app_Web/src/widgets/app/index-appmenu/index-appmenu-model.ts
+110
-14
default-searchform-base.vue
...s-auth-log/default-searchform/default-searchform-base.vue
+871
-0
default-searchform-model.ts
...s-auth-log/default-searchform/default-searchform-model.ts
+61
-0
default-searchform-service.ts
...auth-log/default-searchform/default-searchform-service.ts
+371
-0
default-searchform.less
...s/sys-auth-log/default-searchform/default-searchform.less
+47
-0
default-searchform.vue
...ts/sys-auth-log/default-searchform/default-searchform.vue
+14
-0
main-grid-base.vue
...Web/src/widgets/sys-auth-log/main-grid/main-grid-base.vue
+1524
-0
main-grid-model.ts
...Web/src/widgets/sys-auth-log/main-grid/main-grid-model.ts
+149
-0
main-grid-service.ts
...b/src/widgets/sys-auth-log/main-grid/main-grid-service.ts
+318
-0
main-grid.less
app_Web/src/widgets/sys-auth-log/main-grid/main-grid.less
+95
-0
main-grid.vue
app_Web/src/widgets/sys-auth-log/main-grid/main-grid.vue
+14
-0
main-form-base.vue
app_Web/src/widgets/wfremodel/main-form/main-form-base.vue
+1524
-0
main-form-model.ts
app_Web/src/widgets/wfremodel/main-form/main-form-model.ts
+71
-0
main-form-service.ts
app_Web/src/widgets/wfremodel/main-form/main-form-service.ts
+371
-0
main-form.less
app_Web/src/widgets/wfremodel/main-form/main-form.less
+49
-0
main-form.vue
app_Web/src/widgets/wfremodel/main-form/main-form.vue
+14
-0
application-web-prod.yml
...ibzrt-app-web/src/main/resources/application-web-prod.yml
+8
-0
systemResource.json
ibzrt-core/src/main/resources/permission/systemResource.json
+17
-1
SysAuthLogDTO.java
...r-api/src/main/java/cn/ibizlab/api/dto/SysAuthLogDTO.java
+158
-0
SysAuthLogMapping.java
...c/main/java/cn/ibizlab/api/mapping/SysAuthLogMapping.java
+16
-0
SysAuthLogResource.java
...src/main/java/cn/ibizlab/api/rest/SysAuthLogResource.java
+151
-0
未找到文件。
app_Web/public/assets/json/data-dictionary.json
浏览文件 @
0d279c66
...
...
@@ -59,6 +59,66 @@
"codename"
:
"Item_3"
,
"value"
:
"性别不详"
,
"disabled"
:
false
}
]
},
{
"srfkey"
:
"CLAuthCode"
,
"emptytext"
:
"未定义"
,
"codelisttype"
:
"static"
,
"items"
:
[
{
"id"
:
"200"
,
"label"
:
"成功"
,
"text"
:
"成功"
,
"data"
:
""
,
"codename"
:
"Item_200"
,
"color"
:
"rgba(0, 255, 0, 0)"
,
"value"
:
"200"
,
"disabled"
:
false
}
,
{
"id"
:
"400"
,
"label"
:
"用户不存在"
,
"text"
:
"用户不存在"
,
"data"
:
""
,
"codename"
:
"Item_400"
,
"value"
:
"400"
,
"disabled"
:
false
}
,
{
"id"
:
"401.1"
,
"label"
:
"密码错误"
,
"text"
:
"密码错误"
,
"data"
:
""
,
"codename"
:
"Item_3"
,
"value"
:
"401.1"
,
"disabled"
:
false
}
,
{
"id"
:
"401.2"
,
"label"
:
"配置错误"
,
"text"
:
"配置错误"
,
"data"
:
""
,
"codename"
:
"Item_4"
,
"color"
:
"rgba(22, 9, 170, 1)"
,
"value"
:
"401.2"
,
"disabled"
:
false
}
,
{
"id"
:
"403.6"
,
"label"
:
"地址被拒绝"
,
"text"
:
"地址被拒绝"
,
"data"
:
""
,
"codename"
:
"Item_5"
,
"color"
:
"rgba(0, 72, 255, 1)"
,
"value"
:
"403.6"
,
"disabled"
:
false
}
]
...
...
app_Web/public/assets/json/view-config.json
浏览文件 @
0d279c66
...
...
@@ -31,6 +31,14 @@
"viewname"
:
"SYS_ROLEGridView"
,
"viewtag"
:
"13c174556f45e9b10b66dc51834a6ab5"
},
"sysauthloggridview"
:
{
"title"
:
"认证日志表格视图"
,
"caption"
:
"认证日志"
,
"viewtype"
:
"DEGRIDVIEW"
,
"viewmodule"
:
"uaa"
,
"viewname"
:
"SysAuthLogGridView"
,
"viewtag"
:
"255944d6d1a575d0eda2b68bc19314f3"
},
"sysrolepickupview"
:
{
"title"
:
"角色数据选择视图"
,
"caption"
:
"系统角色"
,
...
...
@@ -71,6 +79,14 @@
"viewname"
:
"IBZEmployeeGridView"
,
"viewtag"
:
"40fe6b28b9f7902341da46bb74a02d59"
},
"wfremodeleditview"
:
{
"title"
:
"流程模型编辑视图"
,
"caption"
:
"流程模型"
,
"viewtype"
:
"DEEDITVIEW"
,
"viewmodule"
:
"workflow"
,
"viewname"
:
"WFREModelEditView"
,
"viewtag"
:
"5856bfb8b576cc2ee743801b23e58299"
},
"ibzdeptmembergridview"
:
{
"title"
:
"部门成员表格视图"
,
"caption"
:
"部门成员"
,
...
...
app_Web/src/locale/lang/en-US.ts
浏览文件 @
0d279c66
import
sysrolepermission_en_US
from
'@locale/lanres/sys-role-permission/sys-role-permission_en_US'
;
import
sysuser_en_US
from
'@locale/lanres/sys-user/sys-user_en_US'
;
import
sysauthlog_en_US
from
'@locale/lanres/sys-auth-log/sys-auth-log_en_US'
;
import
wfmember_en_US
from
'@locale/lanres/wfmember/wfmember_en_US'
;
import
wfuser_en_US
from
'@locale/lanres/wfuser/wfuser_en_US'
;
import
ibzorganization_en_US
from
'@locale/lanres/ibzorganization/ibzorganization_en_US'
;
import
wfgroup_en_US
from
'@locale/lanres/wfgroup/wfgroup_en_US'
;
import
wfremodel_en_US
from
'@locale/lanres/wfremodel/wfremodel_en_US'
;
import
sysuserrole_en_US
from
'@locale/lanres/sys-user-role/sys-user-role_en_US'
;
import
wfprocessdefinition_en_US
from
'@locale/lanres/wfprocess-definition/wfprocess-definition_en_US'
;
import
sysrole_en_US
from
'@locale/lanres/sys-role/sys-role_en_US'
;
...
...
@@ -67,22 +69,29 @@ export default {
},
menus
:
{
index
:
{
menuitem7
:
'组织部门管理'
,
menuitem1
:
'单位管理'
,
menuitem2
:
'部门管理'
,
menuitem3
:
'人员管理'
,
menuitem8
:
'权限管理'
,
menuitem4
:
'用户角色'
,
menuitem5
:
'流程角色'
,
menuitem9
:
'认证日志'
,
menuitem10
:
'流程管理'
,
menuitem6
:
'流程定义'
,
menuitem5
:
'流程角色'
,
menuitem11
:
'发布新流程'
,
},
},
},
entities
:
{
sysrolepermission
:
sysrolepermission_en_US
,
sysuser
:
sysuser_en_US
,
sysauthlog
:
sysauthlog_en_US
,
wfmember
:
wfmember_en_US
,
wfuser
:
wfuser_en_US
,
ibzorganization
:
ibzorganization_en_US
,
wfgroup
:
wfgroup_en_US
,
wfremodel
:
wfremodel_en_US
,
sysuserrole
:
sysuserrole_en_US
,
wfprocessdefinition
:
wfprocessdefinition_en_US
,
sysrole
:
sysrole_en_US
,
...
...
app_Web/src/locale/lang/zh-CN.ts
浏览文件 @
0d279c66
import
sysrolepermission_zh_CN
from
'@locale/lanres/sys-role-permission/sys-role-permission_zh_CN'
;
import
sysuser_zh_CN
from
'@locale/lanres/sys-user/sys-user_zh_CN'
;
import
sysauthlog_zh_CN
from
'@locale/lanres/sys-auth-log/sys-auth-log_zh_CN'
;
import
wfmember_zh_CN
from
'@locale/lanres/wfmember/wfmember_zh_CN'
;
import
wfuser_zh_CN
from
'@locale/lanres/wfuser/wfuser_zh_CN'
;
import
ibzorganization_zh_CN
from
'@locale/lanres/ibzorganization/ibzorganization_zh_CN'
;
import
wfgroup_zh_CN
from
'@locale/lanres/wfgroup/wfgroup_zh_CN'
;
import
wfremodel_zh_CN
from
'@locale/lanres/wfremodel/wfremodel_zh_CN'
;
import
sysuserrole_zh_CN
from
'@locale/lanres/sys-user-role/sys-user-role_zh_CN'
;
import
wfprocessdefinition_zh_CN
from
'@locale/lanres/wfprocess-definition/wfprocess-definition_zh_CN'
;
import
sysrole_zh_CN
from
'@locale/lanres/sys-role/sys-role_zh_CN'
;
...
...
@@ -67,22 +69,29 @@ export default {
},
menus
:
{
index
:
{
menuitem7
:
'组织部门管理'
,
menuitem1
:
'单位管理'
,
menuitem2
:
'部门管理'
,
menuitem3
:
'人员管理'
,
menuitem8
:
'权限管理'
,
menuitem4
:
'用户角色'
,
menuitem5
:
'流程角色'
,
menuitem9
:
'认证日志'
,
menuitem10
:
'流程管理'
,
menuitem6
:
'流程定义'
,
menuitem5
:
'流程角色'
,
menuitem11
:
'发布新流程'
,
},
},
},
entities
:
{
sysrolepermission
:
sysrolepermission_zh_CN
,
sysuser
:
sysuser_zh_CN
,
sysauthlog
:
sysauthlog_zh_CN
,
wfmember
:
wfmember_zh_CN
,
wfuser
:
wfuser_zh_CN
,
ibzorganization
:
ibzorganization_zh_CN
,
wfgroup
:
wfgroup_zh_CN
,
wfremodel
:
wfremodel_zh_CN
,
sysuserrole
:
sysuserrole_zh_CN
,
wfprocessdefinition
:
wfprocessdefinition_zh_CN
,
sysrole
:
sysrole_zh_CN
,
...
...
app_Web/src/locale/lanres/codelist/codelist_en_US.ts
浏览文件 @
0d279c66
...
...
@@ -10,4 +10,12 @@ export default {
'性别不详'
:
'性别不详'
,
empty
:
''
,
},
CLAuthCode
:
{
'200'
:
'成功'
,
'400'
:
'用户不存在'
,
'401.1'
:
'密码错误'
,
'401.2'
:
'配置错误'
,
'403.6'
:
'地址被拒绝'
,
empty
:
''
,
},
};
\ No newline at end of file
app_Web/src/locale/lanres/codelist/codelist_zh_CN.ts
浏览文件 @
0d279c66
...
...
@@ -10,4 +10,12 @@ export default {
'性别不详'
:
'性别不详'
,
empty
:
''
,
},
CLAuthCode
:
{
'200'
:
'成功'
,
'400'
:
'用户不存在'
,
'401.1'
:
'密码错误'
,
'401.2'
:
'配置错误'
,
'403.6'
:
'地址被拒绝'
,
empty
:
''
,
},
};
\ No newline at end of file
app_Web/src/locale/lanres/sys-auth-log/sys-auth-log_en_US.ts
0 → 100644
浏览文件 @
0d279c66
export
default
{
fields
:
{
logid
:
'标识'
,
username
:
'用户全局名'
,
personname
:
'用户名称'
,
domain
:
'域'
,
authtime
:
'认证时间'
,
ipaddr
:
'IP地址'
,
macaddr
:
'MAC地址'
,
useragent
:
'客户端'
,
authcode
:
'认证结果'
,
},
views
:
{
gridview
:
{
caption
:
"认证日志"
,
title
:
'认证日志'
,
},
},
main_grid
:
{
columns
:
{
username
:
"用户全局名"
,
personname
:
"用户名称"
,
authtime
:
"认证时间"
,
authcode
:
"认证结果"
,
ipaddr
:
"IP地址"
,
macaddr
:
"MAC地址"
,
useragent
:
"客户端"
,
domain
:
"域"
,
},
uiactions
:
{
},
},
default_searchform
:
{
details
:
{
formpage1
:
"常规条件"
,
n_username_like
:
"用户全局名(文本包含(%))"
,
n_personname_like
:
"用户名称(文本包含(%))"
,
n_authcode_eq
:
"认证结果(等于(=))"
,
n_authtime_gtandeq
:
"认证时间(大于等于(>=))"
,
n_authtime_ltandeq
:
"认证时间(小于等于(<=))"
,
n_domain_like
:
"域(文本包含(%))"
,
},
uiactions
:
{
},
},
};
\ No newline at end of file
app_Web/src/locale/lanres/sys-auth-log/sys-auth-log_zh_CN.ts
0 → 100644
浏览文件 @
0d279c66
export
default
{
fields
:
{
logid
:
'标识'
,
username
:
'用户全局名'
,
personname
:
'用户名称'
,
domain
:
'域'
,
authtime
:
'认证时间'
,
ipaddr
:
'IP地址'
,
macaddr
:
'MAC地址'
,
useragent
:
'客户端'
,
authcode
:
'认证结果'
,
},
views
:
{
gridview
:
{
caption
:
'认证日志'
,
title
:
'认证日志'
,
},
},
main_grid
:
{
columns
:
{
username
:
'用户全局名'
,
personname
:
'用户名称'
,
authtime
:
'认证时间'
,
authcode
:
'认证结果'
,
ipaddr
:
'IP地址'
,
macaddr
:
'MAC地址'
,
useragent
:
'客户端'
,
domain
:
'域'
,
},
uiactions
:
{
},
},
default_searchform
:
{
details
:
{
formpage1
:
'常规条件'
,
n_username_like
:
'用户全局名(文本包含(%))'
,
n_personname_like
:
'用户名称(文本包含(%))'
,
n_authcode_eq
:
'认证结果(等于(=))'
,
n_authtime_gtandeq
:
'认证时间(大于等于(>=))'
,
n_authtime_ltandeq
:
'认证时间(小于等于(<=))'
,
n_domain_like
:
'域(文本包含(%))'
,
},
uiactions
:
{
},
},
};
\ No newline at end of file
app_Web/src/locale/lanres/wfremodel/wfremodel_en_US.ts
0 → 100644
浏览文件 @
0d279c66
export
default
{
fields
:
{
id
:
'ID'
,
name
:
'名称'
,
bpmnfile
:
'BPMN'
,
},
views
:
{
editview
:
{
caption
:
"流程模型"
,
title
:
'流程模型'
,
},
},
main_form
:
{
details
:
{
group1
:
"流程模型"
,
formpage1
:
"基本信息"
,
srforikey
:
""
,
srfkey
:
"ID"
,
srfmajortext
:
"名称"
,
srftempmode
:
""
,
srfuf
:
""
,
srfdeid
:
""
,
srfsourcekey
:
""
,
bpmnfile
:
"BPMN"
,
modelid
:
"ID"
,
},
uiactions
:
{
},
},
editviewtoolbar_toolbar
:
{
tbitem1
:
{
caption
:
"Save"
,
tip
:
"Save"
,
},
},
};
\ No newline at end of file
app_Web/src/locale/lanres/wfremodel/wfremodel_zh_CN.ts
0 → 100644
浏览文件 @
0d279c66
export
default
{
fields
:
{
id
:
'ID'
,
name
:
'名称'
,
bpmnfile
:
'BPMN'
,
},
views
:
{
editview
:
{
caption
:
'流程模型'
,
title
:
'流程模型'
,
},
},
main_form
:
{
details
:
{
group1
:
'流程模型'
,
formpage1
:
'基本信息'
,
srforikey
:
''
,
srfkey
:
'ID'
,
srfmajortext
:
'名称'
,
srftempmode
:
''
,
srfuf
:
''
,
srfdeid
:
''
,
srfsourcekey
:
''
,
bpmnfile
:
'BPMN'
,
modelid
:
'ID'
,
},
uiactions
:
{
},
},
editviewtoolbar_toolbar
:
{
tbitem1
:
{
caption
:
'保存'
,
tip
:
'保存'
,
},
},
};
\ No newline at end of file
app_Web/src/mock/app/index-appmenu/index-appmenu.ts
浏览文件 @
0d279c66
...
...
@@ -11,6 +11,24 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
name
:
'appmenu'
,
items
:
[
{
id
:
'DCCA086F-7A59-4199-9C11-FEC68DDF7E0B'
,
name
:
'menuitem7'
,
text
:
'组织部门管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'组织部门管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-th-large'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'4ea6829eb5066555b9f0a91145dc7502'
,
name
:
'menuitem1'
,
text
:
'单位管理'
,
...
...
@@ -22,13 +40,13 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-university
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto3'
,
resourcetag
:
''
,
},
{
{
id
:
'f73183a5dfe125c3461116b4d82c2468'
,
name
:
'menuitem2'
,
text
:
'部门管理'
,
...
...
@@ -40,13 +58,13 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-sitemap
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto2'
,
resourcetag
:
''
,
},
{
{
id
:
'341bd3aa939665d5c039462456dfce93'
,
name
:
'menuitem3'
,
text
:
'人员管理'
,
...
...
@@ -58,13 +76,33 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-user
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto4'
,
resourcetag
:
''
,
},
],
},
{
id
:
'F4C605A6-B7AE-4388-8525-3680E19053E9'
,
name
:
'menuitem8'
,
text
:
'权限管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'权限管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-cubes'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'1e02015a09f1d812fe4640fac320158e'
,
name
:
'menuitem4'
,
text
:
'用户角色'
,
...
...
@@ -76,31 +114,51 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-unlock-alt
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto5'
,
resourcetag
:
''
,
},
{
id
:
'
69b794a51f56bc20947749c2d7629117
'
,
name
:
'menuitem
5
'
,
text
:
'
流程角色
'
,
{
id
:
'
4999F409-9C7B-4C41-BD3A-B29611EA7E6E
'
,
name
:
'menuitem
9
'
,
text
:
'
认证日志
'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'
流程角色
'
,
tooltip
:
'
认证日志
'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-sort-amount-asc
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'
Auto1
'
,
appfunctag
:
'
_2
'
,
resourcetag
:
''
,
},
],
},
{
id
:
'B3429E51-565E-49F8-BCDB-CE313AFB338E'
,
name
:
'menuitem10'
,
text
:
'流程管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'流程管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-empire'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'6DFB635D-1B8E-47E7-9869-1B7BC2B844C0'
,
name
:
'menuitem6'
,
text
:
'流程定义'
,
...
...
@@ -115,8 +173,46 @@ mock.onGet('v7/indexappmenu').reply((config: any) => {
iconcls
:
'fa fa-random'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'_
2
'
,
appfunctag
:
'_
4
'
,
resourcetag
:
''
,
},
{
id
:
'69b794a51f56bc20947749c2d7629117'
,
name
:
'menuitem5'
,
text
:
'流程角色'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'流程角色'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-users'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto1'
,
resourcetag
:
''
,
},
{
id
:
'8E6D5AC1-9AA9-4F29-83A2-0A9E7EFACE09'
,
name
:
'menuitem11'
,
text
:
'发布新流程'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'发布新流程'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-arrow-circle-o-up'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'_3'
,
resourcetag
:
''
,
},
],
},
],
}];
...
...
app_Web/src/mock/codelist/codelist.ts
浏览文件 @
0d279c66
...
...
@@ -67,6 +67,66 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
"codename"
:
"Item_3"
,
value
:
'性别不详'
,
disabled
:
false
,
},
]
},
{
srfkey
:
'CLAuthCode'
,
emptytext
:
'未定义'
,
"codelisttype"
:
"static"
,
items
:
[
{
id
:
'200'
,
label
:
'成功'
,
text
:
'成功'
,
"data"
:
""
,
"codename"
:
"Item_200"
,
"color"
:
"rgba(0, 255, 0, 0)"
,
value
:
'200'
,
disabled
:
false
,
},
{
id
:
'400'
,
label
:
'用户不存在'
,
text
:
'用户不存在'
,
"data"
:
""
,
"codename"
:
"Item_400"
,
value
:
'400'
,
disabled
:
false
,
},
{
id
:
'401.1'
,
label
:
'密码错误'
,
text
:
'密码错误'
,
"data"
:
""
,
"codename"
:
"Item_3"
,
value
:
'401.1'
,
disabled
:
false
,
},
{
id
:
'401.2'
,
label
:
'配置错误'
,
text
:
'配置错误'
,
"data"
:
""
,
"codename"
:
"Item_4"
,
"color"
:
"rgba(22, 9, 170, 1)"
,
value
:
'401.2'
,
disabled
:
false
,
},
{
id
:
'403.6'
,
label
:
'地址被拒绝'
,
text
:
'地址被拒绝'
,
"data"
:
""
,
"codename"
:
"Item_5"
,
"color"
:
"rgba(0, 72, 255, 1)"
,
value
:
'403.6'
,
disabled
:
false
,
},
]
...
...
app_Web/src/mock/entity/sys-auth-logs/sys-auth-logs.ts
0 → 100644
浏览文件 @
0d279c66
import
qs
from
'qs'
;
import
{
MockAdapter
}
from
'@/mock/mock-adapter'
;
const
mock
=
MockAdapter
.
getInstance
();
// 模拟数据
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzrt-app-web
\/
sysauthlogs
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzrt-app-web
\/
sysauthlogs
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
sysauthlogs
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// updateBatch
mock
.
onPut
(
new
RegExp
(
/^
\/
sysauthlogs
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// removeBatch
mock
.
onDelete
(
new
RegExp
(
/^
\/
sysauthlogs
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
logid
,
tempValue
.
logid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sysauthlogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.logid, tempValue.logid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'logid'
]
==
tempValue
[
'logid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sysauthlogs
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sysauthlogs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.logid, tempValue.logid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'logid'
]
==
tempValue
[
'logid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sysauthlogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.logid, tempValue.logid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'logid'
]
==
tempValue
[
'logid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sysauthlogs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sysauthlogs
\/
fetchdefault$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
?
mockDatas
:
[]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sysauthlogs
\/
fetchdefault
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
let
url
=
config
.
url
.
split
(
'?'
)[
1
];
let
params
=
qs
.
parse
(
url
);
Object
.
assign
(
config
,
params
);
}
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
let
total
=
mockDatas
.
length
;
let
records
:
Array
<
any
>
=
[];
if
(
!
config
.
page
||
!
config
.
size
){
records
=
mockDatas
;
}
else
{
if
((
config
.
page
-
1
)
*
config
.
size
<
total
){
records
=
mockDatas
.
slice
(
config
.
page
,
config
.
size
);
}
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
records
?
records
:
[]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
records
?
records
:
[]];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
logid
,
tempValue
.
logid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sysauthlog 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'logid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sysauthlogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
logid
,
tempValue
.
logid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_Web/src/mock/entity/wfremodels/wfremodels.ts
0 → 100644
浏览文件 @
0d279c66
import
qs
from
'qs'
;
import
{
MockAdapter
}
from
'@/mock/mock-adapter'
;
const
mock
=
MockAdapter
.
getInstance
();
// 模拟数据
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzrt-app-web
\/
wfremodels
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibzrt-app-web
\/
wfremodels
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
wfremodels
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// updateBatch
mock
.
onPut
(
new
RegExp
(
/^
\/
wfremodels
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// removeBatch
mock
.
onDelete
(
new
RegExp
(
/^
\/
wfremodels
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
wfremodels
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
wfremodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
wfremodels
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
wfremodels
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
wfremodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
wfremodels
\/
fetchdefault$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
?
mockDatas
:
[]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
wfremodels
\/
fetchdefault
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
let
url
=
config
.
url
.
split
(
'?'
)[
1
];
let
params
=
qs
.
parse
(
url
);
Object
.
assign
(
config
,
params
);
}
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
let
total
=
mockDatas
.
length
;
let
records
:
Array
<
any
>
=
[];
if
(
!
config
.
page
||
!
config
.
size
){
records
=
mockDatas
;
}
else
{
if
((
config
.
page
-
1
)
*
config
.
size
<
total
){
records
=
mockDatas
.
slice
(
config
.
page
,
config
.
size
);
}
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
records
?
records
:
[]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
records
?
records
:
[]];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfremodel 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfremodels
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_Web/src/mock/index.ts
浏览文件 @
0d279c66
...
...
@@ -9,10 +9,12 @@ import './upload/upload';
// 实体级接口对象
import
'./entity/sys-role-permissions/sys-role-permissions'
;
import
'./entity/sys-users/sys-users'
;
import
'./entity/sys-auth-logs/sys-auth-logs'
;
import
'./entity/wfmembers/wfmembers'
;
import
'./entity/wfusers/wfusers'
;
import
'./entity/ibzorganizations/ibzorganizations'
;
import
'./entity/wfgroups/wfgroups'
;
import
'./entity/wfremodels/wfremodels'
;
import
'./entity/sys-user-roles/sys-user-roles'
;
import
'./entity/wfprocess-definitions/wfprocess-definitions'
;
import
'./entity/sys-roles/sys-roles'
;
...
...
app_Web/src/mock/viewconfig/viewconfig.ts
浏览文件 @
0d279c66
...
...
@@ -39,6 +39,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname"
:
"SYS_ROLEGridView"
,
"viewtag"
:
"13c174556f45e9b10b66dc51834a6ab5"
},
"sysauthloggridview"
:
{
"title"
:
"认证日志表格视图"
,
"caption"
:
"认证日志"
,
"viewtype"
:
"DEGRIDVIEW"
,
"viewmodule"
:
"uaa"
,
"viewname"
:
"SysAuthLogGridView"
,
"viewtag"
:
"255944d6d1a575d0eda2b68bc19314f3"
},
"sysrolepickupview"
:
{
"title"
:
"角色数据选择视图"
,
"caption"
:
"系统角色"
,
...
...
@@ -79,6 +87,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname"
:
"IBZEmployeeGridView"
,
"viewtag"
:
"40fe6b28b9f7902341da46bb74a02d59"
},
"wfremodeleditview"
:
{
"title"
:
"流程模型编辑视图"
,
"caption"
:
"流程模型"
,
"viewtype"
:
"DEEDITVIEW"
,
"viewmodule"
:
"workflow"
,
"viewname"
:
"WFREModelEditView"
,
"viewtag"
:
"5856bfb8b576cc2ee743801b23e58299"
},
"ibzdeptmembergridview"
:
{
"title"
:
"部门成员表格视图"
,
"caption"
:
"部门成员"
,
...
...
app_Web/src/pages/rt/index/page-register.ts
浏览文件 @
0d279c66
export
const
PageComponents
=
{
install
(
Vue
:
any
,
opt
:
any
)
{
Vue
.
component
(
'ibzorganization-grid-view'
,
()
=>
import
(
'@pages/ou/ibzorganization-grid-view/ibzorganization-grid-view.vue'
));
Vue
.
component
(
'wfremodel-edit-view'
,
()
=>
import
(
'@pages/workflow/wfremodel-edit-view/wfremodel-edit-view.vue'
));
Vue
.
component
(
'ibzemployee-pickup-view'
,
()
=>
import
(
'@pages/ou/ibzemployee-pickup-view/ibzemployee-pickup-view.vue'
));
Vue
.
component
(
'sys-auth-log-grid-view'
,
()
=>
import
(
'@pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.vue'
));
Vue
.
component
(
'ibzemployee-pickup-grid-view'
,
()
=>
import
(
'@pages/ou/ibzemployee-pickup-grid-view/ibzemployee-pickup-grid-view.vue'
));
Vue
.
component
(
'ibzorganization-edit-view'
,
()
=>
import
(
'@pages/ou/ibzorganization-edit-view/ibzorganization-edit-view.vue'
));
Vue
.
component
(
'ibzemployee-option-view'
,
()
=>
import
(
'@pages/ou/ibzemployee-option-view/ibzemployee-option-view.vue'
));
...
...
app_Web/src/pages/rt/index/router.ts
浏览文件 @
0d279c66
...
...
@@ -47,6 +47,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzorganization-grid-view/ibzorganization-grid-view.vue'
),
},
{
path
:
'wfremodels/:wfremodel?/editview/:editview?'
,
meta
:
{
caption
:
'entities.wfremodel.views.editview.caption'
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'wfremodels'
,
parameterName
:
'wfremodel'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/workflow/wfremodel-edit-view/wfremodel-edit-view.vue'
),
},
{
path
:
'ibzemployees/:ibzemployee?/pickupview/:pickupview?'
,
meta
:
{
...
...
@@ -60,6 +73,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzemployee-pickup-view/ibzemployee-pickup-view.vue'
),
},
{
path
:
'sysauthlogs/:sysauthlog?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.sysauthlog.views.gridview.caption'
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'sysauthlogs'
,
parameterName
:
'sysauthlog'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.vue'
),
},
{
path
:
'ibzemployees/:ibzemployee?/pickupgridview/:pickupgridview?'
,
meta
:
{
...
...
@@ -635,6 +661,18 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/uaa/sys-rolegrid-view/sys-rolegrid-view.vue'
),
},
{
path
:
'/sysauthlogs/:sysauthlog?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.sysauthlog.views.gridview.caption'
,
parameters
:
[
{
pathName
:
'sysauthlogs'
,
parameterName
:
'sysauthlog'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.vue'
),
},
{
path
:
'/sysroles/:sysrole?/pickupview/:pickupview?'
,
meta
:
{
...
...
@@ -695,6 +733,18 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzemployee-grid-view/ibzemployee-grid-view.vue'
),
},
{
path
:
'/wfremodels/:wfremodel?/editview/:editview?'
,
meta
:
{
caption
:
'entities.wfremodel.views.editview.caption'
,
parameters
:
[
{
pathName
:
'wfremodels'
,
parameterName
:
'wfremodel'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/workflow/wfremodel-edit-view/wfremodel-edit-view.vue'
),
},
{
path
:
'/ibzdeptmembers/:ibzdeptmember?/gridview/:gridview?'
,
meta
:
{
...
...
app_Web/src/pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view-base.vue
0 → 100644
浏览文件 @
0d279c66
<
template
>
<div
class=
'view-container degridview sys-auth-log-grid-view'
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"sysauthloggridview"
></app-studioaction>
<card
class=
'view-card '
:dis-hover=
"true"
:bordered=
"false"
>
<p
slot=
'title'
>
<span
class=
'caption-info'
>
{{
$t
(
model
.
srfTitle
)
}}
</span>
</p>
<div
class=
'content-container'
>
<div
class=
'view-top-messages'
>
</div>
<div
style=
'margin-bottom: 6px;'
>
<i-input
v-show=
"!isExpandSearchForm"
v-model=
"query"
search
enter-button
@
on-search=
"onSearch($event)"
class=
'quick-search-input'
style=
'max-width: 400px;'
placeholder=
"用户全局名"
/>
<div
class=
'pull-right'
>
</div>
</div>
<view
_searchform
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
v-show=
"isExpandSearchForm"
loaddraftAction=
"FilterGetDraft"
loadAction=
"FilterGet"
name=
"searchform"
ref=
'searchform'
@
save=
"searchform_save($event)"
@
search=
"searchform_search($event)"
@
load=
"searchform_load($event)"
@
closeview=
"closeView($event)"
>
</view
_searchform
>
<view
_grid
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:isSingleSelect=
"isSingleSelect"
:showBusyIndicator=
"true"
:isOpenEdit=
"false"
:gridRowActiveMode=
"gridRowActiveMode"
@
save=
"onSave"
updateAction=
""
removeAction=
"Remove"
loaddraftAction=
""
loadAction=
""
createAction=
""
fetchAction=
"FetchDefault"
:newdata=
"newdata"
:opendata=
"opendata"
name=
"grid"
ref=
'grid'
@
selectionchange=
"grid_selectionchange($event)"
@
beforeload=
"grid_beforeload($event)"
@
rowdblclick=
"grid_rowdblclick($event)"
@
remove=
"grid_remove($event)"
@
load=
"grid_load($event)"
@
closeview=
"closeView($event)"
>
</view
_grid
>
<div
class=
'view-bottom-messages'
>
</div>
</div>
</card>
</div>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
}
from
'vue-property-decorator'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
Subject
}
from
'rxjs'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
import
GridViewEngine
from
'@engine/view/grid-view-engine'
;
import
CodeListService
from
"@service/app/codelist-service"
;
@
Component
({
components
:
{
},
})
export
default
class
SysAuthLogGridViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {SysAuthLogService}
* @memberof SysAuthLogGridViewBase
*/
public
appEntityService
:
SysAuthLogService
=
new
SysAuthLogService
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof SysAuthLogGridViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof SysAuthLogGridViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof SysAuthLogGridViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof SysAuthLogGridViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof SysAuthLogGridViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图标识
*
* @type {string}
* @memberof SysAuthLogGridViewBase
*/
public
viewtag
:
string
=
'255944d6d1a575d0eda2b68bc19314f3'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.sysauthlog.views.gridview.caption'
,
srfTitle
:
'entities.sysauthlog.views.gridview.title'
,
srfSubTitle
:
'entities.sysauthlog.views.gridview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SysAuthLogGridViewBase
*/
@
Watch
(
'viewparam'
,{
immediate
:
true
,
deep
:
true
})
onParamData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
for
(
let
key
in
this
.
viewparams
){
delete
this
.
viewparams
[
key
];
}
Object
.
assign
(
this
.
viewparams
,
JSON
.
parse
(
this
.
viewparam
));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SysAuthLogGridViewBase
*/
@
Watch
(
'viewdata'
)
onViewData
(
newVal
:
any
,
oldVal
:
any
)
{
const
_this
:
any
=
this
;
if
(
!
Object
.
is
(
newVal
,
oldVal
)
&&
_this
.
engine
)
{
_this
.
parseViewParam
();
_this
.
engine
.
load
();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
containerModel
:
any
=
{
view_grid
:
{
name
:
'grid'
,
type
:
'GRID'
},
view_searchform
:
{
name
:
'searchform'
,
type
:
'SEARCHFORM'
},
};
/**
* 计数器刷新
*
* @memberof SysAuthLogGridViewBase
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof SysAuthLogGridViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof SysAuthLogGridViewBase
*/
public
engine
:
GridViewEngine
=
new
GridViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof SysAuthLogGridViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
opendata
:
(
args
:
any
[],
fullargs
?:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
=>
{
this
.
opendata
(
args
,
fullargs
,
params
,
$event
,
xData
);
},
newdata
:
(
args
:
any
[],
fullargs
?:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
=>
{
this
.
newdata
(
args
,
fullargs
,
params
,
$event
,
xData
);
},
grid
:
this
.
$refs
.
grid
,
searchform
:
this
.
$refs
.
searchform
,
keyPSDEField
:
'sysauthlog'
,
majorPSDEField
:
'username'
,
isLoadDefault
:
true
,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof SysAuthLogGridViewBase
*/
public
viewparams
:
any
=
{};
/**
* 解析视图参数
*
* @public
* @memberof SysAuthLogGridViewBase
*/
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 SysAuthLogGridViewBase
*/
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 SysAuthLogGridViewBase
*/
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声明周期
*
* @memberof SysAuthLogGridViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof SysAuthLogGridViewBase
*/
public
afterCreated
(){
const
secondtag
=
this
.
$util
.
createUUID
();
this
.
$store
.
commit
(
'viewaction/createdView'
,
{
viewtag
:
this
.
viewtag
,
secondtag
:
secondtag
});
this
.
viewtag
=
secondtag
;
this
.
parseViewParam
();
if
(
this
.
formDruipart
){
this
.
formDruipart
.
subscribe
((
res
:
any
)
=>
{
if
(
Object
.
is
(
res
.
action
,
'save'
)){
this
.
viewState
.
next
({
tag
:
'grid'
,
action
:
'save'
,
data
:
this
.
viewparams
});
}
if
(
Object
.
is
(
res
.
action
,
'load'
)){
const
_this
:
any
=
this
;
_this
.
engine
.
load
(
res
.
data
,
true
);
}
});
}
}
/**
* 销毁之前
*
* @memberof SysAuthLogGridViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof SysAuthLogGridViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof SysAuthLogGridViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
grid_selectionchange
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'selectionchange'
,
$event
);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
grid_beforeload
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'beforeload'
,
$event
);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
grid_rowdblclick
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'rowdblclick'
,
$event
);
}
/**
* grid 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
grid_remove
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'remove'
,
$event
);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
grid_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'load'
,
$event
);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
searchform_save
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'save'
,
$event
);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
searchform_search
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'search'
,
$event
);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
searchform_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'load'
,
$event
);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof SysAuthLogGridView
*/
public
newdata
(
args
:
any
[],
fullargs
?:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
{
this
.
$Notice
.
warning
({
title
:
'错误'
,
desc
:
'未指定关系视图'
});
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof SysAuthLogGridView
*/
public
opendata
(
args
:
any
[],
fullargs
?:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
{
this
.
$Notice
.
warning
({
title
:
'错误'
,
desc
:
'未指定关系视图'
});
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof SysAuthLogGridViewBase
*/
public
closeView
(
args
:
any
[]):
void
{
let
_view
:
any
=
this
;
if
(
_view
.
viewdata
)
{
_view
.
$emit
(
'viewdataschange'
,
[
args
]);
_view
.
$emit
(
'close'
,
[
args
]);
}
else
if
(
_view
.
$tabPageExp
)
{
_view
.
$tabPageExp
.
onClose
(
_view
.
$route
.
fullPath
);
}
}
/**
* 销毁视图回调
*
* @memberof SysAuthLogGridViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof SysAuthLogGridViewBase
*/
public
afterDestroyed
(){
if
(
this
.
viewDefaultUsage
){
let
localStoreLength
=
Object
.
keys
(
localStorage
);
if
(
localStoreLength
.
length
>
0
){
localStoreLength
.
forEach
((
item
:
string
)
=>
{
if
(
item
.
startsWith
(
this
.
context
.
srfsessionid
)){
localStorage
.
removeItem
(
item
);
}
})
}
}
}
/**
* 是否单选
*
* @type {boolean}
* @memberof SysAuthLogGridViewBase
*/
public
isSingleSelect
:
boolean
=
false
;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof SysAuthLogGridViewBase
*/
@
Prop
({
default
:
false
})
public
isformDruipart
?:
boolean
;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof SysAuthLogGridViewBase
*/
@
Prop
()
public
formDruipart
?:
Subject
<
ViewState
>
;
/**
* 搜索值
*
* @type {string}
* @memberof SysAuthLogGridViewBase
*/
public
query
:
string
=
''
;
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof SysAuthLogGridViewBase
*/
public
isExpandSearchForm
:
boolean
=
true
;
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof SysAuthLogGridViewBase
*/
public
gridRowActiveMode
:
number
|
0
|
1
|
2
=
2
;
/**
* 快速搜索
*
* @param {*} $event
* @memberof SysAuthLogGridViewBase
*/
public
onSearch
(
$event
:
any
):
void
{
const
grid
:
any
=
this
.
$refs
.
grid
;
if
(
grid
)
{
grid
.
load
(
this
.
context
,
true
);
}
}
/**
* grid 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ENTITYTEST1Usr2GridViewBase
*/
public
onSave
(
$event
:
any
)
{
this
.
$emit
(
'drdatasaved'
,
$event
);
}
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof SysAuthLogGridViewBase
*/
get
refreshdata
():
number
|
null
{
return
this
.
$store
.
getters
[
'viewaction/getRefreshData'
](
this
.
viewtag
);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof SysAuthLogGridViewBase
*/
@
Watch
(
'refreshdata'
)
onRefreshData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
===
null
||
newVal
===
undefined
)
{
return
;
}
if
(
newVal
===
0
)
{
return
;
}
const
grid
:
any
=
this
.
$refs
.
grid
;
if
(
grid
)
{
grid
.
load
({});
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './sys-auth-log-grid-view.less';
</
style
>
\ No newline at end of file
app_Web/src/pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.less
0 → 100644
浏览文件 @
0d279c66
.sys-auth-log-grid-view{
position: relative;
}
app_Web/src/pages/uaa/sys-auth-log-grid-view/sys-auth-log-grid-view.vue
0 → 100644
浏览文件 @
0d279c66
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
SysAuthLogGridViewBase
from
'./sys-auth-log-grid-view-base.vue'
;
import
view_grid
from
'@widgets/sys-auth-log/main-grid/main-grid.vue'
;
import
view_searchform
from
'@widgets/sys-auth-log/default-searchform/default-searchform.vue'
;
@
Component
({
components
:
{
view_grid
,
view_searchform
,
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
});
},
})
export
default
class
SysAuthLogGridView
extends
SysAuthLogGridViewBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/pages/workflow/wfremodel-edit-view/wfremodel-edit-view-base.vue
0 → 100644
浏览文件 @
0d279c66
<
template
>
<div
class=
"view-container deeditview wfremodel-edit-view"
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"wfremodeleditview"
></app-studioaction>
<card
class=
'view-card '
:disHover=
"true"
:bordered=
"false"
>
<p
slot=
'title'
>
<span
class=
'caption-info'
>
{{
$t
(
model
.
srfTitle
)
}}
</span>
</p>
<div
slot=
"extra"
>
<div
class=
'toolbar-container'
>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem1.visabled"
:disabled=
"toolBarModels.tbitem1.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem1' }, $event)">
<i
class=
'fa fa-save'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.wfremodel.editviewtoolbar_toolbar.tbitem1.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.wfremodel.editviewtoolbar_toolbar.tbitem1.tip'
)
}}
</div>
</tooltip>
</div>
</div>
<div
class=
"content-container"
>
<div
class=
'view-top-messages'
>
</div>
<view
_form
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:autosave=
"false"
:viewtag=
"viewtag"
:showBusyIndicator=
"true"
updateAction=
"Update"
removeAction=
"Remove"
loaddraftAction=
"GetDraft"
loadAction=
"Get"
createAction=
"Create"
WFSubmitAction=
""
WFStartAction=
""
style=
''
name=
"form"
ref=
'form'
@
save=
"form_save($event)"
@
remove=
"form_remove($event)"
@
load=
"form_load($event)"
@
closeview=
"closeView($event)"
>
</view
_form
>
<div
class=
'view-bottom-messages'
>
</div>
</div>
</card>
</div>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
}
from
'vue-property-decorator'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
Subject
}
from
'rxjs'
;
import
WFREModelService
from
'@/service/wfremodel/wfremodel-service'
;
import
EditViewEngine
from
'@engine/view/edit-view-engine'
;
@
Component
({
components
:
{
},
})
export
default
class
WFREModelEditViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {WFREModelService}
* @memberof WFREModelEditViewBase
*/
public
appEntityService
:
WFREModelService
=
new
WFREModelService
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof WFREModelEditViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof WFREModelEditViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof WFREModelEditViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof WFREModelEditViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof WFREModelEditViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图标识
*
* @type {string}
* @memberof WFREModelEditViewBase
*/
public
viewtag
:
string
=
'5856bfb8b576cc2ee743801b23e58299'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.wfremodel.views.editview.caption'
,
srfTitle
:
'entities.wfremodel.views.editview.title'
,
srfSubTitle
:
'entities.wfremodel.views.editview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof WFREModelEditViewBase
*/
@
Watch
(
'viewparam'
,{
immediate
:
true
,
deep
:
true
})
onParamData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
for
(
let
key
in
this
.
viewparams
){
delete
this
.
viewparams
[
key
];
}
Object
.
assign
(
this
.
viewparams
,
JSON
.
parse
(
this
.
viewparam
));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof WFREModelEditViewBase
*/
@
Watch
(
'viewdata'
)
onViewData
(
newVal
:
any
,
oldVal
:
any
)
{
const
_this
:
any
=
this
;
if
(
!
Object
.
is
(
newVal
,
oldVal
)
&&
_this
.
engine
)
{
_this
.
parseViewParam
();
_this
.
engine
.
load
();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
containerModel
:
any
=
{
view_toolbar
:
{
name
:
'toolbar'
,
type
:
'TOOLBAR'
},
view_form
:
{
name
:
'form'
,
type
:
'FORM'
},
};
/**
* 计数器刷新
*
* @memberof WFREModelEditViewBase
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof WFREModelEditViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 工具栏模型
*
* @type {*}
* @memberof WFREModelEditView
*/
public
toolBarModels
:
any
=
{
tbitem1
:
{
name
:
'tbitem1'
,
caption
:
'保存'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Save'
,
target
:
''
}
},
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof WFREModelEditViewBase
*/
public
engine
:
EditViewEngine
=
new
EditViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof WFREModelEditViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
form
:
this
.
$refs
.
form
,
p2k
:
'0'
,
keyPSDEField
:
'wfremodel'
,
majorPSDEField
:
'name'
,
isLoadDefault
:
true
,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof WFREModelEditViewBase
*/
public
viewparams
:
any
=
{};
/**
* 解析视图参数
*
* @public
* @memberof WFREModelEditViewBase
*/
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 WFREModelEditViewBase
*/
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 WFREModelEditViewBase
*/
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声明周期
*
* @memberof WFREModelEditViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof WFREModelEditViewBase
*/
public
afterCreated
(){
const
secondtag
=
this
.
$util
.
createUUID
();
this
.
$store
.
commit
(
'viewaction/createdView'
,
{
viewtag
:
this
.
viewtag
,
secondtag
:
secondtag
});
this
.
viewtag
=
secondtag
;
this
.
parseViewParam
();
}
/**
* 销毁之前
*
* @memberof WFREModelEditViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof WFREModelEditViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof WFREModelEditViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof WFREModelEditViewBase
*/
public
toolbar_click
(
$event
:
any
,
$event2
?:
any
)
{
if
(
Object
.
is
(
$event
.
tag
,
'tbitem1'
))
{
this
.
toolbar_tbitem1_click
(
null
,
''
,
$event2
);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof WFREModelEditViewBase
*/
public
form_save
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'form'
,
'save'
,
$event
);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof WFREModelEditViewBase
*/
public
form_remove
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'form'
,
'remove'
,
$event
);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof WFREModelEditViewBase
*/
public
form_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'form'
,
'load'
,
$event
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
toolbar_tbitem1_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
.
$refs
.
form
;
if
(
xData
.
getDatas
&&
xData
.
getDatas
instanceof
Function
)
{
datas
=
[...
xData
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
this
.
Save
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"WFREModel"
);
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof WFREModelEditViewBase
*/
public
Save
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
// 界面行为容器对象 _this
const
_this
:
any
=
this
;
if
(
xData
&&
xData
.
save
instanceof
Function
)
{
xData
.
save
().
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
return
;
}
_this
.
$emit
(
'viewdataschange'
,
[{
...
response
.
data
}]);
});
}
else
if
(
_this
.
save
&&
_this
.
save
instanceof
Function
)
{
_this
.
save
();
}
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof WFREModelEditViewBase
*/
public
closeView
(
args
:
any
[]):
void
{
let
_view
:
any
=
this
;
if
(
_view
.
viewdata
)
{
_view
.
$emit
(
'viewdataschange'
,
[
args
]);
_view
.
$emit
(
'close'
,
[
args
]);
}
else
if
(
_view
.
$tabPageExp
)
{
_view
.
$tabPageExp
.
onClose
(
_view
.
$route
.
fullPath
);
}
}
/**
* 销毁视图回调
*
* @memberof WFREModelEditViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof WFREModelEditViewBase
*/
public
afterDestroyed
(){
if
(
this
.
viewDefaultUsage
){
let
localStoreLength
=
Object
.
keys
(
localStorage
);
if
(
localStoreLength
.
length
>
0
){
localStoreLength
.
forEach
((
item
:
string
)
=>
{
if
(
item
.
startsWith
(
this
.
context
.
srfsessionid
)){
localStorage
.
removeItem
(
item
);
}
})
}
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './wfremodel-edit-view.less';
</
style
>
\ No newline at end of file
app_Web/src/pages/workflow/wfremodel-edit-view/wfremodel-edit-view.less
0 → 100644
浏览文件 @
0d279c66
.view-card {
>.ivu-card-extra {
top: 5px;
right: 0px;
}
}
.wfremodel-edit-view{
position: relative;
}
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
app_Web/src/pages/workflow/wfremodel-edit-view/wfremodel-edit-view.vue
0 → 100644
浏览文件 @
0d279c66
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
WFREModelEditViewBase
from
'./wfremodel-edit-view-base.vue'
;
import
view_form
from
'@widgets/wfremodel/main-form/main-form.vue'
;
@
Component
({
components
:
{
view_form
,
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
});
},
})
export
default
class
WFREModelEditView
extends
WFREModelEditViewBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/service/entity-service-register.ts
浏览文件 @
0d279c66
...
...
@@ -41,10 +41,12 @@ export class EntityServiceRegister {
protected
init
():
void
{
this
.
allEntityService
.
set
(
'sysrolepermission'
,
()
=>
import
(
'@/service/sys-role-permission/sys-role-permission-service'
));
this
.
allEntityService
.
set
(
'sysuser'
,
()
=>
import
(
'@/service/sys-user/sys-user-service'
));
this
.
allEntityService
.
set
(
'sysauthlog'
,
()
=>
import
(
'@/service/sys-auth-log/sys-auth-log-service'
));
this
.
allEntityService
.
set
(
'wfmember'
,
()
=>
import
(
'@/service/wfmember/wfmember-service'
));
this
.
allEntityService
.
set
(
'wfuser'
,
()
=>
import
(
'@/service/wfuser/wfuser-service'
));
this
.
allEntityService
.
set
(
'ibzorganization'
,
()
=>
import
(
'@/service/ibzorganization/ibzorganization-service'
));
this
.
allEntityService
.
set
(
'wfgroup'
,
()
=>
import
(
'@/service/wfgroup/wfgroup-service'
));
this
.
allEntityService
.
set
(
'wfremodel'
,
()
=>
import
(
'@/service/wfremodel/wfremodel-service'
));
this
.
allEntityService
.
set
(
'sysuserrole'
,
()
=>
import
(
'@/service/sys-user-role/sys-user-role-service'
));
this
.
allEntityService
.
set
(
'wfprocessdefinition'
,
()
=>
import
(
'@/service/wfprocess-definition/wfprocess-definition-service'
));
this
.
allEntityService
.
set
(
'sysrole'
,
()
=>
import
(
'@/service/sys-role/sys-role-service'
));
...
...
app_Web/src/service/sys-auth-log/sys-auth-log-service-base.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
/**
* 认证日志服务对象基类
*
* @export
* @class SysAuthLogServiceBase
* @extends {EntityServie}
*/
export
default
class
SysAuthLogServiceBase
extends
EntityService
{
/**
* Creates an instance of SysAuthLogServiceBase.
*
* @param {*} [opts={}]
* @memberof SysAuthLogServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
/**
* 初始化基础数据
*
* @memberof SysAuthLogServiceBase
*/
public
initBasicData
(){
this
.
APPLYDEKEY
=
'sysauthlog'
;
this
.
APPDEKEY
=
'logid'
;
this
.
APPDENAME
=
'sysauthlogs'
;
this
.
APPDETEXT
=
'username'
;
this
.
APPNAME
=
'web'
;
this
.
SYSTEMNAME
=
'ibzrt'
;
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/sysauthlogs/
${
context
.
sysauthlog
}
/select`
,
isloading
);
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sysauthlogs/
${
context
.
sysauthlog
}
/checkkey`
,
data
,
isloading
);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sysauthlogs/
${
context
.
sysauthlog
}
`
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysauthlogs/getdraft`
,
isloading
);
res
.
data
.
sysauthlog
=
data
.
sysauthlog
;
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sysauthlogs/
${
context
.
sysauthlog
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysauthlogs/
${
context
.
sysauthlog
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysauthlogs`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysauthlogs/
${
context
.
sysauthlog
}
`
,
isloading
);
return
res
;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysAuthLogServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sysauthlogs/fetchdefault`
,
tempData
,
isloading
);
}
}
\ No newline at end of file
app_Web/src/service/sys-auth-log/sys-auth-log-service.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
}
from
'@/utils'
;
import
SysAuthLogServiceBase
from
'./sys-auth-log-service-base'
;
/**
* 认证日志服务对象
*
* @export
* @class SysAuthLogService
* @extends {SysAuthLogServiceBase}
*/
export
default
class
SysAuthLogService
extends
SysAuthLogServiceBase
{
/**
* Creates an instance of SysAuthLogService.
*
* @param {*} [opts={}]
* @memberof SysAuthLogService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/service/wfremodel/wfremodel-service-base.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
/**
* 流程模型服务对象基类
*
* @export
* @class WFREModelServiceBase
* @extends {EntityServie}
*/
export
default
class
WFREModelServiceBase
extends
EntityService
{
/**
* Creates an instance of WFREModelServiceBase.
*
* @param {*} [opts={}]
* @memberof WFREModelServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
/**
* 初始化基础数据
*
* @memberof WFREModelServiceBase
*/
public
initBasicData
(){
this
.
APPLYDEKEY
=
'wfremodel'
;
this
.
APPDEKEY
=
'id'
;
this
.
APPDENAME
=
'wfremodels'
;
this
.
APPDETEXT
=
'name'
;
this
.
APPNAME
=
'web'
;
this
.
SYSTEMNAME
=
'ibzrt'
;
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/wfremodels/
${
context
.
wfremodel
}
/select`
,
isloading
);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/wfremodels`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/wfremodels/
${
context
.
wfremodel
}
`
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/wfremodels/
${
context
.
wfremodel
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/wfremodels/
${
context
.
wfremodel
}
`
,
data
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/wfremodels/getdraft`
,
isloading
);
res
.
data
.
wfremodel
=
data
.
wfremodel
;
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/wfremodels/
${
context
.
wfremodel
}
`
,
isloading
);
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/wfremodels/
${
context
.
wfremodel
}
/checkkey`
,
data
,
isloading
);
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/wfremodels/fetchdefault`
,
tempData
,
isloading
);
}
}
\ No newline at end of file
app_Web/src/service/wfremodel/wfremodel-service.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
}
from
'@/utils'
;
import
WFREModelServiceBase
from
'./wfremodel-service-base'
;
/**
* 流程模型服务对象
*
* @export
* @class WFREModelService
* @extends {WFREModelServiceBase}
*/
export
default
class
WFREModelService
extends
WFREModelServiceBase
{
/**
* Creates an instance of WFREModelService.
*
* @param {*} [opts={}]
* @memberof WFREModelService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/store/modules/view-action/state.ts
浏览文件 @
0d279c66
...
...
@@ -45,6 +45,15 @@ export const viewstate: any = {
'6bd0981f6dd67a59f211b5cf97ac8f30'
,
],
},
{
viewtag
:
'255944d6d1a575d0eda2b68bc19314f3'
,
viewmodule
:
'uaa'
,
viewname
:
'SysAuthLogGridView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
],
},
{
viewtag
:
'26cc2d5c69f1525eaa415b7de1a0d4a6'
,
viewmodule
:
'uaa'
,
...
...
@@ -95,6 +104,15 @@ export const viewstate: any = {
'9cf7a70099bff83a10f6ae65c4d54692'
,
],
},
{
viewtag
:
'5856bfb8b576cc2ee743801b23e58299'
,
viewmodule
:
'workflow'
,
viewname
:
'WFREModelEditView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
],
},
{
viewtag
:
'61541167ccebbc3f174242ce73e436dd'
,
viewmodule
:
'ou'
,
...
...
@@ -265,8 +283,10 @@ export const viewstate: any = {
viewdatachange
:
false
,
refviews
:
[
'c42bc30741bd6add20b00494231dfa24'
,
'5856bfb8b576cc2ee743801b23e58299'
,
'c0cdac5d5b5691ae8a326f5972aec67f'
,
'6435e95f9bd03acceda6b7fd610873db'
,
'255944d6d1a575d0eda2b68bc19314f3'
,
'13c174556f45e9b10b66dc51834a6ab5'
,
'f498dfb24e88df7c70a5c09ecb587647'
,
'bfa86be8c02420f87d5cf4ff9a768948'
,
...
...
app_Web/src/uiservice/sys-auth-log/sys-auth-log-ui-service-base.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Environment
}
from
'@/environments/environment'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
/**
* 认证日志UI服务对象基类
*
* @export
* @class SysAuthLogUIServiceBase
*/
export
default
class
SysAuthLogUIServiceBase
extends
UIService
{
/**
* 是否支持工作流
*
* @memberof SysAuthLogUIServiceBase
*/
public
isEnableWorkflow
:
boolean
=
false
;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof SysAuthLogUIServiceBase
*/
public
dataService
:
SysAuthLogService
=
new
SysAuthLogService
();
/**
* 所有关联视图
*
* @memberof SysAuthLogUIServiceBase
*/
public
allViewMap
:
Map
<
string
,
Object
>
=
new
Map
();
/**
* 状态值
*
* @memberof SysAuthLogUIServiceBase
*/
public
stateValue
:
number
=
0
;
/**
* 状态属性
*
* @memberof SysAuthLogUIServiceBase
*/
public
stateField
:
string
=
""
;
/**
* 主状态属性集合
*
* @memberof SysAuthLogUIServiceBase
*/
public
mainStateFields
:
Array
<
any
>
=
[];
/**
* 主状态集合Map
*
* @memberof SysAuthLogUIServiceBase
*/
public
allDeMainStateMap
:
Map
<
string
,
string
>
=
new
Map
();
/**
* Creates an instance of SysAuthLogUIServiceBase.
*
* @param {*} [opts={}]
* @memberof SysAuthLogUIServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
}
/**
* 初始化视图Map
*
* @memberof SysAuthLogUIServiceBase
*/
public
initViewMap
(){
this
.
allViewMap
.
set
(
'MDATAVIEW:'
,{
viewname
:
'gridview'
,
srfappde
:
'sysauthlogs'
});
}
/**
* 初始化主状态集合
*
* @memberof SysAuthLogUIServiceBase
*/
public
initDeMainStateMap
(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof SysAuthLogUIServiceBase
*/
public
async
getRDAppView
(
srfkey
:
string
,
isEnableWorkflow
:
boolean
){
this
.
isEnableWorkflow
=
isEnableWorkflow
;
// 进行数据查询
let
result
:
any
=
await
this
.
dataService
.
Get
({
sysauthlog
:
srfkey
});
const
curData
:
any
=
result
.
data
;
//判断当前数据模式,默认为true,todo
const
iRealDEModel
:
boolean
=
true
;
let
bDataInWF
:
boolean
=
false
;
let
bWFMode
:
any
=
false
;
// 计算数据模式
if
(
this
.
isEnableWorkflow
)
{
bDataInWF
=
await
this
.
dataService
.
testDataInWF
({
stateValue
:
this
.
stateValue
,
stateField
:
this
.
stateField
},
curData
);
if
(
bDataInWF
)
{
bDataInWF
=
true
;
bWFMode
=
await
this
.
dataService
.
testUserExistWorklist
(
null
,
curData
);
}
}
let
strPDTViewParam
:
string
=
await
this
.
getDESDDEViewPDTParam
(
curData
,
bDataInWF
,
bWFMode
);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return
this
.
allViewMap
.
get
(
strPDTViewParam
);
}
/**
* 获取实际的数据类型
*
* @memberof SysAuthLogUIServiceBase
*/
public
getRealDEType
(
entity
:
any
){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof SysAuthLogUIServiceBase
*/
public
async
getDESDDEViewPDTParam
(
curData
:
any
,
bDataInWF
:
boolean
,
bWFMode
:
boolean
){
let
strPDTParam
:
string
=
''
;
if
(
bDataInWF
)
{
// 判断数据是否在流程中
}
//多表单,todo
const
isEnableMultiForm
:
boolean
=
false
;
const
multiFormDEField
:
string
|
null
=
null
;
if
(
isEnableMultiForm
&&
multiFormDEField
)
{
const
objFormValue
:
string
=
curData
[
multiFormDEField
];
if
(
!
Environment
.
isAppMode
){
return
'MOBEDITVIEW'
+
objFormValue
;
}
return
'EDITVIEW'
+
objFormValue
;
}
if
(
!
Environment
.
isAppMode
){
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`MOBEDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'MOBEDITVIEW:'
;
}
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`EDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'EDITVIEW:'
;
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof SysAuthLogUIServiceBase
*/
public
async
getDEMainStateTag
(
curData
:
any
){
if
(
this
.
mainStateFields
.
length
===
0
)
return
null
;
this
.
mainStateFields
.
forEach
((
singleMainField
:
any
)
=>
{
if
(
!
(
singleMainField
in
curData
)){
console
.
error
(
`当前数据对象不包含属性singleMainField,可能会发生错误`
);
}
})
let
strTag
:
String
=
""
;
for
(
let
i
=
0
;
i
<=
1
;
i
++
)
{
let
strTag
:
string
=
(
curData
[
this
.
mainStateFields
[
0
]])?(
i
==
0
)
?
curData
[
this
.
mainStateFields
[
0
]]
:
""
:
""
;
if
(
this
.
mainStateFields
.
length
>=
2
)
{
for
(
let
j
=
0
;
j
<=
1
;
j
++
)
{
let
strTag2
:
string
=
(
curData
[
this
.
mainStateFields
[
1
]])?
`
${
strTag
}
__
${(
j
==
0
)
?
curData
[
this
.
mainStateFields
[
1
]]
:
""
}
`
:
strTag
;
if
(
this
.
mainStateFields
.
length
>=
3
)
{
for
(
let
k
=
0
;
k
<=
1
;
k
++
)
{
let
strTag3
:
string
=
(
curData
[
this
.
mainStateFields
[
2
]])?
`
${
strTag2
}
__
${(
k
==
0
)
?
curData
[
this
.
mainStateFields
[
2
]]
:
""
}
`
:
strTag2
;
// 判断是否存在
return
this
.
allDeMainStateMap
.
get
(
strTag3
);
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag2
);
}
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag
);
}
}
return
null
;
}
}
\ No newline at end of file
app_Web/src/uiservice/sys-auth-log/sys-auth-log-ui-service.ts
0 → 100644
浏览文件 @
0d279c66
import
SysAuthLogUIServiceBase
from
'./sys-auth-log-ui-service-base'
;
/**
* 认证日志UI服务对象
*
* @export
* @class SysAuthLogUIService
*/
export
default
class
SysAuthLogUIService
extends
SysAuthLogUIServiceBase
{
/**
* Creates an instance of SysAuthLogUIService.
*
* @param {*} [opts={}]
* @memberof SysAuthLogUIService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/uiservice/ui-service-register.ts
浏览文件 @
0d279c66
...
...
@@ -41,10 +41,12 @@ export class UIServiceRegister {
protected
init
():
void
{
this
.
allUIService
.
set
(
'sysrolepermission'
,
()
=>
import
(
'@/uiservice/sys-role-permission/sys-role-permission-ui-service'
));
this
.
allUIService
.
set
(
'sysuser'
,
()
=>
import
(
'@/uiservice/sys-user/sys-user-ui-service'
));
this
.
allUIService
.
set
(
'sysauthlog'
,
()
=>
import
(
'@/uiservice/sys-auth-log/sys-auth-log-ui-service'
));
this
.
allUIService
.
set
(
'wfmember'
,
()
=>
import
(
'@/uiservice/wfmember/wfmember-ui-service'
));
this
.
allUIService
.
set
(
'wfuser'
,
()
=>
import
(
'@/uiservice/wfuser/wfuser-ui-service'
));
this
.
allUIService
.
set
(
'ibzorganization'
,
()
=>
import
(
'@/uiservice/ibzorganization/ibzorganization-ui-service'
));
this
.
allUIService
.
set
(
'wfgroup'
,
()
=>
import
(
'@/uiservice/wfgroup/wfgroup-ui-service'
));
this
.
allUIService
.
set
(
'wfremodel'
,
()
=>
import
(
'@/uiservice/wfremodel/wfremodel-ui-service'
));
this
.
allUIService
.
set
(
'sysuserrole'
,
()
=>
import
(
'@/uiservice/sys-user-role/sys-user-role-ui-service'
));
this
.
allUIService
.
set
(
'wfprocessdefinition'
,
()
=>
import
(
'@/uiservice/wfprocess-definition/wfprocess-definition-ui-service'
));
this
.
allUIService
.
set
(
'sysrole'
,
()
=>
import
(
'@/uiservice/sys-role/sys-role-ui-service'
));
...
...
app_Web/src/uiservice/wfremodel/wfremodel-ui-service-base.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Environment
}
from
'@/environments/environment'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
WFREModelService
from
'@/service/wfremodel/wfremodel-service'
;
/**
* 流程模型UI服务对象基类
*
* @export
* @class WFREModelUIServiceBase
*/
export
default
class
WFREModelUIServiceBase
extends
UIService
{
/**
* 是否支持工作流
*
* @memberof WFREModelUIServiceBase
*/
public
isEnableWorkflow
:
boolean
=
false
;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof WFREModelUIServiceBase
*/
public
dataService
:
WFREModelService
=
new
WFREModelService
();
/**
* 所有关联视图
*
* @memberof WFREModelUIServiceBase
*/
public
allViewMap
:
Map
<
string
,
Object
>
=
new
Map
();
/**
* 状态值
*
* @memberof WFREModelUIServiceBase
*/
public
stateValue
:
number
=
0
;
/**
* 状态属性
*
* @memberof WFREModelUIServiceBase
*/
public
stateField
:
string
=
""
;
/**
* 主状态属性集合
*
* @memberof WFREModelUIServiceBase
*/
public
mainStateFields
:
Array
<
any
>
=
[];
/**
* 主状态集合Map
*
* @memberof WFREModelUIServiceBase
*/
public
allDeMainStateMap
:
Map
<
string
,
string
>
=
new
Map
();
/**
* Creates an instance of WFREModelUIServiceBase.
*
* @param {*} [opts={}]
* @memberof WFREModelUIServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
}
/**
* 初始化视图Map
*
* @memberof WFREModelUIServiceBase
*/
public
initViewMap
(){
this
.
allViewMap
.
set
(
'EDITVIEW:'
,{
viewname
:
'editview'
,
srfappde
:
'wfremodels'
});
}
/**
* 初始化主状态集合
*
* @memberof WFREModelUIServiceBase
*/
public
initDeMainStateMap
(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof WFREModelUIServiceBase
*/
public
async
getRDAppView
(
srfkey
:
string
,
isEnableWorkflow
:
boolean
){
this
.
isEnableWorkflow
=
isEnableWorkflow
;
// 进行数据查询
let
result
:
any
=
await
this
.
dataService
.
Get
({
wfremodel
:
srfkey
});
const
curData
:
any
=
result
.
data
;
//判断当前数据模式,默认为true,todo
const
iRealDEModel
:
boolean
=
true
;
let
bDataInWF
:
boolean
=
false
;
let
bWFMode
:
any
=
false
;
// 计算数据模式
if
(
this
.
isEnableWorkflow
)
{
bDataInWF
=
await
this
.
dataService
.
testDataInWF
({
stateValue
:
this
.
stateValue
,
stateField
:
this
.
stateField
},
curData
);
if
(
bDataInWF
)
{
bDataInWF
=
true
;
bWFMode
=
await
this
.
dataService
.
testUserExistWorklist
(
null
,
curData
);
}
}
let
strPDTViewParam
:
string
=
await
this
.
getDESDDEViewPDTParam
(
curData
,
bDataInWF
,
bWFMode
);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return
this
.
allViewMap
.
get
(
strPDTViewParam
);
}
/**
* 获取实际的数据类型
*
* @memberof WFREModelUIServiceBase
*/
public
getRealDEType
(
entity
:
any
){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof WFREModelUIServiceBase
*/
public
async
getDESDDEViewPDTParam
(
curData
:
any
,
bDataInWF
:
boolean
,
bWFMode
:
boolean
){
let
strPDTParam
:
string
=
''
;
if
(
bDataInWF
)
{
// 判断数据是否在流程中
}
//多表单,todo
const
isEnableMultiForm
:
boolean
=
false
;
const
multiFormDEField
:
string
|
null
=
null
;
if
(
isEnableMultiForm
&&
multiFormDEField
)
{
const
objFormValue
:
string
=
curData
[
multiFormDEField
];
if
(
!
Environment
.
isAppMode
){
return
'MOBEDITVIEW'
+
objFormValue
;
}
return
'EDITVIEW'
+
objFormValue
;
}
if
(
!
Environment
.
isAppMode
){
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`MOBEDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'MOBEDITVIEW:'
;
}
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`EDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'EDITVIEW:'
;
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof WFREModelUIServiceBase
*/
public
async
getDEMainStateTag
(
curData
:
any
){
if
(
this
.
mainStateFields
.
length
===
0
)
return
null
;
this
.
mainStateFields
.
forEach
((
singleMainField
:
any
)
=>
{
if
(
!
(
singleMainField
in
curData
)){
console
.
error
(
`当前数据对象不包含属性singleMainField,可能会发生错误`
);
}
})
let
strTag
:
String
=
""
;
for
(
let
i
=
0
;
i
<=
1
;
i
++
)
{
let
strTag
:
string
=
(
curData
[
this
.
mainStateFields
[
0
]])?(
i
==
0
)
?
curData
[
this
.
mainStateFields
[
0
]]
:
""
:
""
;
if
(
this
.
mainStateFields
.
length
>=
2
)
{
for
(
let
j
=
0
;
j
<=
1
;
j
++
)
{
let
strTag2
:
string
=
(
curData
[
this
.
mainStateFields
[
1
]])?
`
${
strTag
}
__
${(
j
==
0
)
?
curData
[
this
.
mainStateFields
[
1
]]
:
""
}
`
:
strTag
;
if
(
this
.
mainStateFields
.
length
>=
3
)
{
for
(
let
k
=
0
;
k
<=
1
;
k
++
)
{
let
strTag3
:
string
=
(
curData
[
this
.
mainStateFields
[
2
]])?
`
${
strTag2
}
__
${(
k
==
0
)
?
curData
[
this
.
mainStateFields
[
2
]]
:
""
}
`
:
strTag2
;
// 判断是否存在
return
this
.
allDeMainStateMap
.
get
(
strTag3
);
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag2
);
}
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag
);
}
}
return
null
;
}
}
\ No newline at end of file
app_Web/src/uiservice/wfremodel/wfremodel-ui-service.ts
0 → 100644
浏览文件 @
0d279c66
import
WFREModelUIServiceBase
from
'./wfremodel-ui-service-base'
;
/**
* 流程模型UI服务对象
*
* @export
* @class WFREModelUIService
*/
export
default
class
WFREModelUIService
extends
WFREModelUIServiceBase
{
/**
* Creates an instance of WFREModelUIService.
*
* @param {*} [opts={}]
* @memberof WFREModelUIService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/widgets/app/index-appmenu/index-appmenu-base.vue
浏览文件 @
0d279c66
...
...
@@ -489,12 +489,18 @@ export default class IndexBase extends Vue implements ControlInterface {
case
'Auto2'
:
this
.
clickAuto2
(
item
);
return
;
case
'_4'
:
this
.
click_4
(
item
);
return
;
case
'_2'
:
this
.
click_2
(
item
);
return
;
case
'Auto1'
:
this
.
clickAuto1
(
item
);
return
;
case
'_3'
:
this
.
click_3
(
item
);
return
;
case
'Auto4'
:
this
.
clickAuto4
(
item
);
return
;
...
...
@@ -565,7 +571,7 @@ export default class IndexBase extends Vue implements ControlInterface {
* @param {*} [item={}]
* @memberof Index
*/
public
click_
2
(
item
:
any
=
{})
{
public
click_
4
(
item
:
any
=
{})
{
const
viewparam
:
any
=
{};
Object
.
assign
(
viewparam
,
{});
const
deResParameters
:
any
[]
=
[];
...
...
@@ -577,6 +583,24 @@ export default class IndexBase extends Vue implements ControlInterface {
this
.
$router
.
push
(
path
);
}
/**
* 认证日志
*
* @param {*} [item={}]
* @memberof Index
*/
public
click_2
(
item
:
any
=
{})
{
const
viewparam
:
any
=
{};
Object
.
assign
(
viewparam
,
{});
const
deResParameters
:
any
[]
=
[];
const
parameters
:
any
[]
=
[
{
pathName
:
'sysauthlogs'
,
parameterName
:
'sysauthlog'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
];
const
path
:
string
=
this
.
$viewTool
.
buildUpRoutePath
(
this
.
$route
,
{},
deResParameters
,
parameters
,
[],
viewparam
);
this
.
$router
.
push
(
path
);
}
/**
* 流程角色
*
...
...
@@ -595,6 +619,24 @@ export default class IndexBase extends Vue implements ControlInterface {
this
.
$router
.
push
(
path
);
}
/**
* 发布新流程
*
* @param {*} [item={}]
* @memberof Index
*/
public
click_3
(
item
:
any
=
{})
{
const
viewparam
:
any
=
{};
Object
.
assign
(
viewparam
,
{});
const
deResParameters
:
any
[]
=
[];
const
parameters
:
any
[]
=
[
{
pathName
:
'wfremodels'
,
parameterName
:
'wfremodel'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
];
const
path
:
string
=
this
.
$viewTool
.
buildUpRoutePath
(
this
.
$route
,
{},
deResParameters
,
parameters
,
[],
viewparam
);
this
.
$router
.
push
(
path
);
}
/**
* 人员管理
*
...
...
app_Web/src/widgets/app/index-appmenu/index-appmenu-model.ts
浏览文件 @
0d279c66
...
...
@@ -15,6 +15,24 @@ export default class IndexModel {
*/
public
items
:
any
[]
=
[
{
id
:
'DCCA086F-7A59-4199-9C11-FEC68DDF7E0B'
,
name
:
'menuitem7'
,
text
:
'组织部门管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'组织部门管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-th-large'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'4ea6829eb5066555b9f0a91145dc7502'
,
name
:
'menuitem1'
,
text
:
'单位管理'
,
...
...
@@ -26,13 +44,13 @@ export default class IndexModel {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-university
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto3'
,
resourcetag
:
''
,
},
{
{
id
:
'f73183a5dfe125c3461116b4d82c2468'
,
name
:
'menuitem2'
,
text
:
'部门管理'
,
...
...
@@ -44,13 +62,13 @@ export default class IndexModel {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-sitemap
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto2'
,
resourcetag
:
''
,
},
{
{
id
:
'341bd3aa939665d5c039462456dfce93'
,
name
:
'menuitem3'
,
text
:
'人员管理'
,
...
...
@@ -62,13 +80,33 @@ export default class IndexModel {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-user
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto4'
,
resourcetag
:
''
,
},
],
},
{
id
:
'F4C605A6-B7AE-4388-8525-3680E19053E9'
,
name
:
'menuitem8'
,
text
:
'权限管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'权限管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-cubes'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'1e02015a09f1d812fe4640fac320158e'
,
name
:
'menuitem4'
,
text
:
'用户角色'
,
...
...
@@ -80,31 +118,51 @@ export default class IndexModel {
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-unlock-alt
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto5'
,
resourcetag
:
''
,
},
{
id
:
'
69b794a51f56bc20947749c2d7629117
'
,
name
:
'menuitem
5
'
,
text
:
'
流程角色
'
,
{
id
:
'
4999F409-9C7B-4C41-BD3A-B29611EA7E6E
'
,
name
:
'menuitem
9
'
,
text
:
'
认证日志
'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'
流程角色
'
,
tooltip
:
'
认证日志
'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
iconcls
:
'
fa fa-sort-amount-asc
'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'
Auto1
'
,
appfunctag
:
'
_2
'
,
resourcetag
:
''
,
},
],
},
{
id
:
'B3429E51-565E-49F8-BCDB-CE313AFB338E'
,
name
:
'menuitem10'
,
text
:
'流程管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'流程管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-empire'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'6DFB635D-1B8E-47E7-9869-1B7BC2B844C0'
,
name
:
'menuitem6'
,
text
:
'流程定义'
,
...
...
@@ -119,8 +177,46 @@ export default class IndexModel {
iconcls
:
'fa fa-random'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'_
2
'
,
appfunctag
:
'_
4
'
,
resourcetag
:
''
,
},
{
id
:
'69b794a51f56bc20947749c2d7629117'
,
name
:
'menuitem5'
,
text
:
'流程角色'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'流程角色'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-users'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'Auto1'
,
resourcetag
:
''
,
},
{
id
:
'8E6D5AC1-9AA9-4F29-83A2-0A9E7EFACE09'
,
name
:
'menuitem11'
,
text
:
'发布新流程'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'发布新流程'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
'fa fa-arrow-circle-o-up'
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'_3'
,
resourcetag
:
''
,
},
],
},
];
...
...
app_Web/src/widgets/sys-auth-log/default-searchform/default-searchform-base.vue
0 → 100644
浏览文件 @
0d279c66
<
template
>
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<input
style=
"display:none;"
/>
<row>
<i-col
span=
"20"
class=
"form-content"
>
<row>
<i-col
v-show=
"detailsModel.n_username_like.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_username_like'
:itemRules=
"this.rules.n_username_like"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_username_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_username_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<input-box
v-model=
"data.n_username_like"
@
enter=
"onEnter($event)"
:disabled=
"detailsModel.n_username_like.disabled"
type=
'text'
style=
"width:100px;"
></input-box>
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.n_personname_like.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_personname_like'
:itemRules=
"this.rules.n_personname_like"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_personname_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_personname_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<input-box
v-model=
"data.n_personname_like"
@
enter=
"onEnter($event)"
:disabled=
"detailsModel.n_personname_like.disabled"
type=
'text'
style=
"width:100px;"
></input-box>
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.n_authcode_eq.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_authcode_eq'
:itemRules=
"this.rules.n_authcode_eq"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_authcode_eq')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_authcode_eq.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<dropdown-list
v-model=
"data.n_authcode_eq"
:data=
"data"
:itemParam=
"
{}" :disabled="detailsModel.n_authcode_eq.disabled" tag='CLAuthCode' codelistType='STATIC' placeholder='请选择...' style="width:100px;">
</dropdown-list>
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.n_authtime_gtandeq.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_authtime_gtandeq'
:itemRules=
"this.rules.n_authtime_gtandeq"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_authtime_gtandeq')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_authtime_gtandeq.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<date-picker
type=
"datetime"
:transfer=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"请选择时间..."
:value=
"data.n_authtime_gtandeq"
:disabled=
"detailsModel.n_authtime_gtandeq.disabled"
style=
"min-width: 150px; width:100px;"
@
on-change=
"(val1, val2) =>
{ this.data.n_authtime_gtandeq = val1 }">
</date-picker>
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.n_authtime_ltandeq.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_authtime_ltandeq'
:itemRules=
"this.rules.n_authtime_ltandeq"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_authtime_ltandeq')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_authtime_ltandeq.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<date-picker
type=
"datetime"
:transfer=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"请选择时间..."
:value=
"data.n_authtime_ltandeq"
:disabled=
"detailsModel.n_authtime_ltandeq.disabled"
style=
"min-width: 150px; width:100px;"
@
on-change=
"(val1, val2) =>
{ this.data.n_authtime_ltandeq = val1 }">
</date-picker>
</app-form-item>
</i-col>
<i-col
v-show=
"detailsModel.n_domain_like.visible"
:style=
"
{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_domain_like'
:itemRules=
"this.rules.n_domain_like"
class=
''
:caption=
"$t('entities.sysauthlog.default_searchform.details.n_domain_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_domain_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<input-box
v-model=
"data.n_domain_like"
@
enter=
"onEnter($event)"
:disabled=
"detailsModel.n_domain_like.disabled"
type=
'text'
style=
"width:100px;"
></input-box>
</app-form-item>
</i-col>
</row>
</i-col>
<i-col
span=
"4"
class=
"search-button"
>
<row
v-show=
"Object.keys(data).length>0"
>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
</row>
</i-col>
</row>
</i-form>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Model
}
from
'vue-property-decorator'
;
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
import
DefaultService
from
'./default-searchform-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
@
Component
({
components
:
{
}
})
export
default
class
DefaultBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof Default
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Default
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof Default
*/
@
Prop
()
public
context
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof Default
*/
@
Prop
()
public
viewparams
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Default
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Default
*/
public
getControlType
():
string
{
return
'SEARCHFORM'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Default
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {DefaultService}
* @memberof Default
*/
public
service
:
DefaultService
=
new
DefaultService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {SysAuthLogService}
* @memberof Default
*/
public
appEntityService
:
SysAuthLogService
=
new
SysAuthLogService
({
$store
:
this
.
$store
});
/**
* 关闭视图
*
* @param {any} args
* @memberof Default
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof Default
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof DefaultBase
*/
public
getDatas
():
any
[]
{
return
[
this
.
data
];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof DefaultBase
*/
public
getData
():
any
{
return
this
.
data
;
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof DefaultBase
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof DefaultBase
*/
@
Prop
()
public
loaddraftAction
!
:
string
;
/**
* 部件行为--load
*
* @type {string}
* @memberof DefaultBase
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof DefaultBase
*/
@
Prop
()
public
viewtag
!
:
string
;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof DefaultBase
*/
public
formState
:
Subject
<
any
>
=
new
Subject
();
/**
* 忽略表单项值变化
*
* @type {boolean}
* @memberof DefaultBase
*/
public
ignorefieldvaluechange
:
boolean
=
false
;
/**
* 数据变化
*
* @public
* @type {Subject<any>}
* @memberof DefaultBase
*/
public
dataChang
:
Subject
<
any
>
=
new
Subject
();
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof DefaultBase
*/
public
dataChangEvent
:
Subscription
|
undefined
;
/**
* 原始数据
*
* @public
* @type {*}
* @memberof DefaultBase
*/
public
oldData
:
any
=
{};
/**
* 表单数据对象
*
* @type {*}
* @memberof DefaultBase
*/
public
data
:
any
=
{
n_username_like
:
null
,
n_personname_like
:
null
,
n_authcode_eq
:
null
,
n_authtime_gtandeq
:
null
,
n_authtime_ltandeq
:
null
,
n_domain_like
:
null
,
};
/**
* 属性值规则
*
* @type {*}
* @memberof DefaultBase
*/
public
rules
:
any
=
{
n_username_like
:
[
{
type
:
'string'
,
message
:
'用户全局名(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'用户全局名(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'用户全局名(文本包含(%)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'用户全局名(文本包含(%)) 值不能为空'
,
trigger
:
'blur'
},
],
n_personname_like
:
[
{
type
:
'string'
,
message
:
'用户名称(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'用户名称(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'用户名称(文本包含(%)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'用户名称(文本包含(%)) 值不能为空'
,
trigger
:
'blur'
},
],
n_authcode_eq
:
[
{
type
:
'string'
,
message
:
'认证结果(等于(=)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'认证结果(等于(=)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证结果(等于(=)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证结果(等于(=)) 值不能为空'
,
trigger
:
'blur'
},
],
n_authtime_gtandeq
:
[
{
type
:
'string'
,
message
:
'认证时间(大于等于(>=)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'认证时间(大于等于(>=)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证时间(大于等于(>=)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证时间(大于等于(>=)) 值不能为空'
,
trigger
:
'blur'
},
],
n_authtime_ltandeq
:
[
{
type
:
'string'
,
message
:
'认证时间(小于等于(<=)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'认证时间(小于等于(<=)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证时间(小于等于(<=)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'认证时间(小于等于(<=)) 值不能为空'
,
trigger
:
'blur'
},
],
n_domain_like
:
[
{
type
:
'string'
,
message
:
'域(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'域(文本包含(%)) 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'域(文本包含(%)) 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'域(文本包含(%)) 值不能为空'
,
trigger
:
'blur'
},
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof DefaultBase
*/
public
detailsModel
:
any
=
{
formpage1
:
new
FormPageModel
({
caption
:
'常规条件'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
,
n_username_like
:
new
FormItemModel
({
caption
:
'用户全局名(文本包含(%))'
,
detailType
:
'FORMITEM'
,
name
:
'n_username_like'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
n_personname_like
:
new
FormItemModel
({
caption
:
'用户名称(文本包含(%))'
,
detailType
:
'FORMITEM'
,
name
:
'n_personname_like'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
n_authcode_eq
:
new
FormItemModel
({
caption
:
'认证结果(等于(=))'
,
detailType
:
'FORMITEM'
,
name
:
'n_authcode_eq'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
n_authtime_gtandeq
:
new
FormItemModel
({
caption
:
'认证时间(大于等于(>=))'
,
detailType
:
'FORMITEM'
,
name
:
'n_authtime_gtandeq'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
n_authtime_ltandeq
:
new
FormItemModel
({
caption
:
'认证时间(小于等于(<=))'
,
detailType
:
'FORMITEM'
,
name
:
'n_authtime_ltandeq'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
n_domain_like
:
new
FormItemModel
({
caption
:
'域(文本包含(%))'
,
detailType
:
'FORMITEM'
,
name
:
'n_domain_like'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
};
/**
* 监控表单属性 n_username_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_username_like'
)
onN_username_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_username_like'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 n_personname_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_personname_like'
)
onN_personname_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_personname_like'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 n_authcode_eq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_authcode_eq'
)
onN_authcode_eqChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_authcode_eq'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 n_authtime_gtandeq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_authtime_gtandeq'
)
onN_authtime_gtandeqChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_authtime_gtandeq'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 n_authtime_ltandeq 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_authtime_ltandeq'
)
onN_authtime_ltandeqChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_authtime_ltandeq'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 n_domain_like 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof DefaultBase
*/
@
Watch
(
'data.n_domain_like'
)
onN_domain_likeChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'n_domain_like'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 重置表单项值
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof DefaultBase
*/
public
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
/**
* 表单逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof DefaultBase
*/
public
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
/**
* 表单值变化
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @memberof DefaultBase
*/
public
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
if
(
this
.
ignorefieldvaluechange
)
{
return
;
}
this
.
resetFormData
({
name
:
name
,
newVal
:
newVal
,
oldVal
:
oldVal
});
this
.
formLogic
({
name
:
name
,
newVal
:
newVal
,
oldVal
:
oldVal
});
this
.
dataChang
.
next
(
JSON
.
stringify
(
this
.
data
));
}
/**
* 表单加载完成
*
* @public
* @param {*} [data={}]
* @memberof DefaultBase
*/
public
onFormLoad
(
data
:
any
=
{}):
void
{
this
.
setFormEnableCond
(
data
);
this
.
fillForm
(
data
);
this
.
formLogic
({
name
:
''
,
newVal
:
null
,
oldVal
:
null
});
}
/**
* 值填充
*
* @param {*} [_datas={}]
* @memberof DefaultBase
*/
public
fillForm
(
_datas
:
any
=
{}):
void
{
this
.
ignorefieldvaluechange
=
true
;
Object
.
keys
(
_datas
).
forEach
((
name
:
string
)
=>
{
if
(
this
.
data
.
hasOwnProperty
(
name
))
{
this
.
data
[
name
]
=
_datas
[
name
];
}
});
this
.
$nextTick
(
function
()
{
this
.
ignorefieldvaluechange
=
false
;
})
}
/**
* 设置表单项是否启用
*
* @public
* @param {*} data
* @memberof DefaultBase
*/
public
setFormEnableCond
(
data
:
any
):
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
if
(
!
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
return
;
}
const
formItem
:
FormItemModel
=
detail
;
formItem
.
setEnableCond
(
data
.
srfuf
);
});
}
/**
* 重置草稿表单状态
*
* @public
* @memberof DefaultBase
*/
public
resetDraftFormStates
():
void
{
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
form
.
resetFields
();
}
}
/**
* 重置校验结果
*
* @memberof DefaultBase
*/
public
resetValidates
():
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
if
(
!
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
return
;
}
const
formItem
:
FormItemModel
=
detail
;
formItem
.
setError
(
''
);
});
}
/**
* 填充校验结果 (后台)
*
* @param {any[]} fieldErrors
* @memberof DefaultBase
*/
public
fillValidates
(
fieldErrors
:
any
[]):
void
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
const
formItem
:
FormItemModel
=
this
.
detailsModel
[
error
.
field
];
if
(
!
formItem
)
{
return
;
}
this
.
$nextTick
(()
=>
{
formItem
.
setError
(
error
.
message
);
});
});
}
/**
* 表单校验状态
*
* @returns {boolean}
* @memberof DefaultBase
*/
public
formValidateStatus
():
boolean
{
const
form
:
any
=
this
.
$refs
.
searchform
;
let
validatestate
:
boolean
=
true
;
form
.
validate
((
valid
:
boolean
)
=>
{
validatestate
=
valid
?
true
:
false
;
});
return
validatestate
}
/**
* 获取全部值
*
* @returns {*}
* @memberof DefaultBase
*/
public
getValues
():
any
{
return
this
.
data
;
}
/**
* 表单项值变更
*
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof DefaultBase
*/
public
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
if
(
!
$event
)
{
return
;
}
if
(
!
$event
.
name
||
Object
.
is
(
$event
.
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
$event
.
name
))
{
return
;
}
this
.
data
[
$event
.
name
]
=
$event
.
value
;
}
/**
* 设置数据项值
*
* @param {string} name
* @param {*} value
* @returns {void}
* @memberof DefaultBase
*/
public
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
return
;
}
if
(
Object
.
is
(
this
.
data
[
name
],
value
))
{
return
;
}
this
.
data
[
name
]
=
value
;
}
/**
* 分组界面行为事件
*
* @param {*} $event
* @memberof DefaultBase
*/
public
groupUIActionClick
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
const
item
:
any
=
$event
.
item
;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof DefaultBase
*/
public
created
():
void
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof DefaultBase
*/
public
afterCreated
(){
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'autoload'
,
action
))
{
this
.
autoLoad
(
data
);
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
load
(
data
);
}
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
this
.
loadDraft
(
data
);
}
});
}
}
/**
* vue 生命周期
*
* @memberof DefaultBase
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof DefaultBase
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
if
(
this
.
dataChangEvent
)
{
this
.
dataChangEvent
.
unsubscribe
();
}
}
/**
* 自动加载
*
* @param {*} [arg={}]
* @returns {void}
* @memberof DefaultBase
*/
public
autoLoad
(
arg
:
any
=
{}):
void
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
arg
.
srfkey
});
this
.
load
(
arg
);
return
;
}
if
(
arg
.
srfkeys
&&
!
Object
.
is
(
arg
.
srfkeys
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
arg
.
srfkeys
});
this
.
load
(
arg
);
return
;
}
this
.
loadDraft
(
arg
);
}
/**
* 加载
*
* @public
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图搜索表单loadAction参数未配置'
});
return
;
}
const
arg
:
any
=
{
...
opt
};
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
get
(
this
.
loadAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
)
{
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
);
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
}
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
const
{
data
:
_data
}
=
response
;
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
});
}
/**
* 加载草稿
*
* @param {*} [opt={}]
* @memberof DefaultBase
*/
public
loadDraft
(
opt
:
any
=
{},
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图搜索表单loaddraftAction参数未配置'
});
return
;
}
const
arg
:
any
=
{
...
opt
}
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
const
data
=
response
.
data
;
this
.
resetDraftFormStates
();
this
.
onFormLoad
(
data
);
setTimeout
(()
=>
{
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
form
.
fields
.
forEach
((
field
:
any
)
=>
{
field
.
validateMessage
=
""
;
field
.
validateState
=
""
;
field
.
validateStatus
=
false
;
});
}
});
if
(
Object
.
is
(
mode
,
'RESET'
)){
if
(
!
this
.
formValidateStatus
())
{
return
;
}
}
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
const
{
data
:
_data
}
=
response
;
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
});
}
/**
* 表单项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof DefaultBase
*/
public
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
}
/**
* 回车事件
*
* @param {*} $event
* @memberof DefaultBase
*/
public
onEnter
(
$event
:
any
):
void
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'search'
,
this
.
data
);
}
/**
* 搜索
*
* @memberof DefaultBase
*/
public
onSearch
()
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
this
.
$emit
(
'search'
,
this
.
data
);
}
/**
* 重置
*
* @memberof DefaultBase
*/
public
onReset
()
{
this
.
loadDraft
({},
'RESET'
);
}
}
</
script
>
<
style
lang=
'less'
>
@import './default-searchform.less';
</
style
>
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/default-searchform/default-searchform-model.ts
0 → 100644
浏览文件 @
0d279c66
/**
* Default 部件模型
*
* @export
* @class DefaultModel
*/
export
default
class
DefaultModel
{
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof DefaultModel
*/
public
getDataItems
():
any
[]
{
return
[
{
name
:
'srfwfmemo'
,
prop
:
'srfwfmemo'
,
dataType
:
'TEXT'
,
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name
:
'srffrontuf'
,
prop
:
'srffrontuf'
,
dataType
:
'TEXT'
,
},
{
name
:
'n_username_like'
,
prop
:
'username'
,
dataType
:
'TEXT'
,
},
{
name
:
'n_personname_like'
,
prop
:
'personname'
,
dataType
:
'TEXT'
,
},
{
name
:
'n_authcode_eq'
,
prop
:
'authcode'
,
dataType
:
'SSCODELIST'
,
},
{
name
:
'n_authtime_gtandeq'
,
prop
:
'authtime'
,
dataType
:
'DATETIME'
,
},
{
name
:
'n_authtime_ltandeq'
,
prop
:
'authtime'
,
dataType
:
'DATETIME'
,
},
{
name
:
'n_domain_like'
,
prop
:
'domain'
,
dataType
:
'TEXT'
,
},
]
}
}
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/default-searchform/default-searchform-service.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
import
DefaultModel
from
'./default-searchform-model'
;
/**
* Default 部件服务对象
*
* @export
* @class DefaultService
*/
export
default
class
DefaultService
extends
ControlService
{
/**
* 认证日志服务对象
*
* @type {SysAuthLogService}
* @memberof DefaultService
*/
public
appEntityService
:
SysAuthLogService
=
new
SysAuthLogService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof DefaultService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of DefaultService.
*
* @param {*} [opts={}]
* @memberof DefaultService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
DefaultModel
();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof DefaultService
*/
private
doItems
(
promise
:
Promise
<
any
>
,
deKeyField
:
string
,
deName
:
string
):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
promise
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
)
{
const
data
=
response
.
data
;
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
item
[
deName
]
=
item
[
deKeyField
];
data
[
index
]
=
item
;
});
resolve
(
data
);
}
else
{
reject
([])
}
}).
catch
((
response
:
any
)
=>
{
reject
([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof DefaultService
*/
@
Errorlog
public
getItems
(
serviceName
:
string
,
interfaceName
:
string
,
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
return
Promise
.
reject
([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
wfstart
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
,
localdata
?:
any
):
Promise
<
any
>
{
data
=
this
.
handleWFData
(
data
);
context
=
this
.
handleRequestData
(
action
,
context
,
data
).
context
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
context
,
data
,
isloading
,
localdata
);
}
else
{
result
=
this
.
appEntityService
.
WFStart
(
context
,
data
,
isloading
,
localdata
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
wfsubmit
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
,
localdata
?:
any
):
Promise
<
any
>
{
data
=
this
.
handleWFData
(
data
,
true
);
context
=
this
.
handleRequestData
(
action
,
context
,
data
).
context
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
context
,
data
,
isloading
,
localdata
);
}
else
{
result
=
this
.
appEntityService
.
WFSubmit
(
context
,
data
,
isloading
,
localdata
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
add
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Create
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
delete
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Remove
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
update
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Update
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
get
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Get
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
loadDraft
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
//仿真主键数据
const
PrimaryKey
=
Util
.
createUUID
();
Data
.
logid
=
PrimaryKey
;
Data
.
sysauthlog
=
PrimaryKey
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
GetDraft
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
response
.
data
.
logid
=
PrimaryKey
;
this
.
handleResponse
(
action
,
response
,
true
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@
Errorlog
public
frontLogic
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
return
Promise
.
reject
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
'系统异常'
}
});
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
,
true
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof DefaultService
*/
public
handleRequestData
(
action
:
string
,
context
:
any
,
data
:
any
=
{}){
let
mode
:
any
=
this
.
getMode
();
if
(
!
mode
&&
mode
.
getDataItems
instanceof
Function
)
{
return
data
;
}
let
formItemItems
:
any
[]
=
mode
.
getDataItems
();
let
requestData
:
any
=
{};
formItemItems
.
forEach
((
item
:
any
)
=>
{
if
(
item
&&
item
.
dataType
&&
Object
.
is
(
item
.
dataType
,
'FONTKEY'
)){
if
(
item
&&
item
.
prop
){
requestData
[
item
.
prop
]
=
context
[
item
.
name
];
}
}
else
{
if
(
item
&&
item
.
prop
){
requestData
[
item
.
prop
]
=
data
[
item
.
name
];
}
}
});
if
(
data
&&
data
.
viewparams
){
Object
.
assign
(
requestData
,
data
.
viewparams
);
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
if
(
tempContext
&&
tempContext
.
srfsessionid
){
tempContext
.
srfsessionkey
=
tempContext
.
srfsessionid
;
delete
tempContext
.
srfsessionid
;
}
return
{
context
:
tempContext
,
data
:
requestData
};
}
}
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/default-searchform/default-searchform.less
0 → 100644
浏览文件 @
0d279c66
.ivu-tabs-no-animation>.ivu-tabs-content{
padding: 0 16px;
}
.ivu-card-head{
padding: 14px 0;
}
.app-search-form {
padding: 8px 14px 0;
.ivu-form-item{
margin-bottom: 8px;
}
.search_reset {
margin-right: 12px;
margin-bottom: 8px;
}
.search-button{
text-align: right;
}
}
.app-search-form-flex {
height: 100%;
> .ivu-row {
height: 100%;
> .ivu-tabs {
height: 100%;
display: flex;
flex-direction: column;
> .ivu-tabs-content {
flex-grow: 1;
overflow: auto;
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
}
}
.app-tabpanel-flex {
height: 100%;
> .ivu-tabs-content {
height: calc(100% - 52px);
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
// this is less
app_Web/src/widgets/sys-auth-log/default-searchform/default-searchform.vue
0 → 100644
浏览文件 @
0d279c66
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
DefaultBase
from
'./default-searchform-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
Default
extends
DefaultBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/main-grid/main-grid-base.vue
0 → 100644
浏览文件 @
0d279c66
<
template
>
<div
class=
'grid'
style=
"height:100%;"
>
<i-form>
<el-table
v-if=
"isDisplay === true"
:default-sort=
"
{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:height="isEnablePagingBar
&&
items.length > 0 ? 'calc(100% - 50px)' : '100%'"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template
slot=
"empty"
>
无数据
<span
class=
"quick-toolbar"
>
</span>
</
template
>
<
template
v-if=
"!isSingleSelect"
>
<el-table-column
align=
"center"
type=
'selection'
:width=
"checkboxColWidth"
></el-table-column>
</
template
>
<
template
v-if=
"getColumnState('username')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'username'"
:label=
"$t('entities.sysauthlog.main_grid.columns.username')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.username'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
username
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('personname')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'personname'"
:label=
"$t('entities.sysauthlog.main_grid.columns.personname')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.personname'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
personname
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('authtime')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'authtime'"
:label=
"$t('entities.sysauthlog.main_grid.columns.authtime')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.authtime'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<app-format-data
format=
"YYYY-MM-DD hh:mm:ss"
:data=
"row.authtime"
></app-format-data>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('authcode')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'authcode'"
:label=
"$t('entities.sysauthlog.main_grid.columns.authcode')"
:width=
"100"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.authcode'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<template
>
<codelist
:value=
"row.authcode"
tag=
'CLAuthCode'
codelistType=
'STATIC'
></codelist>
</
template
>
</template>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('ipaddr')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'ipaddr'"
:label=
"$t('entities.sysauthlog.main_grid.columns.ipaddr')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.ipaddr'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
ipaddr
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('macaddr')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'macaddr'"
:label=
"$t('entities.sysauthlog.main_grid.columns.macaddr')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.macaddr'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
macaddr
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('useragent')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'useragent'"
:label=
"$t('entities.sysauthlog.main_grid.columns.useragent')"
:width=
"250"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.useragent'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
useragent
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"getColumnState('domain')"
>
<el-table-column
show-overflow-tooltip
:prop=
"'domain'"
:label=
"$t('entities.sysauthlog.main_grid.columns.domain')"
:width=
"100"
:align=
"'left'"
:sortable=
"'custom'"
>
<template
v-slot:header=
"
{column}">
<span
class=
"column-header "
>
{{
$t
(
'entities.sysauthlog.main_grid.columns.domain'
)
}}
</span>
</
template
>
<
template
v-slot=
"{row,column,$index}"
>
<span>
{{
row
.
domain
}}
</span>
</
template
>
</el-table-column>
</template>
<
template
v-if=
"adaptiveState"
>
<el-table-column></el-table-column>
</
template
>
</el-table>
</i-form>
<row
class=
'grid-pagination'
v-show=
"items.length > 0"
>
<page
class=
'pull-right'
@
on-change=
"pageOnChange($event)"
@
on-page-size-change=
"onPageSizeChange($event)"
:transfer=
"true"
:total=
"totalrow"
show-sizer
:current=
"curPage"
:page-size=
"limit"
:page-size-opts=
"[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]"
show-elevator
show-total
>
<span>
<span
class=
"page-column"
>
<poptip
transfer
placement=
"top-start"
>
<i-button
icon=
"md-menu"
>
{{$t('app.gridpage.choicecolumns')}}
</i-button>
<div
slot=
"content"
>
<
template
v-for=
"col in allColumns"
>
<div
:key=
"col.name"
><el-checkbox
v-model=
"col.show"
@
change=
"onColChange()"
>
{{
$t
(
col
.
langtag
)
}}
</el-checkbox></div>
</
template
>
</div>
</poptip>
</span>
<span
v-if=
"selections.length > 0"
class=
"batch-toolbar"
>
</span>
<span
class=
"page-button"
><i-button
icon=
"md-refresh"
:title=
"$t('app.gridpage.refresh')"
@
click=
"pageRefresh()"
></i-button></span>
<span>
{{$t('app.gridpage.show')}}
<span>
<
template
v-if=
"items.length === 1"
>
1
</
template
>
<
template
v-else
>
<span>
{{
(
curPage
-
1
)
*
limit
+
1
}}
-
{{
totalrow
>
curPage
*
limit
?
curPage
*
limit
:
totalrow
}}
</span>
</
template
>
</span>
{{$t('app.gridpage.records')}},{{$t('app.gridpage.totle')}}
{{totalrow}}
{{$t('app.gridpage.records')}}
</span>
</span>
</page>
</row>
</div>
</template>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Model
}
from
'vue-property-decorator'
;
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
import
MainService
from
'./main-grid-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
@
Component
({
components
:
{
}
})
export
default
class
MainBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Main
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof Main
*/
@
Prop
()
public
context
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof Main
*/
@
Prop
()
public
viewparams
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Main
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Main
*/
public
getControlType
():
string
{
return
'GRID'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Main
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof Main
*/
public
service
:
MainService
=
new
MainService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {SysAuthLogService}
* @memberof Main
*/
public
appEntityService
:
SysAuthLogService
=
new
SysAuthLogService
({
$store
:
this
.
$store
});
/**
* 关闭视图
*
* @param {any} args
* @memberof Main
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof Main
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof Main
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Main
*/
public
getDatas
():
any
[]
{
return
this
.
selections
;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Main
*/
public
getData
():
any
{
return
this
.
selections
[
0
];
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof Main
*/
@
Prop
()
public
newdata
:
any
;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof Main
*/
@
Prop
()
public
opendata
:
any
;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Main
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 部件行为--update
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
updateAction
!
:
string
;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
fetchAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
removeAction
!
:
string
;
/**
* 部件行为--load
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
loaddraftAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
createAction
!
:
string
;
/**
* 当前页
*
* @type {number}
* @memberof Main
*/
public
curPage
:
number
=
1
;
/**
* 数据
*
* @type {any[]}
* @memberof Main
*/
public
items
:
any
[]
=
[];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof Main
*/
public
isEnablePagingBar
:
boolean
=
true
;
/**
* 是否禁用排序
*
* @type {boolean}
* @memberof Main
*/
public
isNoSort
:
boolean
=
false
;
/**
* 排序方向
*
* @type {string}
* @memberof Main
*/
public
minorSortDir
:
string
=
'DESC'
;
/**
* 排序字段
*
* @type {string}
* @memberof Main
*/
public
minorSortPSDEF
:
string
=
'authtime'
;
/**
* 分页条数
*
* @type {number}
* @memberof Main
*/
public
limit
:
number
=
20
;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof Main
*/
public
isHideHeader
:
boolean
=
false
;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof Main
*/
@
Prop
({
default
:
false
})
public
isSelectFirstDefault
!
:
boolean
;
/**
* 是否单选
*
* @type {boolean}
* @memberof Main
*/
@
Prop
()
public
isSingleSelect
?:
boolean
;
/**
* 选中数据字符串
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
selectedData
?:
string
;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof MainTree
*/
@
Watch
(
'selectedData'
)
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
selections
=
[];
if
(
this
.
selectedData
){
const
refs
:
any
=
this
.
$refs
;
if
(
refs
.
multipleTable
)
{
refs
.
multipleTable
.
clearSelection
();
JSON
.
parse
(
this
.
selectedData
).
forEach
((
selection
:
any
)
=>
{
let
selectedItem
=
this
.
items
.
find
((
item
:
any
)
=>
{
return
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
);
});
if
(
selectedItem
){
this
.
rowClick
(
selectedItem
);
}
});
}
}
}
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof Main
*/
@
Prop
({
default
:
2
})
public
gridRowActiveMode
!
:
number
;
/**
* 是否开启行编辑
*
* @type {boolean}
* @memberof Main
*/
@
Prop
({
default
:
false
})
public
isOpenEdit
!
:
boolean
;
/**
* 实际是否开启行编辑
*
* @type {boolean}
* @memberof Main
*/
public
actualIsOpenEdit
:
boolean
=
this
.
isOpenEdit
;
/**
* 总条数
*
* @type {number}
* @memberof Main
*/
public
totalrow
:
number
=
0
;
/**
* 选中行数据
*
* @type {any[]}
* @memberof Main
*/
public
selections
:
any
[]
=
[];
/**
* 拦截行选中
*
* @type {boolean}
* @memberof Main
*/
public
stopRowClick
:
boolean
=
false
;
/**
* 表格是否显示
*
* @type {boolean}
* @memberof Main
*/
public
isDisplay
:
boolean
=
true
;
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Main
*/
public
refresh
(
args
:
any
[]):
void
{
this
.
load
();
}
/**
* 选项框列宽
*
* @type {number}
* @memberof AppIndex
*/
public
checkboxColWidth
:
number
=
50
;
/**
* 是否允许拖动列宽
*
* @type {boolean}
* @memberof AppEmbedPicker
*/
public
isDragendCol
:
boolean
=
false
;
/**
* 所有列成员
*
* @type {any[]}
* @memberof Main
*/
public
allColumns
:
any
[]
=
[
{
name
:
'username'
,
label
:
'用户全局名'
,
langtag
:
'entities.sysauthlog.main_grid.columns.username'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'personname'
,
label
:
'用户名称'
,
langtag
:
'entities.sysauthlog.main_grid.columns.personname'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'authtime'
,
label
:
'认证时间'
,
langtag
:
'entities.sysauthlog.main_grid.columns.authtime'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'authcode'
,
label
:
'认证结果'
,
langtag
:
'entities.sysauthlog.main_grid.columns.authcode'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'ipaddr'
,
label
:
'IP地址'
,
langtag
:
'entities.sysauthlog.main_grid.columns.ipaddr'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'macaddr'
,
label
:
'MAC地址'
,
langtag
:
'entities.sysauthlog.main_grid.columns.macaddr'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'useragent'
,
label
:
'客户端'
,
langtag
:
'entities.sysauthlog.main_grid.columns.useragent'
,
show
:
true
,
util
:
'PX'
},
{
name
:
'domain'
,
label
:
'域'
,
langtag
:
'entities.sysauthlog.main_grid.columns.domain'
,
show
:
true
,
util
:
'PX'
},
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Main
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取表格行模型
*
* @type {*}
* @memberof Main
*/
public
getGridRowModel
(){
return
{
srfkey
:
new
FormItemModel
(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof Main
*/
public
rules
:
any
=
{
srfkey
:
[
{
required
:
false
,
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
return
(
rule
.
required
&&
(
value
===
null
||
value
===
undefined
||
value
===
""
))
?
false
:
true
;},
message
:
'标识 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
return
(
rule
.
required
&&
(
value
===
null
||
value
===
undefined
||
value
===
""
))
?
false
:
true
;},
message
:
'标识 值不能为空'
,
trigger
:
'blur'
},
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
* @returns Promise<any>
*
* @memberof Main
*/
public
validate
(
property
:
string
,
data
:
any
,
rowIndex
:
number
):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$util
.
validateItem
(
property
,
data
,
this
.
rules
).
then
(()
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
null
);
resolve
(
true
);
}).
catch
(({
errors
,
fields
})
=>
{
this
.
gridItemsModel
[
rowIndex
][
property
].
setError
(
errors
[
0
].
message
);
resolve
(
false
);
});
});
}
/**
* 校验所有修改过的编辑项
*
* @returns Promise<any>
* @memberof Main
*/
public
async
validateAll
(){
let
validateState
=
true
;
let
index
=
-
1
;
for
(
let
item
of
this
.
items
){
index
++
;
if
(
item
.
rowDataState
===
"create"
||
item
.
rowDataState
===
"update"
){
for
(
let
property
of
Object
.
keys
(
this
.
rules
)){
if
(
!
await
this
.
validate
(
property
,
item
,
index
)){
validateState
=
false
;
}
}
}
}
return
validateState
;
}
/**
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof Main
*/
public
load
(
opt
:
any
=
{},
pageReset
:
boolean
=
false
):
void
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图表格fetchAction参数未配置'
});
return
;
}
if
(
pageReset
){
this
.
curPage
=
1
;
}
const
arg
:
any
=
{...
opt
};
const
page
:
any
=
{};
if
(
this
.
isEnablePagingBar
)
{
Object
.
assign
(
page
,
{
page
:
this
.
curPage
-
1
,
size
:
this
.
limit
});
}
// 设置排序
if
(
!
this
.
isNoSort
&&
!
Object
.
is
(
this
.
minorSortDir
,
''
)
&&
!
Object
.
is
(
this
.
minorSortPSDEF
,
''
))
{
const
sort
:
string
=
this
.
minorSortPSDEF
+
","
+
this
.
minorSortDir
;
Object
.
assign
(
page
,
{
sort
:
sort
});
}
Object
.
assign
(
arg
,
page
);
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:{};
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
}
return
;
}
const
data
:
any
=
response
.
data
;
this
.
totalrow
=
response
.
total
;
this
.
items
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 清空selections,gridItemsModel
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
setTimeout
(()
=>
{
if
(
_this
.
isSelectFirstDefault
){
_this
.
rowClick
(
_this
.
items
[
0
]);
}
if
(
_this
.
selectedData
){
const
refs
:
any
=
_this
.
$refs
;
if
(
refs
.
multipleTable
)
{
refs
.
multipleTable
.
clearSelection
();
JSON
.
parse
(
_this
.
selectedData
).
forEach
((
selection
:
any
)
=>
{
let
selectedItem
=
_this
.
items
.
find
((
item
:
any
)
=>
{
return
Object
.
is
(
item
.
srfkey
,
selection
.
srfkey
);
});
if
(
selectedItem
){
_this
.
rowClick
(
selectedItem
);
}
});
}
}
},
300
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
});
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof Main
*/
public
async
remove
(
datas
:
any
[]):
Promise
<
any
>
{
if
(
!
this
.
removeAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图表格removeAction参数未配置'
});
return
;
}
let
_datas
:
any
[]
=
[];
datas
.
forEach
((
record
:
any
,
index
:
number
)
=>
{
if
(
!
record
.
srfkey
)
{
this
.
items
.
some
((
val
:
any
,
num
:
number
)
=>
{
if
(
JSON
.
stringify
(
val
)
==
JSON
.
stringify
(
record
)){
this
.
items
.
splice
(
num
,
1
);
this
.
gridItemsModel
.
splice
(
num
,
1
);
return
true
;
}
});
}
else
{
_datas
.
push
(
datas
[
index
]);
}
});
if
(
_datas
.
length
===
0
)
{
return
;
}
let
dataInfo
=
''
;
_datas
.
forEach
((
record
:
any
,
index
:
number
)
=>
{
let
srfmajortext
=
record
.
username
;
if
(
index
<
5
)
{
if
(
!
Object
.
is
(
dataInfo
,
''
))
{
dataInfo
+=
'、'
;
}
dataInfo
+=
srfmajortext
;
}
else
{
return
false
;
}
});
if
(
_datas
.
length
<
5
)
{
dataInfo
=
dataInfo
+
' 共'
+
_datas
.
length
+
'条数据'
;
}
else
{
dataInfo
=
dataInfo
+
'...'
+
' 共'
+
_datas
.
length
+
'条数据'
;
}
const
removeData
=
()
=>
{
let
keys
:
any
[]
=
[];
_datas
.
forEach
((
data
:
any
)
=>
{
keys
.
push
(
data
.
srfkey
);
});
let
_removeAction
=
keys
.
length
>
1
?
'removeBatch'
:
this
.
removeAction
;
let
_keys
=
keys
.
length
>
1
?
keys
:
keys
[
0
]
;
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
post
:
Promise
<
any
>
=
this
.
service
.
delete
(
_removeAction
,
Object
.
assign
(
context
,{
sysauthlog
:
_keys
}),
Object
.
assign
({
sysauthlog
:
_keys
},{
viewparams
:
this
.
viewparams
}),
this
.
showBusyIndicator
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
'删除数据失败,'
+
response
.
info
});
return
;
}
else
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
'删除成功!'
});
}
//删除items中已删除的项
console
.
log
(
this
.
items
);
_datas
.
forEach
((
data
:
any
)
=>
{
this
.
items
.
some
((
item
:
any
,
index
:
number
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
data
.
srfkey
)){
this
.
items
.
splice
(
index
,
1
);
this
.
gridItemsModel
.
splice
(
index
,
1
);
return
true
;
}
});
});
this
.
totalrow
-=
_datas
.
length
;
this
.
$emit
(
'remove'
,
null
);
this
.
selections
=
[];
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
});
}
dataInfo
=
dataInfo
.
replace
(
/
[
null
]
/g
,
''
).
replace
(
/
[
undefined
]
/g
,
''
);
this
.
$Modal
.
confirm
({
title
:
'警告'
,
content
:
'确认要删除 '
+
dataInfo
+
',删除操作将不可恢复?'
,
onOk
:
()
=>
{
removeData
();
},
onCancel
:
()
=>
{
}
});
return
removeData
;
}
/**
* 批量添加
*
* @param {*} [arg={}]
* @memberof Main
*/
public
addBatch
(
arg
:
any
=
{}):
void
{
if
(
!
this
.
fetchAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图表格fetchAction参数未配置'
});
return
;
}
if
(
!
arg
){
arg
=
{};
}
console
.
error
(
"批量添加未实现"
);
}
/**
* 数据导入
*
* @param {*} data
* @memberof Main
*/
public
importExcel
(
data
:
any
=
{}):
void
{
//导入excel
const
importDataModel
:
any
=
{
}
if
(
Object
.
keys
(
importDataModel
).
length
==
0
){
this
.
$Notice
.
warning
({
'title'
:
(
this
.
$t
(
"app.utilview.warning"
)
as
string
),
'desc'
:
(
this
.
$t
(
"app.utilview.info"
)
as
string
)
});
return
;
}
const
view
:
any
=
{
viewname
:
'app-data-upload'
,
title
:
this
.
$t
(
"app.utilview.importview"
),
width
:
900
,
height
:
700
}
let
container
:
Subject
<
any
>
=
this
.
$appmodal
.
openModal
(
view
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
importDataModel
);
container
.
subscribe
((
result
:
any
)
=>
{
if
(
Object
.
is
(
result
.
ret
,
'OK'
)){
this
.
refresh
(
result
.
datas
);
}
});
}
/**
* 数据导出
*
* @param {*} data
* @memberof Main
*/
public
exportExcel
(
data
:
any
=
{}):
void
{
// 导出Excel
const
doExport
=
async
(
_data
:
any
)
=>
{
const
tHeader
:
Array
<
any
>
=
[];
const
filterVal
:
Array
<
any
>
=
[];
this
.
allColumns
.
forEach
((
item
:
any
)
=>
{
item
.
show
&&
item
.
label
?
tHeader
.
push
(
this
.
$t
(
item
.
langtag
))
:
""
;
item
.
show
&&
item
.
name
?
filterVal
.
push
(
item
.
name
)
:
""
;
});
const
data
=
await
this
.
formatExcelData
(
filterVal
,
_data
);
this
.
$export
.
exportExcel
().
then
((
excel
:
any
)
=>
{
excel
.
export_json_to_excel
({
header
:
tHeader
,
//表头 必填
data
,
//具体数据 必填
filename
:
"认证日志表"
,
//非必填
autoWidth
:
true
,
//非必填
bookType
:
"xlsx"
//非必填
});
});
};
const
page
:
any
=
{};
// 设置page,size
if
(
Object
.
is
(
data
.
type
,
'maxRowCount'
))
{
Object
.
assign
(
page
,
{
page
:
0
,
size
:
data
.
maxRowCount
});
}
else
if
(
Object
.
is
(
data
.
type
,
'activatedPage'
))
{
try
{
doExport
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
items
)));
}
catch
(
error
)
{
console
.
error
(
error
);
}
return
;
}
// 设置排序
if
(
!
this
.
isNoSort
&&
!
Object
.
is
(
this
.
minorSortDir
,
''
)
&&
!
Object
.
is
(
this
.
minorSortPSDEF
,
''
))
{
const
sort
:
string
=
this
.
minorSortPSDEF
+
","
+
this
.
minorSortDir
;
Object
.
assign
(
page
,
{
sort
:
sort
});
}
const
arg
:
any
=
{};
Object
.
assign
(
arg
,
page
);
// 获取query,搜索表单,viewparams等父数据
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
''
,
desc
:
'数据导出失败,'
+
response
.
info
});
return
;
}
try
{
doExport
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
catch
(
error
)
{
console
.
error
(
error
);
}
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
''
,
desc
:
'数据导出失败'
});
});
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @returns {[]}
* @memberof Main
*/
public
async
formatExcelData
(
filterVal
:
any
,
jsonData
:
any
)
{
let
codelistColumns
:
Array
<
any
>
=
[
{
name
:
'authcode'
,
srfkey
:
'CLAuthCode'
,
codelistType
:
'STATIC'
,
renderMode
:
'other'
,
textSeparator
:
'、'
,
valueSeparator
:
','
,
},
];
let
_this
=
this
;
for
(
const
codelist
of
codelistColumns
)
{
// 动态代码表处理
if
(
Object
.
is
(
codelist
.
codelistType
,
"DYNAMIC"
))
{
let
items
=
await
_this
.
codeListService
.
getItems
(
codelist
.
srfkey
);
jsonData
.
forEach
((
row
:
any
)
=>
{
row
[
codelist
.
name
]
=
_this
.
getCodelistValue
(
items
,
row
[
codelist
.
name
],
codelist
);
});
// 静态处理
}
else
if
(
Object
.
is
(
codelist
.
codelistType
,
"STATIC"
)){
let
items
=
await
_this
.
$store
.
getters
.
getCodeListItems
(
codelist
.
srfkey
);
jsonData
.
forEach
((
row
:
any
)
=>
{
row
[
codelist
.
name
]
=
_this
.
getCodelistValue
(
items
,
row
[
codelist
.
name
],
codelist
);
});
}
}
return
jsonData
.
map
((
v
:
any
)
=>
filterVal
.
map
((
j
:
any
)
=>
v
[
j
]))
}
/**
* 解析代码表和vlaue,设置items
*
* @public
* @param {any[]} items 代码表数据
* @param {*} value
* @returns {*}
* @memberof Main
*/
public
getCodelistValue
(
items
:
any
[],
value
:
any
,
codelist
:
any
,){
if
(
!
value
){
return
this
.
$t
(
'codelist.'
+
codelist
.
srfkey
+
'.empty'
);
}
if
(
items
)
{
let
result
:
any
=
[];
if
(
Object
.
is
(
codelist
.
renderMode
,
"number"
)){
items
.
map
((
_item
:
any
,
index
:
number
)
=>
{
const
nValue
=
parseInt
((
value
as
any
),
10
);
const
codevalue
=
_item
.
value
;
if
((
parseInt
(
codevalue
,
10
)
&
nValue
)
>
0
){
result
.
push
(
_item
);
}
});
}
else
if
(
Object
.
is
(
codelist
.
renderMode
,
"string"
)){
const
arrayValue
:
Array
<
any
>
=
(
value
as
any
).
split
(
codelist
.
valueSeparator
);
arrayValue
.
map
((
value
:
any
,
index
:
number
)
=>
{
result
.
push
([]);
let
values
:
any
[]
=
Object
.
is
(
this
.
$util
.
typeOf
(
value
),
'number'
)
?
[
value
]
:
[...(
value
as
any
).
split
(
codelist
.
valueSeparator
)];
values
.
map
((
val
:
any
,
num
:
number
)
=>
{
const
item
=
this
.
getItem
(
items
,
val
,
codelist
);
if
(
item
){
result
[
index
].
push
(
item
);
}
});
});
}
else
{
let
values
:
any
[]
=
Object
.
is
(
this
.
$util
.
typeOf
(
value
),
'number'
)
?
[
value
]
:
[...(
value
as
any
).
split
(
codelist
.
valueSeparator
)];
values
.
map
((
value
:
any
,
index
:
number
)
=>
{
const
item
=
this
.
getItem
(
items
,
value
,
codelist
);
if
(
item
){
result
.
push
(
item
);
}
});
}
// 设置items
if
(
result
.
length
!=
0
){
return
result
.
join
(
codelist
.
valueSeparator
);
}
else
{
return
value
;
}
}
}
/**
* 获取代码项
*
* @public
* @param {any[]} items
* @param {*} value
* @returns {*}
* @memberof Main
*/
public
getItem
(
items
:
any
[],
value
:
any
,
codelist
:
any
):
any
{
const
arr
:
Array
<
any
>
=
items
.
filter
(
item
=>
{
return
item
.
value
==
value
});
if
(
arr
.
length
!==
1
)
{
return
undefined
;
}
if
(
Object
.
is
(
codelist
.
codelistType
,
'STATIC'
)){
return
this
.
$t
(
'codelist.'
+
codelist
.
srfkey
+
'.'
+
arr
[
0
].
value
);
}
else
{
return
arr
[
0
].
text
;
}
}
/**
* 生命周期
*
* @memberof Main
*/
public
created
():
void
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof Main
*/
public
afterCreated
(){
this
.
setColState
();
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
load
(
data
);
}
if
(
Object
.
is
(
'remove'
,
action
))
{
this
.
remove
(
data
);
}
if
(
Object
.
is
(
'save'
,
action
))
{
this
.
save
(
data
);
}
});
}
}
/**
* vue 生命周期
*
* @memberof Main
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Main
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
}
/**
* 获取选中行胡数据
*
* @returns {any[]}
* @memberof Main
*/
public
getSelection
():
any
[]
{
return
this
.
selections
;
}
/**
* 行双击事件
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public
rowDBLClick
(
$event
:
any
):
void
{
if
(
!
$event
||
this
.
actualIsOpenEdit
||
Object
.
is
(
this
.
gridRowActiveMode
,
0
))
{
return
;
}
this
.
selections
=
[];
this
.
selections
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
$event
)));
const
refs
:
any
=
this
.
$refs
;
if
(
refs
.
multipleTable
)
{
refs
.
multipleTable
.
clearSelection
();
refs
.
multipleTable
.
toggleRowSelection
(
$event
);
}
this
.
$emit
(
'rowdblclick'
,
this
.
selections
);
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
/**
* 复选框数据选中
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public
select
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
this
.
selections
=
[];
this
.
selections
=
[...
JSON
.
parse
(
JSON
.
stringify
(
$event
))];
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
/**
* 复选框数据全部选中
*
* @param {*} $event
* @memberof Main
*/
public
selectAll
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
this
.
selections
=
[];
this
.
selections
=
[...
JSON
.
parse
(
JSON
.
stringify
(
$event
))];
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
/**
* 行单击选中
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public
rowClick
(
$event
:
any
,
ifAlways
:
boolean
=
false
):
void
{
if
(
!
ifAlways
&&
(
!
$event
||
this
.
actualIsOpenEdit
))
{
return
;
}
if
(
this
.
stopRowClick
)
{
this
.
stopRowClick
=
false
;
return
;
}
if
(
this
.
isSingleSelect
){
this
.
selections
=
[];
}
// 已选中则删除,没选中则添加
let
selectIndex
=
this
.
selections
.
findIndex
((
item
:
any
)
=>
{
return
Object
.
is
(
item
.
sys_authlog
,
$event
.
sys_authlog
);
});
if
(
Object
.
is
(
selectIndex
,
-
1
)){
this
.
selections
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
$event
)));
}
else
{
this
.
selections
.
splice
(
selectIndex
,
1
);
}
const
refs
:
any
=
this
.
$refs
;
if
(
refs
.
multipleTable
)
{
if
(
this
.
isSingleSelect
){
refs
.
multipleTable
.
clearSelection
();
refs
.
multipleTable
.
setCurrentRow
(
$event
);
}
else
{
refs
.
multipleTable
.
toggleRowSelection
(
$event
);
}
}
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
/**
* 页面变化
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public
pageOnChange
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
if
(
$event
===
this
.
curPage
)
{
return
;
}
this
.
curPage
=
$event
;
this
.
load
({});
}
/**
* 分页条数变化
*
* @param {*} $event
* @returns {void}
* @memberof Main
*/
public
onPageSizeChange
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
if
(
$event
===
this
.
limit
)
{
return
;
}
this
.
limit
=
$event
;
if
(
this
.
curPage
===
1
)
{
this
.
load
({});
}
}
/**
* 分页刷新
*
* @memberof Main
*/
public
pageRefresh
():
void
{
this
.
load
({});
}
/**
* 排序变化
*
* @param {{ column: any, prop: any, order: any }} { column, prop, order }
* @memberof Main
*/
public
onSortChange
({
column
,
prop
,
order
}:
{
column
:
any
,
prop
:
any
,
order
:
any
}):
void
{
const
dir
=
Object
.
is
(
order
,
'ascending'
)
?
'asc'
:
Object
.
is
(
order
,
'descending'
)
?
'desc'
:
''
;
if
(
Object
.
is
(
dir
,
this
.
minorSortDir
)
&&
Object
.
is
(
this
.
minorSortPSDEF
,
prop
))
{
return
;
}
this
.
minorSortDir
=
dir
;
this
.
minorSortPSDEF
=
prop
?
prop
:
''
;
this
.
load
({});
}
/**
* 表格行选中样式
*
* @param {{ row: any, rowIndex: any }} { row, rowIndex }
* @returns {string}
* @memberof Main
*/
public
onRowClassName
({
row
,
rowIndex
}:
{
row
:
any
,
rowIndex
:
any
}):
string
{
const
index
=
this
.
selections
.
findIndex
((
select
:
any
)
=>
Object
.
is
(
select
.
srfkey
,
row
.
srfkey
));
return
index
!==
-
1
?
'grid-row-select'
:
''
;
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof Main
*/
public
uiAction
(
row
:
any
,
tag
:
any
,
$event
:
any
)
{
// this.rowClick(row, true);
}
/**
* 设置列状态
*
* @memberof Main
*/
public
setColState
()
{
const
_data
:
any
=
localStorage
.
getItem
(
'sys_authlog_main_grid'
);
if
(
_data
)
{
let
columns
=
JSON
.
parse
(
_data
);
columns
.
forEach
((
col
:
any
)
=>
{
let
column
=
this
.
allColumns
.
find
((
item
)
=>
Object
.
is
(
col
.
name
,
item
.
name
));
if
(
column
)
{
Object
.
assign
(
column
,
col
);
}
});
}
}
/**
* 列变化
*
* @memberof Main
*/
public
onColChange
()
{
localStorage
.
setItem
(
'sys_authlog_main_grid'
,
JSON
.
stringify
(
this
.
allColumns
));
}
/**
* 获取列状态
*
* @param {string} name
* @returns {boolean}
* @memberof Main
*/
public
getColumnState
(
name
:
string
):
boolean
{
let
column
=
this
.
allColumns
.
find
((
col
:
any
)
=>
Object
.
is
(
name
,
col
.
name
)
);
return
column
.
show
?
true
:
false
;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof Main
*/
get
adaptiveState
():
boolean
{
return
!
this
.
allColumns
.
find
((
column
:
any
)
=>
column
.
show
&&
Object
.
is
(
column
.
util
,
'STAR'
));
}
/**
* 保存
*
* @param {*} $event
* @returns {Promise<any>}
* @memberof Main
*/
public
async
save
(
args
:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
){
let
_this
=
this
;
if
(
!
await
this
.
validateAll
()){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'值规则校验异常'
});
return
[];
}
let
successItems
:
any
=
[];
let
errorItems
:
any
=
[];
let
errorMessage
:
any
=
[];
for
(
const
item
of
_this
.
items
)
{
try
{
if
(
Object
.
is
(
item
.
rowDataState
,
'create'
)){
if
(
!
this
.
createAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图表格createAction参数未配置'
});
}
else
{
Object
.
assign
(
item
,{
viewparams
:
this
.
viewparams
});
let
response
=
await
this
.
service
.
add
(
this
.
createAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
successItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
}
else
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
if
(
!
this
.
updateAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'SysAuthLogGridView视图表格updateAction参数未配置'
});
}
else
{
Object
.
assign
(
item
,{
viewparams
:
this
.
viewparams
});
if
(
item
.
sysauthlog
){
Object
.
assign
(
this
.
context
,{
sysauthlog
:
item
.
sysauthlog
});
}
let
response
=
await
this
.
service
.
add
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
successItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
}
}
catch
(
error
)
{
errorItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
item
)));
errorMessage
.
push
(
error
);
}
}
this
.
$emit
(
'save'
,
successItems
);
this
.
refresh
([]);
if
(
errorItems
.
length
===
0
){
this
.
$Notice
.
success
({
title
:
''
,
desc
:
'保存成功!'
});
}
else
{
errorItems
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
$Notice
.
error
({
title
:
'保存失败'
,
desc
:
item
.
majorentityname
+
'保存失败!'
});
console
.
error
(
errorMessage
[
index
]);
});
}
return
successItems
;
}
/**
* 获取对应行class
*
* @param {*} $args row 行数据,rowIndex 行索引
* @returns {void}
* @memberof Main
*/
public
getRowClassName
(
args
:{
row
:
any
,
rowIndex
:
number
}){
let
isSelected
=
this
.
selections
.
some
((
item
:
any
)
=>
{
return
Object
.
is
(
item
.
sysauthlog
,
args
.
row
.
sysauthlog
);
});
return
isSelected
?
"grid-selected-row"
:
""
;
}
}
</
script
>
<
style
lang=
'less'
>
@import './main-grid.less';
</
style
>
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/main-grid/main-grid-model.ts
0 → 100644
浏览文件 @
0d279c66
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export
default
class
MainModel
{
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof MainGridMode
*/
public
isDEExport
:
boolean
=
false
;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainGridMode
*/
public
getDataItems
():
any
[]
{
if
(
this
.
isDEExport
){
return
[
]
}
else
{
return
[
{
name
:
'macaddr'
,
prop
:
'macaddr'
,
dataType
:
'TEXT'
,
},
{
name
:
'authtime'
,
prop
:
'authtime'
,
dataType
:
'DATETIME'
,
},
{
name
:
'username'
,
prop
:
'username'
,
dataType
:
'TEXT'
,
},
{
name
:
'useragent'
,
prop
:
'useragent'
,
dataType
:
'TEXT'
,
},
{
name
:
'ipaddr'
,
prop
:
'ipaddr'
,
dataType
:
'TEXT'
,
},
{
name
:
'authcode'
,
prop
:
'authcode'
,
dataType
:
'SSCODELIST'
,
},
{
name
:
'domain'
,
prop
:
'domain'
,
dataType
:
'TEXT'
,
},
{
name
:
'personname'
,
prop
:
'personname'
,
dataType
:
'TEXT'
,
},
{
name
:
'srfmajortext'
,
prop
:
'username'
,
dataType
:
'TEXT'
,
},
{
name
:
'srfdataaccaction'
,
prop
:
'logid'
,
dataType
:
'TEXT'
,
},
{
name
:
'srfkey'
,
prop
:
'logid'
,
dataType
:
'TEXT'
,
},
{
name
:
'sysauthlog'
,
prop
:
'logid'
,
},
{
name
:
'n_username_like'
,
prop
:
'n_username_like'
,
dataType
:
'TEXT'
,
},
{
name
:
'n_personname_like'
,
prop
:
'n_personname_like'
,
dataType
:
'TEXT'
,
},
{
name
:
'n_authcode_eq'
,
prop
:
'n_authcode_eq'
,
dataType
:
'SSCODELIST'
,
},
{
name
:
'n_authtime_gtandeq'
,
prop
:
'n_authtime_gtandeq'
,
dataType
:
'DATETIME'
,
},
{
name
:
'n_authtime_ltandeq'
,
prop
:
'n_authtime_ltandeq'
,
dataType
:
'DATETIME'
,
},
{
name
:
'n_domain_like'
,
prop
:
'n_domain_like'
,
dataType
:
'TEXT'
,
},
{
name
:
'size'
,
prop
:
'size'
},
{
name
:
'query'
,
prop
:
'query'
},
{
name
:
'page'
,
prop
:
'page'
},
{
name
:
'sort'
,
prop
:
'sort'
},
{
name
:
'srfparentdata'
,
prop
:
'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name
:
'srffrontuf'
,
prop
:
'srffrontuf'
,
dataType
:
'TEXT'
,
},
]
}
}
}
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/main-grid/main-grid-service.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
SysAuthLogService
from
'@/service/sys-auth-log/sys-auth-log-service'
;
import
MainModel
from
'./main-grid-model'
;
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export
default
class
MainService
extends
ControlService
{
/**
* 认证日志服务对象
*
* @type {SysAuthLogService}
* @memberof MainService
*/
public
appEntityService
:
SysAuthLogService
=
new
SysAuthLogService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
MainModel
();
}
/**
* 处理数据
*
* @public
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
public
doItems
(
promise
:
Promise
<
any
>
,
deKeyField
:
string
,
deName
:
string
):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
promise
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
)
{
const
data
=
response
.
data
;
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
item
[
deName
]
=
item
[
deKeyField
];
data
[
index
]
=
item
;
});
resolve
(
data
);
}
else
{
reject
([])
}
}).
catch
((
response
:
any
)
=>
{
reject
([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof MainService
*/
@
Errorlog
public
getItems
(
serviceName
:
string
,
interfaceName
:
string
,
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
return
Promise
.
reject
([])
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
add
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
result
:
Promise
<
any
>
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
_appEntityService
.
Create
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
delete
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
result
:
Promise
<
any
>
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
_appEntityService
.
Remove
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
update
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
result
:
Promise
<
any
>
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Data
,
Context
,
isloading
);
}
else
{
result
=
_appEntityService
.
Update
(
Data
,
Context
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 获取数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
get
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Get
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
//处理返回数据,补充判断标识
if
(
response
.
data
){
Object
.
assign
(
response
.
data
,{
srfuf
:
0
});
}
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
search
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
result
:
Promise
<
any
>
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
_appEntityService
.
FetchDefault
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
loadDraft
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
GetDraft
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
//处理返回数据,补充判断标识
if
(
response
.
data
){
Object
.
assign
(
response
.
data
,{
srfuf
:
'0'
});
//仿真主键数据
response
.
data
.
logid
=
Util
.
createUUID
();
}
this
.
handleResponse
(
action
,
response
,
true
);
this
.
mergeDefaults
(
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public
mergeDefaults
(
response
:
any
=
{}){
if
(
response
.
data
){
}
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
frontLogic
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
,
true
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
return
Promise
.
reject
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
'系统异常'
}
});
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
})
}
}
\ No newline at end of file
app_Web/src/widgets/sys-auth-log/main-grid/main-grid.less
0 → 100644
浏览文件 @
0d279c66
.grid {
flex-grow: 1;
height: 100%;
overflow: auto;
.el-table__body-wrapper::-webkit-scrollbar {
/*滚动条整体样式*/
width : 10px !important; /*高宽分别对应横竖滚动条的尺寸*/
height: 10px !important;
}
.el-table__body-wrapper::-webkit-scrollbar-thumb {
/*滚动条颜色*/
border-radius : 10px !important;
background-color: #cecece !important;
}
.el-table__body-wrapper::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
background : #ededed !important;
border-radius: 10px !important;
}
/*表格文字过长省略*/
.el-table th>.cell, .el-table td>.cell{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.el-table-column--selection .cell {
padding-left: 0px;
padding-right: 0px;
}
.app-column-link, .app-format-data{
display: inline;
}
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
margin-bottom: unset !important;
}
}
}
.grid-pagination {
height: 50px;
padding: 6px 0px;
.page-button {
button {
padding: 0;
font-size: 16px;
min-width: 32px;
height: 32px;
margin-right: 4px;
}
}
.page-column {
position: absolute;
left: 0;
}
.batch-toolbar{
position: absolute;
left: 105px;
>.toolbar-container{
button {
font-size: 16px;
min-width: 32px;
height: 32px;
margin-right: 4px;
margin-top: 0;
margin-bottom: 0;
}
}
}
}
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
}
.ivu-modal-content{
.footer{
.ivu-row{
text-align: right;
}
}
}
// this is less
app_Web/src/widgets/sys-auth-log/main-grid/main-grid.vue
0 → 100644
浏览文件 @
0d279c66
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
MainBase
from
'./main-grid-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
Main
extends
MainBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/widgets/wfremodel/main-form/main-form-base.vue
0 → 100644
浏览文件 @
0d279c66
<
template
>
<i-form
:model=
"this.data"
class=
'app-form'
ref=
'form'
id=
'wfremodel_main'
style=
""
>
<input
style=
"display:none;"
/>
<row
>
<i-col
v-show=
"detailsModel.group1.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-group
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.wfremodel.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<row>
<i-col
v-show=
"detailsModel.bpmnfile.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'bpmnfile'
:itemRules=
"this.rules.bpmnfile"
class=
''
:caption=
"$t('entities.wfremodel.main_form.details.bpmnfile')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.bpmnfile.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-file-upload
:formState=
"formState"
:ignorefieldvaluechange=
"ignorefieldvaluechange"
@
formitemvaluechange=
"onFormItemValueChange"
:data=
"JSON.stringify(this.data)"
name=
'bpmnfile'
:value=
"data.bpmnfile"
:disabled=
"detailsModel.bpmnfile.disabled"
uploadparams=
''
exportparams=
''
:customparams=
"
{}" style="overflow: auto;">
</app-file-upload>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Model
}
from
'vue-property-decorator'
;
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
WFREModelService
from
'@/service/wfremodel/wfremodel-service'
;
import
MainService
from
'./main-form-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
@
Component
({
components
:
{
}
})
export
default
class
MainBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Main
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof Main
*/
@
Prop
()
public
context
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof Main
*/
@
Prop
()
public
viewparams
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Main
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Main
*/
public
getControlType
():
string
{
return
'FORM'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Main
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof Main
*/
public
service
:
MainService
=
new
MainService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {WFREModelService}
* @memberof Main
*/
public
appEntityService
:
WFREModelService
=
new
WFREModelService
({
$store
:
this
.
$store
});
/**
* 关闭视图
*
* @param {any} args
* @memberof Main
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof Main
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 工作流审批意见控件绑定值
*
* @memberof Main
*/
public
srfwfmemo
:
string
=
""
;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Main
*/
public
getDatas
():
any
[]
{
return
[
this
.
data
];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Main
*/
public
getData
():
any
{
return
this
.
data
;
}
/**
* 是否默认保存
*
* @type {boolean}
* @memberof Main
*/
@
Prop
({
default
:
false
})
public
autosave
?:
boolean
;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Main
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 部件行为--submit
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
WFSubmitAction
!
:
string
;
/**
* 部件行为--start
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
WFStartAction
!
:
string
;
/**
* 部件行为--update
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
updateAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
removeAction
!
:
string
;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
loaddraftAction
!
:
string
;
/**
* 部件行为--load
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
createAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
searchAction
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof Main
*/
@
Prop
()
public
viewtag
!
:
string
;
/**
* 表单状态
*
* @type {Subject<any>}
* @memberof Main
*/
public
formState
:
Subject
<
any
>
=
new
Subject
();
/**
* 忽略表单项值变化
*
* @type {boolean}
* @memberof Main
*/
public
ignorefieldvaluechange
:
boolean
=
false
;
/**
* 数据变化
*
* @public
* @type {Subject<any>}
* @memberof Main
*/
public
dataChang
:
Subject
<
any
>
=
new
Subject
();
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Main
*/
public
dataChangEvent
:
Subscription
|
undefined
;
/**
* 原始数据
*
* @public
* @type {*}
* @memberof Main
*/
public
oldData
:
any
=
{};
/**
* 表单数据对象
*
* @type {*}
* @memberof Main
*/
public
data
:
any
=
{
srforikey
:
null
,
srfkey
:
null
,
srfmajortext
:
null
,
srftempmode
:
null
,
srfuf
:
null
,
srfdeid
:
null
,
srfsourcekey
:
null
,
bpmnfile
:
null
,
modelid
:
null
,
wfremodel
:
null
,
};
/**
* 当前执行的行为逻辑
*
* @type {string}
* @memberof Main
*/
public
currentAction
:
string
=
""
;
/**
* 关系界面计数器
*
* @type {number}
* @memberof Main
*/
public
drcounter
:
number
=
0
;
/**
* 需要等待关系界面保存时,第一次调用save参数的备份
*
* @type {number}
* @memberof Main
*/
public
drsaveopt
:
any
=
{};
/**
* 表单保存回调存储对象
*
* @type {any}
* @memberof Main
*/
public
saveState
:
any
;
/**
* 属性值规则
*
* @type {*}
* @memberof Main
*/
public
rules
:
any
=
{
srforikey
:
[
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'blur'
},
],
srfkey
:
[
{
type
:
'string'
,
message
:
'ID 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'ID 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'ID 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'ID 值不能为空'
,
trigger
:
'blur'
},
],
srfmajortext
:
[
{
type
:
'string'
,
message
:
'名称 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'名称 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'名称 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'名称 值不能为空'
,
trigger
:
'blur'
},
],
srftempmode
:
[
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'blur'
},
],
srfuf
:
[
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'blur'
},
],
srfdeid
:
[
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'blur'
},
],
srfsourcekey
:
[
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
' 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
' 值不能为空'
,
trigger
:
'blur'
},
],
bpmnfile
:
[
{
type
:
'string'
,
message
:
'BPMN 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'BPMN 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'BPMN 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'BPMN 值不能为空'
,
trigger
:
'blur'
},
],
modelid
:
[
{
type
:
'string'
,
message
:
'ID 值必须为字符串类型'
,
trigger
:
'change'
},
{
type
:
'string'
,
message
:
'ID 值必须为字符串类型'
,
trigger
:
'blur'
},
{
required
:
false
,
type
:
'string'
,
message
:
'ID 值不能为空'
,
trigger
:
'change'
},
{
required
:
false
,
type
:
'string'
,
message
:
'ID 值不能为空'
,
trigger
:
'blur'
},
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Main
*/
public
detailsModel
:
any
=
{
group1
:
new
FormGroupPanelModel
({
caption
:
'流程模型'
,
detailType
:
'GROUPPANEL'
,
name
:
'group1'
,
visible
:
true
,
isShowCaption
:
false
,
form
:
this
,
uiActionGroup
:
{
caption
:
''
,
langbase
:
'entities.wfremodel.main_form'
,
extractMode
:
'ITEM'
,
details
:
[]
}
})
,
formpage1
:
new
FormPageModel
({
caption
:
'基本信息'
,
detailType
:
'FORMPAGE'
,
name
:
'formpage1'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
})
,
srforikey
:
new
FormItemModel
({
caption
:
''
,
detailType
:
'FORMITEM'
,
name
:
'srforikey'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srfkey
:
new
FormItemModel
({
caption
:
'ID'
,
detailType
:
'FORMITEM'
,
name
:
'srfkey'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srfmajortext
:
new
FormItemModel
({
caption
:
'名称'
,
detailType
:
'FORMITEM'
,
name
:
'srfmajortext'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srftempmode
:
new
FormItemModel
({
caption
:
''
,
detailType
:
'FORMITEM'
,
name
:
'srftempmode'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srfuf
:
new
FormItemModel
({
caption
:
''
,
detailType
:
'FORMITEM'
,
name
:
'srfuf'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srfdeid
:
new
FormItemModel
({
caption
:
''
,
detailType
:
'FORMITEM'
,
name
:
'srfdeid'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
srfsourcekey
:
new
FormItemModel
({
caption
:
''
,
detailType
:
'FORMITEM'
,
name
:
'srfsourcekey'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
bpmnfile
:
new
FormItemModel
({
caption
:
'BPMN'
,
detailType
:
'FORMITEM'
,
name
:
'bpmnfile'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
modelid
:
new
FormItemModel
({
caption
:
'ID'
,
detailType
:
'FORMITEM'
,
name
:
'modelid'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
})
,
};
/**
* 监控表单属性 srforikey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srforikey'
)
onSrforikeyChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srforikey'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srfkey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srfkey'
)
onSrfkeyChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srfkey'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srfmajortext 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srfmajortext'
)
onSrfmajortextChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srfmajortext'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srftempmode 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srftempmode'
)
onSrftempmodeChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srftempmode'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srfuf 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srfuf'
)
onSrfufChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srfuf'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srfdeid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srfdeid'
)
onSrfdeidChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srfdeid'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 srfsourcekey 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.srfsourcekey'
)
onSrfsourcekeyChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'srfsourcekey'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 bpmnfile 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.bpmnfile'
)
onBpmnfileChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'bpmnfile'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 监控表单属性 modelid 值
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Main
*/
@
Watch
(
'data.modelid'
)
onModelidChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
formDataChange
({
name
:
'modelid'
,
newVal
:
newVal
,
oldVal
:
oldVal
});
}
/**
* 重置表单项值
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Main
*/
public
resetFormData
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
/**
* 置空对象
*
* @param {any[]} args
* @memberof EditForm
*/
public
ResetData
(
_datas
:
any
){
if
(
Object
.
keys
(
_datas
).
length
>
0
){
Object
.
keys
(
_datas
).
forEach
((
name
:
string
)
=>
{
if
(
this
.
data
.
hasOwnProperty
(
name
))
{
this
.
data
[
name
]
=
null
;
}
});
}
}
/**
* 表单逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof Main
*/
public
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
}
/**
* 表单值变化
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @returns {void}
* @memberof Main
*/
public
formDataChange
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
if
(
this
.
ignorefieldvaluechange
)
{
return
;
}
this
.
resetFormData
({
name
:
name
,
newVal
:
newVal
,
oldVal
:
oldVal
});
this
.
formLogic
({
name
:
name
,
newVal
:
newVal
,
oldVal
:
oldVal
});
this
.
dataChang
.
next
(
JSON
.
stringify
(
this
.
data
));
}
/**
* 表单加载完成
*
* @public
* @param {*} [data={}]
* @param {string} [action]
* @memberof Main
*/
public
onFormLoad
(
data
:
any
=
{},
action
:
string
):
void
{
if
(
Object
.
is
(
action
,
"save"
)
||
Object
.
is
(
action
,
"autoSave"
)
||
Object
.
is
(
action
,
"submit"
))
// 更新context的实体主键
if
(
data
.
wfremodel
){
Object
.
assign
(
this
.
context
,{
wfremodel
:
data
.
wfremodel
})
}
this
.
setFormEnableCond
(
data
);
this
.
fillForm
(
data
,
action
);
this
.
oldData
=
{};
Object
.
assign
(
this
.
oldData
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
)));
this
.
$store
.
commit
(
'viewaction/setViewDataChange'
,
{
viewtag
:
this
.
viewtag
,
viewdatachange
:
false
});
this
.
formLogic
({
name
:
''
,
newVal
:
null
,
oldVal
:
null
});
}
/**
* 值填充
*
* @param {*} [_datas={}]
* @param {string} [action]
* @memberof Main
*/
public
fillForm
(
_datas
:
any
=
{},
action
:
string
):
void
{
this
.
ignorefieldvaluechange
=
true
;
Object
.
keys
(
_datas
).
forEach
((
name
:
string
)
=>
{
if
(
this
.
data
.
hasOwnProperty
(
name
))
{
this
.
data
[
name
]
=
_datas
[
name
];
}
});
if
(
Object
.
is
(
action
,
'loadDraft'
)){
this
.
createDefault
();
}
if
(
Object
.
is
(
action
,
'load'
)){
this
.
updateDefault
();
}
this
.
$nextTick
(
function
()
{
this
.
ignorefieldvaluechange
=
false
;
})
}
/**
* 设置表单项是否启用
*
* @public
* @param {*} data
* @memberof Main
*/
public
setFormEnableCond
(
data
:
any
):
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
if
(
!
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
return
;
}
const
formItem
:
FormItemModel
=
detail
;
formItem
.
setEnableCond
(
data
.
srfuf
);
});
}
/**
* 重置草稿表单状态
*
* @public
* @memberof Main
*/
public
resetDraftFormStates
():
void
{
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
form
.
resetFields
();
}
}
/**
* 重置校验结果
*
* @memberof Main
*/
public
resetValidates
():
void
{
Object
.
values
(
this
.
detailsModel
).
forEach
((
detail
:
any
)
=>
{
if
(
!
Object
.
is
(
detail
.
detailType
,
'FORMITEM'
))
{
return
;
}
const
formItem
:
FormItemModel
=
detail
;
formItem
.
setError
(
''
);
});
}
/**
* 填充校验结果 (后台)
*
* @param {any[]} fieldErrors
* @memberof Main
*/
public
fillValidates
(
fieldErrors
:
any
[]):
void
{
fieldErrors
.
forEach
((
error
:
any
)
=>
{
const
formItem
:
FormItemModel
=
this
.
detailsModel
[
error
.
field
];
if
(
!
formItem
)
{
return
;
}
this
.
$nextTick
(()
=>
{
formItem
.
setError
(
error
.
message
);
});
});
}
/**
* 表单校验状态
*
* @returns {boolean}
* @memberof Main
*/
public
formValidateStatus
():
boolean
{
const
form
:
any
=
this
.
$refs
.
form
;
let
validatestate
:
boolean
=
true
;
form
.
validate
((
valid
:
boolean
)
=>
{
validatestate
=
valid
?
true
:
false
;
});
return
validatestate
}
/**
* 获取全部值
*
* @returns {*}
* @memberof Main
*/
public
getValues
():
any
{
return
this
.
data
;
}
/**
* 表单项值变更
*
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof Main
*/
public
onFormItemValueChange
(
$event
:
{
name
:
string
,
value
:
any
}):
void
{
if
(
!
$event
)
{
return
;
}
if
(
!
$event
.
name
||
Object
.
is
(
$event
.
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
$event
.
name
))
{
return
;
}
this
.
data
[
$event
.
name
]
=
$event
.
value
;
}
/**
* 设置数据项值
*
* @param {string} name
* @param {*} value
* @returns {void}
* @memberof Main
*/
public
setDataItemValue
(
name
:
string
,
value
:
any
):
void
{
if
(
!
name
||
Object
.
is
(
name
,
''
)
||
!
this
.
data
.
hasOwnProperty
(
name
))
{
return
;
}
if
(
Object
.
is
(
this
.
data
[
name
],
value
))
{
return
;
}
this
.
data
[
name
]
=
value
;
}
/**
* 分组界面行为事件
*
* @param {*} $event
* @memberof Main
*/
public
groupUIActionClick
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
const
item
:
any
=
$event
.
item
;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof Main
*/
public
created
():
void
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof Main
*/
public
afterCreated
(){
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'autoload'
,
action
))
{
this
.
autoLoad
(
data
);
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
load
(
data
);
}
if
(
Object
.
is
(
'loaddraft'
,
action
))
{
if
(
this
.
context
.
srfsourcekey
){
this
.
copy
(
this
.
context
.
srfsourcekey
);
}
else
{
this
.
loadDraft
(
data
);
}
}
if
(
Object
.
is
(
'save'
,
action
))
{
this
.
save
(
data
,
data
.
showResultInfo
);
}
if
(
Object
.
is
(
'remove'
,
action
))
{
this
.
remove
(
data
);
}
if
(
Object
.
is
(
'saveandexit'
,
action
))
{
this
.
saveAndExit
(
data
);
}
if
(
Object
.
is
(
'saveandnew'
,
action
))
{
this
.
saveAndNew
(
data
);
}
if
(
Object
.
is
(
'removeandexit'
,
action
))
{
this
.
removeAndExit
(
data
);
}
if
(
Object
.
is
(
'refresh'
,
action
))
{
this
.
refresh
(
data
);
}
});
}
this
.
dataChang
.
pipe
(
debounceTime
(
300
),
distinctUntilChanged
()
).
subscribe
((
data
:
any
)
=>
{
if
(
this
.
autosave
)
{
this
.
autoSave
();
}
const
state
=
!
Object
.
is
(
JSON
.
stringify
(
this
.
oldData
),
JSON
.
stringify
(
this
.
data
))
?
true
:
false
;
this
.
$store
.
commit
(
'viewaction/setViewDataChange'
,
{
viewtag
:
this
.
viewtag
,
viewdatachange
:
state
});
});
}
/**
* vue 生命周期
*
* @memberof Main
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Main
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
if
(
this
.
dataChangEvent
)
{
this
.
dataChangEvent
.
unsubscribe
();
}
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public
copy
(
srfkey
:
string
):
void
{
let
copyData
=
this
.
$store
.
getters
.
getCopyData
(
srfkey
);
copyData
.
srfkey
=
Util
.
createUUID
();
copyData
.
wfremodel
=
copyData
.
srfkey
;
copyData
.
id
=
copyData
.
srfkey
;
Object
.
assign
(
this
.
context
,{
wfremodel
:
copyData
.
wfremodel
})
this
.
data
=
copyData
;
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
copyData
});
this
.
data
.
srfuf
=
'0'
;
this
.
setFormEnableCond
(
this
.
data
);
});
}
/**
*打印
*@memberof @memberof Main
*/
public
print
(){
let
_this
:
any
=
this
;
_this
.
$print
({
id
:
'wfremodel_main'
,
popTitle
:
'主编辑表单'
});
}
/**
* 部件刷新
*
* @param {any[]} args
* @memberof Main
*/
public
refresh
(
args
:
any
[]):
void
{
let
arg
:
any
=
{};
Object
.
assign
(
arg
,
args
[
0
]);
if
(
this
.
data
.
srfkey
&&
!
Object
.
is
(
this
.
data
.
srfkey
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkey
});
this
.
load
(
arg
);
return
;
}
if
(
this
.
data
.
srfkeys
&&
!
Object
.
is
(
this
.
data
.
srfkeys
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
this
.
data
.
srfkeys
});
this
.
load
(
arg
);
return
;
}
}
/**
* 自动加载
*
* @param {*} [arg={}]
* @returns {void}
* @memberof Main
*/
public
autoLoad
(
arg
:
any
=
{}):
void
{
if
(
arg
.
srfkey
&&
!
Object
.
is
(
arg
.
srfkey
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
arg
.
srfkey
});
this
.
load
(
arg
);
return
;
}
if
(
arg
.
srfkeys
&&
!
Object
.
is
(
arg
.
srfkeys
,
''
))
{
Object
.
assign
(
arg
,
{
srfkey
:
arg
.
srfkeys
});
this
.
load
(
arg
);
return
;
}
this
.
loadDraft
(
arg
);
}
/**
* 加载
*
* @public
* @param {*} [opt={}]
* @memberof Main
*/
public
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'WFREModelEditView视图表单loadAction参数未配置'
});
return
;
}
const
arg
:
any
=
{
...
opt
};
let
viewparamResult
:
any
=
Object
.
assign
(
arg
,
this
.
viewparams
);
const
get
:
Promise
<
any
>
=
this
.
service
.
get
(
this
.
loadAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),{
viewparams
:
viewparamResult
},
this
.
showBusyIndicator
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
)
{
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
,
'load'
);
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
}
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
});
}
/**
* 加载草稿
*
* @param {*} [opt={}]
* @memberof Main
*/
public
loadDraft
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'WFREModelEditView视图表单loaddraftAction参数未配置'
});
return
;
}
const
arg
:
any
=
{
...
opt
}
;
let
viewparamResult
:
any
=
Object
.
assign
(
arg
,
this
.
viewparams
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),{
viewparams
:
viewparamResult
},
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
}
return
;
}
const
data
=
response
.
data
;
if
(
data
.
wfremodel
){
Object
.
assign
(
this
.
context
,{
wfremodel
:
data
.
wfremodel
})
}
this
.
resetDraftFormStates
();
this
.
onFormLoad
(
data
,
'loadDraft'
);
this
.
$emit
(
'load'
,
data
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'load'
,
data
:
data
});
});
setTimeout
(()
=>
{
const
form
:
any
=
this
.
$refs
.
form
;
if
(
form
)
{
form
.
fields
.
forEach
((
field
:
any
)
=>
{
field
.
validateMessage
=
""
;
field
.
validateState
=
""
;
field
.
validateStatus
=
false
;
});
}
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
});
}
/**
* 自动保存
*
* @param {*} [opt={}]
* @memberof Main
*/
public
autoSave
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
formValidateStatus
())
{
return
;
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
if
(
!
action
){
let
actionName
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)?
"updateAction"
:
"createAction"
;
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'WFREModelEditView视图表单'
+
actionName
+
'参数未配置'
});
return
;
}
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
}
return
;
}
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
,
'autoSave'
);
this
.
$emit
(
'save'
,
data
);
this
.
$store
.
dispatch
(
'viewaction/datasaved'
,
{
viewtag
:
this
.
viewtag
});
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'save'
,
data
:
data
});
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
});
}
/**
* 保存
*
* @param {*} [opt={}]
* @param {boolean} [showResultInfo]
* @param {boolean} [ifStateNext] formState是否下发通知
* @returns {Promise<any>}
* @memberof Main
*/
public
async
save
(
opt
:
any
=
{},
showResultInfo
?:
boolean
,
ifStateNext
:
boolean
=
true
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
showResultInfo
=
showResultInfo
===
undefined
?
true
:
false
;
if
(
!
this
.
formValidateStatus
())
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'值规则校验异常'
});
return
;
}
const
arg
:
any
=
{
...
opt
};
const
data
=
this
.
getValues
();
Object
.
assign
(
arg
,
data
);
Object
.
assign
(
arg
,
this
.
context
);
if
(
ifStateNext
)
{
this
.
drcounter
=
0
;
if
(
this
.
drcounter
!==
0
){
this
.
drsaveopt
=
opt
;
this
.
formState
.
next
({
type
:
'beforesave'
,
data
:
arg
});
//先通知关系界面保存
this
.
saveState
=
resolve
;
return
;
}
}
const
action
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)
?
this
.
updateAction
:
this
.
createAction
;
if
(
!
action
){
let
actionName
:
any
=
Object
.
is
(
data
.
srfuf
,
'1'
)?
"updateAction"
:
"createAction"
;
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'WFREModelEditView视图表单'
+
actionName
+
'参数未配置'
});
return
;
}
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
post
:
Promise
<
any
>
=
Object
.
is
(
data
.
srfuf
,
'1'
)?
this
.
service
.
update
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
):
this
.
service
.
add
(
action
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
}
return
;
}
const
data
=
response
.
data
;
this
.
onFormLoad
(
data
,
'save'
);
this
.
$emit
(
'save'
,
data
);
this
.
$store
.
dispatch
(
'viewaction/datasaved'
,
{
viewtag
:
this
.
viewtag
});
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'save'
,
data
:
data
});
});
if
(
showResultInfo
)
{
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
data
.
srfmajortext
?
data
.
srfmajortext
:
''
)
+
' 保存成功!'
});
}
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
reject
(
response
);
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
})
}
/**
* 删除
*
* @public
* @param {*} [opt={}]
* @memberof EditForm
*/
public
remove
(
opt
:
Array
<
any
>
=
[],
showResultInfo
?:
boolean
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
if
(
!
this
.
removeAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'WFREModelEditView视图表单removeAction参数未配置'
});
return
;
}
const
arg
:
any
=
opt
[
0
];
const
_this
:
any
=
this
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
this
.
service
.
delete
(
_this
.
removeAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
showResultInfo
).
then
((
response
:
any
)
=>
{
if
(
response
)
{
const
data
=
response
.
data
;
this
.
$emit
(
'remove'
,
data
);
this
.
formState
.
next
({
type
:
'remove'
,
data
:
data
});
this
.
data
.
ismodify
=
false
;
this
.
$Notice
.
success
({
title
:
''
,
desc
:
(
data
.
srfmajortext
?
data
.
srfmajortext
:
''
)
+
' 删除成功!'
});
resolve
(
response
);
}
}).
catch
((
error
:
any
)
=>
{
const
{
data
:
_data
}
=
error
;
this
.
$Notice
.
error
({
title
:
_data
.
title
,
desc
:
_data
.
message
});
reject
(
error
);
});
});
}
/**
* 工作流启动
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Main
*/
public
async
wfstart
(
data
:
any
,
localdata
?:
any
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_this
:
any
=
this
;
const
post
:
Promise
<
any
>
=
_this
.
save
({},
false
);
post
.
then
((
response
:
any
)
=>
{
const
arg
:
any
=
response
.
data
;
if
(
this
.
viewparams
){
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
}
const
result
:
Promise
<
any
>
=
this
.
service
.
wfstart
(
_this
.
WFStartAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
,
localdata
);
result
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
response
.
data
){
this
.
$Notice
.
error
({
title
:
''
,
desc
:
'工作流启动失败, '
+
response
.
data
.
message
});
}
return
;
}
this
.
$Notice
.
info
({
title
:
''
,
desc
:
'工作流启动成功'
});
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
reject
(
response
);
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
reject
(
response
);
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
})
});
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Main
*/
public
async
wfsubmit
(
data
:
any
,
localdata
?:
any
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
_this
:
any
=
this
;
const
arg
:
any
=
data
[
0
];
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
if
(
!
arg
.
wfremodel
||
Object
.
is
(
arg
.
wfremodel
,
''
))
{
return
;
}
const
post
:
Promise
<
any
>
=
Object
.
is
(
arg
.
srfuf
,
'1'
)?
this
.
service
.
update
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
):
this
.
service
.
add
(
this
.
createAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
const
arg
:
any
=
response
.
data
;
// 保存完成UI处理
this
.
onFormLoad
(
arg
,
'save'
);
this
.
$emit
(
'save'
,
arg
);
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'save'
,
data
:
arg
});
});
// 准备提交参数
if
(
this
.
viewparams
){
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
}
// 强制补充srfwfmemo
if
(
this
.
srfwfmemo
){
Object
.
assign
(
arg
,{
srfwfmemo
:
this
.
srfwfmemo
});
}
const
result
:
Promise
<
any
>
=
this
.
service
.
wfsubmit
(
_this
.
WFSubmitAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
,
localdata
);
result
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
response
.
data
){
this
.
$Notice
.
error
({
title
:
''
,
desc
:
'工作流提交失败, '
+
response
.
data
.
message
});
}
return
;
}
this
.
onFormLoad
(
arg
,
'submit'
);
this
.
$store
.
dispatch
(
'viewaction/datasaved'
,
{
viewtag
:
this
.
viewtag
});
this
.
$Notice
.
info
({
title
:
''
,
desc
:
'工作流提交成功'
});
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
reject
(
response
);
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
reject
(
response
);
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
reject
(
response
);
return
;
}
reject
(
response
);
})
})
}
/**
* 表单项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof Main
*/
public
updateFormItems
(
mode
:
string
,
data
:
any
=
{},
updateDetails
:
string
[],
showloading
?:
boolean
):
void
{
if
(
!
mode
||
(
mode
&&
Object
.
is
(
mode
,
''
)))
{
return
;
}
const
arg
:
any
=
{
...
data
};
Object
.
assign
(
arg
,
this
.
viewparams
);
const
post
:
Promise
<
any
>
=
this
.
service
.
frontLogic
(
mode
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
showloading
);
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'表单项更新失败'
});
return
;
}
const
data
=
response
.
data
;
const
_data
:
any
=
{};
updateDetails
.
forEach
((
name
:
string
)
=>
{
if
(
!
data
.
hasOwnProperty
(
name
))
{
return
;
}
Object
.
assign
(
_data
,
{
[
name
]:
data
[
name
]
});
});
this
.
setFormEnableCond
(
_data
);
this
.
fillForm
(
_data
,
'updateFormItem'
);
this
.
formLogic
({
name
:
''
,
newVal
:
null
,
oldVal
:
null
});
this
.
dataChang
.
next
(
JSON
.
stringify
(
this
.
data
));
this
.
$nextTick
(()
=>
{
this
.
formState
.
next
({
type
:
'updateformitem'
,
ufimode
:
arg
.
srfufimode
,
data
:
_data
});
});
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
return
;
}
});
}
/**
* 回车事件
*
* @param {*} $event
* @memberof Main
*/
public
onEnter
(
$event
:
any
):
void
{
}
/**
* 保存并退出
*
* @param {any[]} args
* @memberof Main
*/
public
saveAndExit
(
data
:
any
[]):
Promise
<
any
>
{
let
_this
=
this
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
arg
:
any
=
{};
if
(
data
&&
data
.
length
>
0
){
Object
.
assign
(
arg
,
data
[
0
]);
}
_this
.
currentAction
=
"saveAndExit"
;
_this
.
save
([
arg
]).
then
((
res
)
=>
{
if
(
res
){
_this
.
closeView
(
res
.
data
);
}
resolve
(
res
);
}).
catch
((
error
)
=>
{
reject
(
error
);
})
})
}
/**
* 保存并新建
*
* @param {any[]} args
* @memberof Main
*/
public
saveAndNew
(
data
:
any
[]):
Promise
<
any
>
{
let
_this
=
this
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
arg
:
any
=
{};
if
(
data
&&
data
.
length
>
0
){
Object
.
assign
(
arg
,
data
[
0
]);
}
_this
.
currentAction
=
"saveAndNew"
;
_this
.
save
([
arg
]).
then
((
res
)
=>
{
_this
.
ResetData
(
res
);
_this
.
loadDraft
({});
}).
catch
((
error
)
=>
{
reject
(
error
);
})
})
}
/**
* 删除并退出
*
* @param {any[]} args
* @memberof Main
*/
public
removeAndExit
(
data
:
any
[]):
Promise
<
any
>
{
let
_this
=
this
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
arg
:
any
=
{};
if
(
data
&&
data
.
length
>
0
){
Object
.
assign
(
arg
,
data
[
0
]);
}
_this
.
remove
([
arg
]).
then
((
res
)
=>
{
if
(
res
){
_this
.
closeView
(
res
.
data
);
}
resolve
(
res
);
}).
catch
((
error
)
=>
{
reject
(
error
);
})
})
}
/**
* 关系界面数据保存完成
*
* @param {any} $event
* @memberof Main
*/
public
drdatasaved
(
$event
:
any
){
let
_this
=
this
;
this
.
drcounter
--
;
if
(
this
.
drcounter
>
0
){
return
;
}
this
.
save
(
this
.
drsaveopt
,
undefined
,
false
).
then
((
res
)
=>
{
this
.
saveState
(
res
);
this
.
drsaveopt
=
{};
if
(
Object
.
is
(
_this
.
currentAction
,
"saveAndNew"
)){
_this
.
ResetData
(
res
);
_this
.
loadDraft
({});
}
else
if
(
Object
.
is
(
_this
.
currentAction
,
"saveAndExit"
)){
if
(
res
){
_this
.
closeView
(
res
.
data
);
}
}
});
}
/**
* 新建默认值
* @memberof Main
*/
public
createDefault
(){
}
/**
* 更新默认值
* @memberof Main
*/
public
updateDefault
(){
}
}
</
script
>
<
style
lang=
'less'
>
@import './main-form.less';
</
style
>
\ No newline at end of file
app_Web/src/widgets/wfremodel/main-form/main-form-model.ts
0 → 100644
浏览文件 @
0d279c66
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export
default
class
MainModel
{
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainModel
*/
public
getDataItems
():
any
[]
{
return
[
{
name
:
'srfwfmemo'
,
prop
:
'srfwfmemo'
,
dataType
:
'TEXT'
,
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name
:
'srffrontuf'
,
prop
:
'srffrontuf'
,
dataType
:
'TEXT'
,
},
{
name
:
'srforikey'
,
},
{
name
:
'srfkey'
,
prop
:
'id'
,
dataType
:
'TEXT'
,
},
{
name
:
'srfmajortext'
,
prop
:
'name'
,
dataType
:
'TEXT'
,
},
{
name
:
'srftempmode'
,
},
{
name
:
'srfuf'
,
},
{
name
:
'srfdeid'
,
},
{
name
:
'srfsourcekey'
,
},
{
name
:
'bpmnfile'
,
prop
:
'bpmnfile'
,
dataType
:
'TEXT'
,
},
{
name
:
'modelid'
,
prop
:
'id'
,
dataType
:
'TEXT'
,
},
{
name
:
'wfremodel'
,
prop
:
'id'
,
dataType
:
'FONTKEY'
,
},
]
}
}
\ No newline at end of file
app_Web/src/widgets/wfremodel/main-form/main-form-service.ts
0 → 100644
浏览文件 @
0d279c66
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
WFREModelService
from
'@/service/wfremodel/wfremodel-service'
;
import
MainModel
from
'./main-form-model'
;
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export
default
class
MainService
extends
ControlService
{
/**
* 流程模型服务对象
*
* @type {WFREModelService}
* @memberof MainService
*/
public
appEntityService
:
WFREModelService
=
new
WFREModelService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
MainModel
();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
private
doItems
(
promise
:
Promise
<
any
>
,
deKeyField
:
string
,
deName
:
string
):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
promise
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
200
)
{
const
data
=
response
.
data
;
data
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
item
[
deName
]
=
item
[
deKeyField
];
data
[
index
]
=
item
;
});
resolve
(
data
);
}
else
{
reject
([])
}
}).
catch
((
response
:
any
)
=>
{
reject
([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof MainService
*/
@
Errorlog
public
getItems
(
serviceName
:
string
,
interfaceName
:
string
,
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
return
Promise
.
reject
([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
wfstart
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
,
localdata
?:
any
):
Promise
<
any
>
{
data
=
this
.
handleWFData
(
data
);
context
=
this
.
handleRequestData
(
action
,
context
,
data
).
context
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
context
,
data
,
isloading
,
localdata
);
}
else
{
result
=
this
.
appEntityService
.
WFStart
(
context
,
data
,
isloading
,
localdata
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
wfsubmit
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
,
localdata
?:
any
):
Promise
<
any
>
{
data
=
this
.
handleWFData
(
data
,
true
);
context
=
this
.
handleRequestData
(
action
,
context
,
data
).
context
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
context
,
data
,
isloading
,
localdata
);
}
else
{
result
=
this
.
appEntityService
.
WFSubmit
(
context
,
data
,
isloading
,
localdata
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
add
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Create
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
delete
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Remove
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
update
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Update
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
get
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
Get
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
loadDraft
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
//仿真主键数据
const
PrimaryKey
=
Util
.
createUUID
();
Data
.
id
=
PrimaryKey
;
Data
.
wfremodel
=
PrimaryKey
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
result
=
this
.
appEntityService
.
GetDraft
(
Context
,
Data
,
isloading
);
}
result
.
then
((
response
)
=>
{
response
.
data
.
id
=
PrimaryKey
;
this
.
handleResponse
(
action
,
response
,
true
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@
Errorlog
public
frontLogic
(
action
:
string
,
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
const
{
data
:
Data
,
context
:
Context
}
=
this
.
handleRequestData
(
action
,
context
,
data
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
result
:
Promise
<
any
>
;
const
_appEntityService
:
any
=
this
.
appEntityService
;
if
(
_appEntityService
[
action
]
&&
_appEntityService
[
action
]
instanceof
Function
)
{
result
=
_appEntityService
[
action
](
Context
,
Data
,
isloading
);
}
else
{
return
Promise
.
reject
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
'系统异常'
}
});
}
result
.
then
((
response
)
=>
{
this
.
handleResponse
(
action
,
response
,
true
);
resolve
(
response
);
}).
catch
(
response
=>
{
reject
(
response
);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public
handleRequestData
(
action
:
string
,
context
:
any
,
data
:
any
=
{}){
let
mode
:
any
=
this
.
getMode
();
if
(
!
mode
&&
mode
.
getDataItems
instanceof
Function
)
{
return
data
;
}
let
formItemItems
:
any
[]
=
mode
.
getDataItems
();
let
requestData
:
any
=
{};
formItemItems
.
forEach
((
item
:
any
)
=>
{
if
(
item
&&
item
.
dataType
&&
Object
.
is
(
item
.
dataType
,
'FONTKEY'
)){
if
(
item
&&
item
.
prop
){
requestData
[
item
.
prop
]
=
context
[
item
.
name
];
}
}
else
{
if
(
item
&&
item
.
prop
){
requestData
[
item
.
prop
]
=
data
[
item
.
name
];
}
}
});
if
(
data
&&
data
.
viewparams
){
Object
.
assign
(
requestData
,
data
.
viewparams
);
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
if
(
tempContext
&&
tempContext
.
srfsessionid
){
tempContext
.
srfsessionkey
=
tempContext
.
srfsessionid
;
delete
tempContext
.
srfsessionid
;
}
return
{
context
:
tempContext
,
data
:
requestData
};
}
}
\ No newline at end of file
app_Web/src/widgets/wfremodel/main-form/main-form.less
0 → 100644
浏览文件 @
0d279c66
.ivu-tabs-no-animation>.ivu-tabs-content{
padding: 0 16px;
}
.ivu-card-head{
padding: 14px 0;
}
.app-form {
overflow: auto;
> .ivu-row {
> .ivu-tabs {
height: 100%;
display: flex;
flex-direction: column;
> .ivu-tabs-content {
flex-grow: 1;
overflow: auto;
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
}
}
.app-tabpanel-flex {
height: 100%;
> .ivu-tabs-content {
height: calc(100% - 52px);
> .ivu-tabs-tabpane {
height: 100%;
}
}
}
.app-form {
>.ivu-row:nth-child(2) {
>.ivu-col:nth-child(1) {
>.ivu-row.app-form-group.app-group-hiddden-caption:nth-child(1) {
margin-top: 12px;
}
}
}
}
// 表单行间距
.app-form{
.app-form-item{
margin-bottom: 20px;
}
}
// this is less
app_Web/src/widgets/wfremodel/main-form/main-form.vue
0 → 100644
浏览文件 @
0d279c66
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
MainBase
from
'./main-form-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
Main
extends
MainBase
{
}
</
script
>
\ No newline at end of file
ibzrt-app/ibzrt-app-web/src/main/resources/application-web-prod.yml
浏览文件 @
0d279c66
...
...
@@ -11,6 +11,10 @@ zuul:
path
:
/sysusers/**
serviceId
:
ibzuaa-api
stripPrefix
:
false
sys_authlog
:
path
:
/sysauthlogs/**
serviceId
:
ibzuaa-api
stripPrefix
:
false
wf_group_member
:
path
:
/wfmembers/**
serviceId
:
ibzwf-api
...
...
@@ -27,6 +31,10 @@ zuul:
path
:
/wfgroups/**
serviceId
:
ibzrt-api
stripPrefix
:
false
wf_model
:
path
:
/wfremodels/**
serviceId
:
ibzwf-api
stripPrefix
:
false
sys_user_role
:
path
:
/sysuserroles/**
serviceId
:
ibzuaa-api
...
...
ibzrt-core/src/main/resources/permission/systemResource.json
浏览文件 @
0d279c66
...
...
@@ -20,6 +20,14 @@
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
"dename"
:
"SysAuthLog"
,
"delogicname"
:
"认证日志"
,
"sysmoudle"
:{
"id"
:
"UAA"
,
"name"
:
"uaa"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
"dename"
:
"WFMember"
,
"delogicname"
:
"成员"
,
"sysmoudle"
:{
"id"
:
"WORKFLOW"
,
"name"
:
"workflow"
},
...
...
@@ -52,6 +60,14 @@
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
"dename"
:
"WFREModel"
,
"delogicname"
:
"流程模型"
,
"sysmoudle"
:{
"id"
:
"WORKFLOW"
,
"name"
:
"workflow"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
"dename"
:
"SysUserRole"
,
"delogicname"
:
"用户角色关系"
,
"sysmoudle"
:{
"id"
:
"UAA"
,
"name"
:
"uaa"
},
...
...
@@ -105,7 +121,7 @@
{
"appid"
:
"Web"
,
"appname"
:
"iBizRT"
,
"appmenu"
:[{
"menuid"
:
"Index"
,
"menuname"
:
"Index"
,
"menuitem"
:[{
"id"
:
"menuitem
1"
,
"name"
:
"单位管理"
},{
"id"
:
"menuitem2"
,
"name"
:
"部门管理"
},{
"id"
:
"menuitem3"
,
"name"
:
"人员管理"
},{
"id"
:
"menuitem4"
,
"name"
:
"用户角色"
},{
"id"
:
"menuitem5"
,
"name"
:
"流程角色"
},{
"id"
:
"menuitem6"
,
"name"
:
"流程定义"
}]
}]
"appmenu"
:[{
"menuid"
:
"Index"
,
"menuname"
:
"Index"
,
"menuitem"
:[{
"id"
:
"menuitem
7"
,
"name"
:
"组织部门管理"
,
"items"
:[{
"id"
:
"menuitem1"
,
"name"
:
"单位管理"
},{
"id"
:
"menuitem2"
,
"name"
:
"部门管理"
},{
"id"
:
"menuitem3"
,
"name"
:
"人员管理"
}]},{
"id"
:
"menuitem8"
,
"name"
:
"权限管理"
,
"items"
:[{
"id"
:
"menuitem4"
,
"name"
:
"用户角色"
},{
"id"
:
"menuitem9"
,
"name"
:
"认证日志"
}]},{
"id"
:
"menuitem10"
,
"name"
:
"流程管理"
,
"items"
:[{
"id"
:
"menuitem6"
,
"name"
:
"流程定义"
},{
"id"
:
"menuitem5"
,
"name"
:
"流程角色"
},{
"id"
:
"menuitem11"
,
"name"
:
"发布新流程"
}]
}]
}]
}
]
}
ibzrt-provider/ibzrt-provider-api/src/main/java/cn/ibizlab/api/dto/SysAuthLogDTO.java
0 → 100644
浏览文件 @
0d279c66
package
cn
.
ibizlab
.
api
.
dto
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.math.BigInteger
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
cn.ibizlab.util.domain.DTOBase
;
import
lombok.Data
;
/**
* 服务DTO对象[SysAuthLogDTO]
*/
@Data
public
class
SysAuthLogDTO
extends
DTOBase
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 属性 [LOGID]
*
*/
@JSONField
(
name
=
"logid"
)
@JsonProperty
(
"logid"
)
private
String
logid
;
/**
* 属性 [USERNAME]
*
*/
@JSONField
(
name
=
"username"
)
@JsonProperty
(
"username"
)
private
String
username
;
/**
* 属性 [PERSONNAME]
*
*/
@JSONField
(
name
=
"personname"
)
@JsonProperty
(
"personname"
)
private
String
personname
;
/**
* 属性 [DOMAIN]
*
*/
@JSONField
(
name
=
"domain"
)
@JsonProperty
(
"domain"
)
private
String
domain
;
/**
* 属性 [AUTHTIME]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"authtime"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"authtime"
)
private
Timestamp
authtime
;
/**
* 属性 [IPADDR]
*
*/
@JSONField
(
name
=
"ipaddr"
)
@JsonProperty
(
"ipaddr"
)
private
String
ipaddr
;
/**
* 属性 [MACADDR]
*
*/
@JSONField
(
name
=
"macaddr"
)
@JsonProperty
(
"macaddr"
)
private
String
macaddr
;
/**
* 属性 [USERAGENT]
*
*/
@JSONField
(
name
=
"useragent"
)
@JsonProperty
(
"useragent"
)
private
String
useragent
;
/**
* 属性 [AUTHCODE]
*
*/
@JSONField
(
name
=
"authcode"
)
@JsonProperty
(
"authcode"
)
private
String
authcode
;
/**
* 设置 [USERNAME]
*/
public
void
setUsername
(
String
username
){
this
.
username
=
username
;
this
.
modify
(
"username"
,
username
);
}
/**
* 设置 [PERSONNAME]
*/
public
void
setPersonname
(
String
personname
){
this
.
personname
=
personname
;
this
.
modify
(
"personname"
,
personname
);
}
/**
* 设置 [DOMAIN]
*/
public
void
setDomain
(
String
domain
){
this
.
domain
=
domain
;
this
.
modify
(
"domain"
,
domain
);
}
/**
* 设置 [IPADDR]
*/
public
void
setIpaddr
(
String
ipaddr
){
this
.
ipaddr
=
ipaddr
;
this
.
modify
(
"ipaddr"
,
ipaddr
);
}
/**
* 设置 [MACADDR]
*/
public
void
setMacaddr
(
String
macaddr
){
this
.
macaddr
=
macaddr
;
this
.
modify
(
"macaddr"
,
macaddr
);
}
/**
* 设置 [USERAGENT]
*/
public
void
setUseragent
(
String
useragent
){
this
.
useragent
=
useragent
;
this
.
modify
(
"useragent"
,
useragent
);
}
/**
* 设置 [AUTHCODE]
*/
public
void
setAuthcode
(
String
authcode
){
this
.
authcode
=
authcode
;
this
.
modify
(
"authcode"
,
authcode
);
}
}
ibzrt-provider/ibzrt-provider-api/src/main/java/cn/ibizlab/api/mapping/SysAuthLogMapping.java
0 → 100644
浏览文件 @
0d279c66
package
cn
.
ibizlab
.
api
.
mapping
;
import
org.mapstruct.*
;
import
cn.ibizlab.core.uaa.domain.SysAuthLog
;
import
cn.ibizlab.api.dto.SysAuthLogDTO
;
import
cn.ibizlab.util.domain.MappingBase
;
import
org.mapstruct.factory.Mappers
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
nullValuePropertyMappingStrategy
=
NullValuePropertyMappingStrategy
.
IGNORE
,
nullValueCheckStrategy
=
NullValueCheckStrategy
.
ALWAYS
)
public
interface
SysAuthLogMapping
extends
MappingBase
<
SysAuthLogDTO
,
SysAuthLog
>
{
}
ibzrt-provider/ibzrt-provider-api/src/main/java/cn/ibizlab/api/rest/SysAuthLogResource.java
0 → 100644
浏览文件 @
0d279c66
package
cn
.
ibizlab
.
api
.
rest
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.ServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.StringUtils
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
cn.ibizlab.api.dto.*
;
import
cn.ibizlab.api.mapping.*
;
import
cn.ibizlab.core.uaa.domain.SysAuthLog
;
import
cn.ibizlab.core.uaa.service.ISysAuthLogService
;
import
cn.ibizlab.core.uaa.filter.SysAuthLogSearchContext
;
@Slf4j
@Api
(
tags
=
{
"SysAuthLog"
})
@RestController
(
"api-sysauthlog"
)
@RequestMapping
(
""
)
public
class
SysAuthLogResource
{
@Autowired
public
ISysAuthLogService
sysauthlogService
;
@Autowired
@Lazy
public
SysAuthLogMapping
sysauthlogMapping
;
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SysAuthLog"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SysAuthLogDTO
sysauthlogdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysauthlogService
.
checkKey
(
sysauthlogMapping
.
toDomain
(
sysauthlogdto
)));
}
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SysAuthLog"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysauthlogs/{sysauthlog_id}"
)
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sysauthlog_id"
)
String
sysauthlog_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysauthlogService
.
remove
(
sysauthlog_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"SysAuthLog"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysauthlogs/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sysauthlogService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SysAuthLog"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysauthlogs/getdraft"
)
public
ResponseEntity
<
SysAuthLogDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysauthlogMapping
.
toDto
(
sysauthlogService
.
getDraft
(
new
SysAuthLog
())));
}
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SysAuthLog"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysauthlogs/{sysauthlog_id}"
)
public
ResponseEntity
<
SysAuthLogDTO
>
update
(
@PathVariable
(
"sysauthlog_id"
)
String
sysauthlog_id
,
@RequestBody
SysAuthLogDTO
sysauthlogdto
)
{
SysAuthLog
domain
=
sysauthlogMapping
.
toDomain
(
sysauthlogdto
);
domain
.
setLogid
(
sysauthlog_id
);
sysauthlogService
.
update
(
domain
);
SysAuthLogDTO
dto
=
sysauthlogMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"SysAuthLog"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysauthlogs/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SysAuthLogDTO
>
sysauthlogdtos
)
{
sysauthlogService
.
updateBatch
(
sysauthlogMapping
.
toDomain
(
sysauthlogdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SysAuthLog"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SysAuthLogDTO
sysauthlogdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysauthlogService
.
save
(
sysauthlogMapping
.
toDomain
(
sysauthlogdto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SysAuthLog"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SysAuthLogDTO
>
sysauthlogdtos
)
{
sysauthlogService
.
saveBatch
(
sysauthlogMapping
.
toDomain
(
sysauthlogdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SysAuthLog"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs"
)
public
ResponseEntity
<
SysAuthLogDTO
>
create
(
@RequestBody
SysAuthLogDTO
sysauthlogdto
)
{
SysAuthLog
domain
=
sysauthlogMapping
.
toDomain
(
sysauthlogdto
);
sysauthlogService
.
create
(
domain
);
SysAuthLogDTO
dto
=
sysauthlogMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"SysAuthLog"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SysAuthLogDTO
>
sysauthlogdtos
)
{
sysauthlogService
.
createBatch
(
sysauthlogMapping
.
toDomain
(
sysauthlogdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SysAuthLog"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysauthlogs/{sysauthlog_id}"
)
public
ResponseEntity
<
SysAuthLogDTO
>
get
(
@PathVariable
(
"sysauthlog_id"
)
String
sysauthlog_id
)
{
SysAuthLog
domain
=
sysauthlogService
.
get
(
sysauthlog_id
);
SysAuthLogDTO
dto
=
sysauthlogMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SysAuthLog"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysauthlogs/fetchdefault"
)
public
ResponseEntity
<
List
<
SysAuthLogDTO
>>
fetchDefault
(
SysAuthLogSearchContext
context
)
{
Page
<
SysAuthLog
>
domains
=
sysauthlogService
.
searchDefault
(
context
)
;
List
<
SysAuthLogDTO
>
list
=
sysauthlogMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SysAuthLog"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysauthlogs/searchdefault"
)
public
ResponseEntity
<
Page
<
SysAuthLogDTO
>>
searchDefault
(
@RequestBody
SysAuthLogSearchContext
context
)
{
Page
<
SysAuthLog
>
domains
=
sysauthlogService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sysauthlogMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录