Browse Source

工作台定位修改

renmy 3 years ago
parent
commit
db2cfe42e3

+ 9 - 0
src/api/device/storage.js

@@ -34,4 +34,13 @@ export function addStorageIn(data) {
         method: 'post',
         data
     })
+}
+
+//自检查看详情
+export function storageInCheckInfo(data) {
+    return request({
+        url: '/api/v1/app/device/log/selfcheck/detail',
+        method: 'post',
+        data
+    })
 }

+ 44 - 0
src/views/device/storage/checkInfoModal.vue

@@ -0,0 +1,44 @@
+<template>
+  <el-dialog :visible.sync="visible" title="自检详情" :close-on-click-modal="false" :close-on-press-escape="false">
+    <div style="color: #01DF01; text-align: center;" v-if="type === 1">{{dataForm.sn + '    自检通过'}}</div>
+    <div style="color: #DF0101; text-align: center;" v-if="type === 2">{{dataForm.sn + '     自检不通过'}}</div>
+    <div class="button" v-if="type === 2" @click="gotoInfo">查看详情</div>
+  </el-dialog>
+</template>
+
+<script>
+import { storageInCheckInfo } from '@/api/device/storage'
+export default {
+  data () {
+    return {
+      //是否显示弹窗
+      visible: false,
+      //表单对象
+      dataForm: {
+        sn: '',
+      },
+      dataList: [],
+      type: null
+    }
+  },
+  methods: {
+    init () {
+      this.visible = true
+      this.getInfo()
+    },
+    getInfo() {
+      storageInCheckInfo(this.dataForm).then(res => {
+
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .button {
+    text-align: center;
+    color: #DF0101;
+    margin-top: 30px;
+  }
+</style>

+ 71 - 4
src/views/device/storage/checkModal.vue

@@ -2,13 +2,36 @@
   <el-dialog :visible.sync="visible" title="自检结果查看" :close-on-click-modal="false" :close-on-press-escape="false">
     <div style="color: #01DF01; text-align: center;" v-if="type === 1">{{dataForm.sn + '    自检通过'}}</div>
     <div style="color: #DF0101; text-align: center;" v-if="type === 2">{{dataForm.sn + '     自检不通过'}}</div>
+    <div class="button" v-if="type === 2" @click="gotoInfo">
+      查看详情
+      <!-- <div class="text">查看详情</div> -->
+    </div>
+    <div class="check-info" v-if="infoVisable">
+      <div class="data-conn">
+        数据连接(6小时):{{detail.checkStatusDataConnect === 0 ? '未通过' : '已通过'}} 
+      </div>
+      <div class="data-conn">
+        定位数据:{{detail.checkStatusLocation === 0 ? '未通过' : '已通过'}} 
+      </div>
+      <div class="data-conn">
+        解锁状态:{{detail.checkStatusLock === 0 ? '未通过' : '已通过'}} 
+      </div>
+      <div class="data-conn">
+        无故障:{{detail.checkStatusFault === 0 ? '未通过' : '已通过'}} 
+      </div>
+      <div class="data-conn">
+        电压正常2.5-4.5:{{detail.checkStatusVoltage === 0 ? '未通过' : '已通过'}} 
+      </div>
+    </div>
+    <InfoModal v-if="infoVisable" ref="infoVisable" />
   </el-dialog>
 </template>
 
 <script>
-import debounce from 'lodash/debounce'
-import { addStorageIn } from '@/api/device/storage'
+import InfoModal from '@/views/device/storage/checkInfoModal.vue'
+import { storageInCheckInfo } from '@/api/device/storage'
 export default {
+  components: { InfoModal },
   data () {
     return {
       //是否显示弹窗
@@ -17,13 +40,57 @@ export default {
       dataForm: {
         sn: '',
       },
-      type: null
+      type: null,
+      infoVisable: false,
+      detail: {}
     }
   },
   methods: {
     init () {
       this.visible = true
+      this.infoVisable = false
     },
+    getInfo() {
+      storageInCheckInfo(this.dataForm).then(res => {
+        if(res.code === 200) {
+          this.detail = res.data[0]
+        } else {
+          return this.$message.error(res.message)
+        }
+      })
+    },
+    gotoInfo() {
+      this.getInfo()
+      this.infoVisable = !this.infoVisable
+    }
   }
 }
-</script>
+</script>
+
+<style lang="scss" scoped>
+  .button {
+    text-align: center;
+    margin-top: 30px;
+    height: 40px;
+    width: 100%;
+    color: #DF0101;
+
+    .text {
+      text-align: center;
+      color: #fff;
+      line-height: 40px;
+      background: #DF0101;
+      width: 80px;
+    }
+  }
+
+  .check-info {
+    margin-top: 30px;
+    padding: 0 40px;
+
+    .data-conn {
+      font-size: 13px;
+      line-height: 30px;
+    }
+  }
+</style>

+ 24 - 8
src/views/device/workbench/details.vue

@@ -136,7 +136,7 @@
 			</div>
 			<div class="bottom-left">
 				<div class="currStatus">
-					<div id="map" ref="mapContainer" style="width:800px;height:800px;"></div>
+					<div id="map" ref="mapContainer" style="width:800px;height:600px;"></div>
 				</div>
 			</div>
 		</div>
@@ -168,14 +168,15 @@ export default {
 				content: '处置时间',
 				timestamp: '2018-04-11'
 			}],
-			longitude: "",
-      latitude: "",
+			longitude: 116.404177,
+      latitude: 39.909652,
 			markerLayer: [],
 			map: null,
 			listQuery: {
 				sn: ''
 			},
-			detail: {}
+			detail: {},
+			isMaker: false
     }
   },
 	created() {
@@ -187,7 +188,7 @@ export default {
 	mounted() {
 		let that = this
 		// this.markerLayer = new TMap.MultiMarker({});
-		that.init()
+		// that.init()
 		
 	},
   // destroyed () {
@@ -204,11 +205,19 @@ export default {
     init() {
       // 定义地图中心点坐标
 			let that = this
-			let center = new window.qq.maps.LatLng(39.916527, 116.397128)
+			let lat = that.latitude
+			let lng = that.longitude
+			let center = new window.qq.maps.LatLng(lat, lng)
+			let zoom = 0
+			if(that.isMaker) {
+				zoom = 9
+			} else {
+				zoom = 4
+			}
       // 定义map变量,调用 TMap.Map() 构造函数创建地图
       let map = new window.qq.maps.Map(that.$refs.mapContainer, {
         center: center, // 设置地图中心点坐标
-        zoom: 5, // 设置地图缩放级别
+        zoom: zoom, // 设置地图缩放级别
 				// minZoom:8,
         pitch: 43.5, // 设置俯仰角
         rotation: 45, // 设置地图旋转角度
@@ -217,12 +226,19 @@ export default {
           position: new window.qq.maps.LatLng(that.detail.lat || 0, that.detail.long || 0),
           map: map
         })
-      this.markerLayer.push(marker)
+			this.markerLayer.push(marker)
+			
       this.map = map
 		},
 		getdetailData() {
 			workDetail(this.listQuery).then(res => {
 				this.detail = res.data[0]
+				if(res.data[0].lat > 0) {
+					this.latitude = res.data[0].lat
+					this.longitude = res.data[0].long
+					this.isMaker = true
+				}
+				this.init()
 			})
 		}
   },