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
Unverified
Commit
0ceddc9c
authored
Apr 25, 2023
by
芋道源码
Committed by
Gitee
Apr 25, 2023
Browse files
Options
Browse Files
Download
Plain Diff
!137 MP模块重构,功能增强
Merge pull request !137 from dhb52/dev
parents
9680a204
88f45027
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
243 additions
and
118 deletions
+243
-118
src/api/mp/account/index.ts
+1
-1
src/views/mp/autoReply/index.vue
+6
-9
src/views/mp/components/wx-account-select/main.vue
+4
-3
src/views/mp/components/wx-msg/components/MsgEvent.vue
+51
-0
src/views/mp/components/wx-msg/components/MsgList.vue
+110
-0
src/views/mp/components/wx-msg/main.vue
+0
-0
src/views/mp/components/wx-msg/types.ts
+6
-0
src/views/mp/components/wx-music/main.vue
+2
-2
src/views/mp/draft/components/CoverSelect.vue
+3
-3
src/views/mp/draft/components/NewsForm.vue
+1
-1
src/views/mp/draft/index.vue
+10
-30
src/views/mp/freePublish/index.vue
+3
-7
src/views/mp/material/index.vue
+3
-8
src/views/mp/menu/components/MenuPreviewer.vue
+26
-18
src/views/mp/menu/index.vue
+2
-2
src/views/mp/message/index.vue
+5
-12
src/views/mp/statistics/index.vue
+2
-2
src/views/mp/tag/index.vue
+3
-8
src/views/mp/user/index.vue
+5
-12
No files found.
src/api/mp/account/index.ts
View file @
0ceddc9c
import
request
from
'@/config/axios'
export
interface
AccountVO
{
id
?
:
number
id
:
number
name
:
string
}
...
...
src/views/mp/autoReply/index.vue
View file @
0ceddc9c
...
...
@@ -103,6 +103,7 @@ import ReplyTable from './components/ReplyTable.vue'
import
{
MsgType
}
from
'./components/types'
const
message
=
useMessage
()
// 消息
const
accountId
=
ref
(
-
1
)
// 公众号ID
const
msgType
=
ref
<
MsgType
>
(
MsgType
.
Keyword
)
// 消息类型
const
RequestMessageTypes
=
[
'text'
,
'image'
,
'voice'
,
'video'
,
'shortvideo'
,
'location'
,
'link'
]
// 允许选择的请求消息类型
const
loading
=
ref
(
true
)
// 遮罩层
...
...
@@ -110,15 +111,10 @@ const total = ref(0) // 总条数
const
list
=
ref
<
any
[]
>
([])
// 自动回复列表
const
formRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 表单 ref
// 查询参数
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
accountId
:
accountId
})
const
dialogTitle
=
ref
(
''
)
// 弹出层标题
...
...
@@ -127,7 +123,7 @@ const replyForm = ref<any>({}) // 表单参数
// 回复消息
const
reply
=
ref
<
Reply
>
({
type
:
ReplyType
.
Text
,
accountId
:
0
accountId
:
-
1
})
// 表单校验
const
rules
=
{
...
...
@@ -137,8 +133,9 @@ const rules = {
/** 侦听账号变化 */
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
accountId
.
value
=
id
reply
.
value
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
src/views/mp/components/wx-account-select/main.vue
View file @
0ceddc9c
...
...
@@ -8,13 +8,14 @@
import
*
as
MpAccountApi
from
'@/api/mp/account'
const
account
:
MpAccountApi
.
AccountVO
=
reactive
({
id
:
undefined
,
id
:
-
1
,
name
:
''
})
const
accountList
:
Ref
<
MpAccountApi
.
AccountVO
[]
>
=
ref
([])
const
accountList
=
ref
<
MpAccountApi
.
AccountVO
[]
>
([])
const
emit
=
defineEmits
<
{
(
e
:
'change'
,
id
:
number
,
name
:
string
)
:
void
(
e
:
'change'
,
id
:
number
,
name
:
string
)
}
>
()
const
handleQuery
=
async
()
=>
{
...
...
src/views/mp/components/wx-msg/components/MsgEvent.vue
0 → 100644
View file @
0ceddc9c
<
template
>
<div>
<div
v-if=
"item.event === 'subscribe'"
>
<el-tag
type=
"success"
>
关注
</el-tag>
</div>
<div
v-else-if=
"item.event === 'unsubscribe'"
>
<el-tag
type=
"danger"
>
取消关注
</el-tag>
</div>
<div
v-else-if=
"item.event === 'CLICK'"
>
<el-tag>
点击菜单
</el-tag>
【
{{
item
.
eventKey
}}
】
</div>
<div
v-else-if=
"item.event === 'VIEW'"
>
<el-tag>
点击菜单链接
</el-tag>
【
{{
item
.
eventKey
}}
】
</div>
<div
v-else-if=
"item.event === 'scancode_waitmsg'"
>
<el-tag>
扫码结果
</el-tag>
【
{{
item
.
eventKey
}}
】
</div>
<div
v-else-if=
"item.event === 'scancode_push'"
>
<el-tag>
扫码结果
</el-tag>
【
{{
item
.
eventKey
}}
】
</div>
<div
v-else-if=
"item.event === 'pic_sysphoto'"
>
<el-tag>
系统拍照发图
</el-tag>
</div>
<div
v-else-if=
"item.event === 'pic_photo_or_album'"
>
<el-tag>
拍照或者相册
</el-tag>
</div>
<div
v-else-if=
"item.event === 'pic_weixin'"
>
<el-tag>
微信相册
</el-tag>
</div>
<div
v-else-if=
"item.event === 'location_select'"
>
<el-tag>
选择地理位置
</el-tag>
</div>
<div
v-else
>
<el-tag
type=
"danger"
>
未知事件类型
</el-tag>
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
const
props
=
defineProps
<
{
item
:
any
}
>
()
const
item
=
ref
(
props
.
item
)
</
script
>
<
style
scoped
></
style
>
src/views/mp/components/wx-msg/components/MsgList.vue
0 → 100644
View file @
0ceddc9c
<
template
>
<div
class=
"execution"
v-for=
"item in props.list"
:key=
"item.id"
>
<div
class=
"avue-comment"
:class=
"
{ 'avue-comment--reverse': item.sendFrom === SendFrom.MpBot }"
>
<div
class=
"avatar-div"
>
<img
:src=
"getAvatar(item.sendFrom)"
class=
"avue-comment__avatar"
/>
<div
class=
"avue-comment__author"
>
{{
getNickname
(
item
.
sendFrom
)
}}
</div>
</div>
<div
class=
"avue-comment__main"
>
<div
class=
"avue-comment__header"
>
<div
class=
"avue-comment__create_time"
>
{{
formatDate
(
item
.
createTime
)
}}
</div>
</div>
<div
class=
"avue-comment__body"
:style=
"item.sendFrom === SendFrom.MpBot ? 'background: #6BED72;' : ''"
>
<!-- 【事件】区域 -->
<MsgEvent
v-if=
"item.type === MsgType.Event"
:item=
"item"
/>
<!-- 【消息】区域 -->
<div
v-else-if=
"item.type === MsgType.Text"
>
{{
item
.
content
}}
</div>
<div
v-else-if=
"item.type === MsgType.Voice"
>
<WxVoicePlayer
:url=
"item.mediaUrl"
:content=
"item.recognition"
/>
</div>
<div
v-else-if=
"item.type === MsgType.Image"
>
<a
target=
"_blank"
:href=
"item.mediaUrl"
>
<img
:src=
"item.mediaUrl"
style=
"width: 100px"
/>
</a>
</div>
<div
v-else-if=
"item.type === MsgType.Video || item.type === 'shortvideo'"
style=
"text-align: center"
>
<WxVideoPlayer
:url=
"item.mediaUrl"
/>
</div>
<div
v-else-if=
"item.type === MsgType.Link"
class=
"avue-card__detail"
>
<el-link
type=
"success"
:underline=
"false"
target=
"_blank"
:href=
"item.url"
>
<div
class=
"avue-card__title"
><i
class=
"el-icon-link"
></i>
{{
item
.
title
}}
</div>
</el-link>
<div
class=
"avue-card__info"
style=
"height: unset"
>
{{
item
.
description
}}
</div>
</div>
<!-- TODO 芋艿:待完善 -->
<div
v-else-if=
"item.type === MsgType.Location"
>
<WxLocation
:label=
"item.label"
:location-y=
"item.locationY"
:location-x=
"item.locationX"
/>
</div>
<div
v-else-if=
"item.type === MsgType.News"
style=
"width: 300px"
>
<!-- TODO 芋艿:待测试;详情页也存在类似的情况 -->
<WxNews
:articles=
"item.articles"
/>
</div>
<div
v-else-if=
"item.type === MsgType.Music"
>
<WxMusic
:title=
"item.title"
:description=
"item.description"
:thumb-media-url=
"item.thumbMediaUrl"
:music-url=
"item.musicUrl"
:hq-music-url=
"item.hqMusicUrl"
/>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
name=
"MsgList"
>
import
WxVideoPlayer
from
'@/views/mp/components/wx-video-play'
import
WxVoicePlayer
from
'@/views/mp/components/wx-voice-play'
import
WxNews
from
'@/views/mp/components/wx-news'
import
WxLocation
from
'@/views/mp/components/wx-location'
import
WxMusic
from
'@/views/mp/components/wx-music'
import
MsgEvent
from
'./MsgEvent.vue'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
MsgType
,
User
}
from
'../types'
import
avatarWechat
from
'@/assets/imgs/wechat.png'
const
props
=
defineProps
<
{
list
:
any
[]
accountId
:
number
user
:
User
}
>
()
enum
SendFrom
{
User
=
1
,
MpBot
=
2
}
const
getAvatar
=
(
sendFrom
:
SendFrom
)
=>
sendFrom
===
SendFrom
.
User
?
props
.
user
.
avatar
:
avatarWechat
const
getNickname
=
(
sendFrom
:
SendFrom
)
=>
sendFrom
===
SendFrom
.
User
?
props
.
user
.
nickname
:
'公众号'
</
script
>
<
style
lang=
"scss"
scoped
>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
@import
'../comment.scss'
;
@import
'../card.scss'
;
.avatar-div
{
text-align
:
center
;
width
:
80px
;
}
</
style
>
src/views/mp/components/wx-msg/main.vue
View file @
0ceddc9c
This diff is collapsed.
Click to expand it.
src/views/mp/components/wx-msg/types.ts
View file @
0ceddc9c
...
...
@@ -9,3 +9,9 @@ export enum MsgType {
Music
=
'music'
,
News
=
'news'
}
export
interface
User
{
nickname
:
string
avatar
:
string
accountId
:
number
}
src/views/mp/components/wx-music/main.vue
View file @
0ceddc9c
...
...
@@ -55,6 +55,6 @@ defineExpose({
</
script
>
<
style
lang=
"scss"
scoped
>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.sc
c
*/
@import
url('../wx-msg/card.scss')
;
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.sc
ss
*/
@import
'../wx-msg/card.scss'
;
</
style
>
src/views/mp/draft/components/CoverSelect.vue
View file @
0ceddc9c
...
...
@@ -51,7 +51,7 @@
>
<WxMaterialSelect
type=
"image"
:account-id=
"accountId"
:account-id=
"accountId
!
"
@
select-material=
"onMaterialSelected"
/>
</el-dialog>
...
...
@@ -93,11 +93,11 @@ const showImageDialog = ref(false)
const
fileList
=
ref
<
UploadFiles
>
([])
interface
UploadData
{
type
:
UploadType
accountId
:
number
|
undefined
accountId
:
number
}
const
uploadData
:
UploadData
=
reactive
({
type
:
UploadType
.
Image
,
accountId
:
accountId
accountId
:
accountId
!
})
/** 素材选择完成事件*/
...
...
src/views/mp/draft/components/NewsForm.vue
View file @
0ceddc9c
...
...
@@ -125,7 +125,7 @@
</el-container>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
name=
"NewsForm"
>
import
{
Editor
}
from
'@/components/Editor'
import
{
createEditorConfig
}
from
'../editor-config'
import
CoverSelect
from
'./CoverSelect.vue'
...
...
src/views/mp/draft/index.vue
View file @
0ceddc9c
...
...
@@ -76,30 +76,17 @@ import {
const
message
=
useMessage
()
// 消息
const
accountId
=
ref
<
number
>
(
0
)
const
accountId
=
ref
(
-
1
)
provide
(
'accountId'
,
accountId
)
const
loading
=
ref
(
true
)
// 列表的加载中
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
total
=
ref
(
0
)
// 列表的总页数
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
})
interface
UploadData
{
type
:
'image'
|
'video'
|
'audio'
accountId
:
number
}
const
uploadData
:
UploadData
=
reactive
({
type
:
'image'
,
accountId
:
0
accountId
:
accountId
})
// ========== 草稿新建 or 修改 ==========
...
...
@@ -111,7 +98,8 @@ const isSubmitting = ref(false)
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
setAccountId
(
id
)
accountId
.
value
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
@@ -124,12 +112,6 @@ const onBeforeDialogClose = async (onDone: () => {}) => {
}
// ======================== 列表查询 ========================
/** 设置账号编号 */
const
setAccountId
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
uploadData
.
accountId
=
id
}
/** 查询列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
...
...
@@ -170,10 +152,10 @@ const onSubmitNewsItem = async () => {
isSubmitting
.
value
=
true
try
{
if
(
isCreating
.
value
)
{
await
MpDraftApi
.
createDraft
(
queryParams
.
accountId
,
newsList
.
value
)
await
MpDraftApi
.
createDraft
(
accountId
.
value
,
newsList
.
value
)
message
.
notifySuccess
(
'新增成功'
)
}
else
{
await
MpDraftApi
.
updateDraft
(
queryParams
.
accountId
,
mediaId
.
value
,
newsList
.
value
)
await
MpDraftApi
.
updateDraft
(
accountId
.
value
,
mediaId
.
value
,
newsList
.
value
)
message
.
notifySuccess
(
'更新成功'
)
}
}
finally
{
...
...
@@ -185,7 +167,6 @@ const onSubmitNewsItem = async () => {
// ======================== 草稿箱发布 ========================
const
onPublish
=
async
(
item
:
Article
)
=>
{
const
accountId
=
queryParams
.
accountId
const
mediaId
=
item
.
mediaId
const
content
=
'你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。'
+
...
...
@@ -193,7 +174,7 @@ const onPublish = async (item: Article) => {
'发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。'
try
{
await
message
.
confirm
(
content
)
await
MpFreePublishApi
.
submitFreePublish
(
accountId
,
mediaId
)
await
MpFreePublishApi
.
submitFreePublish
(
accountId
.
value
,
mediaId
)
message
.
notifySuccess
(
'发布成功'
)
await
getList
()
}
catch
{}
...
...
@@ -201,11 +182,10 @@ const onPublish = async (item: Article) => {
/** 删除按钮操作 */
const
onDelete
=
async
(
item
:
Article
)
=>
{
const
accountId
=
queryParams
.
accountId
const
mediaId
=
item
.
mediaId
try
{
await
message
.
confirm
(
'此操作将永久删除该草稿, 是否继续?'
)
await
MpDraftApi
.
deleteDraft
(
accountId
,
mediaId
)
await
MpDraftApi
.
deleteDraft
(
accountId
.
value
,
mediaId
)
message
.
notifySuccess
(
'删除成功'
)
await
getList
()
}
catch
{}
...
...
src/views/mp/freePublish/index.vue
View file @
0ceddc9c
...
...
@@ -59,20 +59,16 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
accountId
:
-
1
})
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
src/views/mp/material/index.vue
View file @
0ceddc9c
...
...
@@ -100,16 +100,10 @@ const loading = ref(false) // 遮罩层
const
list
=
ref
<
any
[]
>
([])
// 总条数
const
total
=
ref
(
0
)
// 数据列表
// 查询参数
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
permanent
:
boolean
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
,
accountId
:
-
1
,
permanent
:
true
})
const
showCreateVideo
=
ref
(
false
)
// 是否新建视频的弹窗
...
...
@@ -117,6 +111,7 @@ const showCreateVideo = ref(false) // 是否新建视频的弹窗
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
src/views/mp/menu/components/MenuPreviewer.vue
View file @
0ceddc9c
...
...
@@ -4,7 +4,7 @@
item-key=
"id"
ghost-class=
"draggable-ghost"
:animation=
"400"
@
end=
"onDragEnd"
@
end=
"on
Parent
DragEnd"
>
<template
#
item=
"
{ element: parent, index: x }">
<div
class=
"menu_bottom"
>
...
...
@@ -23,6 +23,7 @@
item-key=
"id"
ghost-class=
"draggable-ghost"
:animation=
"400"
@
end=
"onChildDragEnd"
>
<template
#
item=
"
{ element: child, index: y }">
<div
class=
"subtitle menu_bottom"
>
...
...
@@ -118,42 +119,49 @@ const subMenuClicked = (child: Menu, x: number, y: number) => {
}
/**
* 处理一级菜单展开后被拖动
* 处理一级菜单展开后被拖动
,激活(展开)原来活动的一级菜单
*
* @param oldIndex: 一级菜单拖动前的位置
* @param newIndex: 一级菜单拖动后的位置
*/
const
onDragEnd
=
({
oldIndex
,
newIndex
})
=>
{
const
on
Parent
DragEnd
=
({
oldIndex
,
newIndex
})
=>
{
// 二级菜单没有展开,直接返回
if
(
props
.
activeIndex
===
'__MENU_NOT_SELECTED__'
)
{
return
}
let
newParent
=
props
.
parentIndex
if
(
props
.
parentIndex
===
oldIndex
)
{
newParent
=
newIndex
}
else
if
(
props
.
parentIndex
===
newIndex
)
{
newParent
=
oldIndex
}
else
{
// 如果展开的二级菜单下标`props.parentIndex`不是被移动的菜单的前后下标。
// 那么使用一个辅助素组来模拟菜单移动,然后找到展开的二级菜单的新下标`newParent`
// 使用一个辅助数组来模拟菜单移动,然后找到展开的二级菜单的新下标`newParent`
let
positions
=
new
Array
<
boolean
>
(
menuList
.
value
.
length
).
fill
(
false
)
positions
[
props
.
parentIndex
]
=
true
positions
.
splice
(
oldIndex
,
1
)
positions
.
splice
(
newIndex
,
0
,
true
)
newParent
=
positions
.
indexOf
(
true
)
}
const
[
out
]
=
positions
.
splice
(
oldIndex
,
1
)
// 移出菜单,保存到变量out
positions
.
splice
(
newIndex
,
0
,
out
)
// 把out变量插入被移出的菜单
const
newParentIndex
=
positions
.
indexOf
(
true
)
// 找到菜单元素,触发一级菜单点击
const
parent
=
menuList
.
value
[
newParent
]
emit
(
'menu-clicked'
,
parent
,
newParent
)
const
parent
=
menuList
.
value
[
newParentIndex
]
emit
(
'menu-clicked'
,
parent
,
newParentIndex
)
}
/**
* 处理二级菜单展开后被拖动,激活被拖动的菜单
*
* @param newIndex 二级菜单拖动后的位置
*/
const
onChildDragEnd
=
({
newIndex
})
=>
{
const
x
=
props
.
parentIndex
const
y
=
newIndex
const
children
=
menuList
.
value
[
x
]?.
children
if
(
children
&&
children
?.
length
>
0
)
{
const
child
=
children
[
y
]
emit
(
'submenu-clicked'
,
child
,
x
,
y
)
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.menu_bottom
{
position
:
relative
;
display
:
inline-
block
;
display
:
block
;
float
:
left
;
width
:
85.5px
;
text-align
:
center
;
...
...
src/views/mp/menu/index.vue
View file @
0ceddc9c
...
...
@@ -65,7 +65,7 @@ const MENU_NOT_SELECTED = '__MENU_NOT_SELECTED__'
// ======================== 列表查询 ========================
const
loading
=
ref
(
false
)
// 遮罩层
const
accountId
=
ref
<
number
>
(
0
)
const
accountId
=
ref
(
-
1
)
const
accountName
=
ref
<
string
>
(
''
)
const
menuList
=
ref
<
Menu
[]
>
([])
...
...
@@ -339,7 +339,7 @@ div {
.left
{
position
:
relative
;
display
:
inline-
block
;
display
:
block
;
float
:
left
;
width
:
350px
;
height
:
715px
;
...
...
src/views/mp/message/index.vue
View file @
0ceddc9c
...
...
@@ -93,20 +93,12 @@ const total = ref(0) // 数据的总页数
const
list
=
ref
<
any
[]
>
([])
// 当前页的列表数据
// 搜索参数
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
openid
:
string
|
undefined
accountId
:
number
type
:
MsgType
|
undefined
createTime
:
string
[]
|
[]
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
openid
:
undefined
,
accountId
:
0
,
type
:
undefined
,
openid
:
''
,
accountId
:
-
1
,
type
:
MsgType
.
Text
,
createTime
:
[]
})
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
...
...
@@ -120,6 +112,7 @@ const messageBox = reactive({
/** 侦听accountId */
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
handleQuery
()
}
...
...
src/views/mp/statistics/index.vue
View file @
0ceddc9c
...
...
@@ -84,7 +84,7 @@ const dateRange = ref([
beginOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
)),
endOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
))
])
const
accountId
=
ref
()
// 选中的公众号编号
const
accountId
=
ref
(
-
1
)
// 选中的公众号编号
const
accountList
=
ref
<
MpAccountApi
.
AccountVO
[]
>
([])
// 公众号账号列表
const
xAxisDate
=
ref
([]
as
any
[])
// X 轴的日期范围
...
...
@@ -232,7 +232,7 @@ const getAccountList = async () => {
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
// 默认选中第一个
if
(
accountList
.
value
.
length
>
0
)
{
accountId
.
value
=
accountList
.
value
[
0
].
id
accountId
.
value
=
accountList
.
value
[
0
].
id
!
}
}
...
...
src/views/mp/tag/index.vue
View file @
0ceddc9c
...
...
@@ -95,23 +95,18 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
accountId
:
-
1
})
const
formRef
=
ref
<
InstanceType
<
typeof
TagForm
>
|
null
>
(
null
)
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
pageNo
=
1
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
src/views/mp/user/index.vue
View file @
0ceddc9c
...
...
@@ -113,27 +113,20 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
pageNo
:
number
pageSize
:
number
accountId
:
number
openid
:
string
|
null
nickname
:
string
|
null
}
const
queryParams
:
QueryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
accountId
:
0
,
openid
:
null
,
nickname
:
null
accountId
:
-
1
,
openid
:
''
,
nickname
:
''
})
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
const
tagList
=
ref
<
any
[]
>
([])
// 公众号标签列表
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
pageNo
=
1
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
}
...
...
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