Commit 8487a0ac authored by 张牧越's avatar 张牧越

styleFix

parent f3f20b82
...@@ -55,9 +55,10 @@ ...@@ -55,9 +55,10 @@
<div class="status-text">数据更新</div> <div class="status-text">数据更新</div>
</div> </div>
</div> </div>
<div id="video-container" v-if="deviceData.camera_id"></div> <div id="video-container" v-if="deviceData.is_camera == 1"></div>
<div id="video-container-img" v-else> <div id="video-container-img" v-else>
<img :src="deviceData.image_url" alt="" /> <img src="@/assets/tower/no_camera.png" alt="" />
<div>暂无监控信息</div>
</div> </div>
</div> </div>
...@@ -179,32 +180,41 @@ export default { ...@@ -179,32 +180,41 @@ export default {
}); });
}, },
openedEvents() { openedEvents() {
getTowerLiveUrl(this.deviceData.camera_id).then((res) => { if (this.deviceData.is_camera == 1) {
const myVideoDiv = document.getElementById(`video-container`); getTowerLiveUrl(this.deviceData.camera_id).then((res) => {
myVideoDiv.innerHTML = `<video const myVideoDiv = document.getElementById(`video-container`);
myVideoDiv.innerHTML = `<video
id="singleVideo" id="singleVideo"
autoplay="autoplay" autoplay="autoplay"
class="video-js vjs-default-skin" class="video-js vjs-default-skin"
></video>`; ></video>`;
const singlePlayer = videojs(`singleVideo`, { const singlePlayer = videojs(`singleVideo`, {
autoplay: true, // 自动播放 autoplay: true, // 自动播放
controls: true, // 控件显示 controls: true, // 控件显示
preload: "auto", //定义视频加载模式 preload: "auto", //定义视频加载模式
loop: true, //是否循环播放 loop: true, //是否循环播放
}); });
singlePlayer.src({ singlePlayer.src({
src: res.data.live_address_url, src: res.data.live_address_url,
type: "application/x-mpegURL", type: "application/x-mpegURL",
});
singlePlayer.play();
this.player = singlePlayer;
getDeviceTodayChart(this.deviceId).then((result) => {
this.todayData = result.data;
this.$nextTick(() => {
this.renderTodayChart();
});
});
}); });
singlePlayer.play(); } else {
this.player = singlePlayer;
getDeviceTodayChart(this.deviceId).then((result) => { getDeviceTodayChart(this.deviceId).then((result) => {
this.todayData = result.data; this.todayData = result.data;
this.$nextTick(() => { this.$nextTick(() => {
this.renderTodayChart(); this.renderTodayChart();
}); });
}); });
}); }
}, },
}, },
computed: { computed: {
...@@ -242,17 +252,24 @@ export default { ...@@ -242,17 +252,24 @@ export default {
.base-info { .base-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20px;
} }
#video-container { #video-container {
width: calc(40% - 20px); width: calc(40% - 20px);
height: 200px;
} }
.video-container-img { #video-container-img {
width: calc(40% - 20px); width: calc(40% - 50px);
height: 200px; text-align: center;
border: 1px solid #00b7ee;
box-shadow: 0px 21px 24px 0px rgba(42, 78, 169, 0.4);
border-radius: 4px;
padding: 20px;
background: #113e77;
text-align: center;
font-size: 14px;
color: #3f6fab;
img { img {
width: 100%; width: 130px;
height: 100%;
vertical-align: top; vertical-align: top;
} }
} }
...@@ -271,6 +288,9 @@ export default { ...@@ -271,6 +288,9 @@ export default {
background: #113e77; background: #113e77;
text-align: center; text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
&:nth-child(n + 5) {
margin-bottom: 0;
}
.status-value { .status-value {
font-size: 18px; font-size: 18px;
color: #13e0ff; color: #13e0ff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment