homeTable.vue 31 KB

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