12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475 |
- <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 facility_tab2">
- <div class="qkq_tdzy">
- <div class="qkq_tit ">应急场所</div>
- <div class="scrollbar" style="height: 300px;">
- <ul id="accordion" class="accordion yjcs">
- <!-- li上加on类名是点击选中后效果 -->
- <li v-for="(item, index) in shelter" :class="{ on: item.id == shelterCurrent }" :key="index"
- @click="onShelterlick(item)">
- <div class="link">{{ item.name }} - {{ item.address }}</div>
- </li>
- </ul>
- </div>
- </div>
- <div class="qkq_tdzy">
- <div class="qkq_tit">城市内涝点</div>
- <div class="scrollbar" style="height: 300px;">
- <ul id="accordion" class="accordion csnld">
- <li class="on">
- <div class="link">易涝隐患区域加快整治。</div>
- </li>
- <li>
- <div class="link">行洪排涝能力不断提升。</div>
- </li>
- <li>
- <div class="link">设施运维管理持续完善。</div>
- </li>
- <li>
- <div class="link">海绵城市建设稳步推进。</div>
- </li>
- </ul>
- </div>
- </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="facility_tab facility_tab2">
- <div class="qkq_tdzy">
- <div class="qkq_tit ">抢险救援队</div>
- <div class="scrollbar" style="height: 300px;">
- <ul id="accordion" class="accordion nlsb">
- <!-- li上加on类名是点击选中后效果 -->
- <li v-for="(item, index) in team" :class="{ on: item.id == teamCurrent }" :key="index"
- @click="onTeamlick(item)">
- <div class="link">{{ item.dept }}</div>
- </li>
- </ul>
- </div>
- </div>
- <div class="qkq_tdzy">
- <div class="qkq_tit">防汛物资</div>
- <div class="scrollbar" style="height: 300px;">
- <ul id="accordion" class="accordion yjcssb">
- <li v-for="(item, index) in supplies" :class="{ on: item.id == suppliesCurrent }" :key="index"
- @click="onSuppliesclick(item)">
- <div class="link">{{ item.dept }}</div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <!--右侧结束-->
- <!-- 多选按钮 开始 -->
- <form class="qkq_dx">
- <label><input checked type="checkbox" name="ckbx" id="sxt" @click="handleClick"/>摄像头</label>
- <label><input type="checkbox" name="ckbx" id="yjcs" @click="handleClick"/>应急场所</label>
- <label><input type="checkbox" name="ckbx" id="nld" @click="handleClick"/>城市内涝点</label>
- <label><input type="checkbox" name="ckbx" id="jyd" @click="handleClick"/>抢险救援队</label>
- <label><input type="checkbox" name="ckbx" id="fxwz" @click="handleClick"/>防汛物资</label>
- </form>
- <!-- 多选按钮 结束 -->
- <!-- 点位图例 开始
- <div class="dwtl">
- <p><span class="xqnb"></span>街道路面(在线50个/离线10个)</p>
- <p><span class="jdlm"></span>小区内部(在线50个/离线10个)</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" @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 on" @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 {
- selectQkEmergencyRescueTeamAllList,
- selectQkEmergencyShelterAllList,
- selectQkRescueSuppliesAllList,
- } from "@/api/system/aqyj";
- import supermap from "@/views/supermap/supermap";
- export default {
- name: "aqyj",
- components: {
- supermap
- },
- data() {
- return {
- dropdownVisible: false,
- cameras: [],
- team: [],
- shelter: [],
- supplies: [],
- sltProps: null,
- teamCurrent: null,
- shelterCurrent: null,
- suppliesCurrent: null,
- currentTime: '',
- btnOne: true,
- btnTwo: false,
- yjcsChecked: false,
- };
- // 可根据实际情况添加更多设备列表
- },
- created() {
- },
- mounted() {
- this.selectQkEmergencyRescueTeamAllList();
- this.selectQkEmergencyShelterAllList();
- this.selectQkRescueSuppliesAllList();
- this.resourceDistribution();
- this.deviceOnline();
- this.deviceOffline();
- this.cameraList();
- this.regionTop();
- // 每秒刷新时间
- setInterval(() => {
- this.getCurrentTime();
- }, 1000);
- },
- methods: {
- handleClick() {
- this.$refs.supermap.clearM()
- let that = this;
- $('input[name="ckbx"]:checked').each(function () {
- switch ($(this).attr("id")) {
- case "sxt":
- that.loada();
- break;
- case "yjcs":
- that.loadb();
- break;
- case "jyd":
- that.loadc();
- break;
- case "fxwz":
- that.loadd();
- }
- });
- },
- loada() {
- this.$refs.supermap.selectCameraList();
- },
- loadb() {
- this.$refs.supermap.selectQkEmergencyShelterAllList();
- },
- loadc() {
- this.$refs.supermap.selectQkEmergencyRescueTeamAllList();
- },
- loadd() {
- this.$refs.supermap.selectQkRescueSuppliesAllList();
- },
- onTeamlick(val) {
- let dataSource = [];
- this.suppliesCurrent = null;
- this.shelterCurrent = null;
- if (val.id == this.teamCurrent) {
- this.teamCurrent = null;
- } else {
- this.teamCurrent = val.id;
- }
- dataSource.push(val)
- // var checkbox = document.getElementById("jyd");
- // checkbox.setAttribute("checked", "");
- this.$refs.supermap.addMarkers(dataSource, "jyd")
- this.$refs.supermap.dropLocation(val.latitude, val.longitude);
- },
- onSuppliesclick(val) {
- let dataSource = [];
- this.teamCurrent = null;
- this.shelterCurrent = null;
- if (val.id == this.suppliesCurrent) {
- this.suppliesCurrent = null;
- } else {
- this.suppliesCurrent = val.id;
- }
- dataSource.push(val)
- // var checkbox = document.getElementById("fxwz");
- // checkbox.setAttribute("checked", "");
- this.$refs.supermap.addMarkers(dataSource, "fxwz")
- this.$refs.supermap.dropLocation(val.latitude, val.longitude);
- },
- onShelterlick(val) {
- let dataSource = [];
- this.teamCurrent = null;
- this.suppliesCurrent = null;
- if (val.id == this.shelterCurrent) {
- this.shelterCurrent = null;
- } else {
- this.shelterCurrent = val.id;
- }
- dataSource.push(val)
- // var checkbox = document.getElementById("yjcs");
- // checkbox.setAttribute("checked", "");
- this.$refs.supermap.addMarkers(dataSource, "yjcs")
- this.$refs.supermap.dropLocation(val.latitude, val.longitude);
- },
- //可视化查询抢险救援队列表
- selectQkEmergencyRescueTeamAllList() {
- selectQkEmergencyRescueTeamAllList().then(response => {
- this.team = response.data;
- })
- }
- ,
- //可视化查询应急避难所列表
- selectQkEmergencyShelterAllList() {
- selectQkEmergencyShelterAllList().then(response => {
- this.shelter = response.data;
- })
- }
- ,
- //可视化查询防汛抗旱物资储备列表
- selectQkRescueSuppliesAllList() {
- selectQkRescueSuppliesAllList().then(response => {
- this.supplies = response.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.5, //控制拖尾长度
- symbolSize: [20, 2],
- symbol: this.$store.state.common.echarts_baseStreamer,
- 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() {
- //在线设备
- var myChart = echarts.init(document.getElementById('sprh-zxfb'));
- let angle = 0; //角度,用来做简单的动画效果的
- let value = 80;
- 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() {
- // 视频融合--离线设备
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('sprh-lxfb'));
- let angle = 0; //角度,用来做简单的动画效果的
- let value = 20;
- 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() {
- //摄像头统计
- var myChart = echarts.init(document.getElementById('jczl-bmfw'));
- let data = ['小区内部', '街道路面']
- let valueData = [];
- let labelData = []
- for (var i = 0; i < data.length; i++) {
- labelData.push(data[i]);
- var lineNumber = Math.floor(Math.random() * 1000);
- valueData.push(lineNumber);
- }
- var option = {
- "backgroundColor": "rgba(0, 0, 0, 0)",
- title: {
- show: true,
- text: '',
- textStyle: {
- color: '#fff',
- fontSize: '14',
- },
- top: '0%',
- left: 'bottom',
- bottm: '-10%'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- }
- },
- grid: {
- top: '10%',
- left: '15%',
- right: '5%',
- buttom: '-10',
- },
- 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: 3.5,// 周期 速度 2.5
- trailLength: 0.5, //控制拖尾长度
- symbolSize: 25, // ⭐⭐星星大小
- symbol:
- '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',
- 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>
|