| | |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { reactive, ref, watch } from "vue"; |
| | | import { reactive, ref, watch, inject } from "vue"; |
| | | import { initeWaterPrimitiveView } from "@/utils/water"; |
| | | |
| | | const emit = defineEmits(["start", "end"]); |
| | | function endPlay() { |
| | | emit("end"); |
| | | } |
| | | // 注入父组件提供的方法 |
| | | const { startSimulate, endSimulate } = inject("simulateActions"); |
| | | |
| | | // const emit = defineEmits(["start", "end"]); |
| | | // function endPlay() { |
| | | // emit("end"); |
| | | // } |
| | | |
| | | function startPlay() { |
| | | initeWaterPrimitiveView(); |
| | | emit("start"); |
| | | startSimulate(); |
| | | } |
| | | |
| | | const value = ref(""); |
| | |
| | | <el-radio label="预测模拟">预测模拟</el-radio> |
| | | </el-radio-group> |
| | | <div v-if="selectedSimulation === '历史模拟'"> |
| | | <HistorySimulation |
| | | <!-- <HistorySimulation |
| | | :selectedArea="selectedArea" |
| | | @start="start" |
| | | @end="end" |
| | | /> |
| | | /> --> |
| | | <HistorySimulation :selectedArea="selectedArea" /> |
| | | </div> |
| | | <div v-if="selectedSimulation === '实时模拟'"> |
| | | <RealTimeSimulation :selectedArea="selectedArea" /> |
| | |
| | | import PredictiveSimulation from "./KGSimOption/PredictiveSimulation.vue"; |
| | | import RealTimeSimulation from "./KGSimOption/RealTimeSimulation.vue"; |
| | | |
| | | const emit = defineEmits(["start", "end"]); |
| | | // const emit = defineEmits(["start", "end"]); |
| | | |
| | | function end() { |
| | | emit("end"); |
| | | } |
| | | // function end() { |
| | | // emit("end"); |
| | | // } |
| | | |
| | | function start() { |
| | | // initeWaterPrimitiveView(); |
| | | emit("start"); |
| | | } |
| | | // function start() { |
| | | // // initeWaterPrimitiveView(); |
| | | // emit("start"); |
| | | // } |
| | | |
| | | const selectedSimulation = ref("历史模拟"); |
| | | const selectedArea = ref("孙胡沟"); |
| | |
| | | </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 emit = defineEmits(["start", "end"]); |
| | | // const emit = defineEmits(["start", "end"]); |
| | | const { startSimulate, endSimulate } = inject("simulateActions"); |
| | | |
| | | function endPlay() { |
| | | emit("end"); |
| | | } |
| | | // function endPlay() { |
| | | // emit("end"); |
| | | // } |
| | | |
| | | function startPlay() { |
| | | initeWaterPrimitiveView(); |
| | | emit("start"); |
| | | // emit("start"); |
| | | startSimulate(); |
| | | } |
| | | // 定义 Props |
| | | const props = defineProps({ |
| | |
| | | @tab-click="handleClick" |
| | | > |
| | | <el-tab-pane label="行政区划仿真" name="first" |
| | | ><city-sim :clickValue="clickValue" @start="start" @end="end" |
| | | /></el-tab-pane> |
| | | <el-tab-pane label="重点区域仿真" name="second" |
| | | ><city-sim :clickValue="clickValue" @start="start" @end="end" |
| | | /></el-tab-pane> |
| | | ><city-sim :clickValue="clickValue" /> |
| | | <!-- ><city-sim :clickValue="clickValue" @start="start" @end="end"/> --> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="重点区域仿真" name="second"> |
| | | <city-sim :clickValue="clickValue" /> |
| | | <!-- <city-sim :clickValue="clickValue" @start="start" @end="end"/> --> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="重点沟仿真" name="third"> |
| | | <kg-sim :clickValue="clickValue" @start="start" @end="end" /> |
| | | <!-- <kg-sim :clickValue="clickValue" @start="start" @end="end" /> --> |
| | | <kg-sim :clickValue="clickValue" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </template> |
| | |
| | | clickValue.value = tab.props.label; |
| | | console.log(clickValue.value); |
| | | }; |
| | | const emits = defineEmits(["start", "end"]); |
| | | // const emits = defineEmits(["start", "end"]); |
| | | |
| | | function start() { |
| | | emits("start"); |
| | | console.log("开始模拟"); |
| | | } |
| | | function end() { |
| | | emits("end"); |
| | | } |
| | | // function start() { |
| | | // emits("start"); |
| | | // console.log("开始模拟"); |
| | | // } |
| | | // function end() { |
| | | // emits("end"); |
| | | // } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted } from "vue"; |
| | | import { ref, onMounted, onUnmounted, provide } from "vue"; |
| | | import TimeLine from "@/components/menu/TimeLine.vue"; |
| | | import Left from "./left/Left.vue"; |
| | | import echartInfo from "@/components/monifangzhen/echartInfo.vue"; |
| | |
| | | const isDynamicMode = ref(false); |
| | | const isFinish = ref(true); |
| | | |
| | | // 提供方法给所有子组件 |
| | | provide("simulateActions", { |
| | | startSimulate, |
| | | endSimulate, |
| | | }); |
| | | |
| | | function startSimulate(form) { |
| | | // console.log("form", form); |
| | | showWaterSimulate.value = true; |