UserAllocationList.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-item label="登陆人id">
  9. <a-input placeholder="请输入登陆人id" v-model="queryParam.userId"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="账户id --授权">
  14. <a-input placeholder="请输入账户id --授权" v-model="queryParam.accountId"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :md="6" :sm="8">
  19. <a-form-item label="广告主ID">
  20. <a-input placeholder="请输入广告主ID" v-model="queryParam.advertiserId"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="8">
  24. <a-form-item label="指定分配人">
  25. <a-input placeholder="请输入指定分配人" v-model="queryParam.distributionName"></a-input>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="8">
  29. <a-form-item label="部门id">
  30. <a-input placeholder="请输入部门id" v-model="queryParam.departmentId"></a-input>
  31. </a-form-item>
  32. </a-col>
  33. </template>
  34. <a-col :md="6" :sm="8" >
  35. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  36. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  37. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  38. <a @click="handleToggleSearch" style="margin-left: 8px">
  39. {{ toggleSearchStatus ? '收起' : '展开' }}
  40. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  41. </a>
  42. </span>
  43. </a-col>
  44. </a-row>
  45. </a-form>
  46. </div>
  47. <!-- 操作按钮区域 -->
  48. <div class="table-operator">
  49. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  50. <a-button type="primary" icon="download" @click="handleExportXls('用户分配')">导出</a-button>
  51. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  52. <a-button type="primary" icon="import">导入</a-button>
  53. </a-upload>
  54. <a-dropdown v-if="selectedRowKeys.length > 0">
  55. <a-menu slot="overlay">
  56. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  57. </a-menu>
  58. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  59. </a-dropdown>
  60. </div>
  61. <!-- table区域-begin -->
  62. <div>
  63. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  64. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  65. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  66. </div>
  67. <a-table
  68. ref="table"
  69. size="middle"
  70. bordered
  71. rowKey="id"
  72. :columns="columns"
  73. :dataSource="dataSource"
  74. :pagination="ipagination"
  75. :loading="loading"
  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. <userAllocation-modal ref="modalForm" @ok="modalFormOk"></userAllocation-modal>
  97. </a-card>
  98. </template>
  99. <script>
  100. import UserAllocationModal from './modules/UserAllocationModal'
  101. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  102. export default {
  103. name: "UserAllocationList",
  104. mixins:[JeecgListMixin],
  105. components: {
  106. UserAllocationModal
  107. },
  108. data () {
  109. return {
  110. description: '用户分配管理页面',
  111. // 表头
  112. columns: [
  113. {
  114. title: '#',
  115. dataIndex: '',
  116. key:'rowIndex',
  117. width:60,
  118. align:"center",
  119. customRender:function (t,r,index) {
  120. return parseInt(index)+1;
  121. }
  122. },
  123. {
  124. title: '登陆人id',
  125. align:"center",
  126. dataIndex: 'userId'
  127. },
  128. {
  129. title: '账户id --授权',
  130. align:"center",
  131. dataIndex: 'accountId'
  132. },
  133. {
  134. title: '广告主ID',
  135. align:"center",
  136. dataIndex: 'advertiserId'
  137. },
  138. {
  139. title: '指定分配人',
  140. align:"center",
  141. dataIndex: 'distributionName'
  142. },
  143. {
  144. title: '部门id',
  145. align:"center",
  146. dataIndex: 'departmentId'
  147. },
  148. {
  149. title: '管理员名称',
  150. align:"center",
  151. dataIndex: 'adminName'
  152. },
  153. {
  154. title: '广告主名称',
  155. align:"center",
  156. dataIndex: 'advertiserName'
  157. },
  158. {
  159. title: '输入账号 --登陆',
  160. align:"center",
  161. dataIndex: 'accountName'
  162. },
  163. {
  164. title: '操作人姓名',
  165. align:"center",
  166. dataIndex: 'operationName'
  167. },
  168. {
  169. title: '授权名称',
  170. align: "center",
  171. dataIndex: 'authName'
  172. },
  173. {
  174. title: '平台类型 1 头条 2快手',
  175. align:"center",
  176. dataIndex: 'mediaId'
  177. },
  178. {
  179. title: '操作',
  180. dataIndex: 'action',
  181. align:"center",
  182. scopedSlots: { customRender: 'action' },
  183. }
  184. ],
  185. url: {
  186. list: "/ctop/userAllocation/list",
  187. delete: "/ctop/userAllocation/delete",
  188. deleteBatch: "/ctop/userAllocation/deleteBatch",
  189. exportXlsUrl: "ctop/userAllocation/exportXls",
  190. importExcelUrl: "ctop/userAllocation/importExcel",
  191. },
  192. }
  193. },
  194. computed: {
  195. importExcelUrl: function(){
  196. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  197. }
  198. },
  199. methods: {
  200. }
  201. }
  202. </script>
  203. <style scoped>
  204. @import '~@assets/less/common.less'
  205. </style>