homeTable.vue 28 KB

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