| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import i18n from '@/locales'
- export default {
- created () {
- this.singleActions = [
- {
- label: i18n.t('system.notify.topic.receiver.management'),
- action: (obj) => {
- this.sidePageTriggerHandle(this, 'NotifyTopicSidePage', {
- id: obj.id,
- resource: 'topics',
- apiVersion: 'v1',
- getParams: this.getParam,
- }, {
- list: this.list,
- tab: 'subscriber',
- })
- },
- meta: (obj) => {
- return {
- validate: true,
- }
- },
- },
- {
- label: i18n.t('system.text_225'),
- permission: 'topics_perform_enable',
- action: (obj) => {
- this.createDialog('DisableDialog', {
- title: i18n.t('system.text_225'),
- name: this.$t('dictionary.notify-topic'),
- columns: this.columns,
- data: [obj],
- ok: async () => {
- try {
- const response = await this.onManager('performAction', {
- id: obj.id,
- managerArgs: {
- action: 'enable',
- },
- })
- return response
- } catch (error) {
- throw error
- }
- },
- })
- },
- meta: (obj) => {
- return {
- validate: this.isAdminMode && !obj.enabled,
- }
- },
- },
- {
- label: i18n.t('system.text_226'),
- permission: 'topics_perform_disable',
- action: (obj) => {
- this.createDialog('DisableDialog', {
- title: i18n.t('system.text_226'),
- name: this.$t('dictionary.notify-topic'),
- columns: this.columns,
- data: [obj],
- ok: async () => {
- try {
- const response = await this.onManager('performAction', {
- id: obj.id,
- managerArgs: {
- action: 'disable',
- },
- })
- return response
- } catch (error) {
- throw error
- }
- },
- })
- },
- meta: (obj) => {
- return {
- validate: this.isAdminMode && obj.enabled,
- }
- },
- },
- ]
- },
- }
|