123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365 |
- <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">
- <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>1</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">1234<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">234<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">704<i>个</i></h2>
- </div>
- <div class="sb_in">
- <span class="lxsb">街道路面</span>
- <h2 class="lxsb_sl">230<i>个</i></h2>
- </div>
- </div>
- </div>
- </div>
- <!--右侧结束-->
- <!-- 点位图例 开始 -->
- <div class="dwtl">
- <p><span class="xqnb"></span>街道路面(<i class="zx"></i>50个/<i class="lx"></i>10个)</p>
- <p><span class="jdlm"></span>小区内部(<i class="zx"></i>50个/<i class="lx"></i>10个)</p>
- </div>
- <!-- 点位图例 结束 -->
- <!--底部开始-->
- <div class="footer">
- <div class="nav-bottom">
- <div class="nav-bottom-left">
- <div class="nav-li-left">
- <span>经济运行</span>
- </div>
- <div class="nav-li-left">
- <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">
- <span>营商环境</span>
- </div>
- <div class="nav-li-right" @click="handleNavigation('yshj')">
- <span>政务运行</span>
- </div>
- <div class="nav-li-right on" @click="handleNavigation('sprh')">
- <span>安全应急</span>
- </div>
- <div class="nav-li-right">
- <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";
- export default {
- name: "sprh",
- components: {
- supermap
- },
- data() {
- return {
- dropdownVisible: false,
- cameras: [],
- sltProps: null,
- currentTime: '',
- btnOne: true,
- btnTwo: false
- };
- // 可根据实际情况添加更多设备列表
- },
- created() {
- },
- mounted() {
- this.resourceDistribution();
- this.deviceOnline();
- this.deviceOffline();
- this.cameraList();
- this.regionTop();
- // 每秒刷新时间
- setInterval(() => {
- this.getCurrentTime();
- }, 1000);
- },
- methods: {
- 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>
|