Browse Source

feat: 企业细节逻辑调整

main
xuziqiang 6 months ago
parent
commit
819a00f733
  1. 1
      hx-op/src/api/origanizemanage.ts
  2. 28
      hx-op/src/view/organizationManage/enterpriseManage/TreeAdd.vue
  3. 18
      hx-op/src/view/organizationManage/enterpriseManage/config.ts
  4. 84
      hx-op/src/view/organizationManage/enterpriseManage/index.vue
  5. 4
      lib/util/http/axios.ts

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

@ -15,4 +15,5 @@ export enum enterPrise {
queryOrgPermission = `${BASE_URL}/admin/org/QueryOrgPermission`, queryOrgPermission = `${BASE_URL}/admin/org/QueryOrgPermission`,
queryOrgTree = `${BASE_URL}/admin/org/QueryLinkOrgTree`, queryOrgTree = `${BASE_URL}/admin/org/QueryLinkOrgTree`,
resetPwd = `${BASE_URL}/api/user/resetPwd`, resetPwd = `${BASE_URL}/api/user/resetPwd`,
delLink = `${BASE_URL}/admin/org/delLink`,
} }

28
hx-op/src/view/organizationManage/enterpriseManage/TreeAdd.vue

@ -1,22 +1,35 @@
<template> <template>
<a-modal title="企业信息" :width="500" v-model:visible="visible" @ok="handleOk"> <a-modal title="企业信息" :width="500" destroyOnClose v-model:visible="visible" @ok="handleOk">
<ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" /> <ns-form ref="formRef" :schemas="formSchema" :model="formData" formLayout="vertical" />
</a-modal> </a-modal>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, reactive, ref } from 'vue'; import { defineComponent, reactive, ref, watch } from 'vue';
import { enterPrise } from '/@/api/origanizemanage'; import { enterPrise } from '/@/api/origanizemanage';
export default defineComponent({ export default defineComponent({
name: 'AddBorderVisible', name: 'AddBorderVisible',
props: { info: Object },
emits: ['ok'], emits: ['ok'],
setup(props, { emit }) { setup(props, { attrs, emit }) {
let formData = ref({}); let formData = ref({});
const formRef = ref(); const formRef = ref();
const visible = ref(false); const visible = ref(false);
const toggle = () => { const toggle = () => {
formData.value = {};
visible.value = !visible.value; visible.value = !visible.value;
}; };
const currentOrgId = ref();
console.log(attrs, 'attrs');
watch(
() => props.info,
() => {
console.log(props.info, 'sdfasdf');
currentOrgId.value = props.info?.orgId;
},
{ deep: true, immediate: true },
);
const formSchema = reactive([ const formSchema = reactive([
{ {
field: 'orgId', field: 'orgId',
@ -35,12 +48,18 @@
labelField: 'orgName', labelField: 'orgName',
valueField: 'orgId', valueField: 'orgId',
immediate: true, immediate: true,
filterData: (item) => {
return item.orgId !== currentOrgId.value;
},
showSearch: true,
filterOption: (input: string, option: any) => {
return option.orgName.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
placeholder: '请选择', placeholder: '请选择',
}, },
rules: [ rules: [
{ {
required: true, required: true,
trigger: 'blur',
}, },
], ],
}, },
@ -60,7 +79,6 @@
required: true, required: true,
message: '请选择是否分享', message: '请选择是否分享',
type: 'number', type: 'number',
trigger: 'blur',
}, },
], ],
}, },

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

@ -251,6 +251,7 @@ export const tableConfig = ({
columnActions: { columnActions: {
title: '操作', title: '操作',
autoMergeAction: false, autoMergeAction: false,
actionNumber: 1,
actions: [ actions: [
{ {
label: '编辑', label: '编辑',
@ -352,24 +353,25 @@ export const tableConfig = ({
options: [ options: [
{ {
label: '正常', label: '正常',
value: 1, value: 'NORMAL',
}, },
{ {
label: '冻结', label: '冻结',
value: 2, value: 'FREEZE',
}, },
], ],
}, },
}, },
{ {
field: 'cityName', field: 'cityName',
label: '城市地区', label: '省市区',
component: 'NsInputCity', component: 'NsCascader',
defaultValue: '', fieldMap: ['province', 'city', 'county'],
fieldMap: ['provinceName', 'cityName', 'areaName', 'province', 'city', 'area'],
componentProps: { componentProps: {
api: '/api/parking_merchant/objs/BaseArea', placeholder: '请选择',
isSeparate: true, api: enterPrise.getArea,
fieldNames: { label: 'regionName', value: 'regionName' },
showSearch: true,
}, },
}, },
], ],

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

@ -10,18 +10,18 @@
</template> </template>
</ns-drawer> </ns-drawer>
<ns-drawer v-bind="boundaryDrawer"> <ns-drawer v-bind="boundaryDrawer">
<ns-button type="primary" @click="borderAdd">新增</ns-button> <ns-button type="primary" @click="borderAdd('2')">新增</ns-button>
<ns-button type="primary" style="margin-left: 10px; margin-bottom: 10px" @click="borderAdd" <ns-button type="primary" style="margin-left: 10px; margin-bottom: 10px" @click="borderAdd('1')"
>新增子集</ns-button >新增子集</ns-button
> >
<a-tree v-if="linkTree?.length" v-bind="boundaryTree" class="boundaryTree"> <a-tree v-if="linkTree?.length" v-bind="boundaryTree" class="boundaryTree">
<template #title="data"> <template #title="data">
<span>{{ data.orgInfo.orgName }}</span> <div class="node">
<!-- <ns-button type="link" danger >删除</ns-button> --> <span>{{ data.orgInfo.orgName }}</span>
<span v-if="data.orgInfo.orgId !== currentBoundaryRecord.orgId">
<span v-if="data.orgInfo.orgId !== currentBoundaryRecord.orgId" class="nodeDelete"> <DeleteOutlined class="nodeDelete" @click="deleteTree(data)" />
<DeleteOutlined @click="deleteTree(data)" </span>
/></span> </div>
</template> </template>
</a-tree> </a-tree>
</ns-drawer> </ns-drawer>
@ -35,7 +35,7 @@
<a-tree v-if="treeData?.length" v-model:checkedKeys="checkedKeys" v-bind="serverTree" /> <a-tree v-if="treeData?.length" v-model:checkedKeys="checkedKeys" v-bind="serverTree" />
</ns-drawer> </ns-drawer>
<TreeAdd ref="treeAdd" @ok="handleOk" /> <TreeAdd ref="treeAdd" @ok="handleOk" :info="currentBoundaryRecord" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
@ -47,7 +47,7 @@
import { h } from 'vue'; import { h } from 'vue';
import { formConfig } from './config'; import { formConfig } from './config';
import { NsMessage, NsModal } from '/nerv-lib/component'; import { NsMessage, NsModal } from '/nerv-lib/component';
import { mockData, treeData } from './mock'; // import { mockData, treeData } from './mock';
import { enterPrise } from '/@/api/origanizemanage'; import { enterPrise } from '/@/api/origanizemanage';
import { tableConfig as insertConfig } from './config'; import { tableConfig as insertConfig } from './config';
defineOptions({ defineOptions({
@ -70,6 +70,8 @@
const currentBoundaryRecord = ref({}); const currentBoundaryRecord = ref({});
const currentSelectBoundaryNode = ref({}); const currentSelectBoundaryNode = ref({});
const linkTree = ref([]); const linkTree = ref([]);
const treeData = ref([]);
const addType = ref(); //1 2
const totalCheckedKeys = ref([]); const totalCheckedKeys = ref([]);
const opType = ref<string>('add'); const opType = ref<string>('add');
const calMap = { const calMap = {
@ -159,6 +161,7 @@
}; };
fetch(params, false); fetch(params, false);
}; };
const ServiceSelect = (selectedKeys: any, info: any) => { const ServiceSelect = (selectedKeys: any, info: any) => {
console.log(selectedKeys, 'selectedKeys'); console.log(selectedKeys, 'selectedKeys');
console.log(info, 'info'); console.log(info, 'info');
@ -223,7 +226,7 @@
// drawer // drawer
const boundaryDrawer = ref({ const boundaryDrawer = ref({
width: 520, width: 420,
visible: borderVisible, visible: borderVisible,
footerStyle: { textAlign: 'right' }, footerStyle: { textAlign: 'right' },
destroyOnClose: true, destroyOnClose: true,
@ -252,7 +255,8 @@
defaultExpandAll: true, defaultExpandAll: true,
onSelect: handleSelect, onSelect: handleSelect,
treeData: linkTree, treeData: linkTree,
// blockNode: true, blockNode: true,
// selectable: false,
}); });
// //
@ -263,7 +267,7 @@
{ {
linkOrgId: res.orgId, linkOrgId: res.orgId,
point: res.point, point: res.point,
type: 1, //1 2 type: addType.value, //1 2
}, },
], ],
@ -278,7 +282,9 @@
}); });
}); });
}; };
const borderAdd = () => {
const borderAdd = (type) => {
addType.value = type;
treeAddVisible.value = true; treeAddVisible.value = true;
treeAdd.value?.toggle(); treeAdd.value?.toggle();
}; };
@ -294,7 +300,18 @@
const deleteTree = (node: any) => { const deleteTree = (node: any) => {
console.log(node, 'node'); console.log(node, 'node');
const { orgId, point, type } = node.data?.orgInfo;
const params = {
linkOrgVoList: [
{
linkOrgId: orgId,
point,
type,
},
],
orgId: currentBoundaryRecord.value.orgId || '',
};
NsModal.confirm({ NsModal.confirm({
title: '是否确定删除', title: '是否确定删除',
content: createVNode('div', { style: 'color:red;' }, ''), content: createVNode('div', { style: 'color:red;' }, ''),
@ -305,18 +322,13 @@
NsMessage.error('请先删除子集'); NsMessage.error('请先删除子集');
return; return;
} }
// http http.post(enterPrise.delLink, params).then((res) => {
// .post('/api/parking_merchant/objs/gateInfo/delete', { getBoundaryTree({
// uuid: record.uuid, orgId: currentBoundaryRecord.value.orgId,
// }) orgName: currentBoundaryRecord.value.orgName,
// .then((res) => { });
// mainRef.value.nsTableRef.reload(); });
// });
},
onCancel() {
console.log('Cancel');
}, },
class: 'test',
}); });
}; };
@ -326,19 +338,19 @@
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.nodeDelete { .nodeDelete {
// display: none; margin-right: 16px;
margin-left: 40px; display: none;
} }
.boundaryTree { .node {
background-color: red !important; display: flex;
justify-content: space-between;
align-items: center;
} }
:deep(.ant-tree) { .node {
background-color: red !important; &:hover {
.nodeDelete {
// &:hover { display: block !important;
.nodeDelete { }
display: block;
} }
// }
} }
</style> </style>

4
lib/util/http/axios.ts

@ -75,10 +75,10 @@ export class NSAxios {
return config; return config;
}, undefined); }, undefined);
const errCodeMap = new Map([ const errCodeMap = new Map<number, any>([
[13, ''], [13, ''],
[1, ''], [1, ''],
[3005, () => routerConfig.logout()], [10086, () => routerConfig.logout()],
]); ]);
// type closeType = (() => void) | undefined; // type closeType = (() => void) | undefined;

Loading…
Cancel
Save