From 399abec46258d2c69dabb4e60c1efc26702d3719 Mon Sep 17 00:00:00 2001 From: guoshipeng <3194674006@qq.com> Date: Fri, 25 Aug 2023 10:04:46 +0800 Subject: [PATCH] fix:路段 --- src/util/request.ts | 7 src/route/other.router.ts | 27 ++ src/assets/97b970a4f3bd8c3cba44fa167e984e5.png | 0 src/assets/7e0c779a1e1899a97eb1e4e8fdba030.png | 0 src/views/list/road.vue | 545 +++++++++++++++++++++++++++++++++++++++++++++++++ src/route/router.ts | 1 src/assets/43ea4c2b53f61e02193622a7c08c7a1.png | 0 src/components/map/pickCoordinate1.vue | 5 src/views/passport/login/successLoginRoutee.ts | 10 src/route/devices.router.ts | 58 ++-- src/assets/fb259ce2e368f6853a58b91d6f6b293.png | 0 src/views/system/organization.vue | 2 src/assets/723cd95f31481a502d495b2d814d658.png | 0 13 files changed, 621 insertions(+), 34 deletions(-) diff --git a/src/assets/43ea4c2b53f61e02193622a7c08c7a1.png b/src/assets/43ea4c2b53f61e02193622a7c08c7a1.png new file mode 100644 index 0000000..104a426 --- /dev/null +++ b/src/assets/43ea4c2b53f61e02193622a7c08c7a1.png Binary files differ diff --git a/src/assets/723cd95f31481a502d495b2d814d658.png b/src/assets/723cd95f31481a502d495b2d814d658.png new file mode 100644 index 0000000..2140cc6 --- /dev/null +++ b/src/assets/723cd95f31481a502d495b2d814d658.png Binary files differ diff --git a/src/assets/7e0c779a1e1899a97eb1e4e8fdba030.png b/src/assets/7e0c779a1e1899a97eb1e4e8fdba030.png new file mode 100644 index 0000000..fe94177 --- /dev/null +++ b/src/assets/7e0c779a1e1899a97eb1e4e8fdba030.png Binary files differ diff --git a/src/assets/97b970a4f3bd8c3cba44fa167e984e5.png b/src/assets/97b970a4f3bd8c3cba44fa167e984e5.png new file mode 100644 index 0000000..2a2f14c --- /dev/null +++ b/src/assets/97b970a4f3bd8c3cba44fa167e984e5.png Binary files differ diff --git a/src/assets/fb259ce2e368f6853a58b91d6f6b293.png b/src/assets/fb259ce2e368f6853a58b91d6f6b293.png new file mode 100644 index 0000000..f590a57 --- /dev/null +++ b/src/assets/fb259ce2e368f6853a58b91d6f6b293.png Binary files differ diff --git a/src/components/map/pickCoordinate1.vue b/src/components/map/pickCoordinate1.vue index c20c495..3fe8e5c 100644 --- a/src/components/map/pickCoordinate1.vue +++ b/src/components/map/pickCoordinate1.vue @@ -24,7 +24,10 @@ style="width: 160px; height: 26px" @change="searchMap" ></a-input> --> - <input v-model="input" id="tipinput" /><button @click="searchAddress"> + <input v-model="input" id="tipinput" /><button + @click="searchAddress" + style="background-color: #1890ff; color:white; border:none;margin-left:5px" + > ������ </button> <div id="panel"></div> diff --git a/src/route/devices.router.ts b/src/route/devices.router.ts index 42fd496..8eaf5f2 100644 --- a/src/route/devices.router.ts +++ b/src/route/devices.router.ts @@ -1,46 +1,46 @@ import MainLayout from '@/layout/main/MainLayout.vue'; const router = { - path: '/devices', - component: MainLayout, - name: '/devices', - redirect: '/devices/basic', + path: '/devices', + component: MainLayout, + name: '/devices', + redirect: '/devices/basic', + meta: { + title: '������������', + icon: 'table', + routerGuard: true, + i18n: `������������` + }, + children: [{ + path: 'basic', + name: '/devices/basic', + component: () => import(/* webpackChunkName: "list" */ '@/views/list/devicesBasic.vue'), meta: { - title: '������������', - icon: 'table', - routerGuard: true, - i18n:`������������` + title: '������������', + routerGuard: true, + i18n: `menu.list.devicesBasic` }, - children: [{ - path: 'basic', - name: '/devices/basic', - component: () => import(/* webpackChunkName: "list" */ '@/views/list/devicesBasic.vue'), - meta: { - title: '������������', - routerGuard: true, - i18n:`menu.list.devicesBasic` - }, - }, - { + }, + { path: 'devicesVersion', name: '/devices/devicesVersion', component: () => import(/* webpackChunkName: "list" */ '@/views/list/devicesVersion.vue'), meta: { - title: '������������', - routerGuard: true, - i18n:`menu.list.devicesVersion` + title: '������������', + routerGuard: true, + i18n: `menu.list.devicesVersion` }, - }, - { + }, + { path: 'devicesMonitorPoint', name: '/devices/devicesMonitorPoint', component: () => import(/* webpackChunkName: "list" */ '@/views/list/devicesMonitorPoint.vue'), meta: { - title: '������������������', - routerGuard: true, - i18n:`menu.list.devicesMonitorPoint` + title: '������������������', + routerGuard: true, + i18n: `menu.list.devicesMonitorPoint` }, - }], - }; + }], +}; export default router; diff --git a/src/route/other.router.ts b/src/route/other.router.ts new file mode 100644 index 0000000..100bf82 --- /dev/null +++ b/src/route/other.router.ts @@ -0,0 +1,27 @@ +import MainLayout from '@/layout/main/MainLayout.vue'; + +const router = { + path: '/other', + component: MainLayout, + name: '/other', + redirect: '/other/road', + meta: { + title: '������', + icon: 'table', + routerGuard: true, + i18n: `������` + }, + children: [{ + path: 'road', + name: '/other/road', + component: () => import(/* webpackChunkName: "list" */ '@/views/list/road.vue'), + meta: { + title: '������������', + routerGuard: true, + i18n: `menu.list.road` + }, + }, +] +}; + +export default router; diff --git a/src/route/router.ts b/src/route/router.ts index b0fb485..f35ac3c 100644 --- a/src/route/router.ts +++ b/src/route/router.ts @@ -14,6 +14,7 @@ // ��������������������� import sensors from './sensors.router'; import devices from './devices.router'; +import other from './other.router'; import cache from './cache.router' import usersMange from './usersMange.router' diff --git a/src/util/request.ts b/src/util/request.ts index 0c4bbcf..3527d03 100644 --- a/src/util/request.ts +++ b/src/util/request.ts @@ -4,10 +4,11 @@ import { message } from "ant-design-vue"; const instance = axios.create({ - //baseURL: 'http://47.99.64.149:8082/', // baseUrl������������������������������������url������ ������������ + // baseURL: 'http://47.99.64.149:8082/', // baseUrl������������������������������������url������ ������������ // baseURL: 'http://www.7drlb7.com:8082/', // baseUrl������������������������������������url������ ������������ - baseURL: 'http://120.26.43.34:8082/', - // baseURL: 'http://192.168.0.11:8082/', + baseURL: 'http://120.26.43.34:8082/', + // baseURL: 'http://192.168.0.12:8082/', + // baseURL: 'http://192.168.0.28:8082/',// cjl timeout: 5000 }) diff --git a/src/views/list/road.vue b/src/views/list/road.vue new file mode 100644 index 0000000..972992d --- /dev/null +++ b/src/views/list/road.vue @@ -0,0 +1,545 @@ +<template> + <div style="display: flex; overflow: hidden"> + <div class="left"> + <div class="left-one"> + <a-range-picker + v-model="timevalue" + show-time + @ok="change1()" + valueFormat="yyyy-MM-DD HH:MM:SS" + style="width: 200px" + /> + <a-select + ref="select" + v-model="carvalue" + style="width: 200px; margin-left: 10px" + placeholder="������������������" + > + <a-select-option + v-for="item in carIndex" + :key="item.id" + :value="item.mac" + >{{ item.name }}</a-select-option + > + </a-select> + <a-button type="primary" style="margin-left: 10px" @click="selectCar" + >������</a-button + > + </div> + + <div class="left-two"> + <a-table + :dataSource="dataSource" + :selectedRows="selectedRows" + :columns="columns" + :pagination="false" + :scroll="{ y: 300 }" + style="width: 100%" + ></a-table> + </div> + <div class="left-three" style="margin-top: 20px"> + <a-button + v-show="upa === ''" + type="primary" + style="margin-left: 10px; float: right; margin-right: 10px" + @click="openIn" + >������</a-button + > + <a-button + v-show="upa === 'upa'" + type="primary" + style="margin-left: 10px; float: right; margin-right: 10px" + @click="inupa" + >������</a-button + > + <a-button + v-show="upa === 'upa'" + type="primary" + style="margin-left: 10px; float: right; margin-right: 10px" + @click="openupa" + >������</a-button + > + </div> + <div + class="left-four" + style="margin-top: 65px" + v-show="batchshow === true" + > + <a-card title="������������" style="width: 500px"> + <div> + <div> + <span style="font-size: 15.5px; color: black; margin-left: 50px" + >������������ :</span + > + <a-input + style="width: 300px; margin-left: 15px" + placeholder="���������������������" + v-model="starttime" + /> + </div> + <div style="margin-top: 10px; margin-left: 50px"> + <span style="font-size: 15.5px; color: black">������������ :</span> + <a-input + style="width: 300px; margin-left: 15px" + placeholder="���������������������" + v-model="endtime" + /> + </div> + </div> + <div style="margin-left: 140px; margin-top: 30px"> + <a-button @click="handlebatch">������</a-button> + <a-button @click="handlenull">������</a-button> + <a-button type="primary" @click="insertbatch">������</a-button> + </div> + </a-card> + </div> + </div> + <a-modal + title="���������������" + :visible="visibleCreateModal1" + @cancel="handleCreateModalCancel1" + destroyOnClose + okText="������" + > + <template #footer> + <a-button key="back" @click="handleCreateModalCancel1">������</a-button> + <a-button key="submit" type="primary" @click="insertCarLu" + >������</a-button + > + </template> + <div> + <div> + <span style="font-size: 17.5px; color: black; margin-left: 50px" + >������ :</span + > + <a-input + style="width: 300px; margin-left: 15px" + placeholder="���������������" + v-model="startLu" + /> + </div> + <div style="margin-top: 10px; margin-left: 50px"> + <span style="font-size: 17.5px; color: black">������ :</span> + <a-input + style="width: 300px; margin-left: 15px" + placeholder="���������������" + v-model="endLu" + /> + </div> + </div> + </a-modal> + <div class="right"> + <div id="roadmap" class="roadmap"></div> + </div> + </div> +</template> + +<script lang="tsx"> +import {Component, Prop, Vue, Model, Watch} from "vue-property-decorator"; +import { get, post } from "@/util/request"; +import org from "@/util/org"; +import axios from "axios"; +import { jsonp } from 'vue-jsonp' +import any = jasmine.any; + + +@Component({ + components: { + + } +}) +export default class road extends Vue { + private timevalue:any=[] + private change1(){ + console.log(this.timevalue); + } + private mounted() { + this.roadmap(); + } + private map:any + private roadmap(){ + this.map = new BMapGL.Map('roadmap') + // ������������������������������������ + var point = new BMapGL.Point(116.404, 39.915); + this.map.centerAndZoom('���������', 15); + this.map.enableScrollWheelZoom(true) // ������������������������������������������������������s + } + private dataSource: any[] = []; + private visibleCreateModal1: boolean = false; + private handleCreateModalCancel1():any{ + this.visibleCreateModal1=false; + } + private selectedRows: any[] = []; + private tableLoading: boolean = false; + private columns: any[] = [ + { + title: "������", + dataIndex: "startPoint" + }, + { + title: "������", + dataIndex: "endPoint" + }, + { + title: "������", + customRender: this.opRender + } + ]; + private openIn(){ + this.visibleCreateModal1=true; + } + private startLu:any='' + private endLu:any='' + private insertCarLu(){ + post('coordinate/interCruiserRoad',{ + startPoint:this.startLu, + endPoint:this.endLu + }).then((res)=>{ + console.log(res); + this.$message.success(res.data.message) + this.visibleCreateModal1=false; + this.startLu='' + this.endLu='' + this.selectLu() + }) + } + private opRender(text: string, record: any, index: number) { + return ( + <div style="width:180px"> + <a onClick={() => this.handleEditModalVisible(record)}> + {" "} + ������{" "} + </a> + <a-divider type="vertical"/> + <a onClick={() => this.handleEditbatch(record)}> + {" "} + ������������{" "} + </a> + <a-divider type="vertical"/> + <a-popconfirm + title="������������������" + ok-text="������" + cancel-text="������" + onConfirm={() => this.deleteDevice(record)} + > + <a href="#">������</a> + </a-popconfirm> + </div> + ) + } + private deleteDevice(record){ + get('coordinate/deleteCruiserRoad',{ + id:record.coordinateId + }).then((res)=>{ + console.log(res); + this.$message.success(res.data.message) + this.selectLu() + }) + } + private pointshow:boolean=false + private batchid:any=0 + private batchshow:boolean=false + private handleEditbatch(record){ + this.startstate='batch' + this.batchshow=true + this.selectCar(); + this.batchid=record.coordinateId + } + private handlebatch(){ + this.batchshow=false + this.handlenull(); + } + private handlenull(){ + this.starttime='' + this.endtime='' + + } + private insertbatch(){ + post('coordinateDetail/batch',{ + coordinateId:this.batchid, + time1:this.starttime, + time2:this.endtime, + mac:this.carvalue, + }).then((res=>{ + console.log(res); + this.$message.success(res.data.message) + this.starttime='' + this.endtime='' + this.selectCar() + })) + } + private upa='' + private recordid:any=0 + private handleEditModalVisible(record){ + this.handlebatch() + this.startstate='none' + this.upa='upa' + this.recordid=record.coordinateId + if(this.carvalue==='������������������'){ + this.$message.warning('������������������') + return + } + if(this.timevalue.length===0){ + this.$message.warning('���������������') + return + } + post('coordinateDetail/select',{ + coordinateId:record.coordinateId, + // time1:'2023-08-05 00:00:00', + // time2:'2023-08-06 00:00:00', + time1:this.timevalue[0], + time2:this.timevalue[1], + mac:this.carvalue, + }).then((res)=>{ + console.log(res); + this.carDate=[] + this.pointshow=true + this.setMarker(res) + }) + } + private openupa(){ + post('coordinateDetail/insert',{ + coordinateId:this.recordid, + data:this.dataList + }).then((res)=>{ + console.log(res); + this.$message.success(res.data.message) + this.upa='' + this.dataList=[] + this.carDate=[] + this.selectCar() + }) + } + private inupa(){ + this.upa='' + } + private carvalue:any='������������������' + private carIndex:any=[] + private car(){ + get('cruiserInfo/selectCruisers',{ + }).then((res)=>{ + this.carIndex=res.data.data; + console.log(this.carIndex); + }) + } + private carDate:any=[] + private selectCar(){ + console.log(this.timevalue); + if(this.carvalue==='������������������'){ + this.$message.warning('������������������') + return + } + if(this.timevalue.length===0){ + this.$message.warning('���������������') + return + } + get('cruiserInfo/getCruiserInFo',{ + mac:this.carvalue, + // time1:'2023-08-05 00:00:00', + // time2:'2023-08-06 00:00:00' + time1:this.timevalue[0], + time2:this.timevalue[1] + }).then((res)=>{ + console.log(res.data.data,'res'); + // console.log(this.carDate,'this.carDate'); + this.carDate=[] + this.pointshow=false + this.setMarker(res) + }) + } + private markerdata:any=[] + private marker:any=[] + private dataList:any=[] + private indataList:any=[] + private LudataList:any=[] + private carDataList:any=[] + private starttime:any='' + private endtime:any='' + private startstate:any='none' + private setMarker(res) { + console.log(res); + const that=this + that.carDate=[] + that.carDataList=[] + for(var i=0;i<res.data.data.rsData.length;i++){ + // res.data.data.rsData[i].flylat=res.data.data.rsData[i].flylat+'��'.toString() + // res.data.data.rsData[i].flylon=res.data.data.rsData[i].flylon+'��'.toString() + that.carDate.push(res.data.data.rsData[i]) + } + for(var i=0;i<res.data.data.data.length;i++){ + // res.data.data.rsData[i].flylat=res.data.data.rsData[i].flylat+'��'.toString() + // res.data.data.rsData[i].flylon=res.data.data.rsData[i].flylon+'��'.toString() + that.carDataList.push(res.data.data.data[i]) + } + console.log(that.carDate,'that.carDate'); + console.log(that.carDataList,'that.carDataList'); + that.map.clearOverlays() + let bPoints = [] + let aPoints = [] + if (res.status ===200) { + for (let i = 0; i < that.carDate.length; i++) { + //������������point + var myIcon = new BMapGL.Icon(require("@/assets/723cd95f31481a502d495b2d814d658.png"), new BMapGL.Size(50, 50), { + }); + const statePoint = new BMapGL.Point(that.carDate[i].flylon,that.carDate[i].flylat); + // console.log(statePoint,'statePoint'); + bPoints.push(statePoint) + //���marker���������data��������� ������������������ + that.marker[i] = new BMapGL.Marker(statePoint,{icon:myIcon}); + that.marker[i].customData = {data: that.carDate[i].data,state: that.carDate[i].state}; + //������������������marker + that.map.addOverlay(that.marker[i]); + that.marker[i].addEventListener("click",function(){ + console.log(that.carDate[i].data,'that.carDate[i].data'); + switch(that.carDate[i].state){ + case '1': + that.marker[i].setIcon(new BMapGL.Icon(require("@/assets/fb259ce2e368f6853a58b91d6f6b293.png"), new BMapGL.Size(50, 50) + )); + that.carDate[i].state='2' + break; + case '2': + that.marker[i].setIcon(new BMapGL.Icon(require("@/assets/723cd95f31481a502d495b2d814d658.png"), new BMapGL.Size(50, 50) + )); + that.carDate[i].state='1' + } + that.dataList.push({code:that.carDate[i].data,state:that.carDate[i].state}); + if(that.startstate==='batch'){ + if(that.starttime!==''&&that.endtime!==''){ + that.$message.warning('������������') + return + } + if(that.starttime===''){ + that.starttime=that.carDate[i].time + }else{ + that.endtime=that.carDate[i].time + } + } + + + for (let i = 0; i < that.dataList.length; i++) { + /*������������������������������������*/ + for (let j = i + 1; j < that.dataList.length; j++) { + //������������������������������������ + if (that.dataList[i].code == that.dataList[j].code) { + //���������������������������������������������������������j��������������� + that.dataList.splice(j, 1); + if(that.dataList[i].state==='1'){ + that.dataList[i].state='2' + }else{ + that.dataList[i].state='1' + } + } + } + } + }); //������������ + } + + for (let i = 0; i < that.carDataList.length; i++) { + console.log(that.carDataList[i],'that.carDataList[i]'); + //������������point + var myIcon = new BMapGL.Icon(require("@/assets/fb259ce2e368f6853a58b91d6f6b293.png"), new BMapGL.Size(50, 50), { + }); + const statePoint = new BMapGL.Point(that.carDataList[i].longitude,that.carDataList[i].latitude); + // console.log(statePoint,'statePoint'); + aPoints.push(statePoint) + //���marker���������data��������� ������������������ + that.markerdata[i] = new BMapGL.Marker(statePoint,{icon:myIcon}); + that.markerdata[i].customData = {data: that.carDataList[i].code,state: that.carDataList[i].state,id:that.carDataList[i].id}; + //������������������marker + that.map.addOverlay(that.markerdata[i]); + that.markerdata[i].addEventListener("click",function(){ + switch(that.carDataList[i].state){ + case '1': + that.markerdata[i].setIcon(new BMapGL.Icon(require("@/assets/fb259ce2e368f6853a58b91d6f6b293.png"), new BMapGL.Size(50, 50) + )); + that.carDataList[i].state='2'; + break; + case '2': + console.log(123); + that.markerdata[i].setIcon(new BMapGL.Icon(require("@/assets/723cd95f31481a502d495b2d814d658.png"), new BMapGL.Size(50, 50) + )); + that.carDataList[i].state='1'; + break; + } + that.dataList.push({code:that.carDataList[i].code,state:that.carDataList[i].state,id:that.carDataList[i].id}); + console.log(that.dataList); + for (let i = 0; i < that.dataList.length; i++) { + /*������������������������������������*/ + for (let j = i + 1; j < that.dataList.length; j++) { + //������������������������������������ + if (that.dataList[i].code == that.dataList[j].code) { + //���������������������������������������������������������j��������������� + that.dataList.splice(j, 1); + if(that.dataList[i].state==='1'){ + that.dataList[i].state='2' + }else{ + that.dataList[i].state='1' + } + } + } + // that.indataList = Array.from(new Set(that.dataList)) + } + }); //������������ + } + + //��������������������������������������� + if(that.pointshow===false){ + that.setZoom(bPoints) + }else{ + that.setZoom(aPoints) + } + } + } + private setZoom(bPoints) { + var view = this.map.getViewport(eval(bPoints)); + var mapZoom = view.zoom; + var centerPoint = view.center; + this.map.centerAndZoom(centerPoint, mapZoom); + } + + private selectLu(){ + get('coordinate/selectCruiserRoad',{ + }).then((res)=>{ + this.dataSource=res.data.data + }) + } + private created () { + this.car() + this.selectLu() + } + +} +</script> + +<style lang="less"> +.roadmap { + width: 100%; + float: right; + height: 50rem; +} +.BMap_cpyCtrl { + display: none; +} +.anchorBL { + display: none; +} +.left { + width: 32%; + background-color: white; + padding: 10px; +} +.right { + width: 68%; +} +.left-one { + margin-top: 5px; + height: 60px; + border-bottom: 1px dashed gray; +} +.left-two { + margin-top: 30px; +} +.BMap_Marker.BMap_noprint { + width: 23px; +} +</style> diff --git a/src/views/passport/login/successLoginRoutee.ts b/src/views/passport/login/successLoginRoutee.ts index 88f6cc8..fd23cf1 100644 --- a/src/views/passport/login/successLoginRoutee.ts +++ b/src/views/passport/login/successLoginRoutee.ts @@ -113,6 +113,15 @@ title: '������������' }, } +const road = { + path: 'road', + name: '/other/road', + component: () => import(/* webpackChunkName: "list" */ '@/views/list/road.vue'), + meta: { + routerGuard: true, + title: '������������' + }, +} const specialDevice = { path: 'specialDevice', @@ -173,6 +182,7 @@ sensorBasic: sensorBasic, sensorChangeUnit: sensorChangeUnit, basic: basic, + road:road, deviceVersion: deviceVersion, deviceMonitorPoint: deviceMonitorPoint, specialDevice: specialDevice, diff --git a/src/views/system/organization.vue b/src/views/system/organization.vue index 8de4b86..87cd4d5 100644 --- a/src/views/system/organization.vue +++ b/src/views/system/organization.vue @@ -124,7 +124,7 @@ @change="handleChange"> <!-- @blur="handleBlur"--> <a-select-option v-for="(item,index) of orgMenu" :value="item.id"> {{ item.name }}</a-select-option> - </a-select>npm run + </a-select> </a-form-model-item> </a-col> <a-col :md="11" :sm="24"> -- Gitblit v1.8.0