diff --git a/hx-ai-intelligent/src/api/origanizemanage.ts b/hx-ai-intelligent/src/api/origanizemanage.ts
index 00475b0..257d4c8 100644
--- a/hx-ai-intelligent/src/api/origanizemanage.ts
+++ b/hx-ai-intelligent/src/api/origanizemanage.ts
@@ -1,4 +1,19 @@
-export const origanizemanage = {
- userList: '/carbon-smart/api/user/queryUserByPage',
- addUser: '/carbon-smart/api/user/save',
-};
+const BASE_URL = '/carbon-smart';
+
+export enum origanizemanage {
+ userList = '/carbon-smart/api/user/queryUserByPage',
+ addUser = '/carbon-smart/api/user/save',
+ frozen = '/carbon-smart/api/user/frozen',
+ resetPwd = '/carbon-smart/api/user/resetPwd',
+ del = '/carbon-smart/api/user/del',
+ batchDel = '/carbon-smart/api/user/batchDel',
+ queryOrgTree = '/carbon-smart/api/user/queryOrgTree',
+ queryDeptTree = '/carbon-smart/api/user/queryDeptTree',
+ queryUserPerList = '/carbon-smart/api/user/queryUserPerList',
+}
+
+export enum department {
+ dartList = `${BASE_URL}/api/user/queryDeptTree`,
+ deptSave = `${BASE_URL}/api/dept/save`,
+ deptEdit = `${BASE_URL}/api/dept/edit`,
+}
diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts
index 62c819b..30d4718 100644
--- a/hx-ai-intelligent/src/config/app.config.ts
+++ b/hx-ai-intelligent/src/config/app.config.ts
@@ -74,6 +74,8 @@ export const appConfig = {
accountName: 'realName',
accountRealName: 'realName',
orgId: 'orgId',
+ orgName: 'orgName',
+ projectId: 'projectId',
});
return { data: { ...trD } };
});
diff --git a/hx-ai-intelligent/src/router/equipmentManage.ts b/hx-ai-intelligent/src/router/equipmentManage.ts
index 8d53251..20e2842 100644
--- a/hx-ai-intelligent/src/router/equipmentManage.ts
+++ b/hx-ai-intelligent/src/router/equipmentManage.ts
@@ -15,7 +15,8 @@ const equipment = {
{
path: 'index',
name: 'LedgerIndex',
- component: () => import('/@/view/equipmentManage/ledger/index.vue'),
+ component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
+ // component: () => import('/@/view/equipmentManage/ledger/index.vue'),
meta: {
title: '设备台账',
keepAlive: true,
diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
index bc9c7a4..75d1868 100644
--- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
+++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts
@@ -9,7 +9,7 @@ export const formConfig = (disabled: Boolean) => {
schemas: [
{
label: '部门名称',
- field: 'name',
+ field: 'deptName',
component: 'NsInput',
componentProps: {
disabled: disabled,
@@ -23,27 +23,27 @@ export const formConfig = (disabled: Boolean) => {
},
],
},
- {
- label: '上级部门',
- field: 'department',
- component: 'NsSelect',
- componentProps: {
- disabled: true,
- options: [
- {
- label: '部门1',
- value: 1,
- },
- {
- label: '部门2',
- value: 2,
- },
- ],
- },
- },
+ // {
+ // label: '上级部门',
+ // field: 'department',
+ // component: 'NsSelect',
+ // componentProps: {
+ // disabled: true,
+ // options: [
+ // {
+ // label: '部门1',
+ // value: 1,
+ // },
+ // {
+ // label: '部门2',
+ // value: 2,
+ // },
+ // ],
+ // },
+ // },
{
label: '部门编码',
- field: 'code',
+ field: 'deptCode',
component: 'NsInput',
componentProps: {
disabled: disabled,
diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
index e6fb1f2..e82fa4d 100644
--- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
+++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
@@ -9,9 +9,13 @@
新增部门
新增子部门
删除
-
-
- {{ title }}
+
+
+ {{ data.deptInfo.deptName }}
@@ -39,9 +43,7 @@
取消
- {{
- disabled ? '编辑' : '确定'
- }}
+ 确定
@@ -53,8 +55,8 @@
新增子角色
删除
-
- {{ title }}
+
+ {{ data }}
@@ -95,6 +97,8 @@
import { uuid } from '@antv/x6/lib/util/string/uuid';
import { cloneDeep } from 'lodash-es';
import { formConfig, formConfig2 } from './config';
+ import { department } from '/@/api/origanizemanage';
+
export default defineComponent({
name: 'AuthorityManageIndex',
setup() {
@@ -113,6 +117,9 @@
const selectRef2 = ref();
const formSchema = formConfig(disabled as any);
const formSchema2 = formConfig2(disabled2 as any);
+ const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
+ const projectId = JSON.parse(sessionStorage.getItem('userInfo')).projectId;
+
watch(ApartcheckedKeys, () => {
console.log('checkedKeys', ApartcheckedKeys.value);
});
@@ -120,23 +127,20 @@
console.log('checkedKeys', UsercheckedKeys.value);
});
+ // 部门树
+ const getDepartList = (params) => {
+ return http.post(department.dartList, params);
+ };
+ getDepartList({ orgId: 1 }).then((res) => {
+ apartmentTreeData.value = res.data;
+ });
const opMap: any = {
type: 'add',
fuc: () => {},
record: {},
};
- const apartmentTreeData = ref([
- {
- title: '铁路总局',
- key: '0-0',
- info: { name: '铁路总局' },
- children: [
- { title: '济阳站', key: '0-0-0', info: { name: '济阳站' } },
- { title: '临沂站', key: '0-0-1', info: { name: '临沂站' } },
- ],
- },
- ]);
+ const apartmentTreeData = ref([]);
const userTreeData = ref([
{
@@ -182,14 +186,31 @@
},
]);
+ function fetch(api, params) {
+ return http.post(api, params);
+ }
+
const addApartment = () => {
disabled.value = false;
opMap.type = 'add';
+ opMap.fuc = (params) => {
+ fetch(department.deptSave, { ...params, orgId, projectId });
+ };
+ return;
};
const addApartmentSon = () => {
disabled.value = false;
opMap.type = 'addson';
+ formData.value = {};
+ opMap.fuc = (params) => {
+ fetch(department.deptSave, {
+ ...params,
+ orgId,
+ projectId,
+ pdeptId: selectRef.value.deptInfo.deptId,
+ });
+ };
};
const addUser = () => {
@@ -243,12 +264,14 @@
};
const SelectApartmentTree = (selectedKeys: any, info: any) => {
+ console.log(selectedKeys, info);
+
disabled.value = false;
console.log(selectedKeys, 'selectedKeys');
console.log(info.node.dataRef, 'info');
selectKey.value = selectedKeys[0];
selectRef.value = info.node.dataRef;
- formData.value = info.node.dataRef.info;
+ formData.value = info.node.dataRef.deptInfo;
};
const SelectUserTree = (selectedKeys: any, info: any) => {
disabled2.value = false;
@@ -280,24 +303,17 @@
const ApartmentSure = () => {
// formRef.value?.triggerSubmit().then(() => {});
- disabled.value = !disabled.value;
- opMap.fuc && opMap.fuc(formData.value);
+ // disabled.value = !disabled.value;
// console.log(formData.value.name, 'formData');
console.log(opMap.type, 'opMap.type');
if (opMap.type === 'add') {
- apartmentTreeData.value[0].children.push({
- title: formData.value.name,
- key: 'a1',
- info: { ...formData.value },
- });
+ console.log(formRef.value, formData);
+ opMap.fuc && opMap.fuc(formData.value);
} else if (selectRef.value && opMap.type === 'addson')
- selectRef.value['children'] = [
- { key: '123', title: formData.value.name, info: { ...cloneDeep(formData.value) } },
- ];
+ opMap.fuc && opMap.fuc(formData.value);
else {
console.log('ss');
}
- formData.value = {};
};
const UserSure = () => {
disabled2.value = !disabled2.value;
diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
index ab87f71..87ccdbb 100644
--- a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
+++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
@@ -4,6 +4,8 @@ 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 { http } from '/nerv-lib/util';
+import { origanizemanage } from '/@/api/origanizemanage';
export const formConfig = [
{
field: 'field111',
@@ -48,8 +50,8 @@ export const formConfig = [
componentProps: {
radioType: 'radio',
options: [
- { label: '男', value: 1 },
- { label: '女', value: 2 },
+ { label: '男', value: '男' },
+ { label: '女', value: '女' },
],
},
},
@@ -80,8 +82,9 @@ export const formConfig = [
},
{
label: '组织关系',
- field: 'relation',
+ field: 'orgName',
component: 'NsInput',
+ defaultValue: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
componentProps: {
disabled: true,
maxLength: 30,
@@ -91,35 +94,93 @@ export const formConfig = [
},
},
];
+const options = ref([]);
+
+const getUserPerList = (transform, params = {}) => {
+ return http.post(origanizemanage.queryUserPerList, { ...params }).then((res) => {
+ return res.data.map((item) => {
+ item = { ...item, ...transform(item) };
+ return item;
+ });
+ });
+};
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',
component: 'NsCascader',
componentProps: {
placeholder: '请选择',
- displayRender: ({ labels }: any) => {
- casData.value = labels;
+ displayRender: ({ labels, selectedOptions }: any) => {
+ console.log(labels, selectedOptions);
+
+ casData.value = selectedOptions.map(({ label, value }) => {
+ return { label, value };
+ });
return labels.join('/');
},
- options: [
- {
- value: '1',
- label: '铁路局',
- children: [
- {
- value: '2',
- label: '产品部',
- children: [
- {
- value: '3',
- label: '产品总监',
- },
- ],
- },
- ],
- },
- ],
+ // defaultValue: [1, 1, 3],
+ // options: options,
+ // changeOnSelect: true,
+ loadData: (selectedOptions, options) => {
+ console.log(selectedOptions, options, 'selectedOptions, options');
+
+ const targetOption = selectedOptions[selectedOptions.length - 1];
+ let transForm, params;
+ // load options lazily
+ if (!selectedOptions.length) {
+ 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];
+ });
+ }
+ const id = targetOption?.value;
+ const level = targetOption?.level;
+ if (targetOption) {
+ targetOption.loading = true;
+ }
+
+ if (level === 1) {
+ transForm = (data) => {
+ data['label'] = data.deptName;
+ data['value'] = data.deptId;
+ data['isLeaf'] = false;
+ data['level'] = 2;
+ return data;
+ };
+ params = { orgId: id };
+ } else if (level === 2) {
+ transForm = (data) => {
+ data['label'] = data.roleName;
+ data['value'] = data.roleId;
+ data['level'] = 3;
+ return data;
+ };
+ params = { deptId: id };
+ }
+ if (targetOption) {
+ getUserPerList(transForm, { ...params }).then((res) => {
+ targetOption.loading = false;
+ targetOption.children = [...res];
+ });
+ }
+ },
},
},
]);
diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
index 7f3dd36..abb47eb 100644
--- a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
+++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
@@ -5,37 +5,38 @@
关联企业
-
+
-
-
- {{ title }}
-
+
+
+ {{ data.orgInfo?.orgName }}
-
关联部门
+
关联部门
+
-
-
- {{ title }}
-
+
+
+ {{ data.deptInfo?.deptName }}
@@ -44,17 +45,31 @@
-
+
用户权限
-
- 取消
- 确定
+
+
+ 取消
+ 确定
+