jtzl.vue 40 KB

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