qb 5 days ago
parent
commit
bd746fbbef
  1. 157
      src/views/system/user.vue

157
src/views/system/user.vue

@ -11,51 +11,17 @@
</el-col>
<el-col :span="19">
<basic-container>
<avue-crud
:option="option"
v-model:search="search"
:table-loading="loading"
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
:before-open="beforeOpen"
v-model:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<avue-crud :option="option" v-model:search="search" :table-loading="loading" :data="data" ref="crud"
v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
:before-open="beforeOpen" v-model:page="page" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<template #menu-left>
<el-button
type="danger"
plain
icon="el-icon-delete"
v-if="permission.user_delete"
@click="handleDelete"
>
<el-button type="danger" plain icon="el-icon-delete" v-if="permission.user_delete" @click="handleDelete">
</el-button>
<el-button
type="info"
plain
v-if="permission.user_role"
icon="el-icon-user"
@click="handleGrant"
>角色配置
<el-button type="info" plain v-if="permission.user_role" icon="el-icon-user" @click="handleGrant">角色配置
</el-button>
<el-button
type="info"
plain
v-if="permission.user_reset"
icon="el-icon-refresh"
@click="handleReset"
>密码重置
<el-button type="info" plain v-if="permission.user_reset" icon="el-icon-refresh" @click="handleReset">密码重置
</el-button>
<!-- <el-button
type="info"
@ -65,29 +31,14 @@
@click="handlePlatform"
>平台配置
</el-button> -->
<el-button
type="info"
plain
v-if="userInfo.role_name.includes('admin')"
icon="el-icon-coordinate"
@click="handleLock"
>账号解封
<el-button type="info" plain v-if="userInfo.role_name.includes('admin')" icon="el-icon-coordinate"
@click="handleLock">账号解封
</el-button>
<el-button
type="warning"
plain
v-if="userInfo.role_name.includes('admin')"
icon="el-icon-upload"
@click="handleImport"
>导入
<el-button type="warning" plain v-if="userInfo.role_name.includes('admin')" icon="el-icon-upload"
@click="handleImport">导入
</el-button>
<el-button
type="warning"
plain
v-if="userInfo.role_name.includes('admin')"
icon="el-icon-download"
@click="handleExport"
>导出
<el-button type="warning" plain v-if="userInfo.role_name.includes('admin')" icon="el-icon-download"
@click="handleExport">导出
</el-button>
</template>
<template #tenantName="{ row }">
@ -104,16 +55,8 @@
</template>
</avue-crud>
<el-dialog title="用户角色配置" append-to-body v-model="roleBox" width="345px">
<el-tree
:data="roleGrantList"
show-checkbox
check-strictly
default-expand-all
node-key="id"
ref="treeRole"
:default-checked-keys="roleTreeObj"
:props="props"
>
<el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
:default-checked-keys="roleTreeObj" :props="props">
</el-tree>
<template #footer>
<span class="dialog-footer">
@ -132,24 +75,12 @@
</avue-form>
</el-dialog>
<el-dialog title="用户平台配置" append-to-body v-model="platformBox">
<avue-crud
:option="platformOption"
:table-loading="platformLoading"
:data="platformData"
ref="platformCrud"
v-model="platformForm"
:before-open="platformBeforeOpen"
v-model:page="platformPage"
:permission="platformPermissionList"
@row-update="platformRowUpdate"
@search-change="platformSearchChange"
@search-reset="platformSearchReset"
@selection-change="platformSelectionChange"
@current-change="platformCurrentChange"
@size-change="platformSizeChange"
@refresh-change="platformRefreshChange"
@on-load="platformOnLoad"
>
<avue-crud :option="platformOption" :table-loading="platformLoading" :data="platformData" ref="platformCrud"
v-model="platformForm" :before-open="platformBeforeOpen" v-model:page="platformPage"
:permission="platformPermissionList" @row-update="platformRowUpdate" @search-change="platformSearchChange"
@search-reset="platformSearchReset" @selection-change="platformSelectionChange"
@current-change="platformCurrentChange" @size-change="platformSizeChange"
@refresh-change="platformRefreshChange" @on-load="platformOnLoad">
<template #tenantName="{ row }">
<el-tag>{{ row.tenantName }}</el-tag>
</template>
@ -314,6 +245,23 @@ export default {
slot: true,
display: false,
},
{
label: '账号状态',
type: 'select',
slot: true,
display: false,
prop: 'isDeleted',
dicData: [
{
label: '启用',
value: 0
},
{
label: '禁用',
value: 1
}
]
},
{
label: '用户平台',
type: 'select',
@ -711,7 +659,7 @@ export default {
},
},
computed: {
...mapGetters(['userInfo', 'permission']),
...mapGetters(['userInfo', 'permission']),
//
permissionList() {
return {
@ -957,8 +905,7 @@ export default {
}).then(() => {
NProgress.start();
exportBlob(
`/blade-system/user/export-user?${
this.website.tokenHeader
`/blade-system/user/export-user?${this.website.tokenHeader
}=${getToken()}&account=${account}&realName=${realName}`
).then(res => {
downloadXls(res.data, `用户数据表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
@ -1099,19 +1046,23 @@ export default {
</style>
<style scoped lang='scss'>
:deep(.no-print){
margin-left:auto;
.el-button{
margin-right:0
:deep(.no-print) {
margin-left: auto;
.el-button {
margin-right: 0
}
}
:deep(.avue-form__row){
max-width:300px!important;
:deep(.avue-form__row) {
max-width: 300px !important;
}
:deep(.el-form-item__label){
width:auto !important;
:deep(.el-form-item__label) {
width: auto !important;
}
:deep(.el-row){
:deep(.el-row) {
flex-direction: row !important;
}
</style>

Loading…
Cancel
Save