Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
supervise-wecom
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1f2a4dd1
authored
Jun 03, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: regionPicker 设置默认值
1 parent
f5f7d599
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
src/components/regionPicker/index.vue
src/components/regionPicker/index.vue
View file @
1f2a4dd
<
template
>
<van-action-sheet
:close-on-click-action=
"false"
<van-action-sheet
get-container=
"body"
:close-on-click-action=
"false"
:close-on-click-overlay=
"false"
:closeable=
"false"
:title=
"title"
:value=
"visible"
@
closed=
"handleClosed"
@
input=
"updateVisible"
>
...
...
@@ -50,9 +54,18 @@
</
template
>
<
script
>
import
{
ActionSheet
}
from
"vant"
;
export
default
{
name
:
"RegionPicker"
,
components
:
{
[
ActionSheet
.
name
]:
ActionSheet
,
},
props
:
{
title
:
{
type
:
String
,
default
:
"门店区域"
,
},
value
:
{
type
:
[
String
,
Number
],
default
:
""
,
...
...
@@ -73,11 +86,11 @@ export default {
},
labelKey
:
{
type
:
String
,
default
:
"
name
"
,
default
:
"
label
"
,
},
valueKey
:
{
type
:
String
,
default
:
"
cod
e"
,
default
:
"
valu
e"
,
},
},
data
()
{
...
...
@@ -124,6 +137,8 @@ export default {
visible
:
{
immediate
:
true
,
handler
(
val
)
{
console
.
log
(
val
);
if
(
val
)
{
this
.
initPanelState
();
}
...
...
@@ -152,8 +167,9 @@ export default {
return
this
.
normalizedOptions
.
find
(
item
=>
item
.
value
===
value
)
||
null
;
},
handleSelect
(
item
)
{
this
.
tempValue
=
item
.
value
;
this
.
$emit
(
"select"
,
item
);
const
isSameRegion
=
this
.
tempValue
===
item
.
value
;
this
.
tempValue
=
isSameRegion
?
""
:
item
.
value
;
this
.
$emit
(
"select"
,
isSameRegion
?
null
:
item
);
},
handleCancel
()
{
this
.
keyword
=
""
;
...
...
@@ -184,6 +200,16 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.van-action-sheet
{
&__header
{
font-weight
:
500
;
font-size
:
16px
;
line-height
:
20px
;
text-align
:
center
;
color
:
#000000
e5
;
padding
:
16px
;
}
}
.region-sheet
{
display
:
flex
;
flex-direction
:
column
;
...
...
@@ -191,13 +217,15 @@ export default {
background
:
#ffffff
;
&__search
{
padding
:
12px
12px
0
;
::v-deep
.van-search
{
padding
:
12px
16px
4px
!important
;
}
}
&
__list
{
flex
:
1
;
overflow-y
:
auto
;
padding
:
8px
12px
16
px
;
padding
:
0px
16px
12
px
;
}
&
__item
{
...
...
@@ -231,8 +259,7 @@ export default {
&
__footer
{
display
:
flex
;
column-gap
:
12px
;
padding
:
12px
;
border-top
:
1px
solid
#f2f3f5
;
padding
:
8px
16px
;
}
&
__button
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment