1
1
<template >
2
- <div class =" app-container" >
3
- <doc-alert title =" 公众号菜单" url =" https://doc.iocoder.cn/mp/menu/" />
4
-
5
- <!-- 搜索工作栏 -->
6
- <el-form ref =" queryForm" size =" small" :inline =" true" v-show =" showSearch" label-width =" 68px" >
2
+ <doc-alert title =" 公众号菜单" url =" https://doc.iocoder.cn/mp/menu/" />
3
+ <!-- 搜索工作栏 -->
4
+ <ContentWrap >
5
+ <el-form
6
+ class =" -mb-15px"
7
+ :model =" queryParams"
8
+ ref =" queryFormRef"
9
+ :inline =" true"
10
+ label-width =" 68px"
11
+ >
7
12
<el-form-item label =" 公众号" prop =" accountId" >
8
13
<el-select v-model =" accountId" placeholder =" 请选择公众号" >
9
14
<el-option
10
15
v-for =" item in accountList"
11
- :key =" parseInt( item.id) "
16
+ :key =" item.id"
12
17
:label =" item.name"
13
- :value =" parseInt( item.id) "
18
+ :value =" item.id"
14
19
/>
15
20
</el-select >
16
21
</el-form-item >
17
22
<el-form-item >
18
- <el-button type = " primary " icon =" el-icon- search" @click = " handleQuery " >搜索</el-button >
19
- <el-button icon = " el-icon-refresh " @click = " resetQuery " >重置</el-button >
23
+ <el-button @click = " handleQuery " >< Icon icon =" ep: search" / >搜索</el-button >
24
+ <el-button @click = " resetQuery " >< Icon icon = " ep:refresh " / >重置</el-button >
20
25
</el-form-item >
21
26
</el-form >
27
+ </ContentWrap >
22
28
29
+ <!-- 列表 -->
30
+ <ContentWrap >
23
31
<div class =" public-account-management clearfix" v-loading =" loading" >
24
32
<!-- 左边配置菜单-->
25
33
<div class =" left" >
63
71
<el-button
64
72
class =" save_btn"
65
73
type =" success"
66
- size =" small"
67
74
@click =" handleSave"
68
75
v-hasPermi =" ['mp:menu:save']"
69
76
>保存并发布菜单</el-button
70
77
>
71
78
<el-button
72
79
class =" save_btn"
73
80
type =" danger"
74
- size =" small"
75
81
@click =" handleDelete"
76
82
v-hasPermi =" ['mp:menu:delete']"
77
83
>清空菜单</el-button
82
88
<div v-if =" showRightFlag" class =" right" >
83
89
<div class =" configure_page" >
84
90
<div class =" delete_btn" >
85
- <el-button size =" small" type =" danger" @click =" handleDeleteMenu(tempObj)"
86
- > 删除当前菜单<Icon icon =" ep:delete"
87
- /> </el-button >
91
+ <el-button size =" small" type =" danger" @click =" handleDeleteMenu(tempObj)" >
92
+ 删除当前菜单<Icon icon =" ep:delete" />
93
+ </el-button >
88
94
</div >
89
95
<div >
90
96
<span >菜单名称:</span >
161
167
<div class =" select-item" v-if =" tempObj && tempObj.replyArticles" >
162
168
<WxNews :articles =" tempObj.replyArticles" />
163
169
<el-row class =" ope-row" justify =" center" align =" middle" >
164
- <el-button type =" danger" circle @click =" deleteMaterial"
165
- > <icon icon =" ep:delete"
166
- /> </el-button >
170
+ <el-button type =" danger" circle @click =" deleteMaterial" >
171
+ <icon icon =" ep:delete" />
172
+ </el-button >
167
173
</el-row >
168
174
</div >
169
175
<div v-else >
197
203
<p >请选择菜单配置</p >
198
204
</div >
199
205
</div >
200
- </div >
206
+ </ContentWrap >
201
207
</template >
202
-
203
- <script setup>
204
- import { ref , nextTick } from ' vue'
208
+ <script setup name="MpMenu">
209
+ import { handleTree } from ' @/utils/tree'
205
210
import WxReplySelect from ' @/views/mp/components/wx-reply/main.vue'
206
211
import WxNews from ' @/views/mp/components/wx-news/main.vue'
207
212
import WxMaterialSelect from ' @/views/mp/components/wx-material-select/main.vue'
208
213
import { deleteMenu , getMenuList , saveMenu } from ' @/api/mp/menu'
209
- import { getSimpleAccountList } from ' @/api/mp/account'
210
- import { handleTree } from ' @/utils/tree'
214
+ import * as MpAccountApi from ' @/api/mp/account'
211
215
import menuOptions from ' ./menuOptions'
212
-
213
- const message = useMessage ()
216
+ const message = useMessage () // 消息
214
217
215
218
// ======================== 列表查询 ========================
216
- // 遮罩层
217
- const loading = ref (true )
218
- // 显示搜索条件
219
- const showSearch = ref (true )
220
- // 公众号Id
221
- const accountId = ref (undefined )
222
- // 公众号名
223
- const name = ref (' ' )
219
+ const loading = ref (true ) // 遮罩层
220
+ const accountId = ref (undefined ) // 公众号Id
221
+ const name = ref (' ' ) // 公众号名
224
222
const menuList = ref ({ children: [] })
223
+ const accountList = ref ([]) // 公众号账号列表
225
224
226
- // const menuList = ref(menuListData)
227
225
// ======================== 菜单操作 ========================
228
226
const isActive = ref (- 1 ) // 一级菜单点中样式
229
227
const isSubMenuActive = ref (- 1 ) // 一级菜单点中样式
@@ -241,11 +239,8 @@ const tempSelfObj = ref({
241
239
})
242
240
const dialogNewsVisible = ref (false ) // 跳转图文时的素材选择弹窗
243
241
244
- // 公众号账号列表
245
- const accountList = ref ([])
246
-
247
242
onMounted (async () => {
248
- accountList .value = await getSimpleAccountList ()
243
+ accountList .value = await MpAccountApi . getSimpleAccountList ()
249
244
// 选中第一个
250
245
if (accountList .value .length > 0 ) {
251
246
// @ts-ignore
0 commit comments