54611956b8c4794720392729b4b0e37c616d0c83.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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"></a-input>
  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"></a-input>
  15. </a-form-model-item>
  16. </a-col>
  17. <a-col :md="6" :sm="8">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-form-model>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <a-button type="primary" icon="download" @click="handleExportXls('填值规则')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button type="primary" icon="import">导入</a-button>
  32. </a-upload>
  33. <a-dropdown v-if="selectedRowKeys.length > 0">
  34. <a-menu slot="overlay">
  35. <a-menu-item key="1" @click="batchDel">
  36. <a-icon type="delete"/>
  37. 删除
  38. </a-menu-item>
  39. </a-menu>
  40. <a-button style="margin-left: 8px"> 批量操作
  41. <a-icon type="down"/>
  42. </a-button>
  43. </a-dropdown>
  44. </div>
  45. <!-- table区域-begin -->
  46. <a-alert type="info" showIcon style="margin-bottom: 16px;">
  47. <template slot="message">
  48. <span>已选择</span>
  49. <a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
  50. <span>项</span>
  51. <template v-if="selectedRowKeys.length>0">
  52. <a-divider type="vertical"/>
  53. <a @click="onClearSelected">清空</a>
  54. </template>
  55. </template>
  56. </a-alert>
  57. <a-table
  58. ref="table"
  59. size="middle"
  60. bordered
  61. rowKey="id"
  62. :columns="columns"
  63. :dataSource="dataSource"
  64. :pagination="ipagination"
  65. :loading="loading"
  66. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  67. @change="handleTableChange">
  68. <span slot="action" slot-scope="text, record">
  69. <a @click="handleEdit(record)">编辑</a>
  70. <a-divider type="vertical"/>
  71. <a-dropdown>
  72. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  73. <a-menu slot="overlay">
  74. <a-menu-item @click="handleTest(record)">
  75. 功能测试
  76. </a-menu-item>
  77. <a-menu-item>
  78. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  79. <a>删除</a>
  80. </a-popconfirm>
  81. </a-menu-item>
  82. </a-menu>
  83. </a-dropdown>
  84. </span>
  85. </a-table>
  86. <!-- table区域-end -->
  87. <!-- 表单区域 -->
  88. <sys-fill-rule-modal ref="modalForm" @ok="modalFormOk"/>
  89. </a-card>
  90. </template>
  91. <script>
  92. import { getAction } from '@/api/manage'
  93. import SysFillRuleModal from './modules/SysFillRuleModal'
  94. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  95. export default {
  96. name: 'SysFillRuleList',
  97. mixins: [JeecgListMixin],
  98. components: { SysFillRuleModal },
  99. data() {
  100. return {
  101. description: '填值规则管理页面',
  102. // 表头
  103. columns: [
  104. {
  105. title: '#',
  106. dataIndex: '',
  107. key: 'rowIndex',
  108. width: 60,
  109. align: 'center',
  110. customRender: (t, r, index) => 1 + index
  111. },
  112. {
  113. title: '规则名称',
  114. align: 'center',
  115. dataIndex: 'ruleName'
  116. },
  117. {
  118. title: '规则Code',
  119. align: 'center',
  120. dataIndex: 'ruleCode'
  121. },
  122. {
  123. title: '规则实现类',
  124. align: 'center',
  125. dataIndex: 'ruleClass'
  126. },
  127. {
  128. title: '规则参数',
  129. align: 'center',
  130. dataIndex: 'ruleParams'
  131. },
  132. {
  133. title: '操作',
  134. dataIndex: 'action',
  135. align: 'center',
  136. scopedSlots: { customRender: 'action' },
  137. }
  138. ],
  139. url: {
  140. list: '/sys/fillRule/list',
  141. test: '/sys/fillRule/testFillRule',
  142. delete: '/sys/fillRule/delete',
  143. deleteBatch: '/sys/fillRule/deleteBatch',
  144. exportXlsUrl: '/sys/fillRule/exportXls',
  145. importExcelUrl: '/sys/fillRule/importExcel',
  146. },
  147. }
  148. },
  149. computed: {
  150. importExcelUrl() {
  151. return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`
  152. }
  153. },
  154. methods: {
  155. handleTest(record) {
  156. let closeLoading = this.$message.loading('生成中...', 0)
  157. getAction(this.url.test, {
  158. ruleCode: record.ruleCode
  159. }).then(res => {
  160. if (res.success) {
  161. this.$info({
  162. title: '填值规则功能测试',
  163. content: '生成结果:' + res.result
  164. })
  165. } else {
  166. this.$message.warn(res.message)
  167. }
  168. }).finally(() => {
  169. closeLoading()
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style scoped>
  176. @import '~@assets/less/common.less'
  177. </style>