aqyj.vue 40 KB

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