Browse Source

fix: 部门角色逻辑调整

deploy-dev
xuziqiang 4 months ago
parent
commit
7274efd5c2
  1. 13
      hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
  2. 171
      hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
  3. 14
      hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue

13
hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue

@ -145,7 +145,7 @@
<ns-button type="primary" @click="CancelUser">取消</ns-button>
<ns-button
v-if="roleDisabled"
:disabled="!roleTreeData?.length"
:disabled="!selectRoleRef || !roleTreeData?.length"
type="primary"
@click="rolePipe(roleEdit, false, false)">
编辑
@ -501,6 +501,7 @@
roleFormData.value = {};
opMap.type = '';
opMap.fuc = '';
selectRoleRef.value = '';
roleDisabled.value = true;
};
@ -627,6 +628,7 @@
roleActiveKey.value = 1;
//
clearDeptData();
clearRoleData();
const { selected } = info;
if (!selectedKeys?.length) return;
@ -686,7 +688,7 @@
roleFormData.value = cloneDeep(info.node.dataRef);
roleCheckedKeys.value = [];
if (selectRoleRef.value?.proleId) {
//
//
getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId });
} else {
getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId });
@ -723,6 +725,13 @@
deptPermission().then(() => {
clearDeptData();
disabled.value = true;
//
if (selectRoleRef.value?.proleId) {
//
getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId });
} else {
getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId });
}
});
}
};

171
hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts

@ -4,100 +4,91 @@ import { origanizemanage } from '/@/api/origanizemanage';
export const formConfig = (disabled) => {
return ref([
{
field: 'field111',
component: 'NsChildForm',
label: '账号',
field: 'accountNo',
component: 'NsInput',
componentProps: {
title: '用户信息',
schemas: [
{
label: '账号',
field: 'accountNo',
component: 'NsInput',
componentProps: {
placeholder: '请输入账号',
maxLength: 20,
disabled,
},
rules: [
{
required: true,
message: '请输入账号',
},
],
},
{
label: '姓名',
field: 'realName',
component: 'NsInput',
componentProps: {
placeholder: '请输入姓名',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入姓名',
},
],
},
{
label: '性别',
field: 'sex',
component: 'NsRadioGroup',
defaultValue: '男',
componentProps: {
radioType: 'radio',
options: [
{ label: '男', value: '男' },
{ label: '女', value: '女' },
],
},
},
{
label: '手机号',
field: 'telephone',
component: 'NsInput',
componentProps: {
placeholder: '请输入手机号',
maxLength: 11,
},
rules: [
{
required: true,
message: '请输入正确手机号格式',
pattern: /^[1][3-9][0-9]{9}$/,
},
],
},
{
label: '邮箱',
field: 'email',
component: 'NsInput',
componentProps: {
placeholder: '请输入邮箱',
maxLength: 30,
},
rules: [
{
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
message: '请输入正确的邮箱格式',
trigger: 'blur',
},
],
},
{
label: '组织关系',
field: 'orgName',
component: 'NsInput',
defaultValue: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName,
componentProps: {
disabled: true,
maxLength: 30,
},
},
placeholder: '请输入账号',
maxLength: 20,
disabled,
},
rules: [
{
required: true,
message: '请输入账号',
},
],
},
{
label: '姓名',
field: 'realName',
component: 'NsInput',
componentProps: {
placeholder: '请输入姓名',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入姓名',
},
],
},
{
label: '性别',
field: 'sex',
component: 'NsRadioGroup',
defaultValue: '男',
componentProps: {
radioType: 'radio',
options: [
{ label: '男', value: '男' },
{ label: '女', value: '女' },
],
},
},
{
label: '手机号',
field: 'telephone',
component: 'NsInput',
componentProps: {
placeholder: '请输入手机号',
maxLength: 11,
},
rules: [
{
required: true,
message: '请输入正确手机号格式',
pattern: /^[1][3-9][0-9]{9}$/,
},
],
},
{
label: '邮箱',
field: 'email',
component: 'NsInput',
componentProps: {
placeholder: '请输入邮箱',
maxLength: 30,
},
rules: [
{
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
message: '请输入正确的邮箱格式',
trigger: 'blur',
},
],
},
{
label: '组织关系',
field: 'orgName',
component: 'NsInput',
defaultValue: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName,
componentProps: {
disabled: true,
maxLength: 30,
},
},
]);
};
const options = ref([]);

14
hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue

@ -32,12 +32,14 @@
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<span class="admin">用户信息</span>
<ns-form
ref="formRef"
:schemas="formSchema"
:model="formData"
class="form"
:wrapperCol="{ span: 20 }"
:labelCol="{ span: 4 }"
formLayout="vertical" />
<span class="admin">用户权限</span>
<ns-view-list-table
@ -596,6 +598,12 @@
.main {
background-color: @ns-content-bg;
display: flex;
.top,
:deep(.ns-table-search),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
}
.left {
width: 300px;
@ -652,10 +660,4 @@
}
}
}
.top,
:deep(.ns-table-search),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
</style>

Loading…
Cancel
Save