Browse Source

补充删除

master
menghao 2 months ago
parent
commit
6071fa0402
  1. 8
      ruoyi-ui/src/views/childRoom/RightPanel.vue
  2. 47
      ruoyi-ui/src/views/childRoom/index.vue

8
ruoyi-ui/src/views/childRoom/RightPanel.vue

@ -71,7 +71,7 @@
<div class="tree-item-actions">
<i class="el-icon-view" title="显示/隐藏" @click.stop="handleToggleRouteVisibility(route)"></i>
<i class="el-icon-edit" title="编辑" @click.stop="handleOpenRouteDialog(route)"></i>
<i class="el-icon-delete" title="删除" @click.stop="handleDeleteRoute(route)"></i>
<i class="el-icon-delete" title="删除" @click.stop="$emit('delete-route', route)"></i>
</div>
</div>
<!-- 航点列表 -->
@ -359,7 +359,6 @@ export default {
this.$emit('hide')
},
// 线
handleSelectPlan(plan) {
this.$emit('select-plan', plan)
},
@ -407,11 +406,6 @@ export default {
active: this.activeRouteIds.includes(routeId)
}
},
handleDeleteRoute(route) {
//
},
handleOpenWaypointDialog(point) {
this.$emit('open-waypoint-dialog', point)
},

47
ruoyi-ui/src/views/childRoom/index.vue

@ -125,6 +125,7 @@
@select-plan="selectPlan"
@select-route="selectRoute"
@create-route="createRoute"
@delete-route="handleDeleteRoute"
@create-plan="createPlan"
@open-plan-dialog="openPlanDialog"
@open-route-dialog="openRouteDialog"
@ -272,6 +273,7 @@ import LeftMenu from './LeftMenu'
import RightPanel from './RightPanel'
import BottomLeftPanel from './BottomLeftPanel'
import TopHeader from './TopHeader'
import { listScenario} from "@/api/system/scenario";
import { listRoutes, getRoutes, addRoutes,delRoutes } from "@/api/system/routes";
import { updateWaypoints } from "@/api/system/waypoints";
export default {
@ -436,20 +438,7 @@ export default {
],
// 线 - -线-
plans: [
{
id: 1,
name: '方案A',
routes: [
]
},
{
id: 2,
name: '方案B',
routes: [
]
}
],
plans: [],
//
timeProgress: 45,
@ -580,12 +569,23 @@ export default {
}
},
/** 从数据库拉取最新的航线列表数据 */
/** 从数据库拉取最新的数据 */
async getList() {
const query = {}; // scenarioId线
try {
const response = await listRoutes(query);
if (response.code === 200) {
this.routes = response.rows.map(item => ({
// 1.
const scenarioRes = await listScenario({});
if (scenarioRes.code === 200) {
this.plans = scenarioRes.rows.map(s => ({
id: s.id,
name: s.name,
routes: []
}));
}
// 2. 线
const routeRes = await listRoutes({});
if (routeRes.code === 200) {
const allRoutes = routeRes.rows.map(item => ({
id: item.id,
name: item.callSign,
points: item.waypoints ? item.waypoints.length : 0,
@ -593,9 +593,18 @@ export default {
conflict: false,
scenarioId: item.scenarioId
}));
// 3. 线
this.plans.forEach(plan => {
plan.routes = allRoutes.filter(r => r.scenarioId === plan.id);
});
// routes 使
this.routes = allRoutes;
}
} catch (error) {
this.$message.error("获取航线列表失败");
console.error("数据加载失败:", error);
this.$message.error("获取方案列表失败");
}
},
handleMapDrawComplete(points) {

Loading…
Cancel
Save