Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibztask
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibztask
提交
2c4a2af4
提交
2c4a2af4
编写于
4年前
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
6c9f86e8
变更
60
显示空白字符变更
内嵌
并排
正在显示
60 个修改的文件
包含
1729 行增加
和
226 行删除
+1729
-226
auth-service.ts
app_web/src/authservice/auth-service.ts
+1
-1
jobs-info-auth-service-base.ts
.../src/authservice/jobs-info/jobs-info-auth-service-base.ts
+2
-12
jobs-lock-auth-service-base.ts
.../src/authservice/jobs-lock/jobs-lock-auth-service-base.ts
+2
-12
jobs-log-auth-service-base.ts
...eb/src/authservice/jobs-log/jobs-log-auth-service-base.ts
+2
-12
jobs-registry-auth-service-base.ts
...hservice/jobs-registry/jobs-registry-auth-service-base.ts
+2
-12
app-form-group.vue
app_web/src/components/app-form-group/app-form-group.vue
+66
-3
app-lang.less
app_web/src/components/app-lang/app-lang.less
+3
-0
app-picker.vue
app_web/src/components/app-picker/app-picker.vue
+3
-0
app-rich-text-editor.vue
.../components/app-rich-text-editor/app-rich-text-editor.vue
+118
-2
app-slider.vue
app_web/src/components/app-slider/app-slider.vue
+1
-0
filter-mode.vue
app_web/src/components/filter-tree/filter-mode.vue
+70
-9
filter-tree.vue
app_web/src/components/filter-tree/filter-tree.vue
+90
-19
edit-view-engine.ts
app_web/src/engine/view/edit-view-engine.ts
+14
-56
list-view-engine.ts
app_web/src/engine/view/list-view-engine.ts
+3
-3
md-view-engine.ts
app_web/src/engine/view/md-view-engine.ts
+18
-2
view-engine.ts
app_web/src/engine/view/view-engine.ts
+38
-0
en-US.ts
app_web/src/locale/lang/en-US.ts
+32
-0
zh-CN.ts
app_web/src/locale/lang/zh-CN.ts
+32
-0
jobs-info-edit-view-base.vue
...ges/task/jobs-info-edit-view/jobs-info-edit-view-base.vue
+12
-2
jobs-info-grid-view-base.vue
...ges/task/jobs-info-grid-view/jobs-info-grid-view-base.vue
+16
-7
jobs-log-edit-view-base.vue
...pages/task/jobs-log-edit-view/jobs-log-edit-view-base.vue
+10
-0
jobs-log-grid-view-base.vue
...pages/task/jobs-log-grid-view/jobs-log-grid-view-base.vue
+10
-0
jobs-registry-edit-view-base.vue
.../jobs-registry-edit-view/jobs-registry-edit-view-base.vue
+12
-2
jobs-registry-grid-view-base.vue
.../jobs-registry-grid-view/jobs-registry-grid-view-base.vue
+14
-4
task-index-view-base.vue
...b/src/pages/task/task-index-view/task-index-view-base.vue
+11
-0
task-index-view.less
app_web/src/pages/task/task-index-view/task-index-view.less
+3
-1
jobs-info-ui-service-base.ts
app_web/src/uiservice/jobs-info/jobs-info-ui-service-base.ts
+17
-5
jobs-lock-ui-service-base.ts
app_web/src/uiservice/jobs-lock/jobs-lock-ui-service-base.ts
+17
-5
jobs-log-ui-service-base.ts
app_web/src/uiservice/jobs-log/jobs-log-ui-service-base.ts
+17
-5
jobs-registry-ui-service-base.ts
.../uiservice/jobs-registry/jobs-registry-ui-service-base.ts
+17
-5
ui-service.ts
app_web/src/uiservice/ui-service.ts
+7
-0
view-tool.d.ts
app_web/src/utils/types/view-tool.d.ts
+11
-0
view-tool.ts
app_web/src/utils/view-tool/view-tool.ts
+36
-0
task-index-view-appmenu-base.vue
.../task-index-view-appmenu/task-index-view-appmenu-base.vue
+1
-2
default-searchform-base.vue
.../jobs-info/default-searchform/default-searchform-base.vue
+20
-7
main-form-base.vue
app_web/src/widgets/jobs-info/main-form/main-form-base.vue
+24
-3
main-grid-base.vue
app_web/src/widgets/jobs-info/main-grid/main-grid-base.vue
+75
-3
main-grid-model.ts
app_web/src/widgets/jobs-info/main-grid/main-grid-model.ts
+4
-0
default-searchform-base.vue
...s/jobs-log/default-searchform/default-searchform-base.vue
+20
-7
main-form-base.vue
app_web/src/widgets/jobs-log/main-form/main-form-base.vue
+24
-3
main-grid-base.vue
app_web/src/widgets/jobs-log/main-grid/main-grid-base.vue
+75
-3
main-grid-model.ts
app_web/src/widgets/jobs-log/main-grid/main-grid-model.ts
+4
-0
default-searchform-base.vue
...s-registry/default-searchform/default-searchform-base.vue
+20
-7
main-form-base.vue
...eb/src/widgets/jobs-registry/main-form/main-form-base.vue
+24
-3
main-grid-base.vue
...eb/src/widgets/jobs-registry/main-grid/main-grid-base.vue
+75
-3
main-grid-model.ts
...eb/src/widgets/jobs-registry/main-grid/main-grid-model.ts
+4
-0
webSecurityConfig.java
...rc/main/java/cn/ibizlab/web/config/webSecurityConfig.java
+1
-0
DevBootApplication.java
...ask-boot/src/main/java/cn/ibizlab/DevBootApplication.java
+4
-0
JobsInfoServiceImpl.java
...n/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
+1
-1
20200709124030_init_ibzaudit.xml
...rces/liquibase/changelog/20200709124030_init_ibzaudit.xml
+24
-0
apiAutoConfiguration.java
...main/java/cn/ibizlab/api/config/apiAutoConfiguration.java
+15
-0
ibztaskapiApplication.java
...i/src/main/java/cn/ibizlab/api/ibztaskapiApplication.java
+4
-0
Audit.java
...-util/src/main/java/cn/ibizlab/util/annotation/Audit.java
+15
-0
DEField.java
...til/src/main/java/cn/ibizlab/util/annotation/DEField.java
+21
-5
AuditAspect.java
...til/src/main/java/cn/ibizlab/util/aspect/AuditAspect.java
+167
-0
IBZDataAudit.java
...il/src/main/java/cn/ibizlab/util/domain/IBZDataAudit.java
+33
-0
DEFieldCacheMap.java
...src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
+26
-0
IBZDataAuditMapper.java
.../main/java/cn/ibizlab/util/mapper/IBZDataAuditMapper.java
+7
-0
IBZDataAuditService.java
...ain/java/cn/ibizlab/util/service/IBZDataAuditService.java
+19
-0
SimpleAuditService.java
...main/java/cn/ibizlab/util/service/SimpleAuditService.java
+315
-0
未找到文件。
app_web/src/authservice/auth-service.ts
浏览文件 @
2c4a2af4
...
...
@@ -24,7 +24,7 @@ export default class AuthService {
* @type {(any)}
* @memberof AuthService
*/
public
defaultOPPrivs
:
any
=
{
UPDATE
:
1
,
CREATE
:
1
,
READ
:
1
,
DELETE
:
1
};
public
defaultOPPrivs
:
any
=
{
UPDATE
:
1
,
CREATE
:
1
,
READ
:
1
,
DELETE
:
1
,
WFSTART
:
1
,
DENY
:
1
,
NONE
:
1
};
/**
* Creates an instance of AuthService.
...
...
This diff is collapsed.
Click to expand it.
app_web/src/authservice/jobs-info/jobs-info-auth-service-base.ts
浏览文件 @
2c4a2af4
import
AuthService
from
'../auth-service'
;
import
JobsInfoUIService
from
'@/uiservice/jobs-info/jobs-info-ui-service'
;
/**
* 任务信息权限服务对象基类
...
...
@@ -10,13 +9,6 @@ import JobsInfoUIService from '@/uiservice/jobs-info/jobs-info-ui-service';
*/
export
default
class
JobsInfoAuthServiceBase
extends
AuthService
{
/**
* 所依赖UI服务
*
* @memberof JobsInfoAuthServiceBase
*/
public
jobsinfoUIService
:
any
;
/**
* Creates an instance of JobsInfoAuthServiceBase.
*
...
...
@@ -25,18 +17,16 @@ export default class JobsInfoAuthServiceBase extends AuthService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
jobsinfoUIService
=
new
JobsInfoUIService
(
opts
);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*}
data 传入数据
* @param {*}
mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof JobsInfoAuthServiceBase
*/
public
getOPPrivs
(
data
:
any
):
any
{
let
mainSateOPPrivs
:
any
=
this
.
jobsinfoUIService
.
getDEMainStateOPPrivs
(
data
);
public
getOPPrivs
(
mainSateOPPrivs
:
any
):
any
{
let
curDefaultOPPrivs
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultOPPrivs
));
if
(
mainSateOPPrivs
){
Object
.
assign
(
curDefaultOPPrivs
,
mainSateOPPrivs
);
...
...
This diff is collapsed.
Click to expand it.
app_web/src/authservice/jobs-lock/jobs-lock-auth-service-base.ts
浏览文件 @
2c4a2af4
import
AuthService
from
'../auth-service'
;
import
JobsLockUIService
from
'@/uiservice/jobs-lock/jobs-lock-ui-service'
;
/**
* 任务锁权限服务对象基类
...
...
@@ -10,13 +9,6 @@ import JobsLockUIService from '@/uiservice/jobs-lock/jobs-lock-ui-service';
*/
export
default
class
JobsLockAuthServiceBase
extends
AuthService
{
/**
* 所依赖UI服务
*
* @memberof JobsLockAuthServiceBase
*/
public
jobslockUIService
:
any
;
/**
* Creates an instance of JobsLockAuthServiceBase.
*
...
...
@@ -25,18 +17,16 @@ export default class JobsLockAuthServiceBase extends AuthService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
jobslockUIService
=
new
JobsLockUIService
(
opts
);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*}
data 传入数据
* @param {*}
mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof JobsLockAuthServiceBase
*/
public
getOPPrivs
(
data
:
any
):
any
{
let
mainSateOPPrivs
:
any
=
this
.
jobslockUIService
.
getDEMainStateOPPrivs
(
data
);
public
getOPPrivs
(
mainSateOPPrivs
:
any
):
any
{
let
curDefaultOPPrivs
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultOPPrivs
));
if
(
mainSateOPPrivs
){
Object
.
assign
(
curDefaultOPPrivs
,
mainSateOPPrivs
);
...
...
This diff is collapsed.
Click to expand it.
app_web/src/authservice/jobs-log/jobs-log-auth-service-base.ts
浏览文件 @
2c4a2af4
import
AuthService
from
'../auth-service'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
/**
* 任务调度日志权限服务对象基类
...
...
@@ -10,13 +9,6 @@ import JobsLogUIService from '@/uiservice/jobs-log/jobs-log-ui-service';
*/
export
default
class
JobsLogAuthServiceBase
extends
AuthService
{
/**
* 所依赖UI服务
*
* @memberof JobsLogAuthServiceBase
*/
public
jobslogUIService
:
any
;
/**
* Creates an instance of JobsLogAuthServiceBase.
*
...
...
@@ -25,18 +17,16 @@ export default class JobsLogAuthServiceBase extends AuthService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
jobslogUIService
=
new
JobsLogUIService
(
opts
);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*}
data 传入数据
* @param {*}
mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof JobsLogAuthServiceBase
*/
public
getOPPrivs
(
data
:
any
):
any
{
let
mainSateOPPrivs
:
any
=
this
.
jobslogUIService
.
getDEMainStateOPPrivs
(
data
);
public
getOPPrivs
(
mainSateOPPrivs
:
any
):
any
{
let
curDefaultOPPrivs
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultOPPrivs
));
if
(
mainSateOPPrivs
){
Object
.
assign
(
curDefaultOPPrivs
,
mainSateOPPrivs
);
...
...
This diff is collapsed.
Click to expand it.
app_web/src/authservice/jobs-registry/jobs-registry-auth-service-base.ts
浏览文件 @
2c4a2af4
import
AuthService
from
'../auth-service'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
/**
* 任务注册信息权限服务对象基类
...
...
@@ -10,13 +9,6 @@ import JobsRegistryUIService from '@/uiservice/jobs-registry/jobs-registry-ui-se
*/
export
default
class
JobsRegistryAuthServiceBase
extends
AuthService
{
/**
* 所依赖UI服务
*
* @memberof JobsRegistryAuthServiceBase
*/
public
jobsregistryUIService
:
any
;
/**
* Creates an instance of JobsRegistryAuthServiceBase.
*
...
...
@@ -25,18 +17,16 @@ export default class JobsRegistryAuthServiceBase extends AuthService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
jobsregistryUIService
=
new
JobsRegistryUIService
(
opts
);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*}
data 传入数据
* @param {*}
mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof JobsRegistryAuthServiceBase
*/
public
getOPPrivs
(
data
:
any
):
any
{
let
mainSateOPPrivs
:
any
=
this
.
jobsregistryUIService
.
getDEMainStateOPPrivs
(
data
);
public
getOPPrivs
(
mainSateOPPrivs
:
any
):
any
{
let
curDefaultOPPrivs
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
defaultOPPrivs
));
if
(
mainSateOPPrivs
){
Object
.
assign
(
curDefaultOPPrivs
,
mainSateOPPrivs
);
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/app-form-group/app-form-group.vue
浏览文件 @
2c4a2af4
...
...
@@ -27,7 +27,7 @@
</a>
<dropdown-menu
slot=
'list'
v-if=
"uiActionGroup.details && Array.isArray(uiActionGroup.details)"
>
<dropdown-item
v-for=
"(detail,index) in (uiActionGroup.details)"
:key=
"index"
:name=
"detail.name"
>
<span
class=
'item'
@
click=
"doUIAction($event, detail)"
>
<span
class=
'item'
v-show=
"detail.visabled"
:style=
"
{'pointer-events':detail.disabled?'none':'auto'}"
@click="doUIAction($event, detail)">
<template
v-if=
"detail.isShowIcon"
>
<template
v-if=
"detail.icon && !Object.is(detail.icon, '')"
>
<i
:class=
"detail.icon"
></i>
...
...
@@ -58,7 +58,7 @@
<
span
class
=
'item-extract-mode'
>
<
template
v
-
if
=
"uiActionGroup.details && Array.isArray(uiActionGroup.details)"
>
<
div
v
-
for
=
"(detail,index) in uiActionGroup.details"
:
key
=
"index"
>
<
span
class
=
'item'
@
click
=
"doUIAction($event, detail)"
>
<
span
v
-
show
=
"detail.visabled"
:
style
=
"{'pointer-events':detail.disabled?'none':'auto'
}
"
class
=
'item'
@
click
=
"doUIAction($event, detail)"
>
<
template
v
-
if
=
"detail.isShowIcon"
>
<
template
v
-
if
=
"detail.icon && !Object.is(detail.icon, '')"
>
<
i
:
class
=
"detail.icon"
><
/i
>
...
...
@@ -107,7 +107,7 @@
<
/template
>
<
script
lang
=
"ts"
>
import
{
Vue
,
Component
,
Prop
}
from
'vue-property-decorator'
;
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
'vue-property-decorator'
;
@
Component
({
}
)
export
default
class
AppFormGroup
extends
Vue
{
...
...
@@ -120,6 +120,69 @@ export default class AppFormGroup extends Vue {
*/
@
Prop
()
public
caption
?:
string
;
/**
* 注入的UI服务
*
* @type {*
}
* @memberof AppFormGroup
*/
@
Prop
()
public
uiService
!
:
any
;
/**
* 注入数据
*
* @type {*
}
* @memberof AppFormGroup
*/
@
Prop
()
public
data
!
:
any
;
/**
* 监听值变化
*
* @memberof AppFormGroup
*/
@
Watch
(
'data'
)
onSrfupdatedateChange
(
newVal
:
any
,
oldVal
:
any
)
{
if
((
newVal
!==
oldVal
)
&&
this
.
uiActionGroup
.
details
.
length
>
0
){
this
.
calcActionItemAuthState
(
newVal
,
this
.
uiActionGroup
.
details
,
this
.
uiService
);
}
}
/**
* 计算界面行为项权限状态
*
* @param {*
}
[data] 传入数据
* @param {*
}
[ActionModel] 界面行为模型
* @param {*
}
[UIService] 界面行为服务
* @memberof AppFormGroup
*/
public
calcActionItemAuthState
(
data
:
any
,
ActionModel
:
any
,
UIService
:
any
){
for
(
const
key
in
ActionModel
)
{
if
(
!
ActionModel
.
hasOwnProperty
(
key
))
{
return
;
}
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
&&
data
&&
Object
.
keys
(
data
).
length
>
0
){
let
dataActionResult
:
any
=
UIService
.
getAllOPPrivs
(
data
)[
_item
[
'dataaccaction'
]];
// 无权限:0;有权限:1
if
(
!
dataActionResult
){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if
(
_item
.
noprivdisplaymode
===
1
){
_item
.
disabled
=
true
;
}
if
((
_item
.
noprivdisplaymode
===
2
)
||
(
_item
.
noprivdisplaymode
===
6
)){
_item
.
visabled
=
false
;
}
else
{
_item
.
visabled
=
true
;
}
}
else
{
_item
.
visabled
=
true
;
_item
.
disabled
=
false
;
}
}
}
}
/**
* 是否为管理容器
*
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/app-lang/app-lang.less
浏览文件 @
2c4a2af4
.ivu-dropdown{
cursor: pointer;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/components/app-picker/app-picker.vue
浏览文件 @
2c4a2af4
...
...
@@ -268,6 +268,9 @@ export default class AppPicker extends Vue {
if
(
Object
.
is
(
this
.
editortype
,
'dropdown'
)){
this
.
onSearch
(
""
,
null
,
true
);
}
if
(
!
Object
.
is
(
this
.
editortype
,
'pickup-no-ac'
)
&&
!
Object
.
is
(
this
.
editortype
,
'dropdown'
)){
this
.
curvalue
=
this
.
value
;
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/app-rich-text-editor/app-rich-text-editor.vue
浏览文件 @
2c4a2af4
...
...
@@ -106,6 +106,62 @@ export default class AppRichTextEditor extends Vue {
*/
public
langu
:
any
=
localStorage
.
getItem
(
'local'
)
?
localStorage
.
getItem
(
'local'
)
:
'zh-CN'
;
/**
* 上传params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public
upload_params
:
Array
<
any
>
=
[];
/**
* 导出params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public
export_params
:
Array
<
any
>
=
[];
/**
* 上传参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
uploadparams
?:
any
;
/**
* 下载参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
exportparams
?:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
context
!
:
any
;
/**
* 表单数据
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
data
!
:
string
;
/**
* 语言映射文件
*
...
...
@@ -142,6 +198,7 @@ export default class AppRichTextEditor extends Vue {
if
(
this
.
formState
)
{
this
.
formState
.
subscribe
(({
type
,
data
})
=>
{
if
(
Object
.
is
(
'load'
,
type
))
{
this
.
getParams
();
if
(
!
this
.
value
)
{
this
.
init
();
}
...
...
@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue {
if
(
newval
)
{
this
.
init
();
}
this
.
getParams
();
}
/**
...
...
@@ -259,13 +317,33 @@ export default class AppRichTextEditor extends Vue {
images_upload_handler
:
(
bolbinfo
:
any
,
success
:
any
,
failure
:
any
)
=>
{
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
bolbinfo
.
blob
(),
bolbinfo
.
filename
());
const
_url
=
richtexteditor
.
uploadUrl
;
let
_url
=
richtexteditor
.
uploadUrl
;
if
(
this
.
upload_params
.
length
>
0
)
{
_url
+=
'?'
;
this
.
upload_params
.
forEach
((
item
:
any
,
i
:
any
)
=>
{
_url
+=
`
${
Object
.
keys
(
item
)[
0
]}
=
${
Object
.
values
(
item
)[
0
]}
`
;
if
(
i
<
this
.
upload_params
.
length
-
1
){
_url
+=
'&'
;
}
})
}
this
.
uploadUrl
=
_url
;
richtexteditor
.
uploadFile
(
_url
,
formData
).
subscribe
((
file
:
any
)
=>
{
let
downloadUrl
=
richtexteditor
.
downloadUrl
;
if
(
file
.
filename
)
{
const
id
:
string
=
file
.
fileid
;
const
url
:
string
=
`
${
richtexteditor
.
downloadUrl
}
/
${
id
}
`
const
url
:
string
=
`
${
downloadUrl
}
/
${
id
}
`
success
(
url
);
}
if
(
this
.
export_params
.
length
>
0
)
{
downloadUrl
+=
'?'
;
this
.
export_params
.
forEach
((
item
:
any
,
i
:
any
)
=>
{
downloadUrl
+=
`
${
Object
.
keys
(
item
)[
0
]}
=
${
Object
.
values
(
item
)[
0
]}
`
;
if
(
i
<
this
.
export_params
.
length
-
1
){
downloadUrl
+=
'&'
;
}
})
}
},
(
error
:
any
)
=>
{
console
.
log
(
error
);
failure
(
'HTTP Error: '
+
error
.
status
);
...
...
@@ -310,6 +388,44 @@ export default class AppRichTextEditor extends Vue {
});
return
subject
;
}
/**
*获取上传,导出参数
*
*@memberof AppRichTextEditor
*/
public
getParams
(){
let
uploadparams
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
uploadparams
));
let
exportparams
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
exportparams
));
let
upload_params
:
Array
<
string
>
=
[];
let
export_params
:
Array
<
string
>
=
[];
let
param
:
any
=
this
.
viewparams
;
let
context
:
any
=
this
.
context
;
let
_data
:
any
=
JSON
.
parse
(
this
.
data
);
if
(
this
.
uploadparams
&&
!
Object
.
is
(
this
.
uploadparams
,
''
))
{
upload_params
=
this
.
$util
.
computedNavData
(
_data
,
param
,
context
,
uploadparams
);
}
if
(
this
.
exportparams
&&
!
Object
.
is
(
this
.
exportparams
,
''
))
{
export_params
=
this
.
$util
.
computedNavData
(
_data
,
param
,
context
,
exportparams
);
}
this
.
upload_params
=
[];
this
.
export_params
=
[];
for
(
const
item
in
upload_params
)
{
this
.
upload_params
.
push
({
[
item
]:
upload_params
[
item
]
})
}
for
(
const
item
in
export_params
)
{
this
.
export_params
.
push
({
[
item
]:
export_params
[
item
]
})
}
}
}
</
script
>
<
style
lang=
"less"
>
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/app-slider/app-slider.vue
浏览文件 @
2c4a2af4
...
...
@@ -76,6 +76,7 @@ export default class AppSlider extends Vue {
*/
@
Watch
(
'value'
)
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
newVal
=
(
newVal
===
null
)
?
0
:
newVal
;
this
.
currentVal
=
parseInt
(
newVal
);
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/filter-tree/filter-mode.vue
浏览文件 @
2c4a2af4
<
template
>
<el-select
size=
"small"
class=
"filter-mode"
:placeholder=
"$t('components.filterMode.placeholder')"
v-model=
"curVal"
@
change=
"onChange"
>
<el-option
v-for=
"mode in filterMode"
v-for=
"mode in fi
eldFi
lterMode"
:key=
"mode.value"
:label=
"getLabel(mode)"
:value=
"mode.value"
...
...
@@ -11,7 +11,7 @@
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Model
}
from
"vue-property-decorator"
;
import
{
Vue
,
Component
,
Model
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
@
Component
({})
export
default
class
FilterMode
extends
Vue
{
...
...
@@ -24,6 +24,19 @@ export default class FilterMode extends Vue {
*/
@
Model
(
'change'
)
readonly
value
:
any
;
/**
* 自定义逻辑集合
*
* @type {*}
* @memberof FilterMode
*/
@
Prop
()
modes
!
:
any
[];
@
Watch
(
'modes'
)
onModesChange
(
newVal
:
any
)
{
this
.
setDefValue
();
}
get
curVal
()
{
return
this
.
value
;
}
...
...
@@ -34,6 +47,21 @@ export default class FilterMode extends Vue {
this
.
$emit
(
'change'
,
val
);
}
get
fieldFilterMode
()
{
if
(
this
.
modes
&&
this
.
modes
.
length
>
0
)
{
let
index
:
number
=
this
.
modes
.
findIndex
((
mode
:
any
)
=>
Object
.
is
(
mode
.
mode
,
'all'
));
if
(
index
<
0
)
{
let
items
:
any
[]
=
[];
this
.
modes
.
forEach
((
mode
:
any
)
=>
{
let
item
:
any
=
this
.
filterMode
.
find
((
filter
:
any
)
=>
Object
.
is
(
filter
[
'en-US'
],
mode
.
mode
));
items
.
push
(
item
);
})
return
items
;
}
}
return
this
.
filterMode
;
}
/**
* 过滤模式
*
...
...
@@ -44,13 +72,13 @@ export default class FilterMode extends Vue {
// { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' },
{
'zh-CN'
:
'等于(=)'
,
'en-US'
:
'EQ'
,
value
:
'$eq'
},
{
'zh-CN'
:
'不等于(<>)'
,
'en-US'
:
'N
E
'
,
value
:
'$ne'
},
{
'zh-CN'
:
'不等于(<>)'
,
'en-US'
:
'N
OTEQ
'
,
value
:
'$ne'
},
{
'zh-CN'
:
'大于(>)'
,
'en-US'
:
'GT'
,
value
:
'$gt'
},
{
'zh-CN'
:
'大于等于(>=)'
,
'en-US'
:
'G
E
'
,
value
:
'$gte'
},
{
'zh-CN'
:
'大于等于(>=)'
,
'en-US'
:
'G
TANDEQ
'
,
value
:
'$gte'
},
{
'zh-CN'
:
'小于(<)'
,
'en-US'
:
'LT'
,
value
:
'$lt'
},
{
'zh-CN'
:
'小于
(<=)'
,
'en-US'
:
'LE
'
,
value
:
'$lte'
},
{
'zh-CN'
:
'值为空(Nil)'
,
'en-US'
:
'IS
_
NULL'
,
value
:
'$null'
},
{
'zh-CN'
:
'值不为空(NotNil)'
,
'en-US'
:
'IS
_NOT_
NULL'
,
value
:
'$notNull'
},
{
'zh-CN'
:
'小于
等于(<=)'
,
'en-US'
:
'LTANDEQ
'
,
value
:
'$lte'
},
{
'zh-CN'
:
'值为空(Nil)'
,
'en-US'
:
'ISNULL'
,
value
:
'$null'
},
{
'zh-CN'
:
'值不为空(NotNil)'
,
'en-US'
:
'IS
NOT
NULL'
,
value
:
'$notNull'
},
{
'zh-CN'
:
'值在范围中(In)'
,
'en-US'
:
'IN'
,
value
:
'$in'
},
{
'zh-CN'
:
'值不在范围中(NotIn)'
,
'en-US'
:
'NOTIN'
,
value
:
'$notIn'
},
{
'zh-CN'
:
'文本包含(%)'
,
'en-US'
:
'LIKE'
,
value
:
'$like'
},
...
...
@@ -60,13 +88,37 @@ export default class FilterMode extends Vue {
// { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
];
/**
* 生命周期
*
* @return {void}
* @memberof FilterMode
*/
public
mounted
()
{
this
.
setDefValue
()
}
/**
* 设置默认值
*
* @return {void}
* @memberof FilterMode
*/
public
setDefValue
()
{
if
(
this
.
fieldFilterMode
.
length
>
0
)
{
this
.
curVal
=
this
.
fieldFilterMode
[
0
].
value
;
this
.
onChange
();
}
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel
(
mode
:
any
):
string
{
public
getLabel
(
mode
:
any
):
string
{
if
(
this
.
$i18n
.
locale
)
{
return
mode
[
this
.
$i18n
.
locale
];
}
...
...
@@ -79,7 +131,16 @@ export default class FilterMode extends Vue {
* @memberof FilterMode
*/
public
onChange
()
{
this
.
$emit
(
'mode-change'
,
this
.
value
);
this
.
$nextTick
(()
=>
{
let
item
:
any
=
this
.
filterMode
.
find
((
filter
:
any
)
=>
Object
.
is
(
filter
.
value
,
this
.
curVal
));
if
(
this
.
modes
&&
this
.
modes
.
length
>
0
)
{
let
mode
:
any
=
this
.
modes
.
find
((
mode
:
any
)
=>
Object
.
is
(
mode
.
mode
,
item
[
'en-US'
]));
if
(
!
mode
)
{
mode
=
this
.
modes
.
find
((
mode
:
any
)
=>
Object
.
is
(
mode
.
mode
,
'all'
));
}
this
.
$emit
(
'on-change'
,
mode
);
}
})
}
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/components/filter-tree/filter-tree.vue
浏览文件 @
2c4a2af4
...
...
@@ -15,18 +15,20 @@
</
template
>
<
template
v-else
>
<div
class=
"filter-tree-item"
>
<el-select
size=
"small"
class=
"filter-item-field"
v-model=
"data.field"
clearable
:placeholder=
"$t('components.filterTree.placeholder')"
@
change=
"onFieldChange(data)"
>
<el-select
size=
"small"
class=
"filter-item-field"
v-model=
"data.field"
clearable
:placeholder=
"$t('components.filterTree.placeholder')"
>
<el-option
v-for=
"item in fields"
:key=
"item.
prop
"
v-for=
"item in field
Item
s"
:key=
"item.
value
"
:label=
"item.label"
:value=
"item.
nam
e"
>
:value=
"item.
valu
e"
>
</el-option>
</el-select>
<filter-mode
class=
"filter-item-mode"
v-model=
"data.mode"
></filter-mode>
<filter-mode
class=
"filter-item-mode"
v-model=
"data.mode"
:modes=
"getModes(data.field)"
@
on-change=
"onModeChange($event, data)"
></filter-mode>
<div
class=
"filter-item-value"
>
<i-input
v-if=
"!data.field"
></i-input>
<slot
v-else
:data=
"data"
></slot>
<i-input
v-if=
"!data.editor"
></i-input>
<div
v-else
:key=
"data.editor"
>
<slot
:data=
"data"
></slot>
</div>
</div>
<div
class=
"filter-tree-action"
>
<icon
type=
"md-close"
@
click=
"onRemoveItem(node, data)"
/>
...
...
@@ -64,6 +66,14 @@ export default class FilterTree extends Vue {
*/
@
Prop
()
fields
:
any
;
/**
* 属性项集合
*
* @type {*}
* @memberof FilterTree
*/
protected
fieldItems
:
any
[]
=
[];
/**
* 组条件集合
*
...
...
@@ -93,29 +103,77 @@ export default class FilterTree extends Vue {
return
[
root
];
}
/**
*
获取语言文本
*
生命周期
*
* @return {
string
}
* @return {
void
}
* @memberof FilterTree
*/
getLabel
(
mode
:
any
):
string
{
if
(
this
.
$i18n
.
locale
)
{
return
mode
[
this
.
$i18n
.
locale
]
;
public
created
()
{
if
(
!
this
.
fields
)
{
return
;
}
return
mode
[
'zh-CN'
];
this
.
fields
.
forEach
((
field
:
any
)
=>
{
let
index
:
number
=
this
.
fieldItems
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
.
value
,
field
.
prop
));
if
(
index
<
0
)
{
this
.
fieldItems
.
push
({
label
:
field
.
label
,
value
:
field
.
prop
,
modes
:
this
.
getFieldModes
(
field
.
prop
)
})
}
});
}
/**
*
属性变化
*
获取逻辑模式集合
*
* @return {
*
}
* @return {
void
}
* @memberof FilterTree
*/
public
onFieldChange
(
data
:
any
)
{
if
(
!
data
.
mode
)
{
data
.
mode
=
'$eq'
;
public
getModes
(
field
:
string
)
{
if
(
this
.
fieldItems
.
length
>
0
)
{
let
item
:
any
=
this
.
fieldItems
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
value
,
field
));
if
(
item
)
{
return
item
.
modes
;
}
}
return
[];
}
/**
* 获取属性逻辑模式集合
*
* @return {void}
* @memberof FilterTree
*/
public
getFieldModes
(
name
:
string
)
{
let
modes
:
any
[]
=
[];
for
(
let
i
=
0
;
i
<
this
.
fields
.
length
;
i
++
)
{
let
field
:
any
=
this
.
fields
[
i
];
if
(
!
Object
.
is
(
field
.
prop
,
name
))
{
continue
;
}
modes
.
push
({
name
:
field
.
name
,
mode
:
field
.
mode
?
field
.
mode
:
'all'
})
}
return
modes
;
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel
(
mode
:
any
):
string
{
if
(
this
.
$i18n
.
locale
)
{
return
mode
[
this
.
$i18n
.
locale
];
}
return
mode
[
'zh-CN'
];
}
/**
...
...
@@ -128,7 +186,8 @@ export default class FilterTree extends Vue {
if
(
data
&&
data
.
children
)
{
data
.
children
.
push
({
field
:
null
,
mode
:
null
mode
:
null
,
editor
:
null
});
}
}
...
...
@@ -162,6 +221,18 @@ export default class FilterTree extends Vue {
}
}
}
/**
* 条件逻辑变化
*
* @return {*}
* @memberof FilterTree
*/
public
onModeChange
(
mode
:
any
,
data
:
any
)
{
if
(
mode
&&
data
)
{
data
.
editor
=
mode
.
name
;
}
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
app_web/src/engine/view/edit-view-engine.ts
浏览文件 @
2c4a2af4
...
...
@@ -106,6 +106,7 @@ export default class EditViewEngine extends ViewEngine {
this
.
setTabCaption
(
this
.
view
.
model
.
dataInfo
,
Object
.
is
(
arg
.
srfuf
,
'0'
));
const
newdata
:
boolean
=
!
Object
.
is
(
arg
.
srfuf
,
'1'
);
this
.
calcToolbarItemState
(
newdata
);
this
.
calcToolbarItemAuthState
(
this
.
transformData
(
arg
));
}
/**
...
...
@@ -120,6 +121,7 @@ export default class EditViewEngine extends ViewEngine {
this
.
setTabCaption
(
this
.
view
.
model
.
dataInfo
,
Object
.
is
(
arg
.
srfuf
,
'0'
));
const
newdata
:
boolean
=
!
Object
.
is
(
arg
.
srfuf
,
'1'
);
this
.
calcToolbarItemState
(
newdata
);
this
.
calcToolbarItemAuthState
(
this
.
transformData
(
arg
));
this
.
view
.
$emit
(
'save'
,
arg
);
this
.
view
.
$emit
(
'viewdataschange'
,
JSON
.
stringify
({
action
:
'save'
,
status
:
'success'
,
data
:
arg
}));
}
...
...
@@ -144,66 +146,10 @@ export default class EditViewEngine extends ViewEngine {
* @memberof EditViewEngine
*/
public
doSysUIAction
(
tag
:
string
,
actionmode
?:
string
):
void
{
// if (Object.is(tag, 'Help')) {
// this.doHelp();
// return;
// }
// if (Object.is(tag, 'SaveAndStart')) {
// this.doSaveAndStart();
// return;
// }
// if (Object.is(tag, 'SaveAndExit')) {
// this.doSaveAndExit();
// return;
// }
// if (Object.is(tag, 'SaveAndNew')) {
// this.doSaveAndNew();
// return;
// }
if
(
Object
.
is
(
tag
,
'Save'
))
{
this
.
doSave
();
return
;
}
// if (Object.is(tag, 'Print')) {
// this.doPrint();
// return;
// }
// if (Object.is(tag, 'Copy')) {
// this.doCopy();
// return;
// }
// if (Object.is(tag, 'RemoveAndExit')) {
// this.doRemoveAndExit();
// return;
// }
// if (Object.is(tag, 'Refresh')) {
// this.doRefresh();
// return;
// }
// if (Object.is(tag, 'New')) {
// this.doNew();
// return;
// }
// if (Object.is(tag, 'FirstRecord')) {
// this.doMoveToRecord('first');
// return;
// }
// if (Object.is(tag, 'PrevRecord')) {
// this.doMoveToRecord('prev');
// return;
// }
// if (Object.is(tag, 'NextRecord')) {
// this.doMoveToRecord('next');
// return;
// }
// if (Object.is(tag, 'LastRecord')) {
// this.doMoveToRecord('last');
// return;
// }
// if (Object.is(tag, 'Exit') || Object.is(tag, 'Close')) {
// this.doExit();
// return;
// }
super
.
doSysUIAction
(
tag
,
actionmode
);
}
...
...
@@ -263,4 +209,16 @@ export default class EditViewEngine extends ViewEngine {
}
}
/**
* 转化数据
*
* @memberof EditViewEngine
*/
public
transformData
(
arg
:
any
){
if
(
!
this
.
getForm
()
||
!
(
this
.
getForm
().
transformData
instanceof
Function
)){
return
null
;
}
return
this
.
getForm
().
transformData
(
arg
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/engine/view/list-view-engine.ts
浏览文件 @
2c4a2af4
...
...
@@ -150,9 +150,9 @@ export default class ListViewEngine extends MDViewEngine {
arg
.
srfkeys
=
keys
;
}
const
grid
:
any
=
this
.
getMDCtrl
();
if
(
grid
)
{
grid
.
remove
(
arg
);
const
list
:
any
=
this
.
getMDCtrl
();
if
(
list
)
{
list
.
remove
(
arg
);
}
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/engine/view/md-view-engine.ts
浏览文件 @
2c4a2af4
...
...
@@ -358,6 +358,9 @@ export default class MDViewEngine extends ViewEngine {
}
const
state
=
args
.
length
>
0
&&
!
Object
.
is
(
args
[
0
].
srfkey
,
''
)
?
false
:
true
;
this
.
calcToolbarItemState
(
state
);
if
(
args
&&
args
.
length
>
0
){
this
.
calcToolbarItemAuthState
(
this
.
transformData
(
args
[
0
]));
}
}
/**
...
...
@@ -395,8 +398,8 @@ export default class MDViewEngine extends ViewEngine {
if
(
this
.
getSearchForm
()
&&
this
.
view
.
isExpandSearchForm
)
{
Object
.
assign
(
arg
,
this
.
getSearchForm
().
getData
());
}
if
(
this
.
view
&&
this
.
view
.
searchbar
)
{
Object
.
assign
(
arg
,
this
.
view
.
searchbar
.
getData
());
if
(
this
.
view
&&
this
.
view
.
$refs
.
searchbar
&&
this
.
view
.
isExpandSearchForm
)
{
Object
.
assign
(
arg
,
this
.
view
.
$refs
.
searchbar
.
getData
());
}
if
(
this
.
view
&&
!
this
.
view
.
isExpandSearchForm
)
{
Object
.
assign
(
arg
,
{
query
:
this
.
view
.
query
});
...
...
@@ -436,4 +439,17 @@ export default class MDViewEngine extends ViewEngine {
return
this
.
propertypanel
;
}
/**
* 转化数据
*
* @memberof EditViewEngine
*/
public
transformData
(
arg
:
any
){
if
(
!
this
.
getMDCtrl
()
||
!
(
this
.
getMDCtrl
().
transformData
instanceof
Function
)){
return
null
;
}
return
this
.
getMDCtrl
().
transformData
(
arg
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/engine/view/view-engine.ts
浏览文件 @
2c4a2af4
...
...
@@ -169,6 +169,44 @@ export default class ViewEngine {
if
(
_item
.
uiaction
&&
(
Object
.
is
(
_item
.
uiaction
.
target
,
'SINGLEKEY'
)
||
Object
.
is
(
_item
.
uiaction
.
target
,
'MULTIKEY'
)))
{
_item
.
disabled
=
state
;
}
_item
.
visabled
=
true
;
if
(
_item
.
noprivdisplaymode
&&
_item
.
noprivdisplaymode
===
6
){
_item
.
visabled
=
false
;
}
}
}
/**
* 计算工具栏权限状态
*
* @param {boolean} state
* @param {*} [dataaccaction]
* @memberof ViewEngine
*/
public
calcToolbarItemAuthState
(
data
:
any
){
const
_this
:
any
=
this
;
for
(
const
key
in
_this
.
view
.
toolBarModels
)
{
if
(
!
_this
.
view
.
toolBarModels
.
hasOwnProperty
(
key
))
{
return
;
}
const
_item
=
_this
.
view
.
toolBarModels
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
_this
.
view
.
appUIService
&&
data
&&
Object
.
keys
(
data
).
length
>
0
){
let
dataActionResult
:
any
=
_this
.
view
.
appUIService
.
getAllOPPrivs
(
data
)[
_item
[
'dataaccaction'
]];
// 无权限:0;有权限:1
if
(
!
dataActionResult
){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if
(
_item
.
noprivdisplaymode
===
1
){
_this
.
view
.
toolBarModels
[
key
].
disabled
=
true
;
}
if
((
_item
.
noprivdisplaymode
===
2
)
||
(
_item
.
noprivdisplaymode
===
6
)){
_this
.
view
.
toolBarModels
[
key
].
visabled
=
false
;
}
else
{
_this
.
view
.
toolBarModels
[
key
].
visabled
=
true
;
}
}
else
{
_this
.
view
.
toolBarModels
[
key
].
visabled
=
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/locale/lang/en-US.ts
浏览文件 @
2c4a2af4
...
...
@@ -13,6 +13,7 @@ export default {
success
:
"Success"
,
ok
:
"OK"
,
cancel
:
"Cancel"
,
save
:
"Save"
,
codeNotExist
:
'Code list does not exist'
,
reqException
:
"Request exception"
,
sysException
:
"System abnormality"
,
...
...
@@ -183,6 +184,37 @@ export default {
quarter
:
"Quarter"
,
year
:
"Year"
,
},
searchForm
:
{
notConfig
:
{
loadAction
:
"View search form loadAction parameter is not configured"
,
loaddraftAction
:
"View search form loaddraftAction parameter is not configured"
,
},
custom
:
"Store custom queries"
,
title
:
"Name"
,
},
wizardPanel
:
{
back
:
"Back"
,
next
:
"Next"
,
complete
:
"Complete"
,
},
viewLayoutPanel
:
{
appLogoutView
:
{
prompt1
:
"Dear customer, you have successfully exited the system, after"
,
prompt2
:
"seconds, we will jump to the"
,
logingPage
:
"login page"
,
},
appWfstepTraceView
:
{
title
:
"Application process processing record view"
,
},
appWfstepDataView
:
{
title
:
"Application process tracking view"
,
},
appLoginView
:
{
username
:
"Username"
,
password
:
"Password"
,
login
:
"Login"
,
},
},
},
entities
:
{
jobsinfo
:
jobsinfo_en_US
,
...
...
This diff is collapsed.
Click to expand it.
app_web/src/locale/lang/zh-CN.ts
浏览文件 @
2c4a2af4
...
...
@@ -13,6 +13,7 @@ export default {
success
:
"成功"
,
ok
:
"确认"
,
cancel
:
"取消"
,
save
:
"保存"
,
codeNotExist
:
"代码表不存在"
,
reqException
:
"请求异常"
,
sysException
:
"系统异常"
,
...
...
@@ -182,6 +183,37 @@ export default {
quarter
:
"季度"
,
year
:
"年"
,
},
searchForm
:
{
notConfig
:
{
loadAction
:
"视图搜索表单loadAction参数未配置"
,
loaddraftAction
:
"视图搜索表单loaddraftAction参数未配置"
,
},
custom
:
"存储自定义查询"
,
title
:
"名称"
,
},
wizardPanel
:
{
back
:
"上一步"
,
next
:
"下一步"
,
complete
:
"完成"
,
},
viewLayoutPanel
:
{
appLogoutView
:
{
prompt1
:
"尊敬的客户您好,您已成功退出系统,将在"
,
prompt2
:
"秒后跳转至"
,
logingPage
:
"登录页"
,
},
appWfstepTraceView
:
{
title
:
"应用流程处理记录视图"
,
},
appWfstepDataView
:
{
title
:
"应用流程跟踪视图"
,
},
appLoginView
:
{
username
:
"用户名"
,
password
:
"密码"
,
login
:
"登录"
,
},
},
},
entities
:
{
jobsinfo
:
jobsinfo_zh_CN
,
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-info-edit-view/jobs-info-edit-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -61,10 +61,12 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
JobsInfoAuthService
from
'@/authservice/jobs-info/jobs-info-auth-service'
;
import
EditViewEngine
from
'@engine/view/edit-view-engine'
;
import
JobsInfoUIService
from
'@/uiservice/jobs-info/jobs-info-ui-service'
;
@
Component
({
components
:
{
...
...
@@ -80,6 +82,14 @@ export default class JobsInfoEditViewBase extends Vue {
*/
public
appEntityService
:
JobsInfoService
=
new
JobsInfoService
;
/**
* 实体权限服务对象
*
* @type JobsInfoUIService
* @memberof JobsInfoEditViewBase
*/
public
appUIService
:
JobsInfoUIService
=
new
JobsInfoUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
@@ -252,9 +262,9 @@ export default class JobsInfoEditViewBase extends Vue {
* @memberof JobsInfoEditView
*/
public
toolBarModels
:
any
=
{
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'保存'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Save'
,
target
:
''
}
},
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'保存'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Save'
,
target
:
''
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'关闭'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Exit'
,
target
:
''
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'关闭'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Exit'
,
target
:
''
}
},
};
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-info-grid-view/jobs-info-grid-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -120,6 +120,7 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
JobsInfoAuthService
from
'@/authservice/jobs-info/jobs-info-auth-service'
;
import
GridViewEngine
from
'@engine/view/grid-view-engine'
;
...
...
@@ -142,6 +143,14 @@ export default class JobsInfoGridViewBase extends Vue {
*/
public
appEntityService
:
JobsInfoService
=
new
JobsInfoService
;
/**
* 实体权限服务对象
*
* @type JobsInfoUIService
* @memberof JobsInfoGridViewBase
*/
public
appUIService
:
JobsInfoUIService
=
new
JobsInfoUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
@@ -315,19 +324,19 @@ export default class JobsInfoGridViewBase extends Vue {
* @memberof JobsInfoGridView
*/
public
toolBarModels
:
any
=
{
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'启动'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Start'
,
target
:
'SINGLEKEY'
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'启动'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Start'
,
target
:
'SINGLEKEY'
}
},
deuiaction2
:
{
name
:
'deuiaction2'
,
caption
:
'停止'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Stop'
,
target
:
'SINGLEKEY'
}
},
deuiaction2
:
{
name
:
'deuiaction2'
,
caption
:
'停止'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Stop'
,
target
:
'SINGLEKEY'
}
},
deuiaction3
:
{
name
:
'deuiaction3'
,
caption
:
'执行'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Execute'
,
target
:
'SINGLEKEY'
}
},
deuiaction3
:
{
name
:
'deuiaction3'
,
caption
:
'执行'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Execute'
,
target
:
'SINGLEKEY'
}
},
deuiaction4
:
{
name
:
'deuiaction4'
,
caption
:
'新建'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'New'
,
target
:
''
}
},
deuiaction4
:
{
name
:
'deuiaction4'
,
caption
:
'新建'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'New'
,
target
:
''
}
},
deuiaction5
:
{
name
:
'deuiaction5'
,
caption
:
'编辑'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Edit'
,
target
:
'SINGLEKEY'
}
},
deuiaction5
:
{
name
:
'deuiaction5'
,
caption
:
'编辑'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Edit'
,
target
:
'SINGLEKEY'
}
},
deuiaction6
:
{
name
:
'deuiaction6'
,
caption
:
'删除'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Remove'
,
target
:
'MULTIKEY'
}
},
deuiaction6
:
{
name
:
'deuiaction6'
,
caption
:
'删除'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Remove'
,
target
:
'MULTIKEY'
}
},
deuiaction7
:
{
name
:
'deuiaction7'
,
caption
:
'过滤'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ToggleFilter'
,
target
:
''
}
},
deuiaction7
:
{
name
:
'deuiaction7'
,
caption
:
'过滤'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ToggleFilter'
,
target
:
''
}
},
};
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-log-edit-view/jobs-log-edit-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -45,10 +45,12 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
JobsLogAuthService
from
'@/authservice/jobs-log/jobs-log-auth-service'
;
import
EditViewEngine
from
'@engine/view/edit-view-engine'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
@
Component
({
components
:
{
...
...
@@ -64,6 +66,14 @@ export default class JobsLogEditViewBase extends Vue {
*/
public
appEntityService
:
JobsLogService
=
new
JobsLogService
;
/**
* 实体权限服务对象
*
* @type JobsLogUIService
* @memberof JobsLogEditViewBase
*/
public
appUIService
:
JobsLogUIService
=
new
JobsLogUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-log-grid-view/jobs-log-grid-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -69,10 +69,12 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
JobsLogAuthService
from
'@/authservice/jobs-log/jobs-log-auth-service'
;
import
GridViewEngine
from
'@engine/view/grid-view-engine'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
...
...
@@ -90,6 +92,14 @@ export default class JobsLogGridViewBase extends Vue {
*/
public
appEntityService
:
JobsLogService
=
new
JobsLogService
;
/**
* 实体权限服务对象
*
* @type JobsLogUIService
* @memberof JobsLogGridViewBase
*/
public
appUIService
:
JobsLogUIService
=
new
JobsLogUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-registry-edit-view/jobs-registry-edit-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -61,10 +61,12 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
JobsRegistryAuthService
from
'@/authservice/jobs-registry/jobs-registry-auth-service'
;
import
EditViewEngine
from
'@engine/view/edit-view-engine'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
@
Component
({
components
:
{
...
...
@@ -80,6 +82,14 @@ export default class JobsRegistryEditViewBase extends Vue {
*/
public
appEntityService
:
JobsRegistryService
=
new
JobsRegistryService
;
/**
* 实体权限服务对象
*
* @type JobsRegistryUIService
* @memberof JobsRegistryEditViewBase
*/
public
appUIService
:
JobsRegistryUIService
=
new
JobsRegistryUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
@@ -252,9 +262,9 @@ export default class JobsRegistryEditViewBase extends Vue {
* @memberof JobsRegistryEditView
*/
public
toolBarModels
:
any
=
{
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'保存'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Save'
,
target
:
''
}
},
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'保存'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Save'
,
target
:
''
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'关闭'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Exit'
,
target
:
''
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'关闭'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Exit'
,
target
:
''
}
},
};
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/jobs-registry-grid-view/jobs-registry-grid-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -99,10 +99,12 @@ import { UIActionTool,Util } from '@/utils';
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
JobsRegistryAuthService
from
'@/authservice/jobs-registry/jobs-registry-auth-service'
;
import
GridViewEngine
from
'@engine/view/grid-view-engine'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
...
...
@@ -120,6 +122,14 @@ export default class JobsRegistryGridViewBase extends Vue {
*/
public
appEntityService
:
JobsRegistryService
=
new
JobsRegistryService
;
/**
* 实体权限服务对象
*
* @type JobsRegistryUIService
* @memberof JobsRegistryGridViewBase
*/
public
appUIService
:
JobsRegistryUIService
=
new
JobsRegistryUIService
(
this
.
$store
);
/**
* 计数器服务对象集合
...
...
@@ -293,13 +303,13 @@ export default class JobsRegistryGridViewBase extends Vue {
* @memberof JobsRegistryGridView
*/
public
toolBarModels
:
any
=
{
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'新建'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'New'
,
target
:
''
}
},
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'新建'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'New'
,
target
:
''
}
},
tbitem4
:
{
name
:
'tbitem4'
,
caption
:
'编辑'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Edit'
,
target
:
'SINGLEKEY'
}
},
tbitem4
:
{
name
:
'tbitem4'
,
caption
:
'编辑'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Edit'
,
target
:
'SINGLEKEY'
}
},
tbitem8
:
{
name
:
'tbitem8'
,
caption
:
'删除'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Remove'
,
target
:
'MULTIKEY'
}
},
tbitem8
:
{
name
:
'tbitem8'
,
caption
:
'删除'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Remove'
,
target
:
'MULTIKEY'
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'过滤'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
'2'
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ToggleFilter'
,
target
:
''
}
},
deuiaction1
:
{
name
:
'deuiaction1'
,
caption
:
'过滤'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
noprivdisplaymode
:
2
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ToggleFilter'
,
target
:
''
}
},
};
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/task-index-view/task-index-view-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -700,6 +700,7 @@ export default class TaskIndexViewBase extends Vue {
let
left_move
:
any
=
document
.
getElementById
(
"left_move"
);
let
right_move
:
any
=
document
.
getElementById
(
"right_move"
);
let
movebox
:
any
=
document
.
getElementById
(
"movebox"
);
let
leftWidth
:
number
=
parseInt
(
left_move
.
style
.
width
);
move_axis
.
onmousedown
=
(
e
:
any
)
=>
{
let
startX
=
e
.
clientX
;
move_axis
.
left
=
move_axis
.
offsetLeft
;
...
...
@@ -712,6 +713,15 @@ export default class TaskIndexViewBase extends Vue {
move_axis
.
style
.
left
=
moveLen
;
left_move
.
style
.
width
=
moveLen
+
"px"
;
right_move
.
style
.
width
=
(
movebox
.
clientWidth
-
moveLen
-
5
)
+
"px"
;
if
(
moveLen
>
500
)
{
left_move
.
style
.
width
=
500
+
'px'
;
}
let
left_width
:
number
=
parseInt
(
left_move
.
style
.
width
);
move_axis
.
style
.
left
=
left_width
-
5
+
'px'
;
if
(
left_width
<
leftWidth
){
move_axis
.
style
.
left
=
leftWidth
-
5
+
'px'
;
}
}
document
.
onmouseup
=
(
evt
)
=>
{
document
.
onmousemove
=
null
;
...
...
@@ -721,6 +731,7 @@ export default class TaskIndexViewBase extends Vue {
move_axis
.
setCapture
&&
move_axis
.
setCapture
();
return
false
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/pages/task/task-index-view/task-index-view.less
浏览文件 @
2c4a2af4
...
...
@@ -105,10 +105,12 @@
}
#move_axis{
position: absolute;
left: 195px;
width: 5px;
height: 100%;
cursor: w-resize;
float: left
;
background-color: rgba(255,255,255,0)
;
}
.index_sider{
flex: none!important;
...
...
This diff is collapsed.
Click to expand it.
app_web/src/uiservice/jobs-info/jobs-info-ui-service-base.ts
浏览文件 @
2c4a2af4
...
...
@@ -3,6 +3,7 @@ import { UIActionTool,Util } from '@/utils';
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
JobsInfoAuthService
from
'@/authservice/jobs-info/jobs-info-auth-service'
;
/**
* 任务信息UI服务对象基类
...
...
@@ -76,6 +77,7 @@ export default class JobsInfoUIServiceBase extends UIService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
authService
=
new
JobsInfoAuthService
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
this
.
initDeMainStateOPPrivsMap
();
...
...
@@ -416,17 +418,27 @@ export default class JobsInfoUIServiceBase extends UIService {
}
/**
* 获取数据对象
的
操作标识
* 获取数据对象
当前
操作标识
*
* @param
curD
ata 当前数据
* @param
d
ata 当前数据
* @memberof JobsInfoUIServiceBase
*/
public
getDEMainStateOPPrivs
(
curD
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
curD
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
curD
ata
)
as
string
));
public
getDEMainStateOPPrivs
(
d
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
d
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
d
ata
)
as
string
));
}
else
{
return
null
;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof JobsInfoUIServiceBase
*/
public
getAllOPPrivs
(
data
:
any
){
return
this
.
authService
.
getOPPrivs
(
this
.
getDEMainStateOPPrivs
(
data
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/uiservice/jobs-lock/jobs-lock-ui-service-base.ts
浏览文件 @
2c4a2af4
...
...
@@ -3,6 +3,7 @@ import { UIActionTool,Util } from '@/utils';
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
JobsLockService
from
'@/service/jobs-lock/jobs-lock-service'
;
import
JobsLockAuthService
from
'@/authservice/jobs-lock/jobs-lock-auth-service'
;
/**
* 任务锁UI服务对象基类
...
...
@@ -76,6 +77,7 @@ export default class JobsLockUIServiceBase extends UIService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
authService
=
new
JobsLockAuthService
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
this
.
initDeMainStateOPPrivsMap
();
...
...
@@ -222,17 +224,27 @@ export default class JobsLockUIServiceBase extends UIService {
}
/**
* 获取数据对象
的
操作标识
* 获取数据对象
当前
操作标识
*
* @param
curD
ata 当前数据
* @param
d
ata 当前数据
* @memberof JobsLockUIServiceBase
*/
public
getDEMainStateOPPrivs
(
curD
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
curD
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
curD
ata
)
as
string
));
public
getDEMainStateOPPrivs
(
d
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
d
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
d
ata
)
as
string
));
}
else
{
return
null
;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof JobsLockUIServiceBase
*/
public
getAllOPPrivs
(
data
:
any
){
return
this
.
authService
.
getOPPrivs
(
this
.
getDEMainStateOPPrivs
(
data
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/uiservice/jobs-log/jobs-log-ui-service-base.ts
浏览文件 @
2c4a2af4
...
...
@@ -3,6 +3,7 @@ import { UIActionTool,Util } from '@/utils';
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
JobsLogAuthService
from
'@/authservice/jobs-log/jobs-log-auth-service'
;
/**
* 任务调度日志UI服务对象基类
...
...
@@ -76,6 +77,7 @@ export default class JobsLogUIServiceBase extends UIService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
authService
=
new
JobsLogAuthService
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
this
.
initDeMainStateOPPrivsMap
();
...
...
@@ -224,17 +226,27 @@ export default class JobsLogUIServiceBase extends UIService {
}
/**
* 获取数据对象
的
操作标识
* 获取数据对象
当前
操作标识
*
* @param
curD
ata 当前数据
* @param
d
ata 当前数据
* @memberof JobsLogUIServiceBase
*/
public
getDEMainStateOPPrivs
(
curD
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
curD
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
curD
ata
)
as
string
));
public
getDEMainStateOPPrivs
(
d
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
d
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
d
ata
)
as
string
));
}
else
{
return
null
;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof JobsLogUIServiceBase
*/
public
getAllOPPrivs
(
data
:
any
){
return
this
.
authService
.
getOPPrivs
(
this
.
getDEMainStateOPPrivs
(
data
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/uiservice/jobs-registry/jobs-registry-ui-service-base.ts
浏览文件 @
2c4a2af4
...
...
@@ -3,6 +3,7 @@ import { UIActionTool,Util } from '@/utils';
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
JobsRegistryAuthService
from
'@/authservice/jobs-registry/jobs-registry-auth-service'
;
/**
* 任务注册信息UI服务对象基类
...
...
@@ -76,6 +77,7 @@ export default class JobsRegistryUIServiceBase extends UIService {
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
authService
=
new
JobsRegistryAuthService
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
this
.
initDeMainStateOPPrivsMap
();
...
...
@@ -224,17 +226,27 @@ export default class JobsRegistryUIServiceBase extends UIService {
}
/**
* 获取数据对象
的
操作标识
* 获取数据对象
当前
操作标识
*
* @param
curD
ata 当前数据
* @param
d
ata 当前数据
* @memberof JobsRegistryUIServiceBase
*/
public
getDEMainStateOPPrivs
(
curD
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
curD
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
curD
ata
)
as
string
));
public
getDEMainStateOPPrivs
(
d
ata
:
any
){
if
(
this
.
getDEMainStateTag
(
d
ata
)){
return
this
.
allDeMainStateOPPrivsMap
.
get
((
this
.
getDEMainStateTag
(
d
ata
)
as
string
));
}
else
{
return
null
;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof JobsRegistryUIServiceBase
*/
public
getAllOPPrivs
(
data
:
any
){
return
this
.
authService
.
getOPPrivs
(
this
.
getDEMainStateOPPrivs
(
data
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/uiservice/ui-service.ts
浏览文件 @
2c4a2af4
...
...
@@ -17,6 +17,13 @@ export default class UIService {
*/
private
$store
:
Store
<
any
>
|
null
=
null
;
/**
* 所依赖权限服务
*
* @memberof UIService
*/
public
authService
:
any
;
/**
* Creates an instance of UIService.
*
...
...
This diff is collapsed.
Click to expand it.
app_web/src/utils/types/view-tool.d.ts
浏览文件 @
2c4a2af4
...
...
@@ -93,6 +93,17 @@ export declare interface ViewTool {
* @memberof ViewTool
*/
getIndexViewParam
():
any
;
/**
* 计算界面行为项权限状态
*
* @static
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof ViewTool
*/
calcActionItemAuthState
(
data
:
any
,
ActionModel
:
any
,
UIService
:
any
):
any
;
}
declare
module
"vue/types/vue"
{
...
...
This diff is collapsed.
Click to expand it.
app_web/src/utils/view-tool/view-tool.ts
浏览文件 @
2c4a2af4
...
...
@@ -241,4 +241,40 @@ export class ViewTool {
public
static
getIndexViewParam
():
any
{
return
this
.
indexViewParam
;
}
/**
* 计算界面行为项权限状态
*
* @static
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof ViewTool
*/
public
static
calcActionItemAuthState
(
data
:
any
,
ActionModel
:
any
,
UIService
:
any
){
for
(
const
key
in
ActionModel
)
{
if
(
!
ActionModel
.
hasOwnProperty
(
key
))
{
return
;
}
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
&&
data
&&
Object
.
keys
(
data
).
length
>
0
){
let
dataActionResult
:
any
=
UIService
.
getAllOPPrivs
(
data
)[
_item
[
'dataaccaction'
]];
// 无权限:0;有权限:1
if
(
!
dataActionResult
){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if
(
_item
.
noprivdisplaymode
===
1
){
_item
.
disabled
=
true
;
}
if
((
_item
.
noprivdisplaymode
===
2
)
||
(
_item
.
noprivdisplaymode
===
6
)){
_item
.
visabled
=
false
;
}
else
{
_item
.
visabled
=
true
;
}
}
else
{
_item
.
visabled
=
true
;
_item
.
disabled
=
false
;
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app_web/src/widgets/app/task-index-view-appmenu/task-index-view-appmenu-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -122,11 +122,10 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
TaskIndexViewService
from
'./task-index-view-appmenu-service'
;
import
TaskIndexViewModel
from
'./task-index-view-appmenu-model'
;
import
{
Environment
}
from
'@/environments/environment'
;
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-info/default-searchform/default-searchform-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -50,12 +50,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
DefaultService
from
'./default-searchform-service'
;
import
JobsInfoUIService
from
'@/uiservice/jobs-info/jobs-info-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
...
...
@@ -146,6 +146,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof DefaultBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -659,7 +672,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsInfoGridView视图搜索表单loadAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsInfoGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loadAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
};
...
...
@@ -679,7 +692,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
@@ -696,7 +709,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
loadDraft
(
opt
:
any
=
{},
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsInfoGridView视图搜索表单loaddraftAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsInfoGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loaddraftAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
}
;
...
...
@@ -705,7 +718,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
)
,
desc
:
response
.
errorMessage
});
}
return
;
}
...
...
@@ -737,7 +750,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-info/main-form/main-form-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -4,7 +4,7 @@
<row
>
<i-col
v-show=
"detailsModel.group1.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-group
:manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobsinfo.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<app-form-group
:
uiService=
"appUIService"
:data=
"transformData(data)"
:
manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobsinfo.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<row>
<i-col
v-show=
"detailsModel.app.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'app'
:itemRules=
"this.rules.app"
class=
''
:caption=
"$t('entities.jobsinfo.main_form.details.app')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.app.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
...
@@ -121,12 +121,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
MainService
from
'./main-form-service'
;
import
JobsInfoUIService
from
'@/uiservice/jobs-info/jobs-info-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
import
schema
from
'async-validator'
;
...
...
@@ -218,6 +218,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -255,6 +268,14 @@ export default class MainBase extends Vue implements ControlInterface {
@
Inject
({
from
:
'navModel'
,
default
:
'tab'
})
public
navModel
!
:
string
;
/**
* 界面UI服务对象
*
* @type {JobsInfoUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsInfoUIService
=
new
JobsInfoUIService
(
this
.
$store
);
/**
* 工作流审批意见控件绑定值
*
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-info/main-grid/main-grid-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -177,12 +177,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsInfoService
from
'@/service/jobs-info/jobs-info-service'
;
import
MainService
from
'./main-grid-service'
;
import
JobsInfoUIService
from
'@/uiservice/jobs-info/jobs-info-ui-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
...
...
@@ -273,6 +273,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -309,6 +322,23 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
/**
* 界面UI服务对象
*
* @type {JobsInfoUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsInfoUIService
=
new
JobsInfoUIService
(
this
.
$store
);
/**
* 界面行为模型
*
* @type {*}
* @memberof MainBase
*/
public
ActionModel
:
any
=
{
};
/**
* 应用状态事件
*
...
...
@@ -558,6 +588,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
totalrow
:
number
=
0
;
/**
* 表格更新默认值项
*
* @memberof MainBase
*/
public
defaultUpdateItems
:
Array
<
any
>
=
[
'srfkey'
];
/**
* 选中行数据
*
...
...
@@ -700,6 +737,18 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取界面行为权限状态
*
* @memberof MainBase
*/
public
getActionState
(
data
:
any
){
let
targetData
:
any
=
this
.
transformData
(
data
);
let
tempActionModel
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ActionModel
));
ViewTool
.
calcActionItemAuthState
(
targetData
,
tempActionModel
,
this
.
appUIService
);
return
tempActionModel
;
}
/**
* 获取表格行模型
*
...
...
@@ -815,6 +864,9 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
items
.
forEach
((
item
:
any
)
=>
{
Object
.
assign
(
item
,
this
.
getActionState
(
item
));
});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -1506,6 +1558,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
async
save
(
args
:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
){
let
_this
=
this
;
if
(
_this
.
items
&&
_this
.
items
.
length
>
0
){
for
(
const
item
of
_this
.
items
)
{
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
_this
.
updateDefault
(
item
);
}
}
}
if
(
!
await
this
.
validateAll
()){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.rulesException'
)
as
string
)
});
return
[];
...
...
@@ -1531,7 +1590,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
item
.
jobsinfo
){
Object
.
assign
(
this
.
context
,{
jobsinfo
:
item
.
jobsinfo
});
}
let
response
=
await
this
.
service
.
add
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
let
response
=
await
this
.
service
.
update
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
successItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
}
...
...
@@ -1622,6 +1681,11 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridEditItemChange
(
row
:
any
,
property
:
string
,
value
:
any
,
rowIndex
:
number
){
row
.
rowDataState
=
row
.
rowDataState
?
row
.
rowDataState
:
"update"
;
if
(
Object
.
is
(
row
.
rowDataState
,
"update"
)){
if
(
!
value
&&
this
.
defaultUpdateItems
.
includes
(
property
)){
row
.
hasUpdated
=
true
;
}
}
this
.
validate
(
property
,
row
,
rowIndex
);
}
...
...
@@ -1710,6 +1774,14 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
createDefault
(
row
:
any
){
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof MainBase
*/
public
updateDefault
(
row
:
any
){
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-info/main-grid/main-grid-model.ts
浏览文件 @
2c4a2af4
...
...
@@ -114,6 +114,10 @@ export default class MainModel {
name
:
'query'
,
prop
:
'query'
},
{
name
:
'filter'
,
prop
:
'filter'
},
{
name
:
'page'
,
prop
:
'page'
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-log/default-searchform/default-searchform-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -38,12 +38,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
DefaultService
from
'./default-searchform-service'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
...
...
@@ -134,6 +134,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof DefaultBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -647,7 +660,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsLogGridView视图搜索表单loadAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsLogGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loadAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
};
...
...
@@ -667,7 +680,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
@@ -684,7 +697,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
loadDraft
(
opt
:
any
=
{},
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsLogGridView视图搜索表单loaddraftAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsLogGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loaddraftAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
}
;
...
...
@@ -693,7 +706,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
)
,
desc
:
response
.
errorMessage
});
}
return
;
}
...
...
@@ -725,7 +738,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-log/main-form/main-form-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -4,7 +4,7 @@
<row
>
<i-col
v-show=
"detailsModel.group1.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-group
:manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobslog.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<app-form-group
:
uiService=
"appUIService"
:data=
"transformData(data)"
:
manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobslog.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<row>
<i-col
v-show=
"detailsModel.job_id.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'job_id'
:itemRules=
"this.rules.job_id"
class=
''
:caption=
"$t('entities.jobslog.main_form.details.job_id')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.job_id.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
...
@@ -77,12 +77,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
MainService
from
'./main-form-service'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
import
schema
from
'async-validator'
;
...
...
@@ -174,6 +174,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -211,6 +224,14 @@ export default class MainBase extends Vue implements ControlInterface {
@
Inject
({
from
:
'navModel'
,
default
:
'tab'
})
public
navModel
!
:
string
;
/**
* 界面UI服务对象
*
* @type {JobsLogUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsLogUIService
=
new
JobsLogUIService
(
this
.
$store
);
/**
* 工作流审批意见控件绑定值
*
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-log/main-grid/main-grid-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -163,12 +163,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsLogService
from
'@/service/jobs-log/jobs-log-service'
;
import
MainService
from
'./main-grid-service'
;
import
JobsLogUIService
from
'@/uiservice/jobs-log/jobs-log-ui-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
...
...
@@ -259,6 +259,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -295,6 +308,23 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
/**
* 界面UI服务对象
*
* @type {JobsLogUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsLogUIService
=
new
JobsLogUIService
(
this
.
$store
);
/**
* 界面行为模型
*
* @type {*}
* @memberof MainBase
*/
public
ActionModel
:
any
=
{
};
/**
* 应用状态事件
*
...
...
@@ -544,6 +574,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
totalrow
:
number
=
0
;
/**
* 表格更新默认值项
*
* @memberof MainBase
*/
public
defaultUpdateItems
:
Array
<
any
>
=
[
'srfkey'
];
/**
* 选中行数据
*
...
...
@@ -678,6 +715,18 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取界面行为权限状态
*
* @memberof MainBase
*/
public
getActionState
(
data
:
any
){
let
targetData
:
any
=
this
.
transformData
(
data
);
let
tempActionModel
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ActionModel
));
ViewTool
.
calcActionItemAuthState
(
targetData
,
tempActionModel
,
this
.
appUIService
);
return
tempActionModel
;
}
/**
* 获取表格行模型
*
...
...
@@ -793,6 +842,9 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
items
.
forEach
((
item
:
any
)
=>
{
Object
.
assign
(
item
,
this
.
getActionState
(
item
));
});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -1476,6 +1528,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
async
save
(
args
:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
){
let
_this
=
this
;
if
(
_this
.
items
&&
_this
.
items
.
length
>
0
){
for
(
const
item
of
_this
.
items
)
{
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
_this
.
updateDefault
(
item
);
}
}
}
if
(
!
await
this
.
validateAll
()){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.rulesException'
)
as
string
)
});
return
[];
...
...
@@ -1501,7 +1560,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
item
.
jobslog
){
Object
.
assign
(
this
.
context
,{
jobslog
:
item
.
jobslog
});
}
let
response
=
await
this
.
service
.
add
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
let
response
=
await
this
.
service
.
update
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
successItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
}
...
...
@@ -1592,6 +1651,11 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridEditItemChange
(
row
:
any
,
property
:
string
,
value
:
any
,
rowIndex
:
number
){
row
.
rowDataState
=
row
.
rowDataState
?
row
.
rowDataState
:
"update"
;
if
(
Object
.
is
(
row
.
rowDataState
,
"update"
)){
if
(
!
value
&&
this
.
defaultUpdateItems
.
includes
(
property
)){
row
.
hasUpdated
=
true
;
}
}
this
.
validate
(
property
,
row
,
rowIndex
);
}
...
...
@@ -1680,6 +1744,14 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
createDefault
(
row
:
any
){
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof MainBase
*/
public
updateDefault
(
row
:
any
){
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-log/main-grid/main-grid-model.ts
浏览文件 @
2c4a2af4
...
...
@@ -109,6 +109,10 @@ export default class MainModel {
name
:
'query'
,
prop
:
'query'
},
{
name
:
'filter'
,
prop
:
'filter'
},
{
name
:
'page'
,
prop
:
'page'
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-registry/default-searchform/default-searchform-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -44,12 +44,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
DefaultService
from
'./default-searchform-service'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
...
...
@@ -140,6 +140,19 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof DefaultBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -631,7 +644,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
load
(
opt
:
any
=
{}):
void
{
if
(
!
this
.
loadAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsRegistryGridView视图搜索表单loadAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsRegistryGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loadAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
};
...
...
@@ -651,7 +664,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
@@ -668,7 +681,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public
loadDraft
(
opt
:
any
=
{},
mode
?:
string
):
void
{
if
(
!
this
.
loaddraftAction
){
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'JobsRegistryGridView视图搜索表单loaddraftAction参数未配置'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
'JobsRegistryGridView'
+
(
this
.
$t
(
'app.searchForm.notConfig.loaddraftAction'
)
as
string
)
});
return
;
}
const
arg
:
any
=
{
...
opt
}
;
...
...
@@ -677,7 +690,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorMessage
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
)
,
desc
:
response
.
errorMessage
});
}
return
;
}
...
...
@@ -709,7 +722,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'系统异常'
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-registry/main-form/main-form-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -4,7 +4,7 @@
<row
>
<i-col
v-show=
"detailsModel.group1.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-group
:manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobsregistry.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<app-form-group
:
uiService=
"appUIService"
:data=
"transformData(data)"
:
manageContainerStatus=
"detailsModel.group1.manageContainerStatus"
:isManageContainer=
"detailsModel.group1.isManageContainer"
@
managecontainerclick=
"manageContainerClick('group1')"
layoutType=
"TABLE_24COL"
titleStyle=
""
class=
''
:uiActionGroup=
"detailsModel.group1.uiActionGroup"
@
groupuiactionclick=
"groupUIActionClick($event)"
:caption=
"$t('entities.jobsregistry.main_form.details.group1')"
:isShowCaption=
"false"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"false"
>
<row>
<i-col
v-show=
"detailsModel.app.visible"
:style=
"
{}" :lg="{ span: 24, offset: 0 }">
<app-form-item
name=
'app'
:itemRules=
"this.rules.app"
class=
''
:caption=
"$t('entities.jobsregistry.main_form.details.app')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.app.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
...
@@ -52,12 +52,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
MainService
from
'./main-form-service'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
import
{
FormButtonModel
,
FormPageModel
,
FormItemModel
,
FormDRUIPartModel
,
FormPartModel
,
FormGroupPanelModel
,
FormIFrameModel
,
FormRowItemModel
,
FormTabPageModel
,
FormTabPanelModel
,
FormUserControlModel
}
from
'@/model/form-detail'
;
import
{
debounceTime
,
distinctUntilChanged
}
from
'rxjs/operators'
;
import
schema
from
'async-validator'
;
...
...
@@ -149,6 +149,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -186,6 +199,14 @@ export default class MainBase extends Vue implements ControlInterface {
@
Inject
({
from
:
'navModel'
,
default
:
'tab'
})
public
navModel
!
:
string
;
/**
* 界面UI服务对象
*
* @type {JobsRegistryUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsRegistryUIService
=
new
JobsRegistryUIService
(
this
.
$store
);
/**
* 工作流审批意见控件绑定值
*
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-registry/main-grid/main-grid-base.vue
浏览文件 @
2c4a2af4
...
...
@@ -117,12 +117,12 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
{
UIActionTool
,
Util
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
JobsRegistryService
from
'@/service/jobs-registry/jobs-registry-service'
;
import
MainService
from
'./main-grid-service'
;
import
JobsRegistryUIService
from
'@/uiservice/jobs-registry/jobs-registry-ui-service'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
FormItemModel
}
from
'@/model/form-detail'
;
...
...
@@ -213,6 +213,19 @@ export default class MainBase extends Vue implements ControlInterface {
/**
* 转化数据
*
* @param {any} args
* @memberof MainBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
...
...
@@ -249,6 +262,23 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
/**
* 界面UI服务对象
*
* @type {JobsRegistryUIService}
* @memberof MainBase
*/
public
appUIService
:
JobsRegistryUIService
=
new
JobsRegistryUIService
(
this
.
$store
);
/**
* 界面行为模型
*
* @type {*}
* @memberof MainBase
*/
public
ActionModel
:
any
=
{
};
/**
* 应用状态事件
*
...
...
@@ -498,6 +528,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
totalrow
:
number
=
0
;
/**
* 表格更新默认值项
*
* @memberof MainBase
*/
public
defaultUpdateItems
:
Array
<
any
>
=
[
'srfkey'
];
/**
* 选中行数据
*
...
...
@@ -600,6 +637,18 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridItemsModel
:
any
[]
=
[];
/**
* 获取界面行为权限状态
*
* @memberof MainBase
*/
public
getActionState
(
data
:
any
){
let
targetData
:
any
=
this
.
transformData
(
data
);
let
tempActionModel
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ActionModel
));
ViewTool
.
calcActionItemAuthState
(
targetData
,
tempActionModel
,
this
.
appUIService
);
return
tempActionModel
;
}
/**
* 获取表格行模型
*
...
...
@@ -715,6 +764,9 @@ export default class MainBase extends Vue implements ControlInterface {
this
.
selections
=
[];
this
.
gridItemsModel
=
[];
this
.
items
.
forEach
(()
=>
{
this
.
gridItemsModel
.
push
(
this
.
getGridRowModel
())});
this
.
items
.
forEach
((
item
:
any
)
=>
{
Object
.
assign
(
item
,
this
.
getActionState
(
item
));
});
this
.
$emit
(
'load'
,
this
.
items
);
// 设置默认选中
let
_this
=
this
;
...
...
@@ -1406,6 +1458,13 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
async
save
(
args
:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
){
let
_this
=
this
;
if
(
_this
.
items
&&
_this
.
items
.
length
>
0
){
for
(
const
item
of
_this
.
items
)
{
if
(
Object
.
is
(
item
.
rowDataState
,
'update'
)){
_this
.
updateDefault
(
item
);
}
}
}
if
(
!
await
this
.
validateAll
()){
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.rulesException'
)
as
string
)
});
return
[];
...
...
@@ -1431,7 +1490,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
item
.
jobsregistry
){
Object
.
assign
(
this
.
context
,{
jobsregistry
:
item
.
jobsregistry
});
}
let
response
=
await
this
.
service
.
add
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
let
response
=
await
this
.
service
.
update
(
this
.
updateAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
item
,
this
.
showBusyIndicator
);
successItems
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
}
}
...
...
@@ -1522,6 +1581,11 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
gridEditItemChange
(
row
:
any
,
property
:
string
,
value
:
any
,
rowIndex
:
number
){
row
.
rowDataState
=
row
.
rowDataState
?
row
.
rowDataState
:
"update"
;
if
(
Object
.
is
(
row
.
rowDataState
,
"update"
)){
if
(
!
value
&&
this
.
defaultUpdateItems
.
includes
(
property
)){
row
.
hasUpdated
=
true
;
}
}
this
.
validate
(
property
,
row
,
rowIndex
);
}
...
...
@@ -1610,6 +1674,14 @@ export default class MainBase extends Vue implements ControlInterface {
*/
public
createDefault
(
row
:
any
){
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof MainBase
*/
public
updateDefault
(
row
:
any
){
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
app_web/src/widgets/jobs-registry/main-grid/main-grid-model.ts
浏览文件 @
2c4a2af4
...
...
@@ -84,6 +84,10 @@ export default class MainModel {
name
:
'query'
,
prop
:
'query'
},
{
name
:
'filter'
,
prop
:
'filter'
},
{
name
:
'page'
,
prop
:
'page'
...
...
This diff is collapsed.
Click to expand it.
ibztask-app/ibztask-app-web/src/main/java/cn/ibizlab/web/config/webSecurityConfig.java
浏览文件 @
2c4a2af4
...
...
@@ -106,6 +106,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/fonts/**"
,
"/**/js/**"
,
"/**/img/**"
,
"/**/svg/**"
,
"/"
).
permitAll
()
//放行登录请求
...
...
This diff is collapsed.
Click to expand it.
ibztask-boot/src/main/java/cn/ibizlab/DevBootApplication.java
浏览文件 @
2c4a2af4
...
...
@@ -11,6 +11,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
java.util.List
;
@Slf4j
...
...
@@ -29,6 +31,8 @@ import java.util.List;
@Import
({
org
.
springframework
.
cloud
.
openfeign
.
FeignClientsConfiguration
.
class
})
@EnableAsync
@EnableScheduling
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
...
...
This diff is collapsed.
Click to expand it.
ibztask-core/src/main/java/cn/ibizlab/core/task/service/impl/JobsInfoServiceImpl.java
浏览文件 @
2c4a2af4
...
...
@@ -158,9 +158,9 @@ public class JobsInfoServiceImpl extends ServiceImpl<JobsInfoMapper, JobsInfo> i
@Override
@Transactional
public
JobsInfo
stop
(
JobsInfo
et
)
{
et
.
set
(
"Next_time"
,
"0"
);
et
.
set
(
"Last_time"
,
"0"
);
et
.
set
(
"Status"
,
"1"
);
et
.
set
(
"Next_time"
,
"0"
);
update
(
et
);
return
et
;
}
...
...
This diff is collapsed.
Click to expand it.
ibztask-core/src/main/resources/liquibase/changelog/20200709124030_init_ibzaudit.xml
0 → 100644
浏览文件 @
2c4a2af4
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
>
<changeSet
author=
"Think (generated)"
id=
"1566027230162-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"IBZDATAAUDIT"
/>
</not>
</preConditions>
<createTable
remarks=
"数据审计"
tableName=
"IBZDATAAUDIT"
>
<column
name=
"DATAAUDITID"
remarks=
"数据审计标识"
type=
"VARCHAR2(100 BYTE)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"SYS_C00115093"
/>
</column>
<column
name=
"OPPERSONID"
remarks=
"操作人标识"
type=
"VARCHAR2(100 BYTE)"
/>
<column
name=
"OPPERSONNAME"
remarks=
"操作人名称"
type=
"VARCHAR2(100 BYTE)"
/>
<column
name=
"AUDITTYPE"
remarks=
"审计行为类型"
type=
"VARCHAR2(60 BYTE)"
/>
<column
name=
"OPTIME"
remarks=
"操作时间"
type=
"date"
/>
<column
name=
"IPADDRESS"
remarks=
"访问地址"
type=
"VARCHAR2(100 BYTE)"
/>
<column
name=
"AUDITOBJECTDATA"
remarks=
"审计对象(表数据)"
type=
"VARCHAR2(100 BYTE)"
/>
<column
name=
"AUDITOBJECT"
remarks=
"审计对象(表)"
type=
"VARCHAR2(100 BYTE)"
/>
<column
name=
"AUDITINFO"
remarks=
"审计明细"
type=
"CLOB"
/>
<column
name=
"ISDATACHANGED"
remarks=
"审计数据是否发生变化"
type=
"INTEGER"
/>
</createTable>
</changeSet>
</databaseChangeLog>
This diff is collapsed.
Click to expand it.
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/config/apiAutoConfiguration.java
浏览文件 @
2c4a2af4
...
...
@@ -10,6 +10,9 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
import
org.springframework.web.servlet.DispatcherServlet
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
@Configuration
@ConditionalOnClass
(
apiRestConfiguration
.
class
)
...
...
@@ -24,6 +27,18 @@ public class apiAutoConfiguration implements ApplicationContextAware{
this
.
applicationContext
=
applicationContext
;
}
@Bean
(
"asyncExecutor"
)
public
Executor
asyncExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
10
);
executor
.
setMaxPoolSize
(
20
);
executor
.
setQueueCapacity
(
2000
);
executor
.
setKeepAliveSeconds
(
600
);
executor
.
setThreadNamePrefix
(
"asyncExecutor-"
);
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
return
executor
;
}
// @Bean
// public ServletRegistrationBean apiServlet() {
// AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
...
...
This diff is collapsed.
Click to expand it.
ibztask-provider/ibztask-provider-api/src/main/java/cn/ibizlab/api/ibztaskapiApplication.java
浏览文件 @
2c4a2af4
...
...
@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
java.util.List
;
@Slf4j
...
...
@@ -34,6 +36,8 @@ import java.util.List;
org
.
springframework
.
cloud
.
openfeign
.
FeignClientsConfiguration
.
class
})
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
@EnableAsync
@EnableScheduling
public
class
ibztaskapiApplication
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
...
...
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/annotation/Audit.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
FIELD
})
public
@interface
Audit
{
}
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/annotation/DEField.java
浏览文件 @
2c4a2af4
...
...
@@ -16,6 +16,11 @@ public @interface DEField
* @return
*/
String
name
()
default
""
;
/**
* 属性名称
* @return
*/
String
value
()
default
""
;
/**
* 是否为数据主键
* @return
...
...
@@ -26,29 +31,40 @@ public @interface DEField
* @return
*/
String
defaultValue
()
default
""
;
/**
* 属性类型
* @return
*/
String
fieldType
()
default
""
;
/**
* 默认值类型
* @return
*/
DEFieldDefaultValueType
defaultValueType
()
default
DEFieldDefaultValueType
.
NONE
;
/**
* 预置属性类型
* @return
*/
DEPredefinedFieldType
preType
()
default
DEPredefinedFieldType
.
NONE
;
/**
* 逻辑删除有效值
* @return
*/
String
logicval
()
default
""
;
/**
* 逻辑删除无效值
* @return
*/
String
logicdelval
()
default
""
;
/**
* 代码表
* @return
*/
String
dict
()
default
""
;
/**
* 日期格式化
* @return
*/
String
format
()
default
""
;
}
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/aspect/AuditAspect.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
cn.ibizlab.util.annotation.Audit
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
cn.ibizlab.util.service.IBZDataAuditService
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.expression.EvaluationContext
;
import
org.springframework.expression.Expression
;
import
org.springframework.expression.ExpressionParser
;
import
org.springframework.expression.spel.standard.SpelExpressionParser
;
import
org.springframework.expression.spel.support.StandardEvaluationContext
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
/**
* 实体数据审计切面类
*/
@Aspect
@Component
public
class
AuditAspect
{
private
final
ExpressionParser
parser
=
new
SpelExpressionParser
();
@Autowired
IBZDataAuditService
dataAuditService
;
/**
* 实体数据建立切面,在成功创建数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* @param point
*/
@AfterReturning
(
value
=
"execution(* cn.ibizlab.core.*.service.*.create(..))"
)
@SneakyThrows
public
void
create
(
JoinPoint
point
){
HttpServletRequest
request
=
null
;
RequestAttributes
requestAttributes
=
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
){
request
=((
ServletRequestAttributes
)
requestAttributes
).
getRequest
();
}
Object
[]
args
=
point
.
getArgs
();
if
(
ObjectUtils
.
isEmpty
(
args
)
||
args
.
length
==
0
)
return
;
Object
serviceParam
=
args
[
0
];
EntityBase
entity
=(
EntityBase
)
serviceParam
;
//创建数据
Map
<
String
,
Audit
>
auditFields
=
DEFieldCacheMap
.
getAuditFields
(
entity
.
getClass
());
if
(
auditFields
.
size
()==
0
)
//是否有审计属性
return
;
String
idField
=
DEFieldCacheMap
.
getDEKeyField
(
entity
.
getClass
());
Object
idValue
=
""
;
if
(!
StringUtils
.
isEmpty
(
idField
)){
idValue
=
entity
.
get
(
idField
);
}
//记录审计日志
dataAuditService
.
createAudit
(
request
,
entity
,
idValue
,
auditFields
);
return
;
}
/**
* 实体数据更新切面,在成功更新数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* 使用环切【@Around】获取到更新前后的实体数据并进行差异比较,并将差异内容记入审计日志内
* @param point
*/
@Around
(
"execution(* cn.ibizlab.core.*.service.*.update(..))"
)
public
Object
update
(
ProceedingJoinPoint
point
)
throws
Throwable
{
HttpServletRequest
request
=
null
;
RequestAttributes
requestAttributes
=
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
){
request
=((
ServletRequestAttributes
)
requestAttributes
).
getRequest
();
}
Object
serviceObj
=
point
.
getTarget
();
Object
args
[]=
point
.
getArgs
();
if
(
ObjectUtils
.
isEmpty
(
args
)
||
args
.
length
==
0
)
return
point
.
proceed
();
Object
arg
=
args
[
0
];
EntityBase
entity
=
(
EntityBase
)
arg
;
Map
<
String
,
Audit
>
auditFields
=
DEFieldCacheMap
.
getAuditFields
(
entity
.
getClass
());
//是否有审计属性
if
(
auditFields
.
size
()==
0
)
return
point
.
proceed
();
String
idField
=
DEFieldCacheMap
.
getDEKeyField
(
entity
.
getClass
());
Object
idValue
=
""
;
if
(!
StringUtils
.
isEmpty
(
idField
)){
idValue
=
entity
.
get
(
idField
);
}
if
(
ObjectUtils
.
isEmpty
(
idValue
))
return
point
.
proceed
();
//获取更新前实体
EntityBase
beforeEntity
=
getEntity
(
serviceObj
,
idValue
);
//执行更新操作
point
.
proceed
();
//记录审计日志
dataAuditService
.
updateAudit
(
request
,
beforeEntity
,
serviceObj
,
idValue
,
auditFields
);
return
true
;
}
/**
* 实体数据更新切面,在成功更新数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
* 使用环切【@Around】获取要删除的完整数据,并将审计属性相关信息记录到审计日志中
* @param point
* @return
* @throws Throwable
*/
@Around
(
"execution(* cn.ibizlab.core.*.service.*.remove(..))"
)
public
Object
remove
(
ProceedingJoinPoint
point
)
throws
Throwable
{
HttpServletRequest
request
=
null
;
RequestAttributes
requestAttributes
=
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
){
request
=((
ServletRequestAttributes
)
requestAttributes
).
getRequest
();
}
Object
serviceObj
=
point
.
getTarget
();
Object
args
[]=
point
.
getArgs
();
if
(
ObjectUtils
.
isEmpty
(
args
)
||
args
.
length
==
0
)
return
point
.
proceed
();
Object
idValue
=
args
[
0
];
EntityBase
entity
=
getEntity
(
serviceObj
,
idValue
);
Map
<
String
,
Audit
>
auditFields
=
DEFieldCacheMap
.
getAuditFields
(
entity
.
getClass
());
if
(
auditFields
.
size
()==
0
){
return
point
.
proceed
();
}
else
{
//执行删除操作
point
.
proceed
();
//记录审计日志
dataAuditService
.
removeAudit
(
request
,
entity
,
idValue
,
auditFields
);
return
true
;
}
}
/**
* 获取实体
* @param service
* @param id
* @return
*/
@SneakyThrows
private
EntityBase
getEntity
(
Object
service
,
Object
id
){
EntityBase
entity
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
service
)){
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
oldContext
.
setVariable
(
"service"
,
service
);
oldContext
.
setVariable
(
"id"
,
id
);
Expression
oldExp
=
parser
.
parseExpression
(
"#service.get(#id)"
);
return
oldExp
.
getValue
(
oldContext
,
EntityBase
.
class
);
}
return
entity
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/domain/IBZDataAudit.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.Objects
;
/**
* 实体[DataAudit] 数据对象
*/
@TableName
(
value
=
"IBZDATAAUDIT"
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
IBZDataAudit
implements
Serializable
{
@TableId
(
value
=
"dataauditid"
,
type
=
IdType
.
UUID
)
//指定主键生成策略
private
String
dataauditid
;
private
String
dataauditname
;
private
String
oppersonid
;
private
String
oppersonname
;
private
String
audittype
;
private
Timestamp
optime
;
private
String
ipaddress
;
private
String
auditinfo
;
private
Object
auditobjectdata
;
private
String
auditobject
;
private
int
isdatachanged
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
helper
;
import
cn.ibizlab.util.annotation.Audit
;
import
cn.ibizlab.util.annotation.DEField
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -22,6 +23,8 @@ public class DEFieldCacheMap {
private
static
Hashtable
<
String
,
Hashtable
<
String
,
DEField
>>
cacheDEField
=
new
Hashtable
<>();
private
static
Hashtable
<
String
,
Hashtable
<
String
,
Audit
>>
cacheAuditField
=
new
Hashtable
<>();
private
static
Hashtable
<
String
,
String
>
cacheDEKeyField
=
new
Hashtable
<>();
private
static
Object
objLock1
=
new
Object
();
...
...
@@ -44,6 +47,7 @@ public class DEFieldCacheMap {
List
<
Field
>
list
=
new
ArrayList
<
Field
>();
Hashtable
<
String
,
String
>
keys
=
new
Hashtable
<
String
,
String
>();
Hashtable
<
String
,
DEField
>
defields
=
new
Hashtable
<>();
Hashtable
<
String
,
Audit
>
auditfields
=
new
Hashtable
<>();
Hashtable
<
String
,
String
>
dekeyfields
=
new
Hashtable
<>();
Field
[]
fields
=
clazz
.
getDeclaredFields
();
for
(
Field
field:
fields
){
...
...
@@ -51,16 +55,21 @@ public class DEFieldCacheMap {
list
.
add
(
field
);
keys
.
put
(
field
.
getName
().
toLowerCase
(),
field
.
getName
());
DEField
deField
=
field
.
getAnnotation
(
DEField
.
class
);
Audit
auditField
=
field
.
getAnnotation
(
Audit
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
deField
))
{
defields
.
put
(
field
.
getName
(),
deField
);
if
(
deField
.
isKeyField
())
cacheDEKeyField
.
put
(
className
,
field
.
getName
());
}
if
(!
ObjectUtils
.
isEmpty
(
auditField
))
{
auditfields
.
put
(
field
.
getName
(),
auditField
);
}
}
cacheMap
.
put
(
className
,
result
);
cacheList
.
put
(
className
,
list
);
cacheKey
.
put
(
className
,
keys
);
cacheDEField
.
put
(
className
,
defields
);
cacheAuditField
.
put
(
className
,
auditfields
);
return
result
;
}
}
...
...
@@ -97,6 +106,23 @@ public class DEFieldCacheMap {
}
}
/**
* 从缓存中查询审计属性集合
* @param
* @return
*/
public
static
<
T
>
Hashtable
<
String
,
Audit
>
getAuditFields
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheAuditField
.
containsKey
(
className
))
return
cacheAuditField
.
get
(
className
);
else
{
DEFieldCacheMap
.
getFieldMap
(
className
);
return
cacheAuditField
.
get
(
className
);
}
}
/**
* 从缓存中查询实体对象主键
* @param
...
...
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/mapper/IBZDataAuditMapper.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.ibizlab.util.domain.IBZDataAudit
;
public
interface
IBZDataAuditMapper
extends
BaseMapper
<
IBZDataAudit
>
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/service/IBZDataAuditService.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
service
;
import
cn.ibizlab.util.annotation.Audit
;
import
cn.ibizlab.util.domain.EntityBase
;
import
org.springframework.scheduling.annotation.Async
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
/**
* 实体[DataAudit] 服务对象接口
*/
public
interface
IBZDataAuditService
{
@Async
(
"asyncExecutor"
)
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
@Async
(
"asyncExecutor"
)
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
@Async
(
"asyncExecutor"
)
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ibztask-util/src/main/java/cn/ibizlab/util/service/SimpleAuditService.java
0 → 100644
浏览文件 @
2c4a2af4
package
cn
.
ibizlab
.
util
.
service
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.annotation.Audit
;
import
cn.ibizlab.util.annotation.DEField
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.domain.IBZDataAudit
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
cn.ibizlab.util.mapper.IBZDataAuditMapper
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
org.springframework.expression.EvaluationContext
;
import
org.springframework.expression.Expression
;
import
org.springframework.expression.ExpressionParser
;
import
org.springframework.expression.spel.standard.SpelExpressionParser
;
import
org.springframework.expression.spel.support.StandardEvaluationContext
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.sql.Timestamp
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* 实体[DataAudit] 服务对象接口实现
*/
@Service
@Slf4j
public
class
SimpleAuditService
extends
ServiceImpl
<
IBZDataAuditMapper
,
IBZDataAudit
>
implements
IBZDataAuditService
{
private
final
ExpressionParser
parser
=
new
SpelExpressionParser
();
private
static
List
cacheMap
=
Collections
.
synchronizedList
(
new
ArrayList
());
/**
* 定时保存审计记录
*/
@Scheduled
(
fixedRate
=
10000
)
public
void
saveAudit
()
{
if
(
cacheMap
.
size
()>
0
){
log
.
info
(
String
.
format
(
"正在保存审计数据,当前审计集合数量为[%s]"
,
cacheMap
.
size
()));
List
temp
=
new
ArrayList
();
if
(
cacheMap
.
size
()<
500
)
temp
.
addAll
(
cacheMap
);
else
temp
.
addAll
(
cacheMap
.
subList
(
0
,
500
));
this
.
saveBatch
(
temp
);
cacheMap
.
removeAll
(
temp
);
log
.
info
(
String
.
format
(
"保存完成,当前审计集合数量为[%s]"
,
cacheMap
.
size
()));
}
}
/**
* 新建审计日志
* @param request
* @param entity
* @param idValue
* @param auditFields
*/
@Override
public
void
createAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
)
{
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
dataAudit
.
setOppersonid
(
AuthenticationUser
.
getAuthenticationUser
().
getUserid
());
dataAudit
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setAudittype
(
"CREATE"
);
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=
null
)
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setIsdatachanged
(
1
);
cacheMap
.
add
(
dataAudit
);
}
/**
* 更新审计日志
* @param request
* @param beforeEntity
* @param serviceObj
* @param idValue
* @param auditFields
*/
@SneakyThrows
public
void
updateAudit
(
HttpServletRequest
request
,
EntityBase
beforeEntity
,
Object
serviceObj
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
){
//获取更新后的实体
EntityBase
afterEntity
=
getEntity
(
serviceObj
,
idValue
);
//获取更新后的审计内容
String
auditInfo
=
getUpdateAuditInfo
(
beforeEntity
,
afterEntity
,
auditFields
);
//比较更新前后差异内容
int
isDataChanged
=
1
;
if
(
StringUtils
.
isEmpty
(
auditInfo
))
//审计内容是否发生变化
isDataChanged
=
0
;
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
dataAudit
.
setOppersonid
(
AuthenticationUser
.
getAuthenticationUser
().
getUserid
());
dataAudit
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setAudittype
(
"UPDATE"
);
dataAudit
.
setAuditobject
(
afterEntity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=
null
)
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
dataAudit
.
setAuditinfo
(
auditInfo
);
dataAudit
.
setIsdatachanged
(
isDataChanged
);
cacheMap
.
add
(
dataAudit
);
}
/**
* 删除审计日志
* @param request
* @param entity
* @param idValue
* @param auditFields
*/
public
void
removeAudit
(
HttpServletRequest
request
,
EntityBase
entity
,
Object
idValue
,
Map
<
String
,
Audit
>
auditFields
){
IBZDataAudit
dataAudit
=
new
IBZDataAudit
();
dataAudit
.
setOppersonid
(
AuthenticationUser
.
getAuthenticationUser
().
getUserid
());
dataAudit
.
setOppersonname
(
String
.
format
(
"%s[%s]"
,
AuthenticationUser
.
getAuthenticationUser
().
getPersonname
(),
AuthenticationUser
.
getAuthenticationUser
().
getOrgname
()));
dataAudit
.
setAudittype
(
"REMOVE"
);
dataAudit
.
setAuditobject
(
entity
.
getClass
().
getSimpleName
());
dataAudit
.
setAuditobjectdata
(
idValue
);
dataAudit
.
setOptime
(
new
Timestamp
(
new
Date
().
getTime
()));
if
(
request
!=
null
)
dataAudit
.
setIpaddress
(
getIpAddress
(
request
,
AuthenticationUser
.
getAuthenticationUser
()));
dataAudit
.
setAuditinfo
(
getAuditInfo
(
entity
,
auditFields
));
dataAudit
.
setIsdatachanged
(
1
);
cacheMap
.
add
(
dataAudit
);
}
private
String
getAuditInfo
(
EntityBase
entity
,
Map
<
String
,
Audit
>
auditFields
){
String
auditResult
=
""
;
if
(
auditFields
.
size
()==
0
)
return
auditResult
;
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
entity
.
getClass
());
if
(
deFields
.
size
()==
0
)
return
auditResult
;
JSONArray
auditFieldArray
=
new
JSONArray
();
for
(
Map
.
Entry
<
String
,
Audit
>
auditField
:
auditFields
.
entrySet
())
{
Object
objFieldName
=
auditField
.
getKey
();
String
fieldName
=
String
.
valueOf
(
objFieldName
);
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
)){
deField
=
deFields
.
get
(
fieldName
);
}
if
(
ObjectUtils
.
isEmpty
(
deField
))
continue
;
Object
value
=
dataTransfer
(
entity
.
get
(
fieldName
),
deField
.
fieldType
(),
deField
.
format
());
if
(!
StringUtils
.
isEmpty
(
value
)){
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"value"
,
value
);
if
(!
StringUtils
.
isEmpty
(
deField
.
dict
())){
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
}
auditFieldArray
.
add
(
auditFieldObj
);
}
}
if
(
auditFieldArray
.
size
()>
0
){
auditResult
=
auditFieldArray
.
toString
();
}
return
auditResult
;
}
/**
* 获取更新审计内容
* @param oldData
* @param newData
* @param auditFields
* @return
*/
private
String
getUpdateAuditInfo
(
EntityBase
oldData
,
EntityBase
newData
,
Map
<
String
,
Audit
>
auditFields
){
String
auditResult
=
""
;
JSONArray
auditFieldArray
=
new
JSONArray
();
if
(
auditFields
.
size
()==
0
)
return
auditResult
;
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
oldData
.
getClass
());
if
(
deFields
.
size
()==
0
)
return
auditResult
;
for
(
Map
.
Entry
<
String
,
Audit
>
auditField
:
auditFields
.
entrySet
())
{
Object
objFieldName
=
auditField
.
getKey
();
//获取注解字段
String
fieldName
=
String
.
valueOf
(
objFieldName
);
//属性名称
DEField
deField
=
null
;
if
(
deFields
.
containsKey
(
fieldName
)){
deField
=
deFields
.
get
(
fieldName
);
}
if
(
ObjectUtils
.
isEmpty
(
deField
))
continue
;
Object
oldValue
=
oldData
.
get
(
fieldName
);
//老属性值
Object
newValue
=
newData
.
get
(
fieldName
);
//新属性值
if
(!
compare
(
oldValue
,
newValue
)){
oldValue
=
dataTransfer
(
oldValue
,
deField
.
fieldType
(),
deField
.
format
());
//属性值转换
newValue
=
dataTransfer
(
newValue
,
deField
.
fieldType
(),
deField
.
format
());
//属性值转换
JSONObject
auditFieldObj
=
new
JSONObject
();
auditFieldObj
.
put
(
"field"
,
deField
.
value
());
auditFieldObj
.
put
(
"beforevalue"
,
oldValue
);
auditFieldObj
.
put
(
"value"
,
newValue
);
if
(!
StringUtils
.
isEmpty
(
deField
.
dict
())){
auditFieldObj
.
put
(
"dict"
,
deField
.
dict
());
}
auditFieldArray
.
add
(
auditFieldObj
);
}
}
if
(
auditFieldArray
.
size
()>
0
){
auditResult
=
auditFieldArray
.
toString
();
}
return
auditResult
;
}
/**
* 数据转换
* @param value 转换值
* @param dataType 转换字段类型
* @param strFormat 转换字段格式化文本
* @return
*/
private
String
dataTransfer
(
Object
value
,
String
dataType
,
String
strFormat
){
if
(
value
==
null
)
return
""
;
String
transResult
=
value
.
toString
();
if
((
dataType
.
equals
(
"DATE"
)
||
dataType
.
equals
(
"DATETIME"
)
||
dataType
.
equals
(
"TIME"
))
&&
(!
StringUtils
.
isEmpty
(
strFormat
))){
//时间类型转换
Timestamp
timestamp
=(
Timestamp
)
value
;
Date
date
=
timestamp
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
strFormat
);
transResult
=
format
.
format
(
date
);
}
return
transResult
;
}
/**
* 对象比较
* @param sourceObj 比较源对象
* @param targetObj 比较目标对象
* @return
*/
private
boolean
compare
(
Object
sourceObj
,
Object
targetObj
){
if
(
sourceObj
==
null
&&
targetObj
==
null
)
return
true
;
if
(
sourceObj
==
null
&&
targetObj
!=
null
)
return
false
;
return
sourceObj
.
equals
(
targetObj
);
}
/**
* 获取实体
* @param service
* @param id
* @return
*/
@SneakyThrows
private
EntityBase
getEntity
(
Object
service
,
Object
id
){
EntityBase
entity
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
service
)){
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
oldContext
.
setVariable
(
"service"
,
service
);
oldContext
.
setVariable
(
"id"
,
id
);
Expression
oldExp
=
parser
.
parseExpression
(
"#service.get(#id)"
);
return
oldExp
.
getValue
(
oldContext
,
EntityBase
.
class
);
}
return
entity
;
}
/**
* 获取Ip地址
* @param request
* @return
*/
public
String
getIpAddress
(
HttpServletRequest
request
,
AuthenticationUser
authenticationUser
)
{
//客户端有提交ip,以提交的ip为准
if
(
authenticationUser
!=
null
&&
!
StringUtils
.
isEmpty
(
authenticationUser
.
getAddr
())){
return
authenticationUser
.
getAddr
();
}
if
(
request
==
null
)
return
""
;
String
Xip
=
request
.
getHeader
(
"X-Real-IP"
);
String
XFor
=
request
.
getHeader
(
"X-Forwarded-For"
);
if
(!
StringUtils
.
isEmpty
(
XFor
)
&&
!
"unKnown"
.
equalsIgnoreCase
(
XFor
)){
//多次反向代理后会有多个ip值,第一个ip才是真实ip
int
index
=
XFor
.
indexOf
(
","
);
if
(
index
!=
-
1
){
return
XFor
.
substring
(
0
,
index
);
}
else
{
return
XFor
;
}
}
XFor
=
Xip
;
if
(!
StringUtils
.
isEmpty
(
XFor
)
&&
!
"unKnown"
.
equalsIgnoreCase
(
XFor
)){
return
XFor
;
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
XFor
=
request
.
getHeader
(
"Proxy-Client-IP"
);
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
XFor
=
request
.
getHeader
(
"WL-Proxy-Client-IP"
);
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
XFor
=
request
.
getHeader
(
"HTTP_CLIENT_IP"
);
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
XFor
=
request
.
getHeader
(
"HTTP_X_FORWARDED_FOR"
);
}
if
(
StringUtils
.
isEmpty
(
XFor
)
||
"unknown"
.
equalsIgnoreCase
(
XFor
))
{
XFor
=
request
.
getRemoteAddr
();
}
return
XFor
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录