123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- <template>
- <div id="content">
- <el-carousel indicator-position="none" :autoplay="false">
- <el-carousel-item v-for="item in 1" :key="item">
-
- <div v-if=" item==1 ">
- <previewV1
- :date='date'
- :nowWeek='nowWeek'
- :workData='workData'
- :alarmData='alarmData'
- :deviceStatusData='deviceStatusData'
- :pieStateOptions='pieStateOptions'
- :pieFaultOptions='pieFaultOptions'
- :pieDeviceOptions='pieDeviceOptions'
- :pieOptions='pieOptions'
- :barPlanOptions='barPlanOptions'
- :barOptions='barOptions'
- :lineOptions='lineOptions'
- :mapOptions='mapOptions'
- />
- </div>
- <!-- <div v-else>
- <previewV2
- :date='date'
- :nowWeek='nowWeek'
- :alarm_data='alarm_data'
- :alarmData='alarmData'
- :deviceStatusData='deviceStatusData'
- :netPieOptions='netPieOptions'
- :barPlanOptions='barPlanOptions'
- :barOptions='barOptions'
- :lineOptions='lineOptions'
- :barRealtimeAlarmOptions='barRealtimeAlarmOptions'
- :subRealtimeAlarmOptions='subRealtimeAlarmOptions'
- />
- </div> -->
-
-
- </el-carousel-item>
- </el-carousel>
- </div>
- </template>
- <script>
- import previewV1 from "./preview_v1";
- import previewV2 from "./preview_v2";
- export default {
- name: "screen_screen",
- components: {
- previewV1,
- previewV2,
- },
- data() {
- return {
- data:[],
- date: this.initDate(),//实时时间
- nowWeek:'',
-
- netPieData:[],
- workData:[
- {
- 'number': 'A0001B',
- 'position': '固定轴—机座',
- 'user': '员工1'
- },{
- 'number': 'A0001B',
- 'position': '固定轴—机座',
- 'user': '员工1'
- },{
- 'number': 'A0001B',
- 'position': '固定轴—机座',
- 'user': '员工1'
- },{
- 'number': 'A0001B',
- 'position': '固定轴—机座',
- 'user': '员工1'
- },{
- 'number': 'A0001B',
- 'position': '固定轴—机座',
- 'user': '员工1'
- },
- ],
- mapData: [],//地图数据
- mapData1: [],//地图数据
- alarmData: [],//实时告警数据
- PlanBarxAxisData:['液压泵','液压扳手','中空液压扳手'],//频繁告警区域X轴
- PlanBarData: [70,42,28],//频繁告警区域数据
- // fengxAxisData:['总数','在线','异常'],//液压泵设备统计X轴
- fengTypeData:[
- {
- 'value': 150,
- 'name': '新增'
- }, {
- 'value': 37,
- 'name': '异常'
- },
- ],//井类型数据
- barTypexAxisData:['一季度','二季度','三季度','四季度'],//液压泵设备统计X轴
- barTypeData:[100,76,24,20],//井类型数据
- lineAlarmxAxisData:[],//月告警曲线图X轴
- lineAlarmData:[],//月告警曲线图数据
- deviceStatusData:[],//设备状态统计数据
- pieOptions: {},
- pieStateOptions:{},
- pieFaultOptions:{},
- pieDeviceOptions:{},
- netPieOptions:{},
- barPlanOptions: {},
- RealAlarmBarData:[],
- RealAlarmBarxAxisData:[],
- barRealtimeAlarmOptions:{},//当前告警数统计
- subRealAlarmBarData:[],
- subRealAlarmBarxAxisData:[],
- subRealtimeAlarmOptions:{},//分体告警
- barOptions: {},
- lineOptions:{},
- mapOptions: {},
- signalColor:[],
- netStateColor:[],
- deviceTotal:'',
- };
- },
- methods: {
- goback(){
- this.$router.go(-1)
- },
- getNetPieOptions() {
- return {
- color: this.netStateColor,
- title: {
- text: "设备状态",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- tooltip: {
- trigger: "item",
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- legend: {
- orient: "vertical",
- left: 10,
- top: 30,
-
- textStyle: {
- color: "#FFF"
- }
- },
- series: [
- {
- name: "设备状态",
- type: "pie",
- radius: ["45%", "60%"], // 内外半径
- left: 200,
- avoidLabelOverlap: false,
- label: {
- show: false,
- position: "center"
- },
- center: ['10%', '50%'],
- emphasis: {
- label: {
- show: true,
- fontSize: "30",
- fontWeight: "bold",
-
- }
- },
- labelLine: {
- show: false
- },
- data: this.netPieData
- }
- ]
- };
- },
- getPieDeviceOptions(){
- return {
- title: {
- text: "故障设备状态",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- color:['#FE7E00','#FEC400','#22DACE'],
- tooltip: {},
- legend: {
- x : '50%',
- y : '38%',
- textStyle : {
- color:'#FFF',
- },
- orient : 'vertical',
- data:['液压泵','液压扳手','中空液压扳手'],
- formatter: function(name) {
- var index = 0;
- var clientlabels =['液压泵','液压扳手','中空液压扳手']
- var clientcounts = [400,300,200];
- clientlabels.forEach(function(value,i){
- if(value == name){
- index = i;
- }
- });
- return name + " " + clientcounts[index];
- }
- },
-
- calculable : false,
- series: [{
-
- name: 'myCharts',
- type: 'pie',
- radius: ["35%", "60%"], // 内外半径
- center: ['25%', '55%'],
- startAngle:90, //开始 的旋转角度
-
- itemStyle: {
- normal: {
- label: {
- show: false,
- position: 'inner'
-
- },
- labelLine: {
- show: false,
- }
- }
- },
- data: [
- {value:400, name:'液压泵'},
- {value:300, name:'液压扳手'},
- {value:200, name:'中空液压扳手'},
-
- ]
-
- }
- ]
-
- };
- },
- getPieFaultOptions(){
- return {
- title: {
- text: "故障代码状态(TOP5)",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
-
- tooltip: {},
- legend: {
- x : '50%',
- y : '28%',
- textStyle : {
- color:'#FFF',
- },
- orient : 'vertical',
- data:['液压油偏低','扳手校验不合格','液压泵校验过期','扳手外观不合格','设备异常'],
- formatter: function(name) {
- var index = 0;
- var clientlabels =['液压油偏低','扳手校验不合格','液压泵校验过期','扳手外观不合格','设备异常']
- var clientcounts = [400,300,200,200,200];
- clientlabels.forEach(function(value,i){
- if(value == name){
- index = i;
- }
- });
- return name + " " + clientcounts[index];
- }
- },
-
- calculable : false,
- series: [{
-
- name: 'myCharts',
- type: 'pie',
- radius: ["35%", "60%"], // 内外半径
- center: ['25%', '55%'],
- startAngle:90, //开始 的旋转角度
-
- itemStyle: {
- normal: {
- label: {
- show: false,
- position: 'inner'
-
- },
- labelLine: {
- show: false,
- }
- }
- },
- data: [
- {value:400, name:'液压油偏低'},
- {value:300, name:'扳手校验不合格'},
- {value:200, name:'液压泵校验过期'},
- {value:200, name:'扳手外观不合格'},
- {value:200, name:'设备异常'},
- ]
-
- }
- ]
-
- };
- },
- getPieStateOptions(){
- return {
- tooltip: {
- trigger: 'item'
- },
- legend: {
- show:false
- },
- series: [
- {
- name: '校准状态',
- type: 'pie',
- radius: ['0', '90%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- position: 'inner', // 数值显示在内部
-
- formatter: '{b}', // 格式化数值百分比输出
- },
- },
- emphasis: {
- label: {
- show: true,
- fontSize: '16',
- fontWeight: 'bold'
- }
- },
- labelLine: {
- show: false
- },
- data: [
- { value: 1048, name: '已校准' },
- { value: 735, name: '过期' },
- { value: 580, name: '待检' },
- ]
- }
- ]
- };
- },
- getPieOptions() {
- return {
- color: this.signalColor,
- legend: {
- show: false
- },
- title: {
- text: "已服务区域螺栓数",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: '{a} <br/>{b} : {c}({d}%)'
- },
-
- graphic:{
- type: "text",
- left: "center",
- top: "center",
- style:{
- text: this.total,
- fill: "#fff",
- fontSize: 30,
- fontWeight: 700
- }
- },
- series: [
- {
- name: '服务螺栓数',
- type: 'pie',
-
- radius: [0, '57%'],
- center: ['50%', '50%'],
- roseType: 'area',
- itemStyle: {
- borderRadius: 20
- },
- label: {
- // show: false,
- formatter: '{b} : {c}',
- position: 'outer',
- alignTo: 'labelLine',
- bleedMargin: 5
- },
- data: [
- { value: 40, name: '华北大区' },
- { value: 38, name: '东北大区' },
- { value: 32, name: '西北大区' },
- { value: 30, name: '南部大区' },
- { value: 28, name: '中部大区' },
- { value: 26, name: '内蒙大区' },
- { value: 22, name: '江苏大区' }
-
- ]
- }
- ]
- }
- },
- getBarOptions() {
- return {
- title: {
- text: "已服务螺栓数(按季度)",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- color: ["#3398DB"],
- tooltip: {
- trigger: "axis"
- },
- grid: {
- left: "1%",
-
- bottom: "5%",
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
-
- nameLocation: "end",
- data: this.barTypexAxisData,
- nameTextStyle: {
- color: "#fff"
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- },
- interval: 0,
- rotate: 40
- }
- }
- ],
- yAxis: [
- {
- type: "value",
-
- nameTextStyle: {
- color: "#fff"
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- }
- }
- }
- ],
- series: [
- {
- type: "bar",
- barWidth: "40%",
- data:this.barTypeData,
- showBackground: true,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- },
-
- },
-
-
-
- }
- ]
- };
- },
- getLineOptions() {
- return {
- title: {
- text: "故障新增",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- grid: {
- left: "14%",
- right: "13%",
-
- },
- tooltip: {
- trigger: "axis",
- axisPointer: {
- type: "line"
- },
- padding: [5, 10]
- },
- xAxis: {
- type: "category",
- name: "日期",
- nameLocation: "end",
- data: this.lineAlarmxAxisData,
- nameTextStyle: {
- color: "#fff"
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- fontSize: "10",
- color: "#fff"
- },
-
- rotate: -40
- }
- },
- yAxis: {
-
- nameTextStyle: {
- color: "#fff"
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- }
- }
- },
- series: [
- {
- data: this.lineAlarmData,
- type: "line",
- smooth: true,
- lineStyle: {
- color: "#eab72c"
- },
- itemStyle: {
- color: "#eab72c"
- }
- }
- ]
- };
- },
- getSubRealAlarmBarOptions(){
- return {
- title: {
- text: "告警状态统计(分体)",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- color: ["#3398DB"],
- tooltip: {
- trigger: "axis"
- },
- grid: {
- left: "5%",
- right: "15%",
- bottom: "5%",
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- name: "状态",
- nameLocation: "end",
- data: this.subRealAlarmBarxAxisData,
- nameTextStyle: {
- color: "#fff"
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff",
- fontSize:10
- },
- rotate: -40
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- name: "设备数量",
- nameTextStyle: {
- color: "#fff"
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- }
- }
- }
- ],
- series: [
- {
- type: "bar",
- barWidth: "20%",
- data: this.subRealAlarmBarData,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- }
- }
- }
- ]
- };
- },
- getRealAlarmBarOptions(){
- return {
- title: {
- text: "告警状态统计(主体)",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- color: ["#3398DB"],
- tooltip: {
- trigger: "axis"
- },
- grid: {
- left: "5%",
- right: "15%",
- bottom: "5%",
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
- name: "状态",
- nameLocation: "end",
- data: this.RealAlarmBarxAxisData,
- nameTextStyle: {
- color: "#fff"
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff",
- fontSize:10
- },
- rotate: -40
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- name: "设备数量",
- nameTextStyle: {
- color: "#fff"
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- }
- }
- }
- ],
- series: [
- {
- type: "bar",
- barWidth: "20%",
- data: this.RealAlarmBarData,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- }
- }
- }
- ]
- };
- },
- getPlanBarOptions() {
- return {
- title: {
- text: "校准计划",
- textStyle: {
- fontWeight: "600",
- fontSize: "18",
- color: "#3fd5f1"
- }
- },
- color: ["#3398DB"],
- tooltip: {
- trigger: "axis"
- },
- legend: {
- show: false
- },
- grid: {
- left: "5%",
- right: "10%",
- bottom: "5%",
- containLabel: true
- },
- xAxis: [
- {
- type: "category",
-
- nameLocation: "end",
- data: this.PlanBarxAxisData,
- nameTextStyle: {
- color: "#fff"
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- },
-
- }
- }
- ],
- yAxis: [
- {
- type: "value",
- nameTextStyle: {
- color: "#fff"
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: { color: "#FFF" }
- },
- axisLabel: {
- textStyle: {
- color: "#fff"
- }
- }
- }
- ],
- series: [
- {
- type: "bar",
- name:'实际校准',
- barWidth: "20%",
- data: this.PlanBarData,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- }
- }
- },
- {
- type: "bar",
- name:'计划校准',
- barWidth: "20%",
- data: this.PlanBarData,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- }
- }
- }
-
- ]
- };
- },
- getMapOptions() {
- return {
- // title: {
- // text: "风场位置地图",
- // textStyle: {
- // fontWeight: "600",
- // fontSize: "18",
- // color: "#3fd5f1"
- // }
- // },
- color: ['#dd4444', '#fec42c', '#80F1BE'],
- geo: {
- // 这个是重点配置区
- map: "china",
- label: {
- emphasis: {
- show: true
- }
- },
- roam: false,
- itemStyle: {
- normal: {
- areaColor: "#245baf",
- borderColor: "#FFF"
- },
- emphasis: {
- areaColor: "#33c4f6" //鼠标指上市时的颜色
- }
- }
- },
- // aspectScale: 1.1, //地图的长宽比
- // itemStyle: {
- // borderWidth: 1,
- // borderColor: '#0090fe', //边框颜色
- // areaColor: '#003399', //地图区域颜色
- // shadowColor: '#182f68',
- // shadowOffsetX: 0,
- // shadowOffsetY: 10
- // },
- // emphasis: {
- // itemStyle: {
- // show: 'true',
- // borderWidth: 4,
- // borderColor: '#b2163c', //边框颜色
- // areaColor: '#531f67', //鼠标移上去的颜色
- // },
- // label: {
- // color: '#fff',
- // fontWeight: 'bold',
- // show: true,
- // }
- // },
- //滑动显示数据
- tooltip: {
- trigger: "item",
- formatter:function (params) {
- var res = '';
- // res+=params['data'].name+'</br>';
- res+='风场名称' +' : '+params['name']+'</br>';
- res+='风场位置' +' : '+params['data']['address']+'</br>';
- res+='液压泵数量' +' : '+params['data']['number']+'</br>';
- res+='液压扳手数量' +' : '+params['data']['number']+'</br>';
- return res;
- }
- },
- series: [
- {
- name: "地区",
- type: "scatter",
- coordinateSystem: "geo",
- zlevel: 2,
- label: {
- position: "right",
- show: false
- },
- symbolSize: 10,
- itemStyle: {
- normal: {
- color: "#ddb926"
- }
- },
- data: this.mapData
- },
- {
- name: "测试",
- type: "scatter",
- coordinateSystem: "geo",
- zlevel: 2,
- label: {
- position: "right",
- show: false
- },
- symbolSize: 10,
- itemStyle: {
- normal: {
- color: "red"
- }
- },
- data: this.mapData1
- }
- ]
- };
- },
-
- //地图左上 设备状态数量统计
- // getDeviceStatusCount(){
- // this.$http.get('total/device/statusCount').then(response => {
- // this.deviceStatusData=response.data
- // })
- // },
- //获取地图上设备数据
- getDeviceData() {
- // this.$http.get('preview/getDeviceTotal').then(response => {
- // console.log(response.data);
- let data=[];
- // //设备地址
- // this.mapData =data.addrList
- // this.mapOptions = this.getMapOptions();
- //地图左上 设备状态数量统计
- // this.deviceStatusData=data.statusTotal
- let netState= this.$appConfig.netState;
- let netTotalArr=[];
- for(let i=0;i<netState.length;i++){
- // let netItem={value: data.statusTotal[netState[i].value], name: netState[i].label}
- // netTotalArr.push(netItem)
- }
- // this.netPieData=netTotalArr
- this.netPieOptions = this.getNetPieOptions();
- //左上 设备信号统计
- // this.pieData=data.signalTotal
- this.pieOptions = this.getPieOptions();
- this.pieStateOptions = this.getPieStateOptions();
- this.pieFaultOptions=this.getPieFaultOptions();
- this.pieDeviceOptions=this.getPieDeviceOptions()
- //左中 液压泵设备统计
- // this.barTypeData = data.typeTotal.yAxisData;
- // this.barTypexAxisData=data.typeTotal.xAxisData;
- this.barOptions = this.getBarOptions();
- // })
-
- },
- async getDeviceAddress() {
- var query={start:0,limit:10000}
- var that=this
- await this.$http.get('preview/getDeviceAddressList',{ params: query}).then(response => {
- // console.log(response.data);
- let data=response.data;
- //设备地址
- this.mapData =data.addrList
- this.mapData1 =data.addrList1
- this.mapOptions = this.getMapOptions();
- })
-
- },
- async getDeviceAddressBatch(start,limit) {
- var query={start:start,limit:limit}
- await this.$http.get('preview/getDeviceAddressList',{ params: query}).then(response => {
- let data=response.data;
- this.mapData = this.mapData.concat(data.addrList)
- this.deviceTotal = data.total;
- })
-
- },
- async getAlldeviceListBatch(start,limit){
- var length=Math.ceil(this.deviceTotal/limit)
- if(length<=start){
- return
- }
- for(var i=start;i<length;i++){
- await this.getDeviceAddressBatch(i,limit);
- }
- this.mapOptions = this.getMapOptions();
- },
- //左下 当天告警统计
- getAlarmData(){
- // this.$http.get('preview/alarmTotal').then(response => {
- // console.log(response.data)
- // this.alarm_data=response.data
- // })
-
- },
-
- //右上 月告警统计
- getLineAlarmData(){
- this.$http.get('preview/monthAlarmData').then(response => {
- this.lineAlarmxAxisData=response.data.xAxisData;
- this.lineAlarmData=response.data.yAxisData;
- this.lineOptions = this.getLineOptions();
- })
- },
- //右下 实时告警信息
- getScrollAndAreaData() {
-
- // this.$http.get('preview/realTimeAlarmData').then(response => {
- // let data =response.data
- // this.alarmData =data.scrollData
- this.alarmData=[
- {
- 'title': '设备4012发生故障告警',
- 'date': '2022-03-04 09:40:35'
- },{
- 'title': '设备4014发生故障告警',
- 'date': '2022-03-04 09:49:15'
- },{
- 'title': '设备7812发生故障告警',
- 'date': '2022-03-04 10:08:37'
- },{
- 'title': '设备5812液压油偏低',
- 'date': '2022-03-04 10:10:11'
- },{
- 'title': '设备4542发生故障告警',
- 'date': '2022-03-04 10:20:24'
- },{
- 'title': '设备4781液压油偏低',
- 'date': '2022-03-04 10:29:10'
- },{
- 'title': '设备5421发生故障告警',
- 'date': '2022-03-04 10:37:38'
- },{
- 'title': '设备7574液压油偏低',
- 'date': '2022-03-04 10:40:45'
- },{
- 'title': '设备5457检测不合格',
- 'date': '2022-03-04 10:49:37'
- },{
- 'title': '设备5475发生故障告警',
- 'date': '2022-03-04 10:50:45'
- },{
- 'title': '设备5475发生故障告警',
- 'date': '2022-03-04 10:54:27'
- },{
- 'title': '设备6757液压油偏低',
- 'date': '2022-03-04 11:10:35'
- },{
- 'title': '设备0175液压油偏低',
- 'date': '2022-03-04 11:23:00'
- },
- ]
- //中下 频繁告警区域
- // this.PlanBarData =data.areaData.yAxisData;
- // this.PlanBarxAxisData=data.areaData.xAxisData;
- this.barPlanOptions = this.getPlanBarOptions();
- // })
- },
- //中下 实时告警类型统计
- getrealAlarmTypeTotal(){
- // this.$http.get('preview/realAlarmTypeTotal').then(response => {
- // console.log(response.data)
- // this.barRealtimeAlarmOptions=response.data
- // this.RealAlarmBarData =response.data.yAxisData;
- // this.RealAlarmBarxAxisData=response.data.xAxisData;
- this.barRealtimeAlarmOptions = this.getRealAlarmBarOptions();
- // this.subRealAlarmBarData =response.data.subyAxisData;
- // this.subRealAlarmBarxAxisData=response.data.subxAxisData;
- this.subRealtimeAlarmOptions= this.getSubRealAlarmBarOptions();
- // })
-
- },
-
-
- //获取并格式化时间
- initDate(){
- var tmpDate = new Date(); // 每一秒取一次当前时间
- let wk = tmpDate.getDay()
- //格式化 Date()
- var year = tmpDate.getFullYear();
- var month = ("0" + (tmpDate.getMonth() + 1)).slice(-2)
-
- var date = ("0" + tmpDate.getDate()).slice(-2)
- var h =("0" + tmpDate.getHours()).slice(-2)
- var m =("0" + tmpDate.getMinutes()).slice(-2)
- var s =("0" + tmpDate.getSeconds()).slice(-2)
- let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
- this.nowWeek = weeks[wk]
- return year+'-'+month+'-'+date+ ' '+h+':'+m+':'+s
- },
- initSignalColor(){
- let signal_color = this.$appConfig.signalColor;
- signal_color .forEach((item) => {
- this.signalColor.push(item.color)
- })
- let netStateColor= this.$appConfig.netState;
- netStateColor.forEach((item) => {
- this.netStateColor.push(item.color)
- })
-
- }
- },
- mounted() {
- var that = this;
- var alarmTimer=30000
- var deviceTimer=900000
- //初始化大屏
- //获取地图设备数据时 重新调用获取地图options方法
- this.getDeviceData();
- this.getDeviceAddress();
- //获取设备状态统计数据
- // this.getDeviceStatusCount();
- //获取告警统计
- this.getAlarmData();
- //告警状态统计
- this.getrealAlarmTypeTotal();
- //获取月告警曲线图数据
- this.getLineAlarmData();
- //实时滚动警告信息 频繁告警区域信息
- this.getScrollAndAreaData();
- this.initSignalColor();
- //初始化时间
- this.timer = setInterval(() => {
- that.date = this.initDate()
- }, 1000)
- //获取配置请求时间
- // this.$http.get('preview/getScreenRequestConfig').then(response => {
- // var config=response.data
- // if(config.device_request_interval){
- // deviceTimer=config.device_request_interval*1000
- // }
- // if(config.alarm_request_interval){
- // alarmTimer=config.alarm_request_interval*1000
- // }
- // this.timer1 = setInterval(() => {
- // this.getScrollAndAreaData();
- // this.getAlarmData();
- // this.getrealAlarmTypeTotal();
-
- // }, alarmTimer)
- // this.timer2 = setInterval(() => {
- // this.getDeviceData();
- // this.mapData=[];
- // this.getAlldeviceListBatch(0,10000);
- // this.getLineAlarmData();
- // }, deviceTimer)
- // })
-
- },
- beforeDestroy() {
- if (this.timer) {
- clearInterval(this.timer); // 在Vue实例销毁前,清除我们的定时器
- }
- if (this.timer1) {
- clearInterval(this.timer1); // 在Vue实例销毁前,清除我们的定时器
- }
- if (this.timer2) {
- clearInterval(this.timer2); // 在Vue实例销毁前,清除我们的定时器
- }
- }
- }
- </script>
- <style scoped>
- #content{
- width:100%;
- min-width: 1280px;
- height: calc(60vw - 84px);
- /* height: 100vh; */
- min-height: calc(100vh - 84px);
- background-image: url("../../assets/screen/bg_body.png");
- background-position-x: initial;
- background-position-y: initial;
- background-size: 100% 100%;
- background-attachment: initial;
- background-origin: initial;
- background-clip: initial;
- background-color: initial;
- }
- ::v-deep .el-carousel{
- width:100%;
- height:100%;
- }
- ::v-deep .el-carousel__container{
- width:100%;
- height:100%;
- }
- ::v-deep .el-carousel__item h3 {
- color: #475669;
- font-size: 18px;
- opacity: 0.75;
- line-height: 100%;
- margin: 0;
- }
-
- ::v-deep .el-carousel__item:nth-child(2n) {
-
- background-image: url("../../assets/screen/bg_body.png");
- background-position-x: initial;
- background-position-y: initial;
- background-size: 100% 100%;
- background-attachment: initial;
- background-origin: initial;
- background-clip: initial;
- background-color: initial;
- }
-
- ::v-deep .el-carousel__item:nth-child(2n+1) {
-
- background-image: url("../../assets/screen/bg_body.png");
- background-position-x: initial;
- background-position-y: initial;
- background-size: 100% 100%;
- background-attachment: initial;
- background-origin: initial;
- background-clip: initial;
- background-color: initial;
- }
- ::v-deep .el-carousel__indicators{
- display: none;
- }
- ::v-deep .el-carousel__arrow{
- display: none;
- }
- </style>
|