SysGatewayRouteList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 操作按钮区域 -->
  4. <div class="table-operator">
  5. <a-button @click="showModal(null)" type="primary" icon="plus">新增</a-button>
  6. </div>
  7. <div>
  8. <a-table
  9. ref="table"
  10. size="middle"
  11. :scroll="{x:true}"
  12. bordered
  13. rowKey="id"
  14. :columns="columns"
  15. :dataSource="dataSource"
  16. :pagination="false"
  17. :loading="loading"
  18. class="j-table-force-nowrap"
  19. @change="handleTableChange">
  20. <span slot="status" slot-scope="text, record, index">
  21. <a-tag color="pink" v-if="text==0">禁用</a-tag>
  22. <a-tag color="#87d068" v-if="text==1" >正常</a-tag>
  23. </span>
  24. <span slot="action" slot-scope="text, record">
  25. <a @click="showModal(record)">编辑</a>
  26. <a-divider type="vertical"/>
  27. <a-dropdown>
  28. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  29. <a-menu slot="overlay">
  30. <a-menu-item>
  31. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  32. <a>删除</a>
  33. </a-popconfirm>
  34. </a-menu-item>
  35. </a-menu>
  36. </a-dropdown>
  37. </span>
  38. </a-table>
  39. </div>
  40. <gate-way-route-modal ref="modalForm" @ok="modalFormOk"></gate-way-route-modal>
  41. </a-card>
  42. </template>
  43. <script>
  44. import '@/assets/less/TableExpand.less'
  45. import { mixinDevice } from '@/utils/mixin'
  46. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  47. import GateWayRouteModal from './modules/GateWayRouteModal'
  48. export default {
  49. name: 'TenantList',
  50. mixins: [JeecgListMixin, mixinDevice],
  51. components: {
  52. GateWayRouteModal
  53. },
  54. data() {
  55. return {
  56. description: 'adad管理页面',
  57. // 表头
  58. columns: [
  59. {
  60. title: '路由ID',
  61. align: 'center',
  62. dataIndex: 'routerId'
  63. }, {
  64. title: '路由名称',
  65. align: 'center',
  66. dataIndex: 'name'
  67. },
  68. {
  69. title: '路由URI',
  70. align: 'center',
  71. dataIndex: 'uri'
  72. },
  73. {
  74. title: '状态',
  75. align: 'center',
  76. dataIndex: 'status',
  77. scopedSlots: { customRender: 'status' }
  78. },
  79. {
  80. title: '操作',
  81. dataIndex: 'action',
  82. align: 'center',
  83. fixed: 'right',
  84. width: 147,
  85. scopedSlots: { customRender: 'action' }
  86. }
  87. ],
  88. url: {
  89. list: '/sys/gatewayRoute/list',
  90. delete: '/sys/gatewayRoute/delete'
  91. },
  92. dictOptions: {}
  93. }
  94. },
  95. created() {
  96. },
  97. methods: {
  98. showModal(record) {
  99. this.$refs['modalForm'].show(record)
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped>
  105. @import '~@assets/less/common.less';
  106. </style>