Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
9a3a41e2
提交
9a3a41e2
编写于
12月 22, 2020
作者:
hudan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增部门指定单位--fix1
上级
f6476768
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
140 行删除
+24
-140
app-mob-department-select.less
.../app-mob-department-select/app-mob-department-select.less
+10
-4
app-mob-department-select.vue
...s/app-mob-department-select/app-mob-department-select.vue
+14
-136
未找到文件。
src/components/app-mob-department-select/app-mob-department-select.less
浏览文件 @
9a3a41e2
...
@@ -2,13 +2,19 @@
...
@@ -2,13 +2,19 @@
width: 100%;
width: 100%;
.checkField {
.checkField {
position: relative;
position: relative;
.has-value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-word;
}
}
}
.icon {
.icon {
position:absolute;
position:absolute;
top: 2px;
top:
1
2px;
right: 0;
right: 0
px
;
width:
20
px;
width:
18
px;
height:
20px
;
height:
100%
;
}
}
.ivu-dropdown{
.ivu-dropdown{
.ivu-dropdown-rel{
.ivu-dropdown-rel{
...
...
src/components/app-mob-department-select/app-mob-department-select.vue
浏览文件 @
9a3a41e2
<
template
>
<
template
>
<div
class=
"app-mob-department-select"
>
<div
class=
"app-mob-department-select"
>
<div
class=
"checkField"
>
<div
class=
"checkField"
>
<ion-input
:disabled=
"disabled"
:value=
"curValue"
readonly
@
click=
"openModal"
>
<ion-input
:disabled=
"disabled"
:value=
"curValue"
readonly
@
click=
"openModal"
>
</ion-input>
<div
class=
"icon"
>
<div
class=
"icon"
>
<svg
t=
"1608543874255"
class=
"icon"
viewBox=
"0 0 1165 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2970"
width=
"200"
height=
"200"
><path
d=
"M1107.30913719 909.45959375l-186.86323313-145.37686875a479.97811781 479.97811781 0 1 0-69.42107062 87.6783975q13.80107531-13.80107531 26.30518125-28.51668l185.08405875 143.96350594a36.58116281 36.58116281 0 1 0 44.89506375-57.73172719z m-594.79308657 9.37807969c-223.66055812 0-405.63521719-181.95803156-405.63521718-405.63521719S288.80560906 107.56723906 512.46616719 107.56723906 918.10138437 289.59178156 918.10138437 513.20245625 736.14335281 918.83767344 512.46616719 918.83767344z"
fill=
"#474747"
p-id=
"2971"
></path></svg
>
<ion-icon
name=
"search-outline"
></ion-icon
>
</div>
</div>
</ion-input>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -175,128 +175,17 @@ export default class AppMobDepartmentSelect extends Vue {
...
@@ -175,128 +175,17 @@ export default class AppMobDepartmentSelect extends Vue {
@
Watch
(
'data'
,{
immediate
:
true
,
deep
:
true
})
@
Watch
(
'data'
,{
immediate
:
true
,
deep
:
true
})
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
if
(
newVal
){
this
.
computedSelectedData
();
//
this.computedSelectedData();
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
searchNodesData
();
this
.
searchNodesData
();
});
});
}
}
}
}
/**
* 计算选中值
*
* @memberof AppOrgSelect
*/
public
computedSelectedData
(){
// 单选
if
(
!
this
.
multiple
){
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
let
templateValue
:
any
=
{};
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
if
(
this
.
data
&&
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
]);
}
}
}
else
{
// 多选
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
let
tempArray
:
Array
<
any
>
=
[];
Object
.
keys
(
this
.
fillMap
).
forEach
((
item
:
any
)
=>
{
if
(
this
.
data
&&
this
.
data
[
this
.
fillMap
[
item
]]){
let
tempDataArray
:
Array
<
any
>
=
(
this
.
data
[
this
.
fillMap
[
item
]]).
split
(
","
);
tempDataArray
.
forEach
((
tempData
:
any
,
index
:
number
)
=>
{
if
(
tempArray
.
length
<
tempDataArray
.
length
){
let
singleData
:
any
=
{[
item
]:
tempData
};
tempArray
.
push
(
singleData
);
}
else
{
Object
.
assign
(
tempArray
[
index
],{[
item
]:
tempData
});
}
})
}
})
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
);
}
}
}
}
/**
* select事件处理
*
* @param {*} $event
* @memberof AppMobDepartmentSelect
*/
public
onSelect
(
$event
:
any
){
// 组件自身抛值事件
let
selectArr
=
JSON
.
parse
(
$event
);
// fillMap抛值事件
if
(
this
.
fillMap
&&
Object
.
keys
(
this
.
fillMap
).
length
>
0
){
Object
.
keys
(
this
.
fillMap
).
forEach
((
attribute
:
string
)
=>
{
let
_name
=
this
.
fillMap
[
attribute
];
let
values
=
selectArr
.
map
((
item
:
any
)
=>
item
[
attribute
]);
let
_value
=
$event
===
"[]"
?
null
:
values
.
join
(
","
);
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
);
})
}
}
/**
/**
* 打开模态
* 打开模态
*
*
* @memberof App
Org
Select
* @memberof App
MobDepartment
Select
*/
*/
public
async
openModal
(){
public
async
openModal
(){
const
view
:
any
=
{
const
view
:
any
=
{
...
@@ -304,22 +193,10 @@ export default class AppMobDepartmentSelect extends Vue {
...
@@ -304,22 +193,10 @@ export default class AppMobDepartmentSelect extends Vue {
title
:
(
this
.
$t
(
'components.AppMobGroupSelect.groupSelect'
)
as
string
)
title
:
(
this
.
$t
(
'components.AppMobGroupSelect.groupSelect'
)
as
string
)
};
};
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
const
context
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
let
filtervalue
:
string
=
""
;
if
(
this
.
filter
){
if
(
this
.
data
[
this
.
filter
]){
filtervalue
=
this
.
data
[
this
.
filter
];
}
else
if
(
context
[
this
.
filter
]){
filtervalue
=
context
[
this
.
filter
];
}
else
{
filtervalue
=
context
.
srforgid
;
}
}
else
{
filtervalue
=
context
.
srforgid
;
}
const
param
:
any
=
{};
const
param
:
any
=
{};
Object
.
assign
(
param
,
{
Object
.
assign
(
param
,
{
selectTreeValue
:
this
.
selectTreeValue
,
selectTreeValue
:
this
.
selectTreeValue
,
multiple
:
this
.
multiple
,
multiple
:
this
.
multiple
,
nodesData
:
this
.
Nodesdata
nodesData
:
this
.
Nodesdata
});
});
let
container
:
any
=
await
this
.
$appmodal
.
openModal
(
view
,
context
,
param
);
let
container
:
any
=
await
this
.
$appmodal
.
openModal
(
view
,
context
,
param
);
...
@@ -329,17 +206,18 @@ export default class AppMobDepartmentSelect extends Vue {
...
@@ -329,17 +206,18 @@ export default class AppMobDepartmentSelect extends Vue {
/**
/**
* 模态关闭
* 模态关闭
*
*
* @memberof App
Org
Select
* @memberof App
MobDepartment
Select
*/
*/
public
closeModal
(
result
:
any
)
{
public
closeModal
(
result
:
any
)
{
let
checkValue
:
any
[]
=
[];
let
checkValue
:
any
[]
=
[];
result
.
datas
.
forEach
((
item
:
any
)
=>
{
result
.
datas
.
forEach
((
item
:
any
)
=>
{
checkValue
.
push
(
item
.
label
);
checkValue
.
push
(
item
.
label
);
})
})
this
.
curValue
=
checkValue
.
join
(
','
);
this
.
selectTreeValue
=
JSON
.
stringify
(
result
.
datas
);
this
.
$emit
(
'select-change'
,{
name
:
this
.
fillMap
.
label
,
value
:
this
.
curValue
});
this
.
curValue
=
checkValue
==
[]?
''
:
checkValue
.
join
(
','
);
let
_value
=
checkValue
==
[]?
null
:
checkValue
.
join
(
','
);
this
.
$emit
(
'select-change'
,{
"name"
:
this
.
fillMap
.
label
,
"value"
:
_value
});
}
}
}
}
</
script
>
</
script
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录