up
This commit is contained in:
@ -1,121 +1,128 @@
|
||||
<template>
|
||||
<div>
|
||||
<container3 title="利润概况">
|
||||
<el-date-picker slot="datePicker" v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
<div style="height:100%;width:100%;" ref="chart"></div>
|
||||
<el-date-picker
|
||||
slot="datePicker"
|
||||
v-model="dateRange"
|
||||
size="small"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
<div style="height: 100%; width: 100%" ref="chart"></div>
|
||||
</container3>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scalseBox from '../components/scaleBox.vue'
|
||||
import scalseBox from "../components/scaleBox.vue";
|
||||
import bigScreenHead from "../components/bigScreenHead/index.vue";
|
||||
import rocketTit from "../components/rocketTit/index.vue";
|
||||
import container3 from "./components/container3/index.vue";
|
||||
|
||||
import echarts from "echarts";
|
||||
require("echarts/theme/macarons"); // echarts theme
|
||||
import resize from "../../dashboard/mixins/resize";
|
||||
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from '../../dashboard/mixins/resize'
|
||||
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
mixins: [resize],
|
||||
name: 'left2',
|
||||
name: "left2",
|
||||
components: {
|
||||
scalseBox,
|
||||
bigScreenHead,
|
||||
rocketTit,
|
||||
container3,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
dateRange: [],
|
||||
chart: null,
|
||||
option: {
|
||||
legend: {
|
||||
data: ['利润', '利润预测', '利润目标完成率'],
|
||||
data: ["利润", "预测", "利润目标完成率"],
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '6%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
left: "3%",
|
||||
right: "6%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
type: "category",
|
||||
data: [
|
||||
'2021-01',
|
||||
'2021-02',
|
||||
'2021-03',
|
||||
'2021-04',
|
||||
'2021-05',
|
||||
'2021-06',
|
||||
'2021-07',
|
||||
'2021-08',
|
||||
'2021-09',
|
||||
'2021-10',
|
||||
'2021-11',
|
||||
'2021-12',
|
||||
"2021-01",
|
||||
"2021-02",
|
||||
"2021-03",
|
||||
"2021-04",
|
||||
"2021-05",
|
||||
"2021-06",
|
||||
"2021-07",
|
||||
"2021-08",
|
||||
"2021-09",
|
||||
"2021-10",
|
||||
"2021-11",
|
||||
"2021-12",
|
||||
],
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
type: "shadow",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '万元',
|
||||
type: "value",
|
||||
name: "万元",
|
||||
min: 0,
|
||||
max: 250,
|
||||
interval: 50,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
formatter: "{value}",
|
||||
},
|
||||
splitLine: {
|
||||
show: false//不显示网格线
|
||||
show: false, //不显示网格线
|
||||
},
|
||||
splitArea: {
|
||||
show: false//不显示网格区域
|
||||
show: false, //不显示网格区域
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
type: "value",
|
||||
min: 0,
|
||||
max: 50,
|
||||
interval: 5,
|
||||
axisLabel: {
|
||||
formatter: '{value} %'
|
||||
formatter: "{value} %",
|
||||
},
|
||||
splitLine: {
|
||||
show: false//不显示网格线
|
||||
show: false, //不显示网格线
|
||||
},
|
||||
splitArea: {
|
||||
show: false//不显示网格区域
|
||||
show: false, //不显示网格区域
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
grid: {
|
||||
containLabel: true,
|
||||
@ -127,77 +134,83 @@ export default {
|
||||
dataZoom: {},
|
||||
series: [
|
||||
{
|
||||
name: '利润',
|
||||
type: 'bar',
|
||||
name: "利润",
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
data: [
|
||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
|
||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4,
|
||||
3.3,
|
||||
],
|
||||
itemStyle: {
|
||||
color: 'rgb(118,196,166)'
|
||||
color: "rgb(118,196,166)",
|
||||
},
|
||||
barGap: '0'
|
||||
barGap: "0",
|
||||
},
|
||||
{
|
||||
name: '利润预测',
|
||||
type: 'bar',
|
||||
name: "预测",
|
||||
type: "bar",
|
||||
barWidth: 20,
|
||||
data: [
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0,
|
||||
2.3,
|
||||
],
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear', // 线性渐变
|
||||
type: "linear", // 线性渐变
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0,
|
||||
color: '#B5D3FE' // 0%处的颜色为红色
|
||||
}, {
|
||||
offset: 1,
|
||||
color: '#7EA7FC' // 100%处的颜色为蓝
|
||||
}]
|
||||
}
|
||||
}
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#B5D3FE", // 0%处的颜色为红色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#7EA7FC", // 100%处的颜色为蓝
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '利润目标完成率',
|
||||
type: 'line',
|
||||
name: "利润目标完成率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
smooth: false,
|
||||
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2],
|
||||
data: [
|
||||
2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
|
||||
],
|
||||
itemStyle: {
|
||||
color: 'rgba(85, 197, 162, 1)'
|
||||
color: "rgba(85, 197, 162, 1)",
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
symbol: 'none'
|
||||
}
|
||||
symbol: "none",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
this.initChart();
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
this.chart.dispose();
|
||||
this.chart = null;
|
||||
},
|
||||
methods: {
|
||||
initChart () {
|
||||
initChart() {
|
||||
request({
|
||||
url: '/hx/cockpitOverview/profitProfile',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
|
||||
this.chart = echarts.init(this.$refs.chart)
|
||||
url: "/hx/cockpitOverview/profitProfile",
|
||||
method: "get",
|
||||
}).then((res) => {
|
||||
this.chart = echarts.init(this.$refs.chart);
|
||||
let titData = [];
|
||||
let COMPLETEDPROFIT = [];
|
||||
let FORECASTPROFIT = [];
|
||||
@ -207,21 +220,21 @@ export default {
|
||||
titData.push(item.month);
|
||||
COMPLETEDPROFIT.push(item.COMPLETEDPROFIT);
|
||||
FORECASTPROFIT.push(item.FORECASTPROFIT);
|
||||
TARGETPROFIT.push(item.COMPLETEDPROFIT / item.TARGETPROFIT * 100);
|
||||
TARGETPROFIT.push((item.COMPLETEDPROFIT / item.TARGETPROFIT) * 100);
|
||||
}
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
legend: {
|
||||
data: ['利润', '利润预测', '利润目标完成率'],
|
||||
data: ["利润", "预测", "利润目标完成率"],
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
type: "category",
|
||||
// data: [
|
||||
// '2021-01',
|
||||
// '2021-02',
|
||||
@ -238,54 +251,54 @@ export default {
|
||||
// ],
|
||||
data: titData,
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
type: "shadow",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '万元',
|
||||
type: "value",
|
||||
name: "万元",
|
||||
min: 0,
|
||||
max: 250,
|
||||
interval: 50,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
formatter: "{value}",
|
||||
},
|
||||
splitLine: {
|
||||
show: false//不显示网格线
|
||||
show: false, //不显示网格线
|
||||
},
|
||||
splitArea: {
|
||||
show: false//不显示网格区域
|
||||
show: false, //不显示网格区域
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
formatter: '{value} %'
|
||||
formatter: "{value} %",
|
||||
},
|
||||
splitLine: {
|
||||
show: false//不显示网格线
|
||||
show: false, //不显示网格线
|
||||
},
|
||||
splitArea: {
|
||||
show: false//不显示网格区域
|
||||
show: false, //不显示网格区域
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)'
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
grid: {
|
||||
containLabel: true,
|
||||
@ -295,66 +308,69 @@ export default {
|
||||
bottom: 50,
|
||||
},
|
||||
dataZoom: {
|
||||
type: 'slider',
|
||||
type: "slider",
|
||||
start: 0,
|
||||
end: this.dataZoomEnd(titData.length, 7),
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '利润预测',
|
||||
type: 'bar',
|
||||
z: '-1',
|
||||
barGap: '-75%',
|
||||
name: "预测",
|
||||
type: "bar",
|
||||
z: "-1",
|
||||
barGap: "-75%",
|
||||
barWidth: 30,
|
||||
itemStyle: {
|
||||
color: 'rgba(145, 213, 254, .3)',
|
||||
color: "rgba(145, 213, 254, .3)",
|
||||
},
|
||||
data: FORECASTPROFIT,
|
||||
},
|
||||
{
|
||||
name: '利润',
|
||||
type: 'bar',
|
||||
name: "利润",
|
||||
type: "bar",
|
||||
barWidth: 15,
|
||||
position: [0, 0],
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear', // 线性渐变
|
||||
type: "linear", // 线性渐变
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [{
|
||||
offset: 0,
|
||||
color: '#B5D3FE' // 0%处的颜色为红色
|
||||
}, {
|
||||
offset: 1,
|
||||
color: '#7EA7FC' // 100%处的颜色为蓝
|
||||
}]
|
||||
}
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#B5D3FE", // 0%处的颜色为红色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#7EA7FC", // 100%处的颜色为蓝
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
data: COMPLETEDPROFIT,
|
||||
},
|
||||
{
|
||||
name: '利润目标完成率',
|
||||
type: 'line',
|
||||
name: "利润目标完成率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
smooth: false,
|
||||
// data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2],
|
||||
data: TARGETPROFIT,
|
||||
itemStyle: {
|
||||
color: 'rgba(85, 197, 162, 1)'
|
||||
color: "rgba(85, 197, 162, 1)",
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
symbol: 'none'
|
||||
}
|
||||
symbol: "none",
|
||||
},
|
||||
],
|
||||
})
|
||||
});
|
||||
});
|
||||
// this.chart = echarts.init(this.$refs.chart);
|
||||
// this.chart.setOption(this.option);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -1,107 +1,114 @@
|
||||
<template>
|
||||
<div>
|
||||
<container2 title="视频检验系统实况">
|
||||
<div class="box">
|
||||
<div class="_img">
|
||||
<!-- <img src="./1.jpg" alt="" /> -->
|
||||
<!-- muted controls autoplay -->
|
||||
<video id="videoElement" muted controls autoplay>Your browser is too old which doesn't support HTML5 video.</video>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p style="opacity: 0.8">实况信息</p>
|
||||
<p style="opacity: 0.5; color: #91d5fe; font-size: 14px">{{ videoInfo.videoNowInfo }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</container2>
|
||||
</div>
|
||||
<div>
|
||||
<container2 title="视频检验系统实况">
|
||||
<div class="box">
|
||||
<div class="_img">
|
||||
<!-- <img src="./1.jpg" alt="" /> -->
|
||||
<!-- muted controls autoplay -->
|
||||
<video id="videoElement" muted controls autoplay>
|
||||
Your browser is too old which doesn't support HTML5 video.
|
||||
</video>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p style="opacity: 0.8">实况信息</p>
|
||||
<p style="opacity: 0.5; color: #91d5fe; font-size: 14px">
|
||||
{{ videoInfo.videoNowInfo }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</container2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import flvjs from 'flv.js'
|
||||
import flvjs from "flv.js";
|
||||
|
||||
import scalseBox from '../components/scaleBox.vue'
|
||||
import bigScreenHead from '../components/bigScreenHead/index.vue'
|
||||
import rocketTit from '../components/rocketTit/index.vue'
|
||||
import container2 from './components/container2/index.vue'
|
||||
import scalseBox from "../components/scaleBox.vue";
|
||||
import bigScreenHead from "../components/bigScreenHead/index.vue";
|
||||
import rocketTit from "../components/rocketTit/index.vue";
|
||||
import container2 from "./components/container2/index.vue";
|
||||
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from '../../dashboard/mixins/resize'
|
||||
import echarts from "echarts";
|
||||
require("echarts/theme/macarons"); // echarts theme
|
||||
import resize from "../../dashboard/mixins/resize";
|
||||
export default {
|
||||
mixins: [resize],
|
||||
name: 'left3',
|
||||
components: {
|
||||
scalseBox,
|
||||
bigScreenHead,
|
||||
rocketTit,
|
||||
container2,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
videoInfo: {},
|
||||
flvPlayer: null,
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.flvPlayer.player.pause()
|
||||
this.flvPlayer.player.unload()
|
||||
this.flvPlayer.player.detachMediaElement()
|
||||
this.flvPlayer.player.destroy()
|
||||
this.flvPlayer.player = null
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
this.request({
|
||||
url: '/hx/qualityAssurance/getHxVideoSystem',
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
this.videoInfo = data[0]
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: 'flv', // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: this.videoInfo.videoAddress,
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
)
|
||||
let videoElement = document.getElementById('videoElement')
|
||||
this.flvPlayer.attachMediaElement(videoElement)
|
||||
this.flvPlayer.load()
|
||||
this.flvPlayer.play()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
mixins: [resize],
|
||||
name: "left3",
|
||||
components: {
|
||||
scalseBox,
|
||||
bigScreenHead,
|
||||
rocketTit,
|
||||
container2,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
videoInfo: {},
|
||||
flvPlayer: null,
|
||||
};
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
this.request({
|
||||
url: "/hx/qualityAssurance/getHxVideoSystem",
|
||||
method: "get",
|
||||
}).then(({ data }) => {
|
||||
this.videoInfo = data[0];
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: "flv", // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: this.videoInfo.videoAddress,
|
||||
// url: "http://192.168.0.151:81/stream/live/classic_cases_video.flv",
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
);
|
||||
let videoElement = document.getElementById("videoElement");
|
||||
this.flvPlayer.attachMediaElement(videoElement);
|
||||
this.flvPlayer.load();
|
||||
this.flvPlayer.play();
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
display: flex;
|
||||
padding: 0 10px 0 0;
|
||||
._img {
|
||||
width: 310px;
|
||||
height: 229px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
// background-color: rgba(145, 213, 254, 0.15);
|
||||
}
|
||||
display: flex;
|
||||
padding: 0 10px 0 0;
|
||||
._img {
|
||||
width: 310px;
|
||||
height: 229px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.text {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
// background-color: rgba(145, 213, 254, 0.15);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,241 +1,280 @@
|
||||
<template>
|
||||
<container3 title="全厂工房作业信息" :width="768" :height="975">
|
||||
<div>
|
||||
<img v-if="pic.length" style="width: 100%; height: 100%" :src="pic" alt="" srcset="" />
|
||||
<img v-else style="width: 100%; height: 100%" src="./center-bg.png" alt="" srcset="" />
|
||||
</div>
|
||||
<el-popover
|
||||
class="icon_img"
|
||||
:style="{ top: item.ordinate + '%', left: item.abscissa + '%' }"
|
||||
v-for="(item, index) in listData"
|
||||
:key="item.id"
|
||||
placement="bottom"
|
||||
:visible-arrow="false"
|
||||
width="494"
|
||||
trigger="click"
|
||||
@show="handleShow(index)"
|
||||
@hide="hadleHide"
|
||||
>
|
||||
<div>
|
||||
<div class="box">
|
||||
<div class="tit">
|
||||
<img src="./icon2.png" alt="" />
|
||||
<span>总装车间</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="11">
|
||||
<!-- <el-image style="width: 100px; height: 100px" :src="item.avAddress" fit="contain"></el-image> -->
|
||||
<video id="videoElement" muted controls autoplay>
|
||||
Your browser is too old which doesn't support HTML5 video.
|
||||
</video>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<div class="user_box" style="">作业人员</div>
|
||||
<!-- singleWidth: 50 -->
|
||||
<vue-seamless-scroll
|
||||
ref="seamlessScroll"
|
||||
:data="listData2"
|
||||
:class-option="{
|
||||
step: 0.5,
|
||||
direction: 2,
|
||||
}"
|
||||
class="warp"
|
||||
>
|
||||
<ul class="ul-item">
|
||||
<li class="li-item" v-for="(row, index) in listData2" :key="index">
|
||||
<!-- <el-image style="width: 42px; height: 42px" :src="row.avatar" fit="cover"></el-image> -->
|
||||
<img style="width: 42px; height: 42px" :src="row.avatar" />
|
||||
<el-tooltip effect="dark" :content="row.nickname" placement="bottom">
|
||||
<div class="one_hidden">{{ row.nickname }}</div>
|
||||
</el-tooltip>
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="user_box">
|
||||
<span>作业内容</span>
|
||||
<span>{{ item.errorInfo }}</span>
|
||||
</div>
|
||||
<div style="background-color: #2a437d; padding: 10px 8px; color: #fff">{{ item.jobContent }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="text" style="padding: 0" slot="reference">
|
||||
<img style="width: 100%; height: 100%" src="./icon.png" alt="" />
|
||||
</el-button>
|
||||
</el-popover>
|
||||
</container3>
|
||||
<container3 title="全厂工房作业信息" :width="768" :height="975">
|
||||
<div>
|
||||
<img
|
||||
v-if="pic.length"
|
||||
style="width: 100%; height: 100%"
|
||||
:src="pic"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
style="width: 100%; height: 100%"
|
||||
src="./center-bg.png"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
</div>
|
||||
<el-popover
|
||||
class="icon_img"
|
||||
:style="{ top: item.ordinate + '%', left: item.abscissa + '%' }"
|
||||
v-for="(item, index) in listData"
|
||||
:key="item.id"
|
||||
placement="bottom"
|
||||
:visible-arrow="false"
|
||||
width="494"
|
||||
trigger="click"
|
||||
@show="handleShow(index)"
|
||||
@hide="hadleHide"
|
||||
>
|
||||
<div>
|
||||
<div class="box">
|
||||
<div class="tit">
|
||||
<img src="./icon2.png" alt="" />
|
||||
<span>总装车间</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="11">
|
||||
<!-- <el-image style="width: 100px; height: 100px" :src="item.avAddress" fit="contain"></el-image> -->
|
||||
<video id="videoElement" muted controls autoplay>
|
||||
Your browser is too old which doesn't support HTML5 video.
|
||||
</video>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<div class="user_box" style="">作业人员</div>
|
||||
<!-- singleWidth: 50 -->
|
||||
<vue-seamless-scroll
|
||||
ref="seamlessScroll"
|
||||
:data="listData2"
|
||||
:class-option="{
|
||||
step: 0.5,
|
||||
direction: 2,
|
||||
}"
|
||||
class="warp"
|
||||
>
|
||||
<ul class="ul-item">
|
||||
<li
|
||||
class="li-item"
|
||||
v-for="(row, index) in listData2"
|
||||
:key="index"
|
||||
>
|
||||
<!-- <el-image style="width: 42px; height: 42px" :src="row.avatar" fit="cover"></el-image> -->
|
||||
<img style="width: 42px; height: 42px" :src="row.avatar" />
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="row.nickname"
|
||||
placement="bottom"
|
||||
>
|
||||
<div class="one_hidden">{{ row.nickname }}</div>
|
||||
</el-tooltip>
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="user_box">
|
||||
<span>作业内容</span>
|
||||
<span>{{ item.errorInfo }}</span>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
background-color: #2a437d;
|
||||
padding: 10px 8px;
|
||||
color: #fff;
|
||||
"
|
||||
>
|
||||
{{ item.jobContent }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="text" style="padding: 0" slot="reference">
|
||||
<img style="width: 100%; height: 100%" src="./icon.png" alt="" />
|
||||
</el-button>
|
||||
</el-popover>
|
||||
</container3>
|
||||
</template>
|
||||
<script>
|
||||
import flvjs from 'flv.js'
|
||||
import flvjs from "flv.js";
|
||||
|
||||
import container3 from './components/container3/index.vue'
|
||||
import vueSeamlessScroll from 'vue-seamless-scroll'
|
||||
import echarts from 'echarts'
|
||||
import container3 from "./components/container3/index.vue";
|
||||
import vueSeamlessScroll from "vue-seamless-scroll";
|
||||
import echarts from "echarts";
|
||||
export default {
|
||||
components: {
|
||||
container3, //#endregion,
|
||||
vueSeamlessScroll,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pic: '',
|
||||
listData: [],
|
||||
listData2: [],
|
||||
flvPlayer: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.request({
|
||||
url: '/hx/scientificProduction/getHxWorkHomePic',
|
||||
}).then(({ data }) => {
|
||||
this.listData = data
|
||||
})
|
||||
},
|
||||
handleShow(index) {
|
||||
this.listData2 = this.listData[index]['userList']
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: 'flv', // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: this.listData[index]['avAddress'],
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
)
|
||||
let all = document.querySelectorAll('#videoElement')
|
||||
let videoElement = all[all.length - 1]
|
||||
this.flvPlayer.attachMediaElement(videoElement)
|
||||
this.flvPlayer.load()
|
||||
this.flvPlayer.play()
|
||||
}
|
||||
},
|
||||
hadleHide() {
|
||||
this.flvPlayer.player.pause()
|
||||
this.flvPlayer.player.unload()
|
||||
this.flvPlayer.player.detachMediaElement()
|
||||
this.flvPlayer.player.destroy()
|
||||
this.flvPlayer.player = null
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.flvPlayer.player.pause()
|
||||
this.flvPlayer.player.unload()
|
||||
this.flvPlayer.player.detachMediaElement()
|
||||
this.flvPlayer.player.destroy()
|
||||
this.flvPlayer.player = null
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.request({
|
||||
url: '/hx/bigPic/getByType',
|
||||
method: 'get',
|
||||
params: { type: 2 },
|
||||
}).then(res => {
|
||||
if (200 == res.code) {
|
||||
this.pic = res.data.pic
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
components: {
|
||||
container3, //#endregion,
|
||||
vueSeamlessScroll,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pic: "",
|
||||
listData: [],
|
||||
listData2: [],
|
||||
flvPlayer: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.request({
|
||||
url: "/hx/scientificProduction/getHxWorkHomePic",
|
||||
}).then(({ data }) => {
|
||||
// data.map((item) => {
|
||||
// item.avAddress =
|
||||
// "http://192.168.0.151:81/stream/live/classic_cases_video.flv";
|
||||
// });
|
||||
this.listData = data;
|
||||
});
|
||||
},
|
||||
handleShow(index) {
|
||||
this.hadleHide();
|
||||
this.listData2 = this.listData[index]["userList"];
|
||||
setTimeout(() => {
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: "flv", // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: this.listData[index]["avAddress"],
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
);
|
||||
let all = document.querySelectorAll("#videoElement");
|
||||
let videoElement = all[all.length - 1];
|
||||
this.flvPlayer.attachMediaElement(videoElement);
|
||||
this.flvPlayer.load();
|
||||
this.flvPlayer.play();
|
||||
}
|
||||
}, 0);
|
||||
},
|
||||
hadleHide() {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.request({
|
||||
url: "/hx/bigPic/getByType",
|
||||
method: "get",
|
||||
params: { type: 2 },
|
||||
}).then((res) => {
|
||||
if (200 == res.code) {
|
||||
this.pic = res.data.pic;
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.el-popover {
|
||||
background-color: unset;
|
||||
border: 0;
|
||||
background-color: unset;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.icon_img {
|
||||
position: absolute;
|
||||
position: absolute;
|
||||
}
|
||||
.el-popover {
|
||||
.box {
|
||||
width: 177px;
|
||||
height: 0;
|
||||
border-width: 0px 20px 30px 0px;
|
||||
border-style: none solid solid;
|
||||
border-color: transparent transparent rgba(10, 90, 132, 1);
|
||||
.tit {
|
||||
height: 30px;
|
||||
padding-left: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span {
|
||||
margin-left: 8px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cont {
|
||||
background-color: #0d1049;
|
||||
padding: 8px 13px 11px 16px;
|
||||
video {
|
||||
width: 100%;
|
||||
height: 143px;
|
||||
}
|
||||
.user_box {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 16px;
|
||||
background: linear-gradient(
|
||||
270deg,
|
||||
rgba(10, 16, 75, 0) 0%,
|
||||
rgba(8, 56, 105, 0.11) 0%,
|
||||
rgba(6, 116, 151, 0.91) 60%,
|
||||
#00ffff 146%
|
||||
);
|
||||
span:nth-child(1) {
|
||||
float: left;
|
||||
}
|
||||
span:nth-child(2) {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.warp {
|
||||
// height: 100px;
|
||||
margin: 0 auto;
|
||||
margin-top: 25px;
|
||||
overflow: hidden;
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
&.ul-item {
|
||||
display: flex;
|
||||
.li-item {
|
||||
width: 42px;
|
||||
// height: 120px;
|
||||
margin-right: 8px;
|
||||
// line-height: 120px;
|
||||
// background-color: #999;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
.one_hidden {
|
||||
word-break: keep-all;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.box {
|
||||
width: 177px;
|
||||
height: 0;
|
||||
border-width: 0px 20px 30px 0px;
|
||||
border-style: none solid solid;
|
||||
border-color: transparent transparent rgba(10, 90, 132, 1);
|
||||
.tit {
|
||||
height: 30px;
|
||||
padding-left: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span {
|
||||
margin-left: 8px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cont {
|
||||
background-color: #0d1049;
|
||||
padding: 8px 13px 11px 16px;
|
||||
video {
|
||||
width: 100%;
|
||||
height: 143px;
|
||||
}
|
||||
.user_box {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 16px;
|
||||
background: linear-gradient(
|
||||
270deg,
|
||||
rgba(10, 16, 75, 0) 0%,
|
||||
rgba(8, 56, 105, 0.11) 0%,
|
||||
rgba(6, 116, 151, 0.91) 60%,
|
||||
#00ffff 146%
|
||||
);
|
||||
span:nth-child(1) {
|
||||
float: left;
|
||||
}
|
||||
span:nth-child(2) {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.warp {
|
||||
// height: 100px;
|
||||
margin: 0 auto;
|
||||
margin-top: 25px;
|
||||
overflow: hidden;
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
&.ul-item {
|
||||
display: flex;
|
||||
.li-item {
|
||||
width: 42px;
|
||||
// height: 120px;
|
||||
margin-right: 8px;
|
||||
// line-height: 120px;
|
||||
// background-color: #999;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
.one_hidden {
|
||||
word-break: keep-all;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -7,48 +7,136 @@
|
||||
<!-- <div id="left1" ref="left1" class="chart1"></div> -->
|
||||
<div style="height: 270px; margin: 14px 0 8px">
|
||||
<!-- <img style="width: 100%; height: 100%" src="./img/left1/1.jpg" alt="" /> -->
|
||||
<video style="width: 100%; height: 100%" :src="videoUrl" id="videoElement" muted controls autoplay>
|
||||
<video
|
||||
style="width: 100%; height: 100%"
|
||||
:src="videoUrl"
|
||||
id="videoElement"
|
||||
muted
|
||||
controls
|
||||
autoplay
|
||||
>
|
||||
Your browser is too old which doesn't support HTML5 video.
|
||||
</video>
|
||||
</div>
|
||||
<div style="text-align: right; margin-bottom: 14px; font-size: 14px">
|
||||
<span :style="{opacity:videoIndex==0? 0.9:0.7,cursor:'pointer'}" @click="handleVideoType(0)">视频监控 / </span>
|
||||
<span :style="{opacity:videoIndex==1? 0.9:0.7,cursor:'pointer'}" @click="handleVideoType(1)">奖惩播放 / </span>
|
||||
<span :style="{opacity:videoIndex==2? 0.9:0.7,cursor:'pointer'}" @click="handleVideoType(2)">典型案例播放</span>
|
||||
<div
|
||||
style="text-align: right; margin-bottom: 14px; font-size: 14px"
|
||||
>
|
||||
<span
|
||||
:style="{
|
||||
opacity: videoIndex == 0 ? 0.9 : 0.7,
|
||||
cursor: 'pointer',
|
||||
}"
|
||||
@click="handleVideoType(0)"
|
||||
>视频监控 /
|
||||
</span>
|
||||
<span
|
||||
:style="{
|
||||
opacity: videoIndex == 1 ? 0.9 : 0.7,
|
||||
cursor: 'pointer',
|
||||
}"
|
||||
@click="handleVideoType(1)"
|
||||
>奖惩播放 /
|
||||
</span>
|
||||
<span
|
||||
:style="{
|
||||
opacity: videoIndex == 2 ? 0.9 : 0.7,
|
||||
cursor: 'pointer',
|
||||
}"
|
||||
@click="handleVideoType(2)"
|
||||
>典型案例播放</span
|
||||
>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; margin-bottom: 28px">
|
||||
<div
|
||||
style="display: flex; align-items: center; margin-bottom: 28px"
|
||||
>
|
||||
<span>危险点视频覆盖率</span>
|
||||
<progressBar :showText="true" :strokeWidth="10" :percentage="rate" style="flex: 1; margin-left: 10px" />
|
||||
<progressBar
|
||||
:showText="true"
|
||||
:strokeWidth="10"
|
||||
:percentage="rate"
|
||||
style="flex: 1; margin-left: 10px"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24" style="margin-bottom: 1px">
|
||||
<el-row style="height: 42px; line-height: 42px; background: rgba(0, 255, 255, 0.3)">
|
||||
<el-row
|
||||
style="
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
background: rgba(0, 255, 255, 0.3);
|
||||
"
|
||||
>
|
||||
<el-col style="text-align: center" :span="3">序号</el-col>
|
||||
<el-col style="text-align: center" :span="7">危险点</el-col>
|
||||
<el-col style="text-align: center" :span="7">危险级别</el-col>
|
||||
<el-col style="text-align: center" :span="7">运行状态</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<vue-seamless-scroll :data="listData" ref="seamlessScroll" class="warp-scroll" :class-option="{
|
||||
singleHeight: 43,
|
||||
}">
|
||||
<vue-seamless-scroll
|
||||
:data="listData"
|
||||
ref="seamlessScroll"
|
||||
class="warp-scroll"
|
||||
:class-option="{
|
||||
singleHeight: 43,
|
||||
}"
|
||||
>
|
||||
<ul class="item">
|
||||
<li v-for="(item,index) in points" :key="index">
|
||||
<li v-for="(item, index) in points" :key="index">
|
||||
<el-row>
|
||||
<el-col style="text-align: center" :span="3">{{ item.id }}</el-col>
|
||||
<el-col style="text-align: center" :span="7">{{ item.pointName }}</el-col>
|
||||
<el-col style="text-align: center" :span="3">{{
|
||||
item.id
|
||||
}}</el-col>
|
||||
<el-col style="text-align: center" :span="7">{{
|
||||
item.pointName
|
||||
}}</el-col>
|
||||
<el-col style="text-align: center" :span="7">
|
||||
<el-tag v-if="item.level == '一级'" style="background-color: unset" type="danger" effect="plain">
|
||||
{{ item.level }}</el-tag>
|
||||
<el-tag v-else-if="item.level == '二级'" style="background-color: unset" type="warning" effect="plain">
|
||||
{{ item.level }}</el-tag>
|
||||
<el-tag v-else style="background-color: unset" effect="plain"> {{ item.level }}</el-tag>
|
||||
<el-tag
|
||||
v-if="item.level == '一级'"
|
||||
style="background-color: unset"
|
||||
type="danger"
|
||||
effect="plain"
|
||||
>
|
||||
{{ item.level }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
v-else-if="item.level == '二级'"
|
||||
style="background-color: unset"
|
||||
type="warning"
|
||||
effect="plain"
|
||||
>
|
||||
{{ item.level }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
style="background-color: unset"
|
||||
effect="plain"
|
||||
>
|
||||
{{ item.level }}</el-tag
|
||||
>
|
||||
</el-col>
|
||||
<el-col style="text-align: center" :span="7">
|
||||
<section class="box">
|
||||
<span v-if="item.status == '运行中'" style="color: #6fd1b4; font-size: 25px; margin-right: 3px">·</span>
|
||||
<span v-else-if="item.status == '已损坏'" style="color: #f64f58; font-size: 25px; margin-right: 3px">·</span>
|
||||
<span v-else style="font-size: 25px; margin-right: 3px">·</span>
|
||||
<span
|
||||
v-if="item.status == '运行中'"
|
||||
style="
|
||||
color: #6fd1b4;
|
||||
font-size: 25px;
|
||||
margin-right: 3px;
|
||||
"
|
||||
>·</span
|
||||
>
|
||||
<span
|
||||
v-else-if="item.status == '已损坏'"
|
||||
style="
|
||||
color: #f64f58;
|
||||
font-size: 25px;
|
||||
margin-right: 3px;
|
||||
"
|
||||
>·</span
|
||||
>
|
||||
<span v-else style="font-size: 25px; margin-right: 3px"
|
||||
>·</span
|
||||
>
|
||||
<span v-if="item.status == '运行中'">运行中</span>
|
||||
<span v-else-if="item.status == '已损坏'">已损坏</span>
|
||||
<span v-else>未开始</span>
|
||||
@ -65,21 +153,21 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import flvjs from 'flv.js'
|
||||
import flvjs from "flv.js";
|
||||
|
||||
import rocketTit from '../components/rocketTit/index.vue'
|
||||
import container from './components/container/index.vue'
|
||||
import bigScreenTabs from '../components/bigScreenTabs/index.vue'
|
||||
import progressBar from '@/views/bigScreen/components/progress/index.vue'
|
||||
import colorList from '@/utils/colorPalette'
|
||||
import vueSeamlessScroll from 'vue-seamless-scroll'
|
||||
import rocketTit from "../components/rocketTit/index.vue";
|
||||
import container from "./components/container/index.vue";
|
||||
import bigScreenTabs from "../components/bigScreenTabs/index.vue";
|
||||
import progressBar from "@/views/bigScreen/components/progress/index.vue";
|
||||
import colorList from "@/utils/colorPalette";
|
||||
import vueSeamlessScroll from "vue-seamless-scroll";
|
||||
// import {Liquid} from '@antv/g2plot';
|
||||
// import resize from '../../dashboard/mixins/resize'
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import echarts from "echarts";
|
||||
require("echarts/theme/macarons"); // echarts theme
|
||||
export default {
|
||||
// mixins: [resize],
|
||||
name: 'left1',
|
||||
name: "left1",
|
||||
components: {
|
||||
rocketTit,
|
||||
container,
|
||||
@ -87,128 +175,159 @@ export default {
|
||||
progressBar,
|
||||
vueSeamlessScroll,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
colorList,
|
||||
listData: [1, 2, 3, 4,5,6,7,8],
|
||||
listData: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
rate: 0,
|
||||
points: [],
|
||||
videoIndex: 0,
|
||||
flvPlayer: null,
|
||||
videoUrl: ''
|
||||
}
|
||||
videoUrl: "",
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
this.getData();
|
||||
// this.initChart()
|
||||
// this.initLine()
|
||||
})
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.flvPlayer.player.pause()
|
||||
this.flvPlayer.player.unload()
|
||||
this.flvPlayer.player.detachMediaElement()
|
||||
this.flvPlayer.player.destroy()
|
||||
this.flvPlayer.player = null
|
||||
beforeDestroy() {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleVideoType(val){
|
||||
this.videoIndex = val
|
||||
if(val==0){
|
||||
this.videoUrl=''
|
||||
}else if(val==1){
|
||||
handleVideoType(val) {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
this.videoIndex = val;
|
||||
if (val == 0) {
|
||||
this.videoUrl = "";
|
||||
this.getData();
|
||||
} else if (val == 1) {
|
||||
this.request({
|
||||
url: '/hx/securityManagement/getVideoByType',
|
||||
params:{
|
||||
type:'1'
|
||||
}
|
||||
}).then(res=>{
|
||||
this.videoUrl = res.msg
|
||||
})
|
||||
}else{
|
||||
this.request({
|
||||
url: '/hx/securityManagement/getVideoByType',
|
||||
params:{
|
||||
type:'2'
|
||||
}
|
||||
}).then(res=>{
|
||||
this.videoUrl = res.msg
|
||||
})
|
||||
url: "/hx/securityManagement/getVideoByType",
|
||||
params: {
|
||||
type: "1",
|
||||
},
|
||||
}).then((res) => {
|
||||
// this.videoUrl = res.msg;
|
||||
this.setVideoUrl(res.msg);
|
||||
// this.setVideoUrl(
|
||||
// "http://192.168.0.151:81/stream/live/classic_cases_video.flv"
|
||||
// );
|
||||
});
|
||||
} else {
|
||||
this.request({
|
||||
url: "/hx/securityManagement/getVideoByType",
|
||||
params: {
|
||||
type: "2",
|
||||
},
|
||||
}).then((res) => {
|
||||
// this.videoUrl = res.msg;
|
||||
this.setVideoUrl(res.msg);
|
||||
// this.setVideoUrl(
|
||||
// "http://192.168.0.151:81/stream/live/classic_cases_video.flv"
|
||||
// );
|
||||
});
|
||||
}
|
||||
},
|
||||
setVideoUrl(videoUrl){
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: 'flv', // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: videoUrl,
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
)
|
||||
setVideoUrl(videoUrl) {
|
||||
if (flvjs.isSupported()) {
|
||||
this.flvPlayer = flvjs.createPlayer(
|
||||
{
|
||||
type: "flv", // 媒体类型 flv 或 mp4
|
||||
isLive: true, // 是否为直播流
|
||||
fluid: true,
|
||||
// hasAudio: true, // 是否开启声音
|
||||
stashInitialSize: 128, // 减少首桢显示等待时长
|
||||
url: videoUrl,
|
||||
},
|
||||
{
|
||||
enableStashBuffer: false,
|
||||
fixAudioTimestampGap: false,
|
||||
isLive: true,
|
||||
}
|
||||
let videoElement = document.getElementById('videoElement')
|
||||
this.flvPlayer.attachMediaElement(videoElement)
|
||||
this.flvPlayer.load()
|
||||
this.flvPlayer.play()
|
||||
);
|
||||
}
|
||||
let videoElement = document.getElementById("videoElement");
|
||||
this.flvPlayer.attachMediaElement(videoElement);
|
||||
this.flvPlayer.load();
|
||||
this.flvPlayer.play();
|
||||
},
|
||||
getData () {
|
||||
getData() {
|
||||
this.request({
|
||||
url: '/hx/securityManagement/dangerousMap',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
url: "/hx/securityManagement/dangerousMap",
|
||||
method: "get",
|
||||
}).then((res) => {
|
||||
if (200 == res.code) {
|
||||
this.points = res.data.points;
|
||||
this.rate = res.data.rate;
|
||||
this.listData = Array(this.points.length*2).fill(0);
|
||||
this.listData = Array(this.points.length * 2).fill(0);
|
||||
this.$refs.seamlessScroll.reset();
|
||||
if(this.points.length){
|
||||
// this.setVideoUrl(this.rate[0].rtmpAddress)
|
||||
this.setVideoUrl('http://192.168.0.151:81/stream/live/classic_cases_video.flv')
|
||||
if (this.points.length) {
|
||||
if (this.points[0]["rtmpAddress"]) {
|
||||
this.setVideoUrl(this.points[0].rtmpAddress);
|
||||
// this.setVideoUrl(
|
||||
// "http://192.168.0.151:81/stream/live/classic_cases_video.flv"
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
initChart () {
|
||||
this.chart = echarts.init(this.$refs.left1, 'macarons')
|
||||
this.setOptions()
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$refs.left1, "macarons");
|
||||
this.setOptions();
|
||||
},
|
||||
setOptions () {
|
||||
setOptions() {
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)',
|
||||
trigger: "item",
|
||||
formatter: "{a} <br/>{b}: {c} ({d}%)",
|
||||
},
|
||||
color: this.colorList,
|
||||
legend: {
|
||||
data: ['类别一', '类别二', '类别三', '类别四', '类别五', '类别六', '类别七', '类别八'],
|
||||
orient: 'vertical',
|
||||
data: [
|
||||
"类别一",
|
||||
"类别二",
|
||||
"类别三",
|
||||
"类别四",
|
||||
"类别五",
|
||||
"类别六",
|
||||
"类别七",
|
||||
"类别八",
|
||||
],
|
||||
orient: "vertical",
|
||||
// left: '60%',
|
||||
right: '2%',
|
||||
y: 'center',
|
||||
right: "2%",
|
||||
y: "center",
|
||||
textStyle: {
|
||||
//图例文字的样式
|
||||
color: '#fff',
|
||||
color: "#fff",
|
||||
fontSize: 16,
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '概括',
|
||||
type: 'pie',
|
||||
radius: [0, '85%'],
|
||||
center: ['35%', '50%'],
|
||||
name: "概括",
|
||||
type: "pie",
|
||||
radius: [0, "85%"],
|
||||
center: ["35%", "50%"],
|
||||
label: {
|
||||
formatter: '',
|
||||
position: 'inner',
|
||||
formatter: "",
|
||||
position: "inner",
|
||||
fontSize: 14,
|
||||
},
|
||||
labelLine: {
|
||||
@ -217,22 +336,22 @@ export default {
|
||||
data: this.data,
|
||||
},
|
||||
],
|
||||
})
|
||||
});
|
||||
},
|
||||
initLine () {
|
||||
this.chart = echarts.init(this.$refs.left2)
|
||||
this.setOptions2()
|
||||
initLine() {
|
||||
this.chart = echarts.init(this.$refs.left2);
|
||||
this.setOptions2();
|
||||
},
|
||||
setOptions2 () {
|
||||
setOptions2() {
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: '{a1}<br/>{b1}:{c1}',
|
||||
trigger: "axis",
|
||||
formatter: "{a1}<br/>{b1}:{c1}",
|
||||
},
|
||||
legend: {
|
||||
data: ['收入', '实际', '目标'],
|
||||
data: ["收入", "实际", "目标"],
|
||||
textStyle: {
|
||||
color: '#fff', //legend字体颜色
|
||||
color: "#fff", //legend字体颜色
|
||||
},
|
||||
// selectedMode: false,
|
||||
},
|
||||
@ -245,58 +364,58 @@ export default {
|
||||
},
|
||||
xAxis: {
|
||||
data: [
|
||||
'2021-01',
|
||||
'2021-02',
|
||||
'2021-03',
|
||||
'2021-04',
|
||||
'2021-05',
|
||||
'2021-06',
|
||||
'2021-07',
|
||||
'2021-08',
|
||||
'2021-09',
|
||||
'2021-10',
|
||||
'2021-11',
|
||||
'2021-12',
|
||||
"2021-01",
|
||||
"2021-02",
|
||||
"2021-03",
|
||||
"2021-04",
|
||||
"2021-05",
|
||||
"2021-06",
|
||||
"2021-07",
|
||||
"2021-08",
|
||||
"2021-09",
|
||||
"2021-10",
|
||||
"2021-11",
|
||||
"2021-12",
|
||||
],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)',
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
},
|
||||
},
|
||||
dataZoom: {
|
||||
type: 'slider',
|
||||
type: "slider",
|
||||
start: 0,
|
||||
end: 50,
|
||||
},
|
||||
color: ['#ccc', 'red'],
|
||||
color: ["#ccc", "red"],
|
||||
yAxis: [
|
||||
{
|
||||
name: '件',
|
||||
name: "件",
|
||||
splitLine: {
|
||||
show: true,
|
||||
// 改变轴线颜色
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: ['rgba(255, 255, 255,.5)'],
|
||||
color: ["rgba(255, 255, 255,.5)"],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: '{value}',
|
||||
formatter: "{value}",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)',
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
type: "value",
|
||||
min: 0,
|
||||
max: 100,
|
||||
interval: 20,
|
||||
axisLabel: {
|
||||
formatter: '{value} %',
|
||||
formatter: "{value} %",
|
||||
},
|
||||
splitLine: {
|
||||
show: false, //不显示网格线
|
||||
@ -306,58 +425,66 @@ export default {
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(255, 255, 255)',
|
||||
color: "rgb(255, 255, 255)",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
z: '-1',
|
||||
barGap: '-75%',
|
||||
name: "收入",
|
||||
type: "bar",
|
||||
z: "-1",
|
||||
barGap: "-75%",
|
||||
barWidth: 30,
|
||||
itemStyle: {
|
||||
color: 'rgba(85, 197, 162, .3)',
|
||||
color: "rgba(85, 197, 162, .3)",
|
||||
},
|
||||
data: [80, 80, 95, 95, 95, 95, 80, 80, 95, 95, 95, 95],
|
||||
},
|
||||
{
|
||||
name: '实际',
|
||||
type: 'bar',
|
||||
name: "实际",
|
||||
type: "bar",
|
||||
barWidth: 15,
|
||||
position: [0, 0],
|
||||
itemStyle: {
|
||||
color: 'rgba(90, 216, 166, 0.85)',
|
||||
color: "rgba(90, 216, 166, 0.85)",
|
||||
},
|
||||
data: [5, 20, 36, 10, 10, 20, 10, 20, 30, 10, 70, 75],
|
||||
},
|
||||
{
|
||||
name: '目标',
|
||||
type: 'scatter',
|
||||
symbol: 'rect',
|
||||
name: "目标",
|
||||
type: "scatter",
|
||||
symbol: "rect",
|
||||
symbolSize: [30, 4],
|
||||
symbolOffset: [3, 0],
|
||||
position: [0, 0],
|
||||
itemStyle: {
|
||||
color: '#F6D97E',
|
||||
color: "#F6D97E",
|
||||
},
|
||||
data: [20, 30, 45, 20, 20, 30, 20, 30, 40, 20, 90, 90],
|
||||
},
|
||||
],
|
||||
})
|
||||
});
|
||||
},
|
||||
},
|
||||
created () {
|
||||
this.$bus.on("getTarget", res => {
|
||||
console.log(this.videoIndex);
|
||||
this.videoIndex = 0
|
||||
this.setVideoUrl(res.rtmpAddress)
|
||||
console.log(this.videoIndex);
|
||||
created() {
|
||||
this.$bus.on("getTarget", (res) => {
|
||||
if (this.flvPlayer) {
|
||||
this.flvPlayer.pause();
|
||||
this.flvPlayer.unload();
|
||||
this.flvPlayer.detachMediaElement();
|
||||
this.flvPlayer.destroy();
|
||||
this.flvPlayer = null;
|
||||
}
|
||||
this.videoIndex = 0;
|
||||
this.setVideoUrl(res.rtmpAddress);
|
||||
// this.setVideoUrl(
|
||||
// "http://192.168.0.151:81/stream/live/classic_cases_video.flv"
|
||||
// );
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Reference in New Issue
Block a user