jtzl.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  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: 3.5,// 周期 速度 2.5
  1215. trailLength: 0.5, //控制拖尾长度
  1216. symbolSize: 25, // ⭐⭐星星大小
  1217. symbol:
  1218. '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',
  1219. loop: true,
  1220. color: '#ffffff' //流光颜色
  1221. },
  1222. lineStyle: {
  1223. width: 0,
  1224. opacity: 0.6,
  1225. curveness: 0
  1226. },
  1227. z: 999
  1228. },
  1229. {
  1230. type: 'bar',
  1231. data: valueData,
  1232. barWidth: '20px',
  1233. itemStyle: {
  1234. normal: {
  1235. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1236. offset: 0,
  1237. color: 'rgba(0,244,255,1)' // 0% 处的颜色
  1238. }, {
  1239. offset: 1,
  1240. color: 'rgba(0,77,167,1)' // 100% 处的颜色
  1241. }], false),
  1242. barBorderRadius: [30, 30, 30, 30],
  1243. shadowColor: 'rgba(0,160,221,1)',
  1244. shadowBlur: 4,
  1245. }
  1246. },
  1247. }]
  1248. };
  1249. if (option) {
  1250. myChart.setOption(option);
  1251. }
  1252. },
  1253. }
  1254. };
  1255. // import '@/assets/images/TL_Tab.js';
  1256. (function ($) {
  1257. $.fn.TL_Tab = function (options) {
  1258. var defaults = {
  1259. tab: ".df_67 ol li",
  1260. box: ".df_67 ul li",
  1261. events: "over",
  1262. num: 3,
  1263. speed: 300
  1264. };
  1265. var setting = $.extend(defaults, options);
  1266. var tl_tab = setting.tab;
  1267. var tl_box = setting.box;
  1268. var tl_events = setting.events;
  1269. var tl_num = setting.num;
  1270. var tl_speed = setting.speed;
  1271. var tl_time_out = null;
  1272. $(tl_box).css({
  1273. display: 'none'
  1274. });
  1275. $(tl_tab).removeClass('df_on');
  1276. $(tl_tab).eq(tl_num - 1).addClass('df_on');
  1277. $(tl_box).eq(tl_num - 1).css({
  1278. display: 'block'
  1279. });
  1280. if (tl_events === 'click') {
  1281. $(tl_tab).click(function () {
  1282. $(tl_tab).removeClass('df_on');
  1283. $(tl_tab).eq($(this).index()).addClass('df_on');
  1284. $(tl_box).stop().fadeOut(tl_speed);
  1285. $(tl_box).eq($(this).index()).stop().fadeIn(tl_speed);
  1286. });
  1287. }
  1288. if (tl_events === 'over') {
  1289. $(tl_tab).hover(function () {
  1290. var _this = this;
  1291. clearTimeout(tl_num);
  1292. tl_time_out = setTimeout(function () {
  1293. $(tl_tab).removeClass('df_on');
  1294. $(tl_tab).eq($(_this).index()).addClass('df_on');
  1295. $(tl_box).stop().fadeOut(tl_speed);
  1296. $(tl_box).eq($(_this).index()).stop().fadeIn(tl_speed);
  1297. }, 30);
  1298. }, function () {
  1299. clearTimeout(tl_time_out);
  1300. });
  1301. }
  1302. };
  1303. })(jQuery);
  1304. // import '@/assets/images/leftnav.js';
  1305. $(function () {
  1306. var Accordion = function (el, multiple) {
  1307. this.el = el || {};
  1308. this.multiple = multiple || false;
  1309. // Variables privadas
  1310. var links = this.el.find('.link');
  1311. // Evento
  1312. links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
  1313. };
  1314. Accordion.prototype.dropdown = function (e) {
  1315. var $el = e.data.el;
  1316. let $this = $(this);
  1317. let $next = $this.next();
  1318. $next.slideToggle();
  1319. $this.parent().toggleClass('open');
  1320. if (!e.data.multiple) {
  1321. $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
  1322. }
  1323. };
  1324. var accordion = new Accordion($('#accordion'), false);
  1325. $('.submenu li').click(function () {
  1326. $(this).addClass('current').siblings('li').removeClass('current');
  1327. });
  1328. });
  1329. //切换单屏电视墙
  1330. $(function () {
  1331. $(this.$el).find('.facility_tab .div_tab a').TL_Tab({
  1332. tab: ".facility_tab .div_tab a",
  1333. box: ".facility_tab .tab_cont",
  1334. events: "click",
  1335. num: 1,
  1336. speed: 10
  1337. });
  1338. });
  1339. </script>
  1340. <style>
  1341. /* 添加你的CSS样式 */
  1342. </style>