From d5b4f923a873820d0ba01b73da629e4ca8456457 Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期二, 15 四月 2025 10:42:14 +0800
Subject: [PATCH] change

---
 src/views/left/KGSim.vue                            |   19 --
 src/views/left/KGSimOption/PredictiveSimulation.vue |   18 -
 src/views/left/KGSimOption/HistorySimulation.vue    |   13 -
 src/views/left/CitySim.vue                          |  303 +++++++++++++++++++++---------------------
 src/views/left/KGSimOption/RealTimeSimulation.vue   |   58 +++-----
 5 files changed, 184 insertions(+), 227 deletions(-)

diff --git a/src/views/left/CitySim.vue b/src/views/left/CitySim.vue
index 788cb29..111e02f 100644
--- a/src/views/left/CitySim.vue
+++ b/src/views/left/CitySim.vue
@@ -8,20 +8,6 @@
     </div>
     <div class="forms">
       <el-form :model="forms" label-width="auto" style="max-width: 600px">
-        <el-form-item label="琛屾斂鍖哄煙:" v-if="disForm == '琛屾斂鍖哄垝浠跨湡'">
-          <el-select
-            v-model="forms.eare"
-            placeholder="Select"
-            style="max-width: 600px"
-          >
-            <el-option
-              v-for="item in cityOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
-          </el-select>
-        </el-form-item>
         <el-form-item label="涓婁紶鍙傛暟">
           <el-upload
             v-model:file-list="forms.fileList"
@@ -40,6 +26,21 @@
             <template #append>mm/h</template>
           </el-upload>
         </el-form-item>
+        <el-form-item label="琛屾斂鍖哄煙:" v-if="disForm == '琛屾斂鍖哄垝浠跨湡'">
+          <el-select
+            v-model="forms.eare"
+            placeholder="Select"
+            style="max-width: 600px"
+          >
+            <el-option
+              v-for="item in cityOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        
         <el-form-item label="閲嶇偣鍖哄煙" v-if="disForm == '閲嶇偣鍖哄煙浠跨湡'">
           <el-select
             v-model="forms.eares"
@@ -85,133 +86,149 @@
         <el-form-item label="浠跨湡鍙傛暟:"> </el-form-item>
       </el-form>
       <div style="display: flex; justify-content: flex-end">
-        <el-button>淇濆瓨鏂规</el-button>
-        <el-button @click="startPlay">寮�濮嬫ā鎷�</el-button>
+        <el-button type="primary" @click="openSaveDialog">淇濆瓨鏂规</el-button>
+        <el-button type="success" @click="startPlay">寮�濮嬫ā鎷�</el-button>
       </div>
     </div>
+
+    <!-- 淇濆瓨鏂规瀵硅瘽妗� -->
+    <el-dialog
+      v-model="saveDialogVisible"
+      :title="dialogTitle"
+      width="50%"
+      :before-close="handleClose"
+      custom-class="custom-dialog"
+    >
+      <div class="dialog-content">
+        <p><strong>妯℃嫙绫诲瀷锛�</strong>{{ dialogTitle }}</p>
+        <p v-if="disForm === '琛屾斂鍖哄垝浠跨湡'"><strong>琛屾斂鍖哄煙锛�</strong>{{ forms.eare }}</p>
+        <p v-if="disForm === '閲嶇偣鍖哄煙浠跨湡'"><strong>閲嶇偣鍖哄煙锛�</strong>{{ forms.eares }}</p>
+        <p><strong>闄嶉洦閲忥細</strong>{{ forms.rainfall }} mm</p>
+        <p><strong>闄嶉洦鏃堕暱锛�</strong>{{ forms.duration }} h</p>
+        <p><strong>闄嶉洦寮哄害锛�</strong>{{ forms.intensity }} mm/h</p>
+        <p><strong>涓婁紶鏂囦欢锛�</strong>{{ uploadedFilesText }}</p>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="saveDialogVisible = false">鍙栨秷</el-button>
+          <el-button type="primary" @click="confirmSave">纭畾淇濆瓨</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
+
 <script setup>
-import { reactive, ref, watch, inject } from "vue";
-import { initeWaterPrimitiveView } from "@/utils/water";
+import { reactive, ref, computed ,watch} from "vue";
+import { ElMessage, ElMessageBox } from "element-plus";
 
-// 娉ㄥ叆鐖剁粍浠舵彁渚涚殑鏂规硶
-const { startSimulate, endSimulate } = inject("simulateActions");
-
-// const emit = defineEmits(["start", "end"]);
-// function endPlay() {
-//   emit("end");
-// }
-
-function startPlay() {
-  initeWaterPrimitiveView();
-  startSimulate();
-}
-
-const value = ref("");
-
-const cityOptions = [
-  {
-    value: "鍖椾含甯�",
-    label: "鍖椾含甯�",
-  },
-  {
-    value: "涓滃煄鍖�",
-    label: "涓滃煄鍖�",
-  },
-  {
-    value: "瑗垮煄鍖�",
-    label: "瑗垮煄鍖�",
-  },
-  {
-    value: "鏈濋槼鍖�",
-    label: "鏈濋槼鍖�",
-  },
-  {
-    value: "娴锋穩鍖�",
-    label: "娴锋穩鍖�",
-  },
-  {
-    value: "涓板彴鍖�",
-    label: "涓板彴鍖�",
-  },
-  {
-    value: "鐭虫櫙灞卞尯",
-    label: "鐭虫櫙灞卞尯",
-  },
-  {
-    value: "闂ㄥご娌熷尯",
-    label: "闂ㄥご娌熷尯",
-  },
-  {
-    value: "鎴垮北鍖�",
-    label: "鎴垮北鍖�",
-  },
-  {
-    value: "閫氬窞鍖�",
-    label: "閫氬窞鍖�",
-  },
-  {
-    value: "椤轰箟鍖�",
-    label: "椤轰箟鍖�",
-  },
-  {
-    value: "鏄屽钩鍖�",
-    label: "鏄屽钩鍖�",
-  },
-  {
-    value: "澶у叴鍖�",
-    label: "澶у叴鍖�",
-  },
-  {
-    value: "鎬�鏌斿尯",
-    label: "鎬�鏌斿尯",
-  },
-  {
-    value: "骞宠胺鍖�",
-    label: "骞宠胺鍖�",
-  },
-  {
-    value: "瀵嗕簯鍖�",
-    label: "瀵嗕簯鍖�",
-  },
-  {
-    value: "寤跺簡鍖�",
-    label: "寤跺簡鍖�",
-  },
-];
-const earesOptions = [
-  {
-    value: "瀛欒儭娌�",
-    label: "瀛欒儭娌�",
-  },
-  {
-    value: "楸兼按娲炲悗娌�",
-    label: "楸兼按娲炲悗娌�",
-  },
-  {
-    value: "浜庡瑗挎矡",
-    label: "浜庡瑗挎矡",
-  },
-  {
-    value: "鍖楁渤娌�",
-    label: "鍖楁渤娌�",
-  },
-  {
-    value: "榫欐硥宄潙",
-    label: "榫欐硥宄潙",
-  },
-];
-
-const forms = reactive({
-  eare: "鍖椾含甯�",
-  eares: "瀛欒儭娌�",
-  rainfall: "50",
-  duration: "5",
-  intensity: "70",
-  fileList: [],
+// 瀹氫箟 Props
+const props = defineProps({
+  clickValue: String,
 });
 
+// 鏁版嵁缁戝畾
+const disForm = ref(""); // 褰撳墠鏄剧ず鐨勮〃鍗曠被鍨�
+const saveDialogVisible = ref(false); // 鎺у埗淇濆瓨鏂规瀵硅瘽妗嗙殑鏄剧ず鐘舵��
+const forms = reactive({
+  eare: "鍖椾含甯�", // 琛屾斂鍖哄煙
+  eares: "瀛欒儭娌�", // 閲嶇偣鍖哄煙
+  rainfall: "50", // 闄嶉洦閲�
+  duration: "5", // 闄嶉洦鏃堕暱
+  intensity: "70", // 闄嶉洦寮哄害
+  fileList: [], // 涓婁紶鐨勬枃浠跺垪琛�
+});
+
+// 琛屾斂鍖哄煙閫夐」
+const cityOptions = [
+  { value: "鍖椾含甯�", label: "鍖椾含甯�" },
+  { value: "涓滃煄鍖�", label: "涓滃煄鍖�" },
+  { value: "瑗垮煄鍖�", label: "瑗垮煄鍖�" },
+  { value: "鏈濋槼鍖�", label: "鏈濋槼鍖�" },
+  { value: "娴锋穩鍖�", label: "娴锋穩鍖�" },
+  { value: "涓板彴鍖�", label: "涓板彴鍖�" },
+  { value: "鐭虫櫙灞卞尯", label: "鐭虫櫙灞卞尯" },
+  { value: "闂ㄥご娌熷尯", label: "闂ㄥご娌熷尯" },
+  { value: "鎴垮北鍖�", label: "鎴垮北鍖�" },
+  { value: "閫氬窞鍖�", label: "閫氬窞鍖�" },
+  { value: "椤轰箟鍖�", label: "椤轰箟鍖�" },
+  { value: "鏄屽钩鍖�", label: "鏄屽钩鍖�" },
+  { value: "澶у叴鍖�", label: "澶у叴鍖�" },
+  { value: "鎬�鏌斿尯", label: "鎬�鏌斿尯" },
+  { value: "骞宠胺鍖�", label: "骞宠胺鍖�" },
+  { value: "瀵嗕簯鍖�", label: "瀵嗕簯鍖�" },
+  { value: "寤跺簡鍖�", label: "寤跺簡鍖�" },
+];
+
+// 閲嶇偣鍖哄煙閫夐」
+const earesOptions = [
+  { value: "瀛欒儭娌�", label: "瀛欒儭娌�" },
+  { value: "楸兼按娲炲悗娌�", label: "楸兼按娲炲悗娌�" },
+  { value: "浜庡瑗挎矡", label: "浜庡瑗挎矡" },
+  { value: "鍖楁渤娌�", label: "鍖楁渤娌�" },
+  { value: "榫欐硥宄潙", label: "榫欐硥宄潙" },
+];
+
+// 璁$畻灞炴�э細鑾峰彇瀵硅瘽妗嗘爣棰�
+const dialogTitle = computed(() => {
+  return disForm.value === "琛屾斂鍖哄垝浠跨湡" ? "琛屾斂鍖哄垝浠跨湡" : "閲嶇偣鍖哄煙浠跨湡";
+});
+
+// 璁$畻灞炴�э細鑾峰彇涓婁紶鏂囦欢鐨勫悕绉板垪琛�
+const uploadedFilesText = computed(() => {
+  return forms.fileList.map(file => file.name).join(", ") || "鏃�";
+});
+
+// 鐩戝惉 Props 鍙樺寲锛屾洿鏂板綋鍓嶈〃鍗曠被鍨�
+watch(
+  () => props.clickValue,
+  (newValue) => {
+    disForm.value = newValue || "琛屾斂鍖哄垝浠跨湡";
+  },
+  { immediate: true, deep: true }
+);
+
+// 鎵撳紑淇濆瓨鏂规瀵硅瘽妗�
+const openSaveDialog = () => {
+  if (
+    !forms.rainfall ||
+    !forms.duration ||
+    !forms.intensity ||
+    (disForm.value === "琛屾斂鍖哄垝浠跨湡" && !forms.eare) ||
+    (disForm.value === "閲嶇偣鍖哄煙浠跨湡" && !forms.eares)
+  ) {
+    ElMessage.warning("璇峰厛濉啓鎵�鏈夊繀濉」");
+    return;
+  }
+  saveDialogVisible.value = true;
+};
+
+// 鍏抽棴淇濆瓨鏂规瀵硅瘽妗�
+const handleClose = () => {
+  saveDialogVisible.value = false;
+};
+
+// 纭淇濆瓨
+const confirmSave = () => {
+  console.log('淇濆瓨鏂规鎴愬姛', {
+    妯℃嫙绫诲瀷: dialogTitle.value,
+    琛屾斂鍖哄煙: disForm.value === "琛屾斂鍖哄垝浠跨湡" ? forms.eare : null,
+    閲嶇偣鍖哄煙: disForm.value === "閲嶇偣鍖哄煙浠跨湡" ? forms.eares : null,
+    闄嶉洦閲�: `${forms.rainfall} mm`,
+    闄嶉洦鏃堕暱: `${forms.duration} h`,
+    闄嶉洦寮哄害: `${forms.intensity} mm/h`,
+    // 涓婁紶鏂囦欢: forms.fileList.map(file => file.name),
+  });
+  ElMessage.success('鏂规宸蹭繚瀛�');
+  saveDialogVisible.value = false;
+};
+
+// 寮�濮嬫ā鎷�
+function startPlay() {
+  console.log("寮�濮嬫ā鎷熸寜閽鐐瑰嚮");
+}
+
+// 鏂囦欢涓婁紶鐩稿叧鏂规硶
 function handleRemove(file, uploadFiles) {
   console.log(file, uploadFiles);
 }
@@ -227,6 +244,7 @@
     } totally`
   );
 }
+
 const beforeUpload = (file) => {
   const allowedTypes = [
     "application/vnd.ms-excel",
@@ -259,23 +277,8 @@
     () => false
   );
 }
-
-const disForm = ref("");
-
-// 瀹氫箟 Props
-const props = defineProps({
-  clickValue: String,
-});
-
-// 鐩戝惉 Props 鍙樺寲
-watch(
-  () => props.clickValue,
-  (newValue) => {
-    disForm.value = newValue || "琛屾斂鍖哄垝浠跨湡";
-  },
-  { immediate: true, deep: true }
-);
 </script>
+
 <style lang="less" scoped>
 .forms {
   background: url("@/assets/img/screen/leftbg.png");
@@ -293,4 +296,4 @@
 /deep/ .el-form-item__label {
   color: #61f7d4 !important;
 }
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/left/KGSim.vue b/src/views/left/KGSim.vue
index a07ef20..5fe0074 100644
--- a/src/views/left/KGSim.vue
+++ b/src/views/left/KGSim.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="simulation-module">
-    <!-- 妯℃嫙鍖哄煙閮 -->
+    <!-- 妯℃嫙鍖哄煙 -->
     <div class="simulation-area">
       <p>妯℃嫙鍖哄煙</p>
       <el-select
@@ -35,11 +35,6 @@
         <el-radio label="棰勬祴妯℃嫙">棰勬祴妯℃嫙</el-radio>
       </el-radio-group>
       <div v-if="selectedSimulation === '鍘嗗彶妯℃嫙'">
-        <!-- <HistorySimulation
-          :selectedArea="selectedArea"
-          @start="start"
-          @end="end"
-        /> -->
         <HistorySimulation :selectedArea="selectedArea" />
       </div>
       <div v-if="selectedSimulation === '瀹炴椂妯℃嫙'">
@@ -57,17 +52,6 @@
 import HistorySimulation from "./KGSimOption/HistorySimulation.vue";
 import PredictiveSimulation from "./KGSimOption/PredictiveSimulation.vue";
 import RealTimeSimulation from "./KGSimOption/RealTimeSimulation.vue";
-
-// const emit = defineEmits(["start", "end"]);
-
-// function end() {
-//   emit("end");
-// }
-
-// function start() {
-//   // initeWaterPrimitiveView();
-//   emit("start");
-// }
 
 const selectedSimulation = ref("鍘嗗彶妯℃嫙");
 const selectedArea = ref("瀛欒儭娌�");
@@ -102,7 +86,6 @@
 </script>
 
 <style scoped>
-/* 鏍峰紡淇濇寔涓嶅彉 */
 </style>
 
 <style scoped>
diff --git a/src/views/left/KGSimOption/HistorySimulation.vue b/src/views/left/KGSimOption/HistorySimulation.vue
index 1388db7..f7dc304 100644
--- a/src/views/left/KGSimOption/HistorySimulation.vue
+++ b/src/views/left/KGSimOption/HistorySimulation.vue
@@ -93,16 +93,12 @@
 import { ref, computed, inject } from "vue";
 import { ElMessage } from "element-plus";
 import { initeWaterPrimitiveView } from "@/utils/water";
-// const emit = defineEmits(["start", "end"]);
 const { startSimulate, endSimulate } = inject("simulateActions");
 
-// function endPlay() {
-//   emit("end");
-// }
-
 function startPlay() {
+  console.log("寮�濮嬫ā鎷熸寜閽鐐瑰嚮");
+  console.log("褰撳墠閫変腑鐨勫尯鍩燂細", props.selectedArea);
   initeWaterPrimitiveView();
-  // emit("start");
   startSimulate();
 }
 // 瀹氫箟 Props
@@ -175,11 +171,6 @@
   });
   ElMessage.success("鏂规宸蹭繚瀛�");
   saveDialogVisible.value = false;
-};
-// 寮�濮嬫ā鎷�
-const startSimulation = () => {
-  console.log("寮�濮嬫ā鎷熸寜閽鐐瑰嚮");
-  console.log("褰撳墠閫変腑鐨勫尯鍩燂細", props.selectedArea);
 };
 </script>
 
diff --git a/src/views/left/KGSimOption/PredictiveSimulation.vue b/src/views/left/KGSimOption/PredictiveSimulation.vue
index 3b2dd44..237741d 100644
--- a/src/views/left/KGSimOption/PredictiveSimulation.vue
+++ b/src/views/left/KGSimOption/PredictiveSimulation.vue
@@ -84,15 +84,13 @@
 import { ref, 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");
+  console.log("寮�濮嬫ā鎷熸寜閽鐐瑰嚮");
+  console.log("褰撳墠閫変腑鐨勫尯鍩燂細", props.selectedArea);
+  initeWaterPrimitiveView();
+  startSimulate();
 }
 // 瀹氫箟 Props
 const props = defineProps({
@@ -176,12 +174,6 @@
 // 鎵撳紑鏂规
 const openPlan = () => {
   console.log('鎵撳紑鏂规鎸夐挳琚偣鍑�');
-};
-
-// 寮�濮嬫ā鎷�
-const startSimulation = () => {
-  console.log('寮�濮嬫ā鎷熸寜閽鐐瑰嚮');
-  console.log('褰撳墠閫変腑鐨勫尯鍩燂細', props.selectedArea);
 };
 </script>
 
diff --git a/src/views/left/KGSimOption/RealTimeSimulation.vue b/src/views/left/KGSimOption/RealTimeSimulation.vue
index 9dbd94c..1143f95 100644
--- a/src/views/left/KGSimOption/RealTimeSimulation.vue
+++ b/src/views/left/KGSimOption/RealTimeSimulation.vue
@@ -66,15 +66,19 @@
 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) {
@@ -109,12 +113,12 @@
     ],
     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' } 
       ]
     }
   },
@@ -125,12 +129,12 @@
     ],
     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' } 
       ]
     }
   },
@@ -141,12 +145,12 @@
     ],
     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' } 
       ]
     }
   }
@@ -214,25 +218,9 @@
   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('鏈潵棰勬祴鎸夐挳琚偣鍑�');
 };

--
Gitblit v1.9.3