index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <div class="app">
  3. <div class="map">
  4. <!-- <img src="@/assets/images/qkq_mapbg.png"/> -->
  5. <Map3D :geo-json="geoJson" :dbl-click-fn="dblClickFn" :projection-fn-param="projectionFnParam"
  6. style="position: absolute"/>
  7. </div>
  8. <!--头部开始-->
  9. <div class="header">
  10. <h1>城市运行一网统管指挥中心</h1>
  11. </div>
  12. <!--头部结束-->
  13. <!--左侧开始-->
  14. <div class="left_con">
  15. <div class="top_txt">
  16. <b>汽开区</b>
  17. <span>小雨</span>
  18. <span>9~16℃</span>
  19. </div>
  20. <!--土地资源-->
  21. <div class="qkq_tdzy">
  22. <div class="qkq_tit">土地资源</div>
  23. <div class="qkq_tdzy_con">
  24. <div class="dt_txt">
  25. <h2>156.22</h2>
  26. <h3>平方米</h3>
  27. <h4>新增土地</h4>
  28. <h5>20%</h5>
  29. </div>
  30. <div class="dt_con">
  31. <div class="dt_con_c">
  32. <h2>1056.22</h2>
  33. <h3>平方米</h3>
  34. <h4>土地总面积</h4>
  35. </div>
  36. <div class="dt_con_b">
  37. <h4>40%</h4>
  38. <p>环比</p>
  39. </div>
  40. </div>
  41. <div class="dt_txt">
  42. <h2>56.12</h2>
  43. <h3>平方米</h3>
  44. <h4>未归化土地</h4>
  45. <h5>20%</h5>
  46. </div>
  47. </div>
  48. </div>
  49. <!--营商环境-->
  50. <div class="qkq_yshj">
  51. <div class="qkq_tit">营商环境</div>
  52. <div class="qkq_yshj_con">
  53. <div id="yshj" style="top: 40px;"></div>
  54. <div class="qkq_yshj_list">
  55. <p>规上入统<span>1000</span></p>
  56. <p>大型企业<span>1000</span></p>
  57. <p>中型企业<span>1000</span></p>
  58. <p>小型企业<span>1000</span></p>
  59. <p>微型企业<span>1000</span></p>
  60. <p>汽配产业<span>1000</span></p>
  61. </div>
  62. </div>
  63. </div>
  64. <!--网格管理-->
  65. <div class="qkq_wggl">
  66. <div class="qkq_tit" style="top:45px">网格管理</div>
  67. <div id="wggl" style="top:45px"></div>
  68. </div>
  69. </div>
  70. <!--左侧结束-->
  71. <!--右侧开始-->
  72. <div class="right_con">
  73. <div class="top_txt">
  74. <span>{{ currentTime }}</span>
  75. <!-- <span>星期六</span>-->
  76. <!-- <b>11:16:58</b>-->
  77. </div>
  78. <!--党建引领-->
  79. <div class="qkq_djyl">
  80. <div class="qkq_tit">党建引领</div>
  81. <div class="qkq_djyl_con">
  82. <!-- <img src="@/assets/images/qkq_djyl.png"/> -->
  83. <div class="qkq_list">
  84. <p>
  85. <span>党组织数量</span>
  86. <i>12,136</i>
  87. </p>
  88. <p>
  89. <span>党章党规数量</span>
  90. <i class="blue">12,136</i>
  91. </p>
  92. <p>
  93. <span>党组织活动</span>
  94. <i class="green">12,136</i>
  95. </p>
  96. <p>
  97. <span>心愿完成率</span>
  98. <i class="org">98%</i>
  99. </p>
  100. </div>
  101. </div>
  102. </div>
  103. <!--经济运行-->
  104. <div class="qkq_jjyx">
  105. <div class="qkq_tit" style="top:20px">经济运行
  106. <select id="mySelect">
  107. <option value="option1">规上入统</option>
  108. <option value="option2">大型企业</option>
  109. <option value="option3">中型企业</option>
  110. <option value="option4">小型企业</option>
  111. <option value="option5">微型企业</option>
  112. <option value="option6">汽配产业</option>
  113. </select>
  114. </div>
  115. <div id="jjyx" style="top:20px"></div>
  116. </div>
  117. <!--事件信息-->
  118. <div class="qkq_jjyx">
  119. <div class="qkq_tit">事件信息</div>
  120. <dl class="qkq_jjyx_list">
  121. <dt>
  122. <span>名称</span>
  123. <span>时间</span>
  124. <span>类型</span>
  125. <span>状态</span>
  126. </dt>
  127. <div class="scro_list">
  128. <dd>
  129. <span>红旗小区垃圾桶溢满</span>
  130. <span>2024-05-06</span>
  131. <span>生活</span>
  132. <span class="zt">待处理</span>
  133. </dd>
  134. <dd>
  135. <span>红旗小区垃圾桶溢满</span>
  136. <span>2024-05-06</span>
  137. <span>生活</span>
  138. <span class="zt">待处理</span>
  139. </dd>
  140. <dd>
  141. <span>红旗小区垃圾桶溢满</span>
  142. <span>2024-05-06</span>
  143. <span>生活</span>
  144. <span class="zt">待处理</span>
  145. </dd>
  146. <dd>
  147. <span>红旗小区垃圾桶溢满</span>
  148. <span>2024-05-06</span>
  149. <span>生活</span>
  150. <span class="zt">待处理</span>
  151. </dd>
  152. <dd>
  153. <span>红旗小区垃圾桶溢满</span>
  154. <span>2024-05-06</span>
  155. <span>生活</span>
  156. <span class="zt">待处理</span>
  157. </dd>
  158. <dd>
  159. <span>红旗小区垃圾桶溢满</span>
  160. <span>2024-05-06</span>
  161. <span>生活</span>
  162. <span class="zt">待处理</span>
  163. </dd>
  164. <!-- 其他事件信息项 -->
  165. </div>
  166. </dl>
  167. </div>
  168. </div>
  169. <!--右侧结束-->
  170. <!--中间地图 开始-->
  171. <div class="qkq_mapcon">
  172. <!-- <img src="@/assets/images/qkq_mapconbg.png"/> -->
  173. <img src="@/assets/images/qkq_mapcon.png">
  174. <div class="qkq_map" style="height: 0;top:-227px">
  175. <a @click="handleNavigation('fwyq')"><i><img src="@/assets/images/qkq_icon1.png"/></i><span>服务一汽</span></a>
  176. <a @click="handleNavigation('csgl')"><i><img src="@/assets/images/qkq_icon2.png"/></i><span>城市管理</span></a>
  177. <a @click="handleNavigation('jtzl')"><i><img src="@/assets/images/qkq_icon3.png"/></i><span>交通治理</span></a>
  178. <a @click="handleNavigation('jczl')"><i><img src="@/assets/images/qkq_icon4.png"/></i><span>基层治理</span></a>
  179. <a @click="handleNavigation('yshj_new')"><i><img src="@/assets/images/qkq_icon5.png"/></i><span>营商环境</span></a>
  180. <a @click="handleNavigation('yshj')"><i><img src="@/assets/images/qkq_icon6.png"/></i><span>政务运行</span></a>
  181. <a @click="handleNavigation('aqyj')"><i><img src="@/assets/images/qkq_icon7.png"/></i><span>安全应急</span></a>
  182. <a @click="handleNavigation('jjyx')"><i><img src="@/assets/images/qkq_icon8.png"/></i><span>经济运行</span></a>
  183. </div>
  184. </div>
  185. <!--中间地图 结束-->
  186. <!--底部开始-->
  187. <div class="footer">
  188. </div>
  189. <!--底部开始-->
  190. </div>
  191. </template>
  192. <script>
  193. import * as echarts from 'echarts'
  194. import $ from 'jquery'
  195. import jQuery from 'jquery'
  196. import "@/assets/images/qkq_body.css";
  197. import "@/assets/images/qkq_index.css";
  198. import axios from 'axios';
  199. import Map3D from '@/map3d'; // A
  200. const qikaiJSON = require('@/assets/geoJson/seven.json')
  201. export default {
  202. name: 'weather',
  203. components: {
  204. Map3D
  205. },
  206. data() {
  207. return {
  208. currentTime: '',
  209. geoJson: null,
  210. mapAdCode: 220000, // 默认的中国adcode码
  211. projectionFnParam: {
  212. center: [125.11, 43.76],
  213. scale: 4000,
  214. },
  215. mapScale: {
  216. province: 100,
  217. city: 200,
  218. district: 3000,
  219. }
  220. }
  221. },
  222. created() {
  223. },
  224. mounted() {
  225. this.doingBusiness();
  226. this.grid();
  227. this.economic();
  228. // 每秒刷新时间
  229. setInterval(() => {
  230. this.getCurrentTime();
  231. }, 1000);
  232. this.queryMapData(this.mapAdCode);
  233. },
  234. methods: {
  235. queryMapData(code) {
  236. this.geoJson = qikaiJSON
  237. // axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${code}_full.json`)
  238. // .then(response => {
  239. // this.geoJson = response.data;
  240. // })
  241. // .catch(error => {
  242. // console.error(error)
  243. // })
  244. },
  245. dblClickFn(customProperties) {
  246. this.mapAdCode = customProperties.adcode;
  247. console.log('mapAdCode', this.mapAdCode)
  248. this.queryMapData(this.mapAdCode)
  249. this.projectionFnParam = {
  250. center: customProperties.centroid,
  251. // scale: this.mapScale[customProperties.level],
  252. scale: 500
  253. };
  254. },
  255. handleNavigation(page) {
  256. // if (page === 'sprh') {
  257. // this.$router.push('/sprh'); // 跳转到 "交通治理" 页面
  258. // } else if (page === 'yshj') {
  259. // this.$router.push('/yshj'); // 跳转到 "政务运行" 页面
  260. // }
  261. this.$router.push({path: page});
  262. },
  263. doingBusiness() {
  264. // 营商环境
  265. var myChart = echarts.init(document.getElementById('yshj'));
  266. let option = {
  267. tooltip: {},
  268. radar: {
  269. radius: "55%", //大小
  270. nameGap: 1, // 图中工艺等字距离图的距离
  271. center: ["40%", "40%"], // 图的位置
  272. name: {
  273. textStyle: {
  274. color: "rgba(175, 190, 211, 1)",
  275. fontSize: 10
  276. },
  277. textStyle: {
  278. color: '#fff',
  279. textShadowColor: 'rgba(0, 255, 255, 1)',
  280. textShadowBlur: 5,
  281. textShadowOffsetX: 0,
  282. textShadowOffsetY: 0
  283. },
  284. formatter: function (name) {
  285. return name;
  286. }
  287. },
  288. indicator: [
  289. {
  290. "name": '规上入统',
  291. "max": "100"
  292. }, {
  293. "name": '大型企业',
  294. "max": "100"
  295. }, {
  296. "name": '中型企业',
  297. "max": "100"
  298. }, {
  299. "name": '小型企业',
  300. "max": "100"
  301. }, {
  302. "name": '微型企业',
  303. "max": "100"
  304. }, {
  305. "name": '汽配产业',
  306. "max": "100"
  307. },
  308. ],
  309. axisLine: {
  310. lineStyle: {
  311. color: "rgba(1, 118, 214, 0.8)"
  312. }
  313. },
  314. splitArea: {
  315. show: false,
  316. areaStyle: {
  317. color: "rgba(255,0,0,0)" // 图表背景的颜色
  318. }
  319. },
  320. splitLine: {
  321. show: true,
  322. lineStyle: {
  323. width: 1,
  324. color: "rgba(1, 135, 244, 0.8)" // 设置网格的颜色
  325. }
  326. }
  327. },
  328. series: [{
  329. name: "营商环境分析",
  330. type: "radar",
  331. symbol: "angle",
  332. itemStyle: {
  333. normal: {
  334. areaStyle: {
  335. type: "default"
  336. }
  337. }
  338. },
  339. data: [{
  340. symbol: "circle",
  341. symbolSize: 5,
  342. value: [70, 42, 63, 84, 75, 34],
  343. areaStyle: {
  344. color: "rgba(1, 132, 238, 0.8)"
  345. },
  346. itemStyle: {
  347. normal: {
  348. borderWidth: 1,
  349. color: "rgba(0, 62, 120, 1.0)",
  350. borderColor: "rgba(2, 96, 176, 1)"
  351. }
  352. },
  353. lineStyle: {
  354. color: "rgba(2, 96, 176, 1)",
  355. width: 1
  356. }
  357. }]
  358. }]
  359. }
  360. if (option) {
  361. myChart.setOption(option);
  362. }
  363. },
  364. grid() {
  365. // 网格管理
  366. var myChart = echarts.init(document.getElementById('wggl'));
  367. let dataList = [{
  368. name: '前程街道',
  369. value: 600
  370. }, {
  371. name: '富民街道',
  372. value: 1080
  373. }, {
  374. name: '广兴街道',
  375. value: 369
  376. }, {
  377. name: '东风街道',
  378. value: 744
  379. }, {
  380. name: '锦绣街道',
  381. value: 152
  382. }, {
  383. name: '锦城街道',
  384. value: 92
  385. }]
  386. var option = {
  387. grid: {
  388. left: "15%", //距离左边的距离
  389. right: "2%", //距离右边的距离
  390. bottom: "10%", //距离下边的距离
  391. top: "8%" //距离上边的距离
  392. },
  393. title: {
  394. text: '',
  395. left: 26,
  396. top: 26,
  397. textStyle: {
  398. color: '#FFFFFF',
  399. fontSize: 12,
  400. fontWeight: 50000,
  401. fontFamily: 'PingFang SC'
  402. }
  403. },
  404. tooltip: {
  405. trigger: "axis",
  406. axisPointer: {
  407. type: "shadow",
  408. crossStyle: {
  409. color: "#999"
  410. }
  411. },
  412. },
  413. xAxis: [{
  414. type: "category",
  415. data: ['前程街道', '富民街道', '广兴街道', '东风街道', '锦绣街道', '锦城街道'],
  416. axisLabel: {
  417. textStyle: {
  418. color: "#ffffff",
  419. fontSize: 9,
  420. fontFamily: "Microsoft YaHei"
  421. }
  422. },
  423. axisLine: {
  424. show: true
  425. },
  426. axisTick: {
  427. show: false
  428. }
  429. }],
  430. yAxis: [{
  431. type: "value",
  432. axisLabel: {
  433. formatter: "{value}",
  434. textStyle: {
  435. color: "#fff",
  436. fontSize: 12,
  437. fontFamily: "Microsoft YaHei"
  438. },
  439. },
  440. splitLine: {
  441. show: false,
  442. lineStyle: {
  443. color: "#666"
  444. }
  445. },
  446. axisLine: {
  447. show: true
  448. },
  449. axisTick: {
  450. show: false
  451. }
  452. },
  453. ],
  454. dataZoom: [{
  455. type: 'inside',
  456. start: 0,
  457. end: dataList.length > 15 ? 35 : 100
  458. }],
  459. series: [
  460. {
  461. name: "",
  462. type: "bar",
  463. data: dataList,
  464. barGap: '-100%',
  465. barCategoryGap: '70%',
  466. itemStyle: {
  467. normal: {
  468. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  469. offset: 0,
  470. color: 'rgba(37, 215, 255, 1.0)'
  471. }, {
  472. offset: 1,
  473. color: 'rgba(1,23,60,1)'
  474. }])
  475. },
  476. emphasis: {
  477. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  478. offset: 0,
  479. color: 'rgba(43, 129, 234, 1.0)'
  480. }, {
  481. offset: 1,
  482. color: 'rgba(1,23,60,1)'
  483. }])
  484. }
  485. },
  486. },
  487. {
  488. type: 'lines',
  489. coordinateSystem: 'cartesian2d',
  490. data: dataList.map((item, index) => {
  491. return {
  492. coords: [
  493. [index, 0],
  494. [index, item.value - 4]
  495. ]
  496. };
  497. }),
  498. effect: {
  499. show: true,
  500. period: 3.5,// 周期 速度 2.5
  501. trailLength: 0.5, //控制拖尾长度
  502. symbolSize: 25, // ⭐⭐星星大小
  503. symbol: 'path://M307.46000719101244,524.9919417770187 L320.064963732395,524.9919417770187 L323.95999229701675,510.4772043087195 L327.8550230764027,524.9919417770187 L340.45997740302056,524.9919417770187 L330.26237201075065,533.9624401818169 L334.15760211881354,548.4771776501146 L323.95999229701675,539.506434950185 L313.76238468998207,548.4771776501146 L317.6576159054294,533.9624401818169 L307.46000719101244,524.9919417770187 z',
  504. loop: true,
  505. color: '#fff' //流光颜色
  506. },
  507. lineStyle: {
  508. width: 0,
  509. opacity: 0.6,
  510. curveness: 0
  511. },
  512. "zlevel": 2
  513. },
  514. ]
  515. }
  516. if (option) {
  517. myChart.setOption(option);
  518. }
  519. },
  520. economic() {
  521. // 经济运行
  522. var myChart = echarts.init(document.getElementById('jjyx'));
  523. var option = {
  524. title: {
  525. text: '',
  526. left: 26,
  527. top: 26,
  528. textStyle: {
  529. color: '#FFFFFF',
  530. fontSize: 12,
  531. fontWeight: 50000,
  532. fontFamily: 'PingFang SC'
  533. }
  534. },
  535. legend: {
  536. data: ["2023年度", "2024年度"],
  537. top: 1,
  538. textStyle: {
  539. color: "#deebff",
  540. fontSize: 12,
  541. },
  542. itemWidth: 12,
  543. itemHeight: 10,
  544. itemGap: 35,
  545. color: "#242424",
  546. selectedMode: false,
  547. },
  548. tooltip: {
  549. trigger: "axis",
  550. axisPointer: {
  551. type: "shadow",
  552. crossStyle: {
  553. color: "#999"
  554. }
  555. },
  556. },
  557. grid: {
  558. left: "2%",
  559. right: "4%",
  560. bottom: "5%",
  561. top: "10%",
  562. containLabel: true,
  563. },
  564. xAxis: [{
  565. type: "category",
  566. data: [
  567. "第一季度",
  568. "第二季度",
  569. "第三季度",
  570. "第四季度",
  571. ],
  572. axisLabel: {
  573. textStyle: {
  574. color: "#ffffff",
  575. fontSize: 9,
  576. fontFamily: "Microsoft YaHei"
  577. }
  578. },
  579. axisLine: {
  580. show: true
  581. },
  582. axisTick: {
  583. show: false
  584. }
  585. }],
  586. yAxis: [{
  587. type: "value",
  588. axisLabel: {
  589. formatter: "{value}",
  590. textStyle: {
  591. color: "#fff",
  592. fontSize: 12,
  593. fontFamily: "Microsoft YaHei"
  594. },
  595. },
  596. splitLine: {
  597. show: false,
  598. lineStyle: {
  599. color: "#666"
  600. }
  601. },
  602. axisLine: {
  603. show: true
  604. },
  605. axisTick: {
  606. show: false
  607. }
  608. },
  609. ],
  610. series: [
  611. {
  612. name: '2023',
  613. type: 'bar',
  614. data: [20, 16, 42, 32],
  615. barWidth: 10,
  616. barGap: 0,//柱间距离
  617. label: {//图形上的文本标签
  618. normal: {
  619. show: true,
  620. position: 'top',
  621. textStyle: {
  622. color: '#a8aab0',
  623. fontStyle: 'normal',
  624. fontFamily: '微软雅黑',
  625. fontSize: 12,
  626. },
  627. },
  628. },
  629. itemStyle: {
  630. normal: {
  631. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  632. offset: 0,
  633. color: 'rgba(0,222,255,1)'
  634. }, {
  635. offset: 1,
  636. color: 'rgba(1,23,60,1)'
  637. }])
  638. },
  639. emphasis: {
  640. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  641. offset: 0,
  642. color: 'rgba(39,116,212,1)'
  643. }, {
  644. offset: 1,
  645. color: 'rgba(1,23,60,1)'
  646. }])
  647. }
  648. },
  649. },
  650. {
  651. type: 'lines',
  652. coordinateSystem: 'cartesian2d',
  653. data: [52, 42, 12, 24].map((item, index) => {
  654. return {
  655. coords: [
  656. [index, 0],
  657. [index, item - 4]
  658. ]
  659. };
  660. }),
  661. effect: {
  662. show: true,
  663. period: 2.5,// 周期 速度 2.5
  664. trailLength: 0.5, //控制拖尾长度
  665. symbolSize: [19, 2], // ⭐⭐星星大小
  666. symbol: this.$store.state.common.echarts_baseStreamer,
  667. loop: true,
  668. color: '#fff' //流光颜色
  669. },
  670. lineStyle: {
  671. width: 0,
  672. opacity: 0.6,
  673. curveness: 0
  674. },
  675. "zlevel": 2
  676. },
  677. {
  678. name: '2024',
  679. type: 'bar',
  680. data: [52, 42, 12, 24],
  681. barWidth: 10,
  682. barGap: 0.1,//柱间距离
  683. label: {//图形上的文本标签
  684. normal: {
  685. show: true,
  686. position: 'top',
  687. textStyle: {
  688. color: '#a8aab0',
  689. fontStyle: 'normal',
  690. fontFamily: '微软雅黑',
  691. fontSize: 12,
  692. },
  693. },
  694. },
  695. itemStyle: {
  696. normal: {
  697. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  698. offset: 0,
  699. color: 'rgba(0,222,255,1)'
  700. }, {
  701. offset: 1,
  702. color: 'rgba(1,23,60,1)'
  703. }])
  704. },
  705. emphasis: {
  706. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  707. offset: 0,
  708. color: 'rgba(39,116,212,1)'
  709. }, {
  710. offset: 1,
  711. color: 'rgba(1,23,60,1)'
  712. }])
  713. }
  714. },
  715. },
  716. {
  717. type: 'lines',
  718. coordinateSystem: 'cartesian2d',
  719. data: [52, 42, 12, 24].map((item, index) => {
  720. return {
  721. coords: [
  722. [index, 0],
  723. [index, item - 4]
  724. ]
  725. };
  726. }),
  727. effect: {
  728. show: true,
  729. period: 2.5,// 周期 速度 2.5
  730. trailLength: 0.5, //控制拖尾长度
  731. symbolSize: [3, 10], // ⭐⭐星星大小
  732. symbol: this.$store.state.common.echarts_baseStreamer,
  733. loop: true,
  734. color: '#fff' //流光颜色
  735. },
  736. lineStyle: {
  737. width: 0,
  738. opacity: 0.6,
  739. curveness: 0
  740. },
  741. "zlevel": 2
  742. },
  743. ]
  744. };
  745. myChart.setOption(option);
  746. // })
  747. },
  748. getCurrentTime() {
  749. const now = new Date();
  750. const year = now.getFullYear();
  751. const month = now.getMonth() + 1;
  752. const date = now.getDate();
  753. const day = now.getDay();
  754. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  755. const hour = now.getHours();
  756. const minute = now.getMinutes();
  757. const second = now.getSeconds();
  758. const formattedMonth = month < 10 ? `0${month}` : month;
  759. const formattedDate = date < 10 ? `0${date}` : date;
  760. const formattedHour = hour < 10 ? `0${hour}` : hour;
  761. const formattedMinute = minute < 10 ? `0${minute}` : minute;
  762. const formattedSecond = second < 10 ? `0${second}` : second;
  763. this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
  764. },
  765. }
  766. }
  767. </script>
  768. <style>
  769. /* 样式可以根据需要继续补充 */
  770. </style>