diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts
index f5feb8a..34b3318 100644
--- a/hx-ai-intelligent/src/config/app.config.ts
+++ b/hx-ai-intelligent/src/config/app.config.ts
@@ -19,7 +19,7 @@ export const appConfig = {
projectType: 'web',
baseApi: '/api',
projectName: '济阳站_AI智能BAS系统',
- enablePermissions: true,
+ enablePermissions: false,
// themeColor: '#eee',
siderPosition: 'left',
baseHeader: '/parkingManage',
diff --git a/hx-ai-intelligent/src/router/organizationManage.ts b/hx-ai-intelligent/src/router/organizationManage.ts
index 8f1453a..02de016 100644
--- a/hx-ai-intelligent/src/router/organizationManage.ts
+++ b/hx-ai-intelligent/src/router/organizationManage.ts
@@ -46,6 +46,10 @@ const organizationManage = {
code: 'userFrozen',
},
{
+ title: '解冻',
+ code: 'userUnFrozen',
+ },
+ {
title: '重置密码',
code: 'userCodeReset',
},
diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
index d081a0e..5431020 100644
--- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
+++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
@@ -11,6 +11,7 @@ export const formConfig = (disabled: Boolean) => {
disabled: disabled,
placeholder: '请输入部门名称',
maxLength: 20,
+ onKeydown: (e) => e.keyCode === 32 && e.preventDefault(),
},
rules: [
{
@@ -44,6 +45,7 @@ export const formConfig = (disabled: Boolean) => {
componentProps: {
disabled: disabled,
placeholder: '请输入部门编码',
+ onKeydown: (e) => e.keyCode === 32 && e.preventDefault(),
maxLength: 20,
},
rules: [
@@ -56,11 +58,14 @@ export const formConfig = (disabled: Boolean) => {
{
label: '排序',
field: 'sort',
- component: 'NsInput',
+ component: 'NsInputNumber',
componentProps: {
disabled: disabled,
placeholder: '请输入排序',
maxLength: 2,
+ min: 0,
+ max: 99,
+ precision: 0,
},
},
{
@@ -87,6 +92,7 @@ export const formConfig2 = (disabled2: Boolean) => {
componentProps: {
disabled: disabled2,
placeholder: '请输入角色名称',
+ onKeydown: (e) => e.keyCode === 32 && e.preventDefault(),
maxLength: 20,
},
rules: [
@@ -111,6 +117,7 @@ export const formConfig2 = (disabled2: Boolean) => {
componentProps: {
disabled: disabled2,
placeholder: '请输入节点编码',
+ onKeydown: (e) => e.keyCode === 32 && e.preventDefault(),
maxLength: 20,
},
rules: [
diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
index 2618e84..02d0783 100644
--- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
+++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
@@ -10,13 +10,13 @@
新增部门
新增子部门
-
+
删除
@@ -35,11 +35,11 @@
formLayout="vertical"
class="form" />
-
+
取消
- 编辑
+ 编辑
确定
@@ -66,8 +68,9 @@
删除
@@ -88,8 +91,8 @@
取消
- 编辑
- 确定
+
+ 编辑
+
+ 确定
@@ -128,9 +133,10 @@
const roleActiveKey = ref(1);
const disabled = ref(true);
const roleDisabled = ref(true);
- const deptTreeCheckedKeys = ref(['0-0-0']);
- const ApartcheckedKeys = ref([]);
- const UsercheckedKeys = ref([]);
+ const deptTreeSelectedKeys = ref([]);
+ const roleTreeSelectedKeys = ref([]);
+ const deptcheckedKeys = ref([]);
+ const roleCheckedKeys = ref([]);
const currentOrgRef = ref();
const selectKey = ref();
const selectRef = ref();
@@ -138,11 +144,12 @@
const selectRoleRef = ref();
const formSchema = formConfig(disabled as any);
const formSchema2 = formConfig2(roleDisabled as any);
- const { orgId, orgName, projectId } = JSON.parse(sessionStorage.getItem('userInfo'));
- const userAdminTreeData = ref([]);
- const apartmentTreeData = ref([]);
- const apartmentAdminTreeData = ref([]);
- const userTreeData = ref([]);
+ const { orgName, projectId, orgId } = JSON.parse(sessionStorage.getItem('userInfo'));
+ // const orgId = JSON.parse(sessionStorage.getItem('ORGID'));
+ const roleTreeData = ref([]);
+ const rolePermissionTreeData = ref([]);
+ const deptTreeData = ref([]);
+ const deptPermissionTreeData = ref([]);
// 包含半选状态的权限数据
const deptTotalCheckedKeys = ref([]);
@@ -159,28 +166,34 @@
};
watchEffect(() => {
- disabledTree(apartmentAdminTreeData.value, disabled.value);
- disabledTree(userAdminTreeData.value, roleDisabled.value);
+ disabledTree(deptPermissionTreeData.value, disabled.value);
+ disabledTree(rolePermissionTreeData.value, roleDisabled.value);
});
/**操作拦截 */
- const pipe = (func: Function, flag = false) => {
+ const pipe = (func: Function, flag = false, toggle = true) => {
console.log(selectRef.value);
- if (flag && !selectRef.value?.hasOwnProperty('own')) {
- NsMessage.error('请先选择相关部门');
- return;
- }
- if (!flag && !selectRef.value?.deptInfo) {
- NsMessage.error('请先选择相关企业');
- return;
+ if (toggle) activeKey.value = 1;
+ if (flag) {
+ // 只有部门的操作
+ if (selectRef.value?.hasOwnProperty('orgInfo') || !selectRef.value?.deptInfo) {
+ NsMessage.error('请先选择相关部门');
+ return;
+ }
+ } else {
+ if (!selectRef.value?.hasOwnProperty('orgInfo')) {
+ NsMessage.error('请先选择相关企业');
+ return;
+ }
}
+
func && func();
};
- const rolePipe = (func: Function, linkDept = false) => {
+ const rolePipe = (func: Function, linkDept = false, toggle = true) => {
console.log(selectRoleRef.value);
-
+ if (toggle) roleActiveKey.value = 1;
// 需要先选择部门
if ((linkDept && !selectRef.value?.deptInfo) || selectRef.value?.hasOwnProperty('own')) {
NsMessage.error('请先选择相关部门');
@@ -196,12 +209,12 @@
const getPermissionTree = (params) => {
return http.post(permission.queryOrgPermission, params).then((res) => {
- apartmentAdminTreeData.value = get(res, 'data');
+ deptPermissionTreeData.value = get(res, 'data');
});
};
const getRolePermissionTree = (params) => {
return http.post(permission.queryFilterDeptPermission, params).then((res) => {
- userAdminTreeData.value = get(res, 'data');
+ rolePermissionTreeData.value = get(res, 'data');
});
};
@@ -223,13 +236,13 @@
});
};
getDepartList({ orgId }).then((res) => {
- apartmentTreeData.value = res;
+ deptTreeData.value = res;
});
// 获取部门树
const getTree = () => {
getDepartList({ orgId }).then((res) => {
- apartmentTreeData.value = res;
+ deptTreeData.value = res;
NsMessage.success('操作成功');
});
};
@@ -237,7 +250,7 @@
// 获取角色树
const getUserTree = (params = { deptId: selectRef.value?.deptInfo?.deptId }) => {
http.post(department.queryRoleTree, params).then((res) => {
- userTreeData.value = res.data;
+ roleTreeData.value = res.data;
});
};
// 根据依赖刷新角色树
@@ -338,12 +351,13 @@
// 删除逻辑
Modal.confirm({
title: '是否确认删除',
- icon: createVNode(ExclamationCircleOutlined),
- content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {
http.post(department.deptDel, { deptId: selectRef.value.deptInfo.deptId }).then(() => {
getTree();
clearDeptData();
+ // 清空select树
+ deptTreeSelectedKeys.value = [];
+ selectRef.value = '';
});
},
onCancel() {
@@ -355,17 +369,21 @@
const deleteUser = () => {
Modal.confirm({
title: '是否确认删除',
- icon: createVNode(ExclamationCircleOutlined),
- content: createVNode('div', { style: 'color:red;' }, ''),
onOk() {
http.post(department.delRole, { roleId: selectRoleRef.value.roleId }).then(() => {
getUserTree({ deptId: selectRef.value.deptInfo.deptId });
+ clearRoleData();
+ // 清空select树
+ roleTreeSelectedKeys.value = [];
+ selectRoleRef.value = '';
+ NsMessage.success('操作成功');
});
},
-
- class: 'test',
});
};
+ watchEffect(() => {
+ console.log(deptTreeSelectedKeys.value, 'deptTreeData.value');
+ });
const clearDeptData = () => {
formData.value = {};
@@ -452,7 +470,7 @@
http
.post(permission.queryDeptPermission, { deptId: selectRef.value?.deptInfo.deptId })
.then((res) => {
- ApartcheckedKeys.value = res.data
+ deptcheckedKeys.value = res.data
?.filter((item) => !item.halfCheck)
.map((item) => {
return item.permissionId;
@@ -466,7 +484,7 @@
http
.post(permission.queryRolePermission, { roleId: selectRoleRef.value?.roleId })
.then((res) => {
- UsercheckedKeys.value = res.data
+ roleCheckedKeys.value = res.data
?.filter((item) => !item.halfCheck)
.map((item) => {
return item.permissionId;
@@ -502,18 +520,19 @@
const { selected } = info;
if (!selectedKeys?.length) return;
- selectKey.value = [info.node.key];
+ deptTreeSelectedKeys.value = [info.node.key];
selectRef.value = info.node.dataRef;
// 确定是否是企业
if (!selectRef.value.hasOwnProperty('own')) {
formData.value = cloneDeep(info.node.dataRef.deptInfo);
} else {
+ activeKey.value = 1;
currentOrgRef.value = selectRef.value;
formData.value = {};
}
getDeptPermission();
- ApartcheckedKeys.value = [];
+ deptcheckedKeys.value = [];
};
/**
@@ -536,10 +555,10 @@
// roleDisabled.value = !selected;
if (!selectedKeys?.length) return;
- selectRoleKey.value = selectedKeys[0];
+ roleTreeSelectedKeys.value = [info.node.key];
selectRoleRef.value = info.node.dataRef;
roleFormData.value = cloneDeep(info.node.dataRef);
- UsercheckedKeys.value = [];
+ roleCheckedKeys.value = [];
getRolePermission();
getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId });
};
@@ -565,7 +584,7 @@
opMap.fuc &&
opMap.fuc(formData.value).then(() => {
getTree();
- clearDeptData();
+ opMap.type !== 'editDpet' && clearDeptData();
disabled.value = true;
});
}
@@ -578,15 +597,16 @@
};
// 角色确定
- const UserSure = () => {
+ const roleSure = () => {
const typeArr = ['addUserSon', 'addUser', 'editRole'];
if (roleActiveKey.value === 1) {
if (typeArr.includes(opMap.type)) {
opMap.fuc &&
opMap.fuc(roleFormData.value).then(() => {
getUserTree();
- clearRoleData();
+ opMap.type !== 'editRole' && clearRoleData();
roleDisabled.value = !roleDisabled.value;
+ NsMessage.success('操作成功');
});
}
} else {
diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
index c6381c7..61ade5d 100644
--- a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
+++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
@@ -1,99 +1,104 @@
-import { mockData } from './mock';
-import { cloneDeep } from 'lodash-es';
-import { Modal } from 'ant-design-vue';
-import { createVNode, ref } from 'vue';
-import { NsMessage } from '/nerv-lib/component';
-import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import { ref } from 'vue';
import { http } from '/nerv-lib/util';
import { origanizemanage } from '/@/api/origanizemanage';
-export const formConfig = [
- {
- field: 'field111',
- component: 'NsChildForm',
- componentProps: {
- title: '用户信息',
- schemas: [
- {
- label: '账号',
- field: 'accountNo',
- component: 'NsInput',
- componentProps: {
- placeholder: '请输入账号',
- maxLength: 20,
- },
- rules: [
- {
- required: true,
- message: '请输入账号',
+export const formConfig = (disabled) => {
+ return ref([
+ {
+ field: 'field111',
+ component: 'NsChildForm',
+ componentProps: {
+ title: '用户信息',
+ schemas: [
+ {
+ label: '账号',
+ field: 'accountNo',
+ component: 'NsInput',
+ componentProps: {
+ placeholder: '请输入账号',
+ maxLength: 20,
+ disabled,
},
- ],
- },
- {
- label: '姓名',
- field: 'realName',
- component: 'NsInput',
- componentProps: {
- placeholder: '请输入姓名',
- maxLength: 20,
+ rules: [
+ {
+ required: true,
+ message: '请输入账号',
+ },
+ ],
},
- rules: [
- {
- required: true,
- message: '请输入姓名',
+ {
+ label: '姓名',
+ field: 'realName',
+ component: 'NsInput',
+ componentProps: {
+ placeholder: '请输入姓名',
+ maxLength: 20,
},
- ],
- },
- {
- label: '性别',
- field: 'sex',
- component: 'NsRadioGroup',
- componentProps: {
- radioType: 'radio',
- options: [
- { label: '男', value: '男' },
- { label: '女', value: '女' },
+ rules: [
+ {
+ required: true,
+ message: '请输入姓名',
+ },
],
},
- },
- {
- label: '手机号',
- field: 'telephone',
- component: 'NsInput',
- componentProps: {
- placeholder: '请输入手机号',
- maxLength: 11,
+ {
+ label: '性别',
+ field: 'sex',
+ component: 'NsRadioGroup',
+ componentProps: {
+ radioType: 'radio',
+ options: [
+ { label: '男', value: '男' },
+ { label: '女', value: '女' },
+ ],
+ },
},
- rules: [
- {
- required: true,
- message: '请输入正确手机号格式',
- pattern: /^[1][3-9][0-9]{9}$/,
+ {
+ label: '手机号',
+ field: 'telephone',
+ component: 'NsInput',
+ componentProps: {
+ placeholder: '请输入手机号',
+ maxLength: 11,
},
- ],
- },
- {
- label: '邮箱',
- field: 'email',
- component: 'NsInput',
- componentProps: {
- placeholder: '请输入邮箱',
- maxLength: 30,
+ rules: [
+ {
+ required: true,
+ message: '请输入正确手机号格式',
+ pattern: /^[1][3-9][0-9]{9}$/,
+ },
+ ],
},
- },
- {
- label: '组织关系',
- field: 'orgName',
- component: 'NsInput',
- defaultValue: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
- componentProps: {
- disabled: true,
- maxLength: 30,
+ {
+ 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('userInfo')).orgName,
+ componentProps: {
+ disabled: true,
+ maxLength: 30,
+ },
+ },
+ ],
+ },
},
- },
-];
+ ]);
+};
const options = ref([]);
const getUserPerList = (transform, params = {}) => {
@@ -105,16 +110,6 @@ const getUserPerList = (transform, params = {}) => {
});
};
export const formConfig2 = (casData: any) => {
- // const transForm = (data) => {
- // data['label'] = data.orgName;
- // data['value'] = data.orgId;
- // data['isLeaf'] = false;
- // data['level'] = 1;
- // return data;
- // };
- // getUserPerList(transForm).then((res) => {
- // options.value = [...res];
- // });
return ref([
{
field: 'information',
@@ -129,9 +124,6 @@ export const formConfig2 = (casData: any) => {
});
return labels.join('/');
},
- // defaultValue: [1, 1, 3],
- // options: options,
- // changeOnSelect: true,
loadData: (selectedOptions, options) => {
console.log(selectedOptions, options, 'selectedOptions, options');
diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
index f7104e8..bccd076 100644
--- a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
+++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
@@ -73,23 +73,26 @@
-
+