165275bc46d5a295ed73b2913fde567b22657fce.svn-base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <a-card :bordered="false" class="card-area">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <!-- 搜索区域 -->
  6. <a-form layout="inline" @keyup.enter.native="searchQuery">
  7. <a-row :gutter="24">
  8. <a-col :md="6" :sm="8">
  9. <a-form-item label="名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
  10. <a-input placeholder="请输入名称查询" v-model="queryParam.roleName"></a-input>
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="10" :sm="12">
  14. <a-form-item label="创建时间" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
  15. <j-date v-model="queryParam.createTime_begin" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择开始时间" ></j-date>
  16. <span style="width: 10px;">~</span>
  17. <j-date v-model="queryParam.createTime_end" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择结束时间"></j-date>
  18. </a-form-item>
  19. </a-col>
  20. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  21. <a-col :md="6" :sm="24">
  22. <a-button type="primary" @click="searchQuery">查询</a-button>
  23. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  24. </a-col>
  25. </span>
  26. </a-row>
  27. </a-form>
  28. </div>
  29. <!-- 操作按钮区域 -->
  30. <div class="table-operator" style="margin-top: 5px">
  31. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  32. <a-button type="primary" icon="download" @click="handleExportXls('角色信息')">导出</a-button>
  33. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  34. <a-button type="primary" icon="import">导入</a-button>
  35. </a-upload>
  36. <a-dropdown v-if="selectedRowKeys.length > 0">
  37. <a-menu slot="overlay">
  38. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</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. <div>
  47. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  48. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. @change="handleTableChange">
  62. <span slot="action" slot-scope="text, record">
  63. <a @click="handleEdit(record)">编辑</a>
  64. <a-divider type="vertical" />
  65. <a-dropdown>
  66. <a class="ant-dropdown-link">
  67. 更多 <a-icon type="down" />
  68. </a>
  69. <a-menu slot="overlay">
  70. <a-menu-item>
  71. <a @click="handlePerssion(record.id)">授权</a>
  72. </a-menu-item>
  73. <a-menu-item>
  74. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  75. <a>删除</a>
  76. </a-popconfirm>
  77. </a-menu-item>
  78. </a-menu>
  79. </a-dropdown>
  80. </span>
  81. </a-table>
  82. </div>
  83. <!-- table区域-end -->
  84. <!-- 表单区域 -->
  85. <role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
  86. <user-role-modal ref="modalUserRole"></user-role-modal>
  87. </a-card>
  88. </template>
  89. <script>
  90. import RoleModal from './modules/RoleModal'
  91. import UserRoleModal from './modules/UserRoleModal'
  92. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  93. import JDate from '@/components/jeecg/JDate'
  94. export default {
  95. name: "RoleList",
  96. mixins:[JeecgListMixin],
  97. components: {
  98. RoleModal,
  99. UserRoleModal,
  100. JDate
  101. },
  102. data () {
  103. return {
  104. description: '角色管理页面',
  105. // 查询条件
  106. queryParam: {roleName:'',},
  107. // 表头
  108. columns: [
  109. {
  110. title: '#',
  111. dataIndex: '',
  112. key:'rowIndex',
  113. width:60,
  114. align:"center",
  115. customRender:function (t,r,index) {
  116. return parseInt(index)+1;
  117. }
  118. },
  119. {
  120. title: '角色名称',
  121. align:"center",
  122. dataIndex: 'roleName'
  123. },
  124. {
  125. title: '角色编码',
  126. align:"center",
  127. dataIndex: 'roleCode'
  128. },
  129. {
  130. title: '备注',
  131. align:"center",
  132. dataIndex: 'description'
  133. },
  134. {
  135. title: '创建时间',
  136. dataIndex: 'createTime',
  137. align:"center",
  138. sorter: true
  139. },
  140. {
  141. title: '更新时间',
  142. dataIndex: 'updateTime',
  143. align:"center",
  144. sorter: true
  145. },
  146. {
  147. title: '操作',
  148. dataIndex: 'action',
  149. align:"center",
  150. scopedSlots: { customRender: 'action' },
  151. }
  152. ],
  153. url: {
  154. list: "/sys/role/list",
  155. delete: "/sys/role/delete",
  156. deleteBatch: "/sys/role/deleteBatch",
  157. exportXlsUrl: "/sys/role/exportXls",
  158. importExcelUrl: "sys/role/importExcel",
  159. },
  160. }
  161. },
  162. computed: {
  163. importExcelUrl: function(){
  164. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  165. }
  166. },
  167. methods: {
  168. handlePerssion: function(roleId){
  169. // alert(roleId);
  170. this.$refs.modalUserRole.show(roleId);
  171. },
  172. onChangeDate(date, dateString) {
  173. console.log(date, dateString);
  174. },
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. @import '~@assets/less/common.less'
  180. </style>