SysCheckRuleList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-model-item label="规则名称" prop="ruleName">
  9. <a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"/>
  10. </a-form-model-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-model-item label="规则Code" prop="ruleCode">
  14. <a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"/>
  15. </a-form-model-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. </template>
  19. <a-col :md="6" :sm="8">
  20. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  21. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  22. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  23. <a @click="handleToggleSearch" style="margin-left: 8px">
  24. {{ toggleSearchStatus ? '收起' : '展开' }}
  25. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  26. </a>
  27. </span>
  28. </a-col>
  29. </a-row>
  30. </a-form-model>
  31. </div>
  32. <!-- 操作按钮区域 -->
  33. <div class="table-operator">
  34. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  35. <a-button type="primary" icon="download" @click="handleExportXls('编码校验规则')">导出</a-button>
  36. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  37. <a-button type="primary" icon="import">导入</a-button>
  38. </a-upload>
  39. <a-dropdown v-if="selectedRowKeys.length > 0">
  40. <a-menu slot="overlay">
  41. <a-menu-item key="1" @click="batchDel">
  42. <a-icon type="delete"/>
  43. 删除
  44. </a-menu-item>
  45. </a-menu>
  46. <a-button style="margin-left: 8px"> 批量操作
  47. <a-icon type="down"/>
  48. </a-button>
  49. </a-dropdown>
  50. </div>
  51. <!-- table区域-begin -->
  52. <a-alert type="info" showIcon style="margin-bottom: 16px;">
  53. <template slot="message">
  54. <span>已选择</span>
  55. <a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
  56. <span>项</span>
  57. <template v-if="selectedRowKeys.length>0">
  58. <a-divider type="vertical"/>
  59. <a @click="onClearSelected">清空</a>
  60. </template>
  61. </template>
  62. </a-alert>
  63. <a-table
  64. ref="table"
  65. size="middle"
  66. bordered
  67. rowKey="id"
  68. :columns="columns"
  69. :dataSource="dataSource"
  70. :pagination="ipagination"
  71. :loading="loading"
  72. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  73. @change="handleTableChange">
  74. <template slot="action" slot-scope="text, record">
  75. <a @click="handleEdit(record)">编辑</a>
  76. <a-divider type="vertical"/>
  77. <a @click="handleTest(record)">功能测试</a>
  78. <a-divider type="vertical"/>
  79. <a-dropdown>
  80. <a class="ant-dropdown-link">
  81. <span>更多</span>
  82. <a-icon type="down"/>
  83. </a>
  84. <a-menu slot="overlay">
  85. <a-menu-item>
  86. <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">删除</a-popconfirm>
  87. </a-menu-item>
  88. </a-menu>
  89. </a-dropdown>
  90. </template>
  91. </a-table>
  92. <!-- table区域-end -->
  93. <!-- 表单区域 -->
  94. <sys-check-rule-modal ref="modalForm" @ok="modalFormOk"/>
  95. <sys-check-rule-test-modal ref="testModal"/>
  96. </a-card>
  97. </template>
  98. <script>
  99. import JEllipsis from '@/components/jeecg/JEllipsis'
  100. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  101. import SysCheckRuleModal from './modules/SysCheckRuleModal'
  102. import SysCheckRuleTestModal from './modules/SysCheckRuleTestModal'
  103. export default {
  104. name: 'SysCheckRuleList',
  105. mixins: [JeecgListMixin],
  106. components: { SysCheckRuleModal, SysCheckRuleTestModal, JEllipsis },
  107. data() {
  108. return {
  109. description: '编码校验规则管理页面',
  110. // 表头
  111. columns: [
  112. {
  113. title: '#',
  114. key: 'rowIndex',
  115. width: 60,
  116. align: 'center',
  117. customRender: (t, r, i) => i + 1
  118. },
  119. {
  120. title: '规则名称',
  121. align: 'center',
  122. dataIndex: 'ruleName'
  123. },
  124. {
  125. title: '规则Code',
  126. align: 'center',
  127. dataIndex: 'ruleCode'
  128. },
  129. {
  130. title: '规则描述',
  131. align: 'center',
  132. dataIndex: 'ruleDescription',
  133. customRender: (t) => (<j-ellipsis value={t} length={48}/>)
  134. },
  135. {
  136. title: '操作',
  137. dataIndex: 'action',
  138. align: 'center',
  139. scopedSlots: { customRender: 'action' },
  140. }
  141. ],
  142. url: {
  143. list: '/sys/checkRule/list',
  144. delete: '/sys/checkRule/delete',
  145. deleteBatch: '/sys/checkRule/deleteBatch',
  146. exportXlsUrl: 'sys/checkRule/exportXls',
  147. importExcelUrl: 'sys/checkRule/importExcel',
  148. },
  149. }
  150. },
  151. computed: {
  152. importExcelUrl: function () {
  153. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  154. }
  155. },
  156. methods: {
  157. handleTest(record) {
  158. this.$refs.testModal.open(record.ruleCode)
  159. }
  160. }
  161. }
  162. </script>
  163. <style scoped>
  164. @import '~@assets/less/common.less';
  165. </style>