12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103 |
- <template>
- <div style="width:100%;height:100%;background-color:rgb(0, 9, 40)">
- <mapdiv ref="mapv" :deviceList='deviceList'></mapdiv>
- <div class="shipInCount">
- <img src="@/assets/picture/img_wgcb.png" style="margin-top:5rem;margin-left:5rem"/>
- <div style="margin-top:5rem" @click="dialogVisibleShip = true">
- <div style="float:left">
- <div class="lcbBackground">
- <div style="margin-top:12rem">
- {{ so2Count }}
- <br/>
- <span style="font-size:5rem">艘</span>
- </div>
- </div>
- <div style="text-align: center;color: #ffffff;margin-left:14rem;margin-top:43rem">硫含量超标</div>
- </div>
- <div style="float:left">
- <div class="hyzpBackground">
- <div style="margin-top:12rem">
- {{ blackCount }}
- <br/>
- <span style="font-size:5rem">艘</span>
- </div>
- </div>
- <div style="text-align: center;color: #ffffff;margin-left:7rem;margin-top:43rem">黑烟抓拍</div>
- </div>
- </div>
- <img src="@/assets/picture/img_sbtj.png" style="margin-top:5rem;margin-left:5rem"/>
- <div class="totalContent" style="padding-right:15rem">
- <div style="float:left;margin-top:3rem">
- <i class="el-icon-pie-chart" style="font-size:9rem;float:left;margin-left:5rem"/>
- <span style="font-size:6rem;float:left;margin-left:5rem">总数</span>
- </div>
- <div style="float:right;font-size:9rem;margin-top:1rem">{{ deviceTotal }}个</div>
- </div>
- <div style="padding-left:5rem;padding-top:1rem">
- <div style="color:white" @click="dialogVisible = true">
- <div style="float:left"><img src="@/assets/picture/location.png" style="margin-left:5rem"/></div>
- <div style="float:left;background-image: linear-gradient(transparent 90%,white);font-size:6rem;margin-top:14rem">安装位置</div>
- </div>
- <div style="color:white" @click="dialogVisibleType = true">
- <div style="float:left"><img src="@/assets/picture/device_type.png" style="margin-left:5rem"/></div>
- <div style="float:left;background-image: linear-gradient(transparent 90%,white);font-size:6rem;margin-top:14rem">设备类型</div>
- </div>
- </div>
- </div>
- <div class="shipInformation">
- <img src="@/assets/picture/img_xycbxx.png" style="margin-top:5rem;margin-left:5rem"/>
- <scroll illegalStatus=2></scroll>
- <img src="@/assets/picture/img_wgcbxx.png" style="margin-top:5rem;margin-left:5rem"/>
- <scroll illegalStatus=3></scroll>
- </div>
- <div class="equipmentContent">
- <el-dialog
- title=""
- :visible.sync="dialogVisible"
- @open="openChart">
- <div id="equipmentChart" style="width:260rem;height:100rem"></div>
- </el-dialog>
- </div>
- <div class="equipmentTypeContent">
- <el-dialog
- title=""
- :visible.sync="dialogVisibleType"
- @open="openTypeChart">
- <div id="equipmentTypeChart" style="width:160rem;height:100rem"></div>
- </el-dialog>
- </div>
- <div class="wfcbContent">
- <el-dialog
- title=""
- :visible.sync="dialogVisibleShip"
- @open="openShipChart">
- <div style="position:absolute;z-index:3001">
- <div style="float:left;color:#ffffff">开始</div>
- <div style="float:left;margin-left:3rem;width: 55rem;">
- <el-date-picker
- @change='getSo2Time'
- value-format='yyyy-MM'
- v-model="shipDate.startMonth"
- :picker-options="startMonth"
- size="small"
- type="month"
- placeholder="选择月份">
- </el-date-picker>
- </div>
- <div style="float:left;margin-left:3rem;color:#ffffff">结束</div>
- <div style="float:left;margin-left:3rem;width: 55rem;">
- <el-date-picker
- v-model="shipDate.endMonth"
- :picker-options="endMonth"
- size="small"
- @change='getSo2Time'
- value-format='yyyy-MM'
- type="month"
- placeholder="选择月份">
- </el-date-picker>
- </div>
- </div>
- <div id="shipChart" style="width:280rem;height:120rem;position:absolute;z-index:3000"></div>
- </el-dialog>
- </div>
- <!--
- <div class="azwzContent">
- <el-dialog
- title=""
- :visible.sync="dialogVisibleAzwz"
- :before-close="handleClose"
- @open="openShipChart">
- <div id="shipChart" style="width:220rem;height:100rem;"></div>
- </el-dialog>
- </div> -->
- </div>
- </template>
- <script>
- import scroll from "./scroll.vue"
- import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice} from "@/api/data/staticalData";
- import {getdeviceList, queryallShipData, queryShipData} from "@/api/data/deviceData";
- import mapdiv from '../../../components/map/index.vue'
- import {getThresholdList} from "@/api/data/liuData";
- export default {
- name: "homeTable",
- components: {
- scroll,
- mapdiv
- },
- data() {
- return {
- total: 100,
- shipShow: true,
- activeName: 'first',
- normalPer: 0.1,
- so2Count: 0,
- blackCount: 0,
- dialogVisible: false,
- dialogVisibleAzwz: false,
- dialogVisibleType: false,
- normalCount: 1,
- reqcount: 0,
- dialogVisibleShip: false,
- beginTime: '',
- lastdatep: 0,
- isstart: false,
- so2TimeData: {},
- endTime: '',
- deviceList: [],
- deviceTotal: 0,
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- roleName: undefined,
- roleKey: undefined,
- status: undefined,
- mmsi: undefined,
- radio: 1
- },
- tableData: [],
- shipDate: {
- startMonth: '',
- endMonth: ''
- },
- shipDateArry: [],
- heyDeviceData: [
- {"name": "南京三桥黑烟1", "locations": [[118.643133, 31.969894]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
- {"name": "南京三桥黑烟2", "locations": [[118.642232, 31.970804]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
- {"name": "南京三桥黑烟3", "locations": [[118.6503, 31.965016]]},
- {"name": "南京三桥黑烟4", "locations": [[118.638434, 31.973189]]},
- {"name": "南京三桥黑烟5", "locations": [[118.643283, 31.970076]]},
- {"name": "南京三桥黑烟6", "locations": [[118.647403, 31.967309]]},
- {"name": "苏通大桥黑烟1", "locations": [[121.001581, 31.78503]]},
- {"name": "苏通大桥黑烟2", "locations": [[120.997083, 31.76303]]},
- {"name": "苏通大桥黑烟3", "locations": [[120.998929, 31.771094]]},
- {"name": "苏通大桥黑烟4", "locations": [[121.002491, 31.791012]]},
- {"name": "江阴大桥黑烟1", "locations": [[120.27317, 31.945522]]},
- {"name": "江阴大桥黑烟2", "locations": [[120.274763, 31.942572]]},
- {"name": "润扬大桥黑烟1", "locations": [[119.366033, 32.210959]]},
- {"name": "润扬大桥黑烟2", "locations": [[119.370324, 32.202425]]},
- ],
- so2DeviceData: [
- {"name": "南京三桥嗅探1", "locations": [[118.640237, 31.971992]]},
- {"name": "南京三桥嗅探2", "locations": [[118.647447, 31.967359]]},
- {"name": "南京三桥嗅探3", "locations": [[118.641632, 31.971064]]},
- {"name": "苏通大桥嗅探1", "locations": [[121.003306, 31.792982]]},
- {"name": "苏通大桥嗅探2", "locations": [[120.999529, 31.775326]]},
- {"name": "江阴大桥嗅探1", "locations": [[120.272167, 31.947384]]},
- {"name": "江阴大桥嗅探2", "locations": [[120.274441, 31.943087]]},
- {"name": "润扬大桥嗅探1", "locations": [[119.367277, 32.209071]]},
- {"name": "润扬大桥嗅探2", "locations": [[119.369466, 32.204568]]},
- ],
- aisDeviceData: [
- {"name": "南京三桥光谱1", "locations": [[118.642876, 31.970445]]},
- {"name": "南京三桥光谱2", "locations": [[118.648949, 31.966386]]},
- {"name": "南京三桥光谱3", "locations": [[118.651223, 31.964747]]},
- {"name": "苏通大桥光谱1", "locations": [[121.003134, 31.789772]]},
- {"name": "苏通大桥光谱2", "locations": [[120.997985, 31.762921]]},
- {"name": "江阴大桥光谱1", "locations": [[120.272044, 31.947069]]},
- {"name": "江阴大桥光谱2", "locations": [[120.276078, 31.940587]]},
- {"name": "润扬大桥光谱1", "locations": [[119.367235, 32.209107]]},
- {"name": "润扬大桥光谱2", "locations": [[119.369724, 32.204459]]},
- ],
- allship: [],
- ship: [],
- ship1: [
- {"name": "一号船", "mmsi": "s", "locations": [[118.643133, 31.969894]], 'type': 1, "head": 0, "lnglats": [[118.649711, 31.98602], [118.639711, 31.98602], [118.629711, 31.98602], [118.619711, 31.98602]]},
- // {"name": "二号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":60},
- {"name": "三号船", "mmsi": "s1", "locations": [[118.639711, 31.96622]], 'type': 1, "head": 90},
- {"name": "三号船", "mmsi": "s2", "locations": [[118.639711, 31.93662]], 'type': 1, "head": 180},
- // {"name": "四号船", "locations": [[118.639711, 31.96602]], 'type': 3,"head":180},
- // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":270},
- // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":360},
- ],
- startMonth: {
- disabledDate: time => {
- if (this.shipDate.endMonth) {
- return (
- time.getTime() > new Date(this.shipDate.endMonth).getTime() || time.getTime() < new Date('2021-06-01').getTime()
- );
- } else {
- return time.getTime() > Date.now() || time.getTime() < new Date('2021-06-01').getTime();
- }
- }
- },
- endMonth: {
- disabledDate: time => {
- if (this.shipDate.startMonth) {
- return (
- time.getTime() > Date.now() ||
- time.getTime() < new Date(this.shipDate.startMonth).getTime() - 86400000 ||
- time.getTime() < new Date('2021-06-01').getTime()
- );
- } else {
- return time.getTime() > Date.now() || time.getTime() < new Date('2021-06-01').getTime();
- }
- }
- }
- }
- }, mounted() {
- this.getMonthDate();
- this.getdeviceList();
- this.getStaticDevice();
- this.getIllegalShipStatic();
- this.getshipData();
- // this.getallshipData();
- var that = this;
- setInterval(() => {
- that.getshipData();
- }, 120000);
- setInterval(() => {
- if (that.isstart) {
- that.getallshipData();
- }
- }, 5 * 60 * 1000);
- setInterval(() => {
- if (that.reqcount > 0) {
- that.lastdatep = new Date().valueOf() - 11000;
- that.getallshipData();
- }
- }, 5000);
- this.getThresholdList();
- // this.addDevicePoint();
- // this.addAisPoint();
- // this.addSo2Point();
- // this.addshipPoint();
- // console.log(111111111111)
- // this.getChart();
- },
- methods: {
- clickship(shipdata) {
- if (shipdata != null && shipdata != undefined) {
- var ship = shipdata;
- // ship["shipName"] = ship.shipname_cn;
- ship["locations"] = [[ship.lng, ship.lat]];
- ship["type"] = 1;
- ship["speed"] = ship.speed == null ? '-' : ship.speed;
- ship["head"] = ship.head == null ? '-' : ship.head;
- ship["course"] = ship.course == null ? '-' : ship.course;
- // ship["monitorPointName"] = '-';
- for (var i in this.ship) {
- var obj = this.ship[i];
- obj["isc"] = "2";
- }
- var obj = ship;
- obj["isc"] = "1";
- var isin = false;
- for (var i in this.ship) {
- if (this.ship[i]["mmsi"] == obj["mmsi"]) {
- this.ship[i] = obj;
- isin = true;
- break;
- }
- }
- if (!isin) {
- this.ship.push(obj);
- }
- this.addshipPoint();
- this.$refs.mapv.map.getView().setCenter(this.$refs.mapv.transpoints(obj["locations"], 0)[0]);
- this.$refs.mapv.map.getView().setZoom(16);
- this.$refs.mapv.shipShow = true;
- this.$refs.mapv.deviceShow = false;
- this.$refs.mapv.deviceTableShow = false
- this.$refs.mapv.shipName = obj;
- this.$refs.mapv.activeName = "first";
- }
- },
- stopgetall() {
- this.isstart = false;
- },
- startgetall() {
- this.isstart = true;
- this.getallshipData();
- },
- getThresholdList() {
- getThresholdList({type: 'bridge'}).then(response => {
- // console.log(response);
- for (var index in response.rows) {
- var obj = response.rows[index];
- var points = '[' + obj.configValue + ']';
- // console.log(JSON.parse(points));
- this.$refs.mapv.addline(JSON.parse(points));
- }
- });
- },
- getdeviceList() {
- var dlist = [];
- getdeviceList().then(data => {
- // console.log(data);
- var deviceList = [];
- this.deviceList = data.data;
- for (var key in data.data) {
- if (data.data[key] != undefined && data.data[key].length > 0) {
- dlist.push({name: key, location: JSON.parse("[[" + data.data[key][0].latilongti + "]]")});
- this.$refs.mapv.setaddrlist(dlist);
- }
- for (var index in data.data[key]) {
- var obj = data.data[key][index]
- // console.log(data.data[key][index].source);
- // deviceList.push(data.data[key][index]);
- var locationArry = JSON.parse("[[" + obj.latilongti + "]]");
- var icons = "";
- if (obj.source.indexOf("so2") != -1) {
- icons = "so2.png"
- }
- if (obj.source.indexOf("ais") != -1) {
- icons = "ais.png"
- }
- if (obj.source.indexOf("heiyan") != -1) {
- icons = "hy.png"
- }
- this.$refs.mapv.addpoint(locationArry, obj, icons, 'device');
- }
- }
- // console.log(deviceList);
- });
- },
- getshipData() {
- // for(var i=0;i<10000;i++){
- // this.ship.push( {"name": "三号船", "mmsi": "s1"+i, "locations": [[118.639711+i%10/5, 31.96622-i%10/5]], 'type': 1, "head": 90},)
- // }
- queryShipData().then(data => {
- var shipdatalist = [];
- for (var key in data.data) {
- var ship = data.data[key];
- ship["name"] = ship.shipName;
- ship["locations"] = [[ship.lng, ship.lat]];
- ship["type"] = ship.illegalStatus;
- shipdatalist.push(ship);
- }
- this.ship = shipdatalist;
- this.addshipPoint();
- });
- },
- getallshipData() {
- if (!this.isstart) return;
- var cdatep = new Date().valueOf();
- if (cdatep - this.lastdatep > 10000) {
- this.reqcount = 0;
- this.lastdatep = cdatep;
- } else {
- this.reqcount++;
- return;
- }
- // this.allship = this.ship1;
- // for (let i = 0; i < 100000; i++) {
- // let ran = Math.random() * 360;
- // let ran2 = Math.random() * 360;
- // let lon = -180 + ran;
- // let lat = -90 + ran2;
- // this.allship.push({"name": "三号船", "mmsi": "s2", "locations": [[lon, lat]], 'type': 1, "head": 180})
- // // let feature = new Feature({
- // // geometry: new Point([lon, lat])
- // // })
- // // features.push(feature);
- // }
- // this.addshipPointall();
- // console.log( this.$refs.mapv.map.getView().calculateExtent( this.$refs.mapv.map.getSize()));
- var sc = window.getmapviewlatlng();
- var urlc = `areaLatitude1=${sc[0][1]}&areaLatitude2=${sc[1][1]}&areaLongitude1=${sc[0][0]}&areaLongitude2=${sc[1][0]}`;
- queryallShipData({}, urlc).then(data => {
- if (!this.isstart) return;
- var shipdatalist = [];
- for (var key in data.data) {
- var ship = data.data[key];
- ship["shipName"] = ship.shipname_cn;
- ship["locations"] = [[ship.lng, ship.lat]];
- ship["type"] = 1;
- ship["speed"] = ship.speed == null ? '-' : ship.speed;
- ship["head"] = ship.head == null ? '-' : ship.head;
- ship["course"] = ship.course == null ? '-' : ship.course;
- ship["monitorPointName"] = '-';
- shipdatalist.push(ship);
- }
- // this.allship = this.ship1;
- this.allship = shipdatalist;
- this.addshipPointall();
- });
- },
- // addDevicePoint(){
- // for(var index in this.heyDeviceData){
- // var obj = this.heyDeviceData[index]
- // this.$refs.mapv.addpoint(obj.locations,obj.name,'hy.png','device');
- // }
- // },
- // addAisPoint(){
- // for(var index in this.aisDeviceData){
- // var obj = this.aisDeviceData[index]
- // this.$refs.mapv.addpoint(obj.locations,obj.name,'ais.png','device');
- // }
- // },
- // addSo2Point(){
- // for(var index in this.so2DeviceData){
- // var obj = this.so2DeviceData[index]
- // this.$refs.mapv.addpoint(obj.locations,obj.name,'so2.png','device');
- // }
- // },
- addshipPoint() {
- var tt = [];
- for (var index in this.ship) {
- var obj = this.ship[index]
- var img = 'zc.png'
- if (obj.type == 2) {
- img = 'xy.png'
- } else if (obj.type == 3) {
- img = 'wg.png'
- }
- if (obj["isc"] == "1") {
- img = 'xz.png'
- }
- tt.push([obj.locations, obj, img, 'ship', ((obj.head == null ? 0 : parseFloat(obj.head)) - 90) * Math.PI / 180, 1]);
- }
- this.$refs.mapv.addpoints(tt, "ship");
- },
- addshipPointall() {
- var tt = [];
- for (var index in this.allship) {
- var obj = this.allship[index]
- var img = 'zc.png'
- if (obj.type == 2) {
- img = 'xy.png'
- } else if (obj.type == 3) {
- img = 'wg.png'
- }
- tt.push([obj.locations, obj, img, 'ship', ((obj.head == null ? 0 : parseFloat(obj.head)) - 90) * Math.PI / 180, 1, "ship_normal_"]);
- }
- this.$refs.mapv.addpoints(tt)
- },
- getSo2Time() {
- // console.log(111);
- getSo2Time(this.shipDate).then(data => {
- this.getMonthArry(this.shipDate.startMonth, this.shipDate.endMonth);
- this.so2TimeData = data.data
- this.getShipChart();
- });
- },
- getMonthArry(start, end) {
- this.shipDateArry = [];
- var startYear = start.split('-')[0];
- var startMonth = parseInt(start.split('-')[1]);
- var endYear = end.split('-')[0];
- var endMonth = parseInt(end.split('-')[1]);
- if (startYear == endYear) {
- for (var i = startMonth; i < endMonth + 1; i++) {
- if (i < 10) {
- this.shipDateArry.push(startYear + '-' + "0" + i);
- } else {
- this.shipDateArry.push(startYear + '-' + i);
- }
- }
- } else {
- for (var i = startMonth; i < 13; i++) {
- if (i < 10) {
- this.shipDateArry.push(startYear + '-' + "0" + i);
- } else {
- this.shipDateArry.push(startYear + '-' + i);
- }
- }
- for (var i = 1; i < endMonth; i++) {
- if (i < 10) {
- this.shipDateArry.push(endYear + '-' + "0" + i);
- } else {
- this.shipDateArry.push(endYear + '-' + i);
- }
- }
- }
- // console.log(this.shipDateArry);
- },
- getMonthDate() {
- var time = new Date();
- var year = time.getFullYear();
- var month = time.getMonth() + 1;
- if (month > 9) {
- this.shipDate.endMonth = year + "-" + month
- } else if (month > 0) {
- this.shipDate.endMonth = year + "-" + "0" + month
- } else {
- this.shipDate.endMonth = (year - 1) + "-" + '12';
- }
- if (month == 6) {
- this.shipDate.startMonth = year + "-" + '01';
- } else if (month > 6) {
- this.shipDate.startMonth = year + "-" + '0' + (month - 6);
- } else if (month < 6) {
- if (month >= 3) {
- this.shipDate.startMonth = (year - 1) + "-" + (month + 7);
- } else {
- this.shipDate.startMonth = (year - 1) + "-" + "0" + (month + 7);
- }
- }
- },
- openShipChart() {
- const t = this;
- setTimeout(() => {
- // 执行echarts画图方法
- t.getSo2Time();
- }, 0);
- },
- handleClick(tab, event) {
- // console.log(tab, event);
- },
- openChart() {
- const t = this;
- setTimeout(() => {
- // 执行echarts画图方法
- t.getStaticDevice();
- }, 0);
- },
- openTypeChart() {
- const t = this;
- setTimeout(() => {
- // 执行echarts画图方法
- t.getTypeData();
- }, 0);
- },
- getStaticDevice() {
- getStaticDevice().then(response => {
- let nameArry = [];
- let dataArry = [];
- this.deviceTotal = 0;
- for (var key in response.data) {
- this.deviceTotal += response.data[key]
- nameArry.push(key);
- dataArry.push(response.data[key]);
- }
- this.getChart(nameArry, dataArry);
- });
- },
- getIllegalShipStatic() {
- getIllegalShipStatic().then(data => {
- this.blackCount = data.data.blackCount;
- this.so2Count = data.data.so2Count;
- });
- },
- getShipChart() {
- var so2Arry = [];
- var aisArry = [];
- var hyArry = [];
- // console.log(data);
- for (var index in this.shipDateArry) {
- // console.log(this.shipDateArry[index]+'-01T00:00:00Z');
- // console.log(this.so2TimeData.so2['2021-01-01T00:00:00Z']);
- if (this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']) {
- so2Arry.push(this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']);
- } else {
- so2Arry.push(0);
- }
- if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
- aisArry.push(this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']);
- } else {
- aisArry.push(0);
- }
- if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
- hyArry.push(this.so2TimeData.black[this.shipDateArry[index] + '-01T00:00:00Z']);
- } else {
- hyArry.push(0);
- }
- }
- var myChart = this.$echarts.init(document.getElementById('shipChart'));
- var option = {
- color: ['#FF2D3C', '#FFA647', '#61FAFB'],
- legend: {
- data: ['黑烟抓拍', '光谱', '嗅探'],
- right: '10%',
- textStyle: {
- color: '#ffffff'
- }
- },
- xAxis: {
- type: 'category',
- data: this.shipDateArry,
- axisLabel: {
- show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
- interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
- rotate: "45",
- textStyle: { //textStyle里面写x轴下的字体的样式
- color: '#ffffff',
- fontSize: 13
- }
- },
- axisLine: {
- show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
- lineStyle: { //lineStyle里面写x轴那一条线的样式
- color: '#ffffff',
- width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
- }
- }
- },
- yAxis: {
- type: 'value',
- axisLabel: {
- show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
- interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
- textStyle: { //textStyle里面写x轴下的字体的样式
- color: '#ffffff',
- fontSize: 13
- }
- },
- axisLine: {
- show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
- lineStyle: { //lineStyle里面写x轴那一条线的样式
- color: '#ffffff',
- width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
- }
- }
- },
- series: [{
- name: '黑烟抓拍',
- data: hyArry,
- type: 'line',
- smooth: true,
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#FF2D3C',
- width: 5
- }
- }
- },
- }, {
- name: '光谱',
- data: so2Arry,
- type: 'line',
- smooth: true,
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#FFA647',
- width: 5
- }
- }
- },
- }, {
- name: '嗅探',
- data: aisArry,
- type: 'line',
- smooth: true,
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#61FAFB',
- width: 5
- }
- }
- },
- }]
- };
- myChart.setOption(option);
- },
- getChart(nameArry, dataArry) {
- var myChart = this.$echarts.init(document.getElementById('equipmentChart'));
- var option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: nameArry,
- axisTick: {
- alignWithLabel: true
- },
- axisLine: {
- lineStyle: {
- color: 'white'
- }
- },
- axisLabel: {
- interval: 0,
- show: true,
- textStyle: {
- color: 'white' //x轴data 的颜色
- }
- },
- },
- ],
- yAxis: [
- {
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: ['#435886'],
- width: 1,
- type: 'solid'
- }
- },
- axisLine: {
- lineStyle: {
- color: '#435886'
- }
- },
- axisLabel: {
- interval: 0,
- show: true,
- textStyle: {
- color: 'white' //x轴data 的颜色
- }
- },
- }
- ],
- series: [
- {
- name: '数量',
- type: 'bar',
- barWidth: '30%',
- data: dataArry,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: 'white',
- fontSize: 10
- }
- },
- color: new this.$echarts.graphic.LinearGradient(
- 0, 0, 0, 1,
- [
- {offset: 1, color: '#2275E4'}, //柱图渐变色
- {offset: 0, color: '#56CCF2'}, //柱图渐变色
- ]
- )
- },
- }
- }
- ]
- };
- myChart.setOption(option);
- },
- getTypeData() {
- getDeviceType().then(response => {
- let nameArry = [];
- let dataArry = [];
- for (var key in response.data) {
- nameArry.push(key);
- dataArry.push(response.data[key]);
- }
- this.getTypeChart(nameArry, dataArry);
- });
- },
- getTypeChart(nameArry, dataArry) {
- // this.dialogVisible = true;
- var myChart = this.$echarts.init(document.getElementById('equipmentTypeChart'));
- var option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: nameArry,
- axisTick: {
- alignWithLabel: true
- },
- axisLine: {
- lineStyle: {
- color: 'white'
- }
- },
- axisLabel: {
- interval: 0,
- show: true,
- textStyle: {
- color: 'white' //x轴data 的颜色
- }
- },
- },
- ],
- yAxis: [
- {
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: ['#435886'],
- width: 1,
- type: 'solid'
- }
- },
- axisLine: {
- lineStyle: {
- color: '#435886'
- }
- },
- axisLabel: {
- interval: 0,
- show: true,
- textStyle: {
- color: 'white' //x轴data 的颜色
- }
- },
- }
- ],
- series: [
- {
- name: '数量',
- type: 'bar',
- barWidth: '30%',
- data: dataArry,
- itemStyle: {
- normal: {
- label: {
- show: true, //开启显示
- position: 'top', //在上方显示
- textStyle: { //数值样式
- color: 'white',
- fontSize: 10
- }
- },
- color: new this.$echarts.graphic.LinearGradient(
- 0, 0, 0, 1,
- [
- {offset: 1, color: '#2275E4'}, //柱图渐变色
- {offset: 0, color: '#56CCF2'}, //柱图渐变色
- ]
- )
- },
- }
- }
- ]
- };
- myChart.setOption(option);
- var that = this;
- myChart.on('click', function (params) {
- if (params.name == "黑烟") {
- that.$parent.showTable = 9;
- }
- if (params.name == "光谱") {
- that.$parent.showTable = 10;
- }
- if (params.name == "嗅探") {
- that.$parent.showTable = 11;
- }
- });
- }
- }
- }
- </script>
- <style scoped>
- .shipDiv {
- position: absolute;
- top: 250rem;
- left: 140rem;
- width: 220rem;
- height: 130rem;
- background-color: white;
- }
- .shipTitle {
- padding-top: 4rem;
- padding-left: 10rem;
- padding-right: 10rem;
- width: 100%;
- height: 20rem;
- background-color: #0d25a5;
- color: white;
- font-size: 7rem
- }
- .contentFont {
- font-size: 5rem;
- }
- .shipInformation {
- background: url("./assets/bg_information.png") no-repeat;
- background-size: 100% 100%;
- width: 120rem;
- height: 160rem;
- position: absolute;
- top: 225rem;
- right: 30rem;
- }
- .shipInCount {
- background: url("./assets/bg_count.png") no-repeat;
- background-size: 100% 100%;
- width: 120rem;
- height: 160rem;
- position: absolute;
- top: 55rem;
- right: 30rem;
- }
- .lcbBackground {
- background: url("./assets/img_lcb.png") no-repeat;
- background-size: 100% 100%;
- width: 40rem;
- height: 40rem;
- float: left;
- margin-left: 15rem;
- text-align: center;
- color: #45AAF0;
- font-size: 7rem;
- font-weight: Bold;
- }
- .hyzpBackground {
- background: url("./assets/img_hyzp.png") no-repeat;
- background-size: 100% 100%;
- width: 40rem;
- height: 40rem;
- float: left;
- margin-left: 8rem;
- text-align: center;
- color: #2EF9B3;
- font-size: 7rem;
- font-weight: Bold;
- }
- .totalContent {
- background: url("./assets/img_total.png") no-repeat;
- background-size: 100% 100%;
- width: 100rem;
- height: 15rem;
- margin-left: 10rem;
- margin-top: 5rem;
- color: white;
- }
- .shipContent >>> .el-tabs__item {
- font-weight: bold;
- color: #A8A8A8
- }
- .shipContent >>> .el-tabs__item.is-active {
- color: #0d25a5
- }
- .shipContent >>> .el-tabs__active-bar {
- margin-left: 10rem
- }
- .shipContent >>> .el-tabs__nav {
- padding-left: 10rem
- }
- .shipContent >>> .el-tabs__active-bar {
- background-color: #0d25a5
- }
- .tableSc >>> tr {
- padding: 0;
- height: 3rem;
- line-height: 3rem;
- font-size: 5rem;
- }
- .tableSc >>> td {
- padding: 0;
- height: 3rem;
- line-height: 3rem
- }
- .azwzContent >>> .el-dialog {
- background: url("./assets/pop_azwz.png") no-repeat;
- background-size: 100% 100%;
- height: 150rem;
- width: 280rem;
- border: none;
- top: 100rem;
- }
- .wfcbContent >>> .el-dialog {
- background: url("./assets/pop_wgcbtj.png") no-repeat;
- background-size: 100% 100%;
- height: 150rem;
- width: 280rem;
- border: none;
- top: 100rem;
- }
- .equipmentContent >>> .el-dialog {
- background: url("./assets/pop_azwz.png") no-repeat;
- background-size: 100% 100%;
- height: 150rem;
- width: 280rem;
- border: none;
- top: 100rem;
- }
- .equipmentTypeContent >>> .el-dialog {
- background: url("./assets/pop_sblx.png") no-repeat;
- background-size: 100% 100%;
- height: 150rem;
- width: 200rem;
- border: none;
- top: 100rem;
- }
- .wfcbContent >>> .el-date-editor.el-input, .el-date-editor.el-input__inner {
- width: 50rem;
- }
- /* .dialogContent >>> .el-input--medium .el-input__inner{
- height:10rem;
- text-align: center
- } */
- </style>
|