| | |
| | | import { ref, watch, defineProps, computed } from 'vue'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { initeWaterPrimitiveView } from "@/utils/water"; |
| | | |
| | | const emit = defineEmits(["start", "end"]); |
| | | function endPlay() { |
| | | emit("end"); |
| | | } |
| | | const { startSimulate, endSimulate } = inject("simulateActions"); |
| | | |
| | | function startPlay() { |
| | | initeWaterPrimitiveView(); |
| | | emit("start"); |
| | | const selectedItems = filteredTableData.value.filter(item => item.selected); |
| | | if (selectedItems.length > 0) { |
| | | console.log('选中的项:', selectedItems.map(item => item.name)); |
| | | } else { |
| | | console.log('未选中任何项'); |
| | | } |
| | | console.log('当前选中的区域:', props.selectedArea); |
| | | console.log('当前选中的雨量数据:', selectedRainfall.value); |
| | | initeWaterPrimitiveView(); |
| | | startSimulate(); |
| | | } |
| | | // 工具函数:深拷贝并设置默认选中状态 |
| | | function deepCloneAndSetSelected(data) { |
| | |
| | | ], |
| | | tableData: { |
| | | '1': [ |
| | | { id: '001', name: '孙胡沟气象站001' }, // 默认未勾选 |
| | | { id: '002', name: '孙胡沟气象站002' } // 默认未勾选 |
| | | { id: '001', name: '孙胡沟气象站001' }, |
| | | { id: '002', name: '孙胡沟气象站002' } |
| | | ], |
| | | '2': [ |
| | | { id: '003', name: '孙胡沟雨量计003' }, // 默认未勾选 |
| | | { id: '004', name: '孙胡沟雨量计004' } // 默认未勾选 |
| | | { id: '003', name: '孙胡沟雨量计003' }, |
| | | { id: '004', name: '孙胡沟雨量计004' } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | ], |
| | | tableData: { |
| | | '1': [ |
| | | { id: '005', name: '鱼水洞后沟气象站005' }, // 默认未勾选 |
| | | { id: '006', name: '鱼水洞后沟气象站006' } // 默认未勾选 |
| | | { id: '005', name: '鱼水洞后沟气象站005' }, |
| | | { id: '006', name: '鱼水洞后沟气象站006' } |
| | | ], |
| | | '2': [ |
| | | { id: '007', name: '鱼水洞后沟雨量计007' }, // 默认未勾选 |
| | | { id: '008', name: '鱼水洞后沟雨量计008' } // 默认未勾选 |
| | | { id: '007', name: '鱼水洞后沟雨量计007' }, |
| | | { id: '008', name: '鱼水洞后沟雨量计008' } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | ], |
| | | tableData: { |
| | | '1': [ |
| | | { id: '009', name: '于家西沟气象站009' }, // 默认未勾选 |
| | | { id: '010', name: '于家西沟气象站010' } // 默认未勾选 |
| | | { id: '009', name: '于家西沟气象站009' }, |
| | | { id: '010', name: '于家西沟气象站010' } |
| | | ], |
| | | '2': [ |
| | | { id: '011', name: '于家西沟雨量计011' }, // 默认未勾选 |
| | | { id: '012', name: '于家西沟雨量计012' } // 默认未勾选 |
| | | { id: '011', name: '于家西沟雨量计011' }, |
| | | { id: '012', name: '于家西沟雨量计012' } |
| | | ] |
| | | } |
| | | } |
| | |
| | | saveDialogVisible.value = false; |
| | | }; |
| | | |
| | | // 切换详情显示 |
| | | const toggleDetails = () => { |
| | | isCollapsed.value = !isCollapsed.value; |
| | | }; |
| | | |
| | | // 开始模拟 |
| | | const startSimulation = () => { |
| | | const selectedItems = filteredTableData.value.filter(item => item.selected); |
| | | if (selectedItems.length > 0) { |
| | | console.log('选中的项:', selectedItems.map(item => item.name)); |
| | | } else { |
| | | console.log('未选中任何项'); |
| | | } |
| | | |
| | | console.log('当前选中的区域:', props.selectedArea); |
| | | console.log('当前选中的雨量数据:', selectedRainfall.value); |
| | | }; |
| | | |
| | | // 未来预测 |
| | | const futurePredictions = () => { |
| | | console.log('未来预测按钮被点击'); |
| | | }; |