| | |
| | | <span>mm/h</span> |
| | | </div> |
| | | <div class="input-item"> |
| | | <label>选择时间:</label> |
| | | <el-date-picker |
| | | v-model="hours" |
| | | type="datetimerange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | date-format="YYYY/MM/DD ddd" |
| | | time-format="A hh:mm:ss" |
| | | @change="change" |
| | | /> |
| | | <span>h</span> |
| | | </div> |
| | | <div class="input-item"> |
| | | <label>降雨时长:</label> |
| | | <el-input |
| | | disabled |
| | | v-model="rainfallDuration" |
| | | type="number" |
| | | placeholder="请输入" |
| | |
| | | </div> |
| | | |
| | | <!-- 保存方案对话框 --> |
| | | <el-dialog |
| | | <!-- <el-dialog |
| | | v-model="saveDialogVisible" |
| | | title="保存方案" |
| | | width="50%" |
| | |
| | | <el-button type="primary" @click="confirmSave">确定保存</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { useSimStore } from "@/store/simulation.js"; // 引入 Store |
| | | import { getRainfallData } from "@/api/hpApi.js"; |
| | | import { SimAPIStore } from "@/store/simAPI"; |
| | | import { EventBus } from "@/eventBus"; // 引入事件总线 |
| | | |
| | | // 获取 Store 实例 |
| | | const simStore = SimAPIStore(); |
| | |
| | | // 定义 Props |
| | | const props = defineProps({ |
| | | selectedArea: { |
| | | type: String, |
| | | type: Object, |
| | | required: true, |
| | | }, |
| | | }); |
| | |
| | | const totalRainfall = ref(50); // 降雨总量 |
| | | const schemeName = ref("方案名称"); // 方案名称 |
| | | const rainfallIntensity = ref(70); // 降雨强度 |
| | | const rainfallDuration = ref(5); // 降雨时长 |
| | | const hours = ref(null); |
| | | const rainfallDuration = ref(null); // 降雨时长 |
| | | const isCollapsed = ref(false); // 控制详情的展开/收起状态 |
| | | const saveDialogVisible = ref(false); // 控制保存方案对话框的显示状态 |
| | | |
| | |
| | | isCollapsed.value = !isCollapsed.value; |
| | | }; |
| | | |
| | | const { calculateHoursDifference } = inject("calculateHours"); |
| | | |
| | | const change = (val) => { |
| | | rainfallDuration.value = calculateHoursDifference(val); |
| | | }; |
| | | |
| | | // 打开保存方案对话框 |
| | | const openSaveDialog = async () => { |
| | | const forms = { |
| | |
| | | history: rainfallHistory.value, |
| | | }; |
| | | await simStore.addSimCheme(forms); |
| | | EventBus.emit("close-selectArea"); |
| | | }; |
| | | |
| | | // 关闭保存方案对话框 |