From a337fc824fc85b3771a422b373dfcb9ae1161f8c Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 21 Dec 2023 16:31:08 +0800
Subject: [PATCH] fix:热力图播放

---
 src/views/toCarryOutLegislativeReforms/reform/index.vue |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/views/toCarryOutLegislativeReforms/reform/index.vue b/src/views/toCarryOutLegislativeReforms/reform/index.vue
index cdeb5b5..5f05f20 100644
--- a/src/views/toCarryOutLegislativeReforms/reform/index.vue
+++ b/src/views/toCarryOutLegislativeReforms/reform/index.vue
@@ -2,7 +2,7 @@
   <div v-loading="loading" class="main">
     <div>
       <searchBar v-if="searchType" :search-type="'reform'" @handleSearch="handleSearchBut" @handleAdd="handleOpenDialog(null, 'add')" />
-      <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" />
+      <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :isToMap.sync='isToMap' :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" />
       <!-- <el-divider></el-divider> -->
       <div class="tab">
         <div class="exportBox">
@@ -229,6 +229,7 @@
         <el-button type="primary" @click="handleEditChange">��� ���</el-button>
       </span>
     </el-dialog>
+    <mapContainer :visible.sync="isToMap" v-if="isToMap"></mapContainer>
   </div>
 </template>
 
@@ -238,18 +239,21 @@
 import _ from 'lodash'
 import qs from 'qs'
 import searchBar from '@/views/toCarryOutLegislativeReforms/components/queryForm'
+import mapContainer from '@/views/toCarryOutLegislativeReforms/components/locationMap'
 import newWorkOrder from '@/views/toCarryOutLegislativeReforms/components/newWorkOrder'
 import workOrderInformation from '@/views/toCarryOutLegislativeReforms/components/workOrderInformation'
 export default {
   components: {
     searchBar,
     newWorkOrder,
+    mapContainer,
     workOrderInformation
   },
   // mixins: [mixins],
   data() {
     return {
       loading: false,
+      isToMap: false,
       selectionRows: [],
       errorClass: 'errorClass',
       searchType: 'reform',
@@ -295,6 +299,11 @@
       sealList: []
     }
   },
+  watch: {
+    isToMap(newVal, oldVal) {
+      this.isToMap = newVal
+    }
+  },
   computed: {
     updataEscalationUnitIdFormatter: function () {
       const data = this.unitList.find(
@@ -322,8 +331,23 @@
     this.handleSearch({ isInvalid: 0, state: [9, 20, 30] })
     this.getUnitList()
     this.getContaminateList()
+    if (navigator.geolocation) {
+      navigator.geolocation.getCurrentPosition(
+        this.successCallback,
+        this.errorCallback
+      )
+    } else {
+      alert('���������������������������������������������')
+    }
   },
   methods: {
+    successCallback(position) {
+      const latitude = position.coords.latitude // ������
+      const longitude = position.coords.longitude // ������
+      console.log('���������' + longitude)
+      console.log('���������' + latitude)
+    },
+    errorCallback() {},
     handleSelectionChange(rows) {
       console.log(rows)
       this.selectionRows = rows
@@ -332,15 +356,20 @@
       this.$confirm('������������������������������?', '������', {
         confirmButtonText: '������������',
         cancelButtonText: '������������',
+        distinguishCancelAndClose: true,
         type: 'warning'
       })
         .then(() => {
           this.loading = true
           this.exportData()
         })
-        .catch(() => {
-          this.loading = false
-          this.exportData()
+        .catch(action => {
+          if (action === 'cancel') {
+            this.loading = false
+            this.exportData()
+          } else {
+            this.loading = false
+          }
         })
     },
     exportData() {
@@ -371,6 +400,7 @@
           cancel = c
         }),
         onDownloadProgress(progress) {
+          console.log('onDownloadProgress', progress)
           const loaded = progress.loaded
           // progress������������loaded������������������������������total������������������������������������������
           let downProgress = Math.round((loaded / totalSize) * 100)
@@ -427,7 +457,12 @@
         link.click()
         // ������������������������
         url.revokeObjectURL(link.href)
-        this.$message.success('���������������')
+        this.$message({
+          showClose: true,
+          duration: 0,
+          message: '���������������',
+          type: 'success'
+        })
         this.loading = false
       }
     },

--
Gitblit v1.8.0