From 33c5802c4bc6567914057bbc2f3b4b738ec21dd2 Mon Sep 17 00:00:00 2001 From: ihzero Date: Sun, 31 Dec 2023 11:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/sys/other.ts | 11 ++++ src/components/LiveVideo/index.vue | 59 ++++++++++++------- src/components/LiveVideo/index1.vue | 31 ++++++++++ .../main/monitor/components/LiveBroadcast.vue | 2 +- .../monitor/components/LiveBroadcastItem.vue | 2 +- src/views/visualization/MapModal.vue | 11 +++- src/views/visualization/components/JK.vue | 12 ++-- src/views/visualization/components/JK1.vue | 8 +-- .../visualization/components/VideoFlv.vue | 13 ++-- 9 files changed, 105 insertions(+), 44 deletions(-) create mode 100644 src/components/LiveVideo/index1.vue diff --git a/src/api/sys/other.ts b/src/api/sys/other.ts index 7397ef2a..cfeb8481 100644 --- a/src/api/sys/other.ts +++ b/src/api/sys/other.ts @@ -432,3 +432,14 @@ export function devicePoints(type, mode: ErrorMessageMode = 'none') { }, ) } + +export function getLive(id, mode: ErrorMessageMode = 'none') { + return defHttp.get( + { + url: `/api/devices/${id}/live`, + }, + { + errorMessageMode: mode, + }, + ) +} diff --git a/src/components/LiveVideo/index.vue b/src/components/LiveVideo/index.vue index 3977c0ff..dda5130d 100644 --- a/src/components/LiveVideo/index.vue +++ b/src/components/LiveVideo/index.vue @@ -1,30 +1,47 @@ diff --git a/src/components/LiveVideo/index1.vue b/src/components/LiveVideo/index1.vue new file mode 100644 index 00000000..272f6b73 --- /dev/null +++ b/src/components/LiveVideo/index1.vue @@ -0,0 +1,31 @@ + + diff --git a/src/views/main/monitor/components/LiveBroadcast.vue b/src/views/main/monitor/components/LiveBroadcast.vue index 90ece962..f75427e4 100644 --- a/src/views/main/monitor/components/LiveBroadcast.vue +++ b/src/views/main/monitor/components/LiveBroadcast.vue @@ -8,7 +8,7 @@ > diff --git a/src/views/main/monitor/components/LiveBroadcastItem.vue b/src/views/main/monitor/components/LiveBroadcastItem.vue index 39fe9982..4780ea42 100644 --- a/src/views/main/monitor/components/LiveBroadcastItem.vue +++ b/src/views/main/monitor/components/LiveBroadcastItem.vue @@ -9,7 +9,7 @@ >
- +
diff --git a/src/views/visualization/MapModal.vue b/src/views/visualization/MapModal.vue index 8a3418e0..0e27dd21 100644 --- a/src/views/visualization/MapModal.vue +++ b/src/views/visualization/MapModal.vue @@ -153,9 +153,14 @@ const isSZ = computed(() => deviceList.value.findIndex((e) => e.type == '水质设备') >= 0) const isSB = computed(() => deviceList.value.length) - const modelWidth = computed( - () => (boxWidth + 10) * Math.ceil((cropsList.value.length + 4) / 2) + 60, - ) + const modelWidth = computed(() => { + //array去重复 + // const arr = [...new Set(Object.values(deviceList?.value ?? {})?.map(({ type }) => type))] + // // const arr = deviceList.value.map(({ type }) => console.log(type)) + // console.log(arr) + + return (boxWidth + 10) * Math.ceil((cropsList.value.length + 4) / 2) + 60 + }) async function getData() { const resData = await getAgriculturalBasicDetails(props.baseId) diff --git a/src/views/visualization/components/JK.vue b/src/views/visualization/components/JK.vue index cb8f9220..69837a6b 100644 --- a/src/views/visualization/components/JK.vue +++ b/src/views/visualization/components/JK.vue @@ -37,23 +37,23 @@ class="h-130px" :class="{ '!h-160px': isBase }" v-for="(item, index) in listBig" - :key="item.url + index" + :key="index" >
-
+
@@ -72,8 +72,8 @@