index.vue 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988
  1. <!-- 首页模块 首页面 -->
  2. <template>
  3. <div class="home">
  4. <div class="body-middle" :class="{ 'body-middle-height': blockList[0].flag }">
  5. <div class="body-middle-left">
  6. <!-- 任务、消息、提醒、超期 -->
  7. <!-- <Panel :data-list="panelList" @click="gotoNewRw"></Panel> -->
  8. <div class="header">
  9. <div class="left">
  10. <img src="../../../public/img/8b2c7255e9b19c71d68b33a08f20f74.png" alt="">
  11. </div>
  12. <div class="right">
  13. <div class="top">
  14. {{ nowDate }}
  15. </div>
  16. <div class="bottom">
  17. {{ nowTime }}
  18. </div>
  19. </div>
  20. </div>
  21. <div v-show="false">
  22. <el-input v-model="param" />
  23. <el-button @click="openPort()">openPort</el-button>
  24. <el-button @click="closePort()">closePort</el-button>
  25. <div>{{text}}</div>
  26. </div>
  27. <div class="content2">
  28. <el-row class="content2-aside">
  29. <h3 class="title">采购合同完成进度</h3>
  30. <el-col :span="12" class="chart-card">
  31. <div style="font-weight: bold;" class="">
  32. <div ref="myEchart1" style="height: 288px;" class="roseChart"></div>
  33. <div class="bottom-tip">统计单位:吨</div>
  34. </div>
  35. </el-col>
  36. <el-col :span="12" class="chart-card">
  37. <div style="font-weight: bold;">
  38. <div ref="myEchart2" style="height: 288px;" class="roseChart"></div>
  39. <div class="bottom-tip">统计单位:元</div>
  40. </div>
  41. </el-col>
  42. <el-col :span="12" class="chart-card">
  43. <div style="font-weight: bold;">
  44. <div ref="myEchart3" style="height: 288px;" class="roseChart"></div>
  45. <div class="bottom-tip">统计单位:元</div>
  46. </div>
  47. </el-col>
  48. </el-row>
  49. <div class="content2-middle">
  50. <el-row class="left">
  51. <el-col :span="12">
  52. <h3>在途信息统计</h3>
  53. <div class="left-card">
  54. <div class="item">
  55. <p>在途车辆</p>
  56. <p><span class="number">76</span><span class="number-text">台</span></p>
  57. </div>
  58. <div class="item">
  59. <p>装货车辆</p>
  60. <p><span class="number" style="color:#ffa523;">86</span><span class="number-text">台</span></p>
  61. </div>
  62. <div class="item">
  63. <p>卸货车辆</p>
  64. <p><span class="number" style="color: #2483ff;">16</span><span class="number-text">台</span></p>
  65. </div>
  66. </div>
  67. </el-col>
  68. <el-col :span="12">
  69. <h3>粮食总储量</h3>
  70. <div ref="myEchart7" style="height: 208px;"></div>
  71. </el-col>
  72. </el-row>
  73. <el-row>
  74. <h3 class="content2-map">库点流向分布</h3>
  75. <div class="center-map">
  76. <map-drag></map-drag>
  77. </div>
  78. </el-row>
  79. <el-row>
  80. <h3>库存成本</h3>
  81. <div class="content3">
  82. <div class="left">
  83. <img src="../../../public/img/1637204557176-s4AMbBA8.png" alt="">
  84. <span>总库存量</span>
  85. <span class="content3-number blue">27631</span>
  86. <span style="margin-top: 10px;">吨</span>
  87. </div>
  88. <div class="right">
  89. <img src="../../../public/img/1637204768818-70JRjz0H.png" alt="">
  90. <span>库存价值</span>
  91. <span class="content3-number yellow">37745671</span>
  92. <span style="margin-top: 10px;">吨</span>
  93. </div>
  94. </div>
  95. </el-row>
  96. </div>
  97. <el-row class="content2-aside">
  98. <h3 class="left-title">采购合同完成进度</h3>
  99. <el-col :span="12" class="chart-card">
  100. <div style="font-weight: bold;">
  101. <div ref="myEchart4" style="height: 288px;" class="roseChart"></div>
  102. <div class="bottom-tip">统计单位:吨</div>
  103. </div>
  104. </el-col>
  105. <el-col :span="12" class="chart-card">
  106. <div style="font-weight: bold;">
  107. <div ref="myEchart5" style="height: 288px;" class="roseChart"></div>
  108. <div class="bottom-tip">统计单位:元</div>
  109. </div>
  110. </el-col>
  111. <el-col :span="12" class="chart-card">
  112. <div style="font-weight: bold;">
  113. <div ref="myEchart6" style="height: 288px;" class="roseChart"></div>
  114. <div class="bottom-tip">统计单位:元</div>
  115. </div>
  116. </el-col>
  117. </el-row>
  118. </div>
  119. <el-dialog :append-to-body="true" :show-close='false' :visible.sync="dialogVisible" width="30%"
  120. :before-close="handleClose">
  121. <span>这是一段信息</span>
  122. <span slot="footer" class="dialog-footer">
  123. <el-button @click="dialogVisible = false">取 消</el-button>
  124. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  125. </span>
  126. </el-dialog>
  127. <!-- <img style='width:100%;margin-top:10px;' src="../../../public/img/tmt.gif" alt=""> -->
  128. </div>
  129. </div>
  130. <div id="mapXY"></div>
  131. <!-- </ws-dialog> -->
  132. <!-- 第一次登陆的租户 -->
  133. <successfulDialog v-if="successfulDialog" :phone="phone" :successfulDialog="successfulDialog"
  134. @close="successfulDialogClose">
  135. </successfulDialog>
  136. <!-- 试用租户 -->
  137. <trialNotExpired v-if="trialNotExpired" :day="day" :phone="phone" :trialNotExpired="trialNotExpired"
  138. @close="trialNotExpiredClose">
  139. </trialNotExpired>
  140. </div>
  141. </template>
  142. <script>
  143. // import serialport from 'serialport'
  144. // 统计图start
  145. import maintenance from './components/maintenance'
  146. import shipCertificate from './components/shipCertificate'
  147. import sparePartsMaterial from './components/sparePartsMaterial'
  148. import procurement from './components/procurement'
  149. import mapDrag from '@/components/mapdrag/indexMap'
  150. // 统计图end
  151. // 正式租户
  152. import successfulDialog from './components/successfulDialog'
  153. // 试用租户
  154. import trialNotExpired from './components/trialNotExpired'
  155. // 新 api
  156. import {
  157. noticeNumber,
  158. queryCircularManagementReceiveList,
  159. getStaffHomeShowList,
  160. getChartsData
  161. } from '@/model/home/index'
  162. import {
  163. getUserVesselList,
  164. findHottestRouting
  165. } from '@/model/indexRx'
  166. import News from './components/News'
  167. import ShipMap from './components/ShipMap'
  168. import {
  169. getCnCity,
  170. getCnWea
  171. } from './city'
  172. import {
  173. getLanguage
  174. } from '@/lang'
  175. import Panel from './components/Panel'
  176. import {
  177. getChangeLoginFlag
  178. } from '@/model/indexRx'
  179. import {
  180. zipDown
  181. } from '@/utils/batchDown'
  182. import {
  183. EventBus
  184. } from 'base-core-lib'
  185. import {
  186. mapActions,
  187. mapGetters,
  188. mapState
  189. } from 'vuex';
  190. import axios from 'axios'
  191. export default {
  192. name: 'index',
  193. components: {
  194. mapDrag,
  195. axios,
  196. News,
  197. ShipMap,
  198. Panel,
  199. successfulDialog,
  200. trialNotExpired,
  201. //统计图start
  202. maintenance,
  203. shipCertificate,
  204. sparePartsMaterial,
  205. procurement
  206. //统计图end
  207. },
  208. data() {
  209. return {
  210. chartsData: [],
  211. nowDate: null, //存放年月日变量
  212. nowTime: null, //存放时分秒变量
  213. timer: "", //定义一个定时器的变量
  214. currentTime: new Date(), // 获取当前时间
  215. timer: '',
  216. dialogVisible: false,
  217. showEchart: false,
  218. phone: '', // 正式租户电话号码
  219. day: '', //试用租户剩余天数
  220. trialNotExpired: false, //试用租户 剩余天数
  221. successfulDialog: false, //第一次登陆的弹窗
  222. mapXY: undefined,
  223. shipService: undefined,
  224. blockList: [{
  225. name: this.$t('home.shortcutEntrance'),
  226. flag: true
  227. },
  228. {
  229. name: this.$t('home.shipMap'),
  230. flag: true
  231. }
  232. ],
  233. newList: [],
  234. noticeList: [],
  235. routeList: [],
  236. showBlockList: [],
  237. shipList: [],
  238. setFlag: false,
  239. todoCount: '-',
  240. msgCount: '-',
  241. weather: undefined,
  242. ships: [],
  243. selectShip: undefined,
  244. isFullScreen: false,
  245. number: {
  246. task: 0,
  247. remind: 0,
  248. overdue: 0,
  249. news: 0
  250. },
  251. vesselBankFlag: localStorage.getItem('ws-pf_vesselBankFlag'),
  252. shezhiVal: '',
  253. text: '数据',
  254. reader: null,
  255. param: 9600
  256. }
  257. },
  258. computed: {
  259. ...mapState({
  260. showVesslBankFlag: state => state.commonStore.showVesslBankFlag
  261. }),
  262. ...mapGetters(['userSetting']),
  263. /** 计算属性计算属性节点 */
  264. panelList() {
  265. return [{
  266. type: '0',
  267. task: this.$t('homeIndex.task'),
  268. url: require('@/assets/newhome/rw01.png'),
  269. number: this.number.task,
  270. background: require('@/assets/newhome/rw.png'),
  271. remark: '任务'
  272. },
  273. {
  274. type: 'message',
  275. task: this.$t('homeIndex.message'),
  276. url: require('@/assets/newhome/xx01.png'),
  277. number: this.number.news,
  278. background: require('@/assets/newhome/xx.png'),
  279. remark: '消息'
  280. },
  281. {
  282. type: '1',
  283. task: this.$t('homeIndex.remind'),
  284. url: require('@/assets/newhome/tx01.png'),
  285. number: this.number.remind,
  286. background: require('@/assets/newhome/tx.png'),
  287. remark: '提醒'
  288. },
  289. {
  290. type: '2',
  291. task: this.$t('homeIndex.beyond'),
  292. url: require('@/assets/newhome/cq01.png'),
  293. number: this.number.overdue,
  294. background: require('@/assets/newhome/cq.png'),
  295. remark: '超期'
  296. }
  297. ]
  298. },
  299. optionSingleHeightTime() {
  300. return {
  301. openWatch: true,
  302. limitMoveNum: -1, //启动无缝滚动最小数据量 this.dataList.length
  303. direction: 2,
  304. switchDelay: 1000
  305. }
  306. },
  307. getLanguage() {
  308. return this.$store.getters.language
  309. },
  310. isShowShipList() {
  311. return this.userSetting['shipMap'][0].showFlag && this.vesselBankFlag !== 'V' && this.permissionIf(
  312. 'map.mapManagement.view')
  313. },
  314. },
  315. async created() {
  316. //获取快捷路口列表
  317. this.getRouteList()
  318. // this.checkUserInfoDialog()
  319. {
  320. this.timer = setInterval(this.getTime, 1000);
  321. }
  322. },
  323. beforeDestroy() {
  324. clearInterval(this.timer);
  325. if (this.timer) {
  326. clearInterval(this.timer); // 在Vue实例销毁前,清除定时器
  327. }
  328. },
  329. async mounted() {
  330. let that = this
  331. this.getChartsData()
  332. // this.timer = setInterval(function(){
  333. // // that.getRouteList()
  334. // axios.get('https://live.eliangeyun.com/api/v1/device/channellist')
  335. // .then(resp =>{
  336. // 图表重置 myChart.setOption
  337. // that.aa = resp.data.ChannelList
  338. // for(var i=0;i<that.dataList.length;i++){
  339. // console.log('ssss',that.dataList[i].Status);
  340. // }
  341. // }).catch(err =>{
  342. // console.log(err);
  343. // });
  344. // }, 2000);
  345. //获取新闻列表
  346. // this.getNewList()
  347. getChartsData().toPromise().then(res => {
  348. console.log(res)
  349. this.chartsData = res
  350. this.initCharts()
  351. })
  352. // if (this.vesselBankFlag !== 'V') {
  353. // EventBus.$emit('addShipScript', () => {
  354. // this.initShipMap()
  355. // })
  356. // }
  357. // setTimeout(() => {
  358. // this.showEchart = true
  359. // }, 900)
  360. // this.showBlockList = []
  361. // if (this.vesselBankFlag === 'V') {
  362. // this.$refs.noticeList.style.width = 'calc(50% - 7px)'
  363. // this.$refs.newsList.style.width = 'calc(50% - 7px)'
  364. // } else {
  365. // this.showBlockList = []
  366. // this.blockList[1].flag = false
  367. // this.$refs.noticeList.style.width = 'calc(50% - 7px)'
  368. // this.$refs.newsList.style.width = 'calc(50% - 7px)'
  369. // if (this.userSetting['shipMap'] && this.userSetting['shipMap'][0].showFlag) {
  370. // this.showBlockList.push('船舶动态')
  371. // this.blockList[1].flag = true
  372. // }
  373. // }
  374. },
  375. watch: {
  376. // getLanguage: function () {
  377. // this.getShipList()
  378. // }
  379. },
  380. methods: {
  381. ...mapActions('user', ['toSetShow', 'changeVesslBank']),
  382. getChartsData() {
  383. noticeNumber().toPromise().then(res => {
  384. const {
  385. task = 0, remind = 0, overdue = 0, news = 0
  386. } = res
  387. this.number.task = task
  388. this.number.remind = remind
  389. this.number.overdue = overdue
  390. this.number.news = news
  391. })
  392. },
  393. getTime() {
  394. const date = new Date();
  395. const year = date.getFullYear();
  396. const month = date.getMonth() + 1;
  397. const day = date.getDate();
  398. const hour = date.getHours();
  399. const minute = date.getMinutes();
  400. const second = date.getSeconds();
  401. this.month = check(month);
  402. this.day = check(day);
  403. this.hour = check(hour);
  404. this.minute = check(minute);
  405. this.second = check(second);
  406. function check(i) {
  407. const num = (i < 10) ? ("0" + i) : i;
  408. return num;
  409. }
  410. this.nowDate = year + "-" + this.month + "-" + this.day;
  411. this.nowTime = this.hour + ":" + this.minute + ":" + this.second;
  412. },
  413. initCharts() {
  414. let app = this;
  415. var roseCharts = document.getElementsByClassName("roseChart");
  416. for (let i = 0; i < roseCharts.length; i++) {
  417. let myChart = app.$echarts.init(roseCharts[i]);
  418. let color = []
  419. let data = []
  420. let text = ""
  421. let formatter = ""
  422. let graphicText = ''
  423. debugger
  424. switch (i) {
  425. case 0:
  426. // 圆环图各环节的颜色
  427. color = ['#75d1f4', '#3a3b40'];
  428. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  429. data = [{
  430. name: '已完成量',
  431. value: this.chartsData[i].biViewInfoList[0].count
  432. }, {
  433. name: '待完成量',
  434. value: this.chartsData[i].biViewInfoList[1].count
  435. }]
  436. text = '合同总量'
  437. formatter = '{b}{c}吨 </br> 占比{d}%'
  438. graphicText = ' \n\n总量合计\n\n' +Number(this.chartsData[i].total).toFixed(2)
  439. break;
  440. case 1:
  441. // 圆环图各环节的颜色
  442. color = ['#247ef4', '#3a3b40'];
  443. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  444. data = [{
  445. name: '已开票',
  446. value: this.chartsData[i].biViewInfoList[0].count
  447. }, {
  448. name: '待开票',
  449. value: this.chartsData[i].biViewInfoList[1].count
  450. }]
  451. text = '合同总额'
  452. formatter = '{b}{c}元 </br> 占比{d}%'
  453. graphicText = ' \n\n开票合计\n\n' + Number(this.chartsData[i].total).toFixed(2)
  454. break;
  455. case 2:
  456. // 圆环图各环节的颜色
  457. color = ['#f49f23', '#3a3b40'];
  458. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  459. data = [{
  460. name: '已付款',
  461. value: this.chartsData[i].biViewInfoList[0].count
  462. }, {
  463. name: '待付款',
  464. value: this.chartsData[i].biViewInfoList[1].count
  465. }]
  466. text = '合同总额'
  467. formatter = '{b}{c}元 </br> 占比{d}%'
  468. graphicText = ' \n\n付款合计\n\n' + Number(this.chartsData[i].total).toFixed(2)
  469. break;
  470. case 3:
  471. // 圆环图各环节的颜色
  472. color = ['#75d1f4', '#3a3b40'];
  473. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  474. data = [{
  475. name: '已完成量',
  476. value: this.chartsData[i].biViewInfoList[0].count
  477. }, {
  478. name: '待完成量',
  479. value: this.chartsData[i].biViewInfoList[1].count
  480. }]
  481. text = '合同总量'
  482. formatter = '{b}{c}吨 </br> 占比{d}%'
  483. graphicText = ' \n\n总量合计\n\n' + Number(this.chartsData[i].total).toFixed(2)
  484. case 4:
  485. // 圆环图各环节的颜色
  486. color = ['#247ef4', '#3a3b40'];
  487. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  488. data = [{
  489. name: '已开票',
  490. value: this.chartsData[i].biViewInfoList[0].count
  491. }, {
  492. name: '待开票',
  493. value: this.chartsData[i].biViewInfoList[1].count
  494. }]
  495. text = '合同总额'
  496. formatter = '{b}{c}元 </br> 占比{d}%'
  497. graphicText = ' \n\n开票合计\n\n' + Number(this.chartsData[i].total).toFixed(2)
  498. break;
  499. case 5:
  500. // 圆环图各环节的颜色
  501. color = ['#f49f23', '#3a3b40'];
  502. // 圆环图各环节的名称和值(系列中各数据项的名称和值)
  503. data = [{
  504. name: '已付款',
  505. value: this.chartsData[i].biViewInfoList[0].count
  506. }, {
  507. name: '待付款',
  508. value: this.chartsData[i].biViewInfoList[1].count
  509. }]
  510. text = '合同总额'
  511. formatter = '{b}{c}元 </br> 占比{d}%'
  512. graphicText = ' \n\n付款合计\n\n' + Number(this.chartsData[i].total).toFixed(2)
  513. break;
  514. }
  515. myChart.setOption({
  516. title: [{
  517. text: text,
  518. top: '2%',
  519. left: '3%',
  520. textStyle: {
  521. color: '#f4f4f4',
  522. fontSize: 18,
  523. }
  524. }],
  525. // 图例
  526. legend: [{
  527. selectedMode: true, // 图例选择的模式,控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 false 关闭。
  528. top: '10%',
  529. left: 'center',
  530. con: "circle",
  531. itemWidth: 10, // 设置宽度
  532. itemHeight: 10, // 设置高度
  533. itemGap: 40, // 设置间距
  534. textStyle: { // 图例的公用文本样式。
  535. fontSize: 14,
  536. color: '#fff'
  537. },
  538. data: data
  539. }],
  540. // 提示框
  541. tooltip: {
  542. show: true, // 是否显示提示框
  543. formatter: formatter // 提示框显示内容,此处{b}表示各数据项名称,此项配置为默认显示项,{c}表示数据项的值,默认不显示,({d}%)表示数据项项占比,默认不显示。
  544. },
  545. // graphic 是原生图形元素组件。可以支持的图形元素包括:image, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  546. graphic: {
  547. type: 'text', // [ default: image ]用 setOption 首次设定图形元素时必须指定。image, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  548. top: 'center', // 描述怎么根据父元素进行定位。top 和 bottom 只有一个可以生效。如果指定 top 或 bottom,则 shape 里的 y、cy 等定位属性不再生效。『父元素』是指:如果是顶层元素,父元素是 echarts 图表容器。如果是 group 的子元素,父元素就是 group 元素。
  549. left: 'center', // 同上
  550. style: {
  551. text: graphicText, // 文本块文字。可以使用 \n 来换行。[ default: '' ]
  552. fill: '#fff', // 填充色。
  553. fontSize: 16, // 字体大小
  554. fontWeight: 'bold' // 文字字体的粗细,可选'normal','bold','bolder','lighter'
  555. }
  556. },
  557. // 系列列表
  558. series: [{
  559. name: '', // 系列名称
  560. type: 'pie', // 系列类型
  561. center: ['50%', '55%'], // 饼图的中心(圆心)坐标,数组的第一项是横坐标,第二项是纵坐标。[ default: ['50%', '50%'] ]
  562. radius: ['45%', '55%'], // 饼图的半径,数组的第一项是内半径,第二项是外半径。[ default: [0, '75%'] ]
  563. hoverAnimation: true, // 是否开启 hover 在扇区上的放大动画效果。[ default: true ]
  564. color: color, // 圆环图的颜色
  565. label: { // 饼图图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等.
  566. normal: {
  567. show: true, // 是否显示标签[ default: false ]
  568. position: 'outside', // 标签的位置。'outside'饼图扇区外侧,通过视觉引导线连到相应的扇区。'inside','inner' 同 'inside',饼图扇区内部。'center'在饼图中心位置。
  569. formatter: '{c}', // 标签内容
  570. color: '#d5d5d6',
  571. fontSize: 16,
  572. }
  573. },
  574. labelLine: { // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线。
  575. normal: {
  576. show: true, // 是否显示视觉引导线。
  577. length: 15, // 在 label 位置 设置为'outside'的时候会显示视觉引导线。
  578. length2: 10, // 视觉引导项第二段的长度。
  579. lineStyle: { // 视觉引导线的样式
  580. //color: '#000',
  581. //width: 1
  582. }
  583. }
  584. },
  585. data: data // 系列中的数据内容数组。
  586. }]
  587. })
  588. myChart.off("click");
  589. myChart.on("click", function(params) {
  590. // var a = params.dataIndex
  591. console.log(params, "我被点击了");
  592. app.dialogVisible = true
  593. })
  594. }
  595. // 柱状图
  596. let myChart7 = app.$echarts.init(this.$refs.myEchart7);
  597. var zoption = {
  598. // ---- 标题 -----
  599. // title: {
  600. // text: '',//主标题
  601. // textStyle: {
  602. // color: 'red'
  603. // },
  604. // subtext: '',//副标题
  605. // subtextStyle: {
  606. // color: 'blue'
  607. // },
  608. // padding: [0, 0, 10, 100] // 位置
  609. // },
  610. // ---- legend ----
  611. // legend: {
  612. // type: 'plain', // 图列类型,默认为 'plain'
  613. // top: '1%', // 图列相对容器的位置 top\bottom\left\right
  614. // selected: {
  615. // // '销量': true // 图列选择,图形加载出来会显示选择的图列,默认为true
  616. // },
  617. // textStyle: { // 图列内容样式
  618. // color: '#fff', // 字体颜色
  619. // backgroundColor: 'black' // 字体背景色
  620. // },
  621. // tooltip: { // 图列提示框,默认不显示
  622. // show: true,
  623. // color: '#666'
  624. // },
  625. // data: [ // 图列内容
  626. // {
  627. // name: '', //上方标题内容
  628. // icon: 'circle',
  629. // textStyle: {
  630. // color: '#666', // 单独设置某一个图列的颜色
  631. // backgroundColor: '#fff' // 单独设置某一个图列的字体背景色
  632. // }
  633. // }
  634. // ]
  635. // },
  636. grid: {
  637. left: '0',
  638. right: '0',
  639. bottom: '0',
  640. top: '30',
  641. containLabel: true
  642. },
  643. // --- 提示框 ----
  644. tooltip: {
  645. show: true, // 是否显示提示框,默认为true
  646. trigger: 'item', // 数据项图形触发
  647. axisPointer: { // 指示样式
  648. type: 'shadow',
  649. axis: 'auto'
  650. },
  651. padding: 5,
  652. textStyle: { // 提示框内容的样式
  653. color: '#fff'
  654. }
  655. },
  656. // ---- gird区域 ---
  657. // gird: {
  658. // show: false, // 是否显示直角坐标系网格
  659. // top: 10, // 相对位置 top\bottom\left\right
  660. // containLabel: false, // gird 区域是否包含坐标轴的刻度标签
  661. // tooltip: {
  662. // show: true,
  663. // trigger: 'item', // 触发类型
  664. // textStyle: {
  665. // color: '#666'
  666. // }
  667. // }
  668. // },
  669. // ------ X轴 ------
  670. xAxis: {
  671. // show: true, // 是否显示
  672. // position: 'bottom', // x轴的位置
  673. // offset: 0, // x轴相对于默认位置的偏移
  674. // type: 'category', // 轴类型, 默认为 'category'
  675. // name: '', // 轴名称
  676. // nameLocation: 'end', // 轴名称相对位置
  677. // nameTextStyle: { // 坐标轴名称样式
  678. // color: '#666',
  679. // padding: [5, 0, 0, -5]
  680. // },
  681. // nameGap: 30, // 坐标轴名称与轴线之间的距离
  682. // nameRotate: 0, // 坐标轴名字旋转
  683. // axisLine: { // 坐标轴 轴线
  684. // show: true, // 是否显示
  685. // // symbol: ['none', 'arrow'], // 是否显示轴线箭头
  686. // // symbolSize: [8, 8], // 箭头大小
  687. // // symbolOffset: [0, 7], // 箭头位置
  688. // // ------ 线 ---------
  689. // lineStyle: {
  690. // color: '#666',
  691. // width: 1,
  692. // type: 'solid'
  693. // }
  694. // },
  695. // axisTick: { // 坐标轴 刻度
  696. // show: true, // 是否显示
  697. // inside: true, // 是否朝内
  698. // length: 3, // 长度
  699. // lineStyle: { // 默认取轴线的样式
  700. // color: '#666',
  701. // width: 1,
  702. // type: 'solid'
  703. // }
  704. // },
  705. axisLabel: { // 坐标轴标签
  706. show: true, // 是否显示
  707. inside: false, // 是否朝内
  708. rotate: 0, // 旋转角度
  709. margin: 10, // 刻度标签与轴线之间的距离
  710. color: '#666', // 默认取轴线的颜色
  711. interval: 0,
  712. rotate: 40
  713. },
  714. // splitLine: { // gird区域中的分割线
  715. // show: false, // 是否显示
  716. // lineStyle: {
  717. // // color: 'red',
  718. // // width: 1,
  719. // // type: 'solid'
  720. // }
  721. // },
  722. splitArea: { // 网格区域
  723. show: false // 是否显示,默认为false
  724. },
  725. data: ['玉米', '玉米(潮粮)', '玉米(酒精)', '玉米(机收)', '混合麦', '白小麦', '大豆', '水稻', '高粱', '玉米淀粉', '豆粕']
  726. },
  727. // ------ y轴 ----------
  728. yAxis: {
  729. // show: true, // 是否显示
  730. // position: 'left', // y轴位置
  731. // offset: 0, // y轴相对于默认位置的偏移
  732. // type: 'value', // 轴类型,默认为 ‘category’
  733. // // name: '销量', // 轴名称
  734. // nameLocation: 'end', // 轴名称相对位置value
  735. // nameTextStyle: { // 坐标轴名称样式
  736. // color: '#fff',
  737. // padding: [5, 0, 0, 5] // 坐标轴名称相对位置
  738. // },
  739. // nameGap: 15, // 坐标轴名称与轴线之间的距离
  740. // nameRotate: 270, // 坐标轴名字旋转
  741. axisLine: { // 坐标轴 轴线
  742. show: false, // 是否显示
  743. // ----- 箭头 -----
  744. // symbol: ['none', 'arrow'], // 是否显示轴线箭头
  745. // symbolSize: [8, 8], // 箭头大小
  746. // symbolOffset: [0, 7], // 箭头位置
  747. // ----- 线 -------
  748. // lineStyle: {
  749. // color: '#666',
  750. // width: 1,
  751. // type: 'solid'
  752. // }
  753. },
  754. // axisTick: { // 坐标轴的刻度
  755. // show: true, // 是否显示
  756. // inside: true, // 是否朝内
  757. // length: 3, // 长度
  758. // lineStyle: {
  759. // color: '#666', // 默认取轴线的颜色
  760. // width: 1,
  761. // type: 'solid'
  762. // }
  763. // },
  764. axisLabel: { // 坐标轴的标签
  765. show: true, // 是否显示
  766. inside: false, // 是否朝内
  767. rotate: 0, // 旋转角度
  768. margin: 8, // 刻度标签与轴线之间的距离
  769. color: '#666', // 默认轴线的颜色
  770. },
  771. splitLine: { // gird 区域中的分割线
  772. show: true, // 是否显示
  773. lineStyle: {
  774. color: '#666',
  775. width: 1,
  776. type: 'dashed'
  777. }
  778. },
  779. // splitArea: { // 网格区域
  780. // show: false // 是否显示,默认为false
  781. // }
  782. },
  783. // ------- 内容数据 -------
  784. series: [{
  785. name: '储量', // 序列名称
  786. type: 'bar', // 类型
  787. legendHoverLink: true, // 是否启用图列 hover 时的联动高亮
  788. // label: { // 图形上的文本标签
  789. // show: false,
  790. // position: 'insideTop', // 相对位置
  791. // rotate: 0, // 旋转角度
  792. // color: '#eee'
  793. // },
  794. itemStyle: { // 图形的形状
  795. color: '#3779fd'
  796. // barBorderRadius: [18, 18, 0 ,0]
  797. },
  798. barWidth: 20, // 柱形的宽度
  799. barCategoryGap: '20%', // 柱形的间距
  800. label: {
  801. show: true,
  802. position: 'top',
  803. color: "#b0b1b3"
  804. },
  805. data: [3000, 4000, 4200, 4500, 6000, 5600, 4500, 5020, 4500, 5400, 4300]
  806. }]
  807. };
  808. myChart7.setOption(zoption)
  809. },
  810. handleClose(done) {
  811. this.$confirm('确认关闭?')
  812. .then(_ => {
  813. done();
  814. })
  815. .catch(_ => {});
  816. },
  817. // 下载通知通函
  818. downloadNotification(item) {
  819. zipDown({
  820. appendixIds: item.attachmentPath,
  821. baseUrl: this.$store.getters.baseInfo.fileUrl,
  822. zipName: item.theme
  823. })
  824. },
  825. /**
  826. * 校验各种弹框问题
  827. * @Desc 不是本人原意, 请不要骂我 谢谢. 请联系 "后台开发人员" 梳理逻辑
  828. */
  829. async checkUserInfoDialog() {
  830. const {
  831. statusFlag,
  832. loginInfo: {
  833. loginFlag = 0
  834. },
  835. daysRemaining,
  836. customerServiceStaffPhone
  837. } = JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser'))
  838. if (statusFlag * 1 === 3) {
  839. // 判断后台返回的是空 还是 0 是空还是 0 的时候请求后台接口 不懂啥意思 为啥要这么弄
  840. if (!loginFlag && !localStorage.getItem('isShowTryUserDialog') * 1) {
  841. let newId = JSON.parse(localStorage.getItem('ws_login_accountId'))
  842. this.phone = customerServiceStaffPhone
  843. this.successfulDialog = true
  844. localStorage.setItem('isShowTryUserDialog', '1')
  845. await getChangeLoginFlag({
  846. accountId: newId
  847. }).toPromise()
  848. }
  849. }
  850. // 试用租户
  851. const dayDialog = [30, 15, 7, 5, 3, 2, 1, 0]
  852. if (statusFlag * 1 === 2 && dayDialog.indexOf(daysRemaining) > -1 && !localStorage.getItem(
  853. 'isShowTryUserDialog') * 1) {
  854. this.day = daysRemaining
  855. this.phone = customerServiceStaffPhone
  856. this.trialNotExpired = true
  857. localStorage.setItem('isShowTryUserDialog', '1')
  858. }
  859. },
  860. trialNotExpiredClose() {
  861. this.trialNotExpired = false
  862. },
  863. //第一次登陆的弹窗
  864. successfulDialogClose() {
  865. this.successfulDialog = false
  866. },
  867. initShipMap() {
  868. var options = {
  869. ak: '57df9eaa033b44809d4bdaf919af457e',
  870. // 初始中心点坐标
  871. centerPoint: [30.171, 121.27],
  872. zoom: 3,
  873. minZoom: 2,
  874. maxZoom: 18,
  875. defaultMapType: 'MT_SEA', //默认海图
  876. // 公司版权信息( 支持html ),默认Elane Inc.
  877. attribution: {
  878. isShow: false,
  879. emptyString: '&copy;2019 <a class="shipxy_small"></a>&nbsp;<a>WinSea Inc.</a>'
  880. },
  881. measureCtrl: {
  882. isShow: false
  883. },
  884. mousePostionCtrl: {
  885. isShow: false
  886. },
  887. zoomControlElane: {
  888. isShow: true,
  889. position: 'bottomright'
  890. },
  891. zoomviewControl: {
  892. isShow: false,
  893. position: 'bottomright'
  894. },
  895. basemapsControl: {
  896. isShow: false,
  897. position: 'topright'
  898. },
  899. scaleCtrl: {
  900. isShow: true,
  901. position: 'bottomleft'
  902. }
  903. }
  904. // 创建地图示例
  905. // eslint-disable-next-line no-undef
  906. this.mapXY = new ShipxyAPI.Map('mapXY', options)
  907. // eslint-disable-next-line no-undef
  908. this.shipService = ShipxyAPI.ShipService(this.mapXY, {
  909. enableAreaShip: false,
  910. enableFleetShip: false,
  911. isAutoUpdateSrvtime: false,
  912. // delayTime: 5000,
  913. lableFont: ['500 12px Arial', '500 12px 宋体'], // 船舶名称,文字字体,默认值:["600 12px Arial", "500 12px Arial"]
  914. lableTxtColor: ['#fff', '#fff'], // 船舶名称,文字颜色,默认值:["#000","#fff"]
  915. lableLineColor: ['rgba(1, 30, 62, 0)', 'rgba(1, 30, 62, 0)'], // 边框颜色,默认值:["#000","#000"]
  916. lableLinefillColor: ['rgba(0, 0, 0, 0.6)', 'rgba(0, 0, 0, 0.6)'], // 框内填充颜色,默认值:[null,null]
  917. obliqueLineColor: ['#000', '#000'], // 船舶名称,斜线颜色,默认值:[null,null]
  918. dShipColor: '#FF6437', // D+船颜色,默认:#ff6347
  919. zoomLevel_data: 1,
  920. zoomLevel_base: 1,
  921. getAreaShipsCallBack: (call) => {
  922. // console.info(call, 'getAreaShipsCallBack')
  923. },
  924. drawShipsEndCallBack: (call) => {
  925. // console.info(call, 'drawShipsEndCallBack')
  926. }
  927. })
  928. this.shipService.setPointerEvents(true)
  929. window.shipService = this.shipService
  930. //获取船舶列表
  931. this.getShipList()
  932. },
  933. toRoute(url) {
  934. this.$router.push(url)
  935. },
  936. toSetShow() {
  937. this.showBlockList = []
  938. this.setFlag = true
  939. // getStaffHomeShowList({
  940. // staffId: localStorage.getItem('ws-pf_userId')
  941. // }).toPromise().then(data => {
  942. // for (let i = 0; i < data.length; i++) {
  943. // if (data[i].typeId === 'shipMap' && data[i].showFlag) {
  944. // this.showBlockList.push('船舶动态')
  945. // } else {
  946. // this.showBlockList = []
  947. // }
  948. // }
  949. // })
  950. },
  951. toMap() {
  952. this.$router.push('/map/trajectory_child')
  953. },
  954. goNews() {
  955. this.$router.push('/news/noticeType')
  956. },
  957. goNewsDetail(id) {
  958. this.$router.push('/news/noticeDetails?id=' + id)
  959. },
  960. goNotice(data) {
  961. this.$router.push({
  962. name: 'notificationItDetail',
  963. query: {
  964. id: data.id
  965. }
  966. })
  967. },
  968. goNoticeMore() {
  969. this.$router.push('/notice/notificationCircularReleasedIt_child')
  970. },
  971. toHide(index) {
  972. this.changeVesslBank([{
  973. id: this.userSetting['shipMap'][0].id,
  974. staffId: localStorage.getItem('ws-pf_userId'),
  975. typeId: 'shipMap',
  976. showFlag: false
  977. }])
  978. },
  979. getRouteList() {
  980. let data = {
  981. accountId: localStorage.getItem('ws-pf_userId'),
  982. pageSize: 30
  983. }
  984. findHottestRouting(data).toPromise().then(res => {
  985. this.routeList = res
  986. if (res.length == 0) {
  987. this.blockList[0].flag = false
  988. }
  989. })
  990. },
  991. //获取新闻
  992. getNewList() {
  993. let data = {
  994. currentPage: 1,
  995. pageSize: 2,
  996. loginUserId: localStorage.getItem('ws-pf_userId'),
  997. compId: localStorage.getItem('ws-pf_compId'),
  998. releaseFlag: 0
  999. }
  1000. // queryHomePage(data).toPromise().then(resNewList => {
  1001. // for (let i of resNewList) {
  1002. // i.content = '<p>' + i.content.replace(/<[^>]+>/g, '') + '</p>'
  1003. // }
  1004. // this.newList = resNewList
  1005. // for (let i of this.newList) {
  1006. // if (i.ossCoverUrl && i.ossCoverUrl.length > 0) {
  1007. // } else {
  1008. // this.$set(
  1009. // i,
  1010. // 'imgUrl',
  1011. // require('@/assets/images/page/home/noImg.png')
  1012. // )
  1013. // }
  1014. // }
  1015. // })
  1016. },
  1017. //获取通知通函
  1018. // getNoticeList () {
  1019. // let pagesize = Math.floor((this.$refs.noticeList.clientHeight - 44) / 80)
  1020. // let data = {
  1021. // currentPage: 1,
  1022. // pageSize: pagesize || 3,
  1023. // vesselDeptId:
  1024. // localStorage.getItem('ws-pf_vesselBankFlag') === 'V'
  1025. // ? localStorage.getItem('ws-pf_vesselId')
  1026. // : localStorage.getItem('ws-pf_deptId'),
  1027. // compId: localStorage.getItem('ws-pf_compId')
  1028. // }
  1029. // // TODO: 【此处有问题】接口变更的不对
  1030. // queryCircularManagementReceiveList(data)
  1031. // .toPromise()
  1032. // .then(response => {
  1033. // this.noticeList = response.records
  1034. // })
  1035. // },
  1036. // 获取船舶状态
  1037. getNaviStatusStr(t) {
  1038. var array = [
  1039. this.$t('home.navistatus0'),
  1040. this.$t('home.navistatus1'),
  1041. this.$t('home.navistatus2'),
  1042. this.$t('home.navistatus3'),
  1043. this.$t('home.navistatus4'),
  1044. this.$t('home.navistatus5'),
  1045. this.$t('home.navistatus6'),
  1046. this.$t('home.navistatus7'),
  1047. this.$t('home.navistatus8')
  1048. ]
  1049. if (t >= 0 && t <= 8) {
  1050. return array[t]
  1051. }
  1052. return ''
  1053. },
  1054. // 获取船舶状态
  1055. getNaviStatusBg(t) {
  1056. var array = [
  1057. 'bg0',
  1058. 'bg1',
  1059. 'bg2',
  1060. 'bg3',
  1061. 'bg4',
  1062. 'bg5',
  1063. 'bg6',
  1064. 'bg7',
  1065. 'bg8'
  1066. ]
  1067. if (t >= 0 && t <= 8) {
  1068. return array[t]
  1069. }
  1070. return ''
  1071. },
  1072. getShipList() {
  1073. getUserVesselList({
  1074. vesselStatus: 'UNDER_CONTROL'
  1075. }).toPromise().then(res => {
  1076. this.shipList = []
  1077. let num = res.length > 10 ? 10 : res.length
  1078. let obj = {}
  1079. for (let i = 0; i < num; i++) {
  1080. if (res[i].mmsiCode && res[i].mmsiCode.length > 0) {
  1081. obj = this.shipService.getShipByMmsi(res[i].mmsiCode) ?
  1082. this.shipService.getShipByMmsi(res[i].mmsiCode) : {}
  1083. obj.vesselName = res[i].vesselName
  1084. this.shipList.push(obj)
  1085. }
  1086. }
  1087. //我想不出还有什么招了:临时解决办法
  1088. const oldList = this.shipList
  1089. for (let i = 1; i < 5; i++) {
  1090. oldList.forEach(item => {
  1091. this.shipList.push(item)
  1092. })
  1093. }
  1094. })
  1095. },
  1096. onTodoClick() {
  1097. this.$router.push({
  1098. name: 'workNotification'
  1099. })
  1100. },
  1101. onMsgClick() {
  1102. this.$router.push({
  1103. name: 'message'
  1104. })
  1105. },
  1106. onChange(list) {},
  1107. onShipMenuItemClick(ship) {
  1108. this.selectShip = ship
  1109. if (ship) {
  1110. this.$refs.shipMap.selectShip(ship.id)
  1111. } else {
  1112. this.$refs.shipMap.unSelectShip()
  1113. }
  1114. },
  1115. onFullScreen() {
  1116. this.isFullScreen = !this.isFullScreen
  1117. },
  1118. onNoticeMoreBtnClick() {
  1119. this.$router.push({
  1120. name: 'notice'
  1121. })
  1122. },
  1123. onShipSelectEvent(shipid) {
  1124. this.selectShip = this.ships.find(item => {
  1125. return item.id == shipid
  1126. })
  1127. },
  1128. getCityName(encity) {
  1129. if (getLanguage() === 'zh') {
  1130. return getCnCity(encity)
  1131. }
  1132. return encity
  1133. },
  1134. getWeaName(enwea) {
  1135. if (getLanguage() === 'zh') {
  1136. return getCnWea(enwea)
  1137. }
  1138. return enwea
  1139. },
  1140. gotoNewRw(data) {
  1141. if (data === 'message') {
  1142. this.$router.push({
  1143. name: 'message',
  1144. query: {
  1145. types: data
  1146. }
  1147. })
  1148. } else {
  1149. this.$router.push({
  1150. name: 'workNotification',
  1151. query: {
  1152. types: data
  1153. }
  1154. })
  1155. }
  1156. },
  1157. test() {
  1158. console.log('testtesttesttest');
  1159. },
  1160. async test1() {
  1161. console.log('testtesttesttest111111');
  1162. },
  1163. async openPort() {
  1164. console.log('openPort', navigator);
  1165. if ('serial' in navigator) {
  1166. // The Web Serial API is supported.
  1167. console.log('the Web Serial API is supported.');
  1168. console.log(this.param);
  1169. const port = await navigator.serial.requestPort();
  1170. await port.open({
  1171. baudRate: this.param
  1172. }); // set baud rate
  1173. this.reader = port.readable.getReader();
  1174. // 监听来自串行设备的数据
  1175. while (true) {
  1176. const {
  1177. value,
  1178. done
  1179. } = await this.reader.read();
  1180. if (done) {
  1181. // 允许稍后关闭串口。
  1182. this.reader.releaseLock();
  1183. break;
  1184. }
  1185. console.log('value:', value);
  1186. var result = '';
  1187. var flag = false;
  1188. for (var i = value.length - 1; i >= 0; i--) {
  1189. var tmp = String.fromCharCode(value[i])
  1190. if (tmp == '=') {
  1191. flag = true
  1192. }
  1193. if (flag && result.length < 9 && tmp != '=') {
  1194. result += tmp
  1195. }
  1196. }
  1197. setTimeout(1000)
  1198. if (parseInt(result)) {
  1199. console.log('result:', result);
  1200. this.text = parseInt(result)
  1201. }
  1202. console.log('this.text:', this.text);
  1203. // value 是一个 Uint8Array
  1204. }
  1205. await port.close();
  1206. } else {
  1207. console.log('the Web Serial API is not supported.', navigator);
  1208. }
  1209. },
  1210. async closePort() {
  1211. console.log('closePort');
  1212. this.reader.cancel()
  1213. }
  1214. }
  1215. }
  1216. </script>
  1217. <style lang="scss" scoped>
  1218. .home {
  1219. padding: 10px;
  1220. overflow-y: auto;
  1221. // background-color: #eee;
  1222. width: 100%;
  1223. height: calc(100vh - 60px);
  1224. .set-img {
  1225. width: 25px;
  1226. height: 25px;
  1227. position: fixed;
  1228. right: 0;
  1229. bottom: 99px;
  1230. z-index: 1000;
  1231. }
  1232. .shortcut-entrance {
  1233. width: 100%;
  1234. height: 60px;
  1235. background: #fff;
  1236. margin-bottom: 10px;
  1237. padding: 0 20px;
  1238. line-height: 60px;
  1239. display: flex;
  1240. justify-content: space-between;
  1241. align-items: center;
  1242. .shortcut-entrance-left {
  1243. font-size: 16px;
  1244. font-weight: bold;
  1245. color: #333333;
  1246. width: 50%;
  1247. overflow: hidden;
  1248. height: 100%;
  1249. }
  1250. .shortcut-entrance-right {
  1251. width: 14px;
  1252. height: 14px;
  1253. }
  1254. }
  1255. .body-middle {
  1256. display: flex;
  1257. width: 100%;
  1258. height: calc(100vh - 60px);
  1259. .body-middle-left {
  1260. width: 100%;
  1261. // margin-right: 10px;
  1262. .panel-list {
  1263. display: flex;
  1264. color: #ffffff;
  1265. text-shadow: 0px 1px 1px rgba(111, 52, 0, 0.55);
  1266. }
  1267. .ship-list-body {
  1268. position: relative;
  1269. width: 300px;
  1270. margin-top: 10px;
  1271. .shipList-box {
  1272. width: 85%;
  1273. margin: 0 auto;
  1274. .shipList-icon {
  1275. position: absolute;
  1276. top: 6px;
  1277. left: 0px;
  1278. }
  1279. .shipList-name {
  1280. cursor: context-menu;
  1281. font-size: 16px;
  1282. font-weight: bold;
  1283. line-height: 26px;
  1284. color: #333333;
  1285. max-width: 100px;
  1286. white-space: nowrap;
  1287. overflow: hidden;
  1288. text-overflow: ellipsis;
  1289. }
  1290. .shipList-address {
  1291. cursor: context-menu;
  1292. font-size: 14px;
  1293. color: #666666;
  1294. line-height: 35px;
  1295. }
  1296. .shipList-time {
  1297. cursor: context-menu;
  1298. font-size: 14px;
  1299. color: #666666;
  1300. line-height: 20px;
  1301. }
  1302. .ship-list-status {
  1303. cursor: context-menu;
  1304. margin-left: 20px;
  1305. padding: 5px 10px;
  1306. border-radius: 20px;
  1307. color: #fff;
  1308. max-width: 90px;
  1309. white-space: nowrap;
  1310. overflow: hidden;
  1311. text-overflow: ellipsis;
  1312. }
  1313. .bg0 {
  1314. background: #7ed321;
  1315. }
  1316. .bg1 {
  1317. background: #ff8f00;
  1318. }
  1319. .bg2 {
  1320. background: #495b61;
  1321. }
  1322. .bg3 {
  1323. background: #4fc3f7;
  1324. }
  1325. .bg4 {
  1326. background: #26a69a;
  1327. }
  1328. .bg5 {
  1329. background: #9c7fee;
  1330. }
  1331. .bg6 {
  1332. background: #ff5722;
  1333. }
  1334. .bg7 {
  1335. background: #8d6e63;
  1336. }
  1337. .bg8 {
  1338. background: #fadd60;
  1339. }
  1340. }
  1341. }
  1342. .notice-list {
  1343. width: calc(50% - 7px);
  1344. background: #fff;
  1345. margin-top: 10px;
  1346. // height: calc(100% - 180px);
  1347. // min-height: 460px;
  1348. border-radius: 4px;
  1349. // float: left;
  1350. }
  1351. .news-list {
  1352. width: calc(50% - 7px);
  1353. // float: left;
  1354. background: #fff;
  1355. margin-top: 10px;
  1356. // height: calc(100% - 180px);
  1357. height: 285px;
  1358. overflow: hidden;
  1359. // min-height: 460px;
  1360. border-radius: 4px;
  1361. // margin-right: 10px;
  1362. .new-list-box {
  1363. padding: 0 10px;
  1364. .new-list-body:first-child {
  1365. padding-bottom: 20px;
  1366. border-bottom: 1px solid #eeeeee;
  1367. }
  1368. .new-list-body:last-child {
  1369. padding-top: 20px;
  1370. }
  1371. }
  1372. .new-list-body {
  1373. width: 100%;
  1374. padding: 10px 0;
  1375. display: flex;
  1376. border-bottom: 1px solid #eeeeee;
  1377. // height: 50%;
  1378. overflow: hidden;
  1379. // padding: 10px;
  1380. // display: flex;
  1381. .new-list-img {
  1382. // height: 100%;
  1383. width: 160px;
  1384. height: 100px;
  1385. position: relative;
  1386. // margin-right: 20px;
  1387. .newsTJ {
  1388. position: absolute;
  1389. width: 54px;
  1390. height: 50px;
  1391. left: 0;
  1392. top: 0;
  1393. }
  1394. img {
  1395. width: 100%;
  1396. height: 100%;
  1397. display: block;
  1398. }
  1399. }
  1400. .new-list-title {
  1401. color: #343434;
  1402. line-height: 30px;
  1403. font-size: 14px;
  1404. font-weight: bold;
  1405. overflow: hidden;
  1406. text-overflow: ellipsis;
  1407. white-space: nowrap;
  1408. span {
  1409. cursor: pointer;
  1410. display: block;
  1411. }
  1412. }
  1413. .new-list-content {
  1414. color: #666666;
  1415. font-size: 12px;
  1416. line-height: 16px;
  1417. display: -webkit-box;
  1418. -webkit-box-orient: vertical;
  1419. -webkit-line-clamp: 3;
  1420. overflow: hidden;
  1421. height: 48px;
  1422. span {
  1423. cursor: pointer;
  1424. display: block;
  1425. }
  1426. }
  1427. .new-list-date {
  1428. color: #999999;
  1429. font-size: 12px;
  1430. text-align: right;
  1431. line-height: 22px;
  1432. span {
  1433. cursor: pointer;
  1434. display: block;
  1435. }
  1436. }
  1437. }
  1438. // .new-list-body:hover {
  1439. // background: #e2edfa;
  1440. // cursor: pointer;
  1441. // }
  1442. .no-line {
  1443. border-bottom: 0px solid #eeeeee;
  1444. }
  1445. }
  1446. .v-width {
  1447. width: calc(50% - 7px);
  1448. }
  1449. }
  1450. .body-middle-right {
  1451. width: calc(30% - 10px);
  1452. .notice-list {
  1453. height: 50%;
  1454. background: #fff;
  1455. width: 100%;
  1456. min-height: 300px;
  1457. border-radius: 4px;
  1458. .notice-list-body {
  1459. border-bottom: 1px solid #eeeeee;
  1460. padding: 20px 10px;
  1461. .notice-list-title {
  1462. color: #333333;
  1463. font-size: 14px;
  1464. font-weight: bold;
  1465. line-height: 18px;
  1466. overflow: hidden;
  1467. text-overflow: ellipsis;
  1468. white-space: nowrap;
  1469. }
  1470. .notice-list-type {
  1471. margin: 9px 0 12px 0;
  1472. color: #666666;
  1473. }
  1474. .notice-list-person {
  1475. color: #666666;
  1476. font-size: 12px;
  1477. }
  1478. .notice-list-date {
  1479. color: #666666;
  1480. font-size: 12px;
  1481. margin-top: 10px;
  1482. }
  1483. }
  1484. .notice-list-body:hover {
  1485. background: #e2edfa;
  1486. cursor: pointer;
  1487. }
  1488. .notice-body-height {
  1489. height: 50%;
  1490. }
  1491. .notice-body-height1 {
  1492. height: 20%;
  1493. }
  1494. }
  1495. .notice-list-height {
  1496. height: 100%;
  1497. min-height: 638px;
  1498. }
  1499. .ship-list {
  1500. height: calc(50% - 10px);
  1501. margin-top: 10px;
  1502. background: #fff;
  1503. width: 100%;
  1504. min-height: 327px;
  1505. border-radius: 4px;
  1506. .ship-list-body {
  1507. padding: 20px 0;
  1508. border-bottom: 1px solid #eeeeee;
  1509. .ship-list-head {
  1510. display: flex;
  1511. img {
  1512. width: 14px;
  1513. height: 14px;
  1514. }
  1515. .ship-list-name {
  1516. margin: 0 20px;
  1517. font-weight: bold;
  1518. }
  1519. .ship-list-status {
  1520. border-radius: 10px;
  1521. padding: 4px 8px;
  1522. color: #ffffff;
  1523. }
  1524. .bg0 {
  1525. background: #7ed321;
  1526. }
  1527. .bg1 {
  1528. background: #ff8f00;
  1529. }
  1530. .bg2 {
  1531. background: #495b61;
  1532. }
  1533. .bg3 {
  1534. background: #4fc3f7;
  1535. }
  1536. .bg4 {
  1537. background: #26a69a;
  1538. }
  1539. .bg5 {
  1540. background: #9c7fee;
  1541. }
  1542. .bg6 {
  1543. background: #ff5722;
  1544. }
  1545. .bg7 {
  1546. background: #8d6e63;
  1547. }
  1548. .bg8 {
  1549. background: #fadd60;
  1550. }
  1551. }
  1552. .ship-list-address {
  1553. margin: 10px 0 10px 34px;
  1554. color: #666666;
  1555. }
  1556. .ship-list-date {
  1557. color: #666666;
  1558. margin-left: 34px;
  1559. }
  1560. }
  1561. /*.ship-list-body:hover{*/
  1562. /* background: #e2edfa;*/
  1563. /*}*/
  1564. }
  1565. }
  1566. }
  1567. .body-middle-height {
  1568. height: calc(100vh - 80px);
  1569. }
  1570. .list-title {
  1571. width: 100%;
  1572. // background: #f3f9fe;
  1573. background: url('~@/assets/newhome/titilebg.png') no-repeat;
  1574. background-size: 100% 100%;
  1575. height: 44px;
  1576. padding: 0 20px;
  1577. display: flex;
  1578. line-height: 44px;
  1579. justify-content: space-between;
  1580. border-radius: 4px 4px 0 0;
  1581. .list-title-name {
  1582. font-size: 16px;
  1583. font-weight: bold;
  1584. color: #333333;
  1585. }
  1586. .list-title-more {
  1587. font-size: 14px;
  1588. color: #666666;
  1589. cursor: pointer;
  1590. display: flex;
  1591. }
  1592. }
  1593. }
  1594. .el-dropdown-menu {
  1595. margin-top: -20px !important;
  1596. /*left: 1872px !important;*/
  1597. }
  1598. .seamless-warp {
  1599. // width: 100%;
  1600. width: 100%;
  1601. overflow: hidden;
  1602. margin-top: 10px;
  1603. }
  1604. .home-tzthList:nth-of-type(3) {
  1605. border: none;
  1606. }
  1607. .home-tzthList {
  1608. display: flex;
  1609. padding: 10px;
  1610. border-bottom: 1px solid #eeeeee;
  1611. .home-tzthList-type {
  1612. width: 100%;
  1613. display: flex;
  1614. font-size: 14px;
  1615. line-height: 28px;
  1616. font-weight: bold;
  1617. .home-tzthList-type-title {
  1618. color: #343434;
  1619. margin: 0;
  1620. span {
  1621. cursor: pointer;
  1622. }
  1623. }
  1624. .home-tzthList-type-theme {
  1625. color: #666666;
  1626. margin: 0;
  1627. width: 80%;
  1628. overflow: hidden;
  1629. white-space: nowrap;
  1630. text-overflow: ellipsis;
  1631. span {
  1632. cursor: pointer;
  1633. }
  1634. }
  1635. }
  1636. .home-tzthList-people {
  1637. display: flex;
  1638. justify-content: space-between;
  1639. line-height: 22px;
  1640. .home-tzthList-Personnel,
  1641. .home-tzthList-timer {
  1642. font-size: 12px;
  1643. color: #666666;
  1644. span {
  1645. cursor: pointer;
  1646. }
  1647. }
  1648. }
  1649. }
  1650. .noMore {
  1651. position: absolute;
  1652. margin: auto;
  1653. top: 0;
  1654. bottom: 0;
  1655. left: 0;
  1656. right: 0;
  1657. }
  1658. .ship-list {
  1659. width: 100%;
  1660. border-radius: 4px;
  1661. background-color: #fff;
  1662. }
  1663. //新增的图表的样式
  1664. .chart {
  1665. display: flex;
  1666. flex-wrap: wrap;
  1667. justify-content: space-between;
  1668. margin-bottom: 10px;
  1669. }
  1670. .home-tzthList-timer-left {
  1671. width: 10%;
  1672. display: flex;
  1673. align-items: center;
  1674. img {
  1675. cursor: pointer;
  1676. width: 24px;
  1677. height: 24px;
  1678. display: block;
  1679. align-items: center;
  1680. margin: 0 auto;
  1681. }
  1682. }
  1683. .header {
  1684. // background: rgb(36, 38, 45);
  1685. background: #2a2a2a;
  1686. padding: 20px;
  1687. box-sizing: border-box;
  1688. display: flex;
  1689. justify-content: space-between;
  1690. align-items: center;
  1691. .right {
  1692. color: white;
  1693. font-weight: 700;
  1694. text-align: center;
  1695. .top {
  1696. font-size: 14px;
  1697. }
  1698. .bottom {
  1699. font-size: 26px;
  1700. }
  1701. }
  1702. }
  1703. .chart-card {
  1704. // background: rgb(36, 38, 45);
  1705. position: relative;
  1706. background: #2a2a2a;
  1707. width: 350px;
  1708. margin-top: 10px;
  1709. height: 288px;
  1710. // height: 288px;
  1711. }
  1712. .title2 {
  1713. pointer-events: auto;
  1714. display: flex;
  1715. align-items: center;
  1716. justify-content: flex-start;
  1717. color: rgb(255, 255, 255);
  1718. font-weight: bold;
  1719. font-family: "Microsoft Yahei", Arial, "sans-serif";
  1720. font-size: 15px;
  1721. writing-mode: horizontal-tb;
  1722. letter-spacing: 0px;
  1723. text-overflow: ellipsis;
  1724. white-space: nowrap;
  1725. overflow: hidden;
  1726. padding: 10px;
  1727. box-sizing: border-box;
  1728. }
  1729. .content2 {
  1730. // background-color: rgb(27, 28, 30);
  1731. display: flex;
  1732. margin-top: 10px;
  1733. height: calc(100% - 170px);
  1734. h3 {
  1735. pointer-events: auto;
  1736. display: flex;
  1737. align-items: center;
  1738. justify-content: flex-start;
  1739. color: rgb(204, 204, 204);
  1740. font-weight: bold;
  1741. font-family: "Microsoft Yahei", Arial, "sans-serif";
  1742. font-size: 24px;
  1743. writing-mode: horizontal-tb;
  1744. letter-spacing: 0px;
  1745. text-overflow: ellipsis;
  1746. white-space: nowrap;
  1747. overflow: hidden;
  1748. }
  1749. .center-map {
  1750. // background: yellow;
  1751. }
  1752. .content2-aside {
  1753. width: 360px;
  1754. // height: 288px;
  1755. // background: red;
  1756. }
  1757. .content2-middle {
  1758. width: calc(100% - 720px);
  1759. margin: 0 20px 0 15px;
  1760. .left-card {
  1761. display: flex;
  1762. // background: green;
  1763. justify-content: space-evenly;
  1764. .item {
  1765. background: #2a2a2a;
  1766. width: 28%;
  1767. height: 208px;
  1768. position: relative;
  1769. padding-left: 20px;
  1770. p:nth-of-type(1) {
  1771. color: #d5d5d5;
  1772. position: absolute;
  1773. bottom: 70px;
  1774. font-size: 16px;
  1775. }
  1776. p:nth-of-type(2) {
  1777. position: absolute;
  1778. bottom: 0px;
  1779. .number {
  1780. color: #50cad4;
  1781. font-size: 53px;
  1782. font-weight: 700;
  1783. }
  1784. .number-text {
  1785. color: #d5d5d5;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. }
  1791. }
  1792. .home {
  1793. background: rgb(27, 28, 30);
  1794. padding-bottom: 20px
  1795. }
  1796. .home .body-middle-height {
  1797. height: auto;
  1798. }
  1799. .content2-map {
  1800. margin: 0;
  1801. }
  1802. .content3 {
  1803. display: flex;
  1804. justify-content: space-between;
  1805. align-items: center;
  1806. background: #2a2a2a;
  1807. padding: 10px 60px;
  1808. .content3-number {
  1809. margin-left: 40px;
  1810. }
  1811. .blue {
  1812. font-size: 30px;
  1813. color: #50cad4;
  1814. font-weight: 600;
  1815. }
  1816. .yellow {
  1817. font-size: 30px;
  1818. color: #ffa523;
  1819. font-weight: 600;
  1820. }
  1821. .left,
  1822. .right {
  1823. display: flex;
  1824. align-items: center;
  1825. color: #d5d5d5;
  1826. }
  1827. img {
  1828. display: inline-block;
  1829. width: 35px;
  1830. height: 35px;
  1831. }
  1832. }
  1833. .bottom-tip{
  1834. position: absolute;
  1835. z-index: 11;
  1836. color: #8c8c8d;
  1837. right: 10px;
  1838. bottom: 10px;
  1839. }
  1840. </style>