From f513f5ef67409a0db26d85a95a5e3b127595aaca Mon Sep 17 00:00:00 2001
From: mk1990 <153958232@qq.com>
Date: 星期三, 25 五月 2022 14:09:43 +0800
Subject: [PATCH] 解决海康设备在实时监控模块中无法获取到通道信息
---
web_src/src/components/channelList.vue | 173 +++++++++++++++++++++++++++++----------------------------
1 files changed, 88 insertions(+), 85 deletions(-)
diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue
index 59a6f74..2d62e29 100644
--- a/web_src/src/components/channelList.vue
+++ b/web_src/src/components/channelList.vue
@@ -1,15 +1,12 @@
<template>
- <div id="channelList">
- <div style="background-color: #FFFFFF; position: relative; padding: 1rem 0.5rem 0.5rem 0.5rem; text-align: center;">
- <span
- style="font-size: 1rem; font-weight: 500; ">閫氶亾鍒楄〃({{ parentChannelId == 0 ? deviceId : parentChannelId }})</span>
-
- </div>
- <div
- style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">
- <el-button icon="el-icon-arrow-left" size="mini" style="margin-right: 1rem;" type="primary" @click="showDevice">
- 杩斿洖
- </el-button>
+ <div id="channelList" style="width: 100%">
+ <div class="page-header">
+ <div class="page-title">
+ <el-button icon="el-icon-arrow-left" size="mini" style="margin-right: 1rem;" type="primary" @click="showDevice">
+ 杩斿洖
+ </el-button>
+ 閫氶亾鍒楄〃({{ parentChannelId == 0 ? deviceId : parentChannelId }})</div>
+ <div class="page-header-btn">
鎼滅储:
<el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="鍏抽敭瀛�"
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
@@ -28,83 +25,85 @@
<el-option label="鍦ㄧ嚎" value="true"></el-option>
<el-option label="绂荤嚎" value="false"></el-option>
</el-select>
- <el-checkbox size="mini" style="margin-right: 1rem; float: right;" v-model="autoList" @change="autoListChange">
+ <el-checkbox size="mini" v-model="autoList" @change="autoListChange">
鑷姩鍒锋柊
</el-checkbox>
</div>
- <devicePlayer ref="devicePlayer" v-loading="isLoging"></devicePlayer>
- <!--璁惧鍒楄〃-->
- <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%">
- <el-table-column prop="channelId" label="閫氶亾缂栧彿" width="200">
- </el-table-column>
- <el-table-column prop="name" label="閫氶亾鍚嶇О">
- </el-table-column>
- <el-table-column label="蹇収" width="80" align="center">
- <template slot-scope="scope">
- <img style="max-height: 3rem;max-width: 4rem;"
- :id="scope.row.deviceId + '_' + scope.row.channelId"
- :src="getSnap(scope.row)"
- @error="getSnapErrorEvent($event.target.id)"
- alt="">
- <!-- <el-image-->
- <!-- :id="'snapImg_' + scope.row.deviceId + '_' + scope.row.channelId"-->
- <!-- :src="getSnap(scope.row)"-->
- <!-- @error="getSnapErrorEvent($event, scope.row)"-->
- <!-- :fit="'contain'">-->
- <!-- <div slot="error" class="image-slot">-->
- <!-- <i class="el-icon-picture-outline"></i>-->
- <!-- </div>-->
- <!-- </el-image>-->
- </template>
- </el-table-column>
- <el-table-column prop="subCount" label="瀛愯妭鐐规暟">
- </el-table-column>
- <el-table-column prop="manufacture" label="鍘傚">
- </el-table-column>
- <el-table-column label="浣嶇疆淇℃伅" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.longitude }},{{ scope.row.latitude }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ptztypeText" label="浜戝彴绫诲瀷"/>
- <el-table-column label="寮�鍚煶棰�" align="center">
- <template slot-scope="scope">
- <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
- </el-switch>
- </template>
- </el-table-column>
- <el-table-column label="鐘舵��" width="180" align="center">
- <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>
- </div>
- </template>
- </el-table-column>
+ </div>
+ <devicePlayer ref="devicePlayer" v-loading="isLoging"></devicePlayer>
+ <!--璁惧鍒楄〃-->
+ <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%">
+ <el-table-column prop="channelId" label="閫氶亾缂栧彿" width="200">
+ </el-table-column>
+ <el-table-column prop="name" label="閫氶亾鍚嶇О">
+ </el-table-column>
+ <el-table-column label="蹇収" width="80" align="center">
+ <template slot-scope="scope">
+ <img style="max-height: 3rem;max-width: 4rem;"
+ v-if="scope.row.subCount === 0 && scope.row.parental === 0"
+ :id="scope.row.deviceId + '_' + scope.row.channelId"
+ :src="getSnap(scope.row)"
+ @error="getSnapErrorEvent($event.target.id)"
+ alt="">
+ <!-- <el-image-->
+ <!-- :id="'snapImg_' + scope.row.deviceId + '_' + scope.row.channelId"-->
+ <!-- :src="getSnap(scope.row)"-->
+ <!-- @error="getSnapErrorEvent($event, scope.row)"-->
+ <!-- :fit="'contain'">-->
+ <!-- <div slot="error" class="image-slot">-->
+ <!-- <i class="el-icon-picture-outline"></i>-->
+ <!-- </div>-->
+ <!-- </el-image>-->
+ </template>
+ </el-table-column>
+ <el-table-column prop="subCount" label="瀛愯妭鐐规暟">
+ </el-table-column>
+ <el-table-column prop="manufacture" label="鍘傚">
+ </el-table-column>
+ <el-table-column label="浣嶇疆淇℃伅" align="center">
+ <template slot-scope="scope">
+ <span>{{ scope.row.longitude }},{{ scope.row.latitude }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="ptztypeText" label="浜戝彴绫诲瀷"/>
+ <el-table-column label="寮�鍚煶棰�" align="center">
+ <template slot-scope="scope">
+ <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
+ </el-switch>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐘舵��" width="180" align="center">
+ <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>
+ </div>
+ </template>
+ </el-table-column>
- <el-table-column label="鎿嶄綔" width="280" align="center" fixed="right">
- <template slot-scope="scope">
- <el-button-group>
- <!-- <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">鎾斁</el-button> -->
- <el-button size="mini" icon="el-icon-video-play" @click="sendDevicePush(scope.row)">鎾斁</el-button>
- <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId"
- @click="stopDevicePush(scope.row)">鍋滄
- </el-button>
- <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0"
- @click="changeSubchannel(scope.row)">鏌ョ湅
- </el-button>
- <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">璁惧褰曡薄
- </el-button>
- <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">褰曞儚鏌ヨ</el-button> -->
- </el-button-group>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination style="float: right" @size-change="handleSizeChange" @current-change="currentChange"
- :current-page="currentPage" :page-size="count" :page-sizes="[15, 20, 30, 50]"
- layout="total, sizes, prev, pager, next" :total="total">
- </el-pagination>
+ <el-table-column label="鎿嶄綔" width="280" align="center" fixed="right">
+ <template slot-scope="scope">
+ <el-button-group>
+ <!-- <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">鎾斁</el-button> -->
+ <el-button size="mini" icon="el-icon-video-play" @click="sendDevicePush(scope.row)">鎾斁</el-button>
+ <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId"
+ @click="stopDevicePush(scope.row)">鍋滄
+ </el-button>
+ <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0 || scope.row.parental === 1"
+ @click="changeSubchannel(scope.row)">鏌ョ湅
+ </el-button>
+ <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">璁惧褰曞儚
+ </el-button>
+ <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">褰曞儚鏌ヨ</el-button> -->
+ </el-button-group>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination style="float: right" @size-change="handleSizeChange" @current-change="currentChange"
+ :current-page="currentPage" :page-size="count" :page-sizes="[15, 20, 30, 50]"
+ layout="total, sizes, prev, pager, next" :total="total">
+ </el-pagination>
</div>
</template>
@@ -221,6 +220,7 @@
method: 'get',
url: '/api/play/start/' + deviceId + '/' + channelId
}).then(function (res) {
+ console.log(res)
that.isLoging = false;
if (res.data.code === 0) {
@@ -238,14 +238,17 @@
that.initData();
}, 1000)
- } else {
+ }else{
that.$message.error(res.data.msg);
}
}).catch(function (e) {
+ console.error(e)
+ that.isLoging = false;
+ // that.$message.error("璇锋眰瓒呮椂");
});
},
queryRecords: function (itemData) {
- var format = moment().format("YYYY-M-D");
+ var format = moment().format("yyyy-MM-DD");
let deviceId = this.deviceId;
let channelId = itemData.channelId;
this.$refs.devicePlayer.openDialog("record", deviceId, channelId, {date: format})
--
Gitblit v1.8.0