homeTable.vue 28 KB

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