update 优化用户信息及用户查询,实现用户授权角色
This commit is contained in:
@@ -71,7 +71,7 @@ namespace Ewide.Core.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 搜索状态(字典 0正常 1停用 2删除)
|
/// 搜索状态(字典 0正常 1停用 2删除)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CommonStatus SearchStatus { get; set; } = CommonStatus.ENABLE;
|
public CommonStatus? SearchStatus { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AddUserInput : UserInput
|
public class AddUserInput : UserInput
|
||||||
|
|||||||
@@ -103,6 +103,13 @@
|
|||||||
width: 61.8%;
|
width: 61.8%;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
}
|
}
|
||||||
|
.yo-form--fluid {
|
||||||
|
.ant-form-item-control-wrapper {
|
||||||
|
flex: 0 0 100%;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
.ant-form-explain {
|
.ant-form-explain {
|
||||||
font-size: @font-size-base - 1px;
|
font-size: @font-size-base - 1px;
|
||||||
|
|
||||||
|
|||||||
@@ -142,9 +142,6 @@
|
|||||||
|
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
||||||
>a {
|
|
||||||
color: darken(@primary-color, 20%);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
@import '~@/assets/style/app.less';
|
@import '~@/assets/style/app.less';
|
||||||
|
@primary-color: #007bff;
|
||||||
@font-size-base: 13px;
|
@font-size-base: 13px;
|
||||||
@border-radius-base: 0;
|
@border-radius-base: 0;
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ api.$queue = function (queue) {
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
axios,
|
axios,
|
||||||
|
urls,
|
||||||
api,
|
api,
|
||||||
STATUS
|
STATUS
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</Auth>
|
</Auth>
|
||||||
<Auth auth="sysUser:grantData">
|
<Auth auth="sysUser:grantData">
|
||||||
<a-menu-item>
|
<a-menu-item>
|
||||||
<a @click="onOpen('org-form', record)">授权数据</a>
|
<a @click="onOpen('org-form', record)">授权额外数据</a>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</Auth>
|
</Auth>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
@@ -80,7 +80,13 @@
|
|||||||
<a-list-item-meta>
|
<a-list-item-meta>
|
||||||
<div slot="title">{{ record.nickName || record.name }}</div>
|
<div slot="title">{{ record.nickName || record.name }}</div>
|
||||||
<div slot="description">{{ record.account }}</div>
|
<div slot="description">{{ record.account }}</div>
|
||||||
<a-avatar :size="48" :src="record.avatar" icon="user" shape="square" slot="avatar" />
|
<a-avatar
|
||||||
|
:size="48"
|
||||||
|
:src="`${previewUrl}?id=${record.avatar}`"
|
||||||
|
icon="user"
|
||||||
|
shape="square"
|
||||||
|
slot="avatar"
|
||||||
|
/>
|
||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
<div class="yo-list-content--h">
|
<div class="yo-list-content--h">
|
||||||
<div class="yo-list-content--h--item">
|
<div class="yo-list-content--h--item">
|
||||||
@@ -109,14 +115,20 @@
|
|||||||
</container>
|
</container>
|
||||||
<add-form @ok="onReloadData" ref="add-form" />
|
<add-form @ok="onReloadData" ref="add-form" />
|
||||||
<edit-form @ok="onReloadData" ref="edit-form" />
|
<edit-form @ok="onReloadData" ref="edit-form" />
|
||||||
|
<role-form @ok="onReloadData" ref="role-form" />
|
||||||
|
<org-form @ok="onReloadData" ref="org-form" />
|
||||||
</yo-tree-layout>
|
</yo-tree-layout>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { PERVIEW_URL } from '@/util/global';
|
||||||
|
|
||||||
import YoTreeLayout from '@/components/yoTreeLayout';
|
import YoTreeLayout from '@/components/yoTreeLayout';
|
||||||
import YoList from '@/components/yoList';
|
import YoList from '@/components/yoList';
|
||||||
|
|
||||||
import AddForm from './addForm';
|
import AddForm from './addForm';
|
||||||
import EditForm from './editForm';
|
import EditForm from './editForm';
|
||||||
|
import RoleForm from './roleForm';
|
||||||
|
import OrgForm from './orgForm';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -124,6 +136,8 @@ export default {
|
|||||||
YoList,
|
YoList,
|
||||||
AddForm,
|
AddForm,
|
||||||
EditForm,
|
EditForm,
|
||||||
|
RoleForm,
|
||||||
|
OrgForm,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -139,6 +153,8 @@ export default {
|
|||||||
values: [],
|
values: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
previewUrl: PERVIEW_URL,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -231,7 +247,11 @@ export default {
|
|||||||
* 从列表页调用窗口的打开方法
|
* 从列表页调用窗口的打开方法
|
||||||
*/
|
*/
|
||||||
onOpen(formName, record) {
|
onOpen(formName, record) {
|
||||||
this.$refs[formName].onOpen(record, this.query['sysEmpParam.orgId']);
|
try {
|
||||||
|
this.$refs[formName].onOpen(record, this.query['sysEmpParam.orgId']);
|
||||||
|
} catch {
|
||||||
|
console.warn('component open method not found');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onSetUserStatus(record, checked) {
|
onSetUserStatus(record, checked) {
|
||||||
|
|||||||
3
Web/src/pages/system/user/orgForm.vue
Normal file
3
Web/src/pages/system/user/orgForm.vue
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<div></div>
|
||||||
|
</template>
|
||||||
111
Web/src/pages/system/user/roleForm.vue
Normal file
111
Web/src/pages/system/user/roleForm.vue
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<template>
|
||||||
|
<a-modal
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
:visible="visible"
|
||||||
|
@cancel="onCancel"
|
||||||
|
@ok="onOk"
|
||||||
|
class="yo-modal-form"
|
||||||
|
title="授权角色"
|
||||||
|
>
|
||||||
|
<a-form-model class="yo-form" ref="form">
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-icon slot="indicator" spin type="loading" />
|
||||||
|
<div class="yo-form-group">
|
||||||
|
<a-form-model-item class="yo-form--fluid">
|
||||||
|
<a-select mode="multiple" placeholder="请选择角色" v-model="roles">
|
||||||
|
<a-select-option
|
||||||
|
:key="role.id"
|
||||||
|
:value="role.id"
|
||||||
|
v-for="role in roleList"
|
||||||
|
>{{ role.name }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-model-item>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
</a-form-model>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
|
||||||
|
loading: false,
|
||||||
|
|
||||||
|
id: '',
|
||||||
|
roles: [],
|
||||||
|
roleList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 必要的方法
|
||||||
|
* 从外部调用打开本窗口
|
||||||
|
*/
|
||||||
|
async onOpen(record) {
|
||||||
|
this.visible = true;
|
||||||
|
this.id = record.id;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.onInit();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 必要的方法
|
||||||
|
* 点击保存时的操作
|
||||||
|
*/
|
||||||
|
onOk() {
|
||||||
|
this.confirmLoading = true;
|
||||||
|
this.$api
|
||||||
|
/** !!此处必须修改调用的接口方法 */
|
||||||
|
.sysUserGrantRole({
|
||||||
|
id: this.id,
|
||||||
|
grantRoleIdList: this.roles,
|
||||||
|
})
|
||||||
|
.then(({ success }) => {
|
||||||
|
if (success) {
|
||||||
|
this.$message.success('授权成功');
|
||||||
|
this.onCancel();
|
||||||
|
this.$emit('ok');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.confirmLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 必要的方法
|
||||||
|
* 关闭窗口时的操作
|
||||||
|
*/
|
||||||
|
onCancel() {
|
||||||
|
this.visible = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.roles = [];
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
|
||||||
|
async onInit() {
|
||||||
|
this.loading = true;
|
||||||
|
this.roleList = await this.onLoadRoleList();
|
||||||
|
this.roles = await this.onLoadRole();
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoadRoleList() {
|
||||||
|
return this.$api.getRolePage().then(({ data }) => {
|
||||||
|
return data.rows;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoadRole() {
|
||||||
|
return this.$api.sysUserOwnRole({ id: this.id }).then(({ data }) => {
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1 +1,10 @@
|
|||||||
export const EMPTY_ID = '00000000-0000-0000-0000-000000000000'
|
/**
|
||||||
|
* 空GUID
|
||||||
|
*/
|
||||||
|
export const EMPTY_ID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件预览地址
|
||||||
|
*/
|
||||||
|
import { urls } from '@/common/api'
|
||||||
|
export const PERVIEW_URL = process.env.VUE_APP_BASE_URL + urls.sysFileInfoPreview[0]
|
||||||
@@ -2,6 +2,8 @@ let userOpenTimer, userCloseTimer
|
|||||||
|
|
||||||
let initDropdownHeight
|
let initDropdownHeight
|
||||||
|
|
||||||
|
import { PERVIEW_URL } from '@/util/global';
|
||||||
|
|
||||||
import { doLogout } from '@/common/login'
|
import { doLogout } from '@/common/login'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -51,7 +53,7 @@ export default {
|
|||||||
<div class="user-container-inner">
|
<div class="user-container-inner">
|
||||||
<div class="user--base">
|
<div class="user--base">
|
||||||
<a-avatar
|
<a-avatar
|
||||||
src={this.$root.global.info && this.$root.global.info.avatar}
|
src={this.$root.global.info && (`${PERVIEW_URL}?id=${this.$root.global.info.avatar}`)}
|
||||||
class="user--avatar"
|
class="user--avatar"
|
||||||
icon="user"
|
icon="user"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user