homeTable.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. <template>
  2. <div style="width:100%;height:100%;background-color:rgb(0, 9, 40)">
  3. <mapdiv ref="mapv" :deviceList='deviceList'></mapdiv>
  4. <div class="shipInCount">
  5. <img src="@/assets/picture/img_wgcb.png" style="margin-top:5rem;margin-left:5rem"/>
  6. <div style="margin-top:5rem" @click="dialogVisibleShip = true">
  7. <div style="float:left">
  8. <div class="lcbBackground">
  9. <div style="margin-top:12rem">
  10. {{ so2Count }}
  11. <br/>
  12. <span style="font-size:5rem">艘</span>
  13. </div>
  14. </div>
  15. <div style="text-align: center;color: #ffffff;margin-left:14rem;margin-top:43rem">硫含量超标</div>
  16. </div>
  17. <div style="float:left">
  18. <div class="hyzpBackground">
  19. <div style="margin-top:12rem">
  20. {{ blackCount }}
  21. <br/>
  22. <span style="font-size:5rem">艘</span>
  23. </div>
  24. </div>
  25. <div style="text-align: center;color: #ffffff;margin-left:7rem;margin-top:43rem">黑烟抓拍</div>
  26. </div>
  27. </div>
  28. <img src="@/assets/picture/img_sbtj.png" style="margin-top:5rem;margin-left:5rem"/>
  29. <div class="totalContent" style="padding-right:15rem">
  30. <div style="float:left;margin-top:3rem">
  31. <i class="el-icon-pie-chart" style="font-size:9rem;float:left;margin-left:5rem"/>
  32. <span style="font-size:6rem;float:left;margin-left:5rem">总数</span>
  33. </div>
  34. <div style="float:right;font-size:9rem;margin-top:1rem">{{ deviceTotal }}个</div>
  35. </div>
  36. <div style="padding-left:5rem;padding-top:1rem">
  37. <div style="color:white" @click="dialogVisible = true">
  38. <div style="float:left"><img src="@/assets/picture/location.png" style="margin-left:5rem"/></div>
  39. <div style="float:left;background-image: linear-gradient(transparent 90%,white);font-size:6rem;margin-top:14rem">安装位置</div>
  40. </div>
  41. <div style="color:white" @click="dialogVisibleType = true">
  42. <div style="float:left"><img src="@/assets/picture/device_type.png" style="margin-left:5rem"/></div>
  43. <div style="float:left;background-image: linear-gradient(transparent 90%,white);font-size:6rem;margin-top:14rem">设备类型</div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="shipInformation">
  48. <img src="@/assets/picture/img_xycbxx.png" style="margin-top:5rem;margin-left:5rem"/>
  49. <scroll illegalStatus=2></scroll>
  50. <img src="@/assets/picture/img_wgcbxx.png" style="margin-top:5rem;margin-left:5rem"/>
  51. <scroll illegalStatus=3></scroll>
  52. </div>
  53. <div class="equipmentContent">
  54. <el-dialog
  55. title=""
  56. :visible.sync="dialogVisible"
  57. @open="openChart">
  58. <div id="equipmentChart" style="width:260rem;height:100rem"></div>
  59. </el-dialog>
  60. </div>
  61. <div class="equipmentTypeContent">
  62. <el-dialog
  63. title=""
  64. :visible.sync="dialogVisibleType"
  65. @open="openTypeChart">
  66. <div id="equipmentTypeChart" style="width:160rem;height:100rem"></div>
  67. </el-dialog>
  68. </div>
  69. <div class="wfcbContent">
  70. <el-dialog
  71. title=""
  72. :visible.sync="dialogVisibleShip"
  73. @open="openShipChart">
  74. <div style="position:absolute;z-index:3001">
  75. <div style="float:left;color:#ffffff">开始</div>
  76. <div style="float:left;margin-left:3rem">
  77. <el-date-picker
  78. @change='getSo2Time'
  79. value-format='yyyy-MM'
  80. v-model="shipDate.startMonth"
  81. type="month"
  82. placeholder="选择月份">
  83. </el-date-picker>
  84. </div>
  85. <div style="float:left;margin-left:3rem;color:#ffffff">结束</div>
  86. <div style="float:left;margin-left:3rem">
  87. <el-date-picker
  88. v-model="shipDate.endMonth"
  89. @change='getSo2Time'
  90. value-format='yyyy-MM'
  91. type="month"
  92. placeholder="选择月份">
  93. </el-date-picker>
  94. </div>
  95. </div>
  96. <div id="shipChart" style="width:280rem;height:120rem;position:absolute;z-index:3000"></div>
  97. </el-dialog>
  98. </div>
  99. <!--
  100. <div class="azwzContent">
  101. <el-dialog
  102. title=""
  103. :visible.sync="dialogVisibleAzwz"
  104. :before-close="handleClose"
  105. @open="openShipChart">
  106. <div id="shipChart" style="width:220rem;height:100rem;"></div>
  107. </el-dialog>
  108. </div> -->
  109. </div>
  110. </template>
  111. <script>
  112. import scroll from "./scroll.vue"
  113. import {getDeviceType, getIllegalShipStatic, getSo2Time, getStaticDevice} from "@/api/data/staticalData";
  114. import {getdeviceList, queryShipData,queryallShipData} from "@/api/data/deviceData";
  115. import mapdiv from '../../../components/map/index.vue'
  116. import {getThresholdList} from "@/api/data/liuData";
  117. export default {
  118. name: "homeTable",
  119. components: {
  120. scroll,
  121. mapdiv
  122. },
  123. data() {
  124. return {
  125. total: 100,
  126. shipShow: true,
  127. activeName: 'first',
  128. normalPer: 0.1,
  129. so2Count: 0,
  130. blackCount: 0,
  131. dialogVisible: false,
  132. dialogVisibleAzwz: false,
  133. dialogVisibleType: false,
  134. normalCount: 1,
  135. dialogVisibleShip: false,
  136. beginTime: '',
  137. so2TimeData: {},
  138. endTime: '',
  139. deviceList: [],
  140. deviceTotal: 0,
  141. queryParams: {
  142. pageNum: 1,
  143. pageSize: 10,
  144. roleName: undefined,
  145. roleKey: undefined,
  146. status: undefined,
  147. mmsi: undefined,
  148. radio: 1
  149. },
  150. tableData: [],
  151. shipDate: {
  152. startMonth: '',
  153. endMonth: ''
  154. },
  155. shipDateArry: [],
  156. heyDeviceData: [
  157. {"name": "南京三桥黑烟1", "locations": [[118.643133, 31.969894]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
  158. {"name": "南京三桥黑烟2", "locations": [[118.642232, 31.970804]], "data": {'监测点': "南京三桥", '类型': '黑烟检测'}},
  159. {"name": "南京三桥黑烟3", "locations": [[118.6503, 31.965016]]},
  160. {"name": "南京三桥黑烟4", "locations": [[118.638434, 31.973189]]},
  161. {"name": "南京三桥黑烟5", "locations": [[118.643283, 31.970076]]},
  162. {"name": "南京三桥黑烟6", "locations": [[118.647403, 31.967309]]},
  163. {"name": "苏通大桥黑烟1", "locations": [[121.001581, 31.78503]]},
  164. {"name": "苏通大桥黑烟2", "locations": [[120.997083, 31.76303]]},
  165. {"name": "苏通大桥黑烟3", "locations": [[120.998929, 31.771094]]},
  166. {"name": "苏通大桥黑烟4", "locations": [[121.002491, 31.791012]]},
  167. {"name": "江阴大桥黑烟1", "locations": [[120.27317, 31.945522]]},
  168. {"name": "江阴大桥黑烟2", "locations": [[120.274763, 31.942572]]},
  169. {"name": "润扬大桥黑烟1", "locations": [[119.366033, 32.210959]]},
  170. {"name": "润扬大桥黑烟2", "locations": [[119.370324, 32.202425]]},
  171. ],
  172. so2DeviceData: [
  173. {"name": "南京三桥嗅探1", "locations": [[118.640237, 31.971992]]},
  174. {"name": "南京三桥嗅探2", "locations": [[118.647447, 31.967359]]},
  175. {"name": "南京三桥嗅探3", "locations": [[118.641632, 31.971064]]},
  176. {"name": "苏通大桥嗅探1", "locations": [[121.003306, 31.792982]]},
  177. {"name": "苏通大桥嗅探2", "locations": [[120.999529, 31.775326]]},
  178. {"name": "江阴大桥嗅探1", "locations": [[120.272167, 31.947384]]},
  179. {"name": "江阴大桥嗅探2", "locations": [[120.274441, 31.943087]]},
  180. {"name": "润扬大桥嗅探1", "locations": [[119.367277, 32.209071]]},
  181. {"name": "润扬大桥嗅探2", "locations": [[119.369466, 32.204568]]},
  182. ],
  183. aisDeviceData: [
  184. {"name": "南京三桥光谱1", "locations": [[118.642876, 31.970445]]},
  185. {"name": "南京三桥光谱2", "locations": [[118.648949, 31.966386]]},
  186. {"name": "南京三桥光谱3", "locations": [[118.651223, 31.964747]]},
  187. {"name": "苏通大桥光谱1", "locations": [[121.003134, 31.789772]]},
  188. {"name": "苏通大桥光谱2", "locations": [[120.997985, 31.762921]]},
  189. {"name": "江阴大桥光谱1", "locations": [[120.272044, 31.947069]]},
  190. {"name": "江阴大桥光谱2", "locations": [[120.276078, 31.940587]]},
  191. {"name": "润扬大桥光谱1", "locations": [[119.367235, 32.209107]]},
  192. {"name": "润扬大桥光谱2", "locations": [[119.369724, 32.204459]]},
  193. ],
  194. allship:[],
  195. ship: [
  196. {"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]]},
  197. // {"name": "二号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":60},
  198. {"name": "三号船", "mmsi": "s1", "locations": [[118.639711, 31.96622]], 'type': 1, "head": 90},
  199. {"name": "三号船", "mmsi": "s2", "locations": [[118.639711, 31.93662]], 'type': 1, "head": 180},
  200. // {"name": "四号船", "locations": [[118.639711, 31.96602]], 'type': 3,"head":180},
  201. // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":270},
  202. // {"name": "五号船", "locations": [[118.639711, 31.96602]], 'type': 2,"head":360},
  203. ]
  204. }
  205. }, mounted() {
  206. this.getMonthDate();
  207. this.getdeviceList();
  208. this.getStaticDevice();
  209. this.getIllegalShipStatic();
  210. this.getshipData();
  211. this.getallshipData();
  212. var that = this;
  213. setInterval(() => {
  214. that.getshipData();
  215. }, 120000);
  216. setInterval(() => {
  217. that.getallshipData();
  218. }, 5*60*1000);
  219. this.getThresholdList();
  220. // this.addDevicePoint();
  221. // this.addAisPoint();
  222. // this.addSo2Point();
  223. // this.addshipPoint();
  224. // console.log(111111111111)
  225. // this.getChart();
  226. },
  227. methods: {
  228. getThresholdList() {
  229. getThresholdList({type: 'bridge'}).then(response => {
  230. console.log(response);
  231. for (var index in response.rows) {
  232. var obj = response.rows[index];
  233. var points = '[' + obj.configValue + ']';
  234. console.log(JSON.parse(points));
  235. this.$refs.mapv.addline(JSON.parse(points));
  236. }
  237. });
  238. },
  239. getdeviceList() {
  240. var dlist = [];
  241. getdeviceList().then(data => {
  242. console.log(data);
  243. var deviceList = [];
  244. this.deviceList = data.data;
  245. for (var key in data.data) {
  246. if (data.data[key] != undefined && data.data[key].length > 0) {
  247. dlist.push({name: key, location: JSON.parse("[[" + data.data[key][0].latilongti + "]]")});
  248. this.$refs.mapv.setaddrlist(dlist);
  249. }
  250. for (var index in data.data[key]) {
  251. var obj = data.data[key][index]
  252. // console.log(data.data[key][index].source);
  253. // deviceList.push(data.data[key][index]);
  254. var locationArry = JSON.parse("[[" + obj.latilongti + "]]");
  255. var icons = "";
  256. if (obj.source.indexOf("so2") != -1) {
  257. icons = "so2.png"
  258. }
  259. if (obj.source.indexOf("ais") != -1) {
  260. icons = "ais.png"
  261. }
  262. if (obj.source.indexOf("heiyan") != -1) {
  263. icons = "hy.png"
  264. }
  265. this.$refs.mapv.addpoint(locationArry, obj, icons, 'device');
  266. }
  267. }
  268. // console.log(deviceList);
  269. });
  270. },
  271. getshipData() {
  272. queryShipData().then(data => {
  273. var shipdatalist = [];
  274. for (var key in data.data) {
  275. var ship = data.data[key];
  276. ship["name"] = ship.shipName;
  277. ship["locations"] = [[ship.lng, ship.lat]];
  278. ship["type"] = ship.illegalStatus;
  279. shipdatalist.push(ship);
  280. }
  281. // this.ship = shipdatalist;
  282. this.addshipPoint();
  283. });
  284. },
  285. getallshipData() {
  286. queryallShipData().then(data => {
  287. var shipdatalist = [];
  288. for (var key in data.data) {
  289. var ship = data.data[key];
  290. ship["name"] = ship.shipname_cn;
  291. ship["locations"] = [[ship.lng, ship.lat]];
  292. ship["type"] = 1;
  293. shipdatalist.push(ship);
  294. }
  295. this.allship = shipdatalist;
  296. this.addshipPointall();
  297. });
  298. },
  299. // addDevicePoint(){
  300. // for(var index in this.heyDeviceData){
  301. // var obj = this.heyDeviceData[index]
  302. // this.$refs.mapv.addpoint(obj.locations,obj.name,'hy.png','device');
  303. // }
  304. // },
  305. // addAisPoint(){
  306. // for(var index in this.aisDeviceData){
  307. // var obj = this.aisDeviceData[index]
  308. // this.$refs.mapv.addpoint(obj.locations,obj.name,'ais.png','device');
  309. // }
  310. // },
  311. // addSo2Point(){
  312. // for(var index in this.so2DeviceData){
  313. // var obj = this.so2DeviceData[index]
  314. // this.$refs.mapv.addpoint(obj.locations,obj.name,'so2.png','device');
  315. // }
  316. // },
  317. addshipPoint() {
  318. for (var index in this.ship) {
  319. var obj = this.ship[index]
  320. var img = 'zc.png'
  321. if (obj.type == 2) {
  322. img = 'xy.png'
  323. } else if (obj.type == 3) {
  324. img = 'wg.png'
  325. }
  326. this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship', ((obj.head == null ? 0 : parseFloat(obj.head)) - 90) * Math.PI / 180,1);
  327. }
  328. },
  329. addshipPointall() {
  330. for (var index in this.allship) {
  331. var obj = this.allship[index]
  332. var img = 'zc.png'
  333. if (obj.type == 2) {
  334. img = 'xy.png'
  335. } else if (obj.type == 3) {
  336. img = 'wg.png'
  337. }
  338. this.$refs.mapv.addpoint(obj.locations, obj, img, 'ship', ((obj.head == null ? 0 : parseFloat(obj.head)) - 90) * Math.PI / 180,1);
  339. }
  340. },
  341. getSo2Time() {
  342. console.log(111);
  343. getSo2Time(this.shipDate).then(data => {
  344. this.getMonthArry(this.shipDate.startMonth, this.shipDate.endMonth);
  345. this.so2TimeData = data.data
  346. this.getShipChart();
  347. });
  348. },
  349. getMonthArry(start, end) {
  350. this.shipDateArry = [];
  351. var startYear = start.split('-')[0];
  352. var startMonth = parseInt(start.split('-')[1]);
  353. var endYear = end.split('-')[0];
  354. var endMonth = parseInt(end.split('-')[1]);
  355. if (startYear == endYear) {
  356. for (var i = startMonth; i < endMonth + 1; i++) {
  357. if (i < 10) {
  358. this.shipDateArry.push(startYear + '-' + "0" + i);
  359. } else {
  360. this.shipDateArry.push(startYear + '-' + i);
  361. }
  362. }
  363. } else {
  364. for (var i = startMonth; i < 13; i++) {
  365. if (i < 10) {
  366. this.shipDateArry.push(startYear + '-' + "0" + i);
  367. } else {
  368. this.shipDateArry.push(startYear + '-' + i);
  369. }
  370. }
  371. for (var i = 1; i < endMonth; i++) {
  372. if (i < 10) {
  373. this.shipDateArry.push(endYear + '-' + "0" + i);
  374. } else {
  375. this.shipDateArry.push(endYear + '-' + i);
  376. }
  377. }
  378. }
  379. console.log(this.shipDateArry);
  380. },
  381. getMonthDate() {
  382. var time = new Date();
  383. var year = time.getFullYear();
  384. var month = time.getMonth();
  385. if (month > 9) {
  386. this.shipDate.endMonth = year + "-" + month
  387. } else if (month > 0) {
  388. this.shipDate.endMonth = year + "-" + "0" + month
  389. } else {
  390. this.shipDate.endMonth = (year - 1) + "-" + '12';
  391. }
  392. if (month == 6) {
  393. this.shipDate.startMonth = year + "-" + '01';
  394. } else if (month > 6) {
  395. this.shipDate.startMonth = year + "-" + '0' + (month - 6);
  396. } else if (month < 6) {
  397. if (month >= 3) {
  398. this.shipDate.startMonth = (year - 1) + "-" + (month + 7);
  399. } else {
  400. this.shipDate.startMonth = (year - 1) + "-" + "0" + (month + 7);
  401. }
  402. }
  403. },
  404. openShipChart() {
  405. const t = this;
  406. setTimeout(() => {
  407. // 执行echarts画图方法
  408. t.getSo2Time();
  409. }, 0);
  410. },
  411. handleClick(tab, event) {
  412. console.log(tab, event);
  413. },
  414. openChart() {
  415. const t = this;
  416. setTimeout(() => {
  417. // 执行echarts画图方法
  418. t.getStaticDevice();
  419. }, 0);
  420. },
  421. openTypeChart() {
  422. const t = this;
  423. setTimeout(() => {
  424. // 执行echarts画图方法
  425. t.getTypeData();
  426. }, 0);
  427. },
  428. getStaticDevice() {
  429. getStaticDevice().then(response => {
  430. let nameArry = [];
  431. let dataArry = [];
  432. this.deviceTotal = 0;
  433. for (var key in response.data) {
  434. this.deviceTotal += response.data[key]
  435. nameArry.push(key);
  436. dataArry.push(response.data[key]);
  437. }
  438. this.getChart(nameArry, dataArry);
  439. });
  440. },
  441. getIllegalShipStatic() {
  442. getIllegalShipStatic().then(data => {
  443. this.blackCount = data.data.blackCount;
  444. this.so2Count = data.data.so2Count;
  445. });
  446. },
  447. getShipChart() {
  448. var so2Arry = [];
  449. var aisArry = [];
  450. var hyArry = [];
  451. // console.log(data);
  452. for (var index in this.shipDateArry) {
  453. // console.log(this.shipDateArry[index]+'-01T00:00:00Z');
  454. // console.log(this.so2TimeData.so2['2021-01-01T00:00:00Z']);
  455. if (this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']) {
  456. so2Arry.push(this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']);
  457. } else {
  458. so2Arry.push(0);
  459. }
  460. if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
  461. aisArry.push(this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']);
  462. } else {
  463. aisArry.push(0);
  464. }
  465. if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
  466. hyArry.push(this.so2TimeData.black[this.shipDateArry[index] + '-01T00:00:00Z']);
  467. } else {
  468. hyArry.push(0);
  469. }
  470. }
  471. var myChart = this.$echarts.init(document.getElementById('shipChart'));
  472. var option = {
  473. color: ['#FF2D3C', '#FFA647', '#61FAFB'],
  474. legend: {
  475. data: ['黑烟抓拍', '光谱', '嗅探'],
  476. right: '10%',
  477. textStyle: {
  478. color: '#ffffff'
  479. }
  480. },
  481. xAxis: {
  482. type: 'category',
  483. data: this.shipDateArry,
  484. axisLabel: {
  485. show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
  486. interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
  487. textStyle: { //textStyle里面写x轴下的字体的样式
  488. color: '#ffffff',
  489. fontSize: 13
  490. }
  491. },
  492. axisLine: {
  493. show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
  494. lineStyle: { //lineStyle里面写x轴那一条线的样式
  495. color: '#ffffff',
  496. width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
  497. }
  498. }
  499. },
  500. yAxis: {
  501. type: 'value',
  502. axisLabel: {
  503. show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
  504. interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
  505. textStyle: { //textStyle里面写x轴下的字体的样式
  506. color: '#ffffff',
  507. fontSize: 13
  508. }
  509. },
  510. axisLine: {
  511. show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
  512. lineStyle: { //lineStyle里面写x轴那一条线的样式
  513. color: '#ffffff',
  514. width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
  515. }
  516. }
  517. },
  518. series: [{
  519. name: '黑烟抓拍',
  520. data: hyArry,
  521. type: 'line',
  522. smooth: true,
  523. itemStyle: {
  524. normal: {
  525. lineStyle: {
  526. color: '#FF2D3C',
  527. width: 5
  528. }
  529. }
  530. },
  531. }, {
  532. name: '光谱',
  533. data: so2Arry,
  534. type: 'line',
  535. smooth: true,
  536. itemStyle: {
  537. normal: {
  538. lineStyle: {
  539. color: '#FFA647',
  540. width: 5
  541. }
  542. }
  543. },
  544. }, {
  545. name: '嗅探',
  546. data: aisArry,
  547. type: 'line',
  548. smooth: true,
  549. itemStyle: {
  550. normal: {
  551. lineStyle: {
  552. color: '#61FAFB',
  553. width: 5
  554. }
  555. }
  556. },
  557. }]
  558. };
  559. myChart.setOption(option);
  560. },
  561. getChart(nameArry, dataArry) {
  562. var myChart = this.$echarts.init(document.getElementById('equipmentChart'));
  563. var option = {
  564. tooltip: {
  565. trigger: 'axis',
  566. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  567. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  568. }
  569. },
  570. grid: {
  571. left: '3%',
  572. right: '4%',
  573. bottom: '3%',
  574. containLabel: true
  575. },
  576. xAxis: [
  577. {
  578. type: 'category',
  579. data: nameArry,
  580. axisTick: {
  581. alignWithLabel: true
  582. },
  583. axisLine: {
  584. lineStyle: {
  585. color: 'white'
  586. }
  587. },
  588. axisLabel: {
  589. interval: 0,
  590. show: true,
  591. textStyle: {
  592. color: 'white' //x轴data 的颜色
  593. }
  594. },
  595. },
  596. ],
  597. yAxis: [
  598. {
  599. type: 'value',
  600. splitLine: {
  601. show: true,
  602. lineStyle: {
  603. color: ['#435886'],
  604. width: 1,
  605. type: 'solid'
  606. }
  607. },
  608. axisLine: {
  609. lineStyle: {
  610. color: '#435886'
  611. }
  612. },
  613. axisLabel: {
  614. interval: 0,
  615. show: true,
  616. textStyle: {
  617. color: 'white' //x轴data 的颜色
  618. }
  619. },
  620. }
  621. ],
  622. series: [
  623. {
  624. name: '数量',
  625. type: 'bar',
  626. barWidth: '30%',
  627. data: dataArry,
  628. itemStyle: {
  629. normal: {
  630. label: {
  631. show: true, //开启显示
  632. position: 'top', //在上方显示
  633. textStyle: { //数值样式
  634. color: 'white',
  635. fontSize: 10
  636. }
  637. },
  638. color: new this.$echarts.graphic.LinearGradient(
  639. 0, 0, 0, 1,
  640. [
  641. {offset: 1, color: '#2275E4'}, //柱图渐变色
  642. {offset: 0, color: '#56CCF2'}, //柱图渐变色
  643. ]
  644. )
  645. },
  646. }
  647. }
  648. ]
  649. };
  650. myChart.setOption(option);
  651. },
  652. getTypeData() {
  653. getDeviceType().then(response => {
  654. let nameArry = [];
  655. let dataArry = [];
  656. for (var key in response.data) {
  657. nameArry.push(key);
  658. dataArry.push(response.data[key]);
  659. }
  660. this.getTypeChart(nameArry, dataArry);
  661. });
  662. },
  663. getTypeChart(nameArry, dataArry) {
  664. // this.dialogVisible = true;
  665. var myChart = this.$echarts.init(document.getElementById('equipmentTypeChart'));
  666. var option = {
  667. tooltip: {
  668. trigger: 'axis',
  669. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  670. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  671. }
  672. },
  673. grid: {
  674. left: '3%',
  675. right: '4%',
  676. bottom: '3%',
  677. containLabel: true
  678. },
  679. xAxis: [
  680. {
  681. type: 'category',
  682. data: nameArry,
  683. axisTick: {
  684. alignWithLabel: true
  685. },
  686. axisLine: {
  687. lineStyle: {
  688. color: 'white'
  689. }
  690. },
  691. axisLabel: {
  692. interval: 0,
  693. show: true,
  694. textStyle: {
  695. color: 'white' //x轴data 的颜色
  696. }
  697. },
  698. },
  699. ],
  700. yAxis: [
  701. {
  702. type: 'value',
  703. splitLine: {
  704. show: true,
  705. lineStyle: {
  706. color: ['#435886'],
  707. width: 1,
  708. type: 'solid'
  709. }
  710. },
  711. axisLine: {
  712. lineStyle: {
  713. color: '#435886'
  714. }
  715. },
  716. axisLabel: {
  717. interval: 0,
  718. show: true,
  719. textStyle: {
  720. color: 'white' //x轴data 的颜色
  721. }
  722. },
  723. }
  724. ],
  725. series: [
  726. {
  727. name: '数量',
  728. type: 'bar',
  729. barWidth: '30%',
  730. data: dataArry,
  731. itemStyle: {
  732. normal: {
  733. label: {
  734. show: true, //开启显示
  735. position: 'top', //在上方显示
  736. textStyle: { //数值样式
  737. color: 'white',
  738. fontSize: 10
  739. }
  740. },
  741. color: new this.$echarts.graphic.LinearGradient(
  742. 0, 0, 0, 1,
  743. [
  744. {offset: 1, color: '#2275E4'}, //柱图渐变色
  745. {offset: 0, color: '#56CCF2'}, //柱图渐变色
  746. ]
  747. )
  748. },
  749. }
  750. }
  751. ]
  752. };
  753. myChart.setOption(option);
  754. }
  755. }
  756. }
  757. </script>
  758. <style scoped>
  759. .shipDiv {
  760. position: absolute;
  761. top: 250rem;
  762. left: 140rem;
  763. width: 220rem;
  764. height: 130rem;
  765. background-color: white;
  766. }
  767. .shipTitle {
  768. padding-top: 4rem;
  769. padding-left: 10rem;
  770. padding-right: 10rem;
  771. width: 100%;
  772. height: 20rem;
  773. background-color: #0d25a5;
  774. color: white;
  775. font-size: 7rem
  776. }
  777. .contentFont {
  778. font-size: 5rem;
  779. }
  780. .shipInformation {
  781. background: url("./assets/bg_information.png") no-repeat;
  782. background-size: 100% 100%;
  783. width: 120rem;
  784. height: 160rem;
  785. position: absolute;
  786. top: 225rem;
  787. right: 30rem;
  788. }
  789. .shipInCount {
  790. background: url("./assets/bg_count.png") no-repeat;
  791. background-size: 100% 100%;
  792. width: 120rem;
  793. height: 160rem;
  794. position: absolute;
  795. top: 55rem;
  796. right: 30rem;
  797. }
  798. .lcbBackground {
  799. background: url("./assets/img_lcb.png") no-repeat;
  800. background-size: 100% 100%;
  801. width: 40rem;
  802. height: 40rem;
  803. float: left;
  804. margin-left: 15rem;
  805. text-align: center;
  806. color: #45AAF0;
  807. font-size: 7rem;
  808. font-weight: Bold;
  809. }
  810. .hyzpBackground {
  811. background: url("./assets/img_hyzp.png") no-repeat;
  812. background-size: 100% 100%;
  813. width: 40rem;
  814. height: 40rem;
  815. float: left;
  816. margin-left: 8rem;
  817. text-align: center;
  818. color: #2EF9B3;
  819. font-size: 7rem;
  820. font-weight: Bold;
  821. }
  822. .totalContent {
  823. background: url("./assets/img_total.png") no-repeat;
  824. background-size: 100% 100%;
  825. width: 100rem;
  826. height: 15rem;
  827. margin-left: 10rem;
  828. margin-top: 5rem;
  829. color: white;
  830. }
  831. .shipContent >>> .el-tabs__item {
  832. font-weight: bold;
  833. color: #A8A8A8
  834. }
  835. .shipContent >>> .el-tabs__item.is-active {
  836. color: #0d25a5
  837. }
  838. .shipContent >>> .el-tabs__active-bar {
  839. margin-left: 10rem
  840. }
  841. .shipContent >>> .el-tabs__nav {
  842. padding-left: 10rem
  843. }
  844. .shipContent >>> .el-tabs__active-bar {
  845. background-color: #0d25a5
  846. }
  847. .tableSc >>> tr {
  848. padding: 0;
  849. height: 3rem;
  850. line-height: 3rem;
  851. font-size: 5rem;
  852. }
  853. .tableSc >>> td {
  854. padding: 0;
  855. height: 3rem;
  856. line-height: 3rem
  857. }
  858. .azwzContent >>> .el-dialog {
  859. background: url("./assets/pop_azwz.png") no-repeat;
  860. background-size: 100% 100%;
  861. height: 150rem;
  862. width: 280rem;
  863. border: none;
  864. top: 100rem;
  865. }
  866. .wfcbContent >>> .el-dialog {
  867. background: url("./assets/pop_wgcbtj.png") no-repeat;
  868. background-size: 100% 100%;
  869. height: 150rem;
  870. width: 280rem;
  871. border: none;
  872. top: 100rem;
  873. }
  874. .equipmentContent >>> .el-dialog {
  875. background: url("./assets/pop_azwz.png") no-repeat;
  876. background-size: 100% 100%;
  877. height: 150rem;
  878. width: 280rem;
  879. border: none;
  880. top: 100rem;
  881. }
  882. .equipmentTypeContent >>> .el-dialog {
  883. background: url("./assets/pop_sblx.png") no-repeat;
  884. background-size: 100% 100%;
  885. height: 150rem;
  886. width: 200rem;
  887. border: none;
  888. top: 100rem;
  889. }
  890. .wfcbContent >>> .el-date-editor.el-input, .el-date-editor.el-input__inner {
  891. width: 50rem;
  892. }
  893. /* .dialogContent >>> .el-input--medium .el-input__inner{
  894. height:10rem;
  895. text-align: center
  896. } */
  897. </style>