jtzl.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <div>
  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">
  29. <div class="div_tab">
  30. <a>单屏</a>
  31. <a>电视墙</a>
  32. </div>
  33. <div class="clear"></div>
  34. <div class="tab_cont">
  35. <div class="qkq_tdzy">
  36. <div class="qkq_tit ">设备列表</div>
  37. <div class="selectDate">
  38. <span class="_selectData">锦程街道</span>
  39. <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
  40. <div class="_moreMenu" v-if="dropdownVisible">
  41. <ul>
  42. <li class="change">东风街道</li>
  43. <li>锦程街道</li>
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. <ul id="accordion" class="accordion">
  49. <li v-for="(camera, index) in cameras" :key="index">
  50. <div class="link">{{ camera.cameraName }}</div>
  51. </li>
  52. </ul>
  53. </div>
  54. <div class="tab_cont"></div>
  55. </div>
  56. <!-- 设备tab结束-->
  57. </div>
  58. <!--左侧结束-->
  59. <!--右侧开始-->
  60. <div class="right_con sprh-left">
  61. <div class="top_txt">
  62. <span>{{ currentTime }}</span>
  63. <!-- <span>星期六</span>-->
  64. <!-- <b>11:16:58</b>-->
  65. </div>
  66. <!-- 资源分布-->
  67. <div class="qkq_tdzy">
  68. <div class="qkq_tit ">资源分布</div>
  69. <div class="selectDate">
  70. <span class="_selectData">锦程街道</span>
  71. <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
  72. <div class="_moreMenu" v-if="dropdownVisible">
  73. <ul>
  74. <li class="change">东风街道</li>
  75. <li>锦程街道</li>
  76. </ul>
  77. </div>
  78. </div>
  79. </div>
  80. <div id="sprh-zyfb" style="margin:10px auto; width: 350px; height:220px;"></div>
  81. <!-- 资源分布-->
  82. <div class="qkq_tdzy">
  83. <div class="qkq_tit" style="margin-top: -35px">设备实时在线情况</div>
  84. </div>
  85. <div class="sbzs">
  86. <p>设备总数:</p>
  87. <span>1</span>
  88. <span>6</span>
  89. <span>4</span>
  90. <span>0</span>
  91. <p>个</p>
  92. </div>
  93. <div class="sb_cont">
  94. <div class="sb_in">
  95. <div id="sprh-zxfb" style="width:130px; height:150px;margin: 0 auto;"></div>
  96. <span class="zxsb">在线设备</span>
  97. <h2 class="zxsb_sl">1234<i>个</i></h2>
  98. </div>
  99. <div class="sb_in">
  100. <div id="sprh-lxfb" style="width:130px; height:150px;margin: 0 auto;"></div>
  101. <span class="lxsb">离线设备</span>
  102. <h2 class="lxsb_sl">234<i>个</i></h2>
  103. </div>
  104. </div>
  105. <div class="qkq_bmfw">
  106. <div class="qkq_tit ">摄像头统计</div>
  107. <div id="jczl-bmfw" style="margin: 20px auto 0px auto; width: 350px; height: 220px"></div>
  108. </div>
  109. </div>
  110. <!--右侧结束-->
  111. <!--底部开始-->
  112. <div class="footer">
  113. <div class="nav-bottom">
  114. <div class="nav-bottom-left">
  115. <div class="nav-li-left">
  116. <span>经济运行</span>
  117. </div>
  118. <div class="nav-li-left">
  119. <span>城市管理</span>
  120. </div>
  121. <div class="nav-li-left on" @click="handleNavigation('jtzl')">
  122. <span>交通治理</span>
  123. </div>
  124. <div class="nav-li-left" @click="handleNavigation('jczl')">
  125. <span>基层治理</span>
  126. </div>
  127. </div>
  128. <div class="nav-home-middle" @click="homePage('weather')">
  129. <img src="@/assets/images/home-btn.png"/>
  130. <a>返回首页</a>
  131. </div>
  132. <div class="nav-bottom-right">
  133. <div class="nav-li-right">
  134. <span>营商环境</span>
  135. </div>
  136. <div class="nav-li-right" @click="handleNavigation('yshj')">
  137. <span>政务运行</span>
  138. </div>
  139. <div class="nav-li-right" @click="handleNavigation('sprh')">
  140. <span>安全应急</span>
  141. </div>
  142. <div class="nav-li-right">
  143. <span>服务一汽</span>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <!--底部开始-->
  149. </div>
  150. </template>
  151. <script>
  152. import * as echarts from 'echarts'
  153. import $ from 'jquery'
  154. import jQuery from 'jquery'
  155. import "@/assets/images/qkq_body.css";
  156. import "@/assets/images/qkq_index.css";
  157. import "@/assets/images/qkq_sprh.css";
  158. import {getCameraList} from "@/api/system/camera";
  159. import supermap from "@/views/supermap/supermap";
  160. export default {
  161. name: "jtzl",
  162. components: {
  163. supermap
  164. },
  165. data() {
  166. return {
  167. dropdownVisible: false,
  168. cameras: [],
  169. sltProps: null,
  170. currentTime: '',
  171. btnOne: false,
  172. btnTwo: false
  173. };
  174. // 可根据实际情况添加更多设备列表
  175. },
  176. created() {
  177. },
  178. mounted() {
  179. this.resourceDistribution();
  180. this.deviceOnline();
  181. this.deviceOffline();
  182. this.cameraList();
  183. this.regionTop();
  184. // 每秒刷新时间
  185. setInterval(() => {
  186. this.getCurrentTime();
  187. }, 1000);
  188. },
  189. methods: {
  190. sltHandle() {
  191. this.btnOne = true
  192. this.btnTwo = false
  193. this.$refs.supermap.getSupermap(null, null, null, "slt", null, null)
  194. },
  195. yxtHandle() {
  196. this.btnTwo = true
  197. this.btnOne = false
  198. this.$refs.supermap.getSupermap(null, null, null, "yxt", null, null)
  199. },
  200. handleNavigation(route) {
  201. this.$router.push({path: route});
  202. },
  203. homePage(route) {
  204. this.$router.push({path: route});
  205. },
  206. cameraList() {
  207. getCameraList().then(response => {
  208. this.cameras = response.data;
  209. })
  210. },
  211. toggleDropdown(event) {
  212. this.dropdownVisible = !this.dropdownVisible;
  213. },
  214. resourceDistribution() {
  215. //资源分布
  216. var myChart = echarts.init(document.getElementById('sprh-zyfb'));
  217. let data = [
  218. {value: 0, label: '前程街道'},
  219. {value: 0, label: '富民街道'},
  220. {value: 0, label: '广兴街道'},
  221. {value: 0, label: '东风街道'},
  222. {value: 0, label: '锦绣街道'},
  223. {value: 0, label: '锦程街道'}
  224. ];
  225. let option = {
  226. grid: {
  227. top: 10,
  228. left: 33,
  229. right: 20,
  230. bottom: 5,
  231. containLabel: true
  232. },
  233. xAxis: {
  234. type: 'value',
  235. show: false
  236. },
  237. yAxis: {
  238. show: true,
  239. inverse: true,
  240. type: 'category',
  241. axisLine: {
  242. show: false
  243. }
  244. },
  245. series: [{
  246. name: 'label',
  247. type: 'bar',
  248. barWidth: 10,
  249. yAxisIndex: 0,
  250. label: {
  251. show: true,
  252. position: 2,
  253. color: '#fff',
  254. fontSize: 12
  255. },
  256. data: data.map((item) => {
  257. return {
  258. value: 0,
  259. label: {
  260. formatter() {
  261. return item.label;
  262. }
  263. }
  264. };
  265. })
  266. }, {
  267. name: 'value',
  268. type: 'bar',
  269. barWidth: 10,
  270. barMinHeight: 10, // 最小高度
  271. yAxisIndex: 0,
  272. label: {
  273. show: true,
  274. position: 'right',
  275. color: '#00d5e1',
  276. fontSize: 12,
  277. rich: {
  278. value: {
  279. color: '#00e1ce'
  280. }
  281. },
  282. formatter({
  283. value
  284. }) {
  285. return `{value|${value}个}`;
  286. }
  287. },
  288. itemStyle: {
  289. barBorderRadius: 3
  290. },
  291. data: data.map(({
  292. value
  293. }, index) => {
  294. let color = new echarts.graphic.LinearGradient(1, 0, 0, 1, [{
  295. offset: 1,
  296. color: '#004eaf' // 0% 处的颜色
  297. }, {
  298. offset: 0,
  299. color: '#089aa2' // 100% 处的颜色
  300. }], false)
  301. return {
  302. value,
  303. label: {
  304. color
  305. },
  306. itemStyle: {
  307. color
  308. }
  309. };
  310. })
  311. }]
  312. };
  313. if (option) {
  314. myChart.setOption(option);
  315. }
  316. let updateInterval = 1000; // 更新间隔,单位:毫秒
  317. let updateData = () => {
  318. data.forEach((item) => {
  319. item.value += Math.floor(Math.random() * 10); // 模拟逐渐增加的数据
  320. if (item.value >= 1000) {
  321. item.value = 0; // 当增加到1000时重新开始
  322. }
  323. });
  324. option.series[1].data = data.map(({value}, index) => {
  325. let color = new echarts.graphic.LinearGradient(1, 0, 0, 1, [{
  326. offset: 1,
  327. color: '#004eaf'
  328. }, {
  329. offset: 0,
  330. color: '#089aa2'
  331. }], false);
  332. return {
  333. value,
  334. label: {color},
  335. itemStyle: {color}
  336. };
  337. });
  338. myChart.setOption(option);
  339. };
  340. updateData(); // 首次更新数据
  341. let timer = setInterval(updateData, updateInterval);
  342. },
  343. deviceOnline() {
  344. //在线设备
  345. var myChart = echarts.init(document.getElementById('sprh-zxfb'));
  346. const dataArr = [
  347. {
  348. value: 0, // 初始值设为0
  349. name: '在线',
  350. },
  351. ];
  352. const updateData = () => {
  353. let value = dataArr[0].value + 10; // 每次增加的数值
  354. if (value > 500) {
  355. value = 0; // 当数值达到1000时重置为0
  356. }
  357. dataArr[0].value = value;
  358. myChart.setOption({
  359. series: [{
  360. data: dataArr,
  361. }],
  362. });
  363. };
  364. setInterval(updateData, 1000); // 每隔一秒更新一次数据
  365. let option = {
  366. tooltip: {
  367. formatter: '{a} <br/>{b} : {c}%',
  368. },
  369. series: [
  370. {
  371. type: 'gauge',
  372. radius: '90%',
  373. startAngle: '225',
  374. endAngle: '-45',
  375. pointer: {
  376. show: false,
  377. },
  378. detail: {
  379. formatter: function (value) {
  380. var num = Math.round(value);
  381. return '{bule|' + num + '}{white|%}';
  382. },
  383. rich: {
  384. white: {
  385. fontSize: 10,
  386. color: '#0454bf',
  387. fontWeight: '500',
  388. },
  389. bule: {
  390. fontSize: 22,
  391. fontFamily: 'DINBold',
  392. color: '#0454bf',
  393. fontWeight: '700',
  394. },
  395. },
  396. offsetCenter: ['0%', '0%'],
  397. },
  398. data: dataArr,
  399. title: {
  400. show: true,
  401. color: '#0454bf',
  402. offsetCenter: ['0', '75%'],
  403. fontSize: 14
  404. },
  405. axisLine: {
  406. show: true,
  407. lineStyle: {
  408. color: [
  409. [0.61, new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  410. {offset: 0, color: '#0d4470'},
  411. {offset: 1, color: '#0659c9'}
  412. ])],
  413. [1, '#15337C'],
  414. ],
  415. width: 20,
  416. shadowOffsetX: 0,
  417. shadowOffsetY: 0,
  418. opacity: 1,
  419. },
  420. },
  421. axisTick: {
  422. show: false,
  423. },
  424. splitLine: {
  425. show: false,
  426. length: 35,
  427. lineStyle: {
  428. color: '#051c48',
  429. width: 2,
  430. type: 'solid',
  431. },
  432. },
  433. axisLabel: {
  434. show: false,
  435. },
  436. },
  437. ],
  438. };
  439. myChart.setOption(option);
  440. },
  441. deviceOffline() {
  442. // 视频融合--离线设备
  443. // 基于准备好的dom,初始化echarts实例
  444. var myChart = echarts.init(document.getElementById('sprh-lxfb'));
  445. const dataArr1 = [
  446. {
  447. value: 39,
  448. name: '离线',
  449. },
  450. ];
  451. const color1 = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  452. {
  453. offset: 0,
  454. color: '#976204', // 0% 处的颜色
  455. },
  456. {
  457. offset: 1,
  458. color: '#e1b905', // 100% 处的颜色
  459. },
  460. ]);
  461. const colorSet1 = [
  462. [0.39, color1],
  463. [1, '#15337C'],
  464. ];
  465. const rich1 = {
  466. white: {
  467. fontSize: 10,
  468. color: '#ae8609',
  469. fontWeight: '500',
  470. },
  471. bule: {
  472. fontSize: 22,
  473. fontFamily: 'DINBold',
  474. color: '#ae8609',
  475. fontWeight: '700',
  476. },
  477. radius: {
  478. width: 350,
  479. height: 80,
  480. // lineHeight:80,
  481. borderWidth: 1,
  482. borderColor: '#051c48',
  483. fontSize: 50,
  484. color: '#ae8609',
  485. backgroundColor: '#051c48',
  486. borderRadius: 20,
  487. textAlign: 'center',
  488. },
  489. size: {
  490. height: 400,
  491. padding: [50, 0, 0, 0],
  492. },
  493. };
  494. let option = {
  495. tooltip: {
  496. formatter: '{a} <br/>{b} : {c}%',
  497. },
  498. series: [
  499. {
  500. type: 'gauge',
  501. radius: '90%',
  502. startAngle: '225',
  503. endAngle: '-45',
  504. pointer: {
  505. show: false,
  506. },
  507. detail: {
  508. formatter: function (value) {
  509. var num = Math.round(value);
  510. return '{bule|' + num + '}{white|%}';
  511. },
  512. rich: rich1,
  513. offsetCenter: ['0%', '0%'],
  514. },
  515. data: dataArr1,
  516. title: {
  517. show: true,
  518. color: '#ae8609',
  519. offsetCenter: ['0', '75%'],
  520. fontSize: 14
  521. },
  522. axisLine: {
  523. show: true,
  524. lineStyle: {
  525. color: colorSet1,
  526. width: 20,
  527. shadowOffsetX: 0,
  528. shadowOffsetY: 0,
  529. opacity: 1,
  530. },
  531. },
  532. axisTick: {
  533. show: false,
  534. },
  535. splitLine: {
  536. show: false,
  537. length: 35,
  538. lineStyle: {
  539. color: '#051c48',
  540. width: 2,
  541. type: 'solid',
  542. },
  543. },
  544. axisLabel: {
  545. show: false,
  546. },
  547. },
  548. ],
  549. };
  550. if (option) {
  551. myChart.setOption(option);
  552. }
  553. let value = 0;
  554. setInterval(() => {
  555. value = value >= 1000 ? 0 : value + 5; // 数据从0开始往上涨,涨到1000再重新开始
  556. dataArr1[0].value = value;
  557. myChart.setOption({
  558. series: [{
  559. data: dataArr1
  560. }]
  561. });
  562. }, 1000); // 每100毫秒更新一次数据,可以根据需要调整时间间隔
  563. },
  564. getCurrentTime() {
  565. const now = new Date();
  566. const year = now.getFullYear();
  567. const month = now.getMonth() + 1;
  568. const date = now.getDate();
  569. const day = now.getDay();
  570. const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  571. const hour = now.getHours();
  572. const minute = now.getMinutes();
  573. const second = now.getSeconds();
  574. const formattedMonth = month < 10 ? `0${month}` : month;
  575. const formattedDate = date < 10 ? `0${date}` : date;
  576. const formattedHour = hour < 10 ? `0${hour}` : hour;
  577. const formattedMinute = minute < 10 ? `0${minute}` : minute;
  578. const formattedSecond = second < 10 ? `0${second}` : second;
  579. this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
  580. },
  581. regionTop() {
  582. //摄像头统计
  583. var myChart = echarts.init(document.getElementById('jczl-bmfw'));
  584. let data = ['小区建设', '路面建设', '已有']
  585. let valueData = [];
  586. let labelData = []
  587. for (var i = 0; i < data.length; i++) {
  588. labelData.push(data[i]);
  589. var lineNumber = Math.floor(Math.random() * 2000);
  590. valueData.push(lineNumber);
  591. }
  592. var option = {
  593. title: {
  594. show: true,
  595. text: '',
  596. textStyle: {
  597. color: '#fff',
  598. fontSize: '14',
  599. },
  600. top: '0%',
  601. left: 'bottom',
  602. },
  603. tooltip: {
  604. trigger: 'axis',
  605. axisPointer: {
  606. type: 'shadow'
  607. }
  608. },
  609. grid: {
  610. top: '10%',
  611. left: '15%',
  612. right: '5%',
  613. buttom: '0',
  614. },
  615. xAxis: {
  616. type: 'category',
  617. axisLine: {
  618. lineStyle: {
  619. color: 'rgba(255,255,255,0.12)',
  620. },
  621. },
  622. axisLabel: {
  623. margin: 10,
  624. color: '#e2e9ff',
  625. textStyle: {
  626. fontSize: 14
  627. },
  628. },
  629. axisTick: {
  630. show: false,
  631. },
  632. data: labelData
  633. },
  634. yAxis: {
  635. name: '',
  636. nameTextStyle: {
  637. color: '#fff',
  638. },
  639. type: 'value',
  640. axisLine: {
  641. show: false,
  642. lineStyle: {
  643. color: 'rgba(255,255,255,0.12)'
  644. },
  645. },
  646. axisLabel: {
  647. formatter: '{value}',
  648. color: '#e2e9ff',
  649. },
  650. splitLine: {
  651. lineStyle: {
  652. color: 'rgba(255,255,255,0.12)'
  653. }
  654. },
  655. axisTick: {
  656. show: true,
  657. lineStyle: {
  658. color: '#fff',
  659. },
  660. },
  661. },
  662. series: [{
  663. itemStyle: {
  664. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  665. offset: 0,
  666. color: 'rgba(30, 129, 204, 1.0)'
  667. }, {
  668. offset: 1,
  669. color: 'rgba(21, 37, 126, 1.0)'
  670. }], false),
  671. barBorderRadius: 8,
  672. opacity: 0.8
  673. },
  674. barWidth: 14,
  675. label: {
  676. show: true,
  677. position: ['0', '-12'],
  678. color: '#fff',
  679. },
  680. data: valueData,
  681. type: 'bar',
  682. }]
  683. };
  684. var currentIndex = -1;
  685. var timer = setInterval(function () {
  686. // 生成新的随机数据
  687. currentIndex++;
  688. if (currentIndex >= 3) {
  689. currentIndex = 0;
  690. for (var i = 0; i < valueData.length; i++) {
  691. valueData[i] = Math.floor(Math.random() * 2000);
  692. }
  693. } else {
  694. valueData[currentIndex] = Math.floor(Math.random() * 2000);
  695. }
  696. // 更新 option 中的数据
  697. option.series[0].data = valueData;
  698. // 重新渲染图表
  699. myChart.setOption(option);
  700. }, 1000); // 每秒更新一次数据
  701. if (option) {
  702. myChart.setOption(option);
  703. }
  704. },
  705. }
  706. };
  707. // import '@/assets/images/TL_Tab.js';
  708. (function ($) {
  709. $.fn.TL_Tab = function (options) {
  710. var defaults = {
  711. tab: ".df_67 ol li",
  712. box: ".df_67 ul li",
  713. events: "over",
  714. num: 3,
  715. speed: 300
  716. };
  717. var setting = $.extend(defaults, options);
  718. var tl_tab = setting.tab;
  719. var tl_box = setting.box;
  720. var tl_events = setting.events;
  721. var tl_num = setting.num;
  722. var tl_speed = setting.speed;
  723. var tl_time_out = null;
  724. $(tl_box).css({
  725. display: 'none'
  726. });
  727. $(tl_tab).removeClass('df_on');
  728. $(tl_tab).eq(tl_num - 1).addClass('df_on');
  729. $(tl_box).eq(tl_num - 1).css({
  730. display: 'block'
  731. });
  732. if (tl_events === 'click') {
  733. $(tl_tab).click(function () {
  734. $(tl_tab).removeClass('df_on');
  735. $(tl_tab).eq($(this).index()).addClass('df_on');
  736. $(tl_box).stop().fadeOut(tl_speed);
  737. $(tl_box).eq($(this).index()).stop().fadeIn(tl_speed);
  738. });
  739. }
  740. if (tl_events === 'over') {
  741. $(tl_tab).hover(function () {
  742. var _this = this;
  743. clearTimeout(tl_num);
  744. tl_time_out = setTimeout(function () {
  745. $(tl_tab).removeClass('df_on');
  746. $(tl_tab).eq($(_this).index()).addClass('df_on');
  747. $(tl_box).stop().fadeOut(tl_speed);
  748. $(tl_box).eq($(_this).index()).stop().fadeIn(tl_speed);
  749. }, 30);
  750. }, function () {
  751. clearTimeout(tl_time_out);
  752. });
  753. }
  754. };
  755. })(jQuery);
  756. // import '@/assets/images/leftnav.js';
  757. $(function () {
  758. var Accordion = function (el, multiple) {
  759. this.el = el || {};
  760. this.multiple = multiple || false;
  761. // Variables privadas
  762. var links = this.el.find('.link');
  763. // Evento
  764. links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
  765. };
  766. Accordion.prototype.dropdown = function (e) {
  767. var $el = e.data.el;
  768. let $this = $(this);
  769. let $next = $this.next();
  770. $next.slideToggle();
  771. $this.parent().toggleClass('open');
  772. if (!e.data.multiple) {
  773. $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
  774. }
  775. };
  776. var accordion = new Accordion($('#accordion'), false);
  777. $('.submenu li').click(function () {
  778. $(this).addClass('current').siblings('li').removeClass('current');
  779. });
  780. });
  781. //切换单屏电视墙
  782. $(function () {
  783. $(this.$el).find('.facility_tab .div_tab a').TL_Tab({
  784. tab: ".facility_tab .div_tab a",
  785. box: ".facility_tab .tab_cont",
  786. events: "click",
  787. num: 1,
  788. speed: 10
  789. });
  790. });
  791. </script>
  792. <style>
  793. /* 添加你的CSS样式 */
  794. </style>