| | |
| | | // 新增围栏 |
| | | const addFence = () => { |
| | | layerParams.value.addNest = true; |
| | | console.log('layerParams.value',layerParams.value); |
| | | |
| | | }; |
| | | // 新增文件夹 |
| | | const addFolder = () => {}; |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { deitFenceApi } from '@/api/layer/index'; |
| | | const emit = defineEmits([ 'callParentMethod']); |
| | | const layerParams = inject('layerParams'); |
| | | const formData = ref({ |
| | |
| | | detailData.value = layerParams.value.editDetailData |
| | | const totalArea = layerParams.value.total_area |
| | | const totalCount = layerParams.value.total_count |
| | | console.log('layerParams',layerParams |
| | | console.log('layerParams',detailData.value |
| | | ); |
| | | |
| | | const cancelHandel = () => { |
| | |
| | | emit('callParentMethod'); |
| | | }; |
| | | const submitHandle = () => { |
| | | const params={ |
| | | folder_id:detailData.value.folder_id, |
| | | id:detailData.value.id, |
| | | name:detailData.value.name, |
| | | description:detailData.value.description, |
| | | is_enabled: detailData.value.is_enabled, |
| | | area:detailData.value.area, |
| | | altitude:detailData.value.altitude, |
| | | geo_data: layerParams.value.polygonPosition, |
| | | } |
| | | deitFenceApi(params).then(res=>{ |
| | | console.log('保存',res); |
| | | |
| | | }) |
| | | layerParams.value.addNest = false; |
| | | layerParams.value.editNest = false; |
| | | emit('callParentMethod'); |
| | |
| | | editDetailData: null, |
| | | total_count: 0, |
| | | total_area: 0, |
| | | polygonPosition:null, |
| | | }); |
| | | provide('layerParams', layerParams); |
| | | const handleClick = tab => { |
| | |
| | | activeName.value = clickedTab.name; |
| | | }; |
| | | |
| | | |
| | | |
| | | let tbJwdList = []; |
| | | const selectDataList = ref([]); |
| | | // 编辑区域 |
| | | // 编辑围栏区域 |
| | | const handleEdit = val => { |
| | | console.log('编辑数据', val); |
| | | layerParams.value.editDetailData = val; |
| | | drawPolygonExample.editThePatch(true); |
| | | const positions = parseGeoDataToPositions(val.geo_data, val.altitude); |
| | |
| | | } |
| | | let polygon = curPolygonPosition.map(item => [item?.lng, item?.lat]); |
| | | polygon.push([curPolygonPosition[0]?.lng, curPolygonPosition[0]?.lat]); |
| | | console.log('绘制的多边形顶点坐标(Cartesian3):', polygon); |
| | | |
| | | console.log('转换后的经纬度坐标:', curPolygonPosition); |
| | | // console.log('绘制的多边形顶点坐标(Cartesian3):', polygon); |
| | | layerParams.value.polygonPosition = polygon |
| | | console.log('polygon', layerParams.value.polygonPosition); |
| | | }; |
| | | const throttleLoadPlanarRoute = throttle(loadPlanarRoute, 200); |
| | | drawPolygonExample.subscribe('getPolygonPositions', data => { |