csgl.vue 40 KB

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