aqyj.vue 44 KB

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