diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index 7b7c276..299a815 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -1,9 +1,9 @@ -/** @format */ -import { dateUtil } from '/nerv-lib/util/date-util'; -import mockResource from './resource.json'; +import { userInfo, userResource } from './../../../hx-op/src/api/user'; import { http } from '/nerv-lib/saas'; -import { ref } from 'vue'; import { permission } from '/@/api/origanizemanage'; +import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config'; +import { authorizationService } from '/nerv-base/store/modules/authorization-service'; +import { isEmpty } from 'lodash-es'; // const { permissionVos } = sessionStorage.getItem('userInfo'); // ? JSON.parse(sessionStorage.getItem('userInfo')!) @@ -59,7 +59,13 @@ export const appConfig = { api: '/carbon-smart/user/login/logInInfo', placeholder: '请选择', autoSelectFirst: true, - onChange: (cur) => { + onChange: async (cur, record) => { + console.log(cur, record); + const configStore = appConfigStore(); + const useAuthorization = authorizationService(); + + const res = await configStore.userResource(record); + useAuthorization.updateUserResource(res.data); // value.value = cur; }, resultField: 'data.linkList', @@ -73,18 +79,24 @@ export const appConfig = { userLoginApi: (params) => { return http.post('/carbon-smart/user/login', { ...params }); }, - userResourceApi: () => { - return http.post('/carbon-smart/user/login/logInInfo').then((res) => { - return { data: res.data.permissionVos }; - }); + userResourceApi: (params) => { + console.log(params, 'userResource'); + + const userInfo = JSON.parse(sessionStorage.getItem('userInfo')!); + const ownOrgInfo = userInfo.linkList?.filter(({ isOwn }) => isOwn)[0]; + return http + .post('/carbon-smart/user/login/logInPermission', !isEmpty(params) ? params : ownOrgInfo) + .then((res) => { + return res; + }); }, userInfoApi: () => { return http.post('/carbon-smart/user/login/logInInfo').then((res) => { const info = res.data; const trD = transform(info, { accountCode: 'userId', - accountName: 'realName', - accountRealName: 'realName', + accountName: 'accountNo', + accountRealName: 'accountNo', orgId: 'orgId', orgName: 'orgName', projectId: 'projectId', diff --git a/hx-ai-intelligent/src/router/equipmentControl.ts b/hx-ai-intelligent/src/router/equipmentControl.ts index 9bedcc5..a951a58 100644 --- a/hx-ai-intelligent/src/router/equipmentControl.ts +++ b/hx-ai-intelligent/src/router/equipmentControl.ts @@ -3,7 +3,7 @@ const equipmentControl = { path: '/equipmentControl', name: 'EquipmentControl', meta: { title: '设备群控', icon: 'dicizhishou', index: 4 }, - redirect: { name: 'homeIndex' }, + redirect: { name: 'LightManage' }, children: [ { path: 'lightManage', diff --git a/hx-ai-intelligent/src/router/equipmentManage.ts b/hx-ai-intelligent/src/router/equipmentManage.ts index 1161e1b..0b18f9f 100644 --- a/hx-ai-intelligent/src/router/equipmentManage.ts +++ b/hx-ai-intelligent/src/router/equipmentManage.ts @@ -3,7 +3,7 @@ const equipment = { path: '/equipmentManage', name: 'EquipmentManage', meta: { title: '设备管理', icon: 'dicizhishou', index: 1 }, - redirect: { name: 'homeIndex' }, + redirect: { name: 'Ledger' }, children: [ { path: 'ledger', diff --git a/hx-ai-intelligent/src/router/home.ts b/hx-ai-intelligent/src/router/home.ts index 78ab742..5174a9d 100644 --- a/hx-ai-intelligent/src/router/home.ts +++ b/hx-ai-intelligent/src/router/home.ts @@ -10,7 +10,7 @@ const home = { name: 'homeIndex', meta: { title: '首页', hideChildren: true, icon: 'dicizhishou' }, component: () => import('/@/view/developing.vue'), - redirect: { name: 'homeIndex' }, + // redirect: { name: 'homeIndex' }, // children: [ // { // path: 'index', diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts index dc07f58..d081a0e 100644 --- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts +++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/config.ts @@ -2,83 +2,75 @@ import { ref } from 'vue'; export const formConfig = (disabled: Boolean) => { return ref([ + { label: '企业名称', field: 'orgName', show: false }, { - field: 'field111', - component: 'NsChildForm', + label: '部门名称', + field: 'deptName', + component: 'NsInput', componentProps: { - schemas: [ - { label: '企业名称', field: 'orgName', show: false }, - { - label: '部门名称', - field: 'deptName', - component: 'NsInput', - componentProps: { - disabled: disabled, - placeholder: '请输入部门名称', - maxLength: 20, - }, - rules: [ - { - required: true, - message: '请输入部门名称', - }, - ], - }, - // { - // label: '上级部门', - // field: 'department', - // component: 'NsSelect', - // componentProps: { - // disabled: true, - // options: [ - // { - // label: '部门1', - // value: 1, - // }, - // { - // label: '部门2', - // value: 2, - // }, - // ], - // }, - // }, - { - label: '部门编码', - field: 'deptCode', - component: 'NsInput', - componentProps: { - disabled: disabled, - placeholder: '请输入部门编码', - maxLength: 20, - }, - rules: [ - { - required: true, - message: '请输入部门编码', - }, - ], - }, - { - label: '排序', - field: 'sort', - component: 'NsInput', - componentProps: { - disabled: disabled, - placeholder: '请输入排序', - maxLength: 2, - }, - }, - { - field: 'remark', - label: '备注', - component: 'NsTextarea', - componentProps: { - disabled: disabled, - placeholder: '请输入', - maxLength: 300, - }, - }, - ], + disabled: disabled, + placeholder: '请输入部门名称', + maxLength: 20, + }, + rules: [ + { + required: true, + message: '请输入部门名称', + }, + ], + }, + // { + // label: '上级部门', + // field: 'department', + // component: 'NsSelect', + // componentProps: { + // disabled: true, + // options: [ + // { + // label: '部门1', + // value: 1, + // }, + // { + // label: '部门2', + // value: 2, + // }, + // ], + // }, + // }, + { + label: '部门编码', + field: 'deptCode', + component: 'NsInput', + componentProps: { + disabled: disabled, + placeholder: '请输入部门编码', + maxLength: 20, + }, + rules: [ + { + required: true, + message: '请输入部门编码', + }, + ], + }, + { + label: '排序', + field: 'sort', + component: 'NsInput', + componentProps: { + disabled: disabled, + placeholder: '请输入排序', + maxLength: 2, + }, + }, + { + field: 'remark', + label: '备注', + component: 'NsTextarea', + componentProps: { + disabled: disabled, + placeholder: '请输入', + maxLength: 300, }, }, ]); @@ -86,84 +78,76 @@ export const formConfig = (disabled: Boolean) => { export const formConfig2 = (disabled2: Boolean) => { return ref([ + { label: '部门名称', field: 'deptName', show: false }, + { - field: 'field111', - component: 'NsChildForm', + label: '角色名称', + field: 'zhName', + component: 'NsInput', componentProps: { - schemas: [ - { label: '部门名称', field: 'deptName', show: false }, - - { - label: '角色名称', - field: 'zhName', - component: 'NsInput', - componentProps: { - disabled: disabled2, - placeholder: '请输入角色名称', - maxLength: 20, - }, - rules: [ - { - required: true, - message: '请输入角色名称', - }, - ], - }, - // { - // label: '上级领导', - // field: 'department', - // component: 'NsSelect', - // componentProps: { - // disabled: true, - // }, - // }, - { - label: '节点编码', - field: 'roleCode', - component: 'NsInput', - componentProps: { - disabled: disabled2, - placeholder: '请输入节点编码', - maxLength: 20, - }, - rules: [ - { - required: true, - message: '请输入节点编码', - }, - ], - }, - { - label: '是否部门领导', - field: 'isLeader', - component: 'NsRadioGroup', - componentProps: { - disabled: disabled2, - radioType: 'radio', - options: [ - { label: '是', value: 0 }, - { label: '否', value: 1 }, - ], - }, - rules: [ - { - required: true, - message: '请选择是否部门领导', - }, - ], - }, - { - field: 'remark', - label: '备注', - component: 'NsTextarea', - componentProps: { - disabled: disabled2, - placeholder: '请输入', - maxLength: 300, - }, - }, + disabled: disabled2, + placeholder: '请输入角色名称', + maxLength: 20, + }, + rules: [ + { + required: true, + message: '请输入角色名称', + }, + ], + }, + // { + // label: '上级领导', + // field: 'department', + // component: 'NsSelect', + // componentProps: { + // disabled: true, + // }, + // }, + { + label: '节点编码', + field: 'roleCode', + component: 'NsInput', + componentProps: { + disabled: disabled2, + placeholder: '请输入节点编码', + maxLength: 20, + }, + rules: [ + { + required: true, + message: '请输入节点编码', + }, + ], + }, + { + label: '是否部门领导', + field: 'isLeader', + component: 'NsRadioGroup', + componentProps: { + disabled: disabled2, + radioType: 'radio', + options: [ + { label: '是', value: 0 }, + { label: '否', value: 1 }, ], }, + rules: [ + { + required: true, + message: '请选择是否部门领导', + }, + ], + }, + { + field: 'remark', + label: '备注', + component: 'NsTextarea', + componentProps: { + disabled: disabled2, + placeholder: '请输入', + maxLength: 300, + }, }, ]); }; diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue index ce6245e..f84f01a 100644 --- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue +++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue @@ -6,9 +6,13 @@
部门管理
- 新增部门 - 新增子部门 - 删除 + + 新增部门 + + 新增子部门 + + 删除 + - + - - + + @check="deptCheck"> - 确定 - 取消 - 编辑 - 确定 + 编辑 + 确定 @@ -62,17 +58,13 @@
角色管理
- 新增角色 - 新增子角色 - 删除 + + 新增角色 + + 新增子角色 + + 删除 + - - + + - 取消 - 编辑 - 确定 - + - - 确定 - + @check="roleCheck" /> + 取消 + 编辑 + 确定 - -