@@ -63,8 +63,8 @@ SOFTWARE.
63
63
<div class =" menu_bottom menu_addicon" v-if =" this.menuList.length < 3" @click =" addMenu" ><i class =" el-icon-plus" ></i ></div >
64
64
</div >
65
65
<div class =" save_div" >
66
- <!-- < el-button class="save_btn" type="warning " size="small" @click="saveFun">保存菜单 </el-button> -- >
67
- <el-button class =" save_btn" type =" success " size =" small" @click =" handleSaveAndReleaseFun " >保存并发布菜单 </el-button >
66
+ <el-button class =" save_btn" type =" success " size =" small" @click =" handleSave " >保存并发布菜单 </el-button >
67
+ <el-button class =" save_btn" type =" danger " size =" small" @click =" handleDelete " >清空菜单 </el-button >
68
68
</div >
69
69
</div >
70
70
<!-- 右边配置-->
@@ -141,7 +141,7 @@ SOFTWARE.
141
141
import WxReplySelect from ' @/views/mp/components/wx-news/main.vue'
142
142
import WxNews from ' @/views/mp/components/wx-news/main.vue' ;
143
143
import WxMaterialSelect from ' @/views/mp/components/wx-news/main.vue'
144
- import { getMenuList } from " @/api/mp/menu" ;
144
+ import {deleteMenu , getMenuList , saveMenu } from " @/api/mp/menu" ;
145
145
import { getSimpleAccounts } from " @/api/mp/account" ;
146
146
147
147
export default {
@@ -164,11 +164,6 @@ export default {
164
164
children: [],
165
165
},
166
166
167
- menu: { // 横向菜单
168
- button: [
169
- ]
170
- },
171
-
172
167
// ======================== 菜单操作 ========================
173
168
isActive: - 1 ,// 一级菜单点中样式
174
169
isSubMenuActive: - 1 , // 一级菜单点中样式
@@ -178,7 +173,7 @@ export default {
178
173
showRightFlag: false , // 右边配置显示默认详情还是配置详情
179
174
nameMaxLength: 0 , // 菜单名称最大长度;1 级是 4 字符;2 级是 7 字符;
180
175
showConfigureContent: true , // 是否展示配置内容;如果有子菜单,就不显示配置内容
181
-
176
+ hackResetWxReplySelect : false , // 重置 WxReplySelect 组件
182
177
183
178
tempObj: {}, // 右边临时变量,作为中间值牵引关系
184
179
tempSelfObj: { // 一些临时值放在这里进行判断,如果放在 tempObj,由于引用关系,menu 也会多了多余的参数
@@ -218,7 +213,6 @@ export default {
218
213
label: ' 选择地理位置'
219
214
}],
220
215
dialogNewsVisible: false ,
221
- hackResetWxReplySelect: false ,
222
216
223
217
// 公众号账号列表
224
218
accounts: [],
@@ -246,7 +240,6 @@ export default {
246
240
this .loading = false ;
247
241
getMenuList (this .accountId ).then (response => {
248
242
this .menuList = this .handleTree (response .data , " id" );
249
- console .log (this .menuList )
250
243
}).finally (() => {
251
244
this .loading = false ;
252
245
})
@@ -354,31 +347,16 @@ export default {
354
347
},
355
348
356
349
// ======================== 菜单编辑 ========================
357
- handleSaveAndReleaseFun (){
358
- this .$confirm (' 确定要保证并发布该菜单吗?' , ' 提示' , {
359
- confirmButtonText: ' 确定' ,
360
- cancelButtonText: ' 取消' ,
361
- type: ' warning'
362
- }).then (() => {
350
+ handleSave () {
351
+ this .$modal .confirm (' 确定要保证并发布该菜单吗?' ).then (() => {
363
352
this .loading = true
364
- saveAndRelease ({
365
- strWxMenu: this .menu
366
- }).then (response => {
367
- this .loading = false
368
- if (response .code == 200 ){
369
- this .$message ({
370
- showClose: true ,
371
- message: ' 发布成功' ,
372
- type: ' success'
373
- })
374
- }else {
375
- this .$message .error (response .data .msg )
376
- }
377
- }).catch (() => {
378
- this .loading = false
379
- })
380
- }).catch (() => {
381
- })
353
+ return saveMenu (this .accountId , this .menuList );
354
+ }).then (() => {
355
+ this .getList ();
356
+ this .$modal .msgSuccess (" 发布成功" );
357
+ }).catch (() => {}).finally (() => {
358
+ this .loading = false
359
+ });
382
360
},
383
361
// 表单 Editor 重置
384
362
resetEditor () {
@@ -387,6 +365,17 @@ export default {
387
365
this .hackResetEditor = true // 重建组件
388
366
})
389
367
},
368
+ handleDelete () {
369
+ this .$modal .confirm (' 确定要清空所有菜单吗?' ).then (() => {
370
+ this .loading = true
371
+ return deleteMenu (this .accountId );
372
+ }).then (() => {
373
+ this .getList ();
374
+ this .$modal .msgSuccess (" 清空成功" );
375
+ }).catch (() => {}).finally (() => {
376
+ this .loading = false
377
+ });
378
+ },
390
379
391
380
// TODO 芋艿:未归类
392
381
431
420
left :0px ;
432
421
width : 300px ;
433
422
height :64px ;
434
- background : transparent url(assets/menu_head.png ) no-repeat 0 0 ;
423
+ background : transparent url(" assets/menu_head.png" ) no-repeat 0 0 ;
435
424
background-position : 0 0 ;
436
425
background-size : 100%
437
426
}
445
434
left : 0px ;
446
435
}
447
436
.weixin-menu {
448
- background : transparent url(assets/menu_foot.png ) no-repeat 0 0 ;
437
+ background : transparent url(" assets/menu_foot.png" ) no-repeat 0 0 ;
449
438
padding-left : 43px ;
450
439
font-size : 12px
451
440
}
@@ -581,26 +570,26 @@ div{
581
570
<!-- </style>-->
582
571
<!-- 素材样式-->
583
572
<style lang="scss" scoped>
584
- .pagination {
573
+ .pagination {
585
574
text-align : right ;
586
575
margin-right : 25px ;
587
576
}
588
- .select-item {
577
+ .select-item {
589
578
width : 280px ;
590
579
padding : 10px ;
591
580
margin : 0 auto 10px auto ;
592
581
border : 1px solid #eaeaea ;
593
582
}
594
- .select-item2 {
583
+ .select-item2 {
595
584
padding : 10px ;
596
585
margin : 0 auto 10px auto ;
597
586
border : 1px solid #eaeaea ;
598
587
}
599
- .ope-row {
588
+ .ope-row {
600
589
padding-top : 10px ;
601
590
text-align : center ;
602
591
}
603
- .item-name {
592
+ .item-name {
604
593
font-size : 12px ;
605
594
overflow : hidden ;
606
595
text-overflow :ellipsis ;
0 commit comments