Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
total-platform
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
物业总平台
total-platform
Commits
d077ec73
提交
d077ec73
authored
11月 21, 2022
作者:
zhangdaiscott
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【issues/4213】JSearchSelectTag改造支持多选
上级
417bdd44
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
80 行增加
和
1 行删除
+80
-1
JSearchSelectTag.vue
src/components/dict/JSearchSelectTag.vue
+54
-1
SelectDemo.vue
src/views/jeecg/SelectDemo.vue
+26
-0
没有找到文件。
src/components/dict/JSearchSelectTag.vue
浏览文件 @
d077ec73
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
@
change=
"handleAsyncChange"
@
change=
"handleAsyncChange"
allowClear
allowClear
:notFoundContent=
"loading ? undefined : null"
:notFoundContent=
"loading ? undefined : null"
:mode=
"mode"
>
>
<a-spin
v-if=
"loading"
slot=
"notFoundContent"
size=
"small"
/>
<a-spin
v-if=
"loading"
slot=
"notFoundContent"
size=
"small"
/>
<a-select-option
v-for=
"d in options"
:key=
"d.value"
:value=
"d.value"
>
{{
d
.
text
}}
</a-select-option>
<a-select-option
v-for=
"d in options"
:key=
"d.value"
:value=
"d.value"
>
{{
d
.
text
}}
</a-select-option>
...
@@ -31,7 +32,8 @@
...
@@ -31,7 +32,8 @@
:filterOption=
"filterOption"
:filterOption=
"filterOption"
v-model=
"selectedValue"
v-model=
"selectedValue"
allowClear
allowClear
:notFoundContent=
"loading ? undefined : null"
>
:notFoundContent=
"loading ? undefined : null"
:mode=
"mode"
>
<a-spin
v-if=
"loading"
slot=
"notFoundContent"
size=
"small"
/>
<a-spin
v-if=
"loading"
slot=
"notFoundContent"
size=
"small"
/>
<a-select-option
v-for=
"d in options"
:key=
"d.value"
:value=
"d.value"
>
{{
d
.
text
}}
</a-select-option>
<a-select-option
v-for=
"d in options"
:key=
"d.value"
:value=
"d.value"
>
{{
d
.
text
}}
</a-select-option>
</a-select>
</a-select>
...
@@ -74,6 +76,10 @@
...
@@ -74,6 +76,10 @@
type
:
Function
,
type
:
Function
,
default
:
null
default
:
null
},
},
mode
:{
type
:
String
,
default
:
''
,
},
},
},
data
(){
data
(){
this
.
loadData
=
debounce
(
this
.
loadData
,
800
);
//消抖
this
.
loadData
=
debounce
(
this
.
loadData
,
800
);
//消抖
...
@@ -135,17 +141,48 @@
...
@@ -135,17 +141,48 @@
//update-end-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
//update-end-author:taoyan date:20220112 for: 方法initSelectValue 根据下拉框实际值查询下拉框的显示的文本 因后台接口只处理3个参数,所以将过滤条件去掉
getAction
(
`/sys/dict/loadDictItem/
${
itemDictStr
}
`
,{
key
:
this
.
value
}).
then
(
res
=>
{
getAction
(
`/sys/dict/loadDictItem/
${
itemDictStr
}
`
,{
key
:
this
.
value
}).
then
(
res
=>
{
if
(
res
.
success
){
if
(
res
.
success
){
//update-begin---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
//判断是否多选
if
(
this
.
mode
===
'multiple'
){
if
(
res
.
result
&&
res
.
result
.
length
>
0
){
let
itemArray
=
[];
let
valueArray
=
this
.
value
.
split
(
","
)
for
(
let
i
=
0
;
i
<
res
.
result
.
length
;
i
++
)
{
itemArray
.
push
({
key
:
valueArray
[
i
],
label
:
res
.
result
[
i
]
})
}
this
.
selectedAsyncValue
=
itemArray
}
else
{
this
.
selectedAsyncValue
=
[]
this
.
selectedValue
=
[]
}
}
else
{
let
obj
=
{
let
obj
=
{
key
:
this
.
value
,
key
:
this
.
value
,
label
:
res
.
result
label
:
res
.
result
}
}
this
.
selectedAsyncValue
=
{...
obj
}
this
.
selectedAsyncValue
=
{...
obj
}
}
}
//update-end---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选--------------
}
})
})
}
}
}
else
{
//update-begin---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
//判断是否为多选
if
(
this
.
mode
===
'multiple'
){
if
(
this
.
value
){
this
.
selectedValue
=
this
.
value
.
split
(
","
);
}
else
{
this
.
selectedValue
=
[]
}
}
else
{
}
else
{
this
.
selectedValue
=
this
.
value
.
toString
()
this
.
selectedValue
=
this
.
value
.
toString
()
}
}
//update-end---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
}
},
},
loadData
(
value
){
loadData
(
value
){
console
.
log
(
"数据加载"
,
value
)
console
.
log
(
"数据加载"
,
value
)
...
@@ -228,7 +265,17 @@
...
@@ -228,7 +265,17 @@
//update-begin-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
//update-begin-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
if
(
selectedObj
){
if
(
selectedObj
){
this
.
selectedAsyncValue
=
selectedObj
this
.
selectedAsyncValue
=
selectedObj
//update-begin---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
if
(
this
.
mode
===
'multiple'
){
let
keyArray
=
[]
for
(
let
i
=
0
;
i
<
selectedObj
.
length
;
i
++
)
{
keyArray
.
push
(
selectedObj
[
i
].
key
)
}
this
.
selectedValue
=
keyArray
}
else
{
this
.
selectedValue
=
selectedObj
.
key
this
.
selectedValue
=
selectedObj
.
key
}
//update-end---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
}
else
{
}
else
{
this
.
selectedAsyncValue
=
null
this
.
selectedAsyncValue
=
null
this
.
selectedValue
=
null
this
.
selectedValue
=
null
...
@@ -239,7 +286,13 @@
...
@@ -239,7 +286,13 @@
//update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
//update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
},
},
callback
(){
callback
(){
//update-begin---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
if
(
this
.
mode
===
'multiple'
){
this
.
$emit
(
'change'
,
this
.
selectedValue
.
join
(
","
));
}
else
{
this
.
$emit
(
'change'
,
this
.
selectedValue
);
this
.
$emit
(
'change'
,
this
.
selectedValue
);
}
//update-end---author:wangshuai ---date:20221115 for:[issues/4213]JSearchSelectTag改造支持多选------------
},
},
setCurrentDictOptions
(
dictOptions
){
setCurrentDictOptions
(
dictOptions
){
this
.
options
=
dictOptions
this
.
options
=
dictOptions
...
...
src/views/jeecg/SelectDemo.vue
浏览文件 @
d077ec73
...
@@ -56,6 +56,16 @@
...
@@ -56,6 +56,16 @@
</a-col>
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
searchValue
}}
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
searchValue
}}
</a-col>
</a-row>
</a-row>
<!-- 字典搜索多选 -->
<a-row
:gutter=
"24"
>
<a-col
:span=
"12"
>
<a-form-model-item
label=
"字典搜索多选(同步)"
prop=
"searchMultipleValue"
>
<j-search-select-tag
placeholder=
"请做出你的选择"
v-model=
"formData.searchMultipleValue"
:dictOptions=
"searchOptions"
mode=
"multiple"
>
</j-search-select-tag>
</a-form-model-item>
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
searchMultipleValue
}}
</a-col>
</a-row>
<!-- 字典搜索 异步加载 -->
<!-- 字典搜索 异步加载 -->
<a-row
:gutter=
"24"
>
<a-row
:gutter=
"24"
>
...
@@ -72,6 +82,22 @@
...
@@ -72,6 +82,22 @@
</a-col>
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
asyncSelectValue
}}
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
asyncSelectValue
}}
</a-col>
</a-row>
</a-row>
<!-- 字典搜索多选 异步加载 -->
<a-row
:gutter=
"24"
>
<a-col
:span=
"12"
>
<a-form-model-item
label=
"字典搜索多选(异步)"
prop=
"asyncMultipleValue"
>
<j-search-select-tag
placeholder=
"请做出你的选择"
v-model=
"formData.asyncMultipleValue"
dict=
"sys_depart,depart_name,id"
:pageSize=
"6"
:async=
"true"
mode=
"multiple"
>
</j-search-select-tag>
</a-form-model-item>
</a-col>
<a-col
:span=
"12"
>
选中值:
{{
formData
.
asyncMultipleValue
}}
</a-col>
</a-row>
<!-- JMultiSelectTag -->
<!-- JMultiSelectTag -->
<a-row
:gutter=
"24"
>
<a-row
:gutter=
"24"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论