Blame view

ant-design-vue-jeecg/src/views/system/SysGatewayRouteList.vue 2.78 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<template>
  <a-card :bordered="false">
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="showModal(null)" type="primary" icon="plus">新增</a-button>
    </div>
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="false"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
         <span slot="status" slot-scope="text, record, index">
            <a-tag color="pink" v-if="text==0">禁用</a-tag>
肖超群 authored
22
            <a-tag color="#87d068" v-if="text==1">正常</a-tag>
肖超群 authored
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        </span>
        <span slot="action" slot-scope="text, record">
          <a @click="showModal(record)">编辑</a>

          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>
    <gate-way-route-modal ref="modalForm" @ok="modalFormOk"></gate-way-route-modal>
  </a-card>
</template>

<script>
肖超群 authored
48
49
50
51
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import GateWayRouteModal from './modules/GateWayRouteModal'
肖超群 authored
52
肖超群 authored
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
export default {
  name: 'TenantList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    GateWayRouteModal
  },
  data() {
    return {
      description: 'adad管理页面',
      // 表头
      columns: [
        {
          title: '路由ID',
          align: 'center',
          dataIndex: 'routerId'
        }, {
          title: '路由名称',
          align: 'center',
          dataIndex: 'name'
肖超群 authored
72
        },
肖超群 authored
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
        {
          title: '路由URI',
          align: 'center',
          dataIndex: 'uri'
        },
        {
          title: '状态',
          align: 'center',
          dataIndex: 'status',
          scopedSlots: {customRender: 'status'}
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: {customRender: 'action'}
        }
      ],
      url: {
        list: '/sys/gatewayRoute/list',
        delete: '/sys/gatewayRoute/delete'
      },
      dictOptions: {}
    }
  },
  created() {
  },
  methods: {
    showModal(record) {
      this.$refs['modalForm'].show(record)
肖超群 authored
105
106
    }
  }
肖超群 authored
107
}
肖超群 authored
108
109
</script>
<style scoped>
肖超群 authored
110
@import '~@assets/less/common.less';
肖超群 authored
111
</style>