| | |
| | | <el-button class="filter-item" type="success" @click="reset"> |
| | | {{ $t('table.reset') }} |
| | | </el-button> |
| | | <el-dropdown v-has-any-permission="['user:add','user:delete','user:reset','user:export']" trigger="click" class="filter-item"> |
| | | <el-button v-has-permission="['user:add']" class="filter-item" type="success" @click.native="add"> |
| | | {{ $t('table.add') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:delete']" class="filter-item" type="success" @click.native="batchDelete"> |
| | | {{ $t('table.delete') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:reset']" class="filter-item" type="success" @click.native="resetPassword"> |
| | | {{ $t('table.resetPassword') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:export']" class="filter-item" type="success" @click.native="exportExcel"> |
| | | {{ $t('table.export') }} |
| | | </el-button> |
| | | <el-button class="filter-item" icon="el-icon-download" type="primary" plain @click="templateDownload"> |
| | | {{ $t('table.templateDownload') }} |
| | | </el-button> |
| | | <el-upload |
| | | class="upload" |
| | | :action="uploadAction" |
| | | :headers="headers" |
| | | list-type="picture" |
| | | :show-file-list="false" |
| | | :before-upload="beforeUpload" |
| | | :on-success="uploadSuccess" |
| | | :on-error="uploadError" |
| | | :on-progress="uploadProgress" |
| | | > |
| | | <el-button v-has-permission="['user:import']" class="filter-item" icon="el-icon-upload2" type="success" plain> |
| | | {{ $t('table.import') }} |
| | | </el-button> |
| | | </el-upload> |
| | | <!-- <el-dropdown v-has-any-permission="['user:add','user:delete','user:reset','user:export']" trigger="click" class="filter-item"> |
| | | <el-button> |
| | | {{ $t('table.more') }}<i class="el-icon-arrow-down el-icon--right" /> |
| | | </el-button> |
| | |
| | | <el-dropdown-item v-has-permission="['user:reset']" @click.native="resetPassword">{{ $t('table.resetPassword') }}</el-dropdown-item> |
| | | <el-dropdown-item v-has-permission="['user:export']" @click.native="exportExcel">{{ $t('table.export') }}</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </el-dropdown> --> |
| | | </div> |
| | | |
| | | <el-table |
| | |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column type="selection" align="center" width="40px" /> |
| | | |
| | | <el-table-column label="部门(护卫点)" align="center" min-width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.deptName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :label="$t('table.user.username')" prop="username" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.username }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | :label="$t('table.user.sex')" |
| | | :filters="[{ text: $t('common.sex.male'), value: '0' }, { text: $t('common.sex.female'), value: '1' }, { text: $t('common.sex.secret'), value: '2' }]" |
| | | :filter-method="filterSex" |
| | | class-name="status-col" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag :type="row.sex | sexFilter"> |
| | | {{ transSex(row.sex) }} |
| | | </el-tag> |
| | | <el-table-column label="员工姓名" prop="nickName" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.nickName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="身份证号" prop="certificateNumb" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.certificateNumb }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="手机" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.mobile }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :label="$t('table.user.email')" :show-overflow-tooltip="true" align="center" min-width="150px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.email }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :label="$t('table.user.dept')" align="center" min-width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.deptName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | </el-table-column> |
| | | <el-table-column :label="$t('table.operation')" align="center" min-width="150px" class-name="small-padding fixed-width"> |
| | | <template slot-scope="{row}"> |
| | | <i v-hasPermission="['user:view']" class="el-icon-view table-operation" style="color: #87d068;" @click="view(row)" /> |
| | | <!--<i v-hasPermission="['user:view']" class="el-icon-view table-operation" style="color: #87d068;" @click="view(row)" />--> |
| | | <i v-hasPermission="['user:update']" class="el-icon-setting table-operation" style="color: #2db7f5;" @click="edit(row)" /> |
| | | <i v-hasPermission="['user:delete']" class="el-icon-delete table-operation" style="color: #f50;" @click="singleDelete(row)" /> |
| | | <el-link v-has-no-permission="['user:view','user:update','user:delete']" class="no-perm"> |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import UserEdit from './Edit' |
| | | import UserView from './View' |
| | | |
| | | import { getFileType } from '@/utils' |
| | | import { getToken } from '@/utils/auth' |
| | | import NProgress from 'nprogress' |
| | | export default { |
| | | name: 'UserManage', |
| | | components: { Pagination, UserEdit, UserView }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadAction: `${process.env.VUE_APP_BASE_API}system/user/import`, |
| | | headers: { |
| | | Authorization: `bearer ${getToken()}` |
| | | }, |
| | | dialog: { |
| | | isVisible: false, |
| | | title: '' |
| | |
| | | this.fetch() |
| | | }, |
| | | methods: { |
| | | templateDownload() { |
| | | this.$download('system/user/template', {}, 'excel_import_user.xlsx') |
| | | }, |
| | | beforeUpload(file) { |
| | | const type = getFileType(file.name) |
| | | if (type !== 'xlsx') { |
| | | this.$message({ |
| | | message: this.$t('tips.onlySupportXlsx'), |
| | | type: 'error' |
| | | }) |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }, |
| | | uploadError() { |
| | | this.$message({ |
| | | message: this.$t('tips.uploadFailed'), |
| | | type: 'error' |
| | | }) |
| | | NProgress.done() |
| | | }, |
| | | uploadSuccess(response) { |
| | | const data = response.data |
| | | this.data = data.data |
| | | this.error = data.error |
| | | this.time = data.time |
| | | NProgress.done() |
| | | this.fetch() |
| | | this.dialogVisible = true |
| | | }, |
| | | uploadProgress() { |
| | | NProgress.start() |
| | | }, |
| | | transSex(sex) { |
| | | switch (sex) { |
| | | case '0': |