From 86f2633b4c70675bd90e79c9bdaf8a1eb8f95938 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期三, 28 五月 2025 14:49:57 +0800
Subject: [PATCH] 历史模拟

---
 src/views/left/CitySim.vue |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/src/views/left/CitySim.vue b/src/views/left/CitySim.vue
index 8e68f7c..cf42766 100644
--- a/src/views/left/CitySim.vue
+++ b/src/views/left/CitySim.vue
@@ -10,7 +10,11 @@
     <div class="left-top" v-if="simStore.selectTab == '閲嶇偣鍖哄煙浠跨湡'">
       閲嶇偣鍖哄煙浠跨湡锛�10m绮惧害锛�
     </div>
-    <div class="forms">
+    <div class="left-top" v-if="simStore.selectTab == '閲嶇偣娌熶豢鐪�'">
+      鍘嗗彶妯℃嫙
+    </div>
+
+    <div class="forms" :class="{ 'no-background': !showBackground }">
       <el-form
         :rules="rules"
         :model="forms"
@@ -106,7 +110,7 @@
             v-if="forms.fileList.length !== 0"
             v-model="forms.hours"
             type="datetime"
-            placeholder="Select date and time"
+            placeholder="璇烽�夋嫨寮�濮嬫椂闂�"
           />
           <el-date-picker
             v-if="forms.fileList.length == 0"
@@ -169,6 +173,14 @@
 
 const options = reactive([]);
 
+// 鍘嗗彶妯℃嫙閫変腑鍖哄煙
+const props = defineProps({
+  selectedArea: {
+    type: Object,
+    required: true,
+  },
+});
+
 const intensityOptions = ref([
   { value: "mm/h", label: "mm/h" },
   { value: "mm/5min", label: "mm/5min" },
@@ -193,6 +205,8 @@
   fetchRegionData(1);
 });
 
+const showBackground = ref(true); // 榛樿鏄剧ず鑳屾櫙鍥�
+
 // 鐩戝惉 selectTab 鐨勫彉鍖�
 watch(selectTab, (newVal) => {
   let type;
@@ -203,10 +217,21 @@
     case "閲嶇偣鍖哄煙浠跨湡":
       type = 2;
       break;
+    case "閲嶇偣娌熶豢鐪�":
+      type = 3;
+      break;
     default:
       type = 1; // 榛樿鍊�
   }
+  // 鏍规嵁 type 璁剧疆鏄惁鏄剧ず鑳屾櫙鍥撅紙鍥犱负鍘嗗彶妯℃嫙涓〃鍗曞甫浜嗚儗鏅浘锛�
+  if (type == 3) {
+    showBackground.value = false;
+  } else {
+    showBackground.value = true;
+  }
   fetchRegionData(type);
+  // Tab鍒囨崲鐨勬椂鍊欐竻绌鸿〃鍗�
+  resetForm();
 });
 
 // 娉ㄥ叆鐖剁粍浠舵彁渚涚殑鏂规硶
@@ -245,6 +270,9 @@
 
 const addSimCheme = async () => {
   try {
+    if (selectTab.value == "閲嶇偣娌熶豢鐪�") {
+      forms.geom = props.selectedArea;
+    }
     await simStore.addSimCheme(forms);
     resetForm(); // 鍙湁鍦ㄤ繚瀛樻垚鍔熷悗鎵嶉噸缃〃鍗�
     EventBus.emit("close-selectArea");
@@ -471,6 +499,9 @@
 async function startPlay() {
   try {
     // 淇濆瓨鏂规
+    if (selectTab.value == "閲嶇偣娌熶豢鐪�") {
+      forms.geom = props.selectedArea;
+    }
     const res = await simStore.addSimCheme(forms);
     const schemeId = res.data?.data?.id;
 
@@ -508,6 +539,12 @@
   height: 100%;
   padding: 10px 10px 0px 0px;
   box-sizing: border-box;
+  transition: background 0.3s ease; // 鍙�夎繃娓℃晥鏋�
+}
+
+.forms.no-background {
+  margin-top: 0px;
+  background-image: none;
 }
 /deep/ .el-input-group__append,
 .el-input-group__prepend {

--
Gitblit v1.9.3