用户管理列表页增加同步组织人员按钮
用户管理列表页搜索用户可设置为全局搜索
This commit is contained in:
@ -25,6 +25,7 @@ enum Api {
|
||||
User = '/organization/user',
|
||||
MultiInfo = '/organization/user/info/multi',
|
||||
Password = '/organization/user/reset-password',
|
||||
syncOrgAndUser='/organization/syncOrgAndUser/fromDataCenter',
|
||||
enabled = '/organization/user/enabled',
|
||||
Online = '/organization/user/online-users/page',
|
||||
OffOnline = '/organization/user/offline-users',
|
||||
@ -107,6 +108,20 @@ export async function resetUserPassword(id: String, mode: ErrorMessageMode = 'mo
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 同步部门人员
|
||||
*/
|
||||
export async function syncOrgAndUser(source: String, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put(
|
||||
{
|
||||
url: Api.syncOrgAndUser,
|
||||
data: { source },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 更新用户
|
||||
|
||||
@ -6,10 +6,13 @@
|
||||
<a-button type="primary" v-auth="'user:add'" @click="handleCreate">{{
|
||||
t('新增用户')
|
||||
}}</a-button>
|
||||
<a-button type="primary" v-auth="'user:resetPassword'" @click="handleReset">{{
|
||||
<a-button type="default" v-auth="'user:resetPassword'" @click="handleReset">{{
|
||||
t('重置密码')
|
||||
}}</a-button>
|
||||
<a-button type="primary" v-auth="'user:unlock'" @click="handleLock">
|
||||
<a-button type="default" v-auth="'user:syncOrgAndUser'" @click="handleSync">{{
|
||||
t('同步组织人员')
|
||||
}}</a-button>
|
||||
<a-button type="default" v-auth="'user:unlock'" @click="handleLock">
|
||||
{{ lockText }}
|
||||
</a-button>
|
||||
</template>
|
||||
@ -43,7 +46,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, h, ref, computed } from 'vue';
|
||||
import { BasicTable, useTable, TableAction, FormSchema, BasicColumn } from '/@/components/Table';
|
||||
import { getUserPageList, deleteUser, resetUserPassword, userEnabled } from '/@/api/system/user';
|
||||
import { getUserPageList, deleteUser, resetUserPassword, userEnabled, syncOrgAndUser } from '/@/api/system/user';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
@ -54,6 +57,12 @@
|
||||
import { Tag } from 'ant-design-vue';
|
||||
const { t } = useI18n();
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'isSearchAll',
|
||||
label: t('全局搜索'),
|
||||
component: 'Checkbox',
|
||||
colProps: { style:'width:100px;' },
|
||||
},
|
||||
{
|
||||
field: 'userName',
|
||||
label: t('用户名'),
|
||||
@ -172,7 +181,7 @@
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
//发送请求默认新增 左边树结构所选机构id
|
||||
return { ...params, departmentId: selectDeptId.value };
|
||||
return params.isSearchAll?{...params}:{ ...params, departmentId: selectDeptId.value };
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
@ -238,6 +247,13 @@
|
||||
function handleCancel() {
|
||||
isVisible.value = false;
|
||||
}
|
||||
function handleSync(){
|
||||
syncOrgAndUser("fromDataCenter");
|
||||
notification.success({
|
||||
message: t('开始同步组织和人员,请稍后刷新页面查看结果'),
|
||||
description: t('成功'),
|
||||
});
|
||||
}
|
||||
function handleReset() {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
notification.warning({
|
||||
@ -301,6 +317,7 @@
|
||||
handleSuccess,
|
||||
handleSelect,
|
||||
handleReset,
|
||||
handleSync,
|
||||
handleLock,
|
||||
lockText,
|
||||
handleCancel,
|
||||
|
||||
Reference in New Issue
Block a user