| | |
| | | </div> |
| | | </div> |
| | | <div class="btnGroups"> |
| | | <el-button class="ztzf-button" @click="addFence">新增围栏</el-button> |
| | | <el-button class="ztzf-button" @click="addFence">{{props.activeName === '电子围栏' ? '新增围栏' : '新增禁飞区'}}</el-button> |
| | | <el-button class="ztzf-button" @click="addFolder">新增文件夹</el-button> |
| | | <el-button class="ztzf-button" @click="selectAll">全选</el-button> |
| | | </div> |
| | |
| | | <span>{{ node.label }}</span> |
| | | <!-- 操作按钮组 --> |
| | | <div class="tree-node-actions"> |
| | | <el-button |
| | | <el-button v-if="node.level !== 1" |
| | | icon="el-icon-location" |
| | | type="text" |
| | | @click="handleLocation(node)" |
| | |
| | | import { treeDataApi ,deleteFenceApi} from '@/api/layer/index'; |
| | | import { inject, onMounted } from 'vue'; |
| | | const emit = defineEmits(['update:coverData', 'update:deitData','newFencesMethods']); |
| | | import EventBus from '@/utils/eventBus' |
| | | const coverData = ref(); |
| | | const layerParams = inject('layerParams'); |
| | | const checkedKeys = ref([]); // 存储勾选的节点key |
| | |
| | | try { |
| | | const res = await treeDataApi(); |
| | | treeAllData.value = res.data.data; |
| | | console.log('接口数据',treeAllData.value); |
| | | |
| | | setupWatch(); |
| | | } catch (error) { |
| | |
| | | coverData.value = []; |
| | | layerParams.value.editNest = true; |
| | | layerParams.value.decideWhetherToAddOrEdit = 2 |
| | | if (props.activeName === '电子围栏') { |
| | | layerParams.value.fenceType = 1; // 电子围栏类型标识 |
| | | } else if (props.activeName === '自定义禁飞区') { |
| | | layerParams.value.fenceType = 2; // 自定义禁飞区类型标识 |
| | | } |
| | | emit('update:deitData', node.data); |
| | | }; |
| | | |
| | |
| | | const addFence = () => { |
| | | layerParams.value.addNest = true; |
| | | layerParams.value.decideWhetherToAddOrEdit = 1 |
| | | emit('newFencesMethods'); |
| | | console.log('layerParams.value',layerParams.value); |
| | | |
| | | if (props.activeName === '电子围栏') { |
| | | layerParams.value.fenceType = 1; // 电子围栏类型标识 |
| | | } else if (props.activeName === '自定义禁飞区') { |
| | | layerParams.value.fenceType = 2; // 自定义禁飞区类型标识 |
| | | } |
| | | emit('newFencesMethods'); |
| | | }; |
| | | // 新增文件夹 |
| | | const addFolder = () => { |
| | | layerParams.value.addFolder = true |
| | | layerParams.value.addAnEditingFolder =1 |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | gettreeDataApi(); |
| | | EventBus.on('gettreeDataApi', gettreeDataApi) |
| | | }); |
| | | const changeClick = val => {}; |
| | | onBeforeUnmount(()=>{ |
| | | EventBus.off('gettreeDataApi', gettreeDataApi) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |