Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
38ee66d3
提交
38ee66d3
编写于
8月 07, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
2d744c00
变更
18
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
671 行增加
和
132 行删除
+671
-132
app-register.ts
app_web/src/app-register.ts
+5
-0
codelist-register.ts
app_web/src/codelist/codelist-register.ts
+79
-0
app-department-select.vue
...omponents/app-department-select/app-department-select.vue
+74
-6
app-org-select.vue
app_web/src/components/app-org-select/app-org-select.vue
+80
-10
app-upicker.less
app_web/src/components/app-upicker/app-upicker.less
+23
-0
app-upicker.vue
app_web/src/components/app-upicker/app-upicker.vue
+210
-0
index.d.ts
app_web/src/index.d.ts
+3
-2
codelist-service.ts
app_web/src/service/app/codelist-service.ts
+143
-58
entity-service.ts
app_web/src/service/entity-service.ts
+15
-31
config.xml
config.xml
+0
-5
webApplication.java
...-app-web/src/main/java/cn/ibizlab/web/webApplication.java
+6
-1
application-web-prod.yml
...ibzwf-app-web/src/main/resources/application-web-prod.yml
+5
-1
DevBootApplication.java
ibzwf-boot/src/main/java/cn/ibizlab/DevBootApplication.java
+6
-1
application-dev.yml
ibzwf-boot/src/main/resources/application-dev.yml
+5
-1
Dockerfile
ibzwf-provider/ibzwf-provider-api/src/main/docker/Dockerfile
+1
-1
ibzwf-provider-api.yaml
...bzwf-provider-api/src/main/docker/ibzwf-provider-api.yaml
+1
-14
ibzwfapiApplication.java
...api/src/main/java/cn/ibizlab/api/ibzwfapiApplication.java
+6
-1
SearchContextHandlerMethodArgumentResolver.java
.../util/web/SearchContextHandlerMethodArgumentResolver.java
+9
-0
未找到文件。
app_web/src/app-register.ts
浏览文件 @
38ee66d3
...
@@ -12,6 +12,7 @@ import { authServiceRegister } from '@/authservice/auth-service-register';
...
@@ -12,6 +12,7 @@ import { authServiceRegister } from '@/authservice/auth-service-register';
import
{
utilServiceRegister
}
from
'@/utilservice/util-service-register'
;
import
{
utilServiceRegister
}
from
'@/utilservice/util-service-register'
;
import
{
entityServiceRegister
}
from
'@/service/entity-service-register'
;
import
{
entityServiceRegister
}
from
'@/service/entity-service-register'
;
import
{
counterServiceRegister
}
from
'@/counter/counter-service-register'
;
import
{
counterServiceRegister
}
from
'@/counter/counter-service-register'
;
import
{
codeListRegister
}
from
'@codelist/codelist-register'
;
import
InputBox
from
'./components/input-box/input-box.vue'
import
InputBox
from
'./components/input-box/input-box.vue'
import
AppKeepAlive
from
'./components/app-keep-alive/app-keep-alive.vue'
import
AppKeepAlive
from
'./components/app-keep-alive/app-keep-alive.vue'
...
@@ -38,6 +39,7 @@ import AppFormGroup from './components/app-form-group/app-form-group.vue'
...
@@ -38,6 +39,7 @@ import AppFormGroup from './components/app-form-group/app-form-group.vue'
import
AppFormItem
from
'./components/app-form-item/app-form-item.vue'
import
AppFormItem
from
'./components/app-form-item/app-form-item.vue'
import
AppPicker
from
'./components/app-picker/app-picker.vue'
import
AppPicker
from
'./components/app-picker/app-picker.vue'
import
AppMpicker
from
'./components/app-mpicker/app-mpicker.vue'
import
AppMpicker
from
'./components/app-mpicker/app-mpicker.vue'
import
AppUpicker
from
'./components/app-upicker/app-upicker.vue'
import
AppFormGroup2
from
'./components/app-form-group2/app-form-group2.vue'
import
AppFormGroup2
from
'./components/app-form-group2/app-form-group2.vue'
import
AppFormItem2
from
'./components/app-form-item2/app-form-item2.vue'
import
AppFormItem2
from
'./components/app-form-item2/app-form-item2.vue'
import
CodeList
from
'./components/codelist/codelist.vue'
import
CodeList
from
'./components/codelist/codelist.vue'
...
@@ -89,6 +91,8 @@ window['utilServiceRegister'] = utilServiceRegister;
...
@@ -89,6 +91,8 @@ window['utilServiceRegister'] = utilServiceRegister;
window
[
'entityServiceRegister'
]
=
entityServiceRegister
;
window
[
'entityServiceRegister'
]
=
entityServiceRegister
;
// 全局挂载计数器服务注册中心
// 全局挂载计数器服务注册中心
window
[
'counterServiceRegister'
]
=
counterServiceRegister
;
window
[
'counterServiceRegister'
]
=
counterServiceRegister
;
// 全局挂载代码表服务注册中心
window
[
'codeListRegister'
]
=
codeListRegister
;
export
const
AppComponents
=
{
export
const
AppComponents
=
{
install
(
v
:
any
,
opt
:
any
)
{
install
(
v
:
any
,
opt
:
any
)
{
...
@@ -127,6 +131,7 @@ export const AppComponents = {
...
@@ -127,6 +131,7 @@ export const AppComponents = {
v
.
component
(
'app-form-item'
,
AppFormItem
);
v
.
component
(
'app-form-item'
,
AppFormItem
);
v
.
component
(
'app-picker'
,
AppPicker
);
v
.
component
(
'app-picker'
,
AppPicker
);
v
.
component
(
'app-mpicker'
,
AppMpicker
);
v
.
component
(
'app-mpicker'
,
AppMpicker
);
v
.
component
(
'app-upicker'
,
AppUpicker
);
v
.
component
(
'app-form-group2'
,
AppFormGroup2
);
v
.
component
(
'app-form-group2'
,
AppFormGroup2
);
v
.
component
(
'app-form-item2'
,
AppFormItem2
);
v
.
component
(
'app-form-item2'
,
AppFormItem2
);
v
.
component
(
'codelist'
,
CodeList
);
v
.
component
(
'codelist'
,
CodeList
);
...
...
app_web/src/codelist/codelist-register.ts
0 → 100644
浏览文件 @
38ee66d3
/**
* 代码表服务注册中心
*
* @export
* @class CodeListRegister
*/
export
class
CodeListRegister
{
/**
* 所有实体数据服务Map
*
* @protected
* @type {*}
* @memberof CodeListRegister
*/
protected
allCodeList
:
Map
<
string
,
()
=>
Promise
<
any
>>
=
new
Map
();
/**
* 已加载实体数据服务Map缓存
*
* @protected
* @type {Map<string, any>}
* @memberof CodeListRegister
*/
protected
serviceCache
:
Map
<
string
,
any
>
=
new
Map
();
/**
* Creates an instance of CodeListRegister.
* @memberof CodeListRegister
*/
constructor
()
{
this
.
init
();
}
/**
* 初始化
*
* @protected
* @memberof CodeListRegister
*/
protected
init
():
void
{
}
/**
* 加载实体数据服务
*
* @protected
* @param {string} serviceName
* @returns {Promise<any>}
* @memberof CodeListRegister
*/
protected
async
loadService
(
serviceName
:
string
):
Promise
<
any
>
{
const
service
=
this
.
allCodeList
.
get
(
serviceName
);
if
(
service
)
{
return
service
();
}
}
/**
* 获取应用实体数据服务
*
* @param {string} name
* @returns {Promise<any>}
* @memberof CodeListRegister
*/
public
async
getService
(
name
:
string
):
Promise
<
any
>
{
if
(
this
.
serviceCache
.
has
(
name
))
{
return
this
.
serviceCache
.
get
(
name
);
}
const
CodeList
:
any
=
await
this
.
loadService
(
name
);
if
(
CodeList
&&
CodeList
.
default
)
{
const
instance
:
any
=
new
CodeList
.
default
();
this
.
serviceCache
.
set
(
name
,
instance
);
return
instance
;
}
}
}
export
const
codeListRegister
:
CodeListRegister
=
new
CodeListRegister
();
\ No newline at end of file
app_web/src/components/app-department-select/app-department-select.vue
浏览文件 @
38ee66d3
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Watch
,
Prop
,
Model
}
from
'vue-property-decorator'
;
import
{
Vue
,
Component
,
Watch
,
Prop
,
Model
}
from
'vue-property-decorator'
;
import
CodeListService
from
'@/service/app/codelist-service'
;
@
Component
({
@
Component
({
})
})
export
default
class
AppDepartmentSelect
extends
Vue
{
export
default
class
AppDepartmentSelect
extends
Vue
{
...
@@ -18,6 +19,20 @@ export default class AppDepartmentSelect extends Vue {
...
@@ -18,6 +19,20 @@ export default class AppDepartmentSelect extends Vue {
*/
*/
@
Prop
()
public
url
?:
any
;
@
Prop
()
public
url
?:
any
;
/**
* 代码表标识
*
* @memberof AppDepartmentSelect
*/
@
Prop
()
public
tag
?:
string
;
/**
* 代码表类型
*
* @memberof AppDepartmentSelect
*/
@
Prop
()
public
codelistType
?:
string
;
/**
/**
* 过滤项
* 过滤项
*
*
...
@@ -121,14 +136,14 @@ export default class AppDepartmentSelect extends Vue {
...
@@ -121,14 +136,14 @@ export default class AppDepartmentSelect extends Vue {
}
}
this
.
oldurl
=
_url
;
this
.
oldurl
=
_url
;
// 缓存机制
// 缓存机制
const
result
:
any
=
this
.
$store
.
getters
.
get
CopyData
(
_url
);
const
result
:
any
=
this
.
$store
.
getters
.
get
DepData
(
this
.
filter
);
if
(
result
){
if
(
result
){
this
.
Nodesdata
=
result
;
this
.
Nodesdata
=
result
;
return
;
return
;
}
}
this
.
$http
.
get
(
_url
).
then
((
response
:
any
)
=>
{
this
.
$http
.
get
(
_url
).
then
((
response
:
any
)
=>
{
this
.
Nodesdata
=
response
.
data
;
this
.
Nodesdata
=
response
.
data
;
this
.
$store
.
commit
(
'addDepData'
,
{
srfkey
:
this
.
filter
,
org
Data
:
response
.
data
});
this
.
$store
.
commit
(
'addDepData'
,
{
srfkey
:
this
.
filter
,
dep
Data
:
response
.
data
});
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.error'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.error'
)
as
string
),
desc
:
(
this
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
...
@@ -163,13 +178,19 @@ export default class AppDepartmentSelect extends Vue {
...
@@ -163,13 +178,19 @@ export default class AppDepartmentSelect extends Vue {
// 单选
// 单选
if
(
!
this
.
multiple
){
if
(
!
this
.
multiple
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
let
templateValue
=
{};
let
templateValue
:
any
=
{};
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
if
(
this
.
data
&&
this
.
data
[
this
.
fillMap
[
item
]]){
if
(
this
.
data
&&
this
.
data
[
this
.
fillMap
[
item
]]){
Object
.
assign
(
templateValue
,{[
item
]:
this
.
data
[
this
.
fillMap
[
item
]]});
Object
.
assign
(
templateValue
,{[
item
]:
this
.
data
[
this
.
fillMap
[
item
]]});
}
}
})
})
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
if
(
!
templateValue
.
label
&&
templateValue
.
id
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
this
.
fillLabel
(
templateValue
,
templateValue
.
id
,(
templateValue
:
any
)
=>
{
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
});
}
else
{
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
}
}
}
}
else
{
}
else
{
// 多选
// 多选
...
@@ -188,8 +209,30 @@ export default class AppDepartmentSelect extends Vue {
...
@@ -188,8 +209,30 @@ export default class AppDepartmentSelect extends Vue {
})
})
}
}
})
})
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
let
tempflag
:
boolean
=
false
;
if
(
tempArray
.
length
>
0
&&
tempArray
.
length
>
0
){
tempArray
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
label
)
tempflag
=
true
;
})
}
}
if
(
tempflag
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
let
tempStatus
:
number
=
0
;
tempArray
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
label
){
tempStatus
+=
1
;
this
.
fillLabel
(
item
,
item
.
id
,(
result
:
any
)
=>
{
item
=
result
;
tempStatus
-=
1
;
if
(
tempStatus
===
0
){
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
}
})
}
})
}
else
{
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
}
}
}
}
}
}
...
@@ -208,10 +251,35 @@ export default class AppDepartmentSelect extends Vue {
...
@@ -208,10 +251,35 @@ export default class AppDepartmentSelect extends Vue {
let
_name
=
this
.
fillMap
[
attribute
];
let
_name
=
this
.
fillMap
[
attribute
];
let
values
=
selectArr
.
map
((
item
:
any
)
=>
item
[
attribute
]);
let
values
=
selectArr
.
map
((
item
:
any
)
=>
item
[
attribute
]);
let
_value
=
$event
===
"[]"
?
null
:
values
.
join
(
","
);
let
_value
=
$event
===
"[]"
?
null
:
values
.
join
(
","
);
this
.
$emit
(
'select-change'
,{
name
:
this
.
fillMap
[
attribute
],
value
:
_value
})
setTimeout
(()
=>
{
this
.
$emit
(
'select-change'
,{
name
:
this
.
fillMap
[
attribute
],
value
:
_value
});
},
0
);
});
});
}
}
}
}
/**
* 填充label
*
* @memberof AppOrgSelect
*/
public
fillLabel
(
tempObject
:
any
,
valueItem
:
any
,
callback
:
any
){
if
(
!
tempObject
.
label
&&
tempObject
.
id
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
let
codeListService
:
CodeListService
=
new
CodeListService
();
codeListService
.
getItems
(
this
.
tag
).
then
((
items
:
any
)
=>
{
if
(
items
&&
items
.
length
>
0
){
let
result
:
any
=
items
.
find
((
item
:
any
)
=>
{
return
item
.
id
===
valueItem
;
})
Object
.
assign
(
tempObject
,{
label
:
result
.
label
});
}
callback
(
tempObject
);
}).
catch
((
error
:
any
)
=>
{
console
.
log
(
error
);
})
}
}
}
}
</
script
>
</
script
>
...
...
app_web/src/components/app-org-select/app-org-select.vue
浏览文件 @
38ee66d3
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
<
script
lang =
'ts'
>
<
script
lang =
'ts'
>
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
"vue-property-decorator"
;
import
{
Http
}
from
'@/utils'
;
import
{
Http
}
from
'@/utils'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
{
observable
}
from
'rxjs'
;
@
Component
({})
@
Component
({})
export
default
class
AppOrgSelect
extends
Vue
{
export
default
class
AppOrgSelect
extends
Vue
{
...
@@ -37,6 +39,20 @@ export default class AppOrgSelect extends Vue {
...
@@ -37,6 +39,20 @@ export default class AppOrgSelect extends Vue {
*/
*/
@
Prop
()
public
filter
?:
string
;
@
Prop
()
public
filter
?:
string
;
/**
* 代码表标识
*
* @memberof AppOrgSelect
*/
@
Prop
()
public
tag
?:
string
;
/**
* 代码表类型
*
* @memberof AppOrgSelect
*/
@
Prop
()
public
codelistType
?:
string
;
/**
/**
* 是否多选
* 是否多选
*
*
...
@@ -138,13 +154,19 @@ export default class AppOrgSelect extends Vue {
...
@@ -138,13 +154,19 @@ export default class AppOrgSelect extends Vue {
// 单选
// 单选
if
(
!
this
.
multiple
){
if
(
!
this
.
multiple
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
let
templateValue
=
{};
let
templateValue
:
any
=
{};
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
if
(
this
.
data
&&
this
.
data
[
this
.
fillMap
[
item
]]){
if
(
this
.
data
&&
this
.
data
[
this
.
fillMap
[
item
]]){
Object
.
assign
(
templateValue
,{[
item
]:
this
.
data
[
this
.
fillMap
[
item
]]});
Object
.
assign
(
templateValue
,{[
item
]:
this
.
data
[
this
.
fillMap
[
item
]]});
}
})
if
(
!
templateValue
.
label
&&
templateValue
.
id
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
this
.
fillLabel
(
templateValue
,
templateValue
.
id
,(
templateValue
:
any
)
=>
{
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
});
}
else
{
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
}
}
})
this
.
selectTreeValue
=
JSON
.
stringify
([
templateValue
]);
}
}
}
else
{
}
else
{
// 多选
// 多选
...
@@ -163,8 +185,30 @@ export default class AppOrgSelect extends Vue {
...
@@ -163,8 +185,30 @@ export default class AppOrgSelect extends Vue {
})
})
}
}
})
})
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
let
tempflag
:
boolean
=
false
;
if
(
tempArray
.
length
>
0
&&
tempArray
.
length
>
0
){
tempArray
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
label
)
tempflag
=
true
;
})
}
if
(
tempflag
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
let
tempStatus
:
number
=
0
;
tempArray
.
forEach
((
item
:
any
)
=>
{
if
(
!
item
.
label
){
tempStatus
+=
1
;
this
.
fillLabel
(
item
,
item
.
id
,(
result
:
any
)
=>
{
item
=
result
;
tempStatus
-=
1
;
if
(
tempStatus
===
0
){
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
}
})
}
})
}
else
{
this
.
selectTreeValue
=
JSON
.
stringify
(
tempArray
);
}
}
}
}
}
}
}
...
@@ -175,7 +219,7 @@ export default class AppOrgSelect extends Vue {
...
@@ -175,7 +219,7 @@ export default class AppOrgSelect extends Vue {
*/
*/
public
loadTreeData
(
requestUrl
:
string
){
public
loadTreeData
(
requestUrl
:
string
){
if
(
this
.
filter
){
if
(
this
.
filter
){
const
result
:
any
=
this
.
$store
.
getters
.
get
Copy
Data
(
this
.
filter
);
const
result
:
any
=
this
.
$store
.
getters
.
get
Org
Data
(
this
.
filter
);
if
(
result
){
if
(
result
){
this
.
NodesData
=
result
;
this
.
NodesData
=
result
;
return
;
return
;
...
@@ -209,7 +253,9 @@ export default class AppOrgSelect extends Vue {
...
@@ -209,7 +253,9 @@ export default class AppOrgSelect extends Vue {
tempValue
.
forEach
((
value
:
any
,
index
:
number
)
=>
{
tempValue
.
forEach
((
value
:
any
,
index
:
number
)
=>
{
tempResult
+=
index
>
0
?
`,
${
value
[
item
]}
`
:
`
${
value
[
item
]}
`
;
tempResult
+=
index
>
0
?
`,
${
value
[
item
]}
`
:
`
${
value
[
item
]}
`
;
})
})
this
.
emitValue
(
this
.
fillMap
[
item
],
tempResult
);
setTimeout
(()
=>
{
this
.
emitValue
(
this
.
fillMap
[
item
],
tempResult
);
},
0
);
})
})
}
}
}
else
{
}
else
{
...
@@ -225,7 +271,9 @@ export default class AppOrgSelect extends Vue {
...
@@ -225,7 +271,9 @@ export default class AppOrgSelect extends Vue {
const
tempValue
:
any
=
JSON
.
parse
(
$event
)[
0
];
const
tempValue
:
any
=
JSON
.
parse
(
$event
)[
0
];
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
this
.
emitValue
(
this
.
fillMap
[
item
],
tempValue
[
item
]);
setTimeout
(()
=>
{
this
.
emitValue
(
this
.
fillMap
[
item
],
tempValue
[
item
]);
},
0
);
})
})
}
}
}
else
{
}
else
{
...
@@ -247,6 +295,28 @@ export default class AppOrgSelect extends Vue {
...
@@ -247,6 +295,28 @@ export default class AppOrgSelect extends Vue {
this
.
$emit
(
'select-change'
,{
name
:
name
,
value
:
value
});
this
.
$emit
(
'select-change'
,{
name
:
name
,
value
:
value
});
}
}
/**
* 填充label
*
* @memberof AppOrgSelect
*/
public
fillLabel
(
tempObject
:
any
,
valueItem
:
any
,
callback
:
any
){
if
(
!
tempObject
.
label
&&
tempObject
.
id
&&
this
.
tag
&&
this
.
codelistType
&&
Object
.
is
(
this
.
codelistType
,
"DYNAMIC"
)){
let
codeListService
:
CodeListService
=
new
CodeListService
();
codeListService
.
getItems
(
this
.
tag
).
then
((
items
:
any
)
=>
{
if
(
items
&&
items
.
length
>
0
){
let
result
:
any
=
items
.
find
((
item
:
any
)
=>
{
return
item
.
id
===
valueItem
;
})
Object
.
assign
(
tempObject
,{
label
:
result
.
label
});
}
callback
(
tempObject
);
}).
catch
((
error
:
any
)
=>
{
console
.
log
(
error
);
})
}
}
}
}
</
script
>
</
script
>
...
...
app_web/src/components/app-upicker/app-upicker.less
0 → 100644
浏览文件 @
38ee66d3
.app-picker {
width: 100%;
.el-select {
.el-input__suffix {
right: 20px;
}
}
.text-value {
.el-icon-circle-close {
display: none;
}
}
.text-value:hover {
.el-icon-circle-close {
display: inline-block;
}
}
.ivu-icon-ios-open-outline {
margin-top: -2px;
margin-left: 5px;
font-size: 15px;
}
}
\ No newline at end of file
app_web/src/components/app-upicker/app-upicker.vue
0 → 100644
浏览文件 @
38ee66d3
<
template
>
<el-select
style=
"width: 100%;"
size=
'small'
@
change=
"onSelect"
v-model=
"value"
:disabled=
"disabled"
@
visible-change=
"onSelectOpen"
>
<el-option
v-for=
"(item, index) in items"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</
template
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Prop
,
Model
,
Watch
}
from
"vue-property-decorator"
;
import
{
Subject
}
from
"rxjs"
;
import
{
AppModal
}
from
"@/utils"
;
@
Component
({})
export
default
class
AppPicker
extends
Vue
{
/**
* 表单数据
*
* @type {*}
* @memberof AppPicker
*/
@
Prop
()
public
data
!
:
any
;
/**
* 属性项名称
*
* @type {string}
* @memberof AppPicker
*/
@
Prop
()
public
name
!
:
string
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@
Prop
()
public
context
!
:
any
;
/**
* 编辑器禁用
*
* @type {boolean}
* @memberof AppUpicker
*/
@
Prop
()
disabled
?:
boolean
;
/**
* 视图参数
*
* @type {*}
* @memberof SelectFormBase
*/
@
Prop
()
public
viewparams
:
any
;
/**
* 请求参数和请求数据的映射关系
*
* @type {*}
* @memberof AppUpicker
*/
public
interaction
:
any
=
{};
/**
* 当前表单项绑定的值
*
* @type {string}
* @memberof AppUpicker
*/
public
value
:
string
=
""
;
/**
* 编辑器参数
*
* @type {*}
* @memberof AppUpicker
*/
@
Prop
()
public
itemParams
?:
any
;
/**
* 编辑器参数
*
* @type {string}
* @memberof AppUpicker
*/
@
Prop
()
public
valueItem
?:
string
;
/**
* 列表项请求路径
*
* @type {string}
* @memberof AppUpicker
*/
public
url
:
string
=
''
;
/**
* 下拉数组
* @type {any[]}
* @memberof AppPicker
*/
public
items
:
any
[]
=
[];
/**
* 请求到的数据
* @type {any[]}
* @memberof AppPicker
*/
public
itemList
:
any
[]
=
[{
a
:
1
,
b
:
"zhangsan"
},{
a
:
2
,
b
:
"lisi"
},{
a
:
3
,
b
:
"wangwu"
}]
/**
* vue 生命周期
*
* @memberof AppPicker
*/
public
mounted
()
{
// 解析编辑器参数
this
.
analysis
(
this
.
itemParams
);
// 请求下拉数据
this
.
fectchItemList
(
this
.
url
);
}
/**
* 下拉重新加载数据
*
* @memberof AppPicker
*/
public
onSelectOpen
()
{
this
.
fectchItemList
(
this
.
url
);
}
/**
* 解析编辑器参数
* @param {*} itemparams
* @memberof AppPicker
*/
public
analysis
(
itemparams
:
any
)
{
Object
.
keys
(
itemparams
).
forEach
((
param
)
=>
{
if
(
param
===
'path'
){
this
.
url
=
itemparams
[
param
]
}
else
{
this
.
interaction
[
param
]
=
itemparams
[
param
]
}
})
}
/**
* 请求下拉列表数据
* @param {string} url
* @memberof AppPicker
*/
public
fectchItemList
(
url
:
string
)
{
this
.
$http
.
get
(
url
)
.
then
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
==
200
&&
response
.
data
)
{
this
.
itemList
=
response
.
data
;
// 提取需要的值(value,label)
this
.
extractItem
(
this
.
itemList
,
this
.
items
);
}
})
.
catch
((
response
:
any
)
=>
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
this
.
$Notice
.
error
({
title
:
this
.
$t
(
"app.commonWords.error"
)
as
string
,
desc
:
this
.
$t
(
"app.commonWords.sysException"
)
as
string
,
});
return
;
}
});
}
/**
* 解析下拉列表数据
* @param {any[]} itemList 请求到的数据
* @param {any[]} items 下拉数组
* @memberof AppPicker
*/
public
extractItem
(
itemList
:
any
[],
items
:
any
[])
{
this
.
items
.
length
=
0
;
itemList
.
forEach
((
item
)
=>
{
items
.
push
({
label
:
item
[
this
.
interaction
.
label
],
value
:
item
[
this
.
interaction
.
value
],
});
});
}
public
onSelect
(
val
:
string
)
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
value
,
val
));
if
(
index
>=
0
)
{
this
.
onACSelect
(
this
.
items
[
index
]);
}
}
/**
* 选中数据回调
* @param item
*/
public
onACSelect
(
item
:
any
):
void
{
if
(
this
.
name
){
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
item
.
value
});
}
if
(
this
.
valueItem
){
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
valueItem
,
value
:
item
.
value
});
}
}
}
</
script
>
<
style
lang=
"less"
>
@import './app-upicker.less';
</
style
>
app_web/src/index.d.ts
浏览文件 @
38ee66d3
...
@@ -3,13 +3,14 @@ import { AuthServiceRegister } from '@/authservice/auth-service-register';
...
@@ -3,13 +3,14 @@ import { AuthServiceRegister } from '@/authservice/auth-service-register';
import
{
UtilServiceRegister
}
from
'@/utilservice/util-service-register'
;
import
{
UtilServiceRegister
}
from
'@/utilservice/util-service-register'
;
import
{
EntityServiceRegister
}
from
'@/service/entity-service-register'
;
import
{
EntityServiceRegister
}
from
'@/service/entity-service-register'
;
import
{
CounterServiceRegister
}
from
'@/counter/counter-service-register'
;
import
{
CounterServiceRegister
}
from
'@/counter/counter-service-register'
;
import
{
CodeListRegister
}
from
'@codelist/codelist-register'
;
declare
global
{
declare
global
{
interface
Window
{
interface
Window
{
uiServiceRegister
:
UIServiceRegister
,
uiServiceRegister
:
UIServiceRegister
,
authServiceRegister
:
AuthServiceRegister
,
authServiceRegister
:
AuthServiceRegister
,
utilServiceRegister
:
UtilServiceRegister
,
utilServiceRegister
:
UtilServiceRegister
,
entityServiceRegister
:
EntityServiceRegister
,
entityServiceRegister
:
EntityServiceRegister
,
counterServiceRegister
:
CounterServiceRegister
counterServiceRegister
:
CounterServiceRegister
,
codeListRegister
:
CodeListRegister
}
}
}
}
\ No newline at end of file
app_web/src/service/app/codelist-service.ts
浏览文件 @
38ee66d3
import
{
Store
}
from
'vuex'
;
import
store
from
'@/store'
;
import
EntityService
from
'../entity-service'
;
/**
/**
* 动态代码表服务类
* 动态代码表服务类
...
@@ -15,10 +16,10 @@ export default class CodeListService {
...
@@ -15,10 +16,10 @@ export default class CodeListService {
* @type {(any | null)}
* @type {(any | null)}
* @memberof CodeListService
* @memberof CodeListService
*/
*/
private
$store
:
Store
<
any
>
|
null
=
null
;
private
$store
:
any
;
constructor
(
opts
:
any
=
{})
{
constructor
(
opts
:
any
=
{})
{
this
.
$store
=
opts
.
$
store
;
this
.
$store
=
store
;
}
}
/**
/**
...
@@ -27,7 +28,7 @@ export default class CodeListService {
...
@@ -27,7 +28,7 @@ export default class CodeListService {
* @returns {(any | null)}
* @returns {(any | null)}
* @memberof CodeListService
* @memberof CodeListService
*/
*/
public
getStore
():
Store
<
any
>
|
null
{
public
getStore
():
any
{
return
this
.
$store
;
return
this
.
$store
;
}
}
...
@@ -48,6 +49,79 @@ export default class CodeListService {
...
@@ -48,6 +49,79 @@ export default class CodeListService {
*/
*/
public
static
codelistCached
:
Map
<
string
,
any
>
=
new
Map
();
public
static
codelistCached
:
Map
<
string
,
any
>
=
new
Map
();
/**
* 数据服务基类
*
* @type {Minorentity}
* @memberof CodeListService
*/
public
entityService
:
EntityService
=
new
EntityService
();
/**
* 获取代码表服务
*
* @protected
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof EntityService
*/
public
getService
(
name
:
string
):
Promise
<
any
>
{
return
(
window
as
any
)[
'codeListRegister'
].
getService
(
name
);
}
/**
* 获取静态代码表
*
* @param {string} tag 代码表标识
* @returns {Promise<any[]>}
* @memberof CodeListService
*/
public
getStaticItems
(
tag
:
string
):
Promise
<
any
[]
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
const
codelist
=
this
.
$store
.
getters
.
getCodeList
(
tag
);
if
(
codelist
)
{
let
items
:
Array
<
any
>
=
[...
JSON
.
parse
(
JSON
.
stringify
(
codelist
.
items
))];
resolve
(
items
);
}
})
}
/**
* 获取预定义代码表
*
* @param {string} tag 代码表标识
* @returns {Promise<any[]>}
* @memberof CodeListService
*/
public
getPredefinedItems
(
tag
:
string
,
data
?:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
if
(
CodeListService
.
codelistCached
.
get
(
`
${
tag
}
`
)){
let
items
:
any
=
CodeListService
.
codelistCached
.
get
(
`
${
tag
}
`
).
items
;
if
(
items
.
length
>
0
)
resolve
(
items
);
}
const
callback
:
Function
=
(
tag
:
string
,
promise
:
Promise
<
any
>
)
=>
{
promise
.
then
((
res
:
any
)
=>
{
let
result
:
any
=
res
.
data
;
if
(
result
.
items
&&
result
.
items
.
length
>
0
){
CodeListService
.
codelistCached
.
set
(
`
${
tag
}
`
,{
items
:
result
.
items
});
return
resolve
(
result
.
items
);
}
else
{
return
resolve
([]);
}
}).
catch
((
result
:
any
)
=>
{
return
reject
(
result
);
})
}
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if
(
CodeListService
.
codelistCache
.
get
(
`
${
tag
}
`
)){
callback
(
tag
,
CodeListService
.
codelistCache
.
get
(
`
${
tag
}
`
));
}
else
{
let
result
:
Promise
<
any
>
=
this
.
entityService
.
getPredefinedCodelist
(
tag
);
CodeListService
.
codelistCache
.
set
(
`
${
tag
}
`
,
result
);
callback
(
tag
,
result
);
}
})
}
/**
/**
* 获取动态代码表
* 获取动态代码表
...
@@ -57,73 +131,84 @@ export default class CodeListService {
...
@@ -57,73 +131,84 @@ export default class CodeListService {
* @returns {Promise<any[]>}
* @returns {Promise<any[]>}
* @memberof CodeListService
* @memberof CodeListService
*/
*/
public
getItems
(
tag
:
string
,
context
:
any
=
{},
data
?:
any
,
isloading
?:
boolean
,
):
Promise
<
any
[]
>
{
public
getItems
(
tag
:
string
,
context
:
any
=
{},
data
?:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
let
_this
:
any
=
this
;
let
_this
:
any
=
this
;
if
(
context
&&
context
.
srfsessionid
){
if
(
context
&&
context
.
srfsessionid
){
delete
context
.
srfsessionid
;
delete
context
.
srfsessionid
;
}
}
let
isEnableCache
:
boolean
=
_this
[
tag
].
isEnableCache
;
let
cacheTimeout
:
any
=
_this
[
tag
].
cacheTimeout
;
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
// 启用缓存
this
.
getService
(
tag
).
then
((
codelist
:
any
)
=>
{
if
(
isEnableCache
){
if
(
Object
.
is
(
codelist
.
predefinedType
,
"RUNTIME"
)){
// 加载完成,从本地缓存获取
this
.
getPredefinedItems
(
tag
).
then
((
res
:
any
)
=>
{
if
(
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
resolve
(
res
);
let
items
:
any
=
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
).
items
;
})
if
(
items
.
length
>
0
){
return
;
if
(
cacheTimeout
!==
-
1
){
}
if
(
new
Date
().
getTime
()
>
_this
[
tag
].
expirationTime
){
let
isEnableCache
:
boolean
=
codelist
.
isEnableCache
;
_this
[
tag
].
getItems
(
context
,
data
,
isloading
).
then
((
result
:
any
)
=>
{
let
cacheTimeout
:
any
=
codelist
.
cacheTimeout
;
CodeListService
.
codelistCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
// 启用缓存
_this
[
tag
].
expirationTime
=
new
Date
().
getTime
()
+
cacheTimeout
;
if
(
isEnableCache
){
resolve
(
result
);
// 加载完成,从本地缓存获取
}).
catch
((
error
:
any
)
=>
{
if
(
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
Promise
.
reject
([]);
let
items
:
any
=
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
).
items
;
})
if
(
items
.
length
>
0
){
if
(
cacheTimeout
!==
-
1
){
if
(
new
Date
().
getTime
()
>
codelist
.
expirationTime
){
codelist
.
getItems
(
context
,
data
,
isloading
).
then
((
result
:
any
)
=>
{
CodeListService
.
codelistCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
codelist
.
expirationTime
=
new
Date
().
getTime
()
+
cacheTimeout
;
resolve
(
result
);
}).
catch
((
error
:
any
)
=>
{
Promise
.
reject
([]);
})
}
else
{
return
resolve
(
items
);
}
}
else
{
}
else
{
return
resolve
(
items
);
return
resolve
(
items
);
}
}
}
else
{
return
resolve
(
items
);
}
}
}
}
}
if
(
codelist
)
{
if
(
_this
[
tag
])
{
const
callback
:
Function
=
(
context
:
any
=
{},
data
:
any
=
{},
tag
:
string
,
promise
:
Promise
<
any
>
)
=>
{
const
callback
:
Function
=
(
context
:
any
=
{},
data
:
any
=
{},
tag
:
string
,
promise
:
Promise
<
any
>
)
=>
{
promise
.
then
((
result
:
any
)
=>
{
promise
.
then
((
result
:
any
)
=>
{
if
(
result
.
length
>
0
){
if
(
result
.
length
>
0
){
CodeListService
.
codelistCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
CodeListService
.
codelistCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
return
resolve
(
result
);
return
resolve
(
result
);
}
else
{
}
else
{
return
resolve
([]);
return
resolve
([]);
}
}).
catch
((
result
:
any
)
=>
{
return
reject
(
result
);
})
}
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if
(
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
callback
(
context
,
data
,
tag
,
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
));
}
else
{
let
result
:
Promise
<
any
>
=
codelist
.
getItems
(
context
,
data
,
isloading
);
CodeListService
.
codelistCache
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,
result
);
if
(
cacheTimeout
!==
-
1
){
codelist
.
expirationTime
=
new
Date
().
getTime
()
+
cacheTimeout
;
}
}
}).
catch
((
result
:
any
)
=>
{
callback
(
context
,
data
,
tag
,
result
);
return
reject
(
result
);
})
}
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if
(
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
callback
(
context
,
data
,
tag
,
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
));
}
else
{
let
result
:
Promise
<
any
>
=
_this
[
tag
].
getItems
(
context
,
data
,
isloading
);
CodeListService
.
codelistCache
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,
result
);
if
(
cacheTimeout
!==
-
1
){
_this
[
tag
].
expirationTime
=
new
Date
().
getTime
()
+
cacheTimeout
;
}
}
callback
(
context
,
data
,
tag
,
result
);
}
}
}
}
else
{
if
(
_this
[
tag
])
{
_this
[
tag
].
getItems
(
context
,
data
,
isloading
).
then
((
result
:
any
)
=>
{
resolve
(
result
);
}).
catch
((
error
:
any
)
=>
{
Promise
.
reject
([]);
})
}
else
{
}
else
{
return
Promise
.
reject
([]);
if
(
codelist
)
{
}
codelist
.
getItems
(
context
,
data
,
isloading
).
then
((
result
:
any
)
=>
{
}
resolve
(
result
);
}).
catch
((
error
:
any
)
=>
{
Promise
.
reject
([]);
})
}
else
{
return
Promise
.
reject
([]);
}
}
}).
catch
((
error
:
any
)
=>
{
console
.
warn
(
"获取代码表异常"
);
return
Promise
.
reject
([]);
})
})
})
}
}
}
}
\ No newline at end of file
app_web/src/service/entity-service.ts
浏览文件 @
38ee66d3
import
{
Store
}
from
'vuex'
;
import
{
Http
}
from
'@/utils'
;
import
{
Http
}
from
'@/utils'
;
import
CodeListService
from
"@service/app/codelist-service"
;
import
CodeListService
from
"@service/app/codelist-service"
;
...
@@ -10,15 +9,6 @@ import CodeListService from "@service/app/codelist-service";
...
@@ -10,15 +9,6 @@ import CodeListService from "@service/app/codelist-service";
*/
*/
export
default
class
EntityService
{
export
default
class
EntityService
{
/**
* Vue 状态管理器
*
* @private
* @type {(any | null)}
* @memberof EntityService
*/
private
$store
:
Store
<
any
>
|
null
=
null
;
/**
/**
* 获取实体数据服务
* 获取实体数据服务
*
*
...
@@ -101,21 +91,10 @@ export default class EntityService {
...
@@ -101,21 +91,10 @@ export default class EntityService {
* @memberof EntityService
* @memberof EntityService
*/
*/
constructor
(
opts
:
any
=
{})
{
constructor
(
opts
:
any
=
{})
{
this
.
$store
=
opts
.
$store
;
this
.
tempStorage
=
localStorage
;
this
.
tempStorage
=
localStorage
;
this
.
initBasicData
();
this
.
initBasicData
();
}
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof EntityService
*/
public
getStore
():
Store
<
any
>
|
null
{
return
this
.
$store
;
}
/**
/**
* 获取代码表
* 获取代码表
*
*
...
@@ -123,22 +102,16 @@ export default class EntityService {
...
@@ -123,22 +102,16 @@ export default class EntityService {
*/
*/
public
getCodeList
(
tag
:
string
,
codelistType
:
string
,
context
:
any
=
{},
param
:
any
=
{}){
public
getCodeList
(
tag
:
string
,
codelistType
:
string
,
context
:
any
=
{},
param
:
any
=
{}){
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
codeListService
=
new
CodeListService
();
if
(
tag
&&
Object
.
is
(
codelistType
,
"STATIC"
)){
if
(
tag
&&
Object
.
is
(
codelistType
,
"STATIC"
)){
let
returnItems
:
Array
<
any
>
=
[];
codeListService
.
getStaticItems
(
tag
).
then
((
items
:
any
)
=>
{
const
codelist
=
(
this
.
getStore
()
as
Store
<
any
>
).
getters
.
getCodeList
(
tag
);
resolve
(
items
);
if
(
codelist
)
{
})
returnItems
=
[...
JSON
.
parse
(
JSON
.
stringify
(
codelist
.
items
))];
}
else
{
console
.
log
(
`----
${
tag
}
----代码表不存在`
);
}
resolve
(
returnItems
);
}
else
if
(
tag
&&
Object
.
is
(
codelistType
,
"DYNAMIC"
)){
}
else
if
(
tag
&&
Object
.
is
(
codelistType
,
"DYNAMIC"
)){
let
codeListService
=
new
CodeListService
({
$store
:
this
.
$store
});
codeListService
.
getItems
(
tag
,
context
,
param
).
then
((
res
:
any
)
=>
{
codeListService
.
getItems
(
tag
,
context
,
param
).
then
((
res
:
any
)
=>
{
resolve
(
res
);
resolve
(
res
);
}).
catch
((
error
:
any
)
=>
{
}).
catch
((
error
:
any
)
=>
{
reject
(
`
${
tag
}
代码表不存在`
);
reject
(
`
${
tag
}
代码表不存在`
);
console
.
log
(
`----
${
tag
}
----代码表不存在`
);
});
});
}
}
})
})
...
@@ -988,4 +961,15 @@ export default class EntityService {
...
@@ -988,4 +961,15 @@ export default class EntityService {
return
Http
.
getInstance
().
post
(
`/v7/changepwd`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/v7/changepwd`
,
data
,
isloading
);
}
}
/**
* 获取数字字典
*
* @param tag
* @param data
* @param isloading
*/
public
async
getPredefinedCodelist
(
tag
:
string
,
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/dictionarys/codelist/
${
tag
}
`
,
data
,
isloading
);
}
}
}
\ No newline at end of file
config.xml
浏览文件 @
38ee66d3
...
@@ -37,11 +37,6 @@
...
@@ -37,11 +37,6 @@
git clone -b master $para2 ibzwf/
git clone -b master $para2 ibzwf/
export NODE_OPTIONS=--max-old-space-size=4096
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzwf/
cd ibzwf/
mvn clean package -Papi
cd ibzwf-provider/ibzwf-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzwf-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</command>
</hudson.tasks.Shell>
</hudson.tasks.Shell>
</builders>
</builders>
...
...
ibzwf-app/ibzwf-app-web/src/main/java/cn/ibizlab/web/webApplication.java
浏览文件 @
38ee66d3
...
@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
...
@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -30,6 +32,9 @@ import java.util.List;
...
@@ -30,6 +32,9 @@ import java.util.List;
})
})
public
class
webApplication
extends
WebMvcConfigurerAdapter
{
public
class
webApplication
extends
WebMvcConfigurerAdapter
{
@Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
webApplication
.
class
,
args
);
SpringApplication
.
run
(
webApplication
.
class
,
args
);
}
}
...
@@ -37,6 +42,6 @@ public class webApplication extends WebMvcConfigurerAdapter{
...
@@ -37,6 +42,6 @@ public class webApplication extends WebMvcConfigurerAdapter{
@Override
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
cn
.
ibizlab
.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
ibzwf-app/ibzwf-app-web/src/main/resources/application-web-prod.yml
浏览文件 @
38ee66d3
...
@@ -52,9 +52,13 @@ zuul:
...
@@ -52,9 +52,13 @@ zuul:
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
stripPrefix
:
false
stripPrefix
:
false
oudict
:
oudict
:
path
:
/dictionarys/**/
i
bzou**
path
:
/dictionarys/**/
I
bzou**
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
stripPrefix
:
false
stripPrefix
:
false
uaadict
:
path
:
/dictionarys/**/SysOperator
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix
:
false
dict
:
dict
:
path
:
/dictionarys/**
path
:
/dictionarys/**
serviceId
:
${ibiz.ref.service.dict:ibzdict-api}
serviceId
:
${ibiz.ref.service.dict:ibzdict-api}
...
...
ibzwf-boot/src/main/java/cn/ibizlab/DevBootApplication.java
浏览文件 @
38ee66d3
...
@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan;
...
@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
java.util.List
;
import
java.util.List
;
import
cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver
;
import
org.springframework.beans.factory.annotation.Autowired
;
@Slf4j
@Slf4j
@EnableDiscoveryClient
@EnableDiscoveryClient
...
@@ -34,6 +36,9 @@ import java.util.List;
...
@@ -34,6 +36,9 @@ import java.util.List;
@EnableScheduling
@EnableScheduling
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
@Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
}
}
...
@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
...
@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
@Override
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
cn
.
ibizlab
.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
ibzwf-boot/src/main/resources/application-dev.yml
浏览文件 @
38ee66d3
...
@@ -25,9 +25,13 @@ zuul:
...
@@ -25,9 +25,13 @@ zuul:
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
stripPrefix
:
false
stripPrefix
:
false
oudict
:
oudict
:
path
:
/dictionarys/**/
i
bzou**
path
:
/dictionarys/**/
I
bzou**
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
serviceId
:
${ibiz.ref.service.ou:ibzou-api}
stripPrefix
:
false
stripPrefix
:
false
uaadict
:
path
:
/dictionarys/**/SysOperator
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix
:
false
dict
:
dict
:
path
:
/dictionarys/**
path
:
/dictionarys/**
serviceId
:
${ibiz.ref.service.dict:ibzdict-api}
serviceId
:
${ibiz.ref.service.dict:ibzdict-api}
...
...
ibzwf-provider/ibzwf-provider-api/src/main/docker/Dockerfile
浏览文件 @
38ee66d3
...
@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
...
@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzwf-provider-api.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzwf-provider-api.jar
EXPOSE
40003
EXPOSE
8081
ADD
ibzwf-provider-api.jar /ibzwf-provider-api.jar
ADD
ibzwf-provider-api.jar /ibzwf-provider-api.jar
ibzwf-provider/ibzwf-provider-api/src/main/docker/ibzwf-provider-api.yaml
浏览文件 @
38ee66d3
...
@@ -3,22 +3,9 @@ services:
...
@@ -3,22 +3,9 @@ services:
ibzwf-provider-api
:
ibzwf-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzwf-provider-api:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzwf-provider-api:latest
ports
:
ports
:
-
"
40003:40003
"
-
"
8081:8081
"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40003
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
-
SPRING_REDIS_HOST=172.16.100.243
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
-
SPRING_DATASOURCE_PASSWORD=@6dEfb3@
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
NACOS=172.16.102.211:8848
deploy
:
deploy
:
resources
:
resources
:
limits
:
limits
:
...
...
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/ibzwfapiApplication.java
浏览文件 @
38ee66d3
...
@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
...
@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -40,6 +42,9 @@ import java.util.List;
...
@@ -40,6 +42,9 @@ import java.util.List;
@EnableScheduling
@EnableScheduling
public
class
ibzwfapiApplication
extends
WebMvcConfigurerAdapter
{
public
class
ibzwfapiApplication
extends
WebMvcConfigurerAdapter
{
@Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ibzwfapiApplication
.
class
,
args
);
SpringApplication
.
run
(
ibzwfapiApplication
.
class
,
args
);
}
}
...
@@ -47,6 +52,6 @@ public class ibzwfapiApplication extends WebMvcConfigurerAdapter{
...
@@ -47,6 +52,6 @@ public class ibzwfapiApplication extends WebMvcConfigurerAdapter{
@Override
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
cn
.
ibizlab
.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
ibzwf-util/src/main/java/cn/ibizlab/util/web/SearchContextHandlerMethodArgumentResolver.java
浏览文件 @
38ee66d3
...
@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
...
@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import
org.springframework.web.method.support.ModelAndViewContainer
;
import
org.springframework.web.method.support.ModelAndViewContainer
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
@Slf4j
@Slf4j
@Configuration
public
class
SearchContextHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
public
class
SearchContextHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
@Value
(
"${ibiz.pageLimit:1000}"
)
private
int
pageLimit
=
1000
;
private
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
private
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
@Override
@Override
...
@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
...
@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for
(
String
key
:
params
.
keySet
())
{
for
(
String
key
:
params
.
keySet
())
{
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
}
}
if
((!
set
.
containsKey
(
"size"
))
){
set
.
put
(
"size"
,
pageLimit
);
}
String
json
=
objectMapper
.
writeValueAsString
(
set
);
String
json
=
objectMapper
.
writeValueAsString
(
set
);
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录