Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
e46c7331
提交
e46c7331
编写于
9月 08, 2020
作者:
ShineKOT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
部门人员选择器BUG修复
上级
7b841b8b
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
app-department-personnel.vue
...nts/app-department-personnel/app-department-personnel.vue
+8
-8
未找到文件。
src/components/app-department-personnel/app-department-personnel.vue
浏览文件 @
e46c7331
<
template
>
<
template
>
<div
class=
"app-department-personnel"
>
<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-select
:multiple=
"multiple"
:transfer=
"true"
transfer-class-name=
"app-department-personnel-select"
:value
=
"selectsLabel"
:disabled=
"disabled"
:clearable=
"true"
@
on-open-change=
"onClick"
@
on-change=
"change"
>
<i-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item.id"
:label=
"item.label"
>
<i-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item.id"
:label=
"item.label"
>
{{
item
.
label
}}
{{
item
.
label
}}
</i-option>
</i-option>
...
@@ -243,7 +243,7 @@ export default class AppDepartmentPersonnel extends Vue {
...
@@ -243,7 +243,7 @@ export default class AppDepartmentPersonnel extends Vue {
* @memberof AppDepartmentPersonnel
* @memberof AppDepartmentPersonnel
*/
*/
@
Watch
(
'data'
,{
immediate
:
true
,
deep
:
true
})
@
Watch
(
'data'
,{
immediate
:
true
,
deep
:
true
})
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
selects
=
[];
this
.
selects
=
[];
this
.
selectsLabel
=
[];
this
.
selectsLabel
=
[];
if
(
newVal
)
{
if
(
newVal
)
{
...
@@ -262,11 +262,11 @@ export default class AppDepartmentPersonnel extends Vue {
...
@@ -262,11 +262,11 @@ export default class AppDepartmentPersonnel extends Vue {
_item
[
key
]
=
item
[
key
][
index
]
?
item
[
key
][
index
]
:
null
;
_item
[
key
]
=
item
[
key
][
index
]
?
item
[
key
][
index
]
:
null
;
}
}
this
.
selects
.
push
(
_item
);
this
.
selects
.
push
(
_item
);
let
i
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
_item
.
label
));
let
i
=
this
.
items
.
findIndex
((
select
:
any
)
=>
Object
.
is
(
select
.
id
,
_item
.
id
));
if
(
i
<
0
){
if
(
i
<
0
){
this
.
items
.
push
(
_item
);
this
.
items
.
push
(
_item
);
}
}
this
.
selectsLabel
.
push
(
_item
.
label
);
this
.
selectsLabel
.
push
(
_item
.
id
);
})
})
}
}
if
(
item
.
label
.
length
==
0
&&
item
.
id
.
length
>
0
){
if
(
item
.
label
.
length
==
0
&&
item
.
id
.
length
>
0
){
...
@@ -350,11 +350,11 @@ export default class AppDepartmentPersonnel extends Vue {
...
@@ -350,11 +350,11 @@ export default class AppDepartmentPersonnel extends Vue {
this
.
selectsLabel
=
[];
this
.
selectsLabel
=
[];
this
.
selects
=
[...
result
.
datas
];
this
.
selects
=
[...
result
.
datas
];
this
.
selects
.
forEach
((
select
:
any
)
=>
{
this
.
selects
.
forEach
((
select
:
any
)
=>
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
select
.
label
));
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
id
,
select
.
id
));
if
(
index
<
0
){
if
(
index
<
0
){
this
.
items
.
push
(
select
);
this
.
items
.
push
(
select
);
}
}
this
.
selectsLabel
.
push
(
select
.
label
);
this
.
selectsLabel
.
push
(
select
.
id
);
});
});
}
}
this
.
setValue
();
this
.
setValue
();
...
@@ -371,14 +371,14 @@ export default class AppDepartmentPersonnel extends Vue {
...
@@ -371,14 +371,14 @@ export default class AppDepartmentPersonnel extends Vue {
if
(
this
.
multiple
){
if
(
this
.
multiple
){
if
(
$event
.
length
>
0
){
if
(
$event
.
length
>
0
){
$event
.
forEach
((
select
:
any
)
=>
{
$event
.
forEach
((
select
:
any
)
=>
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
select
));
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
id
,
select
));
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
this
.
selects
.
push
(
this
.
items
[
index
]);
this
.
selects
.
push
(
this
.
items
[
index
]);
}
}
});
});
}
}
}
else
{
}
else
{
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
label
,
$event
));
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
.
id
,
$event
));
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
this
.
selects
.
push
(
this
.
items
[
index
]);
this
.
selects
.
push
(
this
.
items
[
index
]);
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录