From 49f1db40efa2a03c0eada89abdfb9e9bd779f64c Mon Sep 17 00:00:00 2001 From: yupan <yupanx@163.com> Date: Mon, 07 Nov 2022 16:05:09 +0800 Subject: [PATCH] 易晨曦提交1、监测因子趋势页面修改时间控件 2、监测因子对比修改echarts显示 --- src/views/car/index.vue | 1054 ++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 687 insertions(+), 367 deletions(-) diff --git a/src/views/car/index.vue b/src/views/car/index.vue index 849a1f4..9c5198a 100644 --- a/src/views/car/index.vue +++ b/src/views/car/index.vue @@ -1,36 +1,60 @@ <template> <div class="main_body"> - <el-container - style="height: 100%" - > + <el-container style="height: 100%"> <el-aside v-if="this.$store.state.aside" width="300px" - style="background-color: rgb(238, 241, 246);padding-top:10px" + style="background-color: rgb(238, 241, 246); padding-top: 10px" > - <span style="font-size:13px;padding-left:10px;font-weight:500;color:rgb(64, 158, 255)">���������������</span> - <el-menu style="margin-top:10px"> + <span + style=" + font-size: 13px; + padding-left: 10px; + font-weight: 500; + color: rgb(64, 158, 255); + " + >���������������</span + > + <el-menu style="margin-top: 10px"> <el-menu-item - v-for="(item,index) in defaultData" + v-for="(item, index) in defaultData" :key="index" - style="display: flex;justify-content: space-between;align-items: center;padding-right: 0;border-bottom:1px solid #eee" - :index="(index+1 + '-' + index + 1).toString()" + style=" + display: flex; + justify-content: space-between; + align-items: center; + padding-right: 0; + border-bottom: 1px solid #eee; + " + :index="(index + 1 + '-' + index + 1).toString()" @click="changeCarData(item)" > <span>{{ item.name }}</span> <i - style="vertical-align: -2.5px;font-size: 20px;margin-right:10px;margin-left:auto" - class="iconfont iconfaxianzuobiao" - @click="deviceDetail(item.mac,null,item,0)" + style=" + vertical-align: -2.5px; + font-size: 20px; + margin-right: 10px; + margin-left: auto; + " + class="iconfont iconfaxianzuobiao" + @click="deviceDetail(item.mac, null, item, 0)" /> -<!-- @click="deviceDetail('p5dnd7a0245390',null,item,0)"--> + <!-- @click="deviceDetail('p5dnd7a0245390',null,item,0)"--> </el-menu-item> </el-menu> </el-aside> + <el-dialog> </el-dialog> <el-container style="position: relative"> <div class="carTop"> - <span style="float:left;margin: 1px 10px 0 0;"> - <el-button size="medium" type="primary" icon="el-icon-setting" @click="dialogFormVisible = true">6���������</el-button> + <span style="float: left; margin: 1px 10px 0 0"> + <el-button + size="medium" + type="primary" + icon="el-icon-setting" + @click="dialogFormVisible = true" + >6���������</el-button + > </span> <span v-for="(item, index) in snesorParams" @@ -38,54 +62,76 @@ class="left" :class="{ click: changeColor == index }" @click="changeCode(index)" - >{{ item }} + >{{ item }} </span> <span - v-for="(item,index) in viewOptions" - :key="index+ '-only'" + v-for="(item, index) in viewOptions" + :key="index + '-only'" class="right" :class="{ click: changeColor1 == index }" @click="changeCode1(index)" - >{{ item }} + >{{ item }} </span> - <span v-if="webSocketView" style="float:right;margin: 2px 10px 0 0;"> - <el-button size="medium" type="primary" @click="wsStart()">������������</el-button> + <span v-if="webSocketView" style="float: right; margin: 2px 10px 0 0"> + <el-button size="medium" type="primary" @click="wsStart()" + >������������</el-button + > </span> -<!-- <el-date-picker - v-if="historyView" - v-model="dateValue" - value-format="yyyy-MM-dd" - style="float:right;margin-right: 10px;line-height: 40px;" - align="right" - type="date" - placeholder="������������" - :picker-options="pickerOptions" - @change="dateChange" - />--> + <!-- <el-date-picker + v-if="historyView" + v-model="dateValue" + value-format="yyyy-MM-dd" + style="float:right;margin-right: 10px;line-height: 40px;" + align="right" + type="date" + placeholder="������������" + :picker-options="pickerOptions" + @change="dateChange" + />--> <!-- ��������������� --> - <el-time-picker - :disabled="isDisTime" - style="float:right;width: 210px" - is-range - v-model="timeValue" - @blur="blurChange" - range-separator="���" - start-placeholder="������������" - end-placeholder="������������" - placeholder="������������������"> - </el-time-picker> + <!-- <el-time-picker--> + <!-- :disabled="isDisTime"--> + <!-- style="float:right;width: 210px"--> + <!-- is-range--> + <!-- v-model="timeValue"--> + <!-- @blur="blurChange"--> + <!-- range-separator="���"--> + <!-- start-placeholder="������������"--> + <!-- end-placeholder="������������"--> + <!-- placeholder="������������������">--> + <!-- </el-time-picker>--> <!-- ��������������������������� --> - <el-select v-if="historyView" v-model="dateValue" placeholder="������������" style="float:right;line-height:40px;margin-right:10px;width:140px" @change="dateChange"> - <el-option - v-for="item in isDataList" - :key="item.value" - :label="item.label" - :value="item.value" - @click.native="dataChangeClick" - /> - </el-select> + <!-- <el-select v-if="historyView" v-model="dateValue" placeholder="������������" style="float:right;line-height:40px;margin-right:10px;width:140px" @change="dateChange">--> + <!-- <el-option--> + <!-- v-for="item in isDataList"--> + <!-- :key="item.value"--> + <!-- :label="item.label"--> + <!-- :value="item.value"--> + <!-- @click.native="dataChangeClick"--> + <!-- />--> + <!-- </el-select>--> + <el-date-picker + style="float: right; margin-right: 10px" + @change="dateChange" + v-model="dateValue" + type="datetimerange" + :picker-options="threeOptions" + range-separator="���" + start-placeholder="������������" + end-placeholder="������������" + > + </el-date-picker> <!-- ������/��������������������� --> - <el-select v-model="dataTypeValue" placeholder="������������" style="float:right;line-height:40px;margin-right:10px;width:103px"> + <el-select + v-model="dataTypeValue" + placeholder="������������" + style=" + float: right; + line-height: 40px; + margin-right: 10px; + width: 103px; + " + > <el-option v-for="item in dataTypeList" :key="item.value" @@ -95,7 +141,8 @@ </el-select> </div> <div v-if="noneData" class="noneData">������������������������������</div> - <div id="map_container" v-loading="loading" /> <!-- ������������ --> + <div id="map_container" v-loading="loading" /> + <!-- ������������ --> </el-container> </el-container> <!-- <div id="selectSenor"> @@ -112,7 +159,12 @@ <!-- 6��������������� --> <el-dialog title="6���������" :visible.sync="dialogFormVisible" width="1000px"> <el-descriptions title="������6���" :column="3" border> - <el-descriptions-item label="PM2.5 | ug/m��" label-class-name="my-label" content-class-name="my-content">22</el-descriptions-item> + <el-descriptions-item + label="PM2.5 | ug/m��" + label-class-name="my-label" + content-class-name="my-content" + >22</el-descriptions-item + > <el-descriptions-item label="PM10 | ug/m��">34</el-descriptions-item> <el-descriptions-item label="SO2 | ug/m��">4</el-descriptions-item> <el-descriptions-item label="NO2 | ug/m��">16</el-descriptions-item> @@ -122,18 +174,20 @@ <!-- <el-descriptions title="���������������" border> </el-descriptions> --> <div - style="font-size: 16px;font-weight: 700;margin:10px 0 20px 0;font-size: 16px; - font-weight: 700;color: #303133;" - >���������������</div> + style=" + font-size: 16px; + font-weight: 700; + margin: 10px 0 20px 0; + font-size: 16px; + font-weight: 700; + color: #303133; + " + > + ��������������� + </div> <el-table :data="sensorTableData" border> - <el-table-column - prop="sensorName" - label="������" - /> - <el-table-column - prop="unit" - label="������" - /> + <el-table-column prop="sensorName" label="������" /> + <el-table-column prop="unit" label="������" /> <el-table-column label="������"> <template slot-scope="scope"> <el-input v-model="scope.row.tab1" placeholder="���������������" /> @@ -176,99 +230,123 @@ <script> import $ from 'jquery' import '@/assets/icon/iconfont.css' +import requestObj from '@/utils/request' var GPS = { PI: 3.14159265358979324, - x_pi: 3.14159265358979324 * 3000.0 / 180.0, - delta: function(lat, lon) { + x_pi: (3.14159265358979324 * 3000.0) / 180.0, + delta: function (lat, lon) { var a = 6378245.0 // a: ������������������������������������������������������������������ var ee = 0.00669342162296594323 // ee: ��������������������� var dLat = this.transformLat(lon - 105.0, lat - 35.0) var dLon = this.transformLon(lon - 105.0, lat - 35.0) - var radLat = lat / 180.0 * this.PI + var radLat = (lat / 180.0) * this.PI var magic = Math.sin(radLat) magic = 1 - ee * magic * magic var sqrtMagic = Math.sqrt(magic) - dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * this.PI) - dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * this.PI) - return { 'lat': dLat, 'lon': dLon } + dLat = (dLat * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * this.PI) + dLon = (dLon * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * this.PI) + return { lat: dLat, lon: dLon } }, // WGS-84 to GCJ-02 - gcj_encrypt: function(wgsLat, wgsLon) { - if (this.outOfChina(wgsLat, wgsLon)) { return { 'lat': wgsLat, 'lon': wgsLon } } + gcj_encrypt: function (wgsLat, wgsLon) { + if (this.outOfChina(wgsLat, wgsLon)) { + return { lat: wgsLat, lon: wgsLon } + } var d = this.delta(wgsLat, wgsLon) - return { 'lat': wgsLat + d.lat, 'lon': wgsLon + d.lon } + return { lat: wgsLat + d.lat, lon: wgsLon + d.lon } }, // GCJ-02 to WGS-84 - gcj_decrypt: function(gcjLat, gcjLon) { - if (this.outOfChina(gcjLat, gcjLon)) { return { 'lat': gcjLat, 'lon': gcjLon } } + gcj_decrypt: function (gcjLat, gcjLon) { + if (this.outOfChina(gcjLat, gcjLon)) { + return { lat: gcjLat, lon: gcjLon } + } var d = this.delta(gcjLat, gcjLon) - return { 'lat': gcjLat - d.lat, 'lon': gcjLon - d.lon } + return { lat: gcjLat - d.lat, lon: gcjLon - d.lon } }, // GCJ-02 to WGS-84 exactly - gcj_decrypt_exact: function(gcjLat, gcjLon) { + gcj_decrypt_exact: function (gcjLat, gcjLon) { var initDelta = 0.01 var threshold = 0.000000001 - var dLat = initDelta; var dLon = initDelta - var mLat = gcjLat - dLat; var mLon = gcjLon - dLon - var pLat = gcjLat + dLat; var pLon = gcjLon + dLon - var wgsLat; var wgsLon; var i = 0 + var dLat = initDelta + var dLon = initDelta + var mLat = gcjLat - dLat + var mLon = gcjLon - dLon + var pLat = gcjLat + dLat + var pLon = gcjLon + dLon + var wgsLat + var wgsLon + var i = 0 while (1) { wgsLat = (mLat + pLat) / 2 wgsLon = (mLon + pLon) / 2 var tmp = this.gcj_encrypt(wgsLat, wgsLon) dLat = tmp.lat - gcjLat dLon = tmp.lon - gcjLon - if ((Math.abs(dLat) < threshold) && (Math.abs(dLon) < threshold)) { break } + if (Math.abs(dLat) < threshold && Math.abs(dLon) < threshold) { + break + } - if (dLat > 0) pLat = wgsLat; else mLat = wgsLat - if (dLon > 0) pLon = wgsLon; else mLon = wgsLon + if (dLat > 0) pLat = wgsLat + else mLat = wgsLat + if (dLon > 0) pLon = wgsLon + else mLon = wgsLon if (++i > 10000) break } - return { 'lat': wgsLat, 'lon': wgsLon } + return { lat: wgsLat, lon: wgsLon } }, // GCJ-02 to BD-09 - bd_encrypt: function(gcjLat, gcjLon) { - var x = gcjLon; var y = gcjLat + bd_encrypt: function (gcjLat, gcjLon) { + var x = gcjLon + var y = gcjLat var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.x_pi) var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.x_pi) this.bdLon = z * Math.cos(theta) + 0.0065 this.bdLat = z * Math.sin(theta) + 0.006 - return { 'lat': this.bdLat, 'lon': this.bdLon } + return { lat: this.bdLat, lon: this.bdLon } }, // BD-09 to GCJ-02 - bd_decrypt: function(bdLat, bdLon) { - var x = bdLon - 0.0065; var y = bdLat - 0.006 + bd_decrypt: function (bdLat, bdLon) { + var x = bdLon - 0.0065 + var y = bdLat - 0.006 var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * this.x_pi) var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * this.x_pi) var gcjLon = z * Math.cos(theta) var gcjLat = z * Math.sin(theta) - return { 'lat': gcjLat, 'lon': gcjLon } + return { lat: gcjLat, lon: gcjLon } }, // WGS-84 to Web mercator // mercatorLat -> y mercatorLon -> x - mercator_encrypt: function(wgsLat, wgsLon) { - var x = wgsLon * 20037508.34 / 180.0 - var y = Math.log(Math.tan((90.0 + wgsLat) * this.PI / 360.0)) / (this.PI / 180.0) - y = y * 20037508.34 / 180.0 - return { 'lat': y, 'lon': x } + mercator_encrypt: function (wgsLat, wgsLon) { + var x = (wgsLon * 20037508.34) / 180.0 + var y = + Math.log(Math.tan(((90.0 + wgsLat) * this.PI) / 360.0)) / + (this.PI / 180.0) + y = (y * 20037508.34) / 180.0 + return { lat: y, lon: x } }, // Web mercator to WGS-84 // mercatorLat -> y mercatorLon -> x - mercator_decrypt: function(mercatorLat, mercatorLon) { - var x = mercatorLon / 20037508.34 * 180.0 - var y = mercatorLat / 20037508.34 * 180.0 - y = 180 / this.PI * (2 * Math.atan(Math.exp(y * this.PI / 180.0)) - this.PI / 2) - return { 'lat': y, 'lon': x } + mercator_decrypt: function (mercatorLat, mercatorLon) { + var x = (mercatorLon / 20037508.34) * 180.0 + var y = (mercatorLat / 20037508.34) * 180.0 + y = + (180 / this.PI) * + (2 * Math.atan(Math.exp((y * this.PI) / 180.0)) - this.PI / 2) + return { lat: y, lon: x } }, // two point's distance - distance: function(latA, lonA, latB, lonB) { + distance: function (latA, lonA, latB, lonB) { var earthR = 6371000.0 - var x = Math.cos(latA * this.PI / 180.0) * Math.cos(latB * this.PI / 180.0) * Math.cos((lonA - lonB) * this.PI / 180) - var y = Math.sin(latA * this.PI / 180.0) * Math.sin(latB * this.PI / 180.0) + var x = + Math.cos((latA * this.PI) / 180.0) * + Math.cos((latB * this.PI) / 180.0) * + Math.cos(((lonA - lonB) * this.PI) / 180) + var y = + Math.sin((latA * this.PI) / 180.0) * Math.sin((latB * this.PI) / 180.0) var s = x + y if (s > 1) s = 1 if (s < -1) s = -1 @@ -276,25 +354,63 @@ var distance = alpha * earthR return distance }, - outOfChina: function(lat, lon) { - if (lon < 72.004 || lon > 137.8347) { return true } - if (lat < 0.8293 || lat > 55.8271) { return true } + outOfChina: function (lat, lon) { + if (lon < 72.004 || lon > 137.8347) { + return true + } + if (lat < 0.8293 || lat > 55.8271) { + return true + } return false }, - transformLat: function(x, y) { - var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)) - ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0 - ret += (20.0 * Math.sin(y * this.PI) + 40.0 * Math.sin(y / 3.0 * this.PI)) * 2.0 / 3.0 - ret += (160.0 * Math.sin(y / 12.0 * this.PI) + 320 * Math.sin(y * this.PI / 30.0)) * 2.0 / 3.0 + transformLat: function (x, y) { + var ret = + -100.0 + + 2.0 * x + + 3.0 * y + + 0.2 * y * y + + 0.1 * x * y + + 0.2 * Math.sqrt(Math.abs(x)) + ret += + ((20.0 * Math.sin(6.0 * x * this.PI) + + 20.0 * Math.sin(2.0 * x * this.PI)) * + 2.0) / + 3.0 + ret += + ((20.0 * Math.sin(y * this.PI) + 40.0 * Math.sin((y / 3.0) * this.PI)) * + 2.0) / + 3.0 + ret += + ((160.0 * Math.sin((y / 12.0) * this.PI) + + 320 * Math.sin((y * this.PI) / 30.0)) * + 2.0) / + 3.0 return ret }, - transformLon: function(x, y) { - var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)) - ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0 - ret += (20.0 * Math.sin(x * this.PI) + 40.0 * Math.sin(x / 3.0 * this.PI)) * 2.0 / 3.0 - ret += (150.0 * Math.sin(x / 12.0 * this.PI) + 300.0 * Math.sin(x / 30.0 * this.PI)) * 2.0 / 3.0 + transformLon: function (x, y) { + var ret = + 300.0 + + x + + 2.0 * y + + 0.1 * x * x + + 0.1 * x * y + + 0.1 * Math.sqrt(Math.abs(x)) + ret += + ((20.0 * Math.sin(6.0 * x * this.PI) + + 20.0 * Math.sin(2.0 * x * this.PI)) * + 2.0) / + 3.0 + ret += + ((20.0 * Math.sin(x * this.PI) + 40.0 * Math.sin((x / 3.0) * this.PI)) * + 2.0) / + 3.0 + ret += + ((150.0 * Math.sin((x / 12.0) * this.PI) + + 300.0 * Math.sin((x / 30.0) * this.PI)) * + 2.0) / + 3.0 return ret - } + }, } export default { data() { @@ -310,7 +426,7 @@ 'CO', 'O3', 'TVOC', - '���������' + '���������', ], changeColor: 0, changeColor1: 0, @@ -319,35 +435,59 @@ dataType: 'history', responseJSON: null, radio1: null, - viewOptions: [ - '������', - '������' - ], - dateValue: null, + viewOptions: ['������', '������'], + dateValue: [], pickerOptions: { disabledDate(time) { return time.getTime() > Date.now() }, - shortcuts: [{ - text: '������', - onClick(picker) { - picker.$emit('pick', new Date()) + shortcuts: [ + { + text: '������', + onClick(picker) { + picker.$emit('pick', new Date()) + }, + }, + { + text: '������', + onClick(picker) { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24) + picker.$emit('pick', date) + }, + }, + { + text: '���������', + onClick(picker) { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', date) + }, + }, + ], + }, + timeOne: '', + threeOptions: { + onPick: ({ maxDate, minDate }) => { + // ������������ ������������ + this.timeOne = minDate.getTime() // ��������������������� ������������������ + // ������������������������������������������������������������ + if (maxDate) this.timeOne = '' + }, + disabledDate: (time) => { + if (this.timeOne) { + const WEEK = 3 * 24 * 3600 * 1000 - 1 // ������������3���������1��������� ������3��������� + const minTime = this.timeOne // ������������ + const maxTime = this.timeOne + WEEK // ������������ + return ( + time.getTime() < minTime || + time.getTime() > maxTime || + time.getTime() > new Date() + ) + } else { + return time.getTime() > new Date() } - }, { - text: '������', - onClick(picker) { - const date = new Date() - date.setTime(date.getTime() - 3600 * 1000 * 24) - picker.$emit('pick', date) - } - }, { - text: '���������', - onClick(picker) { - const date = new Date() - date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) - picker.$emit('pick', date) - } - }] + }, }, sensorDate: null, noneData: false, @@ -355,14 +495,86 @@ carMac: null, dialogFormVisible: false, sensorTableData: [ - { sensorName: 'PM2.5', unit: 'ug/m��', tab1: '35', tab2: '75', tab3: '115', tab4: '150', tab5: '250', tab6: '350' }, - { sensorName: 'PM10', unit: 'ug/m��', tab1: '50', tab2: '150', tab3: '250', tab4: '350', tab5: '420', tab6: '500' }, - { sensorName: 'SO2', unit: 'ug/m��', tab1: '50', tab2: '150', tab3: '475', tab4: '800', tab5: '1600', tab6: '2100' }, - { sensorName: 'NO2', unit: 'ug/m��', tab1: '40', tab2: '80', tab3: '180', tab4: '280', tab5: '565', tab6: '750' }, - { sensorName: 'CO', unit: 'mg/m��', tab1: '2', tab2: '4', tab3: '14', tab4: '24', tab5: '36', tab6: '48' }, - { sensorName: 'O3', unit: 'ug/m��', tab1: '100', tab2: '160', tab3: '215', tab4: '265', tab5: '800', tab6: '800' }, - { sensorName: 'TVOC', unit: 'mg/m��', tab1: '0.1', tab2: '0.3', tab3: '0.5', tab4: '0.7', tab5: '0.9', tab6: '1' }, - { sensorName: '���������', unit: 'ug/m��', tab1: '300', tab2: '500', tab3: '1000', tab4: '10000', tab5: '20000', tab6: '50000' } + { + sensorName: 'PM2.5', + unit: 'ug/m��', + tab1: '35', + tab2: '75', + tab3: '115', + tab4: '150', + tab5: '250', + tab6: '350', + }, + { + sensorName: 'PM10', + unit: 'ug/m��', + tab1: '50', + tab2: '150', + tab3: '250', + tab4: '350', + tab5: '420', + tab6: '500', + }, + { + sensorName: 'SO2', + unit: 'ug/m��', + tab1: '50', + tab2: '150', + tab3: '475', + tab4: '800', + tab5: '1600', + tab6: '2100', + }, + { + sensorName: 'NO2', + unit: 'ug/m��', + tab1: '40', + tab2: '80', + tab3: '180', + tab4: '280', + tab5: '565', + tab6: '750', + }, + { + sensorName: 'CO', + unit: 'mg/m��', + tab1: '2', + tab2: '4', + tab3: '14', + tab4: '24', + tab5: '36', + tab6: '48', + }, + { + sensorName: 'O3', + unit: 'ug/m��', + tab1: '100', + tab2: '160', + tab3: '215', + tab4: '265', + tab5: '800', + tab6: '800', + }, + { + sensorName: 'TVOC', + unit: 'mg/m��', + tab1: '0.1', + tab2: '0.3', + tab3: '0.5', + tab4: '0.7', + tab5: '0.9', + tab6: '1', + }, + { + sensorName: '���������', + unit: 'ug/m��', + tab1: '300', + tab2: '500', + tab3: '1000', + tab4: '10000', + tab5: '20000', + tab6: '50000', + }, ], carWs: null, map: null, @@ -379,13 +591,16 @@ firstPlayFlag: true, firstWsFlag: true, msgTemp: [], - dataTypeList: [{ - value: 'history', - label: '������������' - }, { - value: 'webSocket', - label: '������������' - }], + dataTypeList: [ + { + value: 'history', + label: '������������', + }, + { + value: 'webSocket', + label: '������������', + }, + ], dataTypeValue: 'history', historyView: true, webSocketView: false, @@ -398,24 +613,34 @@ endTime: '', dataDate: '', sensorTime: [], - timeValue: [new Date(2020, 1, 1, 0, 0, 0), new Date(2022, 12, 31, 23, 59, 59)] + timeValue: [ + new Date(2020, 1, 1, 0, 0, 0), + new Date(2022, 12, 31, 23, 59, 59), + ], } }, watch: { dataTypeValue(n, o) { if (this.dataTypeValue === 'webSocket') { - this.dateValue = null + this.dateValue = [] this.historyView = false this.webSocketView = true } else { - this.dateValue = null + this.dateValue = [] this.historyView = true this.webSocketView = false } }, + dateValue(n, o) { + if (n === null) { + this.dateValue = [] + } + }, viewKey(n, o) { // console.log(n) - } + }, + deep: true, + immediate: true, // timeValue: { // handler(newVal, oldVal) { // this.sensorTime = this.newTime() @@ -445,17 +670,36 @@ } // }) }, - beforeDestroy() { - }, + beforeDestroy() {}, created() { this.newTime(this.timeValue) this.newDate() this.getCarData() - this.$watch('carMac', () => { - this.getMacDate() - }) + // this.$watch('carMac', () => { + // this.getMacDate() + // }) }, methods: { + // ������������������ + newTime2(timeArr) { + var arr = [] + timeArr.map((v) => { + var date = new Date(v) + var y = date.getFullYear() + var m = date.getMonth() + 1 + m = m < 10 ? '0' + m : m + var d = date.getDate() + d = d < 10 ? '0' + d : d + var h = date.getHours() + h = h < 10 ? '0' + h : h + var minute = date.getMinutes() + minute = minute < 10 ? '0' + minute : minute + var s = date.getSeconds() + s = s < 10 ? '0' + s : s + arr.push(y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s) + }) + return arr + }, // ��������������������� deviceDetail(mac, item, items, indexs) { // console.log('������������������������') @@ -472,7 +716,7 @@ device: items, macName: mac, indexs: indexs, - items: [items.latitude, items.longitude] + items: [items.latitude, items.longitude], }, query: { monitorPointInfo: JSON.stringify(item), @@ -480,8 +724,8 @@ macName: mac, indexs: indexs, items: [items.latitude, items.longitude], - equipment: 'car' - } + equipment: 'car', + }, }) }, // 6��������������� @@ -498,13 +742,13 @@ getCarData() { this.$request({ url: '/cruiser/selectCruisers', - method: 'get' + method: 'get', }) - .then(res => { + .then((res) => { this.defaultData = res.data this.carMac = res.data[0].mac }) - .catch(err => { + .catch((err) => { console.log(err) }) }, @@ -515,27 +759,27 @@ url: '/cruiser/getDates', method: 'get', params: { - mac: this.carMac - } + mac: this.carMac, + }, }) - .then(res => { + .then((res) => { for (let i = 0; i < res.data.length; i++) { // this.isDataList[i].value = res.data.data[i] // this.isDataList[i].label = res.data.data[i] // this.isDataList[i] = { value: res.data.data[i], label: res.data.data[i] } this.isDataList.push({ value: res.data[i], - label: res.data[i] + label: res.data[i], }) } }) - .catch(err => { + .catch((err) => { console.log(err) }) }, // ��������������������������������������� Rad(d) { - return d * Math.PI / 180.0// ��������������������������������������������������� + return (d * Math.PI) / 180.0 // ��������������������������������������������������� }, // ��������������������������������������������������������������������������������������� GetDistance(lat1, lng1, lat2, lng2) { @@ -543,8 +787,16 @@ var radLat2 = this.Rad(lat2) var a = radLat1 - radLat2 var b = this.Rad(lng1) - this.Rad(lng2) - var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + - Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))) + var s = + 2 * + Math.asin( + Math.sqrt( + Math.pow(Math.sin(a / 2), 2) + + Math.cos(radLat1) * + Math.cos(radLat2) * + Math.pow(Math.sin(b / 2), 2) + ) + ) s = s * 6378.137 // EARTH_RADIUS; s = Math.round(s * 10000) / 10000 // ��������������� // s=s.toFixed(4); @@ -553,7 +805,10 @@ // ��������������� newDate() { var aData = new Date() - var month = aData.getMonth() < 9 ? '0' + (aData.getMonth() + 1) : aData.getMonth() + 1 + var month = + aData.getMonth() < 9 + ? '0' + (aData.getMonth() + 1) + : aData.getMonth() + 1 var date = aData.getDate() <= 9 ? '0' + aData.getDate() : aData.getDate() this.sensorDate = aData.getFullYear() + '-' + month + '-' + date }, @@ -562,31 +817,23 @@ let str = '' let str2 = '' this.sensorTime = [] - timeArr.map(v => { + timeArr.map((v) => { v = JSON.stringify(v) str2 = v.substr(12, 8).split(':') - str2[0] = (str2[0] - 0 + 8) % 24 < 9 ? '0' + (str2[0] - 0 + 8) % 24 : (str2[0] - 0 + 8) % 24 + str2[0] = + (str2[0] - 0 + 8) % 24 < 9 + ? '0' + ((str2[0] - 0 + 8) % 24) + : (str2[0] - 0 + 8) % 24 str = str2.join(':') this.sensorTime.push(str) }) }, // ������������ dateChange(e) { - this.sensorDate = e; - // if (this.view) { - // this.view.removeAllLayers() - // this.map.clearOverlays() - // // console.log('������������') - // } - // this.dataType = 'history' - // // this.map = null - // this.getStart() - }, - // ������������������������ - dataChangeClick(e) { - if (!this.isDisTime) { - // ������������������ - this.newTime(this.timeValue) + if (e === null) { + this.sensorDate = [] + } else { + this.sensorDate = this.newTime2(e) if (this.view) { this.view.removeAllLayers() this.map.clearOverlays() @@ -596,8 +843,25 @@ // this.map = null this.getStart() } - this.isDisTime = false }, + // ������������������������ + // dataChangeClick(e) { + // if (!this.isDisTime) { + // // ������������������ + // if (this.dateValue.length <= 1) { + // this.newTime(this.timeValue) + // } + // if (this.view) { + // this.view.removeAllLayers() + // this.map.clearOverlays() + // // console.log('������������') + // } + // this.dataType = 'history' + // // this.map = null + // this.getStart() + // } + // this.isDisTime = false + // }, // ������������������������ blurChange() { // ������������������ @@ -625,15 +889,16 @@ } that.dataType = 'webSocket' // ������URL + // const baseUrl = `${requestObj.baseUrl}` var socketUrl = 'cruiserWebsocket/' + this.carMac // ������http���WS socketUrl = socketUrl.replace('https', 'ws').replace('http', 'ws') this.ws = new WebSocket(socketUrl) - this.ws.onopen = function() { + this.ws.onopen = function () { console.log('wsStart������������') } // ��������������������������������������������������� - this.ws.onmessage = function(msg) { + this.ws.onmessage = function (msg) { if (that.firstWsFlag) { that.initStart([JSON.parse(msg.data)]) that.firstWsFlag = false @@ -642,8 +907,13 @@ var lon = parseFloat(JSON.parse(msg.data).flylon) if (that.msgTemp.length < 2) { that.msgTemp.push({ lat: lat, lon: lon }) - } - var distance = that.GetDistance(that.msgTemp[0].lat, that.msgTemp[0].lon, that.msgTemp[1].lat, that.msgTemp[1].lon) + } + var distance = that.GetDistance( + that.msgTemp[0].lat, + that.msgTemp[0].lon, + that.msgTemp[1].lat, + that.msgTemp[1].lon + ) if (distance >= 0.05) { that.msgTemp.shift() that.msgTemp.push({ lat: lat, lon: lon }) @@ -652,7 +922,6 @@ that.msgTemp.pop() } } - }, // ��������������������� getStart() { @@ -664,18 +933,16 @@ this.view.removeAllLayers() this.map.clearOverlays() } - var time1 = this.sensorDate + ' ' + this.sensorTime[0] - var time2 = this.sensorDate + ' ' + this.sensorTime[1] + this.$request({ url: '/cruiser/cruiserTrajectory', method: 'get', params: { mac: this.carMac, - time1, - time2 - } - }).then(res => { - console.log(res); + time1: this.sensorDate[0], + time2: this.sensorDate[1], + }, + }).then((res) => { if (!res.data.length) { this.noneData = true this.loading = false @@ -705,13 +972,16 @@ this.loading = false if (this.responseJSON.length > 0) { this.noneData = false - console.log(that.carMac, 'mac') $.each(this.responseJSON, (item, value) => { - if (typeof (value.flylon) === 'undefined') { + if (typeof value.flylon === 'undefined') { showNoPoints() } else { - var lng = parseFloat(value.flylon.substr(0, value.flylon.length - 1)) - var lat = parseFloat(value.flylat.substr(0, value.flylat.length - 1)) + var lng = parseFloat( + value.flylon.substr(0, value.flylon.length - 1) + ) + var lat = parseFloat( + value.flylat.substr(0, value.flylat.length - 1) + ) if (lng < 70 || lng > 150 || lat > 60 || lat < 20) { return true } @@ -719,7 +989,7 @@ lat = GPS.gcj_encrypt(lat, lng).lat lng = GPS.bd_encrypt(lat, lng).lon lat = GPS.bd_encrypt(lat, lng).lat - var point = new BMapGL.Point(lng, lat); + var point = new BMapGL.Point(lng, lat) point.a34004 = parseInt(value.a34004) point.a34002 = parseInt(value.a34002) point.a21026 = parseInt(value.a21026) @@ -727,7 +997,12 @@ point.a21005 = parseFloat(value.a21005).toFixed(3) point.a05024 = parseInt(value.a05024) point.a99054 = parseFloat(value.a99054).toFixed(3) - if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && that.carMac === 'p5dnd7a0243622') { + if ( + value.dustld - 0 !== 0 && + value.dustld - 0 < 100 && + (that.carMac === 'p5dnd7a0243622' || + that.carMac === 'p5dnd7a0243625') + ) { point.dustld = 100 } else { point.dustld = value.dustld - 0 @@ -739,7 +1014,7 @@ that.sensor = this.sensorKey that.viewType = this.viewKey that.size = 50 - that.distance = that.size / 2 / Math.sin(1 * Math.PI / 4) + that.distance = that.size / 2 / Math.sin((1 * Math.PI) / 4) // ��������������������������������� if (!that.showPoints) { that.map = new BMapGL.Map('map_container') @@ -751,12 +1026,13 @@ } else { that.map.setTilt(52) } - that.map.setDisplayOptions({ // ������������������ + that.map.setDisplayOptions({ + // ������������������ skyColors: ['rgba(186, 0, 255, 0)', 'rgba(186, 0, 255, 0.2)'], // ������������ building: false, // ������������������ - poiText: true// ������poi������ + poiText: true, // ������poi������ }) - that.map.addControl(new BMapGL.NavigationControl3D())// ������3d������ + that.map.addControl(new BMapGL.NavigationControl3D()) // ������3d������ if (this.responseJSON.length === 0) { showNoPoints() } @@ -765,9 +1041,9 @@ that.mapZoom = that.viewport.zoom that.centerPoint = that.viewport.center if (that.firstPlayFlag) { - that.map.centerAndZoom(that.centerPoint, that.mapZoom) + that.map.centerAndZoom(that.centerPoint, that.mapZoom) that.view = new mapvgl.View({ - map: that.map + map: that.map, }) that.firstPlayFlag = false } else { @@ -779,21 +1055,24 @@ // drawPolygon(sensor);//��������� draw(that.sensor, that.viewType, that.carMac) // drawLine()// ������ - drawStartAndEnd()// ��������������������� + drawStartAndEnd() // ��������������������� function draw(sensor, type, carMac) { var levels = getGrading(sensor, type, carMac) - $.each(levels, function(index, value) { + $.each(levels, function (index, value) { var color = value.color - var data = value.data + var data = value.data if (data.length > 0) { // ������MapVGL���������������,������������������mapvgl that.shapeLayer = new mapvgl.ShapeLayer({ color: color, // ��������������� enablePicked: true, // ������������������ selectedIndex: -1, // ��������� - selectedColor: '#ee1111', // ��������������� + selectedColor: '#ee1111', // ��������������� autoSelect: true, // ������������������������������������������ - riseTime: 1800 // ��������������������������� + riseTime: 1800, // ��������������������������� + onClick: (e) => { + console.log(e) + }, }) that.shapeLayer.setData(data) that.view.addLayer(that.shapeLayer) @@ -801,7 +1080,7 @@ }) that.map.setDefaultCursor('default') if (type === '2D') { - $.each(that.showPoints, function(item, point) { + $.each(that.showPoints, function (item, point) { setLabelStyle(point[sensor], point) }) } @@ -809,18 +1088,21 @@ // ��������������������������������� function drawPolygon(sensor) { - $.each(that.showPoints, function(item, point) { + $.each(that.showPoints, function (item, point) { var sw = getPoint(225, point.lng, point.lat, that.distance) var ne = getPoint(45, point.lng, point.lat, that.distance) var data = point[sensor] - // ������������������������������������ + // ������������������������������������ color = getColorAndLevel(sensor, data).color - var polygon = new BMapGL.Polygon([ - new BMapGL.Point(sw.lng, sw.lat), // ��������� - new BMapGL.Point(ne.lng, sw.lat), // ��������� - new BMapGL.Point(ne.lng, ne.lat), // ��������� - new BMapGL.Point(sw.lng, ne.lat)// ��������� - ], { strokeWeight: 0.5, strokeOpacity: 0.0, fillColor: color }) + var polygon = new BMapGL.Polygon( + [ + new BMapGL.Point(sw.lng, sw.lat), // ��������� + new BMapGL.Point(ne.lng, sw.lat), // ��������� + new BMapGL.Point(ne.lng, ne.lat), // ��������� + new BMapGL.Point(sw.lng, ne.lat), // ��������� + ], + { strokeWeight: 0.5, strokeOpacity: 0.0, fillColor: color } + ) that.map.addOverlay(polygon) // ���������������label������ setLabelStyle(data, point) @@ -829,14 +1111,26 @@ // ��������������������� function drawStartAndEnd() { - var startIcon = new BMapGL.Icon(require('@/assets/images/start.png'), new BMapGL.Size(48, 48)) - var startMark = new BMapGL.Marker(that.showPoints[0], { icon: startIcon, offset: new BMapGL.Size(0, -20) }) - that.map.addOverlay(startMark) - var endIcon = new BMapGL.Icon(require('@/assets/images/end.png'), new BMapGL.Size(48, 48)) - var endMark = new BMapGL.Marker(that.showPoints[that.showPoints.length - 1], { - icon: endIcon, - offset: new BMapGL.Size(0, -20) + var startIcon = new BMapGL.Icon( + require('@/assets/images/start.png'), + new BMapGL.Size(48, 48) + ) + var startMark = new BMapGL.Marker(that.showPoints[0], { + icon: startIcon, + offset: new BMapGL.Size(0, -20), }) + that.map.addOverlay(startMark) + var endIcon = new BMapGL.Icon( + require('@/assets/images/end.png'), + new BMapGL.Size(48, 48) + ) + var endMark = new BMapGL.Marker( + that.showPoints[that.showPoints.length - 1], + { + icon: endIcon, + offset: new BMapGL.Size(0, -20), + } + ) that.map.addOverlay(endMark) } @@ -844,24 +1138,24 @@ function drawLine() { var data = [] var points = [] - $.each(trackPoints, function(index, value) { + $.each(trackPoints, function (index, value) { var point = [] - point.push(value['lng'],value['lat']) + point.push(value['lng'], value['lat']) points.push(point) }) data.push({ geometry: { type: '"LineString"', - coordinates: [points] - } + coordinates: [points], + }, }) var lineLayer = new mapvgl.LineLayer({ color: 'red', - width: 3, + width: 3, animation: true, duration: 10, // ������������2s trailLength: 0.1, // ������������������������0.4 - interval: 0.3 // ���������������������������������0.2 + interval: 0.3, // ���������������������������������0.2 }) that.view.addLayer(lineLayer) lineLayer.setData(data) @@ -885,6 +1179,7 @@ points.push(point1) } } + return points } @@ -894,14 +1189,23 @@ // ��������������������������������������� var ra = distance / EARTH_RADIUS // ���������radian��������������������������� - angle = angle / 180 * Math.PI - lng = lng / 180 * Math.PI - lat = lat / 180 * Math.PI - lng = lng + Math.atan2(Math.sin(angle) * Math.sin(ra) * Math.cos(lat), Math.cos(ra) - Math.sin(lat) * Math.sin(lat)) - lat = Math.asin(Math.sin(lat) * Math.cos(ra) + Math.cos(lat) * Math.sin(ra) * Math.cos(angle)) + angle = (angle / 180) * Math.PI + lng = (lng / 180) * Math.PI + lat = (lat / 180) * Math.PI + lng = + lng + + Math.atan2( + Math.sin(angle) * Math.sin(ra) * Math.cos(lat), + Math.cos(ra) - Math.sin(lat) * Math.sin(lat) + ) + lat = Math.asin( + Math.sin(lat) * Math.cos(ra) + + Math.cos(lat) * Math.sin(ra) * Math.cos(angle) + ) // ���������������10��������������� - lng = lng * 180 / Math.PI - lat = lat * 180 / Math.PI + lng = (lng * 180) / Math.PI + lat = (lat * 180) / Math.PI + console.log(lng, lat) return new BMapGL.Point(lng, lat) } @@ -931,7 +1235,7 @@ level5.color = '#99004c' level6.color = '#7e0023' - $.each(that.showPoints, function(index, value) { + $.each(that.showPoints, function (index, value) { var sw = getPoint(225, value.lng, value.lat, that.distance) var ne = getPoint(45, value.lng, value.lat, that.distance) var polygon = [] @@ -968,77 +1272,77 @@ data0.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 1: data1.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 2: data2.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 3: data3.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 4: data4.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 5: data5.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break case 6: data6.push({ geometry: { type: 'Polygon', - coordinates: [polygon] + coordinates: [polygon], }, properties: { - height: height - } + height: height, + }, }) break } @@ -1235,13 +1539,14 @@ // point���������label������ function setLabelStyle(content, point) { - var label = new BMapGL.Label("<span class='my-maptip'>" + content + '<br /><span>', // ���lable������������ + + var label = new BMapGL.Label( + "<span class='my-maptip'>" + content + '<br /><span>', // ���lable������������ { offset: new BMapGL.Size(-8, -10), // label������������������������label������������������������ - position: point + position: point, } - )// label��������� - + ) // label��������� var offsetSize = new BMapGL.Size(0, 0) var size = '10px' if (that.map.getZoom() <= 15.5) { @@ -1254,8 +1559,8 @@ lineHeight: '20px', fontFamily: '������������', backgroundColor: '0.05', - fontWeight: 'bold' - } + fontWeight: 'bold', + } label.setStyle(labelStyle) that.map.addOverlay(label) } @@ -1263,18 +1568,20 @@ // ������������,������������������ function showNoPoints() { that.map.centerAndZoom('���������', 17) - setTimeout(function() { + setTimeout(function () { document.getElementById('cpm').style.display = 'block' document.getElementById('data').style.display = 'none' }, 250) } // ������������������������ - that.map.addEventListener('zoomend', function() { + that.map.addEventListener('zoomend', function () { // ��������������������������������������� var zoom = that.map.getZoom() $('span.my-maptip').parent()[zoom <= 15.5 ? 'hide' : 'show']() - $('span.my-maptip').parent().css('font-size', 30 - zoom) + $('span.my-maptip') + .parent() + .css('font-size', 30 - zoom) }) // var that = this @@ -1311,28 +1618,36 @@ this.changeColor = index // var pr = '' switch (index) { - case 0: this.sensorKey = 'a34004' + case 0: + this.sensorKey = 'a34004' // this.bg = require('@/assets/images/tl_PM10.png') break - case 1: this.sensorKey = 'a34002' + case 1: + this.sensorKey = 'a34002' // this.bg = require('@/assets/images/tl_PM2.5.png') break - case 2: this.sensorKey = 'a21026' + case 2: + this.sensorKey = 'a21026' // this.bg = require('@/assets/images/tl_SO2.png') break - case 3: this.sensorKey = 'a21004' + case 3: + this.sensorKey = 'a21004' // this.bg = require('@/assets/images/tl_NO2.png') break - case 4: this.sensorKey = 'a21005' + case 4: + this.sensorKey = 'a21005' // this.bg = require('@/assets/images/tl_CO.png') break - case 5: this.sensorKey = 'a05024' + case 5: + this.sensorKey = 'a05024' // this.bg = require('@/assets/images/tl_O3.png') break - case 6: this.sensorKey = 'a99054' + case 6: + this.sensorKey = 'a99054' // this.bg = require('@/assets/images/tl_TVOCNew.png') break - case 7: this.sensorKey = 'dustld' + case 7: + this.sensorKey = 'dustld' // this.bg = require('@/assets/images/tl_TVOCNew.png') break } @@ -1346,104 +1661,104 @@ this.viewKey = '3D' } this.getStart() - } - } + }, + }, } </script> <style lang="less" scoped> body, html, #map_container { - width: 100%; - height: 100%; - overflow: hidden; - margin: 0; - z-index: 0; - font-size: 14px; - font-family: "������������"; + width: 100%; + height: 100%; + overflow: hidden; + margin: 0; + z-index: 0; + font-size: 14px; + font-family: '������������'; } .main_body { - border: 0; - margin: 0; - width: 100%; - height: 100%; - position: relative; + border: 0; + margin: 0; + width: 100%; + height: 100%; + position: relative; } #cpm { - width: 300px; - height: 100px; - position: absolute; - background-color: #ffffff; - display: none; - left: 50%; - top: 50%; - margin-left: -150px; - margin-top: -50px; - z-index: 11; - color: #000000; - border: 2px solid #FF7F50; - font-size: 28px; - line-height: 100px; - text-align: center; + width: 300px; + height: 100px; + position: absolute; + background-color: #ffffff; + display: none; + left: 50%; + top: 50%; + margin-left: -150px; + margin-top: -50px; + z-index: 11; + color: #000000; + border: 2px solid #ff7f50; + font-size: 28px; + line-height: 100px; + text-align: center; } .BMap_pop > img { - top: 42px !important; - margin-left: -10px; + top: 42px !important; + margin-left: -10px; } .BMap_pop div:nth-child(1) div { - display: none; + display: none; } .BMap_pop div:nth-child(3) { - display: none; + display: none; } .BMap_pop div:nth-child(5) { - display: none; + display: none; } .BMap_pop div:nth-child(7) { - display: none; + display: none; } .BMap_pop div:nth-child(9) { - top: 35px !important; - border-radius: 5px; + top: 35px !important; + border-radius: 5px; } #selectSenor { - position: absolute; - z-index: 1; - left: 30px; - top: 20px; - font-size: 20px; - background: lightgrey; + position: absolute; + z-index: 1; + left: 30px; + top: 20px; + font-size: 20px; + background: lightgrey; } #type { - position: absolute; - z-index: 1; - left: 30px; - top: 50px; - font-size: 20px; - background: lightgrey; + position: absolute; + z-index: 1; + left: 30px; + top: 50px; + font-size: 20px; + background: lightgrey; } button { - font-size: 15px; + font-size: 15px; } .sensorLevel { - position: absolute; - z-index: 1; - bottom: 50px; - left: 10px; - width: 100px; - height: 200px; + position: absolute; + z-index: 1; + bottom: 50px; + left: 10px; + width: 100px; + height: 200px; } .carTop { position: absolute; @@ -1454,7 +1769,8 @@ background: rgba(204, 204, 204, 0.5); box-shadow: 1px 1px 5px #666; } -.carTop > .left,.right { +.carTop > .left, +.right { padding: 5px 10px; border: 1px solid #aaa; border-right: none; @@ -1465,26 +1781,29 @@ margin-top: 4px; -webkit-transform-origin-x: 0; } -.carTop .left:nth-child(1),.carTop .right:nth-child(1) { +.carTop .left:nth-child(1), +.carTop .right:nth-child(1) { border-radius: 5px 0 0 5px; } -.carTop .left:nth-last-child(2),.carTop .right:nth-child(2) { +.carTop .left:nth-last-child(2), +.carTop .right:nth-child(2) { border-radius: 0 5px 5px 0; border-right: 1px solid #aaa; } -.carTop{ - &>.left:nth-child(1){ - border-radius: 5px 0 0 5px; - } +.carTop { + & > .left:nth-child(1) { + border-radius: 5px 0 0 5px; + } } .carTop { - .left{ - &:nth-last-child(2){ + .left { + &:nth-last-child(2) { margin-left: -12px !important; } } } -.carTop > .left:hover,.right:hover { +.carTop > .left:hover, +.right:hover { background: rgb(64, 158, 255); color: #fff; } @@ -1507,10 +1826,11 @@ font-size: 28px; border: 2px solid #ff7f50; } -.main_body .el-date-editor .el-range-input{ +.main_body .el-date-editor .el-range-input { width: 30%; } -.main_body /deep/ .el-date-editor .el-range-separator{ +.main_body /deep/ .el-date-editor .el-range-separator { width: 15%; } </style> + \ No newline at end of file -- Gitblit v1.8.0