新增所需力量

This commit is contained in:
huangchenhao 2025-11-28 10:20:23 +08:00
parent a1115c2c42
commit 93ba75de47
2 changed files with 69 additions and 21 deletions

View File

@ -169,7 +169,36 @@
</div> </div>
</section> </section>
<!-- 4. 力量调派方案 --> <!-- 4. 所需力量 -->
<section class="plan-section">
<div class="section-header">
<img
src="../../assets/images/modal/弹窗title.png"
alt=""
class="title-icon"
/>
<h3 class="section-title">所需力量</h3>
</div>
<div class="section-body">
<div class="dispatch-plans">
<div class="dispatch-card">
<div class="resource-grid">
<div
v-for="(resource, index) in requiredResources"
:key="index"
class="resource-item"
:class="{ 'full-width': resource.label === '物资' }"
>
<span class="resource-label">{{ resource.label }}</span>
<span class="resource-value">{{ resource.value }}</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- 5. 力量调派方案 -->
<section class="plan-section"> <section class="plan-section">
<div class="section-header"> <div class="section-header">
<img <img
@ -317,6 +346,21 @@ const clearanceSteps = reactive([
}, },
]); ]);
/**
* 所需力量数据
*/
const requiredResources = ref([
{ label: "挖掘设备", value: "2台" },
{ label: "装载机", value: "2台" },
{ label: "运渣设备", value: "6台" },
{ label: "运输设备", value: "2台" },
{ label: "人员", value: "20人" },
{
label: "物资",
value: "标志标牌10块、锥桶50件铁锹10把雪糕筒100件麻袋、砂石料等若干",
},
]);
/** /**
* 力量调派预案 * 力量调派预案
*/ */
@ -1012,4 +1056,7 @@ const handleDeletePlan = (id) => {
background: #052044 !important; background: #052044 !important;
} }
} }
.full-width {
grid-column: 1 / -1;
}
</style> </style>

View File

@ -36,11 +36,11 @@ export function useAmapRouting() {
lastError.value = error.message lastError.value = error.message
console.error('[useAmapRouting] 路线计算失败:', error) console.error('[useAmapRouting] 路线计算失败:', error)
// 降级:生成直线路径 // // 降级:生成直线路径
if (options.fallbackToStraightLine !== false) { // if (options.fallbackToStraightLine !== false) {
console.warn('[useAmapRouting] 使用直线降级方案') // console.warn('[useAmapRouting] 使用直线降级方案')
return generateStraightLineRoute(origin, destination) // return generateStraightLineRoute(origin, destination)
} // }
throw error throw error
} finally { } finally {
@ -60,22 +60,23 @@ export function useAmapRouting() {
const results = await calculateMultipleRoutes(routePairs) const results = await calculateMultipleRoutes(routePairs)
// 对失败的路线使用直线降级 // // 对失败的路线使用直线降级
const processedResults = results.map(result => { // const processedResults = results.map(result => {
if (!result.success) { // if (!result.success) {
console.warn(`[useAmapRouting] 路线 ${result.name} 失败,使用直线降级`) // console.warn(`[useAmapRouting] 路线 ${result.name} 失败,使用直线降级`)
const fallbackRoute = generateStraightLineRoute(result.origin, result.destination) // const fallbackRoute = generateStraightLineRoute(result.origin, result.destination)
return { // return {
...result, // ...result,
...fallbackRoute, // ...fallbackRoute,
isFallback: true, // isFallback: true,
success: true // success: true
} // }
} // }
return result // return result
}) // })
return processedResults // return processedResults
return results
} catch (error) { } catch (error) {
lastError.value = error.message lastError.value = error.message
console.error('[useAmapRouting] 批量路线计算失败:', error) console.error('[useAmapRouting] 批量路线计算失败:', error)