增加编辑公告的公根那个
This commit is contained in:
parent
3a17a007e5
commit
0c3bc9bc48
55
src/api/announce.ts
Normal file
55
src/api/announce.ts
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
export interface IAnnounceData {
|
||||
_id?: string
|
||||
shop?: string
|
||||
title?: string
|
||||
content?: string
|
||||
type: number
|
||||
accounts: string[]
|
||||
shops: string[]
|
||||
sendTime?: number
|
||||
endTime?: number
|
||||
}
|
||||
|
||||
export const defaultAnnounceData: IAnnounceData = {
|
||||
shops: [],
|
||||
type: 0,
|
||||
accounts: []
|
||||
}
|
||||
|
||||
export const getAnnounces = (params: any) =>
|
||||
request({
|
||||
url: '/api/announces',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
|
||||
export const getAnnounce = (id: string, params: any) =>
|
||||
request({
|
||||
url: `/api/announce/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
|
||||
export const saveAnnounce = (data: any) =>
|
||||
request({
|
||||
url: '/api/announce/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
export const deleteAnnounce = (data: any) =>
|
||||
request({
|
||||
url: '/api/announce/delete',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
export const publishAnnounce = (data: any) =>
|
||||
request({
|
||||
url: '/api/announce/publish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
12
src/icons/components/announce.ts
Normal file
12
src/icons/components/announce.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-ignore
|
||||
import icon from 'vue-svgicon'
|
||||
icon.register({
|
||||
'announce': {
|
||||
width: 125.156,
|
||||
height: 120,
|
||||
viewBox: '0 0 1068 1024',
|
||||
data: '<defs/><path pid="0" d="M131.517 267.887S.178 265.661.178 445.307c0 180.179 131.34 177.419 131.34 177.419h306.665l306.666 221.718V46.124L438.094 267.888H131.517zm0 398.96l175.149 354.704s165.042 20.836 175.193-88.687c10.15-109.523-87.664-266.017-87.664-266.017H131.517zm674.148 221.718h131.34V1.87h-131.34v886.695zm175.193-576.423v266.017s87.664-47.193 87.664-132.986c0-84.413-58.324-133.031-87.664-133.031z" _fill="#679"/>'
|
||||
}
|
||||
})
|
@ -1,6 +1,7 @@
|
||||
/* tslint:disable */
|
||||
import './404'
|
||||
import './admin'
|
||||
import './announce'
|
||||
import './back-top'
|
||||
import './bug'
|
||||
import './chart'
|
||||
@ -31,6 +32,8 @@ import './like'
|
||||
import './link'
|
||||
import './list'
|
||||
import './lock'
|
||||
import './lottery'
|
||||
import './mail'
|
||||
import './message'
|
||||
import './money'
|
||||
import './nested'
|
||||
@ -46,6 +49,7 @@ import './question_list'
|
||||
import './role'
|
||||
import './search'
|
||||
import './sell'
|
||||
import './share'
|
||||
import './shop_list'
|
||||
import './shop'
|
||||
import './shopping'
|
||||
|
12
src/icons/components/lottery.ts
Normal file
12
src/icons/components/lottery.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-ignore
|
||||
import icon from 'vue-svgicon'
|
||||
icon.register({
|
||||
'lottery': {
|
||||
width: 120,
|
||||
height: 120,
|
||||
viewBox: '0 0 1024 1024',
|
||||
data: '<defs/><path pid="0" d="M512 0C229.182 0 0 229.21 0 512c0 282.818 229.182 512 512 512s512-229.182 512-512C1024 229.21 794.79 0 512 0zm316.803 828.803L701.468 701.468c-32.796 32.823-73.977 57.095-120.085 69.41l46.606 173.997c-37.584 10.102-76.413 15.111-115.989 15.111s-78.405-5.12-115.989-15.11l46.606-173.998c-46.108-12.288-87.289-36.587-120.112-69.41L195.197 828.803c-41.182-41.209-73.48-89.115-96.007-142.419a449.242 449.242 0 01-20.093-58.395l173.997-46.606a267.95 267.95 0 01-9.105-69.3 268.48 268.48 0 019.105-69.41L79.097 395.955c5.286-19.788 12.011-39.3 20.093-58.396 22.61-53.303 54.908-101.293 96.007-142.391l127.308 127.308c32.823-32.796 74.004-57.095 120.112-69.41L396.011 79.068C433.595 69.08 472.424 63.96 512 63.96s78.405 5.12 115.989 15.11l-46.606 173.997c46.108 12.316 87.289 36.615 120.085 69.411l127.335-127.308c41.182 41.209 73.48 89.088 96.007 142.391a447.823 447.823 0 0120.093 58.396l-173.997 46.606c5.923 22.113 9.105 45.416 9.105 69.41s-3.182 47.187-9.105 69.41l173.997 46.607c-5.286 19.788-12.011 39.3-20.093 58.395-22.528 53.331-54.936 101.21-96.007 142.42zm0 0"/><path pid="1" d="M654.253 661.67l-114.411-61.91c-36.504 38.967-120.168 61.91-218.168 61.91v-45.914c55.795-2.463 125.482-10.683 153.351-36.089H321.26v-39.798h166.082v-13.533h72.15v13.533H730.5v39.798H602.97l106.22 50.038h21.726l-15.582 31.965h-61.08zM475.883 525.95H404.95V495.2l-83.248 20.092V467.72l83.248-20.093V422.22h-83.248v-39.77h83.248v-27.067h70.933V525.95zm107.022-170.566h-65.619l-21.338 53.304h-9.825l9.825 31.965h34.871l23.774 33.626c-19.678 1.633-40.6 1.633-62.74 1.633v45.526c135.693 3.294 223.065-22.555 235.353-146.376H574.27l8.635-19.678zm78.737 53.304c-10.267 27.87-28.284 44.28-50.868 53.718l-23.773-31.993h-37.307l9.438-21.725h102.51z"/>'
|
||||
}
|
||||
})
|
12
src/icons/components/mail.ts
Normal file
12
src/icons/components/mail.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-ignore
|
||||
import icon from 'vue-svgicon'
|
||||
icon.register({
|
||||
'mail': {
|
||||
width: 120,
|
||||
height: 120,
|
||||
viewBox: '0 0 1024 1024',
|
||||
data: '<defs/><path pid="0" d="M451.715 607.152c16.086-16.12 37.513-25.006 60.285-25.006 22.773 0 44.2 8.886 60.286 25.006l14.374 14.388 90.033 90.136 282.881-283.143L544.458 13.012c-17.334-17.35-47.581-17.35-64.917 0L83.068 409.798 62.85 430.033l282.9 283.163 105.964-106.044zm-136.732 136.84l2.922-2.963L59.392 482.276V999.725l255.553-255.772zm588.15 249.923h-.097l-358.578-358.91c-17.334-17.35-47.581-17.35-64.917 0L112.01 1002.82h-.058L90.794 1024h842.395l-8.3-8.31-21.756-21.775zM704.52 739.529l4.458 4.463.077-.058 255.553 255.81V479.199z"/>'
|
||||
}
|
||||
})
|
12
src/icons/components/share.ts
Normal file
12
src/icons/components/share.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-ignore
|
||||
import icon from 'vue-svgicon'
|
||||
icon.register({
|
||||
'share': {
|
||||
width: 120,
|
||||
height: 120,
|
||||
viewBox: '0 0 1024 1024',
|
||||
data: '<defs/><path pid="0" d="M853.578 661.715c-65.68 0-119.381 35.158-144.39 89.736L391.713 616.41c18.518-28.693 28.692-63.85 28.692-101.764 0-15.711-1.854-31.448-5.563-46.258l202.703-157.269c26.864 20.348 61.12 32.376 99.059 32.376 91.641 0 160.128-68.46 160.128-159.097 0-90.663-68.512-159.124-160.128-159.124-91.641 0-159.2 68.46-159.2 159.124 0 23.129 4.636 44.404 12.028 62.897L382.44 390.68c-37.012-55.505-98.106-94.372-167.52-94.372A204.97 204.97 0 009.438 501.691a204.97 204.97 0 00205.485 205.356c42.575 0 82.369-11.076 114.77-31.423l364.711 155.388c4.636 86.027 71.268 149.851 159.175 149.851 91.667 0 159.226-68.435 159.226-159.097 0-90.663-68.512-160.05-159.2-160.05z" _fill="#333"/>'
|
||||
}
|
||||
})
|
1
src/icons/svg/announce.svg
Normal file
1
src/icons/svg/announce.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623311826854" class="icon" viewBox="0 0 1068 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7136" xmlns:xlink="http://www.w3.org/1999/xlink" width="125.15625" height="120"><defs><style type="text/css"></style></defs><path d="M131.517217 267.887304s-131.33913-2.226087-131.33913 177.419131c0 180.179478 131.33913 177.41913 131.33913 177.41913h306.66574l306.665739 221.718261V46.124522L438.093913 267.887304H131.517217z m0 398.959305l175.148522 354.704695s165.042087 20.836174 175.193044-88.687304c10.150957-109.523478-87.663304-266.017391-87.663305-266.017391h-262.678261z m674.148174 221.718261h131.339131V1.869913h-131.339131v886.694957z m175.193044-576.422957v266.017391S1068.521739 530.966261 1068.521739 445.17287c0-84.413217-58.323478-133.030957-87.663304-133.030957z" fill="#667799" p-id="7137"></path></svg>
|
After Width: | Height: | Size: 972 B |
1
src/icons/svg/lottery.svg
Normal file
1
src/icons/svg/lottery.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623311713715" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2547" xmlns:xlink="http://www.w3.org/1999/xlink" width="120" height="120"><defs><style type="text/css"></style></defs><path d="M512 0C229.18227 0 0 229.209946 0 512 0 794.81773 229.18227 1024 512 1024S1024 794.81773 1024 512C1024 229.209946 794.790054 0 512 0L512 0zM828.803459 828.803459l-127.335784-127.335784c-32.795676 32.823351-73.977081 57.094919-120.084757 69.410595l46.605838 173.996973c-37.583568 10.101622-76.412541 15.110919-115.988757 15.110919s-78.405189-5.12-115.988757-15.110919l46.605838-173.996973c-46.107676-12.288-87.289081-36.587243-120.112432-69.410595l-127.308108 127.335784 0 0c-41.181405-41.209081-73.478919-89.115676-96.006919-142.419027-8.081297-19.096216-14.778811-38.635243-20.092541-58.395676l173.996973-46.605838c-5.922595-22.112865-9.105297-45.415784-9.105297-69.299892 0-24.022486 3.182703-47.214703 9.105297-69.410595l-173.996973-46.716541c5.286054-19.788108 12.011243-39.299459 20.092541-58.395676 22.611027-53.303351 54.908541-101.292973 96.006919-142.391351l0 0 127.308108 127.308108c32.823351-32.795676 74.004757-57.094919 120.112432-69.410595l-46.605838-173.996973c37.583568-9.990919 76.412541-15.110919 115.988757-15.110919s78.405189 5.12 115.988757 15.110919l-46.605838 173.996973c46.107676 12.315676 87.289081 36.614919 120.084757 69.410595l127.335784-127.308108 0 0c41.181405 41.209081 73.478919 89.088 96.006919 142.391351 8.081297 19.096216 14.778811 38.607568 20.092541 58.395676l-173.996973 46.605838c5.922595 22.112865 9.105297 45.415784 9.105297 69.410595s-3.182703 47.187027-9.105297 69.410595l173.996973 46.605838c-5.286054 19.788108-12.011243 39.299459-20.092541 58.395676C902.282378 739.715459 869.874162 787.594378 828.803459 828.803459L828.803459 828.803459 828.803459 828.803459zM828.803459 828.803459" p-id="2548"></path><path d="M654.252973 661.670054l-114.411243-61.910486c-36.504216 38.967351-120.167784 61.910486-218.167351 61.910486l0-45.913946c55.794162-2.463135 125.481514-10.682811 153.350919-36.089081l-153.766054 0 0-39.797622 166.08173 0 0-13.533405 72.150486 0 0 13.533405 171.008 0 0 39.797622-127.529514 0 106.219243 50.037622 21.725405 0-15.581405 31.965405L654.252973 661.670054zM475.883243 525.948541l-70.932757 0 0-30.747676-83.248432 20.092541L321.702054 467.718919l83.248432-20.092541 0-25.40627-83.248432 0 0-39.769946 83.248432 0 0-27.066811 70.932757 0L475.883243 525.948541zM582.905081 355.383351l-65.619027 0-21.337946 53.303351-9.824865 0 9.824865 31.965405 34.871351 0 23.773405 33.625946c-19.677405 1.632865-40.600216 1.632865-62.740757 1.632865l0 45.526486c135.693838 3.293405 223.065946-22.555676 235.353946-146.376649L574.27027 375.060757 582.905081 355.383351zM661.642378 408.686703c-10.267676 27.869405-28.284541 44.281081-50.867892 53.718486l-23.773405-31.993081-37.306811 0 9.437405-21.725405L661.642378 408.686703z" p-id="2549"></path></svg>
|
After Width: | Height: | Size: 3.0 KiB |
1
src/icons/svg/mail.svg
Normal file
1
src/icons/svg/mail.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623311793331" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5508" xmlns:xlink="http://www.w3.org/1999/xlink" width="120" height="120"><defs><style type="text/css"></style></defs><path d="M451.715072 607.152128c16.086016-16.119808 37.513216-25.00608 60.284928-25.00608 22.772736 0 44.199936 8.886272 60.285952 25.00608l14.373888 14.388224 90.033152 90.135552 282.881024-283.143168L544.457728 13.011968c-17.333248-17.349632-47.581184-17.349632-64.91648 0L83.067904 409.797632l-20.216832 20.235264L345.750528 713.19552 451.715072 607.152128zM314.983424 743.99232 317.904896 741.028864 59.392 482.276352 59.392 488.18176 59.392 495.876096 59.392 513.917952 59.392 999.725056 314.944512 743.953408ZM903.133184 993.91488l-0.09728 0L544.457728 635.004928c-17.333248-17.350656-47.581184-17.350656-64.91648 0L112.009216 1002.820608l-0.058368 0L90.793984 1024l842.394624 0-8.300544-8.30976L903.133184 993.91488zM704.520192 739.528704 708.977664 743.99232 709.055488 743.933952 964.608 999.744512 964.608 495.876096 964.608 488.124416 964.608 479.198208Z" p-id="5509"></path></svg>
|
After Width: | Height: | Size: 1.2 KiB |
1
src/icons/svg/share.svg
Normal file
1
src/icons/svg/share.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623311766316" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4683" xmlns:xlink="http://www.w3.org/1999/xlink" width="120" height="120"><defs><style type="text/css"></style></defs><path d="M853.578 661.715c-65.68 0-119.381 35.158-144.39 89.736L391.713 616.41c18.518-28.693 28.692-63.85 28.692-101.764 0-15.711-1.854-31.448-5.563-46.258l202.703-157.269c26.864 20.348 61.12 32.376 99.059 32.376 91.641 0 160.128-68.46 160.128-159.097 0-90.663-68.512-159.124-160.128-159.124-91.641 0-159.2 68.46-159.2 159.124 0 23.129 4.636 44.404 12.028 62.897L382.44 390.68c-37.012-55.505-98.106-94.372-167.52-94.372A204.97 204.97 0 0 0 9.438 501.691a204.97 204.97 0 0 0 205.485 205.356c42.575 0 82.369-11.076 114.77-31.423l364.711 155.388c4.636 86.027 71.268 149.851 159.175 149.851 91.667 0 159.226-68.435 159.226-159.097 0-90.663-68.512-160.05-159.2-160.05z" fill="#333333" p-id="4684"></path></svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -101,7 +101,10 @@ export default {
|
||||
shop_share: 'Share Setting',
|
||||
shop_mail: 'Mails',
|
||||
create_mail: 'New Mail',
|
||||
edit_mail: 'Edit Mail'
|
||||
edit_mail: 'Edit Mail',
|
||||
shop_announce: 'Announce',
|
||||
create_announce: 'New Announce',
|
||||
edit_announce: 'Edit Announce'
|
||||
},
|
||||
navbar: {
|
||||
logOut: 'Log Out',
|
||||
|
@ -101,7 +101,10 @@ export default {
|
||||
shop_share: '分享设置',
|
||||
shop_mail: '邮件',
|
||||
create_mail: '新邮件',
|
||||
edit_mail: '编辑邮件'
|
||||
edit_mail: '编辑邮件',
|
||||
shop_announce: '公告',
|
||||
create_announce: '新建公告',
|
||||
edit_announce: '编辑公告'
|
||||
},
|
||||
navbar: {
|
||||
logOut: '退出登录',
|
||||
|
@ -18,7 +18,7 @@ import * as directives from '@/directives'
|
||||
import * as filters from '@/filters'
|
||||
import local from '@/utils/storage'
|
||||
|
||||
require('@/utils/Extend')
|
||||
import '@/utils/Extend'
|
||||
|
||||
Vue.use(ElementUI, {
|
||||
size: AppModule.size,
|
||||
|
@ -123,7 +123,7 @@ const shopRoutes: RouteConfig = {
|
||||
meta: {
|
||||
title: 'shop_lottery',
|
||||
permissions: ['shop:edit'],
|
||||
icon: 'game'
|
||||
icon: 'lottery'
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -133,7 +133,7 @@ const shopRoutes: RouteConfig = {
|
||||
meta: {
|
||||
title: 'shop_share',
|
||||
permissions: ['shop:edit'],
|
||||
icon: 'game'
|
||||
icon: 'share'
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -143,7 +143,7 @@ const shopRoutes: RouteConfig = {
|
||||
meta: {
|
||||
title: 'shop_mail',
|
||||
permissions: ['shopmail:read'],
|
||||
icon: 'list'
|
||||
icon: 'mail'
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -167,6 +167,38 @@ const shopRoutes: RouteConfig = {
|
||||
elicon: 'el-icon-arrow-right',
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'announce_list',
|
||||
component: () => import('@/views/announce/list.vue'),
|
||||
name: 'AnnounceList',
|
||||
meta: {
|
||||
title: 'shop_announce',
|
||||
permissions: ['shopannounce:read'],
|
||||
icon: 'announce'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'announce_new',
|
||||
component: () => import('@/views/announce/edit.vue'),
|
||||
name: 'CreateAnnounce',
|
||||
meta: {
|
||||
title: 'create_announce',
|
||||
icon: 'edit',
|
||||
permissions: ['shopannounce:edit'],
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'announce_edit/:id',
|
||||
component: () => import('@/views/announce/edit.vue'),
|
||||
name: 'AnnounceEditor',
|
||||
meta: {
|
||||
title: 'edit_announce',
|
||||
permissions: ['shopannounce:read'],
|
||||
elicon: 'el-icon-arrow-right',
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -42,3 +42,5 @@ export const EVENT_SHOP_UPDATE = 'event_shop_update'
|
||||
* @type {string}
|
||||
*/
|
||||
export const EVENT_ROLE_UPDATE = 'event_role_update'
|
||||
export const EVENT_MAIL_UPDATE = 'event_mail_update'
|
||||
export const EVENT_ANNOUNCE_UPDATE = 'event_announce_update'
|
||||
|
342
src/views/announce/edit.vue
Normal file
342
src/views/announce/edit.vue
Normal file
@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
ref="postForm"
|
||||
:model="postForm"
|
||||
:rules="rules"
|
||||
label-width="121px"
|
||||
class="form-container"
|
||||
>
|
||||
<el-form-item :label="$t('main.shop')" prop="shop" v-if="userLevel === 1">
|
||||
<el-select
|
||||
v-model="postForm.shop"
|
||||
:placeholder="'选择'+$t('main.shop')"
|
||||
name="shop"
|
||||
required
|
||||
class="w100"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allDepts"
|
||||
:key="item._id"
|
||||
:label="item.name"
|
||||
:value="item._id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="公告类型">
|
||||
<el-radio-group v-model="postForm.type">
|
||||
<el-radio :label="0">指定收件人</el-radio>
|
||||
<el-radio :label="1">群发</el-radio>
|
||||
<el-radio :label="2">所有玩家</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="收件人"
|
||||
prop="accounts"
|
||||
v-if="postForm.type === 0"
|
||||
>
|
||||
<el-transfer
|
||||
v-model="postForm.accounts"
|
||||
:props="{
|
||||
key: 'accountId',
|
||||
label: 'nickname'
|
||||
}"
|
||||
filterable
|
||||
:filter-method="filterMethod"
|
||||
filter-placeholder="请输入用户名"
|
||||
:titles="['可选', '已选']"
|
||||
:data="userList">
|
||||
</el-transfer>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="公告标题"
|
||||
prop="title"
|
||||
>
|
||||
<el-input
|
||||
v-model="postForm.title"
|
||||
name="title"
|
||||
style="width: 50%"
|
||||
required
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="公告内容"
|
||||
prop="content"
|
||||
>
|
||||
<el-input
|
||||
v-model="postForm.content"
|
||||
type="textarea"
|
||||
name="content"
|
||||
style="width: 50%"
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="发送时间"
|
||||
prop="sendDate"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="sendDate"
|
||||
type="datetime"
|
||||
name="sendDate"
|
||||
placeholder="选择发送时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="过期时间"
|
||||
prop="endDate"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="endDate"
|
||||
type="datetime"
|
||||
placeholder="选择过期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
:disabled = "!postForm.shop"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button @click="onCancel">
|
||||
取消
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Watch } from 'vue-property-decorator'
|
||||
import { AppModule } from '@/store/modules/app'
|
||||
import { ITagView, TagsViewModule } from '@/store/modules/tags-view'
|
||||
import UploadImage from '@/components/UploadImage/index.vue'
|
||||
import { getShops, getShopUsers } from '@/api/shop'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { EVENT_ANNOUNCE_UPDATE, EVENT_COUPON_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import i18n from '@/lang'
|
||||
import { IShopData } from '@/api/types'
|
||||
import { defaultAnnounceData, getAnnounce, saveAnnounce } from '@/api/announce'
|
||||
|
||||
@Component({
|
||||
name: 'AnnounceEditor',
|
||||
components: {
|
||||
UploadImage
|
||||
}
|
||||
})
|
||||
export default class extends Vue {
|
||||
private validateRequire = (rule: any, value: string, callback: Function) => {
|
||||
if (value === '') {
|
||||
if (rule.field === 'imageURL') {
|
||||
this.$message({
|
||||
message: 'Upload cover image is required',
|
||||
type: 'error'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: rule.field + ' 是必填的',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
callback(new Error(rule.field + ' 是必填的'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
private postForm = Object.assign({}, defaultAnnounceData)
|
||||
private loading = false
|
||||
private rules = {
|
||||
shop: [{ required: true, message: '请输入店铺', trigger: 'blur' }],
|
||||
title: [{ required: true, message: '请输入公告标题', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入公告内容', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
private innerModalRules = {
|
||||
itemId: [{ required: true, message: '请选择一个物品', trigger: 'blur' }],
|
||||
count: [{ required: true, message: '请填写数量', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
private allDepts:IShopData[] = []
|
||||
|
||||
private tempTagView?: ITagView
|
||||
|
||||
private userList = []
|
||||
|
||||
private sendDate: Date = new Date()
|
||||
private endDate: Date = new Date().addDays(7)
|
||||
|
||||
get lang() {
|
||||
return AppModule.language
|
||||
}
|
||||
|
||||
$refs!: {
|
||||
postForm: HTMLFormElement
|
||||
innerModalForm: HTMLFormElement
|
||||
}
|
||||
|
||||
get userLevel() {
|
||||
return UserModule.level
|
||||
}
|
||||
|
||||
created() {
|
||||
const id = this.$route.params?.id
|
||||
if (UserModule.level === 1) {
|
||||
this.getRemoteDeptList('')
|
||||
EventBus.$on(EVENT_SHOP_UPDATE, () => {
|
||||
this.getRemoteDeptList()
|
||||
})
|
||||
} else {
|
||||
this.postForm.shop = UserModule.department
|
||||
this.getUserList(this.postForm.shop)
|
||||
this.getCouponList(this.postForm.shop)
|
||||
}
|
||||
if (id) {
|
||||
this.fetchData(id)
|
||||
}
|
||||
this.tempTagView = Object.assign({}, this.$route)
|
||||
}
|
||||
|
||||
beforeDestory() {
|
||||
if (UserModule.level === 1) {
|
||||
EventBus.$off(EVENT_SHOP_UPDATE)
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('postForm.shop')
|
||||
private shopChange(val: string) {
|
||||
this.getUserList(this.postForm.shop!)
|
||||
}
|
||||
|
||||
@Watch('sendDate')
|
||||
private sendDateChange(val: Date) {
|
||||
if (!this.endDate || this.sendDate.getTime() > this.endDate.getTime()) {
|
||||
this.endDate = val.addDays(7)
|
||||
}
|
||||
}
|
||||
|
||||
private async fetchData(id: string) {
|
||||
try {
|
||||
const { data } = await getAnnounce(id, { /* Your params here */ })
|
||||
console.log(data)
|
||||
this.postForm = data
|
||||
// Just for test
|
||||
const title = this.lang === 'zh' ? '编辑公告' : 'Edit Announce'
|
||||
// Set tagsview title
|
||||
this.setTagsViewTitle(title)
|
||||
// Set page title
|
||||
this.setPageTitle(title)
|
||||
if (data.sendTime !== undefined) {
|
||||
this.sendDate = new Date(data.sendTime)
|
||||
}
|
||||
if (data.endTime !== undefined) {
|
||||
this.endDate = new Date(data.endTime)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
private setTagsViewTitle(title: string) {
|
||||
const tagView = this.tempTagView
|
||||
if (tagView) {
|
||||
tagView.title = `${title}-${this.postForm._id}`
|
||||
TagsViewModule.updateVisitedView(tagView)
|
||||
}
|
||||
}
|
||||
|
||||
private setPageTitle(title: string) {
|
||||
document.title = `${title} - ${this.postForm._id}`
|
||||
}
|
||||
|
||||
private async submitForm() {
|
||||
try {
|
||||
await this.$refs.postForm.validate()
|
||||
if (!this.sendDate) {
|
||||
this.$message({
|
||||
message: '请指定发送时间',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (!this.postForm.shop) {
|
||||
this.$message({
|
||||
message: `请选择一个${i18n.tc('main.shop')}`,
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.postForm.type === 0 && this.postForm.accounts.length === 0) {
|
||||
this.$message({
|
||||
message: '请指定收件人',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.postForm.shopShop = this.getShopName(this.postForm.shop)
|
||||
if (this.postForm.type === 1) {
|
||||
this.postForm.shops = [this.postForm.shop]
|
||||
}
|
||||
this.loading = true
|
||||
this.postForm.sendTime = this.sendDate.getTime()
|
||||
if (this.endDate) {
|
||||
this.postForm.endTime = this.endDate.getTime()
|
||||
}
|
||||
const { data } = await saveAnnounce(this.postForm)
|
||||
this.postForm = data
|
||||
this.loading = false
|
||||
this.$notify({
|
||||
title: 'Success',
|
||||
message: '公告保存成功',
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
EventBus.$emit(EVENT_ANNOUNCE_UPDATE, {})
|
||||
} catch (err) {
|
||||
console.error('Submit Error!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private async onCancel() {
|
||||
try {
|
||||
await this.$confirm('确认不保存当前信息?', 'Warning', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
this.$store.dispatch('delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private async getRemoteDeptList(name?: string) {
|
||||
const { data } = await getShops({ key: name })
|
||||
if (!data.records) return
|
||||
this.allDepts = data.records
|
||||
}
|
||||
|
||||
private getShopName(shop: string) {
|
||||
for (const _d of this.allDepts) {
|
||||
if (_d._id! === shop) {
|
||||
return _d.name
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
private async getUserList(shop: string) {
|
||||
const { data } = await getShopUsers({ shop })
|
||||
this.userList = data
|
||||
}
|
||||
|
||||
private filterMethod(query: string, item: any) {
|
||||
return item.nickname.indexOf(query) > -1
|
||||
}
|
||||
}
|
||||
</script>
|
379
src/views/announce/list.vue
Normal file
379
src/views/announce/list.vue
Normal file
@ -0,0 +1,379 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- filter -->
|
||||
<el-form ref="filterForm" :inline="true" :model="filterForm" class="filter">
|
||||
<el-form-item label="关键字" prop="key">
|
||||
<el-input v-model="filterForm.key" placeholder="关键字"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('main.shop')" prop="key" v-if="userLevel === 1">
|
||||
<el-select
|
||||
v-model="filterForm.sender"
|
||||
:placeholder="'选择'+$t('main.shop')"
|
||||
name="sender"
|
||||
required
|
||||
class="w100"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allDepts"
|
||||
:key="item._id"
|
||||
:label="item.name"
|
||||
:value="item._id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
<el-button @click="resetFilterForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<router-link to="/shop/announce_new">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
v-permission="['shopannounce:edit']"
|
||||
>
|
||||
添加
|
||||
</el-button>
|
||||
</router-link>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%;margin-top:30px;"
|
||||
>
|
||||
<el-table-column
|
||||
width="180px"
|
||||
align="center"
|
||||
label="添加时间"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{ row.createdAt | parseTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="发送时间"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{ formatSendTime(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="类型"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{ formatType(row)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="收件人"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{ formatReceive(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="200px"
|
||||
label="公告标题"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<router-link
|
||||
:to="'/shop/announce_edit/'+row._id"
|
||||
class="link-type"
|
||||
>
|
||||
<span>{{ row.title }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="publish"
|
||||
align="center"
|
||||
label="审核状态"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="row.publish ? 'info': 'danger'"
|
||||
>{{ formPublish(row.publish) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
width="320"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:type="scope.row.publish? 'warning': 'success'"
|
||||
size="small"
|
||||
style="margin-left: 10px"
|
||||
v-permission="['shopannounce:publish']"
|
||||
@click="publishShop(scope)"
|
||||
>
|
||||
{{ scope.row.publish? '取消审核': '通过审核' }}
|
||||
</el-button>
|
||||
<router-link :to="'/shop/announce_edit/'+scope.row._id">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit"
|
||||
style="margin-left: 10px"
|
||||
v-permission="['shopannounce:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
</router-link>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
style="margin-left: 10px"
|
||||
v-permission="['shopannounce:delete']"
|
||||
@click="handleDelete(scope)"
|
||||
>
|
||||
{{ $t('permission.delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator'
|
||||
import { IShopData } from '@/api/types'
|
||||
import Pagination from '@/components/Pagination/index.vue'
|
||||
import { getShops, updateShopPublish } from '@/api/shop'
|
||||
import { parseTime } from '@/utils'
|
||||
import { getAllCategory, getAllTags } from '@/api/question'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { EVENT_ACTIVITY_UPDATE, EVENT_ANNOUNCE_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { LAST_SHOP } from '@/utils/storage'
|
||||
import { deleteAnnounce, getAnnounces, IAnnounceData, publishAnnounce } from '@/api/announce'
|
||||
import i18n from '@/lang'
|
||||
|
||||
@Component({
|
||||
name: 'AnnounceList',
|
||||
components: {
|
||||
Pagination
|
||||
},
|
||||
filters: {
|
||||
parseTime: (timestamp: string) => {
|
||||
return parseTime(timestamp)
|
||||
},
|
||||
parseDate: (timestamp: string) => {
|
||||
if (!timestamp) {
|
||||
return '-'
|
||||
}
|
||||
return parseTime(timestamp, '{y}-{m}-{d}')
|
||||
},
|
||||
formatCount: (count: string) => {
|
||||
if (!count) {
|
||||
return 0
|
||||
}
|
||||
return count
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default class extends Vue {
|
||||
private total = 0
|
||||
private list: IAnnounceData[] = []
|
||||
private listLoading = true
|
||||
private allDepts: IShopData[] = []
|
||||
private listQuery = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
key: '',
|
||||
sender: ''
|
||||
}
|
||||
|
||||
private typeOptions: any[] = []
|
||||
private tagSet: Set<string> = new Set()
|
||||
private tagOptions: string[] = []
|
||||
private filterForm = {
|
||||
key: '',
|
||||
sender: ''
|
||||
}
|
||||
|
||||
$refs!: {
|
||||
filterForm: HTMLFormElement
|
||||
}
|
||||
|
||||
get userLevel() {
|
||||
return UserModule.level
|
||||
}
|
||||
|
||||
async created() {
|
||||
if (UserModule.level === 1) {
|
||||
await this.getRemoteDeptList()
|
||||
EventBus.$on(EVENT_SHOP_UPDATE, () => {
|
||||
this.getRemoteDeptList()
|
||||
})
|
||||
if (this.$local.get(LAST_SHOP)) {
|
||||
this.filterForm.sender = this.$local.get(LAST_SHOP).id
|
||||
this.listQuery.sender = this.$local.get(LAST_SHOP).id
|
||||
}
|
||||
} else {
|
||||
this.filterForm.sender = UserModule.department
|
||||
this.listQuery.sender = UserModule.department
|
||||
}
|
||||
await this.getRemoteCategory()
|
||||
await this.getList()
|
||||
EventBus.$on(EVENT_ANNOUNCE_UPDATE, () => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
|
||||
beforeDestory() {
|
||||
EventBus.$off(EVENT_ANNOUNCE_UPDATE)
|
||||
if (UserModule.level === 1) {
|
||||
EventBus.$off(EVENT_SHOP_UPDATE)
|
||||
}
|
||||
}
|
||||
|
||||
private async getList() {
|
||||
this.listLoading = true
|
||||
const { data } = await getAnnounces(this.listQuery)
|
||||
this.listLoading = false
|
||||
this.list = data.records
|
||||
this.total = data.total
|
||||
}
|
||||
|
||||
private async handleDelete(scope: any) {
|
||||
const { $index, row } = scope
|
||||
await this.$confirm('确认删除该记录?', 'Warning', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
await deleteAnnounce({ ids: [row._id] })
|
||||
this.list.splice($index, 1)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
}
|
||||
|
||||
private search() {
|
||||
this.filterData()
|
||||
}
|
||||
|
||||
private filterData() {
|
||||
this.listQuery.key = this.filterForm.key
|
||||
this.listQuery.sender = this.filterForm.sender
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
}
|
||||
|
||||
private resetFilterForm() {
|
||||
this.$refs.filterForm.resetFields()
|
||||
}
|
||||
|
||||
private async getRemoteDeptList() {
|
||||
const { data } = await getShops({ })
|
||||
if (!data.records) return
|
||||
this.allDepts = data.records
|
||||
}
|
||||
|
||||
private async getRemoteTags() {
|
||||
const { data } = await getAllTags()
|
||||
console.log(data)
|
||||
this.tagSet = new Set(data)
|
||||
this.tagOptions = data
|
||||
}
|
||||
|
||||
private async getRemoteCategory() {
|
||||
const { data } = await getAllCategory()
|
||||
for (const cat of data) {
|
||||
const subArr = []
|
||||
for (const s of cat.children) {
|
||||
subArr.push({
|
||||
value: s._id,
|
||||
label: s.name
|
||||
})
|
||||
}
|
||||
this.typeOptions.push({
|
||||
value: cat._id,
|
||||
label: cat.name,
|
||||
children: subArr
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private formatDept(row: number, column: number, cellValue: string) {
|
||||
let result = '未指定'
|
||||
for (const dep of this.allDepts) {
|
||||
if (dep._id === cellValue) {
|
||||
result = dep.name
|
||||
break
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private formatBool(row: number, column: number, cellValue: boolean) {
|
||||
return cellValue ? '是' : '否'
|
||||
}
|
||||
|
||||
private formatReceive(data: any) {
|
||||
if (data.type === 0) {
|
||||
return `${data.accounts.length}人`
|
||||
} else if (data.type === 1) {
|
||||
return data.senderShop
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
private formatType(data: any) {
|
||||
switch (data.type) {
|
||||
case 0: return '普通'
|
||||
case 1: return '店铺群发'
|
||||
case 2: return '所有玩家'
|
||||
}
|
||||
}
|
||||
|
||||
private formatItems(data: any) {
|
||||
return data.items.length + '件物品'
|
||||
}
|
||||
|
||||
private formatSendTime(data: any) {
|
||||
let str = `${parseTime(data.sendTime, '{y}/{m}/{d}')}`
|
||||
if (data.endTime) {
|
||||
str += `-${parseTime(data.endTime, '{y}/{m}/{d}')}`
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
private formPublish(cellValue: boolean) {
|
||||
return cellValue ? '已审核' : '未审核'
|
||||
}
|
||||
|
||||
private async publishShop(scope: any) {
|
||||
const { row } = scope
|
||||
const str = row.publish ? '确认取消该记录的审核状态?' : '确定通过该记录的审核?'
|
||||
try {
|
||||
await this.$confirm(str, 'Warning', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
await publishAnnounce({ id: row._id, publish: !row.publish })
|
||||
row.publish = !row.publish
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -206,7 +206,7 @@ import { ITagView, TagsViewModule } from '@/store/modules/tags-view'
|
||||
import UploadImage from '@/components/UploadImage/index.vue'
|
||||
import { getShops, getShopUsers } from '@/api/shop'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { EVENT_COUPON_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { EVENT_COUPON_UPDATE, EVENT_MAIL_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { defaultMailData, defaultMailItem, getMail, IMailItem, saveMail } from '@/api/mail'
|
||||
import i18n from '@/lang'
|
||||
import { getCoupons, ICouponData } from '@/api/coupon'
|
||||
@ -393,7 +393,7 @@ export default class extends Vue {
|
||||
type: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
EventBus.$emit(EVENT_COUPON_UPDATE, {})
|
||||
EventBus.$emit(EVENT_MAIL_UPDATE, {})
|
||||
} catch (err) {
|
||||
console.error('Submit Error!')
|
||||
return false
|
||||
|
@ -149,7 +149,7 @@ import { getShops } from '@/api/shop'
|
||||
import { parseTime } from '@/utils'
|
||||
import { getAllCategory, getAllTags } from '@/api/question'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { EVENT_ACTIVITY_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { EVENT_ACTIVITY_UPDATE, EVENT_MAIL_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { deleteMail, getMails, IMailData } from '@/api/mail'
|
||||
import { LAST_SHOP } from '@/utils/storage'
|
||||
|
||||
@ -221,13 +221,13 @@ export default class extends Vue {
|
||||
}
|
||||
await this.getRemoteCategory()
|
||||
await this.getList()
|
||||
EventBus.$on(EVENT_ACTIVITY_UPDATE, () => {
|
||||
EventBus.$on(EVENT_MAIL_UPDATE, () => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
|
||||
beforeDestory() {
|
||||
EventBus.$off(EVENT_ACTIVITY_UPDATE)
|
||||
EventBus.$off(EVENT_MAIL_UPDATE)
|
||||
if (UserModule.level === 1) {
|
||||
EventBus.$off(EVENT_SHOP_UPDATE)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user