|
@@ -35,6 +35,7 @@
|
|
|
<span>{{ item.name }}</span>
|
|
|
<i title="查看" @click="handleCheck(item, 'area')" :class="{ 'active': item.check }"></i>
|
|
|
<i title="网格" @click="handleMesh(item, 'area')" :class="{ 'active': item.mesh }"></i>
|
|
|
+ <i title="删除" @click="handleDelete(item, 'area')"></i>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</Transition>
|
|
@@ -51,6 +52,7 @@
|
|
|
<span>{{ item.name }}</span>
|
|
|
<i title="查看" @click="handleCheck(item, 'route')" :class="{ 'active': item.check }"></i>
|
|
|
<i title="网格" @click="handleMesh(item, 'route')" :class="{ 'active': item.mesh }"></i>
|
|
|
+ <i title="删除" @click="handleDelete(item, 'area')"></i>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</Transition>
|
|
@@ -67,6 +69,7 @@
|
|
|
<span>{{ item.name }}</span>
|
|
|
<i title="查看" @click="handleCheck(item, 'plot')" :class="{ 'active': item.check }"></i>
|
|
|
<i title="网格" @click="handleMesh(item, 'plot')" :class="{ 'active': item.mesh }"></i>
|
|
|
+ <i title="删除" @click="handleDelete(item, 'area')"></i>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</Transition>
|
|
@@ -79,9 +82,10 @@
|
|
|
import { getAssetsFile, getData } from '@/utils/require';
|
|
|
import { onBeforeMount, onBeforeUnmount, reactive, ref } from 'vue';
|
|
|
import { showShapes, heatMap, AddSingleLayer, InspectCube } from '@/utils/map/addLayer'
|
|
|
-import { GetAreaList, GetPlotList, GetRouteList } from '@/service/http'
|
|
|
+import {DeleteArea, DeletePlot, DeleteRoute, GetAreaList, GetPlotList, GetRouteList} from '@/service/http'
|
|
|
import { airSpaceTypes } from '@/utils/options';
|
|
|
import { hexToRgb } from '@/utils/tools';
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
getLists()
|
|
@@ -193,6 +197,37 @@ function handleCheck(item, type) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function handleDelete(item, type){
|
|
|
+ debugger
|
|
|
+ switch(type) {
|
|
|
+ case 'area':
|
|
|
+ DeleteArea(item.id).then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ getLists()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'plot':
|
|
|
+ DeletePlot(item.id).then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ getLists()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case 'route':
|
|
|
+ DeleteRoute(item.id).then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ getLists()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
function handleMesh(item) {
|
|
|
item.mesh = !item.mesh
|
|
|
InspectCube({
|
|
@@ -381,5 +416,8 @@ const vCollapse = {
|
|
|
i:nth-child(4) {
|
|
|
background: url('../../../assets/images/page/btn-mesh.png');
|
|
|
}
|
|
|
+ i:nth-child(5) {
|
|
|
+ background: url('../../../assets/images/page/btn-delete.png');
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|