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

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

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

Loading…
Cancel
Save