From 23bf56d279ee4857750c59d4f76c2995b2ae950c Mon Sep 17 00:00:00 2001
From: fuchengshen <men883234@gmail.com>
Date: 星期三, 22 六月 2022 16:26:04 +0800
Subject: [PATCH] before merge

---
 vite.config.ts                     |    4 +-
 public/hn3d/example/00_hn_new.html |   32 ++++++++++++++-
 public/hn3d/example/test1.vue      |   79 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+), 5 deletions(-)

diff --git a/public/hn3d/example/00_hn_new.html b/public/hn3d/example/00_hn_new.html
index ba0bd68..330878b 100644
--- a/public/hn3d/example/00_hn_new.html
+++ b/public/hn3d/example/00_hn_new.html
@@ -74,14 +74,14 @@
     </div>
   </div>
 
-  <div class="infoview bottomWindows">
+  <!-- <div class="infoview bottomWindows">
     <div>
       <input id="changqu_btn" type="button" class="btn btn-primary" value="鍘傚尯" />
       <input id="meipeng_btn" type="button" class="btn btn-primary" value="鐓ゆ" />
       <input id="pengnei_btn" type="button" class="btn btn-primary" value="妫氬唴" />
     </div>
-  </div>
-  
+  </div> -->
+
   <!-- 鎿嶄綔鎸夐挳鏍� -->
   <div class="infoview infoWindows handle">
     <button type="button" id="meipeng" class="btn btn-primary active" style="width: 100%;">鐓ゆ鏁翠綋</button>
@@ -228,6 +228,9 @@
         },
         control: {
           infoBox: false,
+          timeline: true,
+          clockAnimate: false,
+          distanceLegend: { left: "100px", bottom: "27px" }
         },
         layers: [
           {
@@ -358,8 +361,26 @@
       });
 
 
+      var eventTarget = new mars3d.BaseClass()
       //鍒涘缓涓夌淮鍦扮悆鍦烘櫙
       map = new mars3d.Map("mars3dContainer", mapOptions);
+      var clockAnimate = new mars3d.control.ClockAnimate({
+        format: "yyyy-MM-dd HH:mm:ss"
+      })
+      map.addControl(clockAnimate)
+
+      clockAnimate.on(mars3d.EventType.click, function (event) {
+        if (event.targetType === "label") {
+          console.log("鍗曞嚮浜嗘椂闂存枃鏈尯鍩�", event)
+          console.log(eventTarget, "eventTarget")
+
+          var startTime = Cesium.JulianDate.toDate(map.clock.startTime)
+          var stopTime = Cesium.JulianDate.toDate(map.clock.stopTime)
+          var currentTime = Cesium.JulianDate.toDate(map.clock.currentTime)
+
+          eventTarget.fire("clickShowClockAnimate", { startTime, stopTime, currentTime })
+        }
+      })
 
 
       // 鍒涘缓鏂楄疆鏈哄浘灞�
@@ -640,6 +661,11 @@
 
 
 
+
+
+
+
+
       // 鏂楄疆鏈烘棆杞�
       $("#dou_rote").click(function () {
         // 鏃犲姩鐢绘晥鏋滅殑鏃嬭浆
diff --git a/public/hn3d/example/test1.vue b/public/hn3d/example/test1.vue
new file mode 100644
index 0000000..d857f4c
--- /dev/null
+++ b/public/hn3d/example/test1.vue
@@ -0,0 +1,79 @@
+<template>
+  <mars-pannel :visible="showClockAnimate"
+               left="60"
+               bottom="50">
+    <p class="closePannel f-mb">
+      <mars-icon icon="close"
+                 width="14"
+                 @click="onClickHiddenTime" />
+    </p>
+    <div class="f-mb">
+      <a-space>
+        <span class="mars-pannel-item-label">褰撳墠鏃堕棿锛�</span>
+        <mars-date-picker style="width: 170px"
+                          v-model:value="currrentTime"
+                          format="YYYY-MM-DD HH:mm:ss"
+                          :show-time="{ defaultValue: dayjs('00:00:00', 'HH:mm:ss') }"
+                          @change="onChangeCurrentTime" />
+      </a-space>
+    </div>
+    <div class="f-mb">
+      <a-space>
+        <span class="mars-pannel-item-label">鏃堕棿鑼冨洿锛�</span>
+        <mars-range-picker v-model:value="nowTimeScope"
+                           :show-time="{ format: 'HH:mm' }"
+                           format="YYYY-MM-DD HH:mm"
+                           :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
+                           @change="onRangeChange" />
+      </a-space>
+    </div>
+  </mars-pannel>
+</template>
+
+<script lang="ts" setup>
+import { ref } from "vue";
+import dayjs, { Dayjs } from "dayjs";
+
+import * as mapWork from "./map.js";
+
+const showClockAnimate = ref<boolean>(false);
+const nowTimeScope = ref<[Dayjs, Dayjs]>();
+const currrentTime = ref<Dayjs>();
+
+mapWork.eventTarget.on("clickShowClockAnimate", (e: any) => {
+  showClockAnimate.value = !showClockAnimate.value;
+
+  nowTimeScope.value = [dayjs(e.startTime), dayjs(e.stopTime)];
+  currrentTime.value = dayjs(e.currentTime);
+});
+const onClickHiddenTime = () => {
+  showClockAnimate.value = false;
+};
+const onRangeChange = (value: [Dayjs, Dayjs], dateString: [string, string]) => {
+  mapWork.setClockAnimateTime(dateString[0], dateString[1]);
+};
+const onChangeCurrentTime = (value: Dayjs) => {
+  mapWork.setCurrentTime(value);
+};
+</script>
+
+<style>
+.infoView {
+  overflow-x: hidden;
+  top: calc(100% - 195px) !important;
+  right: calc(100% - 415px) !important;
+}
+</style>
+
+<style lang="less" scoped>
+// .closePannel {
+//   display: flex;
+//   justify-content: flex-end;
+// }
+// :deep(.ant-select-dropdown) {
+//   background-color: #3f5563c4 !important;
+// }
+// :deep(.ant-picker) {
+//   width: 300px;
+// }
+</style>
diff --git a/vite.config.ts b/vite.config.ts
index 16657bf..fda841e 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -18,8 +18,8 @@
   const proxy = {
     "/dev": {
       // target: "http://192.168.1.16:8001",
-      // target: "http://47.92.33.19:8001",
-      target: "http://127.0.0.1:8001",
+      target: "http://47.92.33.19:8001",
+      // target: "http://127.0.0.1:8001",
       changeOrigin: true,
       rewrite: (path: string) => path.replace(/^\/dev/, "")
     },

--
Gitblit v1.9.1