From 2b1f7a47394363e95deb4dfa0f1c67d41e747f7f Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 01 二月 2023 10:56:40 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' into fix-269

---
 web_src/src/components/dialog/queryTrace.vue |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/web_src/src/components/dialog/queryTrace.vue b/web_src/src/components/dialog/queryTrace.vue
new file mode 100644
index 0000000..5063ad4
--- /dev/null
+++ b/web_src/src/components/dialog/queryTrace.vue
@@ -0,0 +1,104 @@
+<template>
+  <div id="queryTrace" >
+    <el-dialog
+      title="鏌ヨ杞ㄨ抗"
+      width="40%"
+      top="2rem"
+      :close-on-click-modal="false"
+      :visible.sync="showDialog"
+      :destroy-on-close="true"
+      @close="close()"
+    >
+      <div v-loading="isLoging">
+        <el-date-picker v-model="searchFrom" type="datetime" placeholder="閫夋嫨寮�濮嬫棩鏈熸椂闂�" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
+        <el-date-picker v-model="searchTo" type="datetime" placeholder="閫夋嫨缁撴潫鏃ユ湡鏃堕棿" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
+        <el-button icon="el-icon-search" size="mini" type="primary" @click="onSubmit">鏌ヨ</el-button>
+      </div>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import DeviceService from '../service/DeviceService'
+
+export default {
+  name: "deviceEdit",
+  props: [],
+  computed: {},
+  created() {},
+  data() {
+    return {
+      deviceService: new DeviceService(),
+      pickerOptions: {
+        shortcuts: [{
+          text: '浠婂ぉ',
+          onClick(picker) {
+            picker.$emit('pick', new Date());
+          }
+        }, {
+          text: '鏄ㄥぉ',
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24);
+            picker.$emit('pick', date);
+          }
+        }, {
+          text: '涓�鍛ㄥ墠',
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', date);
+          }
+        }]
+      },
+      searchFrom: null,
+      searchTo: null,
+      listChangeCallback: null,
+      showDialog: false,
+      isLoging: false,
+      channel: null,
+      callback: null,
+    };
+  },
+  methods: {
+    openDialog: function (channel, callback) {
+      console.log(channel)
+      this.showDialog = true;
+      this.callback = callback;
+      this.channel = channel;
+    },
+
+    onSubmit: function () {
+      console.log("onSubmit");
+      this.isLoging = true;
+      let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`;
+      if (this.channel.channelId) {
+        url+="&channelId=${this.channel.channelId}"
+      }
+      this.$axios.get(url, {
+      }).then((res)=> {
+        this.isLoging = false;
+        if (typeof this.callback == "function") {
+          if (res.data.code == 0) {
+            this.callback(res.data.data)
+            this.close()
+          }else {
+            this.$message.error(res.data.msg);
+          }
+
+        }
+      }).catch(function (error) {
+          this.isLoging = false;
+          console.error(error);
+        })
+    },
+    close: function () {
+      this.showDialog = false;
+      this.isLoging = false;
+      this.callback = null;
+      this.channel = null;
+    },
+  },
+};
+</script>

--
Gitblit v1.8.0