Browse Source

feat: 细节调整

main
xuziqiang 5 months ago
parent
commit
d58f066b39
  1. 25
      hx-ai-intelligent/src/config/app.config.ts
  2. 6
      hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
  3. 25
      hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
  4. 2
      hx-op/.env
  5. 4
      hx-op/src/api/origanizemanage.ts
  6. 73
      hx-op/src/view/organizationManage/enterpriseManage/config.ts
  7. 27
      hx-op/src/view/organizationManage/enterpriseManage/index.vue
  8. 30
      lib/util/http/axios.ts

25
hx-ai-intelligent/src/config/app.config.ts

@ -5,7 +5,11 @@ import { http } from '/nerv-lib/saas';
import { ref } from 'vue'; import { ref } from 'vue';
import { permission } from '/@/api/origanizemanage'; import { permission } from '/@/api/origanizemanage';
const value = ref('1'); // const { linkList } = sessionStorage.getItem('userInfo')
// ? JSON.parse(sessionStorage.getItem('userInfo')!)
// : [{}];
// const value = ref(linkList[0]?.orgId);
const transform = (data, map) => { const transform = (data, map) => {
return Object.keys(map).reduce((pre, cur) => { return Object.keys(map).reduce((pre, cur) => {
pre[cur] = data[map[cur]]; pre[cur] = data[map[cur]];
@ -49,18 +53,20 @@ export const appConfig = {
// }, // },
headerSlotConfig: { headerSlotConfig: {
component: 'NsSelect', component: 'NsSelectApi',
componentProps: { componentProps: {
style: { width: '200px' }, style: { width: '200px' },
api: '/carbon-smart/user/login/logInInfo',
placeholder: '请选择', placeholder: '请选择',
value, autoSelectFirst: true,
onChange: (cur) => { onChange: (cur) => {
value.value = cur; // value.value = cur;
}, },
options: [ resultField: 'data.linkList',
{ label: '济阳', value: '1' }, labelField: 'orgName',
{ label: '临沂', value: '2' }, valueField: 'orgId',
], immediate: true,
dropdownReload: true,
}, },
}, },
timeout: 60 * 1000, timeout: 60 * 1000,
@ -78,7 +84,10 @@ export const appConfig = {
orgId: 'orgId', orgId: 'orgId',
orgName: 'orgName', orgName: 'orgName',
projectId: 'projectId', projectId: 'projectId',
linkList: 'linkList',
permissionInfoList: 'permissionInfoList',
}); });
return { data: { ...trD } }; return { data: { ...trD } };
}); });
}, },

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

@ -439,16 +439,14 @@
// disabled.value = !disabled.value; // disabled.value = !disabled.value;
// console.log(formData.value.name, 'formData'); // console.log(formData.value.name, 'formData');
console.log(opMap.type, 'ApartmentSure'); console.log(opMap.type, 'ApartmentSure');
const opArr = ['addDept', 'editDpet']; const opArr = ['addDept', 'editDpet', 'addson'];
if (opArr.includes(opMap.type)) { if (opArr.includes(opMap.type)) {
console.log(formRef.value, formData); console.log(formRef.value, formData);
opMap.fuc && opMap.fuc &&
opMap.fuc(formData.value).then(() => { opMap.fuc(formData.value).then(() => {
getTree(); getTree();
}); });
} else if (selectRef.value && opMap.type === 'addson') } else if (opMap.type === 'deptDelete') {
opMap.fuc && opMap.fuc(formData.value);
else if (opMap.type === 'deptDelete') {
opMap.fuc && opMap.fuc({ ...formData.value, selectRef: selectRef.value }); opMap.fuc && opMap.fuc({ ...formData.value, selectRef: selectRef.value });
} }
}; };

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

@ -5,7 +5,7 @@
<div class="left"> <div class="left">
<div class="top"> <div class="top">
<div class="ns-table-title">关联企业</div> <div class="ns-table-title">关联企业</div>
<div style="height: 100%; overflow-y: auto"> <div>
<a-input-search <a-input-search
v-model:value="searchValue" v-model:value="searchValue"
style="margin-bottom: 8px" style="margin-bottom: 8px"
@ -22,7 +22,7 @@
</a-tree> </a-tree>
</div> </div>
</div> </div>
<div> <div class="top">
<div class="ns-table-title">关联部门</div> <div class="ns-table-title">关联部门</div>
<a-input-search <a-input-search
@ -371,6 +371,17 @@
defaultParams: { userStatus: 1 }, defaultParams: { userStatus: 1 },
dynamicParams: 'userId', dynamicParams: 'userId',
isReload: true, isReload: true,
ifShow: ({ userStatus }) => userStatus === 0,
api: origanizemanage.frozen,
},
{
label: '解冻',
name: 'userUnFrozen',
confirm: true,
defaultParams: { userStatus: 0 },
dynamicParams: 'userId',
ifShow: ({ userStatus }) => userStatus === 1,
isReload: true,
api: origanizemanage.frozen, api: origanizemanage.frozen,
}, },
{ {
@ -565,8 +576,13 @@
} }
.left { .left {
width: 350px; width: 350px;
border-right: 5px solid rgb(229, 235, 240); max-height: calc(100vh - 96px);
overflow: hidden;
border-right: 16px solid rgb(229, 235, 240);
min-width: fit-content; min-width: fit-content;
.top:first-child {
border-bottom: 16px solid #e5ebf0;
}
} }
.right { .right {
flex: 1; flex: 1;
@ -574,7 +590,8 @@
} }
.top { .top {
height: 50%; height: 50%;
border-bottom: 5px solid rgb(229, 235, 240); // border-bottom: 5px solid rgb(229, 235, 240);
overflow-y: auto;
} }
.ns-table-title { .ns-table-title {
text-align: left; text-align: left;

2
hx-op/.env

@ -1,5 +1,5 @@
# port # port
VITE_PORT = 3301 VITE_PORT = 3302
#mode #mode
VITE_GLOB_APP_RUN_TYPE = saas VITE_GLOB_APP_RUN_TYPE = saas

4
hx-op/src/api/origanizemanage.ts

@ -6,4 +6,8 @@ export enum enterPrise {
edit = `${BASE_URL}/admin/org/edit`, edit = `${BASE_URL}/admin/org/edit`,
save = `${BASE_URL}/admin/org/save`, save = `${BASE_URL}/admin/org/save`,
link = `${BASE_URL}/admin/org/link`, link = `${BASE_URL}/admin/org/link`,
getArea = `${BASE_URL}/system/queryAddressTree`,
freeze = `${BASE_URL}/admin/org/freeze`,
getCode = `${BASE_URL}/admin/org/getCode`,
queryRootAc = `${BASE_URL}/admin/org/queryRootAc`,
} }

73
hx-op/src/view/organizationManage/enterpriseManage/config.ts

@ -1,18 +1,19 @@
import { mockData } from './mock'; import { mockData } from './mock';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import { Modal } from 'ant-design-vue'; import { Modal, message } from 'ant-design-vue';
import { createVNode, ref } from 'vue'; import { createVNode, ref } from 'vue';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { enterPrise } from '/@/api/origanizemanage'; import { enterPrise } from '/@/api/origanizemanage';
type status = 'NORMAL' | 'FREEZE';
export const formConfig = [ export const formConfig = [
{ {
field: 'zuzhi', field: 'projectId',
label: '组织ID', label: '组织ID',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
placeholder: '请输入组织ID', disabled: true,
}, },
rules: [ rules: [
{ {
@ -50,19 +51,17 @@ export const formConfig = [
{ {
field: 'cityName', field: 'cityName',
label: '省市区', label: '省市区',
component: 'NsInputCity', component: 'NsCascader',
defaultValue: '',
fieldMap: ['provinceName', 'cityName', 'areaName', 'province', 'city', 'area'],
componentProps: { componentProps: {
placeholder: '请选择', placeholder: '请选择',
api: '/api/parking_merchant/objs/BaseArea', api: enterPrise.getArea,
isSeparate: true, fieldNames: { label: 'regionName', value: 'regionCode' },
showSearch: true,
}, },
rules: [ rules: [
{ {
required: true, required: true,
message: '请选择区域', message: '请选择省市区',
trigger: 'blur',
}, },
], ],
}, },
@ -76,7 +75,7 @@ export const formConfig = [
}, },
}, },
{ {
field: 'person', field: 'contacts',
label: '联系人', label: '联系人',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
@ -92,7 +91,7 @@ export const formConfig = [
], ],
}, },
{ {
field: 'phone', field: 'phoneNumber',
label: '联系电话', label: '联系电话',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
@ -119,14 +118,6 @@ export const tableConfig = (visible) => {
name: 'RoleTypeAdd', name: 'RoleTypeAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
opMap.type = 'add';
opMap.fuc = (formData: any) => {
console.log(formData, 'formData');
mockData.value.push({
id: Math.random().toString().slice(2, 6),
...cloneDeep(formData),
});
};
visible.value = true; visible.value = true;
}, },
}, },
@ -144,11 +135,11 @@ export const tableConfig = (visible) => {
}, },
{ {
title: '组织ID', title: '组织ID',
dataIndex: 'orgCode', dataIndex: 'projectId',
}, },
{ {
title: '集团名称', title: '集团名称',
dataIndex: 'intro', dataIndex: 'cliqueName',
}, },
{ {
title: '组织名称', title: '组织名称',
@ -157,6 +148,9 @@ export const tableConfig = (visible) => {
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
customRender: ({ value }) => {
return { NORMAL: '正常', FREEZE: '冻结' }[value as status];
},
}, },
{ {
title: '省市区', title: '省市区',
@ -172,15 +166,16 @@ export const tableConfig = (visible) => {
}, },
{ {
title: '联系人', title: '联系人',
dataIndex: 'person', dataIndex: 'contacts',
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'phone', dataIndex: 'phoneNumber',
}, },
], ],
columnActions: { columnActions: {
title: '操作', title: '操作',
autoMergeAction: false,
actions: [ actions: [
{ {
label: '编辑', label: '编辑',
@ -211,18 +206,26 @@ export const tableConfig = (visible) => {
}, },
{ {
label: '冻结', label: '冻结',
name: 'RoleTypeEdit', name: 'enterPriseFreeze',
handle: (record: any) => { confirm: true,
console.log(record, 'record'); isReload: true,
Modal.confirm({ ifShow: ({ status }) => status === 'NORMAL',
title: '是否冻结该账户', api: enterPrise.freeze,
icon: createVNode(ExclamationCircleOutlined), dynamicParams: 'orgId',
content: createVNode('div', { style: 'color:red;' }, ''), defaultParams: {
onOk() { isFreeze: true,
NsMessage.success('冻结成功');
}, },
class: 'test', },
}); {
label: '解冻',
name: 'enterPriseUnFreeze',
confirm: true,
isReload: true,
ifShow: ({ status }) => status === 'FREEZE',
dynamicParams: 'orgId',
api: enterPrise.freeze,
defaultParams: {
isFreeze: false,
}, },
}, },
{ {

27
hx-op/src/view/organizationManage/enterpriseManage/index.vue

@ -2,19 +2,13 @@
<template> <template>
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" rowKey="uuid" /> <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" rowKey="uuid" />
<a-drawer <ns-drawer v-bind="addDrawerConfig">
:width="600"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" /> <ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" />
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button> <a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button> <a-button type="primary" @click="onEdit">确定</a-button>
</template> </template>
</a-drawer> </ns-drawer>
<a-drawer <a-drawer
:width="600" :width="600"
:visible="borderVisible" :visible="borderVisible"
@ -94,6 +88,15 @@
const tableConfig = computed(() => { const tableConfig = computed(() => {
return insertConfig(visible); return insertConfig(visible);
}); });
const getOrgRandomCode = () => {
http.post(enterPrise.getCode).then((res) => {
formData.value.projectId = res.data;
});
};
getOrgRandomCode();
// drawer form
const opMap: any = { const opMap: any = {
type: 'add', type: 'add',
fuc: () => {}, fuc: () => {},
@ -120,6 +123,14 @@
serviceVisible.value = false; serviceVisible.value = false;
}; };
const addDrawerConfig = ref({
width: '520',
visible: visible,
footerStyle: { textAlign: 'right' },
destroyOnClose: true,
onClose: onClose,
});
const borderAdd = () => { const borderAdd = () => {
treeAddVisible.value = true; treeAddVisible.value = true;
treeAdd.value?.toggle(); treeAdd.value?.toggle();

30
lib/util/http/axios.ts

@ -72,31 +72,27 @@ export class NSAxios {
if (this.projectType !== 'web') config.url = `/${this.projectType}/${url}`; if (this.projectType !== 'web') config.url = `/${this.projectType}/${url}`;
} }
// let newUrl = url as string;
// if (config.method === 'get' && config.params) {
// newUrl += '?';
// const keys = Object.keys(config.params);
// for (const key of keys) {
// if (config.params[key] !== undefined) {
// newUrl += `${key}=${encodeURIComponent(config.params[key])}&`;
// }
// }
// newUrl = newUrl.substring(0, newUrl.length - 1);
// config.params = {};
// }
// config.url = newUrl;
return config; return config;
}, undefined); }, undefined);
const errCodeArr = [13, 1, 3005]; const errCodeArr = [13, 1, 3005];
// const newMap = new Map([]) const errCodeMap = new Map([
[13, ''],
[1, ''],
[3005, JSON.stringify(() => routerConfig.logout())],
]);
// type closeType = (() => void) | undefined;
this.instance.interceptors.response.use( this.instance.interceptors.response.use(
(res: AxiosResponse) => { (res: AxiosResponse) => {
console.log('success', res);
// todo // todo
const code = res?.data?.retcode; const code = res?.data?.retcode;
const msg = res?.data?.msg; const msg = res?.data?.msg;
if (errCodeArr.includes(code)) { if (errCodeMap.has(code)) {
NsMessage.error({ content: msg, key: this.errorMsgKey }); NsMessage.error({
content: msg,
key: this.errorMsgKey,
onClose: JSON.parse(errCodeMap.get(code)!),
});
return Promise.reject(res); return Promise.reject(res);
} }
return res; return res;

Loading…
Cancel
Save