homeTable.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  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: 1,
  125. blackCount: 1,
  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. getdeviceList().then(data => {
  246. console.log(data);
  247. var deviceList = [];
  248. for (var key in data.data) {
  249. for (var index in data.data[key]) {
  250. var obj = data.data[key][index]
  251. // console.log(data.data[key][index].source);
  252. // deviceList.push(data.data[key][index]);
  253. var locationArry = [[obj.latilongti]];
  254. this.$refs.mapv.addpoint(locationArry, obj, obj.source + '.png', 'device');
  255. }
  256. }
  257. // console.log(deviceList);
  258. });
  259. },
  260. // addDevicePoint(){
  261. // for(var index in this.heyDeviceData){
  262. // var obj = this.heyDeviceData[index]
  263. // this.$refs.mapv.addpoint(obj.locations,obj.name,'hy.png','device');
  264. // }
  265. // },
  266. // addAisPoint(){
  267. // for(var index in this.aisDeviceData){
  268. // var obj = this.aisDeviceData[index]
  269. // this.$refs.mapv.addpoint(obj.locations,obj.name,'ais.png','device');
  270. // }
  271. // },
  272. // addSo2Point(){
  273. // for(var index in this.so2DeviceData){
  274. // var obj = this.so2DeviceData[index]
  275. // this.$refs.mapv.addpoint(obj.locations,obj.name,'so2.png','device');
  276. // }
  277. // },
  278. addshipPoint() {
  279. for (var index in this.ship) {
  280. var obj = this.ship[index]
  281. var img = 'zc.png'
  282. if (obj.type == 2) {
  283. img = 'xy.png'
  284. } else if (obj.type == 3) {
  285. img = 'wg.png'
  286. }
  287. this.$refs.mapv.addpoint(obj.locations, obj.name, img, 'ship');
  288. }
  289. },
  290. getSo2Time() {
  291. getSo2Time(this.shipDate).then(data => {
  292. this.getMonthArry(this.shipDate.startMonth, this.shipDate.endMonth);
  293. this.so2TimeData = data.data
  294. this.getShipChart();
  295. });
  296. },
  297. getMonthArry(start, end) {
  298. // this.shipDateArry.push(start);
  299. var startYear = start.split('-')[0];
  300. var startMonth = parseInt(start.split('-')[1]);
  301. var endYear = end.split('-')[0];
  302. var endMonth = parseInt(end.split('-')[1]);
  303. if (startYear == endYear) {
  304. for (var i = startMonth; i < endMonth + 1; i++) {
  305. if (i < 10) {
  306. this.shipDateArry.push(startYear + '-' + "0" + i);
  307. } else {
  308. this.shipDateArry.push(startYear + '-' + i);
  309. }
  310. }
  311. } else {
  312. for (var i = startMonth; i < 13; i++) {
  313. if (i < 10) {
  314. this.shipDateArry.push(startYear + '-' + "0" + i);
  315. } else {
  316. this.shipDateArry.push(startYear + '-' + i);
  317. }
  318. }
  319. for (var i = 1; i < endMonth; i++) {
  320. if (i < 10) {
  321. this.shipDateArry.push(endYear + '-' + "0" + i);
  322. } else {
  323. this.shipDateArry.push(endYear + '-' + i);
  324. }
  325. }
  326. }
  327. console.log(this.shipDateArry);
  328. },
  329. getMonthDate() {
  330. var time = new Date();
  331. var year = time.getFullYear();
  332. var month = time.getMonth();
  333. if (month > 9) {
  334. this.shipDate.endMonth = year + "-" + month
  335. } else if (month > 0) {
  336. this.shipDate.endMonth = year + "-" + "0" + month
  337. } else {
  338. this.shipDate.endMonth = (year - 1) + "-" + '12';
  339. }
  340. if (month == 6) {
  341. this.shipDate.startMonth = year + "-" + '01';
  342. } else if (month > 6) {
  343. this.shipDate.startMonth = year + "-" + '0' + (month - 6);
  344. } else if (month < 6) {
  345. if (month >= 3) {
  346. this.shipDate.startMonth = (year - 1) + "-" + (month + 7);
  347. } else {
  348. this.shipDate.startMonth = (year - 1) + "-" + "0" + (month + 7);
  349. }
  350. }
  351. },
  352. openShipChart() {
  353. const t = this;
  354. setTimeout(() => {
  355. // 执行echarts画图方法
  356. t.getSo2Time();
  357. }, 0);
  358. },
  359. handleClick(tab, event) {
  360. console.log(tab, event);
  361. },
  362. openChart() {
  363. const t = this;
  364. setTimeout(() => {
  365. // 执行echarts画图方法
  366. t.getStaticDevice();
  367. }, 0);
  368. },
  369. openTypeChart() {
  370. const t = this;
  371. setTimeout(() => {
  372. // 执行echarts画图方法
  373. t.getTypeData();
  374. }, 0);
  375. },
  376. getStaticDevice() {
  377. getStaticDevice().then(response => {
  378. let nameArry = [];
  379. let dataArry = [];
  380. this.deviceTotal = 0;
  381. for (var key in response.data) {
  382. this.deviceTotal += response.data[key]
  383. nameArry.push(key);
  384. dataArry.push(response.data[key]);
  385. }
  386. this.getChart(nameArry, dataArry);
  387. });
  388. },
  389. getIllegalShipStatic() {
  390. getIllegalShipStatic().then(data => {
  391. this.blackCount = data.data.blackCount;
  392. this.so2Count = data.data.so2Count;
  393. });
  394. },
  395. getShipChart() {
  396. var so2Arry = [];
  397. var aisArry = [];
  398. var hyArry = [];
  399. // console.log(data);
  400. for (var index in this.shipDateArry) {
  401. // console.log(this.shipDateArry[index]+'-01T00:00:00Z');
  402. // console.log(this.so2TimeData.so2['2021-01-01T00:00:00Z']);
  403. if (this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']) {
  404. so2Arry.push(this.so2TimeData.so2[this.shipDateArry[index] + '-01T00:00:00Z']);
  405. } else {
  406. so2Arry.push(0);
  407. }
  408. if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
  409. aisArry.push(this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']);
  410. } else {
  411. aisArry.push(0);
  412. }
  413. if (this.so2TimeData.ais[this.shipDateArry[index] + '-01T00:00:00Z']) {
  414. hyArry.push(this.so2TimeData.black[this.shipDateArry[index] + '-01T00:00:00Z']);
  415. } else {
  416. hyArry.push(0);
  417. }
  418. }
  419. var myChart = this.$echarts.init(document.getElementById('shipChart'));
  420. var option = {
  421. color: ['#FF2D3C', '#FFA647', '#61FAFB'],
  422. legend: {
  423. data: ['黑烟抓拍', '光谱', '嗅探'],
  424. right: '10%',
  425. textStyle: {
  426. color: '#ffffff'
  427. }
  428. },
  429. xAxis: {
  430. type: 'category',
  431. data: this.shipDateArry,
  432. axisLabel: {
  433. show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
  434. interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
  435. textStyle: { //textStyle里面写x轴下的字体的样式
  436. color: '#ffffff',
  437. fontSize: 13
  438. }
  439. },
  440. axisLine: {
  441. show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
  442. lineStyle: { //lineStyle里面写x轴那一条线的样式
  443. color: '#ffffff',
  444. width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
  445. }
  446. }
  447. },
  448. yAxis: {
  449. type: 'value',
  450. axisLabel: {
  451. show: true, //这里的show用于设置是否显示x轴下的字体 默认为true
  452. interval: 0, //可以设置成 0 强制显示所有标签。如果设置为 1,表示『隔一个标签显示一个标签』,如果值为 2,表示隔两个标签显示一个标签,以此类推。
  453. textStyle: { //textStyle里面写x轴下的字体的样式
  454. color: '#ffffff',
  455. fontSize: 13
  456. }
  457. },
  458. axisLine: {
  459. show: true, //这里的show用于设置是否显示x轴那一条线 默认为true
  460. lineStyle: { //lineStyle里面写x轴那一条线的样式
  461. color: '#ffffff',
  462. width: 2, //轴线的粗细 我写的是2 最小为0,值为0的时候线隐藏
  463. }
  464. }
  465. },
  466. series: [{
  467. name: '黑烟抓拍',
  468. data: hyArry,
  469. type: 'line',
  470. smooth: true,
  471. itemStyle: {
  472. normal: {
  473. lineStyle: {
  474. color: '#FF2D3C',
  475. width: 5
  476. }
  477. }
  478. },
  479. }, {
  480. name: '光谱',
  481. data: so2Arry,
  482. type: 'line',
  483. smooth: true,
  484. itemStyle: {
  485. normal: {
  486. lineStyle: {
  487. color: '#FFA647',
  488. width: 5
  489. }
  490. }
  491. },
  492. }, {
  493. name: '嗅探',
  494. data: aisArry,
  495. type: 'line',
  496. smooth: true,
  497. itemStyle: {
  498. normal: {
  499. lineStyle: {
  500. color: '#61FAFB',
  501. width: 5
  502. }
  503. }
  504. },
  505. }]
  506. };
  507. myChart.setOption(option);
  508. },
  509. getChart(nameArry, dataArry) {
  510. var myChart = this.$echarts.init(document.getElementById('equipmentChart'));
  511. var option = {
  512. tooltip: {
  513. trigger: 'axis',
  514. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  515. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  516. }
  517. },
  518. grid: {
  519. left: '3%',
  520. right: '4%',
  521. bottom: '3%',
  522. containLabel: true
  523. },
  524. xAxis: [
  525. {
  526. type: 'category',
  527. data: nameArry,
  528. axisTick: {
  529. alignWithLabel: true
  530. },
  531. axisLine: {
  532. lineStyle: {
  533. color: 'white'
  534. }
  535. },
  536. axisLabel: {
  537. interval: 0,
  538. show: true,
  539. textStyle: {
  540. color: 'white' //x轴data 的颜色
  541. }
  542. },
  543. },
  544. ],
  545. yAxis: [
  546. {
  547. type: 'value',
  548. splitLine: {
  549. show: true,
  550. lineStyle: {
  551. color: ['#435886'],
  552. width: 1,
  553. type: 'solid'
  554. }
  555. },
  556. axisLine: {
  557. lineStyle: {
  558. color: '#435886'
  559. }
  560. },
  561. axisLabel: {
  562. interval: 0,
  563. show: true,
  564. textStyle: {
  565. color: 'white' //x轴data 的颜色
  566. }
  567. },
  568. }
  569. ],
  570. series: [
  571. {
  572. name: '直接访问',
  573. type: 'bar',
  574. barWidth: '30%',
  575. data: dataArry,
  576. itemStyle: {
  577. normal: {
  578. label: {
  579. show: true, //开启显示
  580. position: 'top', //在上方显示
  581. textStyle: { //数值样式
  582. color: 'white',
  583. fontSize: 10
  584. }
  585. },
  586. color: new this.$echarts.graphic.LinearGradient(
  587. 0, 0, 0, 1,
  588. [
  589. {offset: 1, color: '#2275E4'}, //柱图渐变色
  590. {offset: 0, color: '#56CCF2'}, //柱图渐变色
  591. ]
  592. )
  593. },
  594. }
  595. }
  596. ]
  597. };
  598. myChart.setOption(option);
  599. },
  600. getTypeData() {
  601. getDeviceType().then(response => {
  602. let nameArry = [];
  603. let dataArry = [];
  604. for (var key in response.data) {
  605. nameArry.push(key);
  606. dataArry.push(response.data[key]);
  607. }
  608. this.getTypeChart(nameArry, dataArry);
  609. });
  610. },
  611. getTypeChart(nameArry, dataArry) {
  612. // this.dialogVisible = true;
  613. var myChart = this.$echarts.init(document.getElementById('equipmentTypeChart'));
  614. var option = {
  615. tooltip: {
  616. trigger: 'axis',
  617. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  618. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  619. }
  620. },
  621. grid: {
  622. left: '3%',
  623. right: '4%',
  624. bottom: '3%',
  625. containLabel: true
  626. },
  627. xAxis: [
  628. {
  629. type: 'category',
  630. data: nameArry,
  631. axisTick: {
  632. alignWithLabel: true
  633. },
  634. axisLine: {
  635. lineStyle: {
  636. color: 'white'
  637. }
  638. },
  639. axisLabel: {
  640. interval: 0,
  641. show: true,
  642. textStyle: {
  643. color: 'white' //x轴data 的颜色
  644. }
  645. },
  646. },
  647. ],
  648. yAxis: [
  649. {
  650. type: 'value',
  651. splitLine: {
  652. show: true,
  653. lineStyle: {
  654. color: ['#435886'],
  655. width: 1,
  656. type: 'solid'
  657. }
  658. },
  659. axisLine: {
  660. lineStyle: {
  661. color: '#435886'
  662. }
  663. },
  664. axisLabel: {
  665. interval: 0,
  666. show: true,
  667. textStyle: {
  668. color: 'white' //x轴data 的颜色
  669. }
  670. },
  671. }
  672. ],
  673. series: [
  674. {
  675. name: '直接访问',
  676. type: 'bar',
  677. barWidth: '30%',
  678. data: dataArry,
  679. itemStyle: {
  680. normal: {
  681. label: {
  682. show: true, //开启显示
  683. position: 'top', //在上方显示
  684. textStyle: { //数值样式
  685. color: 'white',
  686. fontSize: 10
  687. }
  688. },
  689. color: new this.$echarts.graphic.LinearGradient(
  690. 0, 0, 0, 1,
  691. [
  692. {offset: 1, color: '#2275E4'}, //柱图渐变色
  693. {offset: 0, color: '#56CCF2'}, //柱图渐变色
  694. ]
  695. )
  696. },
  697. }
  698. }
  699. ]
  700. };
  701. myChart.setOption(option);
  702. }
  703. }
  704. }
  705. </script>
  706. <style scoped>
  707. .shipDiv {
  708. position: absolute;
  709. top: 250rem;
  710. left: 140rem;
  711. width: 220rem;
  712. height: 130rem;
  713. background-color: white;
  714. }
  715. .shipTitle {
  716. padding-top: 4rem;
  717. padding-left: 10rem;
  718. padding-right: 10rem;
  719. width: 100%;
  720. height: 20rem;
  721. background-color: #0d25a5;
  722. color: white;
  723. font-size: 7rem
  724. }
  725. .contentFont {
  726. font-size: 5rem;
  727. }
  728. .shipInformation {
  729. background: url("./assets/bg_information.png") no-repeat;
  730. background-size: 100% 100%;
  731. width: 120rem;
  732. height: 160rem;
  733. position: absolute;
  734. top: 225rem;
  735. right: 30rem;
  736. }
  737. .shipInCount {
  738. background: url("./assets/bg_count.png") no-repeat;
  739. background-size: 100% 100%;
  740. width: 120rem;
  741. height: 160rem;
  742. position: absolute;
  743. top: 55rem;
  744. right: 30rem;
  745. }
  746. .lcbBackground {
  747. background: url("./assets/img_lcb.png") no-repeat;
  748. background-size: 100% 100%;
  749. width: 40rem;
  750. height: 40rem;
  751. float: left;
  752. margin-left: 15rem;
  753. text-align: center;
  754. color: #45AAF0;
  755. font-size: 7rem;
  756. font-weight: Bold;
  757. }
  758. .hyzpBackground {
  759. background: url("./assets/img_hyzp.png") no-repeat;
  760. background-size: 100% 100%;
  761. width: 40rem;
  762. height: 40rem;
  763. float: left;
  764. margin-left: 8rem;
  765. text-align: center;
  766. color: #2EF9B3;
  767. font-size: 7rem;
  768. font-weight: Bold;
  769. }
  770. .totalContent {
  771. background: url("./assets/img_total.png") no-repeat;
  772. background-size: 100% 100%;
  773. width: 100rem;
  774. height: 15rem;
  775. margin-left: 10rem;
  776. margin-top: 5rem;
  777. color: white;
  778. }
  779. .shipContent >>> .el-tabs__item {
  780. font-weight: bold;
  781. color: #A8A8A8
  782. }
  783. .shipContent >>> .el-tabs__item.is-active {
  784. color: #0d25a5
  785. }
  786. .shipContent >>> .el-tabs__active-bar {
  787. margin-left: 10rem
  788. }
  789. .shipContent >>> .el-tabs__nav {
  790. padding-left: 10rem
  791. }
  792. .shipContent >>> .el-tabs__active-bar {
  793. background-color: #0d25a5
  794. }
  795. .tableSc >>> tr {
  796. padding: 0;
  797. height: 3rem;
  798. line-height: 3rem;
  799. font-size: 5rem;
  800. }
  801. .tableSc >>> td {
  802. padding: 0;
  803. height: 3rem;
  804. line-height: 3rem
  805. }
  806. .azwzContent >>> .el-dialog {
  807. background: url("./assets/pop_azwz.png") no-repeat;
  808. background-size: 100% 100%;
  809. height: 150rem;
  810. width: 280rem;
  811. border: none;
  812. top: 100rem;
  813. }
  814. .wfcbContent >>> .el-dialog {
  815. background: url("./assets/pop_wgcbtj.png") no-repeat;
  816. background-size: 100% 100%;
  817. height: 150rem;
  818. width: 280rem;
  819. border: none;
  820. top: 100rem;
  821. }
  822. .equipmentContent >>> .el-dialog {
  823. background: url("./assets/pop_azwz.png") no-repeat;
  824. background-size: 100% 100%;
  825. height: 150rem;
  826. width: 280rem;
  827. border: none;
  828. top: 100rem;
  829. }
  830. .equipmentTypeContent >>> .el-dialog {
  831. background: url("./assets/pop_sblx.png") no-repeat;
  832. background-size: 100% 100%;
  833. height: 150rem;
  834. width: 200rem;
  835. border: none;
  836. top: 100rem;
  837. }
  838. .wfcbContent >>> .el-date-editor.el-input, .el-date-editor.el-input__inner {
  839. width: 50rem;
  840. }
  841. /* .dialogContent >>> .el-input--medium .el-input__inner{
  842. height:10rem;
  843. text-align: center
  844. } */
  845. </style>