homeTable.vue 27 KB

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