Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c33e4de5
authored
Apr 10, 2023
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 抽离组件【公众号下拉选择】
parent
521b521d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
src/views/mp/components/wx-account-select/main.vue
+44
-0
No files found.
src/views/mp/components/wx-account-select/main.vue
0 → 100644
View file @
c33e4de5
<
template
>
<el-form
class=
"-mb-15px"
ref=
"queryFormRef"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"公众号"
prop=
"accountId"
>
<el-select
v-model=
"accountId"
placeholder=
"请选择公众号"
class=
"!w-240px"
@
change=
"accountChanged()"
>
<el-option
v-for=
"item in accountList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<slot
name=
"actions"
></slot>
</el-form-item>
</el-form>
</
template
>
<
script
setup
name=
"WxAccountSelect"
>
import
*
as
MpAccountApi
from
'@/api/mp/account'
const
accountId
=
ref
()
const
accountList
=
ref
([])
const
queryFormRef
=
ref
()
const
emit
=
defineEmits
([
'change'
])
onMounted
(
async
()
=>
{
handleQuery
()
})
const
handleQuery
=
async
()
=>
{
const
data
=
await
MpAccountApi
.
getSimpleAccountList
()
accountList
.
value
=
data
// 默认选中第一个
if
(
accountList
.
value
.
length
>
0
)
{
accountId
.
value
=
accountList
.
value
[
0
].
id
emit
(
'change'
,
accountId
.
value
)
}
}
const
accountChanged
=
()
=>
{
emit
(
'change'
,
accountId
.
value
)
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment