Blame view

ant-design-vue-jeecg/src/views/system/SysGatewayRouteList.vue 2.91 KB
1
<template>
2
3
4
5
  <a-card :bordered="false">
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="showModal(null)" type="primary" icon="plus">新增</a-button>
6
    </div>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    <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>
            <a-tag color="#87d068" v-if="text==1" >正常</a-tag>
        </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>
41
    </div>
42
    <gate-way-route-modal ref="modalForm" @ok="modalFormOk"></gate-way-route-modal>
43
44
45
46
  </a-card>
</template>

<script>
47
48
49
50
51

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import GateWayRouteModal from './modules/GateWayRouteModal'
52
53

  export default {
54
55
56
57
58
59
    name: 'TenantList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      GateWayRouteModal
    },
    data() {
60
      return {
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
        description: 'adad管理页面',
        // 表头
        columns: [
          {
            title: '路由ID',
            align: 'center',
            dataIndex: 'routerId'
          }, {
            title: '路由名称',
            align: 'center',
            dataIndex: 'name'
          },
          {
            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: {
94
          list: '/sys/gatewayRoute/list',
95
          delete: '/sys/gatewayRoute/delete'
96
        },
97
        dictOptions: {}
98
99
100
101
102
      }
    },
    created() {
    },
    methods: {
103
104
      showModal(record) {
        this.$refs['modalForm'].show(record)
105
106
107
108
      }
    }
  }
</script>
109
110
111
<style scoped>
  @import '~@assets/less/common.less';
</style>