Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
b88174be
提交
b88174be
编写于
9月 02, 2020
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
人员选择器
上级
2e4f5ad7
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
469 行增加
和
11 行删除
+469
-11
app-register.ts
src/app-register.ts
+2
-1
app-department-personnel.vue
...nts/app-department-personnel/app-department-personnel.vue
+430
-0
app-group-picker.vue
src/components/app-group-picker/app-group-picker.vue
+12
-2
app-group-select.vue
src/components/app-group-select/app-group-select.vue
+3
-4
getters.ts
src/store/getters.ts
+9
-0
mutations.ts
src/store/mutations.ts
+12
-4
state.ts
src/store/state.ts
+1
-0
未找到文件。
src/app-register.ts
浏览文件 @
b88174be
...
...
@@ -88,7 +88,7 @@ import CronEditor from './components/cron-editor/cron-editor.vue'
import
AppMessagePopover
from
'./components/app-message-popover/app-message-popover.vue'
import
AppPanelField
from
'./components/app-panel-field/app-panel-field.vue'
import
AppPanelItem
from
'./components/app-panel-item/app-panel-item.vue'
import
AppDepartmentPersonnel
from
'./components/app-department-personnel/app-department-personnel.vue'
// 全局挂载UI实体服务注册中心
window
[
'uiServiceRegister'
]
=
uiServiceRegister
;
...
...
@@ -114,6 +114,7 @@ export const AppComponents = {
v
.
prototype
.
$verify
=
Verify
;
v
.
prototype
.
$viewTool
=
ViewTool
;
v
.
prototype
.
$uiActionTool
=
UIActionTool
;
v
.
component
(
'app-department-personnel'
,
AppDepartmentPersonnel
);
v
.
component
(
'app-panel-item'
,
AppPanelItem
);
v
.
component
(
'app-panel-field'
,
AppPanelField
);
v
.
component
(
'app-full-scren'
,
AppFullScren
);
...
...
src/components/app-department-personnel/app-department-personnel.vue
0 → 100644
浏览文件 @
b88174be
<
template
>
<div
class=
"app-department-personnel"
>
<i-select
:multiple=
"multiple"
:transfer=
"true"
transfer-class-name=
"app-department-personnel-select"
v-model=
"selectsLabel"
:disabled=
"disabled"
:clearable=
"true"
@
on-open-change=
"onClick"
@
on-change=
"change"
>
<i-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item.value"
:label=
"item.label"
>
{{
item
.
label
}}
</i-option>
</i-select>
<template>
<i
v-if=
"!disabled"
class=
"el-icon-search"
@
click=
"openView"
></i>
</
template
>
</div>
</template>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Prop
,
Watch
}
from
'vue-property-decorator'
;
import
{
Subject
}
from
'rxjs'
;
import
{
Http
}
from
'../../utils'
;
import
CodeListService
from
'@/service/app/codelist-service'
;
@
Component
({})
export
default
class
AppDepartmentPersonnel
extends
Vue
{
/**
* 名称标识
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
name
!
:
string
;
/**
* 树加载地址
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
treeurl
?:
boolean
;
/**
* 数据接口地址
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
url
!
:
string
;
/**
* 多选
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
({
default
:
false
})
public
multiple
?:
boolean
;
/**
* 数据对象
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
data
:
any
;
/**
* 代码表标识
*
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
tag
?:
string
;
/**
* 代码表类型
*
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
codelistType
?:
string
;
/**
* 过滤属性标识
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
filter
?:
string
;
/**
* 是否启用
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
disabled
?:
boolean
;
/**
* 值
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
value
:
any
;
/**
* 上下文参数
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
context
:
any
;
/**
* 关联属性
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
valueitem
:
any
;
/**
* 填充属性
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
@
Prop
()
public
fillmap
:
any
;
/**
* 选中项对象集合
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
selects
:
any
[]
=
[
{
value
:
'New York'
,
label
:
'New York'
}
];
/**
* 选中项label集合
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
selectsLabel
:
any
=
[
"New York"
]
;
/**
* 下拉数组
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
items
:
any
[]
=
[{
value
:
'New York'
,
label
:
'New York'
},
{
value
:
'London'
,
label
:
'London'
},
{
value
:
'Sydney'
,
label
:
'Sydney'
},
{
value
:
'Ottawa'
,
label
:
'Ottawa'
},
{
value
:
'Paris'
,
label
:
'Paris'
},
{
value
:
'Canberra'
,
label
:
'Canberra'
}];
/**
* 过滤值
*
* @type {string}
* @memberof AppDepartmentPersonnel
*/
public
filtervalue
:
string
=
''
;
/**
* 获取需要过滤的部门id
*
* @memberof AppDepartmentPersonnel
*/
public
getDepertmentId
(){
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
if
(
this
.
filter
){
if
(
this
.
data
[
this
.
filter
]){
this
.
filtervalue
=
this
.
data
[
this
.
filter
];
}
else
if
(
context
[
this
.
filter
]){
this
.
filtervalue
=
context
[
this
.
filter
];
}
else
{
this
.
filtervalue
=
context
.
srfpdept
;
}
}
else
{
this
.
filtervalue
=
context
.
srfpdept
;
}
}
/**
* 展开下拉选择框
*
* @param {*} $event
* @memberof AppDepartmentPersonnel
*/
public
onClick
(
$event
:
any
){
if
(
$event
===
true
){
const
items
:
Array
<
any
>
=
this
.
$store
.
getters
.
getDepartmentPersonnel
();
if
(
items
.
length
>
0
){
this
.
items
=
items
;
}
else
{
this
.
getDepertmentId
();
let
tempUrl
=
this
.
url
.
replace
(
'{deptId}'
,
this
.
filtervalue
);
let
get
=
Http
.
getInstance
().
get
(
tempUrl
,
true
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
.
status
===
200
)
{
this
.
items
=
response
.
data
;
this
.
$store
.
commit
(
"addDepartmentPersonnel"
,
this
.
items
);
}
}).
catch
((
error
:
any
)
=>
{
console
.
log
(
error
)
})
}
}
}
/**
* 值变化
*
* @type {*}
* @memberof AppGroupSelect
*/
@
Watch
(
'data'
,{
immediate
:
true
,
deep
:
true
})
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
selects
=
[];
this
.
selectsLabel
=
[];
if
(
newVal
)
{
let
item
:
any
=
{};
item
.
label
=
this
.
data
[
this
.
name
]?
this
.
data
[
this
.
name
].
split
(
','
):[];
item
.
id
=
this
.
data
[
this
.
valueitem
]
?
this
.
data
[
this
.
valueitem
].
split
(
','
)
:
[];
if
(
this
.
fillmap
)
{
for
(
let
key
in
this
.
fillmap
)
{
item
[
this
.
fillmap
[
key
]]
=
this
.
data
[
key
]
?
this
.
data
[
key
].
split
(
','
)
:
[];
}
}
const
callback
:
any
=
(
item
:
any
)
=>
{
item
.
label
.
forEach
((
val
:
string
,
index
:
number
)
=>
{
let
_item
:
any
=
{};
for
(
let
key
in
item
)
{
_item
[
key
]
=
item
[
key
][
index
]
?
item
[
key
][
index
]
:
null
;
}
this
.
selects
.
push
(
_item
);
this
.
selectsLabel
.
push
(
_item
.
label
);
})
}
if
(
item
.
label
.
length
==
0
&&
item
.
id
.
length
>
0
){
this
.
fillLabel
(
item
,
item
.
id
,(
result
:
any
)
=>
{
item
.
label
=
result
.
label
;
callback
(
item
);
});
}
else
{
callback
(
item
);
}
}
}
/**
* 填充label
*
* @memberof AppDepartmentPersonnel
*/
public
fillLabel
(
tempObject
:
any
,
valueItem
:
Array
<
any
>
,
callback
:
any
){
if
(
tempObject
.
label
.
length
===
0
&&
tempObject
.
id
.
length
>
0
&&
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
&&
valueItem
.
length
>
0
){
let
tempLabel
:
Array
<
any
>
=
[];
valueItem
.
forEach
((
value
:
any
)
=>
{
let
result
:
any
=
items
.
find
((
item
:
any
)
=>
{
return
item
.
id
===
value
;
})
tempLabel
.
push
(
result
.
label
);
})
Object
.
assign
(
tempObject
,{
label
:
tempLabel
});
}
callback
(
tempObject
);
}).
catch
((
error
:
any
)
=>
{
console
.
log
(
error
);
})
}
}
/**
* 打开选择视图
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
openView
()
{
const
view
:
any
=
{
viewname
:
'app-group-picker'
,
title
:
(
this
.
$t
(
'components.appGroupSelect.groupSelect'
)
as
string
)
};
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
this
.
getDepertmentId
();
const
param
:
any
=
{};
Object
.
assign
(
param
,
{
showtree
:
this
.
treeurl
?
true
:
false
,
url
:
this
.
url
,
treeurl
:
this
.
treeurl
,
filtervalue
:
this
.
filtervalue
,
multiple
:
this
.
multiple
,
selects
:
this
.
selects
,
selectType
:
'dept'
,
});
let
container
:
Subject
<
any
>
=
this
.
$appmodal
.
openModal
(
view
,
context
,
param
);
container
.
subscribe
((
result
:
any
)
=>
{
if
(
!
result
||
!
Object
.
is
(
result
.
ret
,
'OK'
))
{
return
;
}
this
.
openViewClose
(
result
);
});
}
/**
* 选择视图关闭
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
openViewClose
(
result
:
any
)
{
this
.
selects
=
[];
this
.
selectsLabel
=
[];
if
(
result
.
datas
&&
result
.
datas
.
length
>
0
)
{
this
.
selects
=
result
.
datas
;
if
(
this
.
selects
.
length
>
0
){
this
.
selects
.
forEach
((
select
:
any
)
=>
{
this
.
selectsLabel
.
push
(
select
.
label
)
})
}
}
this
.
setValue
();
}
/**
* 选中项发生变化时
*
* @type {*}
* @memberof AppDepartmentPersonnel
*/
public
change
(
$event
:
any
)
{
this
.
selects
=
[];
if
(
this
.
multiple
){
if
(
$event
.
length
>
0
){
$event
.
forEach
((
select
:
any
)
=>
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
select
));
if
(
index
>=
0
)
{
this
.
selects
.
push
(
this
.
items
[
index
]);
}
});
}
}
else
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
$event
));
if
(
index
>=
0
)
{
this
.
selects
.
push
(
this
.
items
[
index
]);
}
}
this
.
setValue
();
}
/**
* 设置值
*
* @type {*}
* @memberof AppGroupSelect
*/
public
setValue
()
{
let
item
:
any
=
{};
item
[
this
.
name
]
=
null
;
if
(
this
.
valueitem
)
{
item
[
this
.
valueitem
]
=
null
;
}
if
(
this
.
fillmap
)
{
for
(
let
key
in
this
.
fillmap
)
{
item
[
key
]
=
null
;
}
}
if
(
this
.
multiple
)
{
this
.
selects
.
forEach
((
select
:
any
)
=>
{
item
[
this
.
name
]
=
item
[
this
.
name
]
?
`
${
item
[
this
.
name
]}
,
${
select
.
label
}
`
:
select
.
label
;
if
(
this
.
valueitem
)
{
item
[
this
.
valueitem
]
=
item
[
this
.
valueitem
]
?
`
${
item
[
this
.
valueitem
]}
,
${
select
.
id
}
`
:
select
.
id
;
}
if
(
this
.
fillmap
)
{
for
(
let
key
in
this
.
fillmap
)
{
item
[
key
]
=
item
[
key
]
?
`
${
item
[
key
]}
,
${
select
[
this
.
fillmap
[
key
]]}
`
:
select
[
this
.
fillmap
[
key
]];
}
}
});
}
else
{
item
[
this
.
name
]
=
this
.
selects
.
length
>
0
?
this
.
selects
[
0
].
label
:
null
;
if
(
this
.
valueitem
)
{
item
[
this
.
valueitem
]
=
this
.
selects
.
length
>
0
?
this
.
selects
[
0
].
id
:
null
;
}
if
(
this
.
fillmap
)
{
for
(
let
key
in
this
.
fillmap
)
{
item
[
key
]
=
this
.
selects
.
length
>
0
?
this
.
selects
[
0
][
this
.
fillmap
[
key
]]
:
null
;
}
}
}
for
(
let
key
in
item
)
{
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
key
,
value
:
item
[
key
]
});
}
}
}
</
script
>
<
style
lang=
"less"
>
.app-department-personnel{
position: relative;
.el-icon-search{
position: absolute;
top: 10px;
right: 27px;
color: #c0c4cc;
}
}
</
style
>
\ No newline at end of file
src/components/app-group-picker/app-group-picker.vue
浏览文件 @
b88174be
...
...
@@ -176,7 +176,12 @@ export default class AppGroupPicker extends Vue {
*/
public
loadTree
()
{
let
orgid
=
this
.
viewParam
.
filtervalue
;
let
tempTreeUrl
:
string
=
this
.
treeurl
.
replace
(
'${orgid}'
,
orgid
);
let
tempTreeUrl
:
string
=
''
;
if
(
this
.
viewParam
.
selectTyep
==
'org'
){
tempTreeUrl
=
this
.
treeurl
.
replace
(
'${orgid}'
,
orgid
);
}
else
if
(
this
.
viewParam
.
selectTyep
==
'dept'
){
tempTreeUrl
=
this
.
treeurl
.
replace
(
'{deptId}'
,
orgid
);
}
let
get
=
Http
.
getInstance
().
get
(
tempTreeUrl
,
true
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
.
status
===
200
)
{
...
...
@@ -194,7 +199,12 @@ export default class AppGroupPicker extends Vue {
* @memberof AppGroupPicker
*/
public
loadGroupData
(
key
:
string
)
{
let
tempUrl
=
this
.
url
.
replace
(
'${selected-orgid}'
,
key
);
let
tempUrl
:
string
=
''
;
if
(
Object
.
is
(
this
.
viewParam
.
selectType
,
"org"
)){
tempUrl
=
this
.
url
.
replace
(
'${selected-orgid}'
,
key
);
}
else
if
(
Object
.
is
(
this
.
viewParam
.
selectType
,
"dept"
)){
tempUrl
=
this
.
url
.
replace
(
'{deptId}'
,
key
);
}
let
get
=
Http
.
getInstance
().
get
(
tempUrl
,
true
);
get
.
then
((
response
:
any
)
=>
{
if
(
response
.
status
===
200
)
{
...
...
src/components/app-group-select/app-group-select.vue
浏览文件 @
b88174be
...
...
@@ -147,9 +147,7 @@ export default class AppGroupSelect extends Vue {
if
(
newVal
)
{
let
item
:
any
=
{};
item
.
label
=
this
.
data
[
this
.
name
]?
this
.
data
[
this
.
name
].
split
(
','
):[];
if
(
this
.
valueitem
)
{
item
.
id
=
this
.
data
[
this
.
valueitem
]
?
this
.
data
[
this
.
valueitem
].
split
(
','
)
:
[];
}
item
.
id
=
this
.
data
[
this
.
valueitem
]
?
this
.
data
[
this
.
valueitem
].
split
(
','
)
:
[];
if
(
this
.
fillmap
)
{
for
(
let
key
in
this
.
fillmap
)
{
item
[
this
.
fillmap
[
key
]]
=
this
.
data
[
key
]
?
this
.
data
[
key
].
split
(
','
)
:
[];
...
...
@@ -219,7 +217,8 @@ export default class AppGroupSelect extends Vue {
treeurl
:
this
.
treeurl
,
filtervalue
:
filtervalue
,
multiple
:
this
.
multiple
,
selects
:
this
.
selects
selects
:
this
.
selects
,
selectTpye
:
'org'
});
let
container
:
Subject
<
any
>
=
this
.
$appmodal
.
openModal
(
view
,
context
,
param
);
container
.
subscribe
((
result
:
any
)
=>
{
...
...
src/store/getters.ts
浏览文件 @
b88174be
/**
* 获取代码表对象
*
* @param state
*/
export
const
getDepartmentPersonnel
=
(
state
:
any
)
=>
()
=>
{
return
state
.
departmentPersonnel
;
}
/**
* 获取代码表对象
*
...
...
src/store/mutations.ts
浏览文件 @
b88174be
import
{
Environment
}
from
'@/environments/environment'
;
/**
* 添加部门成员
*
* @param state
* @param codelists
*/
export
const
addDepartmentPersonnel
=
(
state
:
any
,
departmentPersonnel
:
Array
<
any
>
)
=>
{
state
.
departmentPersonnel
=
[];
state
.
departmentPersonnel
=
[...
departmentPersonnel
];
}
/**
* 添加代码表
*
...
...
@@ -98,10 +109,7 @@ export const addPage = (state: any, arg: any) => {
if
(
!
arg
)
{
return
;
}
// 视图类型为REDIRECTVIEW和NOTAB的视图不添加缓存
if
(
Object
.
is
(
arg
.
meta
.
viewType
,
'REDIRECTVIEW'
)
||
Object
.
is
(
arg
.
meta
.
viewType
,
'NOTAB'
)){
return
;
}
else
if
(
Object
.
is
(
arg
.
meta
.
viewType
,
'APPINDEX'
))
{
if
(
Object
.
is
(
arg
.
meta
.
viewType
,
'APPINDEX'
))
{
window
.
sessionStorage
.
setItem
(
Environment
.
AppName
,
arg
.
fullPath
);
}
else
{
const
page
:
any
=
{};
...
...
src/store/state.ts
浏览文件 @
b88174be
...
...
@@ -7,6 +7,7 @@ export const rootstate: any = {
pageMetas
:
[],
historyPathList
:
[],
codelists
:
[],
departmentPersonnel
:[],
selectTheme
:
''
,
selectFont
:
''
,
appdata
:
''
,
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录