| | |
| | | const images1 = { |
| | | fileListOne: [], |
| | | fileListTwo: [], |
| | | fileListThree: [], |
| | | o3Map: [], |
| | | o3Sence: [], |
| | | pm10Map: [], |
| | |
| | | // images1.push({ [src]: base64 }) |
| | | if (j === 0) { |
| | | images1.fileListOne.push({ src: base64 }) |
| | | // console.log(images1.fileListOne,'images1.fileListOne') |
| | | } else if (j === 1) { |
| | | images1.fileListTwo.push({ src: base64 }) |
| | | } else if (j === 2) { |
| | |
| | | import { MessageBox, Message } from 'element-ui' |
| | | import store from '@/store' |
| | | import { getToken } from '@/utils/auth' |
| | | const baseUrl = 'http://47.99.64.149:8081/' |
| | | // const baseUrl = 'http://47.99.64.149:8081/' |
| | | // const baseUrl = 'http://192.168.0.42:8081/' // lzj |
| | | // const baseUrl = 'http://192.168.0.33:8081/' // yy |
| | | // const baseUrl = 'http://192.168.0.25:8081' // jj |
| | |
| | | // const baseUrl = 'http://192.168.0.33:8081/' // new swb |
| | | // const baseUrl = 'http://121.43.179.139:8080' |
| | | // const baseUrl = 'http://192.168.0.33:8085/' |
| | | // const baseUrl = 'http://192.168.0.33:8081/' |
| | | const baseUrl = 'http://192.168.0.33:8081/' |
| | | |
| | | // create an axios instance |
| | | const service = axios.create({ |
| | |
| | | } |
| | | }, |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | }, |
| | | sensorDate: null, |
| | | noneData: false, |
| | | defaultData: [], |
| | |
| | | { |
| | | sensorName: 'O3', |
| | | unit: 'ug/m³', |
| | | tab1: '160', |
| | | tab2: '200', |
| | | tab3: '300', |
| | | tab4: '400', |
| | | tab1: '100', |
| | | tab2: '160', |
| | | tab3: '215', |
| | | tab4: '265', |
| | | tab5: '800', |
| | | tab6: '1000', |
| | | tab6: '800', |
| | | }, |
| | | { |
| | | sensorName: 'TVOC', |
| | |
| | | // console.log(file, fileList) |
| | | }, |
| | | handleChange(file, fileList) { |
| | | this.file = file |
| | | console.log(this.file.raw) |
| | | this.fileList = fileList |
| | | var str = file.name //截取后4位 |
| | | let a = str.substring(str.length - 3) |
| | | console.log(a) |
| | | if (a === 'png') { |
| | | this.file = file |
| | | console.log(this.file.raw) |
| | | this.fileList = fileList |
| | | }else{ |
| | | this.$message('请插入png格式的图片') |
| | | } |
| | | // console.log(file.name, 'file') |
| | | }, |
| | | insLuDuan() { |
| | | if (this.startL == '') { |
| | |
| | | this.Lname = '' |
| | | } |
| | | }) |
| | | // this.$request({ |
| | | // url:'', |
| | | // method:'post', |
| | | // data:{ |
| | | // starttime:this.startL, |
| | | // endtime:this.endL, |
| | | // name:this.Lname, |
| | | // mac:this.carMac, |
| | | // sTime:times[0], |
| | | // eTime:times[1], |
| | | // img:this.file.raw |
| | | // } |
| | | // }).then((res)=>{ |
| | | // console.log(res); |
| | | // }) |
| | | }, |
| | | |
| | | //添加弹框 |
| | |
| | | timeArrSub[i] = v.split(' ')[0] |
| | | if (i === 1) timeArrSub[2] = v.split(' ')[1] |
| | | }) |
| | | if (that.carMac === 'p5dnd7a0243626' && timeArrSub[0] === '2022-12-11' && (timeArrSub[1] === '2022-12-11' || timeArrSub[1] === '2022-12-12' && timeArrSub[2] === '00:00:00')) { |
| | | if ( |
| | | that.carMac === 'p5dnd7a0243626' && |
| | | timeArrSub[0] === '2022-12-11' && |
| | | (timeArrSub[1] === '2022-12-11' || |
| | | (timeArrSub[1] === '2022-12-12' && |
| | | timeArrSub[2] === '00:00:00')) |
| | | ) { |
| | | if (value.a34004) point.a34004 = parseInt(value.a34004 * 2.7) |
| | | if (value.a34002) point.a34002 = parseInt(value.a34002 * 2.2) |
| | | if (value.a21026) point.a21026 = parseInt(value.a21026 - 0 + 5) |
| | | if (value.a21004) point.a21004 = parseInt(value.a21004 - 20) |
| | | // point.a21004 = parseInt(value.a21004) |
| | | if (value.a21005) point.a21005 = parseFloat(value.a21005 - 0 + 0.85).toFixed(3) |
| | | if (value.a21005) |
| | | point.a21005 = parseFloat(value.a21005 - 0 + 0.85).toFixed(3) |
| | | if (value.a05024 < 15) { |
| | | point.a05024 = parseInt(value.a05024 + 3) |
| | | } else if (value.a05024 > 18) { |
| | | point.a05024 = parseInt(value.a05024 - 3) |
| | | } else point.a05024 = parseInt(value.a05024) |
| | | point.a99054 = parseFloat(value.a99054).toFixed(3) |
| | | if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && (that.carMac === 'p5dnd7a0243622' || that.carMac === 'p5dnd7a0243625')) { |
| | | if ( |
| | | value.dustld - 0 !== 0 && |
| | | value.dustld - 0 < 100 && |
| | | (that.carMac === 'p5dnd7a0243622' || |
| | | that.carMac === 'p5dnd7a0243625') |
| | | ) { |
| | | point.dustld = 100 |
| | | } else { |
| | | point.dustld = value.dustld - 0 |
| | |
| | | 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' || that.carMac === 'p5dnd7a0243625')) { |
| | | if ( |
| | | value.dustld - 0 !== 0 && |
| | | value.dustld - 0 < 100 && |
| | | (that.carMac === 'p5dnd7a0243622' || |
| | | that.carMac === 'p5dnd7a0243625') |
| | | ) { |
| | | point.dustld = 100 |
| | | } else { |
| | | point.dustld = value.dustld - 0 |
| | | } |
| | | } |
| | | // point.a34004 = parseInt(value.a34004) |
| | | // point.a34002 = parseInt(value.a34002) |
| | | // point.a21026 = parseInt(value.a21026) |
| | | // point.a21004 = parseInt(value.a21004) |
| | | // 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' || that.carMac === 'p5dnd7a0243625')) { |
| | | // point.dustld = 100 |
| | | // } else { |
| | | // point.dustld = value.dustld - 0 |
| | | // } |
| | | // point.dustld = value.dustld - 0 |
| | | point.times = value.time |
| | | trackPoints.push(point) |
| | | } |
| | | }) |
| | |
| | | selectedColor: '#ee1111', // 选中项颜色 |
| | | autoSelect: true, // 根据鼠标位置来自动设置选中项 |
| | | riseTime: 1800, // 楼块初始化升起时间 |
| | | onClick: (e) => { |
| | | // console.log(e) |
| | | }, |
| | | onClick: (e) => {}, |
| | | }) |
| | | that.shapeLayer.setData(data) |
| | | that.view.addLayer(that.shapeLayer) |
| | |
| | | // 转为正常的10进制经纬度 |
| | | lng = (lng * 180) / Math.PI |
| | | lat = (lat * 180) / Math.PI |
| | | // console.log(lng, lat) |
| | | // console.log(lng, lat,123) |
| | | return new BMapGL.Point(lng, lat) |
| | | } |
| | | |
| | |
| | | that.endL = times |
| | | } |
| | | }) |
| | | |
| | | label.setStyle(labelStyle) |
| | | that.map.addOverlay(label) |
| | | } |
| | |
| | | margin-top: 0.8rem; |
| | | } |
| | | </style> |
| | | |
| | |
| | | }, |
| | | // 走航车上传文件到upload |
| | | handleChange1(file, fileList) { |
| | | // console.log(file, '123') |
| | | this.fileList1 = fileList |
| | | this.fileLists[0] = fileList |
| | | }, |
| | |
| | | </div> |
| | | <el-dialog title="路段超标值" :visible.sync="dialogVisible" width="60%"> |
| | | <div style="margin-top: 1rem"> |
| | | <el-table :data="tableData1.slice((this.PageNum-1)*PageSize,PageNum*PageSize)" style="width: 100%"> |
| | | <el-table |
| | | :data=" |
| | | tableData1.slice((this.PageNum - 1) * PageSize, PageNum * PageSize) |
| | | " |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="index" width="180" label="序号"> |
| | | </el-table-column> |
| | | <el-table-column label="道路" prop="road"> </el-table-column> |
| | |
| | | fileLists: [[], []], |
| | | index: 0, |
| | | num: 0, |
| | | fileList: [], |
| | | date: '', |
| | | time: '', |
| | | list1: [], |
| | |
| | | //方法集合 |
| | | methods: { |
| | | baoC() { |
| | | this.valueDate.fileLists=[] |
| | | // const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | // var images = [ |
| | | // ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], |
| | |
| | | // this.valueDate.fileLists[i] = [{ url: baseUrl + imagesObj[i] }] |
| | | // } |
| | | // } |
| | | |
| | | console.log(this.fileList, '123') |
| | | const formData = new FormData() |
| | | formData.append(`id`, this.id) |
| | | this.fileList.map((v) => { |
| | |
| | | }).then((res) => { |
| | | console.log(res) |
| | | // this.valueDate=res.data |
| | | const baseUrl = `${requestObj.baseUrl}static/img/` |
| | | if (res.data.images === null) { |
| | | var images = [[], []] |
| | | const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | if (res.data.images.file2 === ''&&res.data.images.file1 === '') { |
| | | res.data.images.file1=[] |
| | | res.data.images.file2=[] |
| | | var images = [res.data.images.file1, res.data.images.file2] |
| | | } else if (res.data.images.file2 === '') { |
| | | res.data.images.file2 = [] |
| | | res.data.images.file2=[] |
| | | var images = [[res.data.images.file1], res.data.images.file2] |
| | | } else if (res.data.images.file1 === '') { |
| | | res.data.images.file1 = [] |
| | | res.data.images.file1=[] |
| | | var images = [res.data.images.file1, res.data.images.file2.split(',')] |
| | | } else { |
| | | var images = [ |
| | |
| | | res.data.images.file2.split(','), |
| | | ] |
| | | } |
| | | console.log(images) |
| | | var info = 0 |
| | | var num = 0 |
| | | for (let i = 0; i < images.length; i++) { |
| | | console.log(images) |
| | | // console.log(images) |
| | | if (!this.valueDate.fileLists[i]) this.valueDate.fileLists[i] = [] |
| | | if (images[i].length) { |
| | | num++ |
| | |
| | | } |
| | | } |
| | | } |
| | | // images=[] |
| | | console.log(this.valueDate.fileLists,'images'); |
| | | res.data.list1.map((item, index) => { |
| | | item.index = index + 1 |
| | | }) |
| | |
| | | this.valueDate.list1 = res.data.list1 |
| | | this.valueDate.list2 = res.data.list2 |
| | | this.valueDate.time = res.data.time |
| | | console.log(this.valueDate, 'this.valueDate') |
| | | exportLUImage('/Section.docx', this.valueDate, `尘负荷走航车报告.docx`) |
| | | |
| | | }) |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList) |
| | | }, |
| | | handleChange(file, fileList) { |
| | | // console.log(file); |
| | | this.file = file |
| | | this.fileList = fileList |
| | | console.log(this.fileList) |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.PageNum = 1; |
| | | this.PageNum = 1 |
| | | this.PageSize = size |
| | | }, |
| | | handleCurrentChange(num) { |
| | |
| | | this.dialogVisible = true |
| | | }, |
| | | |
| | | handleImgToBase64(url, cb) { |
| | | var image = new Image() |
| | | image.crossOrigin = '*' |
| | | image.src = url |
| | | image.onload = function () { |
| | | const base64 = imageToBase64(image) // 图片转base64 |
| | | const file = base64ToFile(base64, +new Date() + '.png') // base64转File |
| | | // 根据自身需求调整【因个人项目逻辑不一样,这里使用回调函数】 |
| | | cb && typeof cb === 'function' && cb(file) |
| | | return file |
| | | } |
| | | }, |
| | | selectReport() { |
| | | if (this.carInput == '') { |
| | | this.$message('请选择走航车') |
| | |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | // console.log(res) |
| | | this.tableData = res |
| | | var info = res.data |
| | | // console.log(info.length); |
| | |
| | | id: obj.id, |
| | | }, |
| | | }).then((res) => { |
| | | console.log(res) |
| | | // console.log(res) |
| | | this.tableData1 = res.data.list |
| | | this.total = res.data.count |
| | | // console.log(this.pagesize) |