c9040828443c3831369b180cfdbab713888a6860.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <#list columns as po><#rt/>
  8. <#if po.fieldName !='id' && po_index<= tableVo.searchFieldNum>
  9. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  10. <a-form-item label="${po.filedComment}">
  11. <a-input placeholder="请输入${po.filedComment}" v-model="queryParam.${po.fieldName}"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. </#if>
  15. </#list>
  16. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  17. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  18. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  19. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  20. </span>
  21. </a-col>
  22. </a-row>
  23. </a-form>
  24. </div>
  25. <!-- 操作按钮区域 -->
  26. <div class="table-operator">
  27. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  28. <a-button type="primary" icon="download" @click="handleExportXls('${tableVo.ftlDescription}')">导出</a-button>
  29. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  30. <a-button type="primary" icon="import">导入</a-button>
  31. </a-upload>
  32. <a-dropdown v-if="selectedRowKeys.length > 0">
  33. <a-menu slot="overlay">
  34. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  35. </a-menu>
  36. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  37. </a-dropdown>
  38. </div>
  39. <!-- table区域-begin -->
  40. <div>
  41. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  42. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  43. <span>已选择</span>
  44. <a style="font-weight: 600">
  45. {{ selectedRowKeys.length }}
  46. </a>
  47. <span>项</span>
  48. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  49. </div>
  50. <a-table
  51. ref="table"
  52. size="middle"
  53. bordered
  54. rowKey="id"
  55. :columns="columns"
  56. :dataSource="dataSource"
  57. :pagination="ipagination"
  58. :loading="loading"
  59. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  60. @change="handleTableChange">
  61. <span slot="action" slot-scope="text, record">
  62. <a @click="handleEdit(record)">编辑</a>
  63. <a-divider type="vertical" />
  64. <a-dropdown>
  65. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  66. <a-menu slot="overlay">
  67. <a-menu-item>
  68. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  69. <a>删除</a>
  70. </a-popconfirm>
  71. </a-menu-item>
  72. </a-menu>
  73. </a-dropdown>
  74. </span>
  75. </a-table>
  76. </div>
  77. <!-- table区域-end -->
  78. <!-- 表单区域 -->
  79. <${entityName?uncap_first}-modal ref="modalForm" @ok="modalFormOk"/>
  80. </a-card>
  81. </template>
  82. <script>
  83. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  84. import ${entityName}Modal from './modules/${entityName}Modal'
  85. export default {
  86. name: "${entityName}List",
  87. mixins: [JeecgListMixin],
  88. components: {
  89. ${entityName}Modal
  90. },
  91. data () {
  92. return {
  93. description: '${tableVo.ftlDescription}管理页面',
  94. // 表头
  95. columns: [
  96. {
  97. title: '#',
  98. dataIndex: '',
  99. key: 'rowIndex',
  100. width: 60,
  101. align: "center",
  102. customRender:function (t, r, index) {
  103. return parseInt(index)+1;
  104. }
  105. },
  106. <#list columns as po><#rt/>
  107. <#if po.fieldName !='id'>
  108. {
  109. title: '${po.filedComment}',
  110. align:"center",
  111. dataIndex: '${po.fieldName}'
  112. },
  113. </#if>
  114. </#list>
  115. {
  116. title: '操作',
  117. dataIndex: 'action',
  118. align:"center",
  119. scopedSlots: { customRender: 'action' },
  120. }
  121. ],
  122. // 请求参数
  123. url: {
  124. list: "/${entityPackage}/${entityName?uncap_first}/list",
  125. delete: "/${entityPackage}/${entityName?uncap_first}/delete",
  126. deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
  127. exportXlsUrl: "${entityPackage}/${entityName?uncap_first}/exportXls",
  128. importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
  129. },
  130. }
  131. },
  132. computed: {
  133. importExcelUrl: function(){
  134. <#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
  135. }
  136. },
  137. methods: {
  138. initDictConfig() {
  139. }
  140. }
  141. }
  142. </script>
  143. <style scoped>
  144. @import '~@assets/less/common.less'
  145. </style>