index.vue 58 KB

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