From c2faa8c3ce858a5c5cbb0712eda4ac2df0d60693 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 15 六月 2022 16:04:36 +0800
Subject: [PATCH] 显示效果优化
---
web_src/src/components/DeviceList.vue | 2 +-
web_src/src/components/service/DeviceService.js | 13 +++++++++++++
web_src/src/components/channelList.vue | 22 ++++++++++++++++++----
web_src/src/components/dialog/deviceEdit.vue | 2 +-
web_src/src/components/control.vue | 6 ++----
web_src/src/components/map.vue | 15 ++++++++++++++-
6 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/web_src/src/components/DeviceList.vue b/web_src/src/components/DeviceList.vue
index c974274..1911d1d 100644
--- a/web_src/src/components/DeviceList.vue
+++ b/web_src/src/components/DeviceList.vue
@@ -56,7 +56,7 @@
@mouseover="getTooltipContent(scope.row.deviceId)">鍒锋柊
</el-button>
<el-divider direction="vertical"></el-divider>
- <el-button type="text" size="medium" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0"
+ <el-button type="text" size="medium" icon="el-icon-video-camera" v-bind:disabled="scope.row.online==0"
@click="showChannelList(scope.row)">閫氶亾
</el-button>
<el-divider direction="vertical"></el-divider>
diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue
index f51e042..d27e62b 100644
--- a/web_src/src/components/channelList.vue
+++ b/web_src/src/components/channelList.vue
@@ -38,11 +38,11 @@
<el-table-column prop="name" label="閫氶亾鍚嶇О" min-width="200">
</el-table-column>
<el-table-column label="蹇収" min-width="120">
- <template slot-scope="scope">
+ <template v-slot:default="scope">
<el-image
:src="getSnap(scope.row)"
:preview-src-list="getBigSnap(scope.row)"
- @error="getSnapErrorEvent(scope.row.deviceId, cope.row.channelId)"
+ @error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)"
:fit="'contain'"
style="width: 60px">
<div slot="error" class="image-slot">
@@ -71,8 +71,8 @@
<el-table-column label="鐘舵��" min-width="120">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
- <el-tag size="medium" v-if="scope.row.status == 1">鍦ㄧ嚎</el-tag>
- <el-tag size="medium" type="info" v-if="scope.row.status == 0">绂荤嚎</el-tag>
+ <el-tag size="medium" v-if="scope.row.status === 1">鍦ㄧ嚎</el-tag>
+ <el-tag size="medium" type="info" v-if="scope.row.status === 0">绂荤嚎</el-tag>
</div>
</template>
</el-table-column>
@@ -112,6 +112,8 @@
import devicePlayer from './dialog/devicePlayer.vue'
import uiHeader from '../layout/UiHeader.vue'
import moment from "moment";
+import DviceService from "./service/DeviceService";
+import DeviceService from "./service/DeviceService";
export default {
name: 'channelList',
@@ -121,6 +123,8 @@
},
data() {
return {
+ deviceService: new DeviceService(),
+ device: null,
deviceId: this.$route.params.deviceId,
parentChannelId: this.$route.params.parentChannelId,
deviceChannelList: [],
@@ -141,7 +145,17 @@
},
mounted() {
+ if (this.deviceId) {
+ this.deviceService.getDevice(this.deviceId, (result)=>{
+ this.device = result;
+
+ }, (error)=>{
+ console.log("鑾峰彇璁惧淇℃伅澶辫触")
+ console.error(error)
+ })
+ }
this.initData();
+
},
destroyed() {
this.$destroy('videojs');
diff --git a/web_src/src/components/control.vue b/web_src/src/components/control.vue
index b8b3e34..507cc0d 100644
--- a/web_src/src/components/control.vue
+++ b/web_src/src/components/control.vue
@@ -235,10 +235,8 @@
<el-table-column prop="local_ip" label="鏈湴"></el-table-column>
<el-table-column prop="typeid" label="绫诲瀷"></el-table-column>
<el-table-column align="right">
- <template slot="header" slot-scope="scope">
- <el-button icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
- </template>
- <template slot-scope="scope">
+ <template v-slot:default="scope">
+ <el-button size="mini" icon="el-icon-refresh-right" circle @click="getAllSession()"></el-button>
<el-button @click.native.prevent="deleteRow(scope.$index, allSessionData)" type="text" size="small">绉婚櫎
</el-button>
</template>
diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue
index 233fa56..ed17d17 100644
--- a/web_src/src/components/dialog/deviceEdit.vue
+++ b/web_src/src/components/dialog/deviceEdit.vue
@@ -38,8 +38,8 @@
</el-form-item>
<el-form-item label="鍦扮悊鍧愭爣绯�" prop="geoCoordSys" >
<el-select v-model="form.geoCoordSys" style="float: left; width: 100%" >
- <el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option>
<el-option key="WGS84" label="WGS84" value="WGS84"></el-option>
+ <el-option key="GCJ02" label="GCJ02" value="GCJ02"></el-option>
</el-select>
</el-form-item>
<el-form-item label="鐩綍璁㈤槄" title="0涓哄彇娑堣闃�" prop="subscribeCycleForCatalog" >
diff --git a/web_src/src/components/map.vue b/web_src/src/components/map.vue
index caf36d4..e9e8628 100644
--- a/web_src/src/components/map.vue
+++ b/web_src/src/components/map.vue
@@ -266,7 +266,20 @@
this.channel = channels[0]
}
this.$nextTick(() => {
- this.infoBoxId = this.$refs.map.openInfoBox([this.channel.longitude, this.channel.latitude], this.$refs.infobox, [0, -50])
+ let longitudeStr;
+ let latitudeStr;
+ if (window.mapParam.coordinateSystem == "GCJ-02") {
+ longitudeStr = "longitudeGcj02";
+ latitudeStr = "latitudeGcj02";
+ }else if (window.mapParam.coordinateSystem == "WGS84") {
+ longitudeStr = "longitudeWgs84";
+ latitudeStr = "latitudeWgs84";
+ }else {
+ longitudeStr = "longitude";
+ latitudeStr = "latitude";
+ }
+ let position = [this.channel[longitudeStr], this.channel[latitudeStr]];
+ this.infoBoxId = this.$refs.map.openInfoBox(position, this.$refs.infobox, [0, -50])
})
},
closeInfoBox: function () {
diff --git a/web_src/src/components/service/DeviceService.js b/web_src/src/components/service/DeviceService.js
index 4700e79..fb66374 100644
--- a/web_src/src/components/service/DeviceService.js
+++ b/web_src/src/components/service/DeviceService.js
@@ -21,6 +21,19 @@
if (typeof (errorCallback) == "function") errorCallback(error)
});
}
+
+ getDevice(deviceId, callback, errorCallback){
+ this.$axios({
+ method: 'get',
+ url:`/api/device/query/devices/${deviceId}`,
+ }).then((res) => {
+ if (typeof (callback) == "function") callback(res.data)
+ }).catch((error) => {
+ console.log(error);
+ if (typeof (errorCallback) == "function") errorCallback(error)
+ });
+ }
+
getAllDeviceList(callback,endCallback, errorCallback) {
let currentPage = 1;
let count = 100;
--
Gitblit v1.8.0