91cf4b35715a63ceb4f10518ee9f55196b9a7968.svn-base 5.9 KB

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