| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <page-list
- :list="list"
- :columns="columns"
- :group-actions="groupActions"
- :single-actions="singleActions" />
- </template>
- <script>
- import ColumnsMixin from '../mixins/columns'
- import SingleActionsMixin from '../mixins/singleActions'
- import WindowsMixin from '@/mixins/windows'
- import ListMixin from '@/mixins/list'
- import { getCreatedAtFilter } from '@/utils/common/tableFilter'
- export default {
- name: 'NotifyConfigList',
- mixins: [WindowsMixin, ListMixin, ColumnsMixin, SingleActionsMixin],
- props: {
- id: String,
- getParams: {
- type: Object,
- },
- },
- data () {
- return {
- list: this.$list.createList(this, {
- id: this.id,
- resource: 'notifyconfigs',
- apiVersion: 'v1',
- getParams: this.getParam,
- filterOptions: {
- name: {
- label: this.$t('system.text_101'),
- filter: true,
- formatter: val => {
- return `name.contains("${val}")`
- },
- },
- created_at: getCreatedAtFilter(),
- },
- hiddenColumns: ['created_at'],
- }),
- groupActions: [{
- label: this.$t('system.text_128'),
- permission: 'notifyconfigs_create',
- action: () => {
- this.$router.push({
- path: '/notifyconfig/create',
- })
- },
- meta: () => {
- return {
- buttonType: 'primary',
- }
- },
- }, {
- label: this.$t('system.text_129'),
- permission: 'notifyconfigs_delete',
- action: (row) => {
- this.createDialog('DeleteResDialog', {
- vm: this,
- data: this.list.selectedItems,
- columns: this.columns,
- title: this.$t('system.text_129'),
- name: this.$t('system.notify_channels'),
- onManager: this.onManager,
- })
- },
- meta: () => this.$getDeleteResult(this.list.selectedItems),
- }],
- }
- },
- created () {
- this.initSidePageTab('detail')
- this.list.fetchData()
- },
- methods: {
- getParam () {
- const ret = {
- ...this.getParams,
- details: true,
- }
- return ret
- },
- handleOpenSidepage (row) {
- this.sidePageTriggerHandle(this, 'NotifyConfigSidePage', {
- id: row.id,
- resource: 'notifyconfigs',
- apiVersion: 'v1',
- getParams: this.getParam,
- }, {
- list: this.list,
- })
- },
- },
- }
- </script>
|