| | |
| | | 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 |
| | | ref="schemeCardRef" |
| | | @start="start" |
| | | @end="end" |
| | | @reset="reset" |
| | | :deleteSim="deleteSim" |
| | | /> --> |
| | | <!-- <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"]); |
| | | |
| | | const list = [ |
| | |
| | | const showAddIns = ref(false); |
| | | const btnShow = ref(true); |
| | | let divPointList = []; |
| | | |
| | | function handleClick() { |
| | | // currentMock.value = mock.name; |
| | | showAddIns.value = true; |
| | | } |
| | | |
| | | function handleBack(value) { |
| | | showAddIns.value = false; // 隐藏子组件 |
| | | } |
| | | 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) => { |
| | |
| | | // createPoint(item) |
| | | }); |
| | | } |
| | | function getData() { |
| | | getDeviceData().then((res) => { |
| | | devicetList.value = res.data; |
| | | }); |
| | | } |
| | | |
| | | function createLabel(item) { |
| | | const { name, x, y, showBillboard = false } = item; |
| | | let position = Cesium.Cartesian3.for(x, y); |
| | |
| | | } |
| | | 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 start(form) { |
| | | emits("start", form); |
| | | } |
| | |
| | | emits("end"); |
| | | } |
| | | onMounted(() => { |
| | | // getData() |
| | | // initDevicePoint() |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | ///////////////////////////删除仿真方案/////////////////////////// |
| | | // 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> |