|
@ -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> |
|
|