aqyj.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591
  1. <template>
  2. <div style="background-color: #32435A">
  3. <div class="map">
  4. <supermap ref="supermap" style="height: 100%;width: 100%;position: absolute;z-index: 0;"
  5. :yxtSltProps="sltProps"></supermap>
  6. </div>
  7. <!-- 阴影背景 -->
  8. <div class="bj_left"><img src="@/assets/images/sprhbj-left.png"/></div>
  9. <div class="bj_right"><img src="@/assets/images/sprhbj-right.png"/></div>
  10. <div class="bj_bottom"><img src="@/assets/images/sprhbj-bottom.png"/></div>
  11. <!--头部开始-->
  12. <div class="header">
  13. <h1>城市运行一网统管指挥中心</h1>
  14. <div class="map_tab">
  15. <button @click="sltHandle" :class="{ 'on': btnOne }">矢量图</button>
  16. <button @click="yxtHandle" :class="{ 'on': btnTwo }">影像图</button>
  17. </div>
  18. </div>
  19. <!--头部结束-->
  20. <!--左侧开始-->
  21. <div class="left_con sprh-left">
  22. <div class="top_txt">
  23. <b>汽开区</b>
  24. <!-- <span>小雨</span>-->
  25. <!-- <span>9~16℃</span>-->
  26. </div>
  27. <!-- 设备tab开始-->
  28. <div class="facility_tab facility_tab2">
  29. <div class="qkq_tdzy">
  30. <div class="qkq_tit ">摄像头</div>
  31. <div class="scrollbar" style="height: 660px;">
  32. <ul id="accordion" class="accordion yjcs">
  33. <!-- li上加on类名是点击选中后效果 -->
  34. <li v-for="(item, index) in shelter" :class="{ on: item.id == shelterCurrent }" :key="index"
  35. @click="onShelterlick(item)">
  36. <div class="link">{{ item.name }} - {{ item.address }}</div>
  37. </li>
  38. </ul>
  39. </div>
  40. </div>
  41. </div>
  42. <!-- 设备tab结束-->
  43. </div>
  44. <!--左侧结束-->
  45. <!--右侧开始-->
  46. <div class="right_con sprh-left">
  47. <div class="top_txt">
  48. <span>{{ currentTime }}</span>
  49. <!-- <span>星期六</span>-->
  50. <!-- <b>11:16:58</b>-->
  51. </div>
  52. <div class="facility_tab facility_tab2">
  53. <div class="qkq_tdzy">
  54. <div class="qkq_tit ">今日安全承诺</div>
  55. <div class="qkq_aqcn">
  56. <div id="qkq_aqcn_chart"></div>
  57. <div class="qkq_aqcn_txt">
  58. <p>应承诺数<span>162家</span></p>
  59. <p>已承诺数<span>162家</span></p>
  60. <p>未承诺数<span>0家</span></p>
  61. </div>
  62. </div>
  63. <div class="qkq_aqcn_col">
  64. <p>
  65. <span>高风险</span>
  66. <b>0</b>
  67. </p>
  68. <p>
  69. <span>较大风险</span>
  70. <b>1</b>
  71. </p>
  72. <p>
  73. <span>一般风险</span>
  74. <b>31</b>
  75. </p>
  76. <p>
  77. <span>低风险</span>
  78. <b>129</b>
  79. </p>
  80. </div>
  81. </div>
  82. <div class="qkq_tdzy">
  83. <div class="qkq_tit">监测预警</div>
  84. <ul class="qkq_csnl scrollbar">
  85. <li>
  86. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  87. <p>预警事件:内涝点积水</p>
  88. <p>预警时间:2024年8月2日09:51:53</p>
  89. </li>
  90. <li>
  91. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  92. <p>预警事件:内涝点积水</p>
  93. <p>预警时间:2024年8月2日09:51:53</p>
  94. </li>
  95. <li>
  96. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  97. <p>预警事件:内涝点积水</p>
  98. <p>预警时间:2024年8月2日09:51:53</p>
  99. </li>
  100. <li>
  101. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  102. <p>预警事件:内涝点积水</p>
  103. <p>预警时间:2024年8月2日09:51:53</p>
  104. </li>
  105. <li>
  106. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  107. <p>预警事件:内涝点积水</p>
  108. <p>预警时间:2024年8月2日09:51:53</p>
  109. </li>
  110. <li>
  111. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  112. <p>预警事件:内涝点积水</p>
  113. <p>预警时间:2024年8月2日09:51:53</p>
  114. </li>
  115. <li>
  116. <h4><span class="blue">【城市内涝点】</span>飞跃路与越野街交汇</h4>
  117. <p>预警事件:内涝点积水</p>
  118. <p>预警时间:2024年8月2日09:51:53</p>
  119. </li>
  120. </ul>
  121. </div>
  122. </div>
  123. </div>
  124. <!--右侧结束-->
  125. <!-- 多选按钮 开始 -->
  126. <form class="qkq_dx">
  127. <label><input checked type="checkbox" name="ckbx" id="sxt" @click="handleClick"/>摄像头</label>
  128. <label><input type="checkbox" name="ckbx" id="yjcs" @click="handleClick"/>应急场所</label>
  129. <label><input type="checkbox" name="ckbx" id="nld" @click="handleClick"/>城市内涝点</label>
  130. <label><input type="checkbox" name="ckbx" id="jyd" @click="handleClick"/>抢险救援队</label>
  131. <label><input type="checkbox" name="ckbx" id="fxwz" @click="handleClick"/>防汛物资</label>
  132. </form>
  133. <!-- 多选按钮 结束 -->
  134. <!-- 点位图例 开始
  135. <div class="dwtl">
  136. <p><span class="xqnb"></span>街道路面(在线50个/离线10个)</p>
  137. <p><span class="jdlm"></span>小区内部(在线50个/离线10个)</p>
  138. </div>
  139. 点位图例 结束 -->
  140. <!--底部开始-->
  141. <div class="footer">
  142. <div class="nav-bottom">
  143. <div class="nav-bottom-left">
  144. <div class="nav-li-left" @click="handleNavigation('jjyx')">
  145. <span>经济运行</span>
  146. </div>
  147. <div class="nav-li-left" @click="handleNavigation('csgl')">
  148. <span>城市管理</span>
  149. </div>
  150. <div class="nav-li-left" @click="handleNavigation('jtzl')">
  151. <span>交通治理</span>
  152. </div>
  153. <div class="nav-li-left" @click="handleNavigation('jczl')">
  154. <span>基层治理</span>
  155. </div>
  156. </div>
  157. <div class="nav-home-middle" @click="homePage('weather')">
  158. <img src="@/assets/images/home-btn.png"/>
  159. <a>返回首页</a>
  160. </div>
  161. <div class="nav-bottom-right">
  162. <div class="nav-li-right" @click="handleNavigation('yshj_new')">
  163. <span>营商环境</span>
  164. </div>
  165. <div class="nav-li-right" @click="handleNavigation('bjzshz')">
  166. <span>政务运行</span>
  167. </div>
  168. <div class="nav-li-right on" @click="handleNavigation('aqyj')">
  169. <span>安全应急</span>
  170. </div>
  171. <div class="nav-li-right" @click="handleNavigation('fwyq')">
  172. <span>服务一汽</span>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <!--底部开始-->
  178. </div>
  179. </template>
  180. <script>
  181. import * as echarts from 'echarts'
  182. import $ from 'jquery'
  183. import jQuery from 'jquery'
  184. import "@/assets/images/qkq_body.css";
  185. import "@/assets/images/qkq_index.css";
  186. import "@/assets/images/qkq_sprh.css";
  187. import {getCameraList} from "@/api/system/camera";
  188. import {
  189. selectQkEmergencyRescueTeamAllList,
  190. selectQkEmergencyShelterAllList,
  191. selectQkRescueSuppliesAllList,
  192. } from "@/api/system/aqyj";
  193. import supermap from "@/views/supermap/supermap";
  194. export default {
  195. name: "aqyj",
  196. components: {
  197. supermap
  198. },
  199. data() {
  200. return {
  201. dropdownVisible: false,
  202. cameras: [],
  203. team: [],
  204. shelter: [],
  205. supplies: [],
  206. sltProps: null,
  207. teamCurrent: null,
  208. shelterCurrent: null,
  209. suppliesCurrent: null,
  210. currentTime: '',
  211. btnOne: true,
  212. btnTwo: false,
  213. yjcsChecked: false,
  214. };
  215. // 可根据实际情况添加更多设备列表
  216. },
  217. created() {
  218. },
  219. mounted() {
  220. this.selectQkEmergencyRescueTeamAllList();
  221. this.selectQkEmergencyShelterAllList();
  222. this.selectQkRescueSuppliesAllList();
  223. // this.resourceDistribution();
  224. // this.deviceOnline();
  225. // this.deviceOffline();
  226. this.cameraList();
  227. // this.regionTop();
  228. this.qkq_aqcn_chart();
  229. // 每秒刷新时间
  230. setInterval(() => {
  231. this.getCurrentTime();
  232. }, 1000);
  233. },
  234. methods: {
  235. handleClick() {
  236. this.$refs.supermap.clearM()
  237. let that = this;
  238. $('input[name="ckbx"]:checked').each(function () {
  239. switch ($(this).attr("id")) {
  240. case "sxt":
  241. that.loada();
  242. break;
  243. case "yjcs":
  244. that.loadb();
  245. break;
  246. case "jyd":
  247. that.loadc();
  248. break;
  249. case "fxwz":
  250. that.loadd();
  251. }
  252. });
  253. },
  254. loada() {
  255. this.$refs.supermap.selectCameraList();
  256. },
  257. loadb() {
  258. this.$refs.supermap.selectQkEmergencyShelterAllList();
  259. },
  260. loadc() {
  261. this.$refs.supermap.selectQkEmergencyRescueTeamAllList();
  262. },
  263. loadd() {
  264. this.$refs.supermap.selectQkRescueSuppliesAllList();
  265. },
  266. onTeamlick(val) {
  267. let dataSource = [];
  268. this.suppliesCurrent = null;
  269. this.shelterCurrent = null;
  270. if (val.id == this.teamCurrent) {
  271. this.teamCurrent = null;
  272. } else {
  273. this.teamCurrent = val.id;
  274. }
  275. dataSource.push(val)
  276. // var checkbox = document.getElementById("jyd");
  277. // checkbox.setAttribute("checked", "");
  278. this.$refs.supermap.addMarkers(dataSource, "jyd")
  279. this.$refs.supermap.dropLocation(val.latitude, val.longitude);
  280. },
  281. onSuppliesclick(val) {
  282. let dataSource = [];
  283. this.teamCurrent = null;
  284. this.shelterCurrent = null;
  285. if (val.id == this.suppliesCurrent) {
  286. this.suppliesCurrent = null;
  287. } else {
  288. this.suppliesCurrent = val.id;
  289. }
  290. dataSource.push(val)
  291. // var checkbox = document.getElementById("fxwz");
  292. // checkbox.setAttribute("checked", "");
  293. this.$refs.supermap.addMarkers(dataSource, "fxwz")
  294. this.$refs.supermap.dropLocation(val.latitude, val.longitude);
  295. },
  296. onShelterlick(val) {
  297. let dataSource = [];
  298. this.teamCurrent = null;
  299. this.suppliesCurrent = null;
  300. if (val.id == this.shelterCurrent) {
  301. this.shelterCurrent = null;
  302. } else {
  303. this.shelterCurrent = val.id;
  304. }
  305. dataSource.push(val)
  306. // var checkbox = document.getElementById("yjcs");
  307. // checkbox.setAttribute("checked", "");
  308. this.$refs.supermap.addMarkers(dataSource, "yjcs")
  309. this.$refs.supermap.dropLocation(val.latitude, val.longitude);
  310. },
  311. //可视化查询抢险救援队列表
  312. selectQkEmergencyRescueTeamAllList() {
  313. selectQkEmergencyRescueTeamAllList().then(response => {
  314. this.team = response.data;
  315. })
  316. }
  317. ,
  318. //可视化查询应急避难所列表
  319. selectQkEmergencyShelterAllList() {
  320. selectQkEmergencyShelterAllList().then(response => {
  321. this.shelter = response.data;
  322. })
  323. }
  324. ,
  325. //可视化查询防汛抗旱物资储备列表
  326. selectQkRescueSuppliesAllList() {
  327. selectQkRescueSuppliesAllList().then(response => {
  328. this.supplies = response.data;
  329. })
  330. }
  331. ,
  332. sltHandle() {
  333. this.btnOne = true
  334. this.btnTwo = false
  335. this.$refs.supermap.getSupermap(null, null, null, "slt", null, null)
  336. }
  337. ,
  338. yxtHandle() {
  339. this.btnTwo = true
  340. this.btnOne = false
  341. this.$refs.supermap.getSupermap(null, null, null, "yxt", null, null)
  342. }
  343. ,
  344. handleNavigation(route) {
  345. this.$router.push({path: route});
  346. }
  347. ,
  348. homePage(route) {
  349. this.$router.push({path: route});
  350. }
  351. ,
  352. cameraList() {
  353. getCameraList().then(response => {
  354. this.cameras = response.data;
  355. })
  356. }
  357. ,
  358. toggleDropdown(event) {
  359. this.dropdownVisible = !this.dropdownVisible;
  360. }
  361. ,
  362. resourceDistribution() {
  363. //资源分布
  364. var myChart = echarts.init(document.getElementById('sprh-zyfb'));
  365. var salvProName = ['前程街道', '富民街道', '广兴街道', '东风街道', '锦绣街道', '锦程街道'];
  366. var salvProValue = [239, 181, 154, 144, 135, 117, 124];
  367. var salvProMax = [];//背景按最大值
  368. for (let i = 0; i < salvProValue.length; i++) {
  369. salvProMax.push(salvProValue[0])
  370. }
  371. let option = {
  372. grid: {
  373. top: 0,
  374. left: 33,
  375. right: 20,
  376. bottom: 0,
  377. containLabel: true
  378. },
  379. tooltip: {
  380. trigger: 'axis',
  381. axisPointer: {
  382. type: 'none'
  383. },
  384. formatter: function (params) {
  385. return params[0].name + ' : ' + params[0].value
  386. }
  387. },
  388. xAxis: {
  389. show: false,
  390. type: 'value'
  391. },
  392. yAxis: [{
  393. type: 'category',
  394. inverse: true,
  395. axisLabel: {
  396. show: true,
  397. textStyle: {
  398. color: '#fff'
  399. },
  400. },
  401. splitLine: {
  402. show: false
  403. },
  404. axisTick: {
  405. show: false
  406. },
  407. axisLine: {
  408. show: false
  409. },
  410. data: salvProName
  411. }, {
  412. type: 'category',
  413. inverse: true,
  414. axisTick: 'none',
  415. axisLine: 'none',
  416. show: true,
  417. axisLabel: {
  418. textStyle: {
  419. color: '#ffffff',
  420. fontSize: '12'
  421. },
  422. },
  423. data: salvProValue.map((item) => {
  424. return item + "个";
  425. })
  426. }],
  427. series: [{
  428. name: '值',
  429. type: 'bar',
  430. zlevel: 1,
  431. itemStyle: {
  432. normal: {
  433. barBorderRadius: 30,
  434. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  435. offset: 0,
  436. color: '#0e3eaf'
  437. }, {
  438. offset: 1,
  439. color: '#00ffff'
  440. }]),
  441. },
  442. },
  443. barWidth: 20,
  444. data: salvProValue
  445. },
  446. {
  447. type: 'lines',
  448. coordinateSystem: 'cartesian2d',
  449. data: salvProValue.map((item, index) => {
  450. return {
  451. coords: [
  452. [0, index],
  453. [item - 4, index]
  454. ]
  455. };
  456. }),
  457. effect: {
  458. show: true,
  459. period: 2.5,
  460. trailLength: 0.5, //控制拖尾长度
  461. symbolSize: [20, 2],
  462. symbol: this.$store.state.common.echarts_baseStreamer,
  463. loop: true,
  464. color: '#fff' //流光颜色
  465. },
  466. lineStyle: {
  467. width: 0,
  468. opacity: 0.6,
  469. curveness: 0
  470. },
  471. zlevel: 10,
  472. },
  473. {
  474. name: '背景',
  475. type: 'bar',
  476. barWidth: 20,
  477. barGap: '-100%',
  478. data: salvProMax,
  479. itemStyle: {
  480. normal: {
  481. color: 'rgba(24,31,68,1)',
  482. barBorderRadius: 30,
  483. }
  484. },
  485. },
  486. ]
  487. };
  488. if (option) {
  489. myChart.setOption(option);
  490. }
  491. }
  492. ,
  493. deviceOnline() {
  494. //在线设备
  495. var myChart = echarts.init(document.getElementById('sprh-zxfb'));
  496. let angle = 0; //角度,用来做简单的动画效果的
  497. let value = 80;
  498. var timerId;
  499. let option = {
  500. title: {
  501. text: '{a|' + value + '}{c|%}',
  502. x: 'center',
  503. y: 'center',
  504. textStyle: {
  505. rich: {
  506. a: {
  507. fontSize: 24,
  508. color: '#29EEF3'
  509. },
  510. c: {
  511. fontSize: 16,
  512. color: '#ffffff',
  513. // padding: [5,0]
  514. }
  515. }
  516. }
  517. },
  518. series: [
  519. // 紫色
  520. {
  521. name: "ring5",
  522. type: 'custom',
  523. coordinateSystem: "none",
  524. renderItem: function (params, api) {
  525. return {
  526. type: 'arc',
  527. shape: {
  528. cx: api.getWidth() / 2,
  529. cy: api.getHeight() / 2,
  530. r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
  531. startAngle: (0 + angle) * Math.PI / 180,
  532. endAngle: (90 + angle) * Math.PI / 180
  533. },
  534. style: {
  535. stroke: "#8383FA",
  536. fill: "transparent",
  537. lineWidth: 1.5
  538. },
  539. silent: true
  540. };
  541. },
  542. data: [0]
  543. }, {
  544. name: "ring5", //紫点
  545. type: 'custom',
  546. coordinateSystem: "none",
  547. renderItem: function (params, api) {
  548. let x0 = api.getWidth() / 2;
  549. let y0 = api.getHeight() / 2;
  550. let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
  551. let point = getCirlPoint(x0, y0, r, (90 + angle))
  552. return {
  553. type: 'circle',
  554. shape: {
  555. cx: point.x,
  556. cy: point.y,
  557. r: 4
  558. },
  559. style: {
  560. stroke: "#8450F9", //绿
  561. fill: "#8450F9"
  562. },
  563. silent: true
  564. };
  565. },
  566. data: [0]
  567. },
  568. // 蓝色
  569. {
  570. name: "ring5",
  571. type: 'custom',
  572. coordinateSystem: "none",
  573. renderItem: function (params, api) {
  574. return {
  575. type: 'arc',
  576. shape: {
  577. cx: api.getWidth() / 2,
  578. cy: api.getHeight() / 2,
  579. r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
  580. startAngle: (180 + angle) * Math.PI / 180,
  581. endAngle: (270 + angle) * Math.PI / 180
  582. },
  583. style: {
  584. stroke: "#4386FA",
  585. fill: "transparent",
  586. lineWidth: 1.5
  587. },
  588. silent: true
  589. };
  590. },
  591. data: [0]
  592. },
  593. {
  594. name: "ring5", // 蓝色
  595. type: 'custom',
  596. coordinateSystem: "none",
  597. renderItem: function (params, api) {
  598. let x0 = api.getWidth() / 2;
  599. let y0 = api.getHeight() / 2;
  600. let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
  601. let point = getCirlPoint(x0, y0, r, (180 + angle))
  602. return {
  603. type: 'circle',
  604. shape: {
  605. cx: point.x,
  606. cy: point.y,
  607. r: 4
  608. },
  609. style: {
  610. stroke: "#4386FA", //绿
  611. fill: "#4386FA"
  612. },
  613. silent: true
  614. };
  615. },
  616. data: [0]
  617. },
  618. {
  619. name: "ring5",
  620. type: 'custom',
  621. coordinateSystem: "none",
  622. renderItem: function (params, api) {
  623. return {
  624. type: 'arc',
  625. shape: {
  626. cx: api.getWidth() / 2,
  627. cy: api.getHeight() / 2,
  628. r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
  629. startAngle: (270 + -angle) * Math.PI / 180,
  630. endAngle: (40 + -angle) * Math.PI / 180
  631. },
  632. style: {
  633. stroke: "#0CD3DB",
  634. fill: "transparent",
  635. lineWidth: 1.5
  636. },
  637. silent: true
  638. };
  639. },
  640. data: [0]
  641. },
  642. // 橘色
  643. {
  644. name: "ring5",
  645. type: 'custom',
  646. coordinateSystem: "none",
  647. renderItem: function (params, api) {
  648. return {
  649. type: 'arc',
  650. shape: {
  651. cx: api.getWidth() / 2,
  652. cy: api.getHeight() / 2,
  653. r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
  654. startAngle: (90 + -angle) * Math.PI / 180,
  655. endAngle: (220 + -angle) * Math.PI / 180
  656. },
  657. style: {
  658. stroke: "#FF8E89",
  659. fill: "transparent",
  660. lineWidth: 1.5
  661. },
  662. silent: true
  663. };
  664. },
  665. data: [0]
  666. }, {
  667. name: "ring5",
  668. type: 'custom',
  669. coordinateSystem: "none",
  670. renderItem: function (params, api) {
  671. let x0 = api.getWidth() / 2;
  672. let y0 = api.getHeight() / 2;
  673. let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
  674. let point = getCirlPoint(x0, y0, r, (90 + -angle))
  675. return {
  676. type: 'circle',
  677. shape: {
  678. cx: point.x,
  679. cy: point.y,
  680. r: 4
  681. },
  682. style: {
  683. stroke: "#FF8E89", //粉
  684. fill: "#FF8E89"
  685. },
  686. silent: true
  687. };
  688. },
  689. data: [0]
  690. }, {
  691. name: "ring5", //绿点
  692. type: 'custom',
  693. coordinateSystem: "none",
  694. renderItem: function (params, api) {
  695. let x0 = api.getWidth() / 2;
  696. let y0 = api.getHeight() / 2;
  697. let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
  698. let point = getCirlPoint(x0, y0, r, (270 + -angle))
  699. return {
  700. type: 'circle',
  701. shape: {
  702. cx: point.x,
  703. cy: point.y,
  704. r: 4
  705. },
  706. style: {
  707. stroke: "#0CD3DB", //绿
  708. fill: "#0CD3DB"
  709. },
  710. silent: true
  711. };
  712. },
  713. data: [0]
  714. }, {
  715. name: '设备在线率',
  716. type: 'pie',
  717. radius: ['72%', '55%'],
  718. silent: true,
  719. clockwise: true,
  720. startAngle: 90,
  721. z: 0,
  722. zlevel: 0,
  723. label: {
  724. normal: {
  725. position: "center",
  726. }
  727. },
  728. data: [{
  729. value: value,
  730. name: "",
  731. itemStyle: {
  732. normal: {
  733. color: { // 完成的圆环的颜色
  734. colorStops: [{
  735. offset: 0,
  736. color: '#A098FC' // 0% 处的颜色
  737. },
  738. {
  739. offset: 0.3,
  740. color: '#4386FA' // 0% 处的颜色
  741. },
  742. {
  743. offset: 0.6,
  744. color: '#4FADFD' // 0% 处的颜色
  745. },
  746. {
  747. offset: 0.8,
  748. color: '#0CD3DB' // 100% 处的颜色
  749. }, {
  750. offset: 1,
  751. color: '#646CF9' // 100% 处的颜色
  752. }
  753. ]
  754. },
  755. }
  756. }
  757. },
  758. {
  759. value: 100 - value,
  760. name: "",
  761. label: {
  762. normal: {
  763. show: false
  764. }
  765. },
  766. itemStyle: {
  767. normal: {
  768. color: "#173164"
  769. }
  770. }
  771. }
  772. ]
  773. },
  774. {
  775. name: '设备在线率',
  776. type: 'pie',
  777. radius: ['52%', '45%'],
  778. silent: true,
  779. clockwise: true,
  780. startAngle: 270,
  781. z: 0,
  782. zlevel: 0,
  783. label: {
  784. normal: {
  785. position: "center",
  786. }
  787. },
  788. data: [{
  789. value: value,
  790. name: "",
  791. itemStyle: {
  792. normal: {
  793. color: { // 完成的圆环的颜色
  794. colorStops: [{
  795. offset: 0,
  796. color: '#00EDF3' // 0% 处的颜色
  797. }, {
  798. offset: 1,
  799. color: '#646CF9' // 100% 处的颜色
  800. }]
  801. },
  802. }
  803. }
  804. },
  805. {
  806. value: 100 - value,
  807. name: "",
  808. label: {
  809. normal: {
  810. show: false
  811. }
  812. },
  813. itemStyle: {
  814. normal: {
  815. color: "#173164"
  816. }
  817. }
  818. }
  819. ]
  820. },
  821. ]
  822. };
  823. //获取圆上面某点的坐标(x0,y0表示坐标,r半径,angle角度)
  824. function getCirlPoint(x0, y0, r, angle) {
  825. let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
  826. let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
  827. return {
  828. x: x1,
  829. y: y1
  830. }
  831. }
  832. function draw() {
  833. angle = angle + 3
  834. myChart.setOption(option, true)
  835. //window.requestAnimationFrame(draw);
  836. }
  837. if (timerId) {
  838. clearInterval(timerId);
  839. }
  840. timerId = setInterval(function () {
  841. //用setInterval做动画感觉有问题
  842. draw()
  843. }, 100);
  844. myChart.setOption(option);
  845. }
  846. ,
  847. deviceOffline() {
  848. // 视频融合--离线设备
  849. // 基于准备好的dom,初始化echarts实例
  850. var myChart = echarts.init(document.getElementById('sprh-lxfb'));
  851. let angle = 0; //角度,用来做简单的动画效果的
  852. let value = 20;
  853. var timerId;
  854. let option = {
  855. title: {
  856. text: '{a|' + value + '}{c|%}',
  857. x: 'center',
  858. y: 'center',
  859. textStyle: {
  860. rich: {
  861. a: {
  862. fontSize: 24,
  863. color: '#29EEF3'
  864. },
  865. c: {
  866. fontSize: 16,
  867. color: '#ffffff',
  868. // padding: [5,0]
  869. }
  870. }
  871. }
  872. },
  873. series: [
  874. // 紫色
  875. {
  876. name: "ring5",
  877. type: 'custom',
  878. coordinateSystem: "none",
  879. renderItem: function (params, api) {
  880. return {
  881. type: 'arc',
  882. shape: {
  883. cx: api.getWidth() / 2,
  884. cy: api.getHeight() / 2,
  885. r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
  886. startAngle: (0 + angle) * Math.PI / 180,
  887. endAngle: (90 + angle) * Math.PI / 180
  888. },
  889. style: {
  890. stroke: "#8383FA",
  891. fill: "transparent",
  892. lineWidth: 1.5
  893. },
  894. silent: true
  895. };
  896. },
  897. data: [0]
  898. }, {
  899. name: "ring5", //紫点
  900. type: 'custom',
  901. coordinateSystem: "none",
  902. renderItem: function (params, api) {
  903. let x0 = api.getWidth() / 2;
  904. let y0 = api.getHeight() / 2;
  905. let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
  906. let point = getCirlPoint(x0, y0, r, (90 + angle))
  907. return {
  908. type: 'circle',
  909. shape: {
  910. cx: point.x,
  911. cy: point.y,
  912. r: 4
  913. },
  914. style: {
  915. stroke: "#8450F9", //绿
  916. fill: "#8450F9"
  917. },
  918. silent: true
  919. };
  920. },
  921. data: [0]
  922. },
  923. // 蓝色
  924. {
  925. name: "ring5",
  926. type: 'custom',
  927. coordinateSystem: "none",
  928. renderItem: function (params, api) {
  929. return {
  930. type: 'arc',
  931. shape: {
  932. cx: api.getWidth() / 2,
  933. cy: api.getHeight() / 2,
  934. r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
  935. startAngle: (180 + angle) * Math.PI / 180,
  936. endAngle: (270 + angle) * Math.PI / 180
  937. },
  938. style: {
  939. stroke: "#4386FA",
  940. fill: "transparent",
  941. lineWidth: 1.5
  942. },
  943. silent: true
  944. };
  945. },
  946. data: [0]
  947. },
  948. {
  949. name: "ring5", // 蓝色
  950. type: 'custom',
  951. coordinateSystem: "none",
  952. renderItem: function (params, api) {
  953. let x0 = api.getWidth() / 2;
  954. let y0 = api.getHeight() / 2;
  955. let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
  956. let point = getCirlPoint(x0, y0, r, (180 + angle))
  957. return {
  958. type: 'circle',
  959. shape: {
  960. cx: point.x,
  961. cy: point.y,
  962. r: 4
  963. },
  964. style: {
  965. stroke: "#4386FA", //绿
  966. fill: "#4386FA"
  967. },
  968. silent: true
  969. };
  970. },
  971. data: [0]
  972. },
  973. {
  974. name: "ring5",
  975. type: 'custom',
  976. coordinateSystem: "none",
  977. renderItem: function (params, api) {
  978. return {
  979. type: 'arc',
  980. shape: {
  981. cx: api.getWidth() / 2,
  982. cy: api.getHeight() / 2,
  983. r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
  984. startAngle: (270 + -angle) * Math.PI / 180,
  985. endAngle: (40 + -angle) * Math.PI / 180
  986. },
  987. style: {
  988. stroke: "#0CD3DB",
  989. fill: "transparent",
  990. lineWidth: 1.5
  991. },
  992. silent: true
  993. };
  994. },
  995. data: [0]
  996. },
  997. // 橘色
  998. {
  999. name: "ring5",
  1000. type: 'custom',
  1001. coordinateSystem: "none",
  1002. renderItem: function (params, api) {
  1003. return {
  1004. type: 'arc',
  1005. shape: {
  1006. cx: api.getWidth() / 2,
  1007. cy: api.getHeight() / 2,
  1008. r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
  1009. startAngle: (90 + -angle) * Math.PI / 180,
  1010. endAngle: (220 + -angle) * Math.PI / 180
  1011. },
  1012. style: {
  1013. stroke: "#FF8E89",
  1014. fill: "transparent",
  1015. lineWidth: 1.5
  1016. },
  1017. silent: true
  1018. };
  1019. },
  1020. data: [0]
  1021. }, {
  1022. name: "ring5",
  1023. type: 'custom',
  1024. coordinateSystem: "none",
  1025. renderItem: function (params, api) {
  1026. let x0 = api.getWidth() / 2;
  1027. let y0 = api.getHeight() / 2;
  1028. let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
  1029. let point = getCirlPoint(x0, y0, r, (90 + -angle))
  1030. return {
  1031. type: 'circle',
  1032. shape: {
  1033. cx: point.x,
  1034. cy: point.y,
  1035. r: 4
  1036. },
  1037. style: {
  1038. stroke: "#FF8E89", //粉
  1039. fill: "#FF8E89"
  1040. },
  1041. silent: true
  1042. };
  1043. },
  1044. data: [0]
  1045. }, {
  1046. name: "ring5", //绿点
  1047. type: 'custom',
  1048. coordinateSystem: "none",
  1049. renderItem: function (params, api) {
  1050. let x0 = api.getWidth() / 2;
  1051. let y0 = api.getHeight() / 2;
  1052. let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
  1053. let point = getCirlPoint(x0, y0, r, (270 + -angle))
  1054. return {
  1055. type: 'circle',
  1056. shape: {
  1057. cx: point.x,
  1058. cy: point.y,
  1059. r: 4
  1060. },
  1061. style: {
  1062. stroke: "#0CD3DB", //绿
  1063. fill: "#0CD3DB"
  1064. },
  1065. silent: true
  1066. };
  1067. },
  1068. data: [0]
  1069. }, {
  1070. name: '设备离线率',
  1071. type: 'pie',
  1072. radius: ['72%', '55%'],
  1073. silent: true,
  1074. clockwise: true,
  1075. startAngle: 90,
  1076. z: 0,
  1077. zlevel: 0,
  1078. label: {
  1079. normal: {
  1080. position: "center",
  1081. }
  1082. },
  1083. data: [{
  1084. value: value,
  1085. name: "",
  1086. itemStyle: {
  1087. normal: {
  1088. color: { // 完成的圆环的颜色
  1089. colorStops: [{
  1090. offset: 0,
  1091. color: '#A098FC' // 0% 处的颜色
  1092. },
  1093. {
  1094. offset: 0.3,
  1095. color: '#4386FA' // 0% 处的颜色
  1096. },
  1097. {
  1098. offset: 0.6,
  1099. color: '#4FADFD' // 0% 处的颜色
  1100. },
  1101. {
  1102. offset: 0.8,
  1103. color: '#0CD3DB' // 100% 处的颜色
  1104. }, {
  1105. offset: 1,
  1106. color: '#646CF9' // 100% 处的颜色
  1107. }
  1108. ]
  1109. },
  1110. }
  1111. }
  1112. },
  1113. {
  1114. value: 100 - value,
  1115. name: "",
  1116. label: {
  1117. normal: {
  1118. show: false
  1119. }
  1120. },
  1121. itemStyle: {
  1122. normal: {
  1123. color: "#173164"
  1124. }
  1125. }
  1126. }
  1127. ]
  1128. },
  1129. {
  1130. name: '设备离线率',
  1131. type: 'pie',
  1132. radius: ['52%', '45%'],
  1133. silent: true,
  1134. clockwise: true,
  1135. startAngle: 270,
  1136. z: 0,
  1137. zlevel: 0,
  1138. label: {
  1139. normal: {
  1140. position: "center",
  1141. }
  1142. },
  1143. data: [{
  1144. value: value,
  1145. name: "",
  1146. itemStyle: {
  1147. normal: {
  1148. color: { // 完成的圆环的颜色
  1149. colorStops: [{
  1150. offset: 0,
  1151. color: '#00EDF3' // 0% 处的颜色
  1152. }, {
  1153. offset: 1,
  1154. color: '#646CF9' // 100% 处的颜色
  1155. }]
  1156. },
  1157. }
  1158. }
  1159. },
  1160. {
  1161. value: 100 - value,
  1162. name: "",
  1163. label: {
  1164. normal: {
  1165. show: false
  1166. }
  1167. },
  1168. itemStyle: {
  1169. normal: {
  1170. color: "#173164"
  1171. }
  1172. }
  1173. }
  1174. ]
  1175. },
  1176. ]
  1177. };
  1178. //获取圆上面某点的坐标(x0,y0表示坐标,r半径,angle角度)
  1179. function getCirlPoint(x0, y0, r, angle) {
  1180. let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
  1181. let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
  1182. return {
  1183. x: x1,
  1184. y: y1
  1185. }
  1186. }
  1187. function draw() {
  1188. angle = angle + 3
  1189. myChart.setOption(option, true)
  1190. //window.requestAnimationFrame(draw);
  1191. }
  1192. if (timerId) {
  1193. clearInterval(timerId);
  1194. }
  1195. timerId = setInterval(function () {
  1196. //用setInterval做动画感觉有问题
  1197. draw()
  1198. }, 100);
  1199. myChart.setOption(option);
  1200. }
  1201. ,
  1202. qkq_aqcn_chart() {
  1203. var myChart = echarts.init(document.getElementById('qkq_aqcn_chart'));
  1204. // mock数据
  1205. const mockData = {
  1206. value: 100,
  1207. name: '承诺率'
  1208. }
  1209. // 渐变色
  1210. var color = [
  1211. { offset: 0, color: 'rgba(0, 170, 255, 0.5)' },
  1212. { offset: 0.6, color: 'rgba(0, 170, 255, 0.6)' },
  1213. { offset: 0.95, color: 'rgba(0, 170, 255, 0.7)' },
  1214. { offset: 1, color: 'rgba(0, 170, 255, 0.9)' }
  1215. ];
  1216. // 圆环宽度
  1217. const barMaxWidth = 10
  1218. // 坐标轴
  1219. const angleAxis = {
  1220. show: false,
  1221. max: 100 * 360 / 270,
  1222. type: 'value',
  1223. startAngle: 225,
  1224. splitLine: { show: false }
  1225. }
  1226. // 坐标轴
  1227. const radiusAxis = {
  1228. show: false,
  1229. type: 'category',
  1230. }
  1231. //圆环位置和大小
  1232. const polar = {
  1233. center: ['50%', '60%'],
  1234. radius: '175%'
  1235. }
  1236. const series = [{
  1237. type: 'bar',
  1238. data: [{
  1239. //上层圆环,显示数据
  1240. value: mockData.value,
  1241. itemStyle: {
  1242. color: { type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: color, },
  1243. },
  1244. }],
  1245. label: {
  1246. show: true,
  1247. formatter: params => {
  1248. return `{a|${params.value}}{b| %}\n\n\n{c|${mockData.name}}`
  1249. },
  1250. rich: {
  1251. a: { fontSize: 18, verticalAlign: 'bottom' },
  1252. b: { fontSize: 16, verticalAlign: 'bottom' },
  1253. c: { fontSize: 14 }
  1254. },
  1255. itemStyle: {
  1256. normal: {
  1257. color: "#fff"
  1258. }
  1259. },
  1260. },
  1261. barGap: '-100%',
  1262. coordinateSystem: 'polar',
  1263. roundCap: true,
  1264. z: 2
  1265. },
  1266. {
  1267. type: 'bar',
  1268. data: [{
  1269. value: 100,
  1270. itemStyle: { color: 'rgba(0, 36, 109, 0.3)' }
  1271. }],
  1272. barGap: '-100%',
  1273. coordinateSystem: 'polar',
  1274. roundCap: true,
  1275. z: 1
  1276. }]
  1277. // 渲染
  1278. var option = { barMaxWidth, radiusAxis, polar, angleAxis, series};
  1279. if (option) {
  1280. myChart.setOption(option);
  1281. }
  1282. },
  1283. getCurrentTime() {
  1284. const now = new Date();
  1285. const year = now.getFullYear();
  1286. const month = now.getMonth() + 1;
  1287. const date = now.getDate();
  1288. const day = now.getDay();
  1289. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  1290. const hour = now.getHours();
  1291. const minute = now.getMinutes();
  1292. const second = now.getSeconds();
  1293. const formattedMonth = month < 10 ? `0${month}` : month;
  1294. const formattedDate = date < 10 ? `0${date}` : date;
  1295. const formattedHour = hour < 10 ? `0${hour}` : hour;
  1296. const formattedMinute = minute < 10 ? `0${minute}` : minute;
  1297. const formattedSecond = second < 10 ? `0${second}` : second;
  1298. this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
  1299. }
  1300. ,
  1301. regionTop() {
  1302. //摄像头统计
  1303. var myChart = echarts.init(document.getElementById('jczl-bmfw'));
  1304. let data = ['小区内部', '街道路面']
  1305. let valueData = [];
  1306. let labelData = []
  1307. for (var i = 0; i < data.length; i++) {
  1308. labelData.push(data[i]);
  1309. var lineNumber = Math.floor(Math.random() * 1000);
  1310. valueData.push(lineNumber);
  1311. }
  1312. var option = {
  1313. "backgroundColor": "rgba(0, 0, 0, 0)",
  1314. title: {
  1315. show: true,
  1316. text: '',
  1317. textStyle: {
  1318. color: '#fff',
  1319. fontSize: '14',
  1320. },
  1321. top: '0%',
  1322. left: 'bottom',
  1323. bottm: '-10%'
  1324. },
  1325. tooltip: {
  1326. trigger: 'axis',
  1327. axisPointer: {
  1328. type: 'shadow',
  1329. }
  1330. },
  1331. grid: {
  1332. top: '10%',
  1333. left: '15%',
  1334. right: '5%',
  1335. buttom: '-10',
  1336. },
  1337. xAxis: [{
  1338. type: 'category',
  1339. data: labelData,
  1340. axisTick: {
  1341. show: false, //隐藏X轴刻度
  1342. alignWithLabel: true
  1343. },
  1344. axisLabel: {
  1345. margin: 10,
  1346. color: '#e2e9ff',
  1347. textStyle: {
  1348. fontSize: 14
  1349. },
  1350. },
  1351. axisLine: {
  1352. lineStyle: {
  1353. color: 'rgba(255,255,255,0.12)',
  1354. },
  1355. },
  1356. }],
  1357. yAxis: {
  1358. name: '',
  1359. nameTextStyle: {
  1360. color: '#fff',
  1361. },
  1362. type: 'value',
  1363. axisLine: {
  1364. show: false,
  1365. lineStyle: {
  1366. color: 'rgba(255,255,255,0.12)'
  1367. },
  1368. },
  1369. axisLabel: {
  1370. formatter: '{value}',
  1371. color: '#e2e9ff',
  1372. },
  1373. splitLine: {
  1374. lineStyle: {
  1375. color: 'rgba(255,255,255,0.12)'
  1376. }
  1377. },
  1378. axisTick: {
  1379. show: true,
  1380. lineStyle: {
  1381. color: '#fff',
  1382. },
  1383. },
  1384. },
  1385. // 切片
  1386. series: [
  1387. {
  1388. type: 'lines',
  1389. coordinateSystem: 'cartesian2d',
  1390. data: valueData.map((item, index) => {
  1391. return {
  1392. coords: [
  1393. [index, 0],
  1394. [index, item - 4]
  1395. ]
  1396. };
  1397. }),
  1398. effect: {
  1399. show: true,
  1400. period: 3.5,// 周期 速度 2.5
  1401. trailLength: 0.5, //控制拖尾长度
  1402. symbolSize: 25, // ⭐⭐星星大小
  1403. symbol:
  1404. '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',
  1405. loop: true,
  1406. color: '#ffffff' //流光颜色
  1407. },
  1408. lineStyle: {
  1409. width: 0,
  1410. opacity: 0.6,
  1411. curveness: 0
  1412. },
  1413. z: 999
  1414. },
  1415. {
  1416. type: 'bar',
  1417. data: valueData,
  1418. barWidth: '20px',
  1419. itemStyle: {
  1420. normal: {
  1421. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1422. offset: 0,
  1423. color: 'rgba(0,244,255,1)' // 0% 处的颜色
  1424. }, {
  1425. offset: 1,
  1426. color: 'rgba(0,77,167,1)' // 100% 处的颜色
  1427. }], false),
  1428. barBorderRadius: [30, 30, 30, 30],
  1429. shadowColor: 'rgba(0,160,221,1)',
  1430. shadowBlur: 4,
  1431. }
  1432. },
  1433. }]
  1434. };
  1435. if (option) {
  1436. myChart.setOption(option);
  1437. }
  1438. }
  1439. ,
  1440. }
  1441. };
  1442. // import '@/assets/images/TL_Tab.js';
  1443. (function ($) {
  1444. $.fn.TL_Tab = function (options) {
  1445. var defaults = {
  1446. tab: ".df_67 ol li",
  1447. box: ".df_67 ul li",
  1448. events: "over",
  1449. num: 3,
  1450. speed: 300
  1451. };
  1452. var setting = $.extend(defaults, options);
  1453. var tl_tab = setting.tab;
  1454. var tl_box = setting.box;
  1455. var tl_events = setting.events;
  1456. var tl_num = setting.num;
  1457. var tl_speed = setting.speed;
  1458. var tl_time_out = null;
  1459. $(tl_box).css({
  1460. display: 'none'
  1461. });
  1462. $(tl_tab).removeClass('df_on');
  1463. $(tl_tab).eq(tl_num - 1).addClass('df_on');
  1464. $(tl_box).eq(tl_num - 1).css({
  1465. display: 'block'
  1466. });
  1467. if (tl_events === 'click') {
  1468. $(tl_tab).click(function () {
  1469. $(tl_tab).removeClass('df_on');
  1470. $(tl_tab).eq($(this).index()).addClass('df_on');
  1471. $(tl_box).stop().fadeOut(tl_speed);
  1472. $(tl_box).eq($(this).index()).stop().fadeIn(tl_speed);
  1473. });
  1474. }
  1475. if (tl_events === 'over') {
  1476. $(tl_tab).hover(function () {
  1477. var _this = this;
  1478. clearTimeout(tl_num);
  1479. tl_time_out = setTimeout(function () {
  1480. $(tl_tab).removeClass('df_on');
  1481. $(tl_tab).eq($(_this).index()).addClass('df_on');
  1482. $(tl_box).stop().fadeOut(tl_speed);
  1483. $(tl_box).eq($(_this).index()).stop().fadeIn(tl_speed);
  1484. }, 30);
  1485. }, function () {
  1486. clearTimeout(tl_time_out);
  1487. });
  1488. }
  1489. };
  1490. })(jQuery);
  1491. // import '@/assets/images/leftnav.js';
  1492. $(function () {
  1493. var Accordion = function (el, multiple) {
  1494. this.el = el || {};
  1495. this.multiple = multiple || false;
  1496. // Variables privadas
  1497. var links = this.el.find('.link');
  1498. // Evento
  1499. links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
  1500. };
  1501. Accordion.prototype.dropdown = function (e) {
  1502. var $el = e.data.el;
  1503. let $this = $(this);
  1504. let $next = $this.next();
  1505. $next.slideToggle();
  1506. $this.parent().toggleClass('open');
  1507. if (!e.data.multiple) {
  1508. $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
  1509. }
  1510. };
  1511. var accordion = new Accordion($('#accordion'), false);
  1512. $('.submenu li').click(function () {
  1513. $(this).addClass('current').siblings('li').removeClass('current');
  1514. });
  1515. });
  1516. //切换单屏电视墙
  1517. $(function () {
  1518. $(this.$el).find('.facility_tab .div_tab a').TL_Tab({
  1519. tab: ".facility_tab .div_tab a",
  1520. box: ".facility_tab .tab_cont",
  1521. events: "click",
  1522. num: 1,
  1523. speed: 10
  1524. });
  1525. });
  1526. </script>
  1527. <style>
  1528. /* 添加你的CSS样式 */
  1529. </style>