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
dc32b924
authored
Apr 14, 2023
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 删除WxAccountSelect
parent
92da7e34
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
61 deletions
+17
-61
src/views/mp/components/WxMpSelect.vue
+0
-36
src/views/mp/components/wx-account-select/main.vue
+15
-23
src/views/mp/message/index.vue
+2
-2
No files found.
src/views/mp/components/WxMpSelect.vue
deleted
100644 → 0
View file @
92da7e34
<
template
>
<el-select
v-model=
"account.id"
placeholder=
"请选择公众号"
class=
"!w-240px"
@
change=
"onChanged"
>
<el-option
v-for=
"item in accountList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</
template
>
<!-- TODO @芋艿:WxMpSelect 改成 WxAccountSelect,然后挪到现有的 wx-account-select 包下 -->
<
script
lang=
"ts"
setup
name=
"WxMpSelect"
>
import
*
as
MpAccountApi
from
'@/api/mp/account'
const
account
:
MpAccountApi
.
AccountVO
=
reactive
({
id
:
undefined
,
name
:
''
})
const
accountList
:
Ref
<
MpAccountApi
.
AccountVO
[]
>
=
ref
([])
const
emit
=
defineEmits
<
{
(
e
:
'change'
,
id
?:
number
,
name
?:
string
):
void
}
>
()
onMounted
(()
=>
{
handleQuery
()
})
const
handleQuery
=
async
()
=>
{
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
// 默认选中第一个
if
(
accountList
.
value
.
length
>
0
)
{
account
.
id
=
accountList
.
value
[
0
].
id
emit
(
'change'
,
account
.
id
,
account
.
name
)
}
}
const
onChanged
=
()
=>
{
emit
(
'change'
,
account
.
id
,
account
.
name
)
}
</
script
>
src/views/mp/components/wx-account-select/main.vue
View file @
dc32b924
<
template
>
<
template
>
<el-form
class=
"-mb-15px"
ref=
"queryFormRef"
:inline=
"true"
label-width=
"68px"
>
<el-select
v-model=
"account.id"
placeholder=
"请选择公众号"
class=
"!w-240px"
@
change=
"onChanged"
>
<el-form-item
label=
"公众号"
prop=
"accountId"
>
<!-- TODO 芋艿:需要将 el-form 和 el-select 解耦 -->
<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-option
v-for=
"item in accountList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-select>
</el-form-item>
<el-form-item>
<slot
name=
"actions"
></slot>
</el-form-item>
</el-form>
</
template
>
</
template
>
<
script
setup
name=
"WxAccountSelect"
>
<
script
lang=
"ts"
setup
name=
"WxAccountSelect"
>
import
*
as
MpAccountApi
from
'@/api/mp/account'
import
*
as
MpAccountApi
from
'@/api/mp/account'
const
accountId
=
ref
()
const
accountList
=
ref
([])
const
queryFormRef
=
ref
()
const
emit
=
defineEmits
([
'change'
])
const
account
:
MpAccountApi
.
AccountVO
=
reactive
({
id
:
undefined
,
name
:
''
})
const
accountList
:
Ref
<
MpAccountApi
.
AccountVO
[]
>
=
ref
([])
const
emit
=
defineEmits
<
{
(
e
:
'change'
,
id
?:
number
,
name
?:
string
):
void
}
>
()
onMounted
(()
=>
{
onMounted
(()
=>
{
handleQuery
()
handleQuery
()
...
@@ -33,12 +25,12 @@ const handleQuery = async () => {
...
@@ -33,12 +25,12 @@ const handleQuery = async () => {
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
// 默认选中第一个
// 默认选中第一个
if
(
accountList
.
value
.
length
>
0
)
{
if
(
accountList
.
value
.
length
>
0
)
{
account
Id
.
value
=
accountList
.
value
[
0
].
id
account
.
id
=
accountList
.
value
[
0
].
id
emit
(
'change'
,
account
Id
.
valu
e
)
emit
(
'change'
,
account
.
id
,
account
.
nam
e
)
}
}
}
}
const
account
Changed
=
()
=>
{
const
on
Changed
=
()
=>
{
emit
(
'change'
,
account
Id
.
valu
e
)
emit
(
'change'
,
account
.
id
,
account
.
nam
e
)
}
}
</
script
>
</
script
>
src/views/mp/message/index.vue
View file @
dc32b924
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
label-width=
"68px"
label-width=
"68px"
>
>
<el-form-item
label=
"公众号"
prop=
"accountId"
>
<el-form-item
label=
"公众号"
prop=
"accountId"
>
<Wx
Mp
Select
@
change=
"onAccountChanged"
/>
<Wx
Account
Select
@
change=
"onAccountChanged"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"消息类型"
prop=
"type"
>
<el-form-item
label=
"消息类型"
prop=
"type"
>
<el-select
v-model=
"queryParams.type"
placeholder=
"请选择消息类型"
class=
"!w-240px"
>
<el-select
v-model=
"queryParams.type"
placeholder=
"请选择消息类型"
class=
"!w-240px"
>
...
@@ -203,7 +203,7 @@ import WxMsg from '@/views/mp/components/wx-msg/main.vue'
...
@@ -203,7 +203,7 @@ import WxMsg from '@/views/mp/components/wx-msg/main.vue'
import
WxLocation
from
'@/views/mp/components/wx-location/main.vue'
import
WxLocation
from
'@/views/mp/components/wx-location/main.vue'
import
WxMusic
from
'@/views/mp/components/wx-music/main.vue'
import
WxMusic
from
'@/views/mp/components/wx-music/main.vue'
import
WxNews
from
'@/views/mp/components/wx-news/main.vue'
import
WxNews
from
'@/views/mp/components/wx-news/main.vue'
import
Wx
MpSelect
from
'@/views/mp/components/WxMpSelect
.vue'
import
Wx
AccountSelect
from
'@/views/mp/components/wx-account-select/main
.vue'
import
*
as
MpMessageApi
from
'@/api/mp/message'
import
*
as
MpMessageApi
from
'@/api/mp/message'
import
{
DICT_TYPE
,
getStrDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getStrDictOptions
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
...
...
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