12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385 |
- <template>
- <div style="background-color: #32435A">
- <div class="map">
- <supermap ref="supermap" style="height: 100%;width: 100%;position: absolute;z-index: 0;"
- :yxtSltProps="sltProps"></supermap>
- </div>
- <!-- 阴影背景 -->
- <div class="bj_left"><img src="@/assets/images/sprhbj-left.png"/></div>
- <div class="bj_right"><img src="@/assets/images/sprhbj-right.png"/></div>
- <div class="bj_bottom"><img src="@/assets/images/sprhbj-bottom.png"/></div>
- <!--头部开始-->
- <div class="header">
- <h1>城市运行一网统管指挥中心</h1>
- <div class="map_tab">
- <button @click="sltHandle" :class="{ 'on': btnOne }">矢量图</button>
- <button @click="yxtHandle" :class="{ 'on': btnTwo }">影像图</button>
- </div>
- </div>
- <!--头部结束-->
- <!--左侧开始-->
- <div class="left_con sprh-left">
- <div class="top_txt">
- <b>汽开区</b>
- <!-- <span>小雨</span>-->
- <!-- <span>9~16℃</span>-->
- </div>
- <!-- 设备tab开始-->
- <div class="facility_tab">
- <div class="div_tab">
- <a class="on">单屏</a>
- <a>电视墙</a>
- </div>
- <div class="clear"></div>
- <form class="qkq_ss">
- <input type="text" placeholder="请输入搜索词" class="inp_ss"/>
- <input type="button" class="inp_btn" value="搜索"/>
- </form>
- <div class="tab_cont">
- <div class="qkq_tdzy">
- <div class="qkq_tit ">设备列表</div>
- <div class="selectDate">
- <span class="_selectData">锦程街道</span>
- <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
- <div class="_moreMenu" v-if="dropdownVisible">
- <ul>
- <li class="change">东风街道</li>
- <li>锦程街道</li>
- </ul>
- </div>
- </div>
- </div>
- <div class="scrollbar" style="height: 510px;">
- <ul id="accordion" class="accordion">
- <!-- lx_on 离线 zx_on在线 -->
- <li v-for="(camera, index) in cameras" :key="index" :class="{ 'zx_on': camera.cameraStatus == 1, 'lx_on': camera.cameraStatus == 2 }">
- <div class="link">{{ camera.cameraName }}</div>
- </li>
- </ul>
- </div>
- </div>
- <div class="tab_cont"></div>
- </div>
- <!-- 设备tab结束-->
- </div>
- <!--左侧结束-->
- <!--右侧开始-->
- <div class="right_con sprh-left">
- <div class="top_txt">
- <span>{{ currentTime }}</span>
- <!-- <span>星期六</span>-->
- <!-- <b>11:16:58</b>-->
- </div>
- <!-- 资源分布-->
- <div class="qkq_tdzy">
- <div class="qkq_tit ">资源分布</div>
- <div class="selectDate">
- <span class="_selectData">锦程街道</span>
- <a class="icon_more" @click="toggleDropdown($event)"><img src="@/assets/images/down.png"/></a>
- <div class="_moreMenu" v-if="dropdownVisible">
- <ul>
- <li class="change">东风街道</li>
- <li>锦程街道</li>
- </ul>
- </div>
- </div>
- </div>
- <div id="sprh-zyfb" style="margin:-5px auto 10px auto; width: 350px; height:150px;"></div>
- <!-- 资源分布-->
- <div class="qkq_tdzy">
- <div class="qkq_tit" style="margin-top: -35px">设备实时在线情况</div>
- </div>
- <div class="sbzs">
- <p>设备总数:</p>
- <span>{{cameraOnlineSituation.total}}个</span>
- <!-- <span>6</span>-->
- <!-- <span>4</span>-->
- <!-- <span>0</span>-->
- <!-- <p>个</p>-->
- </div>
- <div class="sb_cont">
- <div class="sb_in">
- <div id="sprh-zxfb" style="width:130px; height:140px;margin: 0 auto;"></div>
- <span class="zxsb">在线设备</span>
- <h2 class="zxsb_sl">{{cameraOnlineSituation.onLine}}<i>个</i></h2>
- </div>
- <div class="sb_in">
- <div id="sprh-lxfb" style="width:130px; height:140px;margin: 0 auto;"></div>
- <span class="lxsb">离线设备</span>
- <h2 class="lxsb_sl">{{cameraOnlineSituation.offLine}}<i>个</i></h2>
- </div>
- </div>
- <div class="qkq_bmfw">
- <div class="qkq_tit ">摄像头统计</div>
- <div id="jczl-bmfw" style="margin: 20px auto 0px auto; width: 350px; height: 160px"></div>
- <div class="sb_cont sb_cont_sxt">
- <div class="sb_in">
- <span class="lxsb">小区内部</span>
- <h2 class="zxsb_sl">{{ cameraStatisticsData.inside }}<i>个</i></h2>
- </div>
- <div class="sb_in">
- <span class="lxsb">街道路面</span>
- <h2 class="lxsb_sl">{{ cameraStatisticsData.pavement }}<i>个</i></h2>
- </div>
- </div>
- </div>
- </div>
- <!--右侧结束-->
- <!-- 点位图例 开始 -->
- <div class="dwtl">
- <p><span class="xqnb"></span>街道路面(<i class="zx"></i>{{ this.cameraOnlineSituationType.pavementOnLine }}个/<i class="lx"></i>{{ this.cameraOnlineSituationType.pavementOffLine }}个)</p>
- <p><span class="jdlm"></span>小区内部(<i class="zx"></i>{{ this.cameraOnlineSituationType.insideOnLine }}个/<i class="lx"></i>{{ this.cameraOnlineSituationType.insideOffLine }}个)</p>
- </div>
- <!-- 点位图例 结束 -->
- <!--底部开始-->
- <div class="footer">
- <div class="nav-bottom">
- <div class="nav-bottom-left">
- <div class="nav-li-left" @click="handleNavigation('jjyx')">
- <span>经济运行</span>
- </div>
- <div class="nav-li-left" @click="handleNavigation('csgl')">
- <span>城市管理</span>
- </div>
- <div class="nav-li-left on" @click="handleNavigation('jtzl')">
- <span>交通治理</span>
- </div>
- <div class="nav-li-left" @click="handleNavigation('jczl')">
- <span>基层治理</span>
- </div>
- </div>
- <div class="nav-home-middle" @click="homePage('weather')">
- <img src="@/assets/images/home-btn.png"/>
- <a>返回首页</a>
- </div>
- <div class="nav-bottom-right">
- <div class="nav-li-right" @click="handleNavigation('yshj_new')">
- <span>营商环境</span>
- </div>
- <div class="nav-li-right" @click="handleNavigation('bjzshz')">
- <span>政务运行</span>
- </div>
- <div class="nav-li-right" @click="handleNavigation('aqyj')">
- <span>安全应急</span>
- </div>
- <div class="nav-li-right" @click="handleNavigation('fwyq')">
- <span>服务一汽</span>
- </div>
- </div>
- </div>
- </div>
- <!--底部开始-->
- </div>
- </template>
- <script>
- import * as echarts from 'echarts'
- import $ from 'jquery'
- import jQuery from 'jquery'
- import "@/assets/images/qkq_body.css";
- import "@/assets/images/qkq_index.css";
- import "@/assets/images/qkq_sprh.css";
- import {getCameraList} from "@/api/system/camera";
- import supermap from "@/views/supermap/supermap";
- import {
- getCameraOnlineSituationList,
- getCameraStatisticsByTypeList,
- getCameraStatisticsList
- } from "@/api/jtzl/statistics";
- export default {
- name: "jtzl",
- components: {
- supermap
- },
- data() {
- return {
- dropdownVisible: false,
- cameras: [],
- sltProps: null,
- currentTime: '',
- btnOne: true,
- btnTwo: false,
- cameraStatisticsData:{},
- cameraOnlineSituation:{},
- cameraOnlineSituationType:{},
- // 查询参数
- queryParams: {},
- };
- // 可根据实际情况添加更多设备列表
- },
- created() {
- this.getCameraOnlineSituationList()
- this.getCameraStatisticsList()
- this.getCameraStatisticsByTypeList()
- },
- mounted() {
- this.resourceDistribution();
- // this.deviceOnline();
- // this.deviceOffline();
- this.cameraList();
- // this.regionTop();
- // 每秒刷新时间
- setInterval(() => {
- this.getCurrentTime();
- }, 1000);
- },
- methods: {
- getCameraOnlineSituationList(){
- getCameraOnlineSituationList(this.queryParams).then(res => {
- this.cameraOnlineSituation = res.data;
- this.deviceOnline(this.cameraOnlineSituation.onLineRate)
- this.deviceOffline(this.cameraOnlineSituation.offLineRate)
- });
- },
- getCameraStatisticsList(){
- getCameraStatisticsList(this.queryParams).then(res => {
- this.cameraStatisticsData = res.data;
- this.regionTop(res.data.list)
- });
- },
- getCameraStatisticsByTypeList(){
- getCameraStatisticsByTypeList(this.queryParams).then(res => {
- this.cameraOnlineSituationType = res.data;
- });
- },
- sltHandle() {
- this.btnOne = true
- this.btnTwo = false
- this.$refs.supermap.getSupermap(null, null, null, "slt", null, null)
- },
- yxtHandle() {
- this.btnTwo = true
- this.btnOne = false
- this.$refs.supermap.getSupermap(null, null, null, "yxt", null, null)
- },
- handleNavigation(route) {
- this.$router.push({path: route});
- },
- homePage(route) {
- this.$router.push({path: route});
- },
- cameraList() {
- getCameraList().then(response => {
- this.cameras = response.data;
- })
- },
- toggleDropdown(event) {
- this.dropdownVisible = !this.dropdownVisible;
- },
- resourceDistribution() {
- //资源分布
- var myChart = echarts.init(document.getElementById('sprh-zyfb'));
- var salvProName = ['前程街道', '富民街道', '广兴街道', '东风街道', '锦绣街道', '锦程街道'];
- var salvProValue = [239, 181, 154, 144, 135, 117, 124];
- var salvProMax = [];//背景按最大值
- for (let i = 0; i < salvProValue.length; i++) {
- salvProMax.push(salvProValue[0])
- }
- let option = {
- grid: {
- top: 0,
- left: 33,
- right: 20,
- bottom: 0,
- containLabel: true
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'none'
- },
- formatter: function (params) {
- return params[0].name + ' : ' + params[0].value
- }
- },
- xAxis: {
- show: false,
- type: 'value'
- },
- yAxis: [{
- type: 'category',
- inverse: true,
- axisLabel: {
- show: true,
- textStyle: {
- color: '#fff'
- },
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLine: {
- show: false
- },
- data: salvProName
- }, {
- type: 'category',
- inverse: true,
- axisTick: 'none',
- axisLine: 'none',
- show: true,
- axisLabel: {
- textStyle: {
- color: '#ffffff',
- fontSize: '12'
- },
- },
- data: salvProValue.map((item) => {
- return item + "个";
- })
- }],
- series: [{
- name: '值',
- type: 'bar',
- zlevel: 1,
- itemStyle: {
- normal: {
- barBorderRadius: 30,
- color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
- offset: 0,
- color: '#0e3eaf'
- }, {
- offset: 1,
- color: '#00ffff'
- }]),
- },
- },
- barWidth: 20,
- data: salvProValue
- },
- {
- type: 'lines',
- coordinateSystem: 'cartesian2d',
- data: salvProValue.map((item, index) => {
- return {
- coords: [
- [0, index],
- [item - 4, index]
- ]
- };
- }),
- effect: {
- show: true,
- period: 2.5,
- trailLength: 0.4, //控制拖尾长度
- symbolSize: [20, 14],
- 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',
- loop: true,
- color: '#fff' //流光颜色
- },
- lineStyle: {
- width: 0,
- opacity: 0.6,
- // curveness: 0
- },
- zlevel: 10,
- },
- {
- name: '背景',
- type: 'bar',
- barWidth: 20,
- barGap: '-100%',
- data: salvProMax,
- itemStyle: {
- normal: {
- color: 'rgba(24,31,68,1)',
- barBorderRadius: 30,
- }
- },
- },
- ]
- };
- if (option) {
- myChart.setOption(option);
- }
- },
- deviceOnline(val) {
- //在线设备
- var myChart = echarts.init(document.getElementById('sprh-zxfb'));
- let angle = 0; //角度,用来做简单的动画效果的
- let value = val
- var timerId;
- let option = {
- title: {
- text: '{a|' + value + '}{c|%}',
- x: 'center',
- y: 'center',
- textStyle: {
- rich: {
- a: {
- fontSize: 24,
- color: '#29EEF3'
- },
- c: {
- fontSize: 16,
- color: '#ffffff',
- // padding: [5,0]
- }
- }
- }
- },
- series: [
- // 紫色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
- startAngle: (0 + angle) * Math.PI / 180,
- endAngle: (90 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#8383FA",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5", //紫点
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
- let point = getCirlPoint(x0, y0, r, (90 + angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#8450F9", //绿
- fill: "#8450F9"
- },
- silent: true
- };
- },
- data: [0]
- },
- // 蓝色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
- startAngle: (180 + angle) * Math.PI / 180,
- endAngle: (270 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#4386FA",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5", // 蓝色
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
- let point = getCirlPoint(x0, y0, r, (180 + angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#4386FA", //绿
- fill: "#4386FA"
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
- startAngle: (270 + -angle) * Math.PI / 180,
- endAngle: (40 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- // 橘色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
- startAngle: (90 + -angle) * Math.PI / 180,
- endAngle: (220 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#FF8E89",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
- let point = getCirlPoint(x0, y0, r, (90 + -angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#FF8E89", //粉
- fill: "#FF8E89"
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5", //绿点
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
- let point = getCirlPoint(x0, y0, r, (270 + -angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#0CD3DB", //绿
- fill: "#0CD3DB"
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: '设备在线率',
- type: 'pie',
- radius: ['72%', '55%'],
- silent: true,
- clockwise: true,
- startAngle: 90,
- z: 0,
- zlevel: 0,
- label: {
- normal: {
- position: "center",
- }
- },
- data: [{
- value: value,
- name: "",
- itemStyle: {
- normal: {
- color: { // 完成的圆环的颜色
- colorStops: [{
- offset: 0,
- color: '#A098FC' // 0% 处的颜色
- },
- {
- offset: 0.3,
- color: '#4386FA' // 0% 处的颜色
- },
- {
- offset: 0.6,
- color: '#4FADFD' // 0% 处的颜色
- },
- {
- offset: 0.8,
- color: '#0CD3DB' // 100% 处的颜色
- }, {
- offset: 1,
- color: '#646CF9' // 100% 处的颜色
- }
- ]
- },
- }
- }
- },
- {
- value: 100 - value,
- name: "",
- label: {
- normal: {
- show: false
- }
- },
- itemStyle: {
- normal: {
- color: "#173164"
- }
- }
- }
- ]
- },
- {
- name: '设备在线率',
- type: 'pie',
- radius: ['52%', '45%'],
- silent: true,
- clockwise: true,
- startAngle: 270,
- z: 0,
- zlevel: 0,
- label: {
- normal: {
- position: "center",
- }
- },
- data: [{
- value: value,
- name: "",
- itemStyle: {
- normal: {
- color: { // 完成的圆环的颜色
- colorStops: [{
- offset: 0,
- color: '#00EDF3' // 0% 处的颜色
- }, {
- offset: 1,
- color: '#646CF9' // 100% 处的颜色
- }]
- },
- }
- }
- },
- {
- value: 100 - value,
- name: "",
- label: {
- normal: {
- show: false
- }
- },
- itemStyle: {
- normal: {
- color: "#173164"
- }
- }
- }
- ]
- },
- ]
- };
- //获取圆上面某点的坐标(x0,y0表示坐标,r半径,angle角度)
- function getCirlPoint(x0, y0, r, angle) {
- let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
- let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
- return {
- x: x1,
- y: y1
- }
- }
- function draw() {
- angle = angle + 3
- myChart.setOption(option, true)
- //window.requestAnimationFrame(draw);
- }
- if (timerId) {
- clearInterval(timerId);
- }
- timerId = setInterval(function() {
- //用setInterval做动画感觉有问题
- draw()
- }, 100);
- myChart.setOption(option);
- },
- deviceOffline(val) {
- // 视频融合--离线设备
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('sprh-lxfb'));
- let angle = 0; //角度,用来做简单的动画效果的
- let value = val
- var timerId;
- let option = {
- title: {
- text: '{a|' + value + '}{c|%}',
- x: 'center',
- y: 'center',
- textStyle: {
- rich: {
- a: {
- fontSize: 24,
- color: '#29EEF3'
- },
- c: {
- fontSize: 16,
- color: '#ffffff',
- // padding: [5,0]
- }
- }
- }
- },
- series: [
- // 紫色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
- startAngle: (0 + angle) * Math.PI / 180,
- endAngle: (90 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#8383FA",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5", //紫点
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
- let point = getCirlPoint(x0, y0, r, (90 + angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#8450F9", //绿
- fill: "#8450F9"
- },
- silent: true
- };
- },
- data: [0]
- },
- // 蓝色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.42,
- startAngle: (180 + angle) * Math.PI / 180,
- endAngle: (270 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#4386FA",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5", // 蓝色
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.42;
- let point = getCirlPoint(x0, y0, r, (180 + angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#4386FA", //绿
- fill: "#4386FA"
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
- startAngle: (270 + -angle) * Math.PI / 180,
- endAngle: (40 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- // 橘色
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) * 0.47,
- startAngle: (90 + -angle) * Math.PI / 180,
- endAngle: (220 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#FF8E89",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
- let point = getCirlPoint(x0, y0, r, (90 + -angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#FF8E89", //粉
- fill: "#FF8E89"
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: "ring5", //绿点
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) * 0.47;
- let point = getCirlPoint(x0, y0, r, (270 + -angle))
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#0CD3DB", //绿
- fill: "#0CD3DB"
- },
- silent: true
- };
- },
- data: [0]
- }, {
- name: '设备离线率',
- type: 'pie',
- radius: ['72%', '55%'],
- silent: true,
- clockwise: true,
- startAngle: 90,
- z: 0,
- zlevel: 0,
- label: {
- normal: {
- position: "center",
- }
- },
- data: [{
- value: value,
- name: "",
- itemStyle: {
- normal: {
- color: { // 完成的圆环的颜色
- colorStops: [{
- offset: 0,
- color: '#A098FC' // 0% 处的颜色
- },
- {
- offset: 0.3,
- color: '#4386FA' // 0% 处的颜色
- },
- {
- offset: 0.6,
- color: '#4FADFD' // 0% 处的颜色
- },
- {
- offset: 0.8,
- color: '#0CD3DB' // 100% 处的颜色
- }, {
- offset: 1,
- color: '#646CF9' // 100% 处的颜色
- }
- ]
- },
- }
- }
- },
- {
- value: 100 - value,
- name: "",
- label: {
- normal: {
- show: false
- }
- },
- itemStyle: {
- normal: {
- color: "#173164"
- }
- }
- }
- ]
- },
- {
- name: '设备离线率',
- type: 'pie',
- radius: ['52%', '45%'],
- silent: true,
- clockwise: true,
- startAngle: 270,
- z: 0,
- zlevel: 0,
- label: {
- normal: {
- position: "center",
- }
- },
- data: [{
- value: value,
- name: "",
- itemStyle: {
- normal: {
- color: { // 完成的圆环的颜色
- colorStops: [{
- offset: 0,
- color: '#00EDF3' // 0% 处的颜色
- }, {
- offset: 1,
- color: '#646CF9' // 100% 处的颜色
- }]
- },
- }
- }
- },
- {
- value: 100 - value,
- name: "",
- label: {
- normal: {
- show: false
- }
- },
- itemStyle: {
- normal: {
- color: "#173164"
- }
- }
- }
- ]
- },
- ]
- };
- //获取圆上面某点的坐标(x0,y0表示坐标,r半径,angle角度)
- function getCirlPoint(x0, y0, r, angle) {
- let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
- let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
- return {
- x: x1,
- y: y1
- }
- }
- function draw() {
- angle = angle + 3
- myChart.setOption(option, true)
- //window.requestAnimationFrame(draw);
- }
- if (timerId) {
- clearInterval(timerId);
- }
- timerId = setInterval(function() {
- //用setInterval做动画感觉有问题
- draw()
- }, 100);
- myChart.setOption(option);
- },
- getCurrentTime() {
- const now = new Date();
- const year = now.getFullYear();
- const month = now.getMonth() + 1;
- const date = now.getDate();
- const day = now.getDay();
- const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
- const hour = now.getHours();
- const minute = now.getMinutes();
- const second = now.getSeconds();
- const formattedMonth = month < 10 ? `0${month}` : month;
- const formattedDate = date < 10 ? `0${date}` : date;
- const formattedHour = hour < 10 ? `0${hour}` : hour;
- const formattedMinute = minute < 10 ? `0${minute}` : minute;
- const formattedSecond = second < 10 ? `0${second}` : second;
- this.currentTime = `${year}年${formattedMonth}月${formattedDate}日 ${weekDays[day]} ${formattedHour}:${formattedMinute}:${formattedSecond}`;
- },
- regionTop(val) {
- //摄像头统计
- var myChart = echarts.init(document.getElementById('jczl-bmfw'));
- let valueData = val;
- let labelData = ['小区内部', '街道路面']
- var option = {
- "backgroundColor": "rgba(0, 0, 0, 0)",
- title: {
- show: true,
- text: '',
- textStyle: {
- color: '#fff',
- fontSize: '14',
- },
- top: '0%',
- left: 'bottom',
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- }
- },
- grid: {
- top: '10%',
- left: '15%',
- right: '5%',
- buttom: '0',
- },
- xAxis: [{
- type: 'category',
- data: labelData,
- axisTick: {
- show: false, //隐藏X轴刻度
- alignWithLabel: true
- },
- axisLabel: {
- margin: 10,
- color: '#e2e9ff',
- textStyle: {
- fontSize: 14
- },
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,0.12)',
- },
- },
- }],
- yAxis: {
- name: '',
- nameTextStyle: {
- color: '#fff',
- },
- type: 'value',
- axisLine: {
- show: false,
- lineStyle: {
- color: 'rgba(255,255,255,0.12)'
- },
- },
- axisLabel: {
- formatter: '{value}',
- color: '#e2e9ff',
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,0.12)'
- }
- },
- axisTick: {
- show: true,
- lineStyle: {
- color: '#fff',
- },
- },
- },
- // 切片
- series: [
- {
- type: 'lines',
- coordinateSystem: 'cartesian2d',
- data: valueData.map((item, index) => {
- return {
- coords: [
- [index, 0],
- [index, item - 4]
- ]
- };
- }),
- effect: {
- show: true,
- period: 2.5,
- trailLength: 0.4, //控制拖尾长度
- symbolSize: [20, 14],
- 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',
- loop: true,
- color: '#ffffff' //流光颜色
- },
- lineStyle: {
- width: 0,
- opacity: 0.6,
- curveness: 0
- },
- z: 999
- },
- {
- type: 'bar',
- data: valueData,
- barWidth: '20px',
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(0,244,255,1)' // 0% 处的颜色
- }, {
- offset: 1,
- color: 'rgba(0,77,167,1)' // 100% 处的颜色
- }], false),
- barBorderRadius: [30, 30, 30, 30],
- shadowColor: 'rgba(0,160,221,1)',
- shadowBlur: 4,
- }
- },
- }]
- };
- if (option) {
- myChart.setOption(option);
- }
- },
- }
- };
- // import '@/assets/images/TL_Tab.js';
- (function ($) {
- $.fn.TL_Tab = function (options) {
- var defaults = {
- tab: ".df_67 ol li",
- box: ".df_67 ul li",
- events: "over",
- num: 3,
- speed: 300
- };
- var setting = $.extend(defaults, options);
- var tl_tab = setting.tab;
- var tl_box = setting.box;
- var tl_events = setting.events;
- var tl_num = setting.num;
- var tl_speed = setting.speed;
- var tl_time_out = null;
- $(tl_box).css({
- display: 'none'
- });
- $(tl_tab).removeClass('df_on');
- $(tl_tab).eq(tl_num - 1).addClass('df_on');
- $(tl_box).eq(tl_num - 1).css({
- display: 'block'
- });
- if (tl_events === 'click') {
- $(tl_tab).click(function () {
- $(tl_tab).removeClass('df_on');
- $(tl_tab).eq($(this).index()).addClass('df_on');
- $(tl_box).stop().fadeOut(tl_speed);
- $(tl_box).eq($(this).index()).stop().fadeIn(tl_speed);
- });
- }
- if (tl_events === 'over') {
- $(tl_tab).hover(function () {
- var _this = this;
- clearTimeout(tl_num);
- tl_time_out = setTimeout(function () {
- $(tl_tab).removeClass('df_on');
- $(tl_tab).eq($(_this).index()).addClass('df_on');
- $(tl_box).stop().fadeOut(tl_speed);
- $(tl_box).eq($(_this).index()).stop().fadeIn(tl_speed);
- }, 30);
- }, function () {
- clearTimeout(tl_time_out);
- });
- }
- };
- })(jQuery);
- // import '@/assets/images/leftnav.js';
- $(function () {
- var Accordion = function (el, multiple) {
- this.el = el || {};
- this.multiple = multiple || false;
- // Variables privadas
- var links = this.el.find('.link');
- // Evento
- links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
- };
- Accordion.prototype.dropdown = function (e) {
- var $el = e.data.el;
- let $this = $(this);
- let $next = $this.next();
- $next.slideToggle();
- $this.parent().toggleClass('open');
- if (!e.data.multiple) {
- $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
- }
- };
- var accordion = new Accordion($('#accordion'), false);
- $('.submenu li').click(function () {
- $(this).addClass('current').siblings('li').removeClass('current');
- });
- });
- //切换单屏电视墙
- $(function () {
- $(this.$el).find('.facility_tab .div_tab a').TL_Tab({
- tab: ".facility_tab .div_tab a",
- box: ".facility_tab .tab_cont",
- events: "click",
- num: 1,
- speed: 10
- });
- });
- </script>
- <style>
- /* 添加你的CSS样式 */
- </style>
|