yshj.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693
  1. <template>
  2. <div>
  3. <div class="map">
  4. <!-- <img src="@/assets/images/qkq_mapbg.png"/>-->
  5. <supermap ref="supermap" style="height: 100%;width: 100%;position: absolute;z-index: 0;"
  6. :yxtSltProps="sltProps"></supermap>
  7. </div>
  8. <!-- 阴影背景 -->
  9. <div class="bj_left"><img src="@/assets/images/sprhbj-left.png"/></div>
  10. <div class="bj_right"><img src="@/assets/images/sprhbj-right.png"/></div>
  11. <div class="bj_bottom"><img src="@/assets/images/sprhbj-bottom.png"/></div>
  12. <!--头部开始-->
  13. <div class="header">
  14. <h1>城市运行一网统管指挥中心</h1>
  15. <div class="map_tab_zw">
  16. <button @click="sltHandle" :class="{ 'on': btnOne }">矢量图</button>
  17. <button @click="yxtHandle" :class="{ 'on': btnTwo }">影像图</button>
  18. </div>
  19. </div>
  20. <!--头部结束-->
  21. <!-- 中间开始 -->
  22. <div class="center-bar">
  23. <div class="center-list">
  24. <h4>事项可网办率</h4>
  25. <h5>94.85%</h5>
  26. </div>
  27. <div class="center-list">
  28. <h4>办件率</h4>
  29. <h5>869件</h5>
  30. </div>
  31. <div class="center-list">
  32. <h4>锁定提前办结效率</h4>
  33. <h5>98.57%</h5>
  34. </div>
  35. <div class="center-list">
  36. <h4>承诺提前办结效率</h4>
  37. <h5>94.85%</h5>
  38. </div>
  39. <div class="center-list">
  40. <h4>逾期率</h4>
  41. <h5>0%</h5>
  42. </div>
  43. <div class="center-list">
  44. <h4>平均办理时间</h4>
  45. <h5>0天1小时36分</h5>
  46. </div>
  47. </div>
  48. <!-- 中间结束 -->
  49. <!-- 中间左侧 开始 -->
  50. <div class="zwyx_left">
  51. <div class="zwyx_con">
  52. <div class="qkq_tit ">事项逾期率</div>
  53. <div id="sxyql"></div>
  54. </div>
  55. <div class="zwyx_con">
  56. <div class="qkq_tit ">部门办件数</div>
  57. <div id="bmbjs"></div>
  58. </div>
  59. <div class="zwyx_con">
  60. <div class="qkq_tit ">部门办件率</div>
  61. <div id="bmbjl"></div>
  62. </div>
  63. <div class="zwyx_con">
  64. <div class="qkq_tit ">部门逾期率</div>
  65. <div id="bmyql"></div>
  66. </div>
  67. </div>
  68. <!-- 中间左侧 结束 -->
  69. <!--左侧开始-->
  70. <div class="left_con">
  71. <div class="top_txt">
  72. <b>汽开区</b>
  73. <span>小雨</span>
  74. <span>9~16℃</span>
  75. </div>
  76. <!-- 土地资源 -->
  77. <!-- 区域办件量TOP -->
  78. <div class="qkq_tdzy">
  79. <div class="qkq_tit">区域办件量TOP</div>
  80. <div class="selectDate">
  81. <!-- <span class="_selectData">程锦街道</span>-->
  82. <!-- <a class="icon_more" @click="smalClick(this)"-->
  83. <!-- ><img src="@/assets/images/down.png"-->
  84. <!-- /></a>-->
  85. <!-- <div class="_moreMenu">-->
  86. <!-- <ul>-->
  87. <!-- <li class="change">东风街道</li>-->
  88. <!-- <li>锦城街道</li>-->
  89. <!-- </ul>-->
  90. <!-- </div>-->
  91. </div>
  92. </div>
  93. <div
  94. id="sprh-zyfb"
  95. style="margin: 10px auto; width: 350px; height: 240px"
  96. ></div>
  97. <!-- 区域办件量TOP -->
  98. <!-- 办件趋势统计 -->
  99. <div class="qkq_tdzy">
  100. <div class="qkq_tit ">办件趋势统计</div>
  101. </div>
  102. <div
  103. id="sprh-bjqstj"
  104. style="margin: 10px auto; width: 350px; height: 300px"
  105. ></div>
  106. <!-- 办件趋势统计 -->
  107. </div>
  108. <!--左侧结束-->
  109. <!--右侧开始-->
  110. <div class="right_con">
  111. <div class="top_txt">
  112. <span>{{ currentTime }}</span>
  113. <!-- <span>星期六</span>-->
  114. <!-- <b>11:16:58</b>-->
  115. </div>
  116. <!-- 事项办件量Top10 -->
  117. <div class="qkq_tdzy">
  118. <div class="qkq_tit ">事项办件量Top10</div>
  119. </div>
  120. <div
  121. id="sprh-sxbjl10"
  122. style="margin: 10px auto; width: 350px; height: 260px"
  123. ></div>
  124. <!-- 事项办件量Top10 -->
  125. <!-- 事项办件率Top10 -->
  126. <div class="qkq_tdzy">
  127. <div class="qkq_tit ">事项办件率Top10</div>
  128. </div>
  129. <div
  130. id="sprh-sxbjl-top"
  131. style="margin: 10px auto; width: 350px; height: 260px"
  132. ></div>
  133. <!-- 事项办件率Top10 -->
  134. </div>
  135. <!--右侧结束-->
  136. <!--底部开始-->
  137. <div class="footer">
  138. <div class="nav-bottom">
  139. <div class="nav-bottom-left">
  140. <div class="nav-li-left">
  141. <span>经济运行</span>
  142. </div>
  143. <div class="nav-li-left">
  144. <span>城市管理</span>
  145. </div>
  146. <div class="nav-li-left" @click="serviceFAW('jtzl')">
  147. <span>交通治理</span>
  148. </div>
  149. <div class="nav-li-left" @click="serviceFAW('jczl')">
  150. <span>基层治理</span>
  151. </div>
  152. </div>
  153. <div class="nav-home-middle" @click="homePage('weather')">
  154. <img src="@/assets/images/home-btn.png"/>
  155. <a>返回首页</a>
  156. </div>
  157. <div class="nav-bottom-right">
  158. <div class="nav-li-right">
  159. <span>营商环境</span>
  160. </div>
  161. <div class="nav-li-right on">
  162. <span>政务运行</span>
  163. </div>
  164. <div class="nav-li-right " @click="serviceFAW('sprh')">
  165. <span>安全应急</span>
  166. </div>
  167. <div class="nav-li-right">
  168. <span>服务一汽</span>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <!--底部开始-->
  174. </div>
  175. </template>
  176. <script>
  177. import * as echarts from 'echarts'
  178. import $ from 'jquery'
  179. import jQuery from 'jquery'
  180. import "@/assets/images/qkq_body.css";
  181. import "@/assets/images/qkq_index.css";
  182. import "@/assets/images/qkq_sprh.css";
  183. import supermap from "@/views/supermap/supermap";
  184. export default {
  185. name: "yshj",
  186. components: {supermap},
  187. data() {
  188. return {
  189. sltProps: null,
  190. btnOne: true,
  191. btnTwo: false,
  192. currentTime: '',
  193. }
  194. },
  195. created() {
  196. },
  197. mounted() {
  198. this.regionTop();
  199. this.trend();
  200. this.matterUpTop();
  201. this.matterTop();
  202. this.sxyql();
  203. this.bmbjs();
  204. this.bmbjl();
  205. this.bmyql();
  206. // 每秒刷新时间
  207. setInterval(() => {
  208. this.getCurrentTime();
  209. }, 1000);
  210. },
  211. methods: {
  212. sltHandle() {
  213. this.btnOne = true
  214. this.btnTwo = false
  215. this.$refs.supermap.getSupermap(null, null, null, "slt", null, null)
  216. },
  217. yxtHandle() {
  218. this.btnTwo = true
  219. this.btnOne = false
  220. this.$refs.supermap.getSupermap(null, null, null, "yxt", null, null)
  221. },
  222. homePage(route) {
  223. this.$router.push({path: route});
  224. },
  225. serviceFAW(route) {
  226. this.$router.push({path: route});
  227. },
  228. smalClick(val) {
  229. var node = $(val).next();
  230. if (node.is(":hidden")) {
  231. //如果node是隐藏的则显示node元素,否则隐藏
  232. node.show();
  233. } else {
  234. node.hide();
  235. }
  236. },
  237. regionTop() {
  238. var myChart = echarts.init(document.getElementById('sprh-zyfb'));
  239. let data = [
  240. {value: 0, label: '前程街道'},
  241. {value: 0, label: '富民街道'},
  242. {value: 0, label: '广兴街道'},
  243. {value: 0, label: '东风街道'},
  244. {value: 0, label: '锦绣街道'},
  245. {value: 0, label: '锦城街道'}
  246. ];
  247. let option = {
  248. grid: {
  249. top: 10,
  250. left: 33,
  251. right: 20,
  252. bottom: 5,
  253. containLabel: true
  254. },
  255. xAxis: {
  256. type: 'value',
  257. show: false
  258. },
  259. yAxis: {
  260. show: true,
  261. inverse: true,
  262. type: 'category',
  263. axisLine: {
  264. show: false
  265. }
  266. },
  267. series: [
  268. {
  269. name: 'label',
  270. type: 'bar',
  271. barWidth: 10,
  272. yAxisIndex: 0,
  273. label: {
  274. show: true,
  275. position: 2,
  276. color: '#fff',
  277. fontSize: 12
  278. },
  279. data: data.map((item) => {
  280. return {
  281. value: 0,
  282. label: {
  283. formatter() {
  284. return item.label;
  285. }
  286. }
  287. };
  288. })
  289. },
  290. {
  291. name: 'value',
  292. type: 'bar',
  293. barWidth: 10,
  294. barMinHeight: 10,
  295. yAxisIndex: 0,
  296. label: {
  297. show: true,
  298. position: 'right',
  299. color: '#00d5e1',
  300. fontSize: 12,
  301. rich: {
  302. value: {
  303. color: '#00e1ce'
  304. }
  305. },
  306. formatter({
  307. value
  308. }) {
  309. return `{value|${value}个}`;
  310. }
  311. },
  312. itemStyle: {
  313. barBorderRadius: 3
  314. },
  315. data: data.map(({value}, index) => {
  316. let color = new echarts.graphic.LinearGradient(1, 0, 0, 1, [{
  317. offset: 1,
  318. color: '#004eaf'
  319. }, {
  320. offset: 0,
  321. color: '#089aa2'
  322. }], false);
  323. return {
  324. value,
  325. label: {color},
  326. itemStyle: {color}
  327. };
  328. })
  329. }
  330. ]
  331. };
  332. let updateInterval = 1000; // 更新间隔,单位:毫秒
  333. let updateRegionTop = () => {
  334. data.forEach((item) => {
  335. item.value += Math.floor(Math.random() * 10); // 模拟逐渐增加的数据
  336. if (item.value >= 100) {
  337. item.value = 0; // 当增加到1000时重新开始
  338. }
  339. });
  340. option.series[1].data = data.map(({value}, index) => {
  341. let color = new echarts.graphic.LinearGradient(1, 0, 0, 1, [{
  342. offset: 1,
  343. color: '#004eaf'
  344. }, {
  345. offset: 0,
  346. color: '#089aa2'
  347. }], false);
  348. return {
  349. value,
  350. label: {color},
  351. itemStyle: {color}
  352. };
  353. });
  354. myChart.setOption(option);
  355. };
  356. updateRegionTop(); // 首次更新数据
  357. let timer = setInterval(updateRegionTop, updateInterval);
  358. },
  359. trend() {
  360. //办件趋势
  361. var myChart = echarts.init(document.getElementById('sprh-bjqstj'));
  362. var monthData = [];
  363. var lineData = [];
  364. for (var i = 1; i <= 12; i++) {
  365. monthData.push(i + '月');
  366. var lineNumber = Math.floor(Math.random() * 10000);
  367. lineData.push(lineNumber);
  368. }
  369. let option = {
  370. tooltip: {
  371. trigger: 'axis',
  372. axisPointer: {
  373. type: 'shadow',
  374. },
  375. },
  376. grid: {
  377. top: '5%',
  378. left: '15%',
  379. right: '5%',
  380. bottom: '25%',
  381. // containLabel: true
  382. },
  383. xAxis: [
  384. {
  385. type: 'category',
  386. boundaryGap: false,
  387. axisLine: {
  388. show: true, //隐藏X轴轴线
  389. lineStyle: {
  390. color: '#502297',
  391. width: 1,
  392. type: 'dashed',
  393. },
  394. },
  395. splitLine: {
  396. show: true,
  397. interval: 'auto',
  398. lineStyle: {
  399. color: ['#502297'],
  400. type: 'dashed',
  401. },
  402. },
  403. axisLabel: {
  404. show: true,
  405. textStyle: {
  406. color: '#FFFFFF', //X轴文字颜色
  407. fontSize: 12,
  408. },
  409. margin: 12,
  410. interval: 0,
  411. },
  412. axisTick: {
  413. show: false,
  414. },
  415. data: monthData,
  416. },
  417. ],
  418. yAxis: [
  419. {
  420. splitNumber: 6,
  421. splitLine: {
  422. show: true,
  423. interval: 'auto',
  424. lineStyle: {
  425. color: ['#502297'],
  426. type: 'dashed',
  427. },
  428. },
  429. axisTick: {
  430. show: false,
  431. },
  432. axisLine: {
  433. lineStyle: {
  434. color: '#502297',
  435. width: 1,
  436. type: 'dashed',
  437. },
  438. },
  439. axisLabel: {
  440. show: true,
  441. textStyle: {
  442. color: '#ffffff',
  443. },
  444. },
  445. },
  446. ],
  447. series: [
  448. {
  449. name: '成绩',
  450. type: 'line',
  451. symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
  452. showAllSymbol: true,
  453. smooth: true,
  454. symbolSize: 8,
  455. lineStyle: {
  456. normal: {
  457. color: '#FE7B00', // 线条颜色
  458. },
  459. borderColor: '#ffffff',
  460. },
  461. itemStyle: {
  462. color: '#ffffff',
  463. borderColor: '#FE7B00',
  464. borderWidth: 2,
  465. },
  466. areaStyle: {
  467. //区域填充样式
  468. normal: {
  469. //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
  470. color: new echarts.graphic.LinearGradient(
  471. 0,
  472. 0,
  473. 0,
  474. 1,
  475. [
  476. {
  477. offset: 0,
  478. color: 'rgba(125, 14, 255, 0.4)',
  479. },
  480. {
  481. offset: 1,
  482. color: 'rgba(116, 0, 216, 0.1)',
  483. },
  484. ],
  485. false
  486. ),
  487. },
  488. },
  489. data: lineData,
  490. },
  491. ],
  492. };
  493. var currentIndex = -1;
  494. var timer = setInterval(function () {
  495. // 生成新的随机数据
  496. currentIndex++;
  497. if (currentIndex >= 12) {
  498. currentIndex = 0;
  499. for (var i = 0; i < lineData.length; i++) {
  500. lineData[i] = Math.floor(Math.random() * 1000);
  501. }
  502. } else {
  503. lineData[currentIndex] = Math.floor(Math.random() * 1000);
  504. }
  505. // 更新 option 中的数据
  506. option.series[0].data = lineData;
  507. // 重新渲染图表
  508. myChart.setOption(option);
  509. }, 1000); // 每秒更新一次数据
  510. if (option) {
  511. myChart.setOption(option);
  512. }
  513. },
  514. matterUpTop() {
  515. var myChart = echarts.init(document.getElementById('sprh-sxbjl10'));
  516. var datas = [{
  517. "value": 30,
  518. "name": "特种设备安全管.."
  519. },
  520. {
  521. "value": 20,
  522. "name": "特种设备使用登.."
  523. },
  524. {
  525. "value": 10,
  526. "name": "特种设备安全管2.."
  527. },
  528. {
  529. "value": 40,
  530. "name": "一孩、二孩、三孩.."
  531. },
  532. {
  533. "value": 50,
  534. "name": "失业登记"
  535. },
  536. {
  537. "value": 60,
  538. "name": "医师执业注册(.."
  539. },
  540. {
  541. "value": 70,
  542. "name": "残疾人证新办"
  543. },
  544. {
  545. "value": 80,
  546. "name": "护士执业注册(.."
  547. },
  548. {
  549. "value": 90,
  550. "name": "失业登记2"
  551. },
  552. {
  553. "value": 100,
  554. "name": "一孩、二孩、三孩1.. "
  555. }
  556. ]
  557. var maxArr = (new Array(datas.length)).fill(100);
  558. let option = {
  559. grid: {
  560. left: 0,
  561. right: 0,
  562. bottom: 0,
  563. top: 0,
  564. containLabel: true
  565. },
  566. tooltip: {
  567. trigger: 'item',
  568. axisPointer: {
  569. type: 'none'
  570. },
  571. formatter: function (params) {
  572. return params[0].name + ' : ' + params[0].value
  573. }
  574. },
  575. xAxis: {
  576. show: false,
  577. type: 'value'
  578. },
  579. yAxis: [{
  580. type: 'category',
  581. inverse: true,
  582. axisLabel: {
  583. show: true,
  584. align: 'right',
  585. textStyle: {
  586. fontSize: 14,
  587. color: '#ffffff',
  588. rich: {
  589. index: {
  590. color: '#9d9d9d',
  591. fontWeight: 'bold',
  592. fontStyle: 'italic'
  593. },
  594. index1: {
  595. color: '#f8777b',
  596. fontWeight: 'bold',
  597. fontStyle: 'italic'
  598. },
  599. index2: {
  600. color: '#ffa145',
  601. fontWeight: 'bold',
  602. fontStyle: 'italic'
  603. },
  604. index3: {
  605. color: '#6ade8d',
  606. fontWeight: 'bold',
  607. fontStyle: 'italic'
  608. },
  609. name: {
  610. width: 7 * 14,
  611. align: 'left',
  612. textAlign: 'left'
  613. }
  614. }
  615. },
  616. formatter: (name) => {
  617. var index = (datas.map(item => item.name)).indexOf(name) + 1;
  618. return [
  619. '{' + (index > 3 ? 'index' : 'index' + index) + '|' + index + '}',
  620. '{name|' + name + '}'
  621. ].join(' ')
  622. }
  623. },
  624. splitLine: {
  625. show: false
  626. },
  627. axisTick: {
  628. show: false
  629. },
  630. axisLine: {
  631. show: false
  632. },
  633. data: datas.map(item => item.name)
  634. },
  635. {
  636. type: 'category',
  637. inverse: true,
  638. axisTick: 'none',
  639. axisLine: 'none',
  640. show: true,
  641. axisLabel: {
  642. textStyle: {
  643. color: '#3196fa',
  644. fontSize: '12'
  645. },
  646. formatter: '{value}'
  647. },
  648. data: datas.map(item => item.value)
  649. }
  650. ],
  651. series: [{
  652. name: '值',
  653. type: 'bar',
  654. zlevel: 1,
  655. itemStyle: {
  656. normal: {
  657. barBorderRadius: 5,
  658. color: '#3196fa',
  659. },
  660. emphasis: {
  661. shadowBlur: 10,
  662. shadowColor: 'rgba(0, 0, 0, 0.5)'
  663. }
  664. },
  665. barWidth: 10,
  666. data: datas
  667. },
  668. {
  669. name: '背景',
  670. type: 'bar',
  671. barWidth: 10,
  672. barGap: '-100%',
  673. data: maxArr,
  674. itemStyle: {
  675. normal: {
  676. color: '#042039',
  677. barBorderRadius: 5,
  678. }
  679. },
  680. }
  681. ]
  682. };
  683. setInterval(function () {
  684. // 更新数据和名字,并重新渲染图表
  685. datas.forEach(function (item) {
  686. item.value = Math.floor(Math.random() * 100); // 随机生成新的值
  687. });
  688. myChart.setOption({
  689. yAxis: [{
  690. data: datas.map(item => item.name)
  691. }, {
  692. data: datas.map(item => item.value)
  693. }],
  694. series: [{
  695. data: datas
  696. },
  697. {
  698. data: maxArr
  699. }
  700. ]
  701. });
  702. }, 1000); // 每隔3秒钟更新一次数据
  703. // 初次渲染图表
  704. if (option) {
  705. myChart.setOption(option);
  706. }
  707. },
  708. matterTop() {
  709. var myChart = echarts.init(document.getElementById('sprh-sxbjl-top'));
  710. var datas = [{
  711. "value": 0,
  712. "name": "民办学校的举办.."
  713. },
  714. {
  715. "value": 0,
  716. "name": "失业登记.."
  717. },
  718. {
  719. "value": 0,
  720. "name": "民办学校的终止.."
  721. },
  722. {
  723. "value": 0,
  724. "name": "医师执业注册(.."
  725. },
  726. {
  727. "value": 0,
  728. "name": "一孩、二孩、三孩.."
  729. },
  730. {
  731. "value": 0,
  732. "name": "药品零售企业许.."
  733. },
  734. {
  735. "value": 0,
  736. "name": "护士执业注册"
  737. },
  738. {
  739. "value": 0,
  740. "name": "残疾人证新办"
  741. },
  742. {
  743. "value": 0,
  744. "name": "医疗广告审查"
  745. },
  746. {
  747. "value": 0,
  748. "name": "变更施工单位项.."
  749. },
  750. ]
  751. var maxArr = (new Array(datas.length)).fill(100);
  752. let option = {
  753. grid: {
  754. left: 0,
  755. right: 0,
  756. bottom: 0,
  757. top: 0,
  758. containLabel: true
  759. },
  760. tooltip: {
  761. trigger: 'item',
  762. axisPointer: {
  763. type: 'none'
  764. },
  765. formatter: function (params) {
  766. return params[0].name + ' : ' + params[0].value
  767. }
  768. },
  769. xAxis: {
  770. show: false,
  771. type: 'value'
  772. },
  773. yAxis: [{
  774. type: 'category',
  775. inverse: true,
  776. axisLabel: {
  777. show: true,
  778. align: 'right',
  779. textStyle: {
  780. fontSize: 14,
  781. color: '#ffffff',
  782. rich: {
  783. index: {
  784. color: '#9d9d9d',
  785. fontWeight: 'bold',
  786. fontStyle: 'italic'
  787. },
  788. index1: {
  789. color: '#f8777b',
  790. fontWeight: 'bold',
  791. fontStyle: 'italic'
  792. },
  793. index2: {
  794. color: '#ffa145',
  795. fontWeight: 'bold',
  796. fontStyle: 'italic'
  797. },
  798. index3: {
  799. color: '#6ade8d',
  800. fontWeight: 'bold',
  801. fontStyle: 'italic'
  802. },
  803. name: {
  804. width: 7 * 14,
  805. align: 'left',
  806. textAlign: 'left'
  807. }
  808. }
  809. },
  810. formatter: (name) => {
  811. var index = (datas.map(item => item.name)).indexOf(name) + 1;
  812. return [
  813. '{' + (index > 3 ? 'index' : 'index' + index) + '|' + index + '}',
  814. '{name|' + name + '}'
  815. ].join(' ')
  816. }
  817. },
  818. splitLine: {
  819. show: false
  820. },
  821. axisTick: {
  822. show: false
  823. },
  824. axisLine: {
  825. show: false
  826. },
  827. data: datas.map(item => item.name)
  828. }, {
  829. type: 'category',
  830. inverse: true,
  831. axisTick: 'none',
  832. axisLine: 'none',
  833. show: true,
  834. axisLabel: {
  835. textStyle: {
  836. color: '#3196fa',
  837. fontSize: '12'
  838. },
  839. formatter: '{value}%'
  840. },
  841. data: datas.map(item => item.value)
  842. }],
  843. series: [{
  844. name: '值',
  845. type: 'bar',
  846. zlevel: 1,
  847. itemStyle: {
  848. normal: {
  849. barBorderRadius: 5,
  850. color: '#3196fa',
  851. },
  852. },
  853. barWidth: 10,
  854. data: datas
  855. },
  856. {
  857. name: '背景',
  858. type: 'bar',
  859. barWidth: 10,
  860. barGap: '-100%',
  861. data: maxArr,
  862. itemStyle: {
  863. normal: {
  864. color: '#042039',
  865. barBorderRadius: 5,
  866. }
  867. },
  868. },
  869. ]
  870. };
  871. if (option) {
  872. myChart.setOption(option);
  873. }
  874. // 设置定时器,每隔一段时间更新数据并重绘图表
  875. setInterval(function () {
  876. // 更新数据和名字,并重新渲染图表
  877. datas.forEach(function (item) {
  878. item.value = Math.floor(Math.random() * 100); // 随机生成新的值
  879. });
  880. myChart.setOption({
  881. yAxis: [{
  882. data: datas.map(item => item.name)
  883. }, {
  884. data: datas.map(item => item.value)
  885. }],
  886. series: [{
  887. data: datas
  888. },
  889. {
  890. data: maxArr
  891. }
  892. ]
  893. });
  894. }, 1000); // 每隔3秒钟更新一次数据
  895. },
  896. sxyql() {
  897. var myChart = echarts.init(document.getElementById('sxyql'));
  898. var data = [
  899. {
  900. name: 'xxxx事项',
  901. value: 10,
  902. },
  903. {
  904. name: 'xxxx事项',
  905. value: 20,
  906. },
  907. {
  908. name: 'xxxx事项',
  909. value: 60,
  910. },
  911. {
  912. name: 'xxxx事项',
  913. value: 50,
  914. },
  915. {
  916. name: 'xxxx事项',
  917. value: 70,
  918. },
  919. ];
  920. var defaultData = [100, 100, 100, 100, 100, 100];
  921. let labelData = ['cxxxx事项', 'xxxx事项', 'xxxx事项', 'xxxx事项', 'xxxx事项']
  922. let valueData = [];
  923. for (var i = 0; i < data.length; i++) {
  924. let object = {}
  925. labelData.push(data[i]);
  926. var lineNumber = Math.floor(Math.random() * 900);
  927. this.$set(object, "name", data[i]);
  928. this.$set(object, "value", lineNumber);
  929. valueData.push(object);
  930. }
  931. var getArrByKey = (data, k) => {
  932. let key = k || 'value';
  933. let res = [];
  934. if (data) {
  935. data.forEach(function (t) {
  936. res.push(t[key]);
  937. });
  938. }
  939. return res;
  940. };
  941. var getSymbolData = (data) => {
  942. let arr = [];
  943. for (var i = 0; i < data.length; i++) {
  944. arr.push({
  945. value: data[i].value,
  946. symbolPosition: 'end',
  947. });
  948. }
  949. return arr;
  950. };
  951. // console.log(getSymbolData(data));
  952. var option = {
  953. grid: {
  954. top: '9%',
  955. bottom: -15,
  956. right: -50,
  957. left: 0,
  958. containLabel: true,
  959. },
  960. xAxis: {
  961. show: false,
  962. },
  963. yAxis: [
  964. {
  965. triggerEvent: false,
  966. show: true,
  967. inverse: true,
  968. data: getArrByKey(data, 'name'),
  969. axisLine: {
  970. show: false,
  971. },
  972. splitLine: {
  973. show: false,
  974. },
  975. axisTick: {
  976. show: false,
  977. },
  978. axisLabel: {
  979. show: false,
  980. interval: 0,
  981. color: '#fff',
  982. align: 'left',
  983. margin: 10,
  984. fontSize: 12,
  985. formatter: function (value, index) {
  986. return '{title|' + value + '}';
  987. },
  988. rich: {
  989. title: {
  990. width: 500,
  991. },
  992. },
  993. },
  994. },
  995. {
  996. triggerEvent: false,
  997. show: true,
  998. inverse: true,
  999. data: getArrByKey(data, 'name'),
  1000. axisLine: {
  1001. show: false,
  1002. },
  1003. splitLine: {
  1004. show: false,
  1005. },
  1006. axisTick: {
  1007. show: false,
  1008. },
  1009. axisLabel: {
  1010. interval: 0,
  1011. shadowOffsetX: '-110px',
  1012. // color: ['#fff'],
  1013. align: 'right',
  1014. verticalAlign: 'bottom',
  1015. lineHeight: 24,
  1016. fontSize: 11,
  1017. color: '#fff',
  1018. formatter: function (value, index) {
  1019. return (
  1020. '逾期: ' + data[index].value + '%'
  1021. );
  1022. },
  1023. rich: {
  1024. percentNumber: {
  1025. color: '#ff8e2e',
  1026. },
  1027. },
  1028. },
  1029. },
  1030. ],
  1031. series: [
  1032. {
  1033. // name: 'XXX',
  1034. // type: 'pictorialBar',
  1035. // symbol:
  1036. // 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA6CAMAAADWZboaAAAAZlBMVEUAAABe3uVe3+Vf3uVf3+Zf3uVg3+Zg3+Zf3+Vi4OZh4OZg3+Z86/Bh3+Zi4Odj4Odi4OZ86/B76/B86/Bj4ed56+9x5+xn4umB7/N87PB36e+A7/N+7fF/7vJ/7vJ+7fGA7/OB7/PReX+lAAAAIXRSTlMABQkVDREmIhk3MR10LEFFPHh7cUprXE35h2XnqMLAp+mHAG9cAAAB5ElEQVRIx83WjU7CMBQFYIoiKMqU/XUboHv/l/Tce7t2XamDNSacETEmX86tlK2rx4py150o+MstMBLwWRfHKo6JCVxLnvmFGBjFQ58oF1//sUZhGy/ClSTWObgnL4O+bkeN4nY2okfNMbkRt9/vtxz8InoTsWplJSCzFxPmO8+GpSIByX3YQAuGDWtRKhKjCnxDXhF6Z4yxnZ20Wgko7BMRDmxtSGVaI4kdTIgb+zTYoJQlIMlDlmUFgrcDWWC201qSayqlTkiCddWWeV62VU0YlnpRi9VOKaSUsiyq/N0krwq2Ugt7lVpZl5BfHNiytjagMi+XYp0kCR45hMlivVQrE/uU5pXSrCB5bM6d1t2lOZItMqmliT3q5uVxqxzyW/ccfYLNKx7ZTeykMvNyac2yt2Fbc61MHLSC0rwoxbiNdlQ3GBm1NLHQsHUrtEXppR/ljNpW6DbSCoqlFiVoN6YdaFlgsSFVPs1BdT8OaB5QyQzVcaqWDows/zepxR8ObLglTrdtCRVuRNj4Rrxh+//0ke2f8KVL+Kon3GCSbmsJN9OUW3j6g0Ns+LgCij2u0h+Sghc8mlMPBMgdx5DFh59VmOVHrvmDnoNxCz3J7MFWsMuaLyR089xz/xhlfijvwutR8gv3zk6BLUUeCgAAAABJRU5ErkJggg==',
  1037. // symbolSize: [50, 50],
  1038. // symbolOffset: [20, 0],
  1039. // z: 12,
  1040. // itemStyle: {
  1041. // normal: {
  1042. // color: '#fff',
  1043. // },
  1044. // },
  1045. // data: getSymbolData(data),
  1046. name: 'XXX',
  1047. type: 'bar',
  1048. barWidth: 10,
  1049. barGap: '-100%',
  1050. z: 1,
  1051. data: getSymbolData(data),
  1052. itemStyle: {
  1053. normal: {
  1054. color: '#0b2645',
  1055. barBorderRadius: 10,
  1056. },
  1057. },
  1058. },
  1059. {
  1060. name: '背景',
  1061. type: 'bar',
  1062. barWidth: 10,
  1063. barGap: '-100%',
  1064. z: 1,
  1065. data: defaultData,
  1066. itemStyle: {
  1067. normal: {
  1068. color: '#0b2645',
  1069. barBorderRadius: 10,
  1070. },
  1071. },
  1072. },
  1073. {
  1074. name: '条',
  1075. type: 'bar',
  1076. showBackground: true,
  1077. // backgroundColor:'#fff',
  1078. barBorderRadius: 30,
  1079. yAxisIndex: 0,
  1080. data: data,
  1081. barWidth: 10,
  1082. // align: left,
  1083. itemStyle: {
  1084. normal: {
  1085. // color: "rgba(41, 162, 245, 1)",
  1086. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  1087. {
  1088. offset: 0,
  1089. color: 'rgb(0,251,253,0)',
  1090. },
  1091. {
  1092. offset: 1,
  1093. color: 'rgb(0,251,253,1)',
  1094. },
  1095. ]),
  1096. barBorderRadius: 10,
  1097. },
  1098. // color: '#A71A2B',
  1099. barBorderRadius: 4,
  1100. },
  1101. label: {
  1102. normal: {
  1103. color: '#fff',
  1104. show: true,
  1105. position: [0, '-20px'],
  1106. textStyle: {
  1107. fontSize: 12,
  1108. },
  1109. formatter: function (a, b) {
  1110. return a.name;
  1111. },
  1112. },
  1113. },
  1114. },
  1115. ],
  1116. };
  1117. // 更新数据并重新设置图表选项
  1118. function updateData() {
  1119. let newData = [];
  1120. for (var i = 0; i < data.length; i++) {
  1121. let object = {};
  1122. object.name = data[i].name;
  1123. object.value = Math.floor(Math.random() * 1000);
  1124. newData.push(object);
  1125. }
  1126. option.series[2].data = newData;
  1127. myChart.setOption(option);
  1128. }
  1129. // 每隔一段时间更新数据
  1130. setInterval(function () {
  1131. updateData();
  1132. }, 1000);
  1133. if (option) {
  1134. myChart.setOption(option);
  1135. }
  1136. },
  1137. bmbjs() {
  1138. var myChart = echarts.init(document.getElementById('bmbjs'));
  1139. let data = ['xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门']
  1140. let valueData = [];
  1141. let labelData = []
  1142. for (var i = 0; i < data.length; i++) {
  1143. labelData.push(data[i]);
  1144. var lineNumber = Math.floor(Math.random() * 900);
  1145. valueData.push(lineNumber);
  1146. }
  1147. var option = {
  1148. tooltip: {
  1149. trigger: 'axis',
  1150. axisPointer: {
  1151. lineStyle: {
  1152. color: {
  1153. type: 'linear',
  1154. x: 0,
  1155. y: 0,
  1156. x2: 0,
  1157. y2: 1,
  1158. colorStops: [{
  1159. offset: 0,
  1160. color: 'rgba(255,255,255,0)' // 0% 处的颜色
  1161. }, {
  1162. offset: 0.5,
  1163. color: 'rgba(255,255,255,1)' // 100% 处的颜色
  1164. }, {
  1165. offset: 1,
  1166. color: 'rgba(255,255,255,0)' // 100% 处的颜色
  1167. }],
  1168. global: false // 缺省为 false
  1169. }
  1170. },
  1171. },
  1172. },
  1173. grid: {
  1174. top: '18%',
  1175. left: '1%',
  1176. right: '1%',
  1177. bottom: '25%',
  1178. // containLabel: true
  1179. },
  1180. xAxis: [{
  1181. type: 'category',
  1182. boundaryGap: true,
  1183. axisLine: { //坐标轴轴线相关设置。数学上的x轴
  1184. show: true,
  1185. lineStyle: {
  1186. color: 'rgba(255,255,255,0.4)'
  1187. },
  1188. },
  1189. axisLabel: { //坐标轴刻度标签的相关设置
  1190. textStyle: {
  1191. color: '#d1e6eb',
  1192. margin: 15,
  1193. },
  1194. },
  1195. axisTick: {
  1196. show: false,
  1197. },
  1198. data: labelData,
  1199. }],
  1200. yAxis: [{
  1201. type: 'value',
  1202. min: 0,
  1203. // max: 140,
  1204. splitNumber: 4,
  1205. splitLine: {
  1206. show: true,
  1207. lineStyle: {
  1208. color: 'rgba(255,255,255,0.1)'
  1209. }
  1210. },
  1211. axisLine: {
  1212. show: false,
  1213. },
  1214. axisLabel: {
  1215. show: false,
  1216. margin: 20,
  1217. textStyle: {
  1218. color: '#d1e6eb',
  1219. },
  1220. },
  1221. axisTick: {
  1222. show: false,
  1223. },
  1224. }],
  1225. series: [{
  1226. name: '办件数',
  1227. type: 'line',
  1228. // smooth: true, //是否平滑曲线显示
  1229. // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆
  1230. showAllSymbol: true,
  1231. // symbol: 'image://./static/images/guang-circle.png',
  1232. symbolSize: 8,
  1233. lineStyle: {
  1234. normal: {
  1235. color: "#53fdfe", // 线条颜色
  1236. },
  1237. borderColor: '#f0f'
  1238. },
  1239. label: {
  1240. show: true,
  1241. position: 'top',
  1242. textStyle: {
  1243. color: '#fff',
  1244. }
  1245. },
  1246. itemStyle: {
  1247. normal: {
  1248. color: "rgba(255,255,255,1)",
  1249. }
  1250. },
  1251. tooltip: {
  1252. show: true
  1253. },
  1254. areaStyle: { //区域填充样式
  1255. normal: {
  1256. //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
  1257. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1258. offset: 0,
  1259. color: 'rgba(0,150,239,0.3)'
  1260. },
  1261. {
  1262. offset: 1,
  1263. color: 'rgba(0,253,252,0)'
  1264. }
  1265. ], false),
  1266. shadowColor: 'rgba(53,142,215, 0.9)', //阴影颜色
  1267. shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
  1268. }
  1269. },
  1270. data: valueData
  1271. }]
  1272. };
  1273. var currentIndex = -1;
  1274. var timer = setInterval(function () {
  1275. // 生成新的随机数据
  1276. currentIndex++;
  1277. if (currentIndex >= 12) {
  1278. currentIndex = 0;
  1279. for (var i = 0; i < valueData.length; i++) {
  1280. valueData[i] = Math.floor(Math.random() * 700);
  1281. }
  1282. } else {
  1283. valueData[currentIndex] = Math.floor(Math.random() * 700);
  1284. }
  1285. // 更新 option 中的数据
  1286. option.series[0].data = valueData;
  1287. // 重新渲染图表
  1288. myChart.setOption(option);
  1289. }, 1000); // 每秒更新一次数据
  1290. if (option) {
  1291. myChart.setOption(option);
  1292. }
  1293. },
  1294. bmbjl() {
  1295. var myChart = echarts.init(document.getElementById('bmbjl'));
  1296. const color = ['rgba(0, 181, 255, 0.3)']; //线条边框颜色
  1297. // const backgroundColor = '#101736';
  1298. const typeList = ['xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门'];
  1299. const number = [10, 23, 14, 17, 20, 18, 10, 23, 14, 17];
  1300. // const maxData = Math.max(...number) * 1.1;
  1301. let valueData = [];
  1302. let labelData = []
  1303. for (var i = 0; i < typeList.length; i++) {
  1304. labelData.push(typeList[i]);
  1305. var lineNumber = Math.floor(Math.random() * 100);
  1306. valueData.push(lineNumber);
  1307. }
  1308. const maxData = Math.max(...valueData) * 1.1;
  1309. const title = {
  1310. show: false,
  1311. };
  1312. const legend = {
  1313. show: false,
  1314. };
  1315. const tooltip = {
  1316. show: true,
  1317. };
  1318. const indicator = labelData.reduce((acc, cur) => {
  1319. acc.push({name: cur, max: maxData});
  1320. return acc;
  1321. }, []);
  1322. const dataArr = [
  1323. {
  1324. name: '部门办件率',
  1325. value: valueData,
  1326. symbolSize: 0,
  1327. symbol: 'circle',
  1328. lineStyle: {
  1329. width: 1,
  1330. },
  1331. areaStyle: {
  1332. // 单项区域填充样式
  1333. color: {
  1334. type: 'linear',
  1335. x: 0, //右
  1336. y: 0, //下
  1337. x2: 1, //左
  1338. y2: 1, //上
  1339. colorStops: [
  1340. {
  1341. offset: 0,
  1342. color: color[0],
  1343. },
  1344. {
  1345. offset: 0.5,
  1346. color: 'rgba(0,0,0,0)',
  1347. },
  1348. {
  1349. offset: 1,
  1350. color: color[0],
  1351. },
  1352. ],
  1353. global: false,
  1354. },
  1355. opacity: 1, // 区域透明度
  1356. },
  1357. },
  1358. ];
  1359. var option = {
  1360. color,
  1361. title,
  1362. legend,
  1363. tooltip,
  1364. radar: {
  1365. center: ['50%', '50%'], //圆心坐标距离左边和上边的距离
  1366. radius: ['0%', '75%'], //内外半径,不写默认是75%
  1367. startAngle: 90, //可以旋转图形
  1368. shape: 'circle',
  1369. axisName: {
  1370. color: '#fff',
  1371. fontSize: 11,
  1372. },
  1373. indicator: indicator,
  1374. splitArea: {
  1375. show: false, //默认显示颜色分割区域,不需要显示
  1376. },
  1377. axisLine: {
  1378. show: true, //是否显示十字交叉线
  1379. symbol: ['none', 'circle'],
  1380. symbolSize: [8, 8],
  1381. lineStyle: {
  1382. color: '#fff',
  1383. width: 0,
  1384. },
  1385. },
  1386. axisLabel: {show: false},
  1387. splitLine: {
  1388. //雷达一圈圈
  1389. show: true,
  1390. lineStyle: {
  1391. type: 'solid',
  1392. color: '#455063', // 雷达一圈圈颜色分隔线颜色
  1393. width: 1, // 分隔线线宽
  1394. },
  1395. },
  1396. },
  1397. series: [
  1398. {
  1399. type: 'radar',
  1400. data: dataArr,
  1401. },
  1402. ],
  1403. };
  1404. function updateData() {
  1405. let newData = [];
  1406. for (var i = 0; i < typeList.length; i++) {
  1407. var lineNumber = Math.floor(Math.random() * 100); // 生成0到1000之间的随机数
  1408. newData.push(lineNumber);
  1409. }
  1410. option.series[0].data[0].value = newData;
  1411. myChart.setOption(option);
  1412. }
  1413. setInterval(function () {
  1414. updateData();
  1415. }, 1000); // 每秒更新一次数据
  1416. if (option) {
  1417. myChart.setOption(option);
  1418. }
  1419. },
  1420. bmyql() {
  1421. var myChart = echarts.init(document.getElementById('bmyql'));
  1422. let data = ['xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门', 'xx部门']
  1423. let valueData = [];
  1424. let labelData = []
  1425. for (var i = 0; i < data.length; i++) {
  1426. labelData.push(data[i]);
  1427. var lineNumber = Math.floor(Math.random() * 900);
  1428. valueData.push(lineNumber);
  1429. }
  1430. var option = {
  1431. animation: true,
  1432. grid: {
  1433. top: "5%",
  1434. bottom: "20%",
  1435. right: "5%"
  1436. },
  1437. tooltip: {
  1438. show: true,
  1439. },
  1440. xAxis: {
  1441. data: labelData,
  1442. axisLine: {
  1443. show: false,//隐藏X轴轴线
  1444. },
  1445. axisTick: {
  1446. show: false //隐藏X轴轴线
  1447. },
  1448. splitLine: {
  1449. show: true,
  1450. lineStyle: {
  1451. color: "rgba(77, 128, 254, 0.2)",
  1452. width: 1
  1453. }
  1454. },
  1455. axisLabel: {
  1456. show: true,
  1457. interval: 0,
  1458. rotate: 45,
  1459. // margin: 14,
  1460. fontSize: 10,
  1461. textStyle: {
  1462. color: "#a8d5ff" //X轴文字颜色
  1463. }
  1464. }
  1465. },
  1466. yAxis: [
  1467. {
  1468. type: "value",
  1469. gridIndex: 0,
  1470. min: 0,
  1471. //max: 100,
  1472. interval: 50,
  1473. // splitNumber: 4,
  1474. splitLine: {
  1475. show: true,
  1476. lineStyle: {
  1477. color: "rgba(77, 128, 254, 0.2)",
  1478. width: 1
  1479. }
  1480. },
  1481. axisTick: {
  1482. show: false
  1483. },
  1484. axisLine: {
  1485. show: true,
  1486. lineStyle: {
  1487. color: "rgba(77, 128, 254, 0.2)"
  1488. }
  1489. },
  1490. axisLabel: {
  1491. show: true,
  1492. margin: 7,
  1493. fontSize: 10,
  1494. textStyle: {
  1495. color: "#a8d5ff"
  1496. }
  1497. }
  1498. }
  1499. ],
  1500. series: [
  1501. {
  1502. name: "设备在线率",
  1503. type: "bar",
  1504. barWidth: 8,
  1505. itemStyle: {
  1506. normal: {
  1507. label: {
  1508. show: true, //开启显示
  1509. position: 'top', //在上方显示
  1510. textStyle: { //数值样式
  1511. color: '#fff',
  1512. fontSize: 10
  1513. }
  1514. },
  1515. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1516. {
  1517. offset: 0,
  1518. color: "rgba(146, 225, 255, 1)"
  1519. },
  1520. {
  1521. offset: 1,
  1522. color: "rgba(0, 151, 251, 1)"
  1523. }
  1524. ])
  1525. }
  1526. },
  1527. data: valueData,
  1528. z: 10,
  1529. zlevel: 0
  1530. },
  1531. {
  1532. // 分隔
  1533. type: "pictorialBar",
  1534. itemStyle: {
  1535. normal: {
  1536. color: "#0F375F"
  1537. }
  1538. },
  1539. symbolRepeat: "fixed",
  1540. symbolMargin: 6,
  1541. symbol: "rect",
  1542. symbolClip: true,
  1543. symbolSize: [18, 2],
  1544. symbolPosition: "start",
  1545. symbolOffset: [1, 1],
  1546. data: valueData,
  1547. width: 2,
  1548. z: 0,
  1549. zlevel: 1
  1550. },
  1551. {
  1552. name: "外框",
  1553. type: "bar",
  1554. barGap: "-110%", // 设置外框粗细
  1555. data: [100, 100, 100, 100, 100, 100, 100],
  1556. barWidth: 16,
  1557. itemStyle: {
  1558. normal: {
  1559. color: "transparent", // 填充色
  1560. // barBorderRadius: 0, //圆角半径
  1561. label: {
  1562. // 标签显示位置
  1563. show: false,
  1564. position: "top" // insideTop 或者横向的 insideLeft
  1565. }
  1566. }
  1567. },
  1568. z: 0
  1569. },
  1570. {
  1571. name: "背影",
  1572. type: "line",
  1573. smooth: true, //平滑曲线显示
  1574. showAllSymbol: false, //显示所有图形。
  1575. symbolSize: 0,
  1576. lineStyle: {
  1577. width: 0
  1578. },
  1579. areaStyle: {
  1580. color: "rgba(0, 151, 251, 0.1)"
  1581. },
  1582. data: [498, 520, 568, 432, 464, 332, 344, 458, 470, 468, 398, 310, 421],
  1583. z: 5
  1584. }
  1585. ],
  1586. // dataZoom: [
  1587. // {
  1588. // type: "slider",
  1589. // show: false,
  1590. // xAxisIndex: [0],
  1591. // endValue: 14,
  1592. // startValue: 0
  1593. // }
  1594. // ]
  1595. }
  1596. var currentIndex = -1;
  1597. var timer = setInterval(function () {
  1598. // 生成新的随机数据
  1599. currentIndex++;
  1600. if (currentIndex >= 12) {
  1601. currentIndex = 0;
  1602. for (var i = 0; i < valueData.length; i++) {
  1603. valueData[i] = Math.floor(Math.random() * 700);
  1604. }
  1605. } else {
  1606. valueData[currentIndex] = Math.floor(Math.random() * 700);
  1607. }
  1608. // 更新 option 中的数据
  1609. option.series[0].data = valueData;
  1610. // 重新渲染图表
  1611. myChart.setOption(option);
  1612. }, 1000); // 每秒更新一次数据
  1613. if (option) {
  1614. myChart.setOption(option);
  1615. }
  1616. },
  1617. getCurrentTime() {
  1618. const now = new Date();
  1619. const year = now.getFullYear();
  1620. const month = now.getMonth() + 1;
  1621. const date = now.getDate();
  1622. const day = now.getDay();
  1623. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  1624. const hour = now.getHours();
  1625. const minute = now.getMinutes();
  1626. const second = now.getSeconds();
  1627. const formattedMonth = month < 10 ? `0${month}` : month;
  1628. const formattedDate = date < 10 ? `0${date}` : date;
  1629. const formattedHour = hour < 10 ? `0${hour}` : hour;
  1630. const formattedMinute = minute < 10 ? `0${minute}` : minute;
  1631. const formattedSecond = second < 10 ? `0${second}` : second;
  1632. this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
  1633. },
  1634. },
  1635. };
  1636. </script>
  1637. <style scoped>
  1638. /* Your CSS styles here */
  1639. </style>