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