| | |
| | | <span>仿真推演方案</span> |
| | | </div> |
| | | <div class="left-content"> |
| | | <div style=" |
| | | <div |
| | | style=" |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | padding: 8px 8px 8px 0px; |
| | | " |
| | | v-if="btnShow"> |
| | | <el-button style="width: 45%;" @click="handleClick">新建仿真方案</el-button> |
| | | <el-button style="width: 45%;" @click="deleteSelectedScheme">删除仿真方案</el-button> |
| | | v-if="btnShow" |
| | | > |
| | | <el-button style="width: 45%" @click="handleClick" |
| | | >新建仿真方案</el-button |
| | | > |
| | | <el-button style="width: 45%" @click="deleteSelectedScheme" |
| | | >删除仿真方案</el-button |
| | | > |
| | | </div> |
| | | <schemeCard ref="schemeCardRef" @start="start" @end="end" @reset="reset" @closeBtn="handleBackFromParent" /> |
| | | <!-- <schemeCard |
| | | <!-- <schemeCard ref="schemeCardRef" @start="start" @end="end" @reset="reset" @closeBtn="handleBackFromParent" /> --> |
| | | <schemeCard |
| | | ref="schemeCardRef" |
| | | @start="start" |
| | | @end="end" |
| | | @reset="reset" |
| | | :deleteSim="deleteSim" |
| | | /> --> |
| | | :showAddIns="showAddIns" |
| | | @closeBtn="handleBackFromParent" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="left" v-show="showAddIns"> |
| | |
| | | // import RiverLevel from "@/components/monifangzhen/RiverLevel.vue"; |
| | | import { createPoint, removeEntities } from "@/utils/map"; |
| | | // import { deviceDictList, getDictName } from "@/constant/dict.js"; |
| | | |
| | | import { getDeviceData } from "@/api/index"; |
| | | const emits = defineEmits(["start", "end"]); |
| | | |
| | |
| | | } |
| | | function handleBackFromParent(value) { |
| | | if (value === false) { |
| | | btnShow.value = false |
| | | } else btnShow.value = true |
| | | btnShow.value = false; |
| | | } else btnShow.value = true; |
| | | } |
| | | function initDevicePoint() { |
| | | list.forEach((item) => { |
| | |
| | | } |
| | | const schemeCardRef = ref(null); |
| | | |
| | | function deleteSelectedScheme() { |
| | | const selectedId = schemeCardRef.value.getSelectedId(); |
| | | const selectedScheme = simStore.schemCard.find( |
| | | (item) => item.id === selectedId |
| | | ); |
| | | if (!selectedId) { |
| | | ElMessage.warning("请先选择一个方案!"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | `确定要删除 "${selectedScheme.name}" 方案吗?`, |
| | | "删除确认", |
| | | { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | simStore.removeSchemCardItem(selectedId); |
| | | ElMessage.success(`方案 "${selectedScheme.name}" 删除成功!`); |
| | | }) |
| | | .catch(() => { }); |
| | | } |
| | | // function deleteSelectedScheme() { |
| | | // const selectedId = schemeCardRef.value.getSelectedId(); |
| | | // const selectedScheme = simStore.schemCard.find( |
| | | // (item) => item.id === selectedId |
| | | // ); |
| | | // if (!selectedId) { |
| | | // ElMessage.warning("请先选择一个方案!"); |
| | | // return; |
| | | // } |
| | | // ElMessageBox.confirm( |
| | | // `确定要删除 "${selectedScheme.name}" 方案吗?`, |
| | | // "删除确认", |
| | | // { |
| | | // confirmButtonText: "确定", |
| | | // cancelButtonText: "取消", |
| | | // type: "warning", |
| | | // } |
| | | // ) |
| | | // .then(() => { |
| | | // simStore.removeSchemCardItem(selectedId); |
| | | // ElMessage.success(`方案 "${selectedScheme.name}" 删除成功!`); |
| | | // }) |
| | | // .catch(() => { }); |
| | | // } |
| | | |
| | | function start(form) { |
| | | emits("start", form); |
| | |
| | | }); |
| | | |
| | | ///////////////////////////删除仿真方案/////////////////////////// |
| | | // const deleteSim = ref(false); |
| | | const deleteSim = ref(false); |
| | | |
| | | // function reset() { |
| | | // deleteSim.value = false; // 重置标志位 |
| | | // } |
| | | // function deleteSelectedScheme() { |
| | | // deleteSim.value = true; |
| | | // } |
| | | function reset() { |
| | | deleteSim.value = false; // 重置标志位 |
| | | } |
| | | function deleteSelectedScheme() { |
| | | deleteSim.value = true; |
| | | } |
| | | ///////////////////////////删除仿真方案/////////////////////////// |
| | | </script> |
| | | <style lang="less" scoped> |