sprh.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div>
  3. <div class="map">
  4. <supermap ref="supermap" style="height: 100%;width: 100%;position: absolute;z-index: 0;"></supermap>
  5. </div>
  6. <!-- 阴影背景 -->
  7. <div class="bj_left"><img src="@/assets/images/sprhbj-left.png"/></div>
  8. <div class="bj_right"><img src="@/assets/images/sprhbj-right.png"/></div>
  9. <div class="bj_bottom"><img src="@/assets/images/sprhbj-bottom.png"/></div>
  10. <!--头部开始-->
  11. <div class="header">
  12. <h1>城市运行一网统管指挥中心</h1>
  13. </div>
  14. <!--头部结束-->
  15. <!--左侧开始-->
  16. <div class="left_con sprh-left">
  17. <div class="top_txt">
  18. <b>汽开区</b>
  19. <span>小雨</span>
  20. <span>9~16℃</span>
  21. </div>
  22. <!-- 设备tab开始-->
  23. <div class="facility_tab">
  24. <div class="div_tab">
  25. <a>单屏</a>
  26. <a>电视墙</a>
  27. </div>
  28. <div class="clear"></div>
  29. <div class="tab_cont">
  30. <div class="qkq_tdzy">
  31. <div class="qkq_tit ">设备列表</div>
  32. <div class="selectDate">
  33. <span class="_selectData">程锦街道</span>
  34. <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
  35. <div class="_moreMenu" v-if="dropdownVisible">
  36. <ul>
  37. <li class="change">东风街道</li>
  38. <li>程锦街道</li>
  39. </ul>
  40. </div>
  41. </div>
  42. </div>
  43. <ul id="accordion" class="accordion">
  44. <li v-for="(camera, index) in cameras" :key="index">
  45. <div class="link">{{ camera.cameraName }}</div>
  46. </li>
  47. </ul>
  48. </div>
  49. <div class="tab_cont"></div>
  50. </div>
  51. <!-- 设备tab结束-->
  52. </div>
  53. <!--左侧结束-->
  54. <!--右侧开始-->
  55. <div class="right_con sprh-left">
  56. <div class="top_txt">
  57. <span>2024.04.20</span>
  58. <span>星期六</span>
  59. <b>11:16:58</b>
  60. </div>
  61. <!-- 资源分布-->
  62. <div class="qkq_tdzy">
  63. <div class="qkq_tit ">资源分布</div>
  64. <div class="selectDate">
  65. <span class="_selectData">程锦街道</span>
  66. <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
  67. <div class="_moreMenu" v-if="dropdownVisible">
  68. <ul>
  69. <li class="change">东风街道</li>
  70. <li>程锦街道</li>
  71. </ul>
  72. </div>
  73. </div>
  74. </div>
  75. <div id="sprh-zyfb" style="margin:10px auto; width: 350px; height:240px;"></div>
  76. <!-- 资源分布-->
  77. <div class="qkq_tdzy">
  78. <div class="qkq_tit ">设备实时在线情况</div>
  79. </div>
  80. <div class="sbzs">
  81. <p>设备总数:</p>
  82. <span>1</span>
  83. <span>6</span>
  84. <span>4</span>
  85. <span>0</span>
  86. <p>个</p>
  87. </div>
  88. <div class="sb_cont">
  89. <div class="sb_in">
  90. <div id="sprh-zxfb" style="width:130px; height:150px;margin: 0 auto;"></div>
  91. <span class="zxsb">在线设备</span>
  92. <h2 class="zxsb_sl">1234<i>个</i></h2>
  93. </div>
  94. <div class="sb_in">
  95. <div id="sprh-lxfb" style="width:130px; height:150px;margin: 0 auto;"></div>
  96. <span class="lxsb">离线设备</span>
  97. <h2 class="lxsb_sl">234<i>个</i></h2>
  98. </div>
  99. </div>
  100. </div>
  101. <!--右侧结束-->
  102. <!--底部开始-->
  103. <div class="footer">
  104. <div class="nav-bottom">
  105. <div class="nav-bottom-left">
  106. <div class="nav-li-left">
  107. <span>经济运行</span>
  108. </div>
  109. <div class="nav-li-left">
  110. <span>城市管理</span>
  111. </div>
  112. <div class="nav-li-left">
  113. <span>交通治理</span>
  114. </div>
  115. <div class="nav-li-left">
  116. <span>基层治理</span>
  117. </div>
  118. </div>
  119. <div class="nav-home-middle" @click="homePage('weather')">
  120. <img src="@/assets/images/home-btn.png"/>
  121. <a>返回首页</a>
  122. </div>
  123. <div class="nav-bottom-right">
  124. <div class="nav-li-right" @click="handleNavigation('yshj')">
  125. <span>营商环境</span>
  126. </div>
  127. <div class="nav-li-right">
  128. <span>政务运行</span>
  129. </div>
  130. <div class="nav-li-right">
  131. <span>安全应急</span>
  132. </div>
  133. <div class="nav-li-right on">
  134. <span>服务一汽</span>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <!--底部开始-->
  140. </div>
  141. </template>
  142. <script>
  143. import * as echarts from 'echarts'
  144. import $ from 'jquery'
  145. import jQuery from 'jquery'
  146. import "@/assets/images/qkq_body.css";
  147. import "@/assets/images/qkq_index.css";
  148. import "@/assets/images/qkq_sprh.css";
  149. import {getCameraList} from "@/api/system/camera";
  150. import supermap from "@/views/supermap/supermap";
  151. export default {
  152. name: "sprh",
  153. components:{
  154. supermap
  155. },
  156. data() {
  157. return {
  158. dropdownVisible: false,
  159. cameras: []
  160. };
  161. // 可根据实际情况添加更多设备列表
  162. },
  163. created() {
  164. },
  165. mounted() {
  166. this.resourceDistribution();
  167. this.deviceOnline();
  168. this.deviceOffline();
  169. this.cameraList();
  170. },
  171. methods: {
  172. handleNavigation(route) {
  173. this.$router.push({ path: route });
  174. },
  175. homePage(route) {
  176. this.$router.push({ path: route });
  177. },
  178. cameraList() {
  179. getCameraList().then(response => {
  180. this.cameras = response.data;
  181. })
  182. },
  183. toggleDropdown(event) {
  184. this.dropdownVisible = !this.dropdownVisible;
  185. },
  186. resourceDistribution() {
  187. //资源分布
  188. var myChart = echarts.init(document.getElementById('sprh-zyfb'));
  189. let data = [{
  190. value: 120,
  191. label: '东兴网格'
  192. }, {
  193. value: 142,
  194. label: '胜利网格'
  195. }, {
  196. value: 110,
  197. label: '裕民网格'
  198. },
  199. {
  200. value: 132,
  201. label: '首期网格'
  202. },
  203. {
  204. value: 132,
  205. label: '民生网格 '
  206. }
  207. ];
  208. let option = {
  209. grid: {
  210. top: 10,
  211. left: 33,
  212. right: 20,
  213. bottom: 5,
  214. containLabel: true
  215. },
  216. xAxis: {
  217. type: 'value',
  218. show: false
  219. },
  220. yAxis: {
  221. show: true,
  222. inverse: true,
  223. type: 'category',
  224. axisLine: {
  225. show: false
  226. }
  227. },
  228. series: [{
  229. name: 'label',
  230. type: 'bar',
  231. barWidth: 10,
  232. yAxisIndex: 0,
  233. label: {
  234. show: true,
  235. position: 2,
  236. color: '#fff',
  237. fontSize: 12
  238. },
  239. data: data.map((item) => {
  240. return {
  241. value: 0,
  242. label: {
  243. formatter() {
  244. return item.label;
  245. }
  246. }
  247. };
  248. })
  249. }, {
  250. name: 'value',
  251. type: 'bar',
  252. barWidth: 10,
  253. barMinHeight: 10, // 最小高度
  254. yAxisIndex: 0,
  255. label: {
  256. show: true,
  257. position: 'right',
  258. color: '#00d5e1',
  259. fontSize: 12,
  260. formatter({
  261. value
  262. }) {
  263. return `${value}人`;
  264. }
  265. },
  266. itemStyle: {
  267. barBorderRadius: 3
  268. },
  269. data: data.map(({
  270. value
  271. }, index) => {
  272. let color = new echarts.graphic.LinearGradient(1, 0, 0, 1, [{
  273. offset: 1,
  274. color: '#004eaf' // 0% 处的颜色
  275. }, {
  276. offset: 0,
  277. color: '#089aa2' // 100% 处的颜色
  278. }], false)
  279. return {
  280. value,
  281. label: {
  282. color
  283. },
  284. itemStyle: {
  285. color
  286. }
  287. };
  288. })
  289. }]
  290. };
  291. if (option) {
  292. myChart.setOption(option);
  293. }
  294. },
  295. deviceOnline() {
  296. // 视频融合--在线设备
  297. // 基于准备好的dom,初始化echarts实例
  298. var myChart = echarts.init(document.getElementById('sprh-zxfb'));
  299. const dataArr = [
  300. {
  301. value: 61,
  302. name: '在线',
  303. },
  304. ];
  305. const color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  306. {
  307. offset: 0,
  308. color: '#0d4470', // 0% 处的颜色
  309. },
  310. {
  311. offset: 1,
  312. color: '#0659c9', // 100% 处的颜色
  313. },
  314. ]);
  315. const colorSet = [
  316. [0.61, color],
  317. [1, '#15337C'],
  318. ];
  319. const rich = {
  320. white: {
  321. fontSize: 10,
  322. color: '#0454bf',
  323. fontWeight: '500',
  324. },
  325. bule: {
  326. fontSize: 22,
  327. fontFamily: 'DINBold',
  328. color: '#0454bf',
  329. fontWeight: '700',
  330. },
  331. radius: {
  332. width: 350,
  333. height: 80,
  334. // lineHeight:80,
  335. borderWidth: 1,
  336. borderColor: '#051c48',
  337. fontSize: 50,
  338. color: '#0454bf',
  339. backgroundColor: '#051c48',
  340. borderRadius: 20,
  341. textAlign: 'center',
  342. },
  343. size: {
  344. height: 400,
  345. padding: [50, 0, 0, 0],
  346. },
  347. };
  348. let option = {
  349. tooltip: {
  350. formatter: '{a} <br/>{b} : {c}%',
  351. },
  352. series: [
  353. {
  354. type: 'gauge',
  355. radius: '90%',
  356. startAngle: '225',
  357. endAngle: '-45',
  358. pointer: {
  359. show: false,
  360. },
  361. detail: {
  362. formatter: function (value) {
  363. var num = Math.round(value);
  364. return '{bule|' + num + '}{white|%}';
  365. },
  366. rich: rich,
  367. offsetCenter: ['0%', '0%'],
  368. },
  369. data: dataArr,
  370. title: {
  371. show: true,
  372. color: '#0454bf',
  373. offsetCenter: ['0', '75%'],
  374. fontSize: 14
  375. },
  376. axisLine: {
  377. show: true,
  378. lineStyle: {
  379. color: colorSet,
  380. width: 20,
  381. shadowOffsetX: 0,
  382. shadowOffsetY: 0,
  383. opacity: 1,
  384. },
  385. },
  386. axisTick: {
  387. show: false,
  388. },
  389. splitLine: {
  390. show: false,
  391. length: 35,
  392. lineStyle: {
  393. color: '#051c48',
  394. width: 2,
  395. type: 'solid',
  396. },
  397. },
  398. axisLabel: {
  399. show: false,
  400. },
  401. },
  402. ],
  403. };
  404. if (option) {
  405. myChart.setOption(option);
  406. }
  407. },
  408. deviceOffline() {
  409. // 视频融合--离线设备
  410. // 基于准备好的dom,初始化echarts实例
  411. var myChart = echarts.init(document.getElementById('sprh-lxfb'));
  412. const dataArr1 = [
  413. {
  414. value: 39,
  415. name: '离线',
  416. },
  417. ];
  418. const color1 = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  419. {
  420. offset: 0,
  421. color: '#976204', // 0% 处的颜色
  422. },
  423. {
  424. offset: 1,
  425. color: '#e1b905', // 100% 处的颜色
  426. },
  427. ]);
  428. const colorSet1 = [
  429. [0.39, color1],
  430. [1, '#15337C'],
  431. ];
  432. const rich1 = {
  433. white: {
  434. fontSize: 10,
  435. color: '#ae8609',
  436. fontWeight: '500',
  437. },
  438. bule: {
  439. fontSize: 22,
  440. fontFamily: 'DINBold',
  441. color: '#ae8609',
  442. fontWeight: '700',
  443. },
  444. radius: {
  445. width: 350,
  446. height: 80,
  447. // lineHeight:80,
  448. borderWidth: 1,
  449. borderColor: '#051c48',
  450. fontSize: 50,
  451. color: '#ae8609',
  452. backgroundColor: '#051c48',
  453. borderRadius: 20,
  454. textAlign: 'center',
  455. },
  456. size: {
  457. height: 400,
  458. padding: [50, 0, 0, 0],
  459. },
  460. };
  461. let option = {
  462. tooltip: {
  463. formatter: '{a} <br/>{b} : {c}%',
  464. },
  465. series: [
  466. {
  467. type: 'gauge',
  468. radius: '90%',
  469. startAngle: '225',
  470. endAngle: '-45',
  471. pointer: {
  472. show: false,
  473. },
  474. detail: {
  475. formatter: function (value) {
  476. var num = Math.round(value);
  477. return '{bule|' + num + '}{white|%}';
  478. },
  479. rich: rich1,
  480. offsetCenter: ['0%', '0%'],
  481. },
  482. data: dataArr1,
  483. title: {
  484. show: true,
  485. color: '#ae8609',
  486. offsetCenter: ['0', '75%'],
  487. fontSize: 14
  488. },
  489. axisLine: {
  490. show: true,
  491. lineStyle: {
  492. color: colorSet1,
  493. width: 20,
  494. shadowOffsetX: 0,
  495. shadowOffsetY: 0,
  496. opacity: 1,
  497. },
  498. },
  499. axisTick: {
  500. show: false,
  501. },
  502. splitLine: {
  503. show: false,
  504. length: 35,
  505. lineStyle: {
  506. color: '#051c48',
  507. width: 2,
  508. type: 'solid',
  509. },
  510. },
  511. axisLabel: {
  512. show: false,
  513. },
  514. },
  515. ],
  516. };
  517. if (option) {
  518. myChart.setOption(option);
  519. }
  520. }
  521. }
  522. };
  523. // import '@/assets/images/TL_Tab.js';
  524. (function ($) {
  525. $.fn.TL_Tab = function (options) {
  526. var defaults = {
  527. tab: ".df_67 ol li",
  528. box: ".df_67 ul li",
  529. events: "over",
  530. num: 3,
  531. speed: 300
  532. };
  533. var setting = $.extend(defaults, options);
  534. var tl_tab = setting.tab;
  535. var tl_box = setting.box;
  536. var tl_events = setting.events;
  537. var tl_num = setting.num;
  538. var tl_speed = setting.speed;
  539. var tl_time_out = null;
  540. $(tl_box).css({
  541. display: 'none'
  542. });
  543. $(tl_tab).removeClass('df_on');
  544. $(tl_tab).eq(tl_num - 1).addClass('df_on');
  545. $(tl_box).eq(tl_num - 1).css({
  546. display: 'block'
  547. });
  548. if (tl_events === 'click') {
  549. $(tl_tab).click(function () {
  550. $(tl_tab).removeClass('df_on');
  551. $(tl_tab).eq($(this).index()).addClass('df_on');
  552. $(tl_box).stop().fadeOut(tl_speed);
  553. $(tl_box).eq($(this).index()).stop().fadeIn(tl_speed);
  554. });
  555. }
  556. if (tl_events === 'over') {
  557. $(tl_tab).hover(function () {
  558. var _this = this;
  559. clearTimeout(tl_num);
  560. tl_time_out = setTimeout(function () {
  561. $(tl_tab).removeClass('df_on');
  562. $(tl_tab).eq($(_this).index()).addClass('df_on');
  563. $(tl_box).stop().fadeOut(tl_speed);
  564. $(tl_box).eq($(_this).index()).stop().fadeIn(tl_speed);
  565. }, 30);
  566. }, function () {
  567. clearTimeout(tl_time_out);
  568. });
  569. }
  570. };
  571. })(jQuery);
  572. // import '@/assets/images/leftnav.js';
  573. $(function () {
  574. var Accordion = function (el, multiple) {
  575. this.el = el || {};
  576. this.multiple = multiple || false;
  577. // Variables privadas
  578. var links = this.el.find('.link');
  579. // Evento
  580. links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
  581. };
  582. Accordion.prototype.dropdown = function (e) {
  583. var $el = e.data.el;
  584. let $this = $(this);
  585. let $next = $this.next();
  586. $next.slideToggle();
  587. $this.parent().toggleClass('open');
  588. if (!e.data.multiple) {
  589. $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
  590. }
  591. };
  592. var accordion = new Accordion($('#accordion'), false);
  593. $('.submenu li').click(function () {
  594. $(this).addClass('current').siblings('li').removeClass('current');
  595. });
  596. });
  597. //切换单屏电视墙
  598. $(function () {
  599. $(this.$el).find('.facility_tab .div_tab a').TL_Tab({
  600. tab: ".facility_tab .div_tab a",
  601. box: ".facility_tab .tab_cont",
  602. events: "click",
  603. num: 1,
  604. speed: 10
  605. });
  606. });
  607. </script>
  608. <style>
  609. /* 添加你的CSS样式 */
  610. </style>