增加前端请求超时配置
用户部门优化(用户所属部门改为列表,增加是否同步配置项) switch组件支持自定义值 基本表格可编辑字段组件增加onUpdate支持响应式
This commit is contained in:
@ -3,6 +3,8 @@ VITE_USE_MOCK = false
|
|||||||
|
|
||||||
# 资源公共路径,需要以 /开头和结尾
|
# 资源公共路径,需要以 /开头和结尾
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /
|
||||||
|
# 路由模式切换为history
|
||||||
|
#VITE_ROUTE_MODE = history
|
||||||
|
|
||||||
# 本地开发代理,可以解决跨域及多地址代理
|
# 本地开发代理,可以解决跨域及多地址代理
|
||||||
# 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题
|
# 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题
|
||||||
@ -16,6 +18,7 @@ VITE_DROP_CONSOLE = false
|
|||||||
# 接口地址
|
# 接口地址
|
||||||
# 如果没有跨域问题,直接在这里配置即可
|
# 如果没有跨域问题,直接在这里配置即可
|
||||||
VITE_GLOB_API_URL=http://10.133.96.105:8077
|
VITE_GLOB_API_URL=http://10.133.96.105:8077
|
||||||
|
#VITE_GLOB_REQUEST_TIMEOUT=20000
|
||||||
# 报表系统地址
|
# 报表系统地址
|
||||||
VITE_GLOB_REPORT_URL=http://10.133.96.105:3100
|
VITE_GLOB_REPORT_URL=http://10.133.96.105:3100
|
||||||
|
|
||||||
@ -35,8 +38,8 @@ VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
|
|||||||
VITE_GLOB_API_URL_PREFIX =
|
VITE_GLOB_API_URL_PREFIX =
|
||||||
|
|
||||||
#租户开关
|
#租户开关
|
||||||
VITE_TENANT_ENABLED = true
|
# VITE_TENANT_ENABLED = true
|
||||||
# 屏蔽通知消息的轮询
|
# 屏蔽通知消息的轮询
|
||||||
VITE_DISABLE_NEWS=false
|
VITE_DISABLE_NEWS=false
|
||||||
# 禁用关闭页面提示
|
# 禁用关闭页面提示
|
||||||
VITE_CLOSE_ALERT_DISABLED=true
|
# VITE_CLOSE_ALERT_DISABLED=true
|
||||||
|
|||||||
@ -42,6 +42,9 @@ export interface UserModel {
|
|||||||
roles: any; //角色信息
|
roles: any; //角色信息
|
||||||
posts: any; //岗位信息
|
posts: any; //岗位信息
|
||||||
chargeDepartments: any; //负责部门
|
chargeDepartments: any; //负责部门
|
||||||
|
departments:any;//所属部门
|
||||||
|
|
||||||
|
isSync: string;//是否同步
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { isBoolean } from '/@/utils/is';
|
import {isBoolean, isNumber} from '/@/utils/is';
|
||||||
import { useAppStore } from '/@/store/modules/app';
|
import { useAppStore } from '/@/store/modules/app';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -37,7 +37,7 @@
|
|||||||
watch(
|
watch(
|
||||||
() => props.checked,
|
() => props.checked,
|
||||||
(val) => {
|
(val) => {
|
||||||
value.value = isBoolean(val) ? val : Number(val)!;
|
value.value = isBoolean(val) ? val : isNumber(val)? Number(val)! : val;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|||||||
@ -89,7 +89,10 @@
|
|||||||
placeholder: createPlaceholderMessage(unref(getComponent)),
|
placeholder: createPlaceholderMessage(unref(getComponent)),
|
||||||
...apiSelectProps,
|
...apiSelectProps,
|
||||||
...omit(compProps, 'onChange'),
|
...omit(compProps, 'onChange'),
|
||||||
[valueField]: value,
|
[valueField]: currentValueRef,
|
||||||
|
["onUpdate:"+valueField]:(newVal)=>{
|
||||||
|
handleChange(newVal);
|
||||||
|
}
|
||||||
} as any;
|
} as any;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
|
|||||||
const {
|
const {
|
||||||
VITE_GLOB_APP_TITLE,
|
VITE_GLOB_APP_TITLE,
|
||||||
VITE_GLOB_API_URL,
|
VITE_GLOB_API_URL,
|
||||||
|
VITE_GLOB_REQUEST_TIMEOUT,
|
||||||
VITE_GLOB_APP_SHORT_NAME,
|
VITE_GLOB_APP_SHORT_NAME,
|
||||||
VITE_GLOB_API_URL_PREFIX,
|
VITE_GLOB_API_URL_PREFIX,
|
||||||
VITE_GLOB_UPLOAD_URL,
|
VITE_GLOB_UPLOAD_URL,
|
||||||
@ -24,6 +25,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
|
|||||||
const glob: Readonly<GlobConfig> = {
|
const glob: Readonly<GlobConfig> = {
|
||||||
title: VITE_GLOB_APP_TITLE,
|
title: VITE_GLOB_APP_TITLE,
|
||||||
apiUrl: VITE_GLOB_API_URL,
|
apiUrl: VITE_GLOB_API_URL,
|
||||||
|
requestTimeout:VITE_GLOB_REQUEST_TIMEOUT,
|
||||||
shortName: VITE_GLOB_APP_SHORT_NAME,
|
shortName: VITE_GLOB_APP_SHORT_NAME,
|
||||||
urlPrefix: VITE_GLOB_API_URL_PREFIX,
|
urlPrefix: VITE_GLOB_API_URL_PREFIX,
|
||||||
uploadUrl: VITE_GLOB_UPLOAD_URL,
|
uploadUrl: VITE_GLOB_UPLOAD_URL,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export function getAppEnvConfig() {
|
|||||||
(import.meta.env as unknown as GlobEnvConfig)
|
(import.meta.env as unknown as GlobEnvConfig)
|
||||||
: window[ENV_NAME as any]) as unknown as GlobEnvConfig;
|
: window[ENV_NAME as any]) as unknown as GlobEnvConfig;
|
||||||
|
|
||||||
const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_UPLOAD_URL, VITE_GLOB_UPLOAD_PREVIEW, VITE_GLOB_OUT_LINK_URL, VITE_GLOB_REPORT_URL, VITE_GLOB_PRINT_BASE_URL } = ENV;
|
const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_REQUEST_TIMEOUT, VITE_GLOB_UPLOAD_URL, VITE_GLOB_UPLOAD_PREVIEW, VITE_GLOB_OUT_LINK_URL, VITE_GLOB_REPORT_URL, VITE_GLOB_PRINT_BASE_URL } = ENV;
|
||||||
|
|
||||||
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
||||||
warn(`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`);
|
warn(`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`);
|
||||||
@ -33,6 +33,7 @@ export function getAppEnvConfig() {
|
|||||||
VITE_GLOB_API_URL,
|
VITE_GLOB_API_URL,
|
||||||
VITE_GLOB_APP_SHORT_NAME,
|
VITE_GLOB_APP_SHORT_NAME,
|
||||||
VITE_GLOB_API_URL_PREFIX,
|
VITE_GLOB_API_URL_PREFIX,
|
||||||
|
VITE_GLOB_REQUEST_TIMEOUT,
|
||||||
VITE_GLOB_UPLOAD_URL,
|
VITE_GLOB_UPLOAD_URL,
|
||||||
VITE_GLOB_UPLOAD_PREVIEW,
|
VITE_GLOB_UPLOAD_PREVIEW,
|
||||||
VITE_GLOB_OUT_LINK_URL,
|
VITE_GLOB_OUT_LINK_URL,
|
||||||
|
|||||||
@ -243,7 +243,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
|
|||||||
// authentication schemes,e.g: Bearer
|
// authentication schemes,e.g: Bearer
|
||||||
// authenticationScheme: 'Bearer',
|
// authenticationScheme: 'Bearer',
|
||||||
authenticationScheme: 'Bearer',
|
authenticationScheme: 'Bearer',
|
||||||
timeout: 10 * 1000,
|
timeout: globSetting.requestTimeout||10 * 1000,
|
||||||
// 基础接口地址
|
// 基础接口地址
|
||||||
// baseURL: globSetting.apiUrl,
|
// baseURL: globSetting.apiUrl,
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@
|
|||||||
label: '组织简称',
|
label: '组织简称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入公司简称',
|
placeholder: '请输入组织简称',
|
||||||
},
|
},
|
||||||
colProps: { lg: 12, md: 12 },
|
colProps: { lg: 12, md: 12 },
|
||||||
},
|
},
|
||||||
@ -129,6 +129,18 @@
|
|||||||
placeholder: '请选择行政区域'
|
placeholder: '请选择行政区域'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'isSync',
|
||||||
|
label: '同步',
|
||||||
|
component: 'Switch',
|
||||||
|
colProps: { span: 12 },
|
||||||
|
helpMessage: '开启同步则会自动修正与域里人员组织数据一致,域里不存在的组织和下级人员组织将被删除',
|
||||||
|
helpComponentProps: { maxWidth: '400px' },
|
||||||
|
componentProps: {
|
||||||
|
checkedValue: 'Y',
|
||||||
|
unCheckedValue: 'N',
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const companySchema: FormSchema[] = [
|
const companySchema: FormSchema[] = [
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
// import { useI18n } from 'vue-i18n';
|
// import { useI18n } from 'vue-i18n';
|
||||||
import { SelectMember } from '/@/components/SelectOrganizational/index';
|
import { SelectMember } from '/@/components/SelectOrganizational/index';
|
||||||
import { deleteDepartment, getDepartmentEnabledTree, getDepartmentTrees, getDepartmentUserList, updateDepartmentUser } from '/@/api/system/department';
|
import { deleteDepartment, getDepartmentTrees, getDepartmentUserList, updateDepartmentUser } from '/@/api/system/department';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
:fixedHeight="true"
|
:fixedHeight="true"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
>
|
>
|
||||||
<a-tabs v-model:activeKey="activeKey" @change="handleTabChange">
|
<a-tabs v-model:activeKey="activeKey" @change="handleTabChange" :class="{ 'h-full': ['1', '2'].includes(activeKey) }">
|
||||||
<a-tab-pane key="1" tab="全部">
|
<a-tab-pane key="1" tab="全部">
|
||||||
<BasicTable @register="registerTableAll" />
|
<BasicTable @register="registerTableAll" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
const emits = defineEmits(['success']);
|
const emits = defineEmits(['success']);
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false, fixedHeight: true });
|
||||||
setSelectedRowKeys1(data.orgs?.map((x) => x.id) || []);
|
setSelectedRowKeys1(data.orgs?.map((x) => x.id) || []);
|
||||||
reload();
|
reload();
|
||||||
});
|
});
|
||||||
@ -138,8 +138,12 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-tabs-content),
|
||||||
:deep(.vben-basic-table .ant-table-wrapper) {
|
:deep(.vben-basic-table .ant-table-wrapper) {
|
||||||
height: auto;
|
height: 100%;
|
||||||
|
}
|
||||||
|
:deep(.vben-basic-table .ant-table) {
|
||||||
|
height: calc(100% - 40px);
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ant-tabs-nav-wrap) {
|
:deep(.ant-tabs-nav-wrap) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
|
||||||
<a-tabs
|
<a-tabs
|
||||||
v-model:activeKey="activeKey"
|
v-model:activeKey="activeKey"
|
||||||
:class="{ 'h-full': ['3', '4', '5'].includes(activeKey) }"
|
:class="{ 'h-full': ['3', '4', '5', '6'].includes(activeKey) }"
|
||||||
>
|
>
|
||||||
<a-tab-pane key="1" tab="基础信息">
|
<a-tab-pane key="1" tab="基础信息">
|
||||||
<BasicForm @register="registerForm1" :style="{ 'margin-right': '10px' }">
|
<BasicForm @register="registerForm1" :style="{ 'margin-right': '10px' }">
|
||||||
@ -79,10 +79,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="6" tab="所属部门" force-render>
|
||||||
|
<BasicTable @register="registerTable4">
|
||||||
|
<template #headerCell="{ column }">
|
||||||
|
<template v-if="column.flag === 'INDEX'">
|
||||||
|
<plus-outlined :style="{ color: '#5E95FF' }" @click="handleDeptCreate" />
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ column.customTitle }}</template>
|
||||||
|
</template>
|
||||||
|
<template #action="{ index }">
|
||||||
|
<a-button type="link" danger @click="handleDelete(index, 4)">删除</a-button>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
<RoleModal @register="registerRoleModal" @success="handleRoleSuccess" />
|
<RoleModal @register="registerRoleModal" @success="handleRoleSuccess" />
|
||||||
<PostModal @register="registerPostModal" @success="handlePostSuccess" />
|
<PostModal @register="registerPostModal" @success="handlePostSuccess" />
|
||||||
<OrganizationModal @register="registerOrgModal" @success="handleOrgSuccess" />
|
<OrganizationModal @register="registerOrgModal" @success="handleOrgSuccess" />
|
||||||
|
<OrganizationModal @register="registerDeptModal" @success="handleDeptSuccess" />
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -138,7 +152,7 @@
|
|||||||
label: t('所属机构'),
|
label: t('所属机构'),
|
||||||
component: 'Dept',
|
component: 'Dept',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择所属机构',
|
placeholder: '请从所属部门进行修改',
|
||||||
fieldNames: {
|
fieldNames: {
|
||||||
label: 'name',
|
label: 'name',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
@ -147,8 +161,9 @@
|
|||||||
isArray: true,
|
isArray: true,
|
||||||
multiple: true,
|
multiple: true,
|
||||||
getPopupContainer: () => document.body,
|
getPopupContainer: () => document.body,
|
||||||
|
disabled:true
|
||||||
},
|
},
|
||||||
required: true,
|
//required: true,
|
||||||
colProps: { span: 12 },
|
colProps: { span: 12 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -258,6 +273,18 @@
|
|||||||
placeholder: '请输入排序',
|
placeholder: '请输入排序',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'isSync',
|
||||||
|
label: '同步',
|
||||||
|
component: 'Switch',
|
||||||
|
colProps: { span: 12 },
|
||||||
|
helpMessage: '开启同步则会自动修正与域里人员组织数据一致,域里不存在的用户将被删除',
|
||||||
|
helpComponentProps: { maxWidth: '400px' },
|
||||||
|
componentProps: {
|
||||||
|
checkedValue: 'Y',
|
||||||
|
unCheckedValue: 'N',
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('备注'),
|
label: t('备注'),
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
@ -426,6 +453,62 @@
|
|||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
const deptColumns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: t('组织编码'),
|
||||||
|
dataIndex: 'code',
|
||||||
|
align: 'left',
|
||||||
|
width:120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('组织名称'),
|
||||||
|
dataIndex: 'name',
|
||||||
|
align: 'left',
|
||||||
|
width:120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('组织路径'),
|
||||||
|
dataIndex: 'hierarchy',
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'isSync',
|
||||||
|
title: '是否同步',
|
||||||
|
width:100,
|
||||||
|
edit:true,
|
||||||
|
editComponent: 'Switch',
|
||||||
|
//editRule:false,
|
||||||
|
helpMessage: '开启同步则会自动修正与域里人员组织数据一致,域里不存在的组织和下级人员组织将被删除',
|
||||||
|
editComponentProps: {
|
||||||
|
checkedValue: 'Y',
|
||||||
|
unCheckedValue: 'N',
|
||||||
|
},
|
||||||
|
editValueMap: (value) => {
|
||||||
|
return value=='Y' ? '是' : '否';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'isMain',
|
||||||
|
title: '是否主部门',
|
||||||
|
width:100,
|
||||||
|
edit:true,
|
||||||
|
editComponent: 'Switch',
|
||||||
|
editComponentProps: {
|
||||||
|
checkedValue: 'Y',
|
||||||
|
unCheckedValue: 'N',
|
||||||
|
},
|
||||||
|
editValueMap: (value) => {
|
||||||
|
return value=='Y' ? '是' : '否';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'sortCode',
|
||||||
|
title: '排序',
|
||||||
|
width:120,
|
||||||
|
edit:true,
|
||||||
|
editComponent: 'InputNumber'
|
||||||
|
},
|
||||||
|
];
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
@ -438,6 +521,7 @@
|
|||||||
const roleDatasource = ref<any[]>([]);
|
const roleDatasource = ref<any[]>([]);
|
||||||
const postDatasource = ref<any[]>([]);
|
const postDatasource = ref<any[]>([]);
|
||||||
const orgDatasource = ref<any[]>([]);
|
const orgDatasource = ref<any[]>([]);
|
||||||
|
const deptDatasource = ref<any[]>([]);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
registerForm1,
|
registerForm1,
|
||||||
@ -507,17 +591,30 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [registerTable4, { setTableData: setTableData4 }] = useTable({
|
||||||
|
rowKey: 'id',
|
||||||
|
dataSource: deptDatasource.value,
|
||||||
|
columns: deptColumns,
|
||||||
|
striped: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 80,
|
||||||
|
title: t('操作'),
|
||||||
|
dataIndex: 'action',
|
||||||
|
slots: { customRender: 'action' },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
resetFields1();
|
resetFields1();
|
||||||
resetFields2();
|
resetFields2();
|
||||||
setModalProps({ confirmLoading: false, width: 800, fixedHeight: true, destroyOnClose: true });
|
setModalProps({ confirmLoading: false, width: 1000, fixedHeight: true, destroyOnClose: true });
|
||||||
activeKey.value = '1';
|
activeKey.value = '1';
|
||||||
isUpdate.value = !!data?.isUpdate;
|
isUpdate.value = !!data?.isUpdate;
|
||||||
roleDatasource.value = [];
|
roleDatasource.value = [];
|
||||||
if (unref(isUpdate)) {
|
if (unref(isUpdate)) {
|
||||||
rowId.value = data.id;
|
rowId.value = data.id;
|
||||||
const record = await getUser(data.id);
|
const record = await getUser(data.id);
|
||||||
const departmentIds = record.departmentIds.split(',');
|
const departmentIds = record.departmentIds?.split(',')||[];
|
||||||
setFieldsValue1({
|
setFieldsValue1({
|
||||||
...record,
|
...record,
|
||||||
departmentIds,
|
departmentIds,
|
||||||
@ -528,10 +625,12 @@
|
|||||||
roleDatasource.value = record.roles || [];
|
roleDatasource.value = record.roles || [];
|
||||||
postDatasource.value = record.posts || [];
|
postDatasource.value = record.posts || [];
|
||||||
orgDatasource.value = record.chargeDepartments || [];
|
orgDatasource.value = record.chargeDepartments || [];
|
||||||
|
deptDatasource.value = record.departments || [];
|
||||||
|
|
||||||
setTableData1(roleDatasource.value);
|
setTableData1(roleDatasource.value);
|
||||||
setTableData2(postDatasource.value);
|
setTableData2(postDatasource.value);
|
||||||
setTableData3(orgDatasource.value);
|
setTableData3(orgDatasource.value);
|
||||||
|
setTableData4(deptDatasource.value);
|
||||||
}
|
}
|
||||||
const treeData = await getDepartmentTree();
|
const treeData = await getDepartmentTree();
|
||||||
|
|
||||||
@ -549,6 +648,7 @@
|
|||||||
const [registerRoleModal, { openModal: openRoleModal }] = useModal();
|
const [registerRoleModal, { openModal: openRoleModal }] = useModal();
|
||||||
const [registerPostModal, { openModal: openPostModal }] = useModal();
|
const [registerPostModal, { openModal: openPostModal }] = useModal();
|
||||||
const [registerOrgModal, { openModal: openOrgModal }] = useModal();
|
const [registerOrgModal, { openModal: openOrgModal }] = useModal();
|
||||||
|
const [registerDeptModal, { openModal: openDeptModal }] = useModal();
|
||||||
|
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? t('新增用户') : t('编辑用户')));
|
const getTitle = computed(() => (!unref(isUpdate) ? t('新增用户') : t('编辑用户')));
|
||||||
|
|
||||||
@ -588,6 +688,11 @@
|
|||||||
orgs: orgDatasource.value,
|
orgs: orgDatasource.value,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const handleDeptCreate = () => {
|
||||||
|
openDeptModal(true, {
|
||||||
|
orgs: deptDatasource.value,
|
||||||
|
});
|
||||||
|
};
|
||||||
const handleDelete = (index, type) => {
|
const handleDelete = (index, type) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -599,6 +704,9 @@
|
|||||||
case 3:
|
case 3:
|
||||||
orgDatasource.value.splice(index, 1);
|
orgDatasource.value.splice(index, 1);
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
deptDatasource.value.splice(index, 1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -614,6 +722,20 @@
|
|||||||
orgDatasource.value = data;
|
orgDatasource.value = data;
|
||||||
setTableData3(orgDatasource.value);
|
setTableData3(orgDatasource.value);
|
||||||
};
|
};
|
||||||
|
const handleDeptSuccess = (data) => {
|
||||||
|
//重复的保留列表中的值
|
||||||
|
data.forEach(item=>{
|
||||||
|
const exitsItem=deptDatasource.value.find(x=>x.id==item.id);
|
||||||
|
if(exitsItem){
|
||||||
|
item.hierarchy=exitsItem.hierarchy;
|
||||||
|
item.isMain=exitsItem.isMain;
|
||||||
|
item.isSync=exitsItem.isSync;
|
||||||
|
item.sortCode=exitsItem.sortCode;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
deptDatasource.value = data;
|
||||||
|
setTableData4(deptDatasource.value);
|
||||||
|
};
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const values = await validate1();
|
const values = await validate1();
|
||||||
@ -621,13 +743,15 @@
|
|||||||
const roleIds = roleDatasource.value?.map((x) => x.id);
|
const roleIds = roleDatasource.value?.map((x) => x.id);
|
||||||
const postIds = postDatasource.value?.map((x) => x.id);
|
const postIds = postDatasource.value?.map((x) => x.id);
|
||||||
const chargeDepartmentIds = orgDatasource.value?.map((x) => x.id);
|
const chargeDepartmentIds = orgDatasource.value?.map((x) => x.id);
|
||||||
|
const departments=deptDatasource.value;
|
||||||
const data = {
|
const data = {
|
||||||
...values,
|
...values,
|
||||||
...values2,
|
...values2,
|
||||||
departmentIds: values.departmentIds.toString(),
|
departmentIds: values.departmentIds?.toString(),
|
||||||
roleIds,
|
roleIds,
|
||||||
postIds,
|
postIds,
|
||||||
chargeDepartmentIds,
|
chargeDepartmentIds,
|
||||||
|
departments
|
||||||
};
|
};
|
||||||
setModalProps({ confirmLoading: true });
|
setModalProps({ confirmLoading: true });
|
||||||
|
|
||||||
|
|||||||
2
types/config.d.ts
vendored
2
types/config.d.ts
vendored
@ -133,6 +133,7 @@ export interface GlobConfig {
|
|||||||
title: string;
|
title: string;
|
||||||
// Service interface url
|
// Service interface url
|
||||||
apiUrl: string;
|
apiUrl: string;
|
||||||
|
requestTimeout?: number;
|
||||||
// Upload url
|
// Upload url
|
||||||
uploadUrl?: string;
|
uploadUrl?: string;
|
||||||
// Service interface url prefix
|
// Service interface url prefix
|
||||||
@ -153,6 +154,7 @@ export interface GlobEnvConfig {
|
|||||||
// Service interface url prefix
|
// Service interface url prefix
|
||||||
VITE_GLOB_API_URL_PREFIX?: string;
|
VITE_GLOB_API_URL_PREFIX?: string;
|
||||||
// Project abbreviation
|
// Project abbreviation
|
||||||
|
VITE_GLOB_REQUEST_TIMEOUT?: number;
|
||||||
VITE_GLOB_APP_SHORT_NAME: string;
|
VITE_GLOB_APP_SHORT_NAME: string;
|
||||||
// Upload url
|
// Upload url
|
||||||
VITE_GLOB_UPLOAD_URL?: string;
|
VITE_GLOB_UPLOAD_URL?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user