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
19875286
authored
Apr 22, 2023
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: mp模块统一accountId未初始化值为-1,删除QueryParams定义
parent
036c9b33
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
83 deletions
+42
-83
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/draft/index.vue
+9
-20
src/views/mp/freePublish/index.vue
+3
-7
src/views/mp/material/index.vue
+3
-8
src/views/mp/menu/index.vue
+1
-1
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 @
19875286
import
request
from
'@/config/axios'
import
request
from
'@/config/axios'
export
interface
AccountVO
{
export
interface
AccountVO
{
id
?
:
number
id
:
number
name
:
string
name
:
string
}
}
...
...
src/views/mp/autoReply/index.vue
View file @
19875286
...
@@ -103,6 +103,7 @@ import ReplyTable from './components/ReplyTable.vue'
...
@@ -103,6 +103,7 @@ import ReplyTable from './components/ReplyTable.vue'
import
{
MsgType
}
from
'./components/types'
import
{
MsgType
}
from
'./components/types'
const
message
=
useMessage
()
// 消息
const
message
=
useMessage
()
// 消息
const
accountId
=
ref
(
-
1
)
// 公众号ID
const
msgType
=
ref
<
MsgType
>
(
MsgType
.
Keyword
)
// 消息类型
const
msgType
=
ref
<
MsgType
>
(
MsgType
.
Keyword
)
// 消息类型
const
RequestMessageTypes
=
[
'text'
,
'image'
,
'voice'
,
'video'
,
'shortvideo'
,
'location'
,
'link'
]
// 允许选择的请求消息类型
const
RequestMessageTypes
=
[
'text'
,
'image'
,
'voice'
,
'video'
,
'shortvideo'
,
'location'
,
'link'
]
// 允许选择的请求消息类型
const
loading
=
ref
(
true
)
// 遮罩层
const
loading
=
ref
(
true
)
// 遮罩层
...
@@ -110,15 +111,10 @@ const total = ref(0) // 总条数
...
@@ -110,15 +111,10 @@ const total = ref(0) // 总条数
const
list
=
ref
<
any
[]
>
([])
// 自动回复列表
const
list
=
ref
<
any
[]
>
([])
// 自动回复列表
const
formRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 表单 ref
const
formRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 表单 ref
// 查询参数
// 查询参数
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
0
accountId
:
accountId
})
})
const
dialogTitle
=
ref
(
''
)
// 弹出层标题
const
dialogTitle
=
ref
(
''
)
// 弹出层标题
...
@@ -127,7 +123,7 @@ const replyForm = ref<any>({}) // 表单参数
...
@@ -127,7 +123,7 @@ const replyForm = ref<any>({}) // 表单参数
// 回复消息
// 回复消息
const
reply
=
ref
<
Reply
>
({
const
reply
=
ref
<
Reply
>
({
type
:
ReplyType
.
Text
,
type
:
ReplyType
.
Text
,
accountId
:
0
accountId
:
-
1
})
})
// 表单校验
// 表单校验
const
rules
=
{
const
rules
=
{
...
@@ -137,8 +133,9 @@ const rules = {
...
@@ -137,8 +133,9 @@ const rules = {
/** 侦听账号变化 */
/** 侦听账号变化 */
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
accountId
.
value
=
id
reply
.
value
.
accountId
=
id
reply
.
value
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
getList
()
}
}
...
...
src/views/mp/components/wx-account-select/main.vue
View file @
19875286
...
@@ -8,13 +8,14 @@
...
@@ -8,13 +8,14 @@
import
*
as
MpAccountApi
from
'@/api/mp/account'
import
*
as
MpAccountApi
from
'@/api/mp/account'
const
account
:
MpAccountApi
.
AccountVO
=
reactive
({
const
account
:
MpAccountApi
.
AccountVO
=
reactive
({
id
:
undefined
,
id
:
-
1
,
name
:
''
name
:
''
})
})
const
accountList
:
Ref
<
MpAccountApi
.
AccountVO
[]
>
=
ref
([])
const
accountList
=
ref
<
MpAccountApi
.
AccountVO
[]
>
([])
const
emit
=
defineEmits
<
{
const
emit
=
defineEmits
<
{
(
e
:
'change'
,
id
:
number
,
name
:
string
)
:
void
(
e
:
'change'
,
id
:
number
,
name
:
string
)
}
>
()
}
>
()
const
handleQuery
=
async
()
=>
{
const
handleQuery
=
async
()
=>
{
...
...
src/views/mp/draft/index.vue
View file @
19875286
...
@@ -76,18 +76,14 @@ import {
...
@@ -76,18 +76,14 @@ import {
const
message
=
useMessage
()
// 消息
const
message
=
useMessage
()
// 消息
const
accountId
=
ref
<
number
>
(
-
1
)
const
accountId
=
ref
(
-
1
)
provide
(
'accountId'
,
accountId
)
provide
(
'accountId'
,
accountId
)
const
loading
=
ref
(
true
)
// 列表的加载中
const
loading
=
ref
(
true
)
// 列表的加载中
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
interface
QueryParams
{
pageNo
:
number
const
queryParams
=
reactive
({
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
accountId
accountId
:
accountId
...
@@ -102,7 +98,8 @@ const isSubmitting = ref(false)
...
@@ -102,7 +98,8 @@ const isSubmitting = ref(false)
/** 侦听公众号变化 **/
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
setAccountId
(
id
)
accountId
.
value
=
id
queryParams
.
pageNo
=
1
getList
()
getList
()
}
}
...
@@ -115,12 +112,6 @@ const onBeforeDialogClose = async (onDone: () => {}) => {
...
@@ -115,12 +112,6 @@ const onBeforeDialogClose = async (onDone: () => {}) => {
}
}
// ======================== 列表查询 ========================
// ======================== 列表查询 ========================
/** 设置账号编号 */
const
setAccountId
=
(
id
:
number
)
=>
{
accountId
.
value
=
id
// queryParams.accountId = id
}
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
...
@@ -161,10 +152,10 @@ const onSubmitNewsItem = async () => {
...
@@ -161,10 +152,10 @@ const onSubmitNewsItem = async () => {
isSubmitting
.
value
=
true
isSubmitting
.
value
=
true
try
{
try
{
if
(
isCreating
.
value
)
{
if
(
isCreating
.
value
)
{
await
MpDraftApi
.
createDraft
(
queryParams
.
accountId
,
newsList
.
value
)
await
MpDraftApi
.
createDraft
(
accountId
.
value
,
newsList
.
value
)
message
.
notifySuccess
(
'新增成功'
)
message
.
notifySuccess
(
'新增成功'
)
}
else
{
}
else
{
await
MpDraftApi
.
updateDraft
(
queryParams
.
accountId
,
mediaId
.
value
,
newsList
.
value
)
await
MpDraftApi
.
updateDraft
(
accountId
.
value
,
mediaId
.
value
,
newsList
.
value
)
message
.
notifySuccess
(
'更新成功'
)
message
.
notifySuccess
(
'更新成功'
)
}
}
}
finally
{
}
finally
{
...
@@ -176,7 +167,6 @@ const onSubmitNewsItem = async () => {
...
@@ -176,7 +167,6 @@ const onSubmitNewsItem = async () => {
// ======================== 草稿箱发布 ========================
// ======================== 草稿箱发布 ========================
const
onPublish
=
async
(
item
:
Article
)
=>
{
const
onPublish
=
async
(
item
:
Article
)
=>
{
const
accountId
=
queryParams
.
accountId
const
mediaId
=
item
.
mediaId
const
mediaId
=
item
.
mediaId
const
content
=
const
content
=
'你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。'
+
'你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。'
+
...
@@ -184,7 +174,7 @@ const onPublish = async (item: Article) => {
...
@@ -184,7 +174,7 @@ const onPublish = async (item: Article) => {
'发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。'
'发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。'
try
{
try
{
await
message
.
confirm
(
content
)
await
message
.
confirm
(
content
)
await
MpFreePublishApi
.
submitFreePublish
(
accountId
,
mediaId
)
await
MpFreePublishApi
.
submitFreePublish
(
accountId
.
value
,
mediaId
)
message
.
notifySuccess
(
'发布成功'
)
message
.
notifySuccess
(
'发布成功'
)
await
getList
()
await
getList
()
}
catch
{}
}
catch
{}
...
@@ -192,11 +182,10 @@ const onPublish = async (item: Article) => {
...
@@ -192,11 +182,10 @@ const onPublish = async (item: Article) => {
/** 删除按钮操作 */
/** 删除按钮操作 */
const
onDelete
=
async
(
item
:
Article
)
=>
{
const
onDelete
=
async
(
item
:
Article
)
=>
{
const
accountId
=
queryParams
.
accountId
const
mediaId
=
item
.
mediaId
const
mediaId
=
item
.
mediaId
try
{
try
{
await
message
.
confirm
(
'此操作将永久删除该草稿, 是否继续?'
)
await
message
.
confirm
(
'此操作将永久删除该草稿, 是否继续?'
)
await
MpDraftApi
.
deleteDraft
(
accountId
,
mediaId
)
await
MpDraftApi
.
deleteDraft
(
accountId
.
value
,
mediaId
)
message
.
notifySuccess
(
'删除成功'
)
message
.
notifySuccess
(
'删除成功'
)
await
getList
()
await
getList
()
}
catch
{}
}
catch
{}
...
...
src/views/mp/freePublish/index.vue
View file @
19875286
...
@@ -59,20 +59,16 @@ const loading = ref(true) // 列表的加载中
...
@@ -59,20 +59,16 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
0
accountId
:
-
1
})
})
/** 侦听公众号变化 **/
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
getList
()
}
}
...
...
src/views/mp/material/index.vue
View file @
19875286
...
@@ -100,16 +100,10 @@ const loading = ref(false) // 遮罩层
...
@@ -100,16 +100,10 @@ const loading = ref(false) // 遮罩层
const
list
=
ref
<
any
[]
>
([])
// 总条数
const
list
=
ref
<
any
[]
>
([])
// 总条数
const
total
=
ref
(
0
)
// 数据列表
const
total
=
ref
(
0
)
// 数据列表
// 查询参数
// 查询参数
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
accountId
:
number
permanent
:
boolean
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
0
,
accountId
:
-
1
,
permanent
:
true
permanent
:
true
})
})
const
showCreateVideo
=
ref
(
false
)
// 是否新建视频的弹窗
const
showCreateVideo
=
ref
(
false
)
// 是否新建视频的弹窗
...
@@ -117,6 +111,7 @@ const showCreateVideo = ref(false) // 是否新建视频的弹窗
...
@@ -117,6 +111,7 @@ const showCreateVideo = ref(false) // 是否新建视频的弹窗
/** 侦听公众号变化 **/
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
getList
()
}
}
...
...
src/views/mp/menu/index.vue
View file @
19875286
...
@@ -65,7 +65,7 @@ const MENU_NOT_SELECTED = '__MENU_NOT_SELECTED__'
...
@@ -65,7 +65,7 @@ const MENU_NOT_SELECTED = '__MENU_NOT_SELECTED__'
// ======================== 列表查询 ========================
// ======================== 列表查询 ========================
const
loading
=
ref
(
false
)
// 遮罩层
const
loading
=
ref
(
false
)
// 遮罩层
const
accountId
=
ref
<
number
>
(
0
)
const
accountId
=
ref
(
-
1
)
const
accountName
=
ref
<
string
>
(
''
)
const
accountName
=
ref
<
string
>
(
''
)
const
menuList
=
ref
<
Menu
[]
>
([])
const
menuList
=
ref
<
Menu
[]
>
([])
...
...
src/views/mp/message/index.vue
View file @
19875286
...
@@ -93,20 +93,12 @@ const total = ref(0) // 数据的总页数
...
@@ -93,20 +93,12 @@ const total = ref(0) // 数据的总页数
const
list
=
ref
<
any
[]
>
([])
// 当前页的列表数据
const
list
=
ref
<
any
[]
>
([])
// 当前页的列表数据
// 搜索参数
// 搜索参数
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
openid
:
string
|
undefined
accountId
:
number
type
:
MsgType
|
undefined
createTime
:
string
[]
|
[]
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
openid
:
undefined
,
openid
:
''
,
accountId
:
0
,
accountId
:
-
1
,
type
:
undefined
,
type
:
MsgType
.
Text
,
createTime
:
[]
createTime
:
[]
})
})
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
...
@@ -120,6 +112,7 @@ const messageBox = reactive({
...
@@ -120,6 +112,7 @@ const messageBox = reactive({
/** 侦听accountId */
/** 侦听accountId */
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
handleQuery
()
handleQuery
()
}
}
...
...
src/views/mp/statistics/index.vue
View file @
19875286
...
@@ -84,7 +84,7 @@ const dateRange = ref([
...
@@ -84,7 +84,7 @@ const dateRange = ref([
beginOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
)),
beginOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
)),
endOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
))
endOfDay
(
new
Date
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
))
])
])
const
accountId
=
ref
()
// 选中的公众号编号
const
accountId
=
ref
(
-
1
)
// 选中的公众号编号
const
accountList
=
ref
<
MpAccountApi
.
AccountVO
[]
>
([])
// 公众号账号列表
const
accountList
=
ref
<
MpAccountApi
.
AccountVO
[]
>
([])
// 公众号账号列表
const
xAxisDate
=
ref
([]
as
any
[])
// X 轴的日期范围
const
xAxisDate
=
ref
([]
as
any
[])
// X 轴的日期范围
...
@@ -232,7 +232,7 @@ const getAccountList = async () => {
...
@@ -232,7 +232,7 @@ const getAccountList = async () => {
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
accountList
.
value
=
await
MpAccountApi
.
getSimpleAccountList
()
// 默认选中第一个
// 默认选中第一个
if
(
accountList
.
value
.
length
>
0
)
{
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 @
19875286
...
@@ -95,23 +95,18 @@ const loading = ref(true) // 列表的加载中
...
@@ -95,23 +95,18 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
accountId
:
number
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
0
accountId
:
-
1
})
})
const
formRef
=
ref
<
InstanceType
<
typeof
TagForm
>
|
null
>
(
null
)
const
formRef
=
ref
<
InstanceType
<
typeof
TagForm
>
|
null
>
(
null
)
/** 侦听公众号变化 **/
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
pageNo
=
1
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
getList
()
}
}
...
...
src/views/mp/user/index.vue
View file @
19875286
...
@@ -113,27 +113,20 @@ const loading = ref(true) // 列表的加载中
...
@@ -113,27 +113,20 @@ const loading = ref(true) // 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
const
list
=
ref
<
any
[]
>
([])
// 列表的数据
interface
QueryParams
{
const
queryParams
=
reactive
({
pageNo
:
number
pageSize
:
number
accountId
:
number
openid
:
string
|
null
nickname
:
string
|
null
}
const
queryParams
:
QueryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
accountId
:
0
,
accountId
:
-
1
,
openid
:
null
,
openid
:
''
,
nickname
:
null
nickname
:
''
})
})
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
const
queryFormRef
=
ref
<
FormInstance
|
null
>
(
null
)
// 搜索的表单
const
tagList
=
ref
<
any
[]
>
([])
// 公众号标签列表
const
tagList
=
ref
<
any
[]
>
([])
// 公众号标签列表
/** 侦听公众号变化 **/
/** 侦听公众号变化 **/
const
onAccountChanged
=
(
id
:
number
)
=>
{
const
onAccountChanged
=
(
id
:
number
)
=>
{
queryParams
.
pageNo
=
1
queryParams
.
accountId
=
id
queryParams
.
accountId
=
id
queryParams
.
pageNo
=
1
getList
()
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