| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['system:user:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="80px" inline> |
| | | <el-form-item label="è´¦å·" prop="username"> |
| | | <el-input v-model="searchForm.username" v-trim placeholder="请è¾å
¥" @keypress.enter.native="search"/> |
| | | </el-form-item> |
| | | <el-form-item label="å§å" prop="realname"> |
| | | <el-input v-model="searchForm.realname" v-trim placeholder="请è¾å
¥" @keypress.enter.native="search"/> |
| | | </el-form-item> |
| | | <el-form-item label="èç³»æ¹å¼" prop="mobile"> |
| | | <el-input v-model="searchForm.mobile" v-trim placeholder="请è¾å
¥" @keypress.enter.native="search"/> |
| | | </el-form-item> |
| | | <el-form-item label="ä¼ä¸åç§°" prop="companyName"> |
| | | <el-input v-model="searchForm.companyName" 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> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | :default-sort = "{prop: 'createTime', order: 'descending'}" |
| | | stripe |
| | | @sort-change="handleSortChange" |
| | | > |
| | | <el-table-column label="åºå·" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{scope.$index + 1}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="username" label="è´¦å·" min-width="120px"></el-table-column> |
| | | <el-table-column prop="realname" label="å§å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="mobile" label="èç³»æ¹å¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="companyName" label="å½å±å
¬å¸" min-width="100px"></el-table-column> |
| | | <el-table-column label="ææä¼ä¸" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span>{{row.authNum}}å®¶</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¯å¦è¶
管" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.isAdmin === '1'">æ¯</span> |
| | | <span v-if="row.isAdmin === '0'">å¦</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-if="!row.fixed" |
| | | @change="changeStatus($event, row)" |
| | | v-model="row.status" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="0" |
| | | :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="100" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.authorizedEnterprise.open('ææä¼ä¸è®°å½', row.id)">ææä¼ä¸</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | <authorizedEnterprise ref="authorizedEnterprise" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/common/Pagination' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import { updUserStatus } from '@/api/system/user' |
| | | import authorizedEnterprise from '@/components/business/authorizedEnterprise' |
| | | export default { |
| | | name: 'userManagement', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, authorizedEnterprise }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | username: '', |
| | | realname: '', |
| | | mobile: '', |
| | | companyName: '', |
| | | type: 1 |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ç¨æ·', |
| | | api: '/system/user', |
| | | 'field.main': 'realname', |
| | | sorts: [{ |
| | | property: 'CREATE_TIME', |
| | | direction: 'DESC' |
| | | }] |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeStatus(status, row) { |
| | | updUserStatus({ |
| | | id: row.id, |
| | | status |
| | | }).then(res => { |
| | | this.search() |
| | | }).catch(err => { |
| | | row.status = row.status === 0 ? 1 : 0 |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/style/variables.scss"; |
| | | // å表头åå¤ç |
| | | .table-column-avatar { |
| | | img { |
| | | width: 48px; |
| | | } |
| | | } |
| | | </style> |