| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <TableLayout :permissions="['system:role:query']"> | 
|---|
|  |  |  | <!-- æç´¢è¡¨å --> | 
|---|
|  |  |  | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|---|
|  |  |  | <el-form-item label="è§è²ç¼ç " prop="code"> | 
|---|
|  |  |  | <el-input v-model="searchForm.code" v-trim placeholder="请è¾å
¥è§è²ç¼ç " @keypress.enter.native="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="è§è²åç§°" prop="name"> | 
|---|
|  |  |  | <el-input v-model="searchForm.name" v-trim placeholder="请è¾å
¥è§è²åç§°" @keypress.enter.native="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <section> | 
|---|
|  |  |  | <el-button type="primary" icon="el-icon-search" @click="search">æç´¢</el-button> | 
|---|
|  |  |  | <el-button @click="reset">éç½®</el-button> | 
|---|
|  |  |  | </section> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | <!-- è¡¨æ ¼åå页 --> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['system:role:create', 'system:role:delete']"> | 
|---|
|  |  |  | <li v-permissions="['system:role:create']"><el-button type="primary" @click="$refs.operaRoleWindow.open('æ°å»ºè§è²')" icon="el-icon-plus">æ°å»º</el-button></li> | 
|---|
|  |  |  | <li v-permissions="['system:role:delete']"><el-button @click="deleteByIdInBatch" icon="el-icon-delete">å é¤</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | :height="tableHeightNew" | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | :default-sort = "{prop: 'createTime', order: 'descending'}" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | @sort-change="handleSortChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column type="selection" fixed="left" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="è§è²ç¼ç " fixed="left" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="name" label="è§è²åç§°" fixed="left" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="remark" label="è§è²å¤æ³¨" min-width="120px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createUser" label="å建人" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createTime" label="å建æ¶é´" min-width="140px" sortable="custom" sort-by="role.CREATE_TIME"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="updateUser" label="æ´æ°äºº" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}">{{row.updateUserInfo == null ? '' : row.updateUserInfo.username}}</template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="140px"></el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-if="containPermissions(['system:role:update', 'system:role:createRolePermission', 'system:role:createRoleMenu', 'system:role:delete'])" | 
|---|
|  |  |  | label="æä½" | 
|---|
|  |  |  | min-width="270" | 
|---|
|  |  |  | fixed="right" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template v-if="isAdmin || (row.code !== adminCode && userInfo.roles.findIndex(code => code === row.code) === -1)" slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.operaRoleWindow.open('ç¼è¾è§è²', row)" icon="el-icon-edit" v-permissions="['system:role:update']">ç¼è¾</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.permissionConfigWindow.open(row)" v-permissions="['system:role:createRolePermission']">é
ç½®æé</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.menuConfigWindow.open(row)" icon="el-icon-menu" v-permissions="['system:role:createRoleMenu']">ææèå</el-button> | 
|---|
|  |  |  | <el-button v-if="!row.fixed" type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['system:role:delete']">å é¤</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <pagination | 
|---|
|  |  |  | @size-change="handleSizeChange" | 
|---|
|  |  |  | @current-change="handlePageChange" | 
|---|
|  |  |  | :pagination="tableData.pagination" | 
|---|
|  |  |  | ></pagination> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <!-- æ°å»º/修湠--> | 
|---|
|  |  |  | <OperaRoleWindow ref="operaRoleWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> | 
|---|
|  |  |  | <!-- é
ç½®æé --> | 
|---|
|  |  |  | <PermissionConfigWindow ref="permissionConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> | 
|---|
|  |  |  | <!-- ææèå --> | 
|---|
|  |  |  | <MenuConfigWindow ref="menuConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import TableLayout from '@/layouts/TableLayout' | 
|---|
|  |  |  | import BaseTable from '@/components/base/BaseTable' | 
|---|
|  |  |  | import OperaRoleWindow from '@/components/system/role/OperaRoleWindow' | 
|---|
|  |  |  | import PermissionConfigWindow from '@/components/system/role/PermissionConfigWindow' | 
|---|
|  |  |  | import MenuConfigWindow from '@/components/system/role/MenuConfigWindow' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'SystemRole', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { MenuConfigWindow, PermissionConfigWindow, OperaRoleWindow, TableLayout, Pagination }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // æç´¢ | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | code: '', | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | remark: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: 'è§è²', | 
|---|
|  |  |  | api: '/system/role', | 
|---|
|  |  |  | sorts: [{ | 
|---|
|  |  |  | property: 'role.CREATE_TIME', | 
|---|
|  |  |  | direction: 'DESC' | 
|---|
|  |  |  | }] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|