| | |
| | | <div class="buttons"> |
| | | <el-button type="primary" @click="openPlan">打开方案</el-button> |
| | | <el-button type="primary" @click="openSaveDialog">保存方案</el-button> |
| | | <el-button type="success" @click="startSimulation">开始模拟</el-button> |
| | | <el-button type="success" @click="startPlay">开始模拟</el-button> |
| | | </div> |
| | | |
| | | <!-- 保存方案对话框 --> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed } from 'vue'; |
| | | import { ref, computed,inject } from 'vue'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { initeWaterPrimitiveView } from "@/utils/water"; |
| | | const { startSimulate, endSimulate } = inject("simulateActions"); |
| | | |
| | | function startPlay() { |
| | | console.log("开始模拟按钮被点击"); |
| | | console.log("当前选中的区域:", props.selectedArea); |
| | | initeWaterPrimitiveView(); |
| | | startSimulate(); |
| | | } |
| | | // 定义 Props |
| | | const props = defineProps({ |
| | | selectedArea: { |
| | |
| | | // 打开方案 |
| | | const openPlan = () => { |
| | | console.log('打开方案按钮被点击'); |
| | | }; |
| | | |
| | | // 开始模拟 |
| | | const startSimulation = () => { |
| | | console.log('开始模拟按钮被点击'); |
| | | console.log('当前选中的区域:', props.selectedArea); |
| | | }; |
| | | </script> |
| | | |