diff --git a/jeecgboot-vue3-master/src/views/system/user/userYX.api.ts b/jeecgboot-vue3-master/src/views/system/user/userYX.api.ts index 09e637c6..936d13a7 100644 --- a/jeecgboot-vue3-master/src/views/system/user/userYX.api.ts +++ b/jeecgboot-vue3-master/src/views/system/user/userYX.api.ts @@ -25,10 +25,6 @@ enum Api { allRolesListNoByTenant = '/sys/role/queryallNoByTenant', allRolesListExcludeByTenant = '/sys/role/queryallExcludeByTenant', allRolesZjListExcludeByTenant = '/sys/role/queryZjAllExcludeByTenant', - - //院系用户 - allRolesListYxExcludeByTenant = '/sys/role/queryYxAllExcludeByTenant', - allTenantList = '/sys/tenant/queryList', allPostList = '/sys/position/list', userDepartList = '/sys/user/userDepartList', @@ -158,12 +154,6 @@ export const getAllRolesListNoByTenant = (params) => defHttp.get({ url: Api.allR export const getAllRolesListNoByExcludeTenant = (params) => defHttp.get({ url: Api.allRolesListExcludeByTenant, params }); -/** - * 获取角色(排除:总管理、专家、学校管理员) - * @param params - */ -export const getAllRolesListYxNoByExcludeTenant = (params) => defHttp.get({ url: Api.allRolesListYxExcludeByTenant, params }); - /** * 获取角色(排除:总管理) diff --git a/jeecgboot-vue3-master/src/views/system/userdep/UserDrawer.vue b/jeecgboot-vue3-master/src/views/system/userdep/UserDrawer.vue index 440d3d55..0fe48908 100644 --- a/jeecgboot-vue3-master/src/views/system/userdep/UserDrawer.vue +++ b/jeecgboot-vue3-master/src/views/system/userdep/UserDrawer.vue @@ -16,7 +16,7 @@ import { BasicForm, useForm } from '/@/components/Form/index'; import { formSchema } from './userYX.data'; import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; - import { saveOrUpdateUser, getUserRoles, getUserDepartList, getAllRolesListNoByTenant, getAllRolesList } from './userYX.api'; + import { saveOrUpdateUser, getUserRoles, getUserDepartList, getAllRolesListYxNoByExcludeTenant, getAllRolesList } from './userYX.api'; import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth'; import { getTenantId } from "/@/utils/auth"; @@ -104,7 +104,7 @@ //update-begin---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------ //判断是否为多租户模式 componentProps:{ - api: data.tenantSaas?getAllRolesList:getAllRolesListNoByTenant + api: data.tenantSaas?getAllRolesList:getAllRolesListYxNoByExcludeTenant } //update-end---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------ }, diff --git a/jeecgboot-vue3-master/src/views/system/userdep/UserDrawerYX.vue b/jeecgboot-vue3-master/src/views/system/userdep/UserDrawerYX.vue index de5e8eab..05b00979 100644 --- a/jeecgboot-vue3-master/src/views/system/userdep/UserDrawerYX.vue +++ b/jeecgboot-vue3-master/src/views/system/userdep/UserDrawerYX.vue @@ -17,7 +17,7 @@ import { formSchemaYX} from '/@/views/system/user/userYX.data'; import { BasicDrawerYX, useDrawerInner } from '/@/components/DrawerYX'; - import { saveOrUpdateUser, getUserRoles, getUserDepartList, getAllRolesListNoByTenant, getAllRolesList,getAllRolesListNoByExcludeTenant } from './userYX.api'; + import { saveOrUpdateUser, getUserRoles, getUserDepartList, getAllRolesListNoByTenant, getAllRolesList,getAllRolesListYxNoByExcludeTenant } from './userYX.api'; import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth'; import { getTenantId } from "/@/utils/auth"; @@ -105,7 +105,7 @@ //update-begin---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------ //判断是否为多租户模式 componentProps:{ - api: data.tenantSaas?getAllRolesList:getAllRolesListNoByExcludeTenant + api: data.tenantSaas?getAllRolesList:getAllRolesListYxNoByExcludeTenant } //update-end---author:wangshuai ---date:20230424 for:【issues/4844】多租户模式下,新增或编辑用户,选择角色一栏,角色选项没有做租户隔离------------ }, diff --git a/jeecgboot-vue3-master/src/views/system/userdep/userYX.api.ts b/jeecgboot-vue3-master/src/views/system/userdep/userYX.api.ts index bfd2134d..21824706 100644 --- a/jeecgboot-vue3-master/src/views/system/userdep/userYX.api.ts +++ b/jeecgboot-vue3-master/src/views/system/userdep/userYX.api.ts @@ -40,6 +40,11 @@ enum Api { getUserTenantPageList='/sys/tenant/getUserTenantPageList', exportXlsMb = '/sys/user/exportXlsMb', queryByUserId = '/expert/expert/queryByUserId', + + //院系 + + //院系用户 + allRolesListYxExcludeByTenant = '/sys/role/queryYxAllExcludeByTenant', } /** * 根据userid判断是否为专家 @@ -65,6 +70,13 @@ export const getImportUrl = Api.importExcel; */ export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 获取角色(排除:总管理、专家、学校管理员) + * @param params + */ +export const getAllRolesListYxNoByExcludeTenant = (params) => defHttp.get({ url: Api.allRolesListYxExcludeByTenant, params }); + /** * 列表接口(查询全部用户,不通过租户隔离) * @param params diff --git a/jeecgboot-vue3-master/src/views/system/userdep/userYX.data.ts b/jeecgboot-vue3-master/src/views/system/userdep/userYX.data.ts index f157d873..38bea296 100644 --- a/jeecgboot-vue3-master/src/views/system/userdep/userYX.data.ts +++ b/jeecgboot-vue3-master/src/views/system/userdep/userYX.data.ts @@ -3,7 +3,8 @@ import { FormSchema } from '/@/components/Table'; import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; -import {getAllRolesListYxNoByExcludeTenant} from "/@/views/system/user/userYX.api"; +import {getAllRolesListYxNoByExcludeTenant} from "/@/views/system/userdep/userYX.api"; +import {getAllRolesListNoByTenant, getAllTenantList} from "/@/views/system/user/user.api"; export const columns: BasicColumn[] = [ { title: '用户账号', @@ -142,7 +143,199 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 6 }, }, ]; +export const formSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + label: '用户账号', + field: 'username', + component: 'Input', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true), + }, + { + label: '登录密码', + field: 'password', + component: 'StrengthMeter', + rules: [ + { + required: true, + message: '请输入登录密码', + }, + ], + }, + { + label: '确认密码', + field: 'confirmPassword', + component: 'InputPassword', + dynamicRules: ({ values }) => rules.confirmPassword(values, true), + }, + { + label: '用户姓名', + field: 'realname', + required: true, + component: 'Input', + }, + { + label: '工号', + field: 'workNo', + required: true, + component: 'Input', + dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true), + }, + { + label: '职务', + field: 'post', + required: false, + component: 'JSelectPosition', + componentProps: { + rowKey: 'code', + labelKey: 'name', + }, + }, + { + label: '角色', + field: 'selectedroles', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllRolesListNoByTenant, + labelField: 'roleName', + valueField: 'id', + }, + }, + { + label: '所属部门', + field: 'selecteddeparts', + component: 'JSelectDept', + componentProps: ({ formActionType, formModel }) => { + return { + sync: false, + checkStrictly: true, + defaultExpandLevel: 2, + onSelect: (options, values) => { + const { updateSchema } = formActionType; + //所属部门修改后更新负责部门下拉框数据 + updateSchema([ + { + field: 'departIds', + componentProps: { options }, + }, + ]); + //所属部门修改后更新负责部门数据 + formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1)); + }, + }; + }, + }, + { + label: '租户', + field: 'relTenantIds', + component: 'ApiSelect', + componentProps: { + mode: 'multiple', + api: getAllTenantList, + numberToString: true, + labelField: 'name', + valueField: 'id', + }, + }, + { + label: '身份', + field: 'userIdentity', + component: 'RadioGroup', + defaultValue: 1, + componentProps: ({ formModel }) => { + return { + options: [ + { label: '普通用户', value: 1, key: '1' }, + { label: '上级', value: 2, key: '2' }, + ], + onChange: () => { + formModel.userIdentity == 1 && (formModel.departIds = []); + }, + }; + }, + }, + { + label: '负责部门', + field: 'departIds', + component: 'Select', + componentProps: { + mode: 'multiple', + }, + ifShow: ({ values }) => values.userIdentity == 2, + }, + { + label: '头像', + field: 'avatar', + component: 'JImageUpload', + componentProps: { + fileMax: 1, + }, + }, + { + label: '生日', + field: 'birthday', + component: 'DatePicker', + }, + { + label: '性别', + field: 'sex', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sex', + placeholder: '请选择性别', + stringToNumber: true, + }, + }, + { + label: '邮箱', + field: 'email', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [ + { ...rules.duplicateCheckRule('sys_user', 'email', model, schema, true)[0] }, + { ...rules.rule('email', false)[0] }, + ]; + }, + }, + { + label: '手机号码', + field: 'phone', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [ + { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0] }, + { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' }, + ]; + }, + }, + { + label: '座机', + field: 'telephone', + component: 'Input', + rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }], + }, + // { + // label: '工作流引擎', + // field: 'activitiSync', + // defaultValue: 1, + // component: 'JDictSelectTag', + // componentProps: { + // dictCode: 'activiti_sync', + // type: 'radio', + // stringToNumber: true, + // }, + // }, +]; export const formSchemaYX: FormSchema[] = [ { label: '',