1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525 |
- <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'
- :pieRightOptions='pieRightOptions'
- :pieCenterOptions='pieCenterOptions'
- :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: [],//地图数据
- mapData2: [],//地图数据
- alarmData: [],//实时告警数据
- PlanBarxAxisData:['1月','2月','3月','4月','5月','6月','7月'],//频繁告警区域X轴
- PlanBarData: [70,42,28,23,45,23,52],//频繁告警区域数据
- // fengxAxisData:['总数','在线','异常'],//液压泵设备统计X轴
- fengTypeData:[
- {
- 'value': 150,
- 'name': '新增'
- }, {
- 'value': 37,
- 'name': '异常'
- },
- ],//井类型数据
- barTypexAxisData:['一季度','二季度','三季度','四季度'],//液压泵设备统计X轴
- barTypeData:[100,76,24,20],//井类型数据
- lineAlarmxAxisData:[],//月告警曲线图X轴
- lineAlarmData:[],//月告警曲线图数据
- deviceStatusData:[],//设备状态统计数据
- pieOptions: {},
- pieStateOptions:{},
- pieFaultOptions:{},
- pieRightOptions:{},
- pieCenterOptions:{},
- 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: '故障设备',
- 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:'中空液压扳手'},
-
- ]
-
- }
- ]
-
- };
- },
- getpieRightOptions(){
- return {
- tooltip: {
- show: false,
- trigger: 'item',
- formatter: "{a} : {c} ({d}%)"
- },
- legend: {
- show:false
- },
- // color: ['#546570', '#c4ccd3'],
- // color: ['rgb(255,159,127)', 'rgb(50,197,233)'],
- // legend: {
- // orient: 'vertical',
- // x: '35%',
- // top: '27%',
- // itemHeight: 10,//图例的高度
- // itemGap: 8,//图例之间的间距
- // data: ['通过率' + pass_rate + '%', '平均值' + average + '%']
- // //图例的名字需要和饼图的name一致,才会显示图例
- // },
- title: {
- text: 80+ '%', //图形标题,配置在中间对应效果图的80%
- left: "center",
- top: "50%",
- textStyle: {
- color: "rgb(50,197,233)",
- fontSize: 16,
- align: "center"
- }
- },
- series: [
- {
- type: 'pie',
- radius: ['70%', '90%'], //设置内外环半径,两者差值越大,环越粗
- hoverAnimation: false, //移入图形是否放大
- label: { //对应效果图中的Angular显示与否以及设置样式
- // show: true,
- // position: 'center',
- normal: {
- show: true,
- position: 'center',
- padding: [0, 0, 20, 0], //设置字angular的边距
- fontSize: 16,
- }
- },
- labelLine: {
- normal: { //label线不显示
- show: false
- }
- },
- // emphasis: { //鼠标移入时效果
- // label: {
- // show: false,
- // fontSize: '20',
- // fontWeight: 'bold'
- // }
- // },
- data: [
- {
- name: '良好', //数据,name对应Angular
- value: 80, //对应显示的部分数据即80%
- itemStyle: {
- normal: {
- color: 'rgb(50,197,233)',
- }
- }
- },
- {
- value: 20,
- itemStyle: {
- normal: {
- color: 'transparent'
- }
- }
- }
- ]
- }
- ]
- };
- },
- getpieCenterOptions(){
- return {
- tooltip: {
- show: false,
- trigger: 'item',
- formatter: "{a} : {c} ({d}%)"
- },
- legend: {
- show:false
- },
- // color: ['#546570', '#c4ccd3'],
- // color: ['rgb(255,159,127)', 'rgb(50,197,233)'],
- // legend: {
- // orient: 'vertical',
- // x: '35%',
- // top: '27%',
- // itemHeight: 10,//图例的高度
- // itemGap: 8,//图例之间的间距
- // data: ['通过率' + pass_rate + '%', '平均值' + average + '%']
- // //图例的名字需要和饼图的name一致,才会显示图例
- // },
- title: {
- text: 70+ '%', //图形标题,配置在中间对应效果图的80%
- left: "center",
- top: "50%",
- textStyle: {
- color: "green",
- fontSize: 16,
- align: "center"
- }
- },
- series: [
- {
- type: 'pie',
- radius: ['70%', '90%'], //设置内外环半径,两者差值越大,环越粗
- hoverAnimation: false, //移入图形是否放大
- label: { //对应效果图中的Angular显示与否以及设置样式
- // show: true,
- // position: 'center',
- normal: {
- show: true,
- position: 'center',
- padding: [0, 0, 20, 0], //设置字angular的边距
- fontSize: 16,
- }
- },
- labelLine: {
- normal: { //label线不显示
- show: false
- }
- },
- // emphasis: { //鼠标移入时效果
- // label: {
- // show: false,
- // fontSize: '20',
- // fontWeight: 'bold'
- // }
- // },
- data: [
- {
- name: '良好', //数据,name对应Angular
- value: 70, //对应显示的部分数据即80%
- itemStyle: {
- normal: {
- color: 'green',
- }
- }
- },
- {
- value: 30,
- itemStyle: {
- normal: {
- color: 'transparent'
- }
- }
- }
- ]
- }
- ]
- };
- },
- 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: '故障代码',
- 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 {
- color: ['green','red','yellow'],
- tooltip: {
- trigger: 'item'
- },
- legend: {
- show:false
- },
- series: [
- {
- name: '校准状态',
- type: 'pie',
- radius: ['0', '90%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- position: 'inner', // 数值显示在内部
- color:'#32c5e9',
- 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: false, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: "white",
- fontSize: 12
- }
- }
- }
- }
- },
- {
- type: "bar",
- name:'计划校准',
- barWidth: "20%",
- data: this.PlanBarData,
- itemStyle: {
- normal: {
- label: {
- show: false, //开启显示
- 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: "yellow"
- }
- },
- data: this.mapData
- },
- {
- name: "静止状态",
- type: "scatter",
- coordinateSystem: "geo",
- zlevel: 2,
- label: {
- position: "right",
- show: false
- },
- symbolSize: 10,
- itemStyle: {
- normal: {
- color: "red"
- }
- },
- data: this.mapData1
- },
- {
- name: "当天使用",
- type: "scatter",
- coordinateSystem: "geo",
- zlevel: 2,
- label: {
- position: "right",
- show: false
- },
- symbolSize: 10,
- itemStyle: {
- normal: {
- color: "green"
- }
- },
- data: this.mapData2
- }
- ]
- };
- },
-
- //地图左上 设备状态数量统计
- // 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.pieCenterOptions=this.getpieCenterOptions()
- this.pieRightOptions=this.getpieRightOptions()
- 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.mapData2 =data.addrList2
- 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=[
- {
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- }
- ,{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- },{
- 'date': '2022-03-04 09:40:35',
- 'name': '测试设备',
- 'number': '000001',
- 'result': '正常',
- }
- ]
- //中下 频繁告警区域
- // 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>
|