index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <el-card class="content-z">
  3. <!-- 操作按钮区域 -->
  4. <div class="table-operator" style="margin: 5px 0;float: right">
  5. <a-button v-permission="['pc:system:dict:add']" type="primary" icon="plus" @click="handleAdd">新增</a-button>
  6. <a-dropdown v-if="selectedRowKeys.length > 0">
  7. <a-menu slot="overlay">
  8. <a-menu-item key="1" v-permission="['pc:system:dict:remove']" @click="batchDel">
  9. <a-icon type="delete" />
  10. 删除
  11. </a-menu-item>
  12. </a-menu>
  13. <a-button style="margin-left: 8px">
  14. 批量操作
  15. <a-icon type="down" />
  16. </a-button>
  17. </a-dropdown>
  18. </div>
  19. <!-- 查询区域 -->
  20. <div class="table-page-search-wrapper">
  21. <a-form layout="inline" @keyup.enter.native="searchQuery">
  22. <a-form-item>
  23. <a-input
  24. v-model="queryParam.dictName"
  25. style="width: 250px"
  26. placeholder="请输入字典名称"
  27. />
  28. </a-form-item>
  29. <a-form-item>
  30. <a-button type="primary" @click="searchQuery">查询</a-button>
  31. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  32. </a-form-item>
  33. </a-form>
  34. </div>
  35. <!-- table区域-begin -->
  36. <div>
  37. <div class="ant-alert ant-alert-info" style="margin: 16px 0;">
  38. <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择&nbsp;<a style="font-weight: 600">{{
  39. selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  40. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  41. </div>
  42. <a-table
  43. ref="table"
  44. size="middle"
  45. bordered
  46. row-key="dictId"
  47. :columns="columns"
  48. :data-source="dataSource"
  49. :pagination="ipagination"
  50. :loading="loading"
  51. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  52. @change="handleTableChange"
  53. >
  54. <span slot="action" slot-scope="text, record">
  55. <a-button v-permission="['pc:system:dict:edit']" size="small" type="primary" @click="handleEdit(record)">
  56. 编辑
  57. </a-button>
  58. <a-divider type="vertical" />
  59. <a-button v-permission="['pc:system:dict:edit']" size="small" type="primary" @click="editDictItem(record)">
  60. 字典配置
  61. </a-button>
  62. <a-divider type="vertical" />
  63. <a-popconfirm
  64. v-permission="['pc:system:dict:remove']"
  65. title="确定删除吗?"
  66. @confirm="() => handleDelete(record.dictId)"
  67. >
  68. <a-button size="small" type="danger">
  69. 删除
  70. </a-button>
  71. </a-popconfirm>
  72. </span>
  73. </a-table>
  74. <check-and-edit-model ref="modalForm" @ok="modalFormOk" />
  75. <dict-item-list ref="dictItemList" />
  76. </div>
  77. <!-- table区域-end -->
  78. <!-- 表单区域 -->
  79. </el-card>
  80. </template>
  81. <script>
  82. import { listMixin } from '@/mixin/listMixin'
  83. import columns from './indexColumns'
  84. import CheckAndEditModel from './CheckAndEditModel'
  85. import DictItemList from './DictItemList'
  86. export default {
  87. components: {
  88. CheckAndEditModel,
  89. DictItemList
  90. },
  91. mixins: [listMixin],
  92. data() {
  93. return {
  94. // 查询条件
  95. queryParam: {},
  96. // 表头
  97. columns: columns(this),
  98. url: {
  99. list: '/system/dict/type/list',
  100. delete: '/system/dict/type/',
  101. exportXlsUrl: '/exportXlsUrl',
  102. importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
  103. }
  104. }
  105. },
  106. created() {
  107. },
  108. methods: {
  109. editDictItem(record) {
  110. this.$refs.dictItemList.edit(record)
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped>
  116. @import '~@/assets/less/common.less'
  117. </style>