| | |
| | | end-placeholder="结束日期" |
| | | :picker-options="pickerOptions1"> |
| | | </el-date-picker> |
| | | <el-select v-model="carInput" clearable placeholder="请选择走航车" style="width: 180px;display: inline-block"> |
| | | <el-select v-if="equipChoose1==='car'" v-model="carInput" clearable placeholder="请选择走航车" style="width: 180px;display: inline-block"> |
| | | <el-option |
| | | v-for="(item,index) in carMac" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.mac"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-select v-else v-model="planSelect" clearable placeholder="请选择无人机" style="width: 180px;display: inline-block"> |
| | | <el-option |
| | | v-for="(item,index) in carMac" |
| | | :key="index" |
| | |
| | | </el-select> |
| | | <el-button type="primary" @click="selectExport" style="margin-right: 10px;">查询</el-button> |
| | | <el-button type="primary" @click="upImgBtn" style="margin-left: 0">上传</el-button> |
| | | <!-- <el-button type="primary" @click="exportDom">下载demo</el-button>--> |
| | | </div> |
| | | <div class="dailyDown" style="overflow-y: auto"> |
| | | <el-card class="boxCard"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="medium" @click="expReport(scope.row)">下载</el-button> |
| | | <el-button v-if="equipChoose1==='car'" type="text" size="medium" @click="expReport(scope.row)">下载</el-button> |
| | | <el-button v-else type="text" size="medium" @click="exUAVReport(scope.row)">下载</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-input v-if="equipChoose2==='car'" v-model="areaInput3" placeholder="请输入走航区域" clearable style="width: 180px;display: inline-block"></el-input> |
| | | <el-input v-else v-model="planInput2" placeholder="请输入飞行区域" clearable style="width: 180px;display: inline-block"></el-input> |
| | | <el-button v-if="equipChoose2!=='car'" type="primary" @click="innerVisible = true">飞行监测</el-button> |
| | | <div class="dateTimeBox"> |
| | | <div class="dateTimeBox" v-if="equipChoose2==='car'"> |
| | | <div> |
| | | <el-date-picker |
| | | v-model="value2" |
| | |
| | | @change="value4Change"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <el-date-picker |
| | | v-model="planUpTime" |
| | | type="date" |
| | | placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | <div v-if="equipChoose2==='car'" class="uploadDiv" style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between"> |
| | |
| | | <div slot="tip" class="el-upload__tip">请上传小结图片</div> |
| | | </el-upload> |
| | | </div> |
| | | <div v-else class="uploadDiv" style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan1" |
| | | :on-change="handleChangePlan1" |
| | | :on-remove="handleRemovePlan1" |
| | | :file-list="fileListPlan1" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传国控点位置及航拍图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan2" |
| | | :on-change="handleChangePlan2" |
| | | :on-remove="handleRemovePlan2" |
| | | :file-list="fileListPlan2" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传国控点实时数值图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan3" |
| | | :on-change="handleChangePlan3" |
| | | :on-remove="handleRemovePlan3" |
| | | :file-list="fileListPlan3" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传高值区域与国控点相对位置图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan4" |
| | | :on-change="handleChangePlan4" |
| | | :on-remove="handleRemovePlan4" |
| | | :file-list="fileListPlan4" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传O3实时监测高值区域图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan5" |
| | | :on-change="handleChangePlan5" |
| | | :on-remove="handleRemovePlan5" |
| | | :file-list="fileListPlan5" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传O3高值区现场航拍图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan6" |
| | | :on-change="handleChangePlan6" |
| | | :on-remove="handleRemovePlan6" |
| | | :file-list="fileListPlan6" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传PM10实时监测高值区域图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan7" |
| | | :on-change="handleChangePlan7" |
| | | :on-remove="handleRemovePlan7" |
| | | :file-list="fileListPlan7" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传PM10高值区现场航拍图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan8" |
| | | :on-change="handleChangePlan8" |
| | | :on-remove="handleRemovePlan8" |
| | | :file-list="fileListPlan8" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传SO2实时监测高值区域图</div> |
| | | </el-upload> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="" |
| | | ref="uploadPlan9" |
| | | :on-change="handleChangePlan9" |
| | | :on-remove="handleRemovePlan9" |
| | | :file-list="fileListPlan9" |
| | | multiple |
| | | :auto-upload="false"> |
| | | <el-button slot="trigger" type="primary" size="small">选取图片</el-button> |
| | | <div slot="tip" class="el-upload__tip">请上传SO2高值区现场航拍图</div> |
| | | </el-upload> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="openBox = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitImgs" :disabled ="isDisplay">保 存</el-button> |
| | | </div> |
| | | <el-dialog |
| | | class="innerDialog" |
| | | width="60%" |
| | | width="70%" |
| | | height="90%" |
| | | margin-top="7vh" |
| | | title="内层 Dialog" |
| | | :visible.sync="innerVisible" |
| | | append-to-body> |
| | |
| | | |
| | | <script> |
| | | import { exportDocx } from '@/utils/exportImageFile' |
| | | import { exportUAVImage } from '@/utils/exportUAVImage' |
| | | import requestObj from '@/utils/request' |
| | | import Map from '@/components/PlanMap/Map' |
| | | export default { |
| | |
| | | cityOptions: [{ |
| | | value: 'gx', |
| | | label: '高新区' |
| | | }, { |
| | | value: 'hn', |
| | | label: '浑南区' |
| | | }], |
| | | cityOptions2: [{ |
| | | value: 'gx', |
| | | label: '高新区' |
| | | }, { |
| | | value: 'hn', |
| | | label: '浑南区' |
| | | }], |
| | | equipChoose1: 'car', |
| | | equipChoose2: 'car', |
| | | equipOptions1: [{ |
| | | value: 'car', |
| | | label: '走航车' |
| | | }, { |
| | | value: 'plan', |
| | | label: '无人机' |
| | | }], |
| | | equipOptions2: [{ |
| | | value: 'car', |
| | |
| | | value2: [new Date(), new Date()], // 上传时间1 |
| | | value3: [], // 上传时间2 |
| | | value4: [], // 上传时间3 |
| | | planUpTime: new Date(), // 无人机上传时间 |
| | | pickerOptions1: { |
| | | shortcuts: [{ |
| | | text: '最近一周', |
| | |
| | | planInput: '', // 无人机飞行区域查询 |
| | | planInput2: '', // 无人机飞行区域上传 |
| | | innerVisible: false, // 内部地图是否打开 |
| | | radioSeven: 'PM2.5' |
| | | radioSeven: 'PM2.5', |
| | | fileListPlan1: [], |
| | | fileListPlan2: [], |
| | | fileListPlan3: [], |
| | | fileListPlan4: [], |
| | | fileListPlan5: [], |
| | | fileListPlan6: [], |
| | | fileListPlan7: [], |
| | | fileListPlan8: [], |
| | | fileListPlan9: [], |
| | | fileBase64Plan1: [], |
| | | fileBase64Plan2: [], |
| | | fileBase64Plan3: [], |
| | | fileBase64Plan4: [], |
| | | fileBase64Plan5: [], |
| | | fileBase64Plan6: [], |
| | | fileBase64Plan7: [], |
| | | fileBase64Plan8: [], |
| | | fileBase64Plan9: [], |
| | | UAVReport: { |
| | | fileLists: [], |
| | | }, // 无人机报告 |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | if (n === null) { |
| | | this.value4 = [] |
| | | } |
| | | } |
| | | }, |
| | | equipChoose1(n, o) { |
| | | if (n !== o) { |
| | | this.tableData = [] |
| | | } |
| | | }, |
| | | cityChoose(n, o) { |
| | | if (n !== o) { |
| | | this.tableData = [] |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | created() { |
| | | // 走航车数组 |
| | | this.$request({ |
| | | url: 'cruiser/selectCruisers', |
| | | method: 'get' |
| | | }).then(res => { |
| | | this.carMac = res.data |
| | | this.planMac = res.data // 无人机数组,暂用走航数据 |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | // 无人机数组 |
| | | // this.$request({ |
| | | // url: 'uav/getUavDaily', |
| | | // method: 'get' |
| | | // }).then(res => { |
| | | // this.planMac = res.data |
| | | // }).catch(err => { |
| | | // console.log(err) |
| | | // }) |
| | | }, |
| | | methods: { |
| | | // 模拟下载 |
| | | exportDom() { |
| | | // const url1 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg` |
| | | // const url2 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg` |
| | | // const url3 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg` |
| | | // const url4 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg` |
| | | // this.UAVReport.fileLists[1] = [url1, url2] |
| | | // this.UAVReport.fileLists[3] = [url3, url4, url3] |
| | | const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | var images = [['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], [], []] |
| | | var info = 0 |
| | | var num = 0 |
| | | for (let i = 0; i < images.length; i++) { |
| | | if (!this.UAVReport.fileLists[i]) this.UAVReport.fileLists[i] = [] |
| | | if (images[i].length) { |
| | | num++ |
| | | info += images[i].length |
| | | if (i === 0) this.UAVReport.num1 = images[i].length |
| | | else if (i === 1) this.UAVReport.num2 = images[i].length |
| | | else if (i === 2) this.UAVReport.num3 = images[i].length |
| | | else if (i === 3) this.UAVReport.num4 = images[i].length |
| | | else if (i === 4) this.UAVReport.num5 = images[i].length |
| | | else if (i === 5) this.UAVReport.num6 = images[i].length |
| | | else if (i === 6) this.UAVReport.num7 = images[i].length |
| | | for (let j = 0; j < images[i].length; j++) { |
| | | this.UAVReport.fileLists[i].push(baseUrl + images[i][j]) |
| | | } |
| | | } |
| | | } |
| | | this.UAVReport.index = info |
| | | this.UAVReport.num = num |
| | | console.log(this.UAVReport, 'this.UAVReport') |
| | | exportUAVImage('/UAVReport.docx', this.UAVReport, `模拟无人机报告.docx`) |
| | | }, |
| | | // 查询走行车报告 |
| | | selectExport() { |
| | | this.selectTime = this.newTime(this.value1) |
| | | if (this.cityChoose && this.equipChoose1 && this.selectTime[1]) { |
| | | // 判断无人机or走航车 |
| | | var mac = '' |
| | | if (this.equipChoose1 === 'car') { |
| | | mac = this.carInput |
| | | } else { |
| | | mac = this.planSelect |
| | | } |
| | | this.$request({ |
| | | url: '/cruiser/selectDaily', |
| | | method: 'get', |
| | |
| | | type: this.equipChoose1, |
| | | startTime: this.selectTime[0], |
| | | endTime: this.selectTime[1], |
| | | mac: this.carInput |
| | | mac: mac |
| | | } |
| | | }).then(res => { |
| | | this.carInput2 = this.carInput |
| | |
| | | } |
| | | info.map(v => { |
| | | var time = v.time.split('-').join('') |
| | | v.name = `高新区走航监测报告${time}` |
| | | if (this.cityChoose === 'gx') { |
| | | v.name = `高新区走航监测报告${time}` |
| | | } else { |
| | | v.name = `浑南区走航监测报告${time}` |
| | | } |
| | | }) |
| | | info.sort((a, b) => { return b.time.split('-').join('') - a.time.split('-').join('') }) |
| | | this.tableData = info |
| | |
| | | }, |
| | | // 上传图片 |
| | | submitImgs() { |
| | | if(this.equipChoose2 === 'car') { |
| | | if (this.equipChoose2 === 'car') { // 上传走航车图片 |
| | | this.tableData = [] |
| | | this.isDisplay = true |
| | | this.numList = [this.fileLists[0].length, this.fileLists[1].length, this.fileLists[2].length, this.fileLists[3].length, this.fileLists[4].length, this.fileLists[5].length, this.fileLists[6].length, this.fileLists[7].length, this.fileLists[8].length] |
| | |
| | | num++ |
| | | } |
| | | }) |
| | | if (this.cityOptions2 && this.value2.length === 2 && this.equipChoose2 && this.carInput2 && this.areaInput3 && this.isDisplay && (num === 0 || num === this.fileLists.length)) { |
| | | if (this.cityChoose2 && this.value2.length === 2 && this.equipChoose2 && this.carInput2 && this.areaInput3 && this.isDisplay && (num === 0 || num === this.fileLists.length)) { |
| | | this.upTime = this.newTime(this.value2, 'submit') |
| | | const formData = new FormData() |
| | | formData.append(`code`, this.cityChoose2) |
| | |
| | | var s = new Date(res.data.time) // 标准时间转中国标准时间 |
| | | this.value1 = [s, s] |
| | | this.carInput = this.carInput2 |
| | | this.equipChoose1 = this.equipChoose2 |
| | | this.cityChoose = this.cityChoose2 |
| | | var reportInfo = res.data |
| | | reportInfo.name = '高新区走航监测报告' + reportInfo.time.split('-').join('') |
| | | if (this.cityChoose2 === 'gx') { |
| | | reportInfo.name = '高新区走航监测报告' + reportInfo.time.split('-').join('') |
| | | } else { |
| | | reportInfo.name = '浑南区走航监测报告' + reportInfo.time.split('-').join('') |
| | | } |
| | | this.tableData = [reportInfo] |
| | | } else if (res.code === -47) { |
| | | this.$message(res.message) |
| | |
| | | this.isDisplay = false |
| | | this.$message('缺失参数!') |
| | | } |
| | | } else { // 上传无人机图片 |
| | | this.UAVUpImage() |
| | | } |
| | | }, |
| | | // 上传无人机图片 |
| | | async UAVUpImage() { |
| | | var upObj = {} |
| | | console.log('uav上传') |
| | | this.tableData = [] |
| | | this.isDisplay = true |
| | | if (this.cityChoose2 && this.equipChoose2 && this.planSelect2 && this.planInput2 && this.isDisplay) { |
| | | this.upTime = this.OneDayNew(this.planUpTime) |
| | | // 所有图片转base64 |
| | | await this.UAVAllImageToBase64() |
| | | upObj.fileList1 = this.fileBase64Plan1 |
| | | upObj.fileList2 = this.fileBase64Plan2 |
| | | upObj.fileList3 = this.fileBase64Plan3 |
| | | upObj.fileList4 = this.fileBase64Plan4 |
| | | upObj.fileList5 = this.fileBase64Plan5 |
| | | upObj.fileList6 = this.fileBase64Plan6 |
| | | upObj.fileList7 = this.fileBase64Plan7 |
| | | upObj.fileList8 = this.fileBase64Plan8 |
| | | upObj.fileList9 = this.fileBase64Plan9 |
| | | upObj.code = this.cityChoose2 |
| | | upObj.type = this.equipChoose2 |
| | | upObj.mac = this.planSelect2 |
| | | upObj.area = this.planInput2 |
| | | upObj.time = this.upTime |
| | | var objJson = JSON.stringify(upObj) |
| | | console.log(objJson, 'objJson') |
| | | // 弹框隐藏 |
| | | this.openBox = false |
| | | this.$request({ |
| | | url: 'uav/getUavDaily', |
| | | data: { objJson: objJson }, |
| | | method: 'post' |
| | | }).then(res => { |
| | | this.isDisplay = false |
| | | if (res.code === 0) { |
| | | this.$message({ |
| | | message: '提交成功!', |
| | | type: 'success' |
| | | }) |
| | | // console.log(res) |
| | | // var s = new Date(res.data.time) // 标准时间转中国标准时间 |
| | | // this.value1 = [s, s] |
| | | this.planSelect = this.planSelect2 |
| | | this.equipChoose1 = this.equipChoose2 |
| | | this.cityChoose = this.cityChoose2 |
| | | var reportInfo = res.data |
| | | if (this.cityChoose === 'gx') { |
| | | reportInfo.name = '高新区飞行监测报告' + reportInfo.time.split('-').join('') |
| | | } else { |
| | | reportInfo.name = '浑南区飞行监测报告' + reportInfo.time.split('-').join('') |
| | | } |
| | | this.tableData = [reportInfo] |
| | | } else if (res.code === -47) { |
| | | this.$message(res.message) |
| | | } else { |
| | | this.$message.error('提交失败!') |
| | | } |
| | | }).catch(err => { |
| | | console.log(err) |
| | | this.isDisplay = false |
| | | }) |
| | | } else { |
| | | this.isDisplay = false |
| | | this.$message('缺失参数!') |
| | | } |
| | | }, |
| | | // 提交文件后台接口 |
| | |
| | | data |
| | | }) |
| | | }, |
| | | // 下载报告 |
| | | // 下载走航车报告 |
| | | expReport(obj) { |
| | | this.$request({ |
| | | url: '/cruiser/loadDaily', |
| | |
| | | this.sailingReport.time1 = time[1] |
| | | this.sailingReport.time2 = time[2] |
| | | } |
| | | if (this.cityChoose === 'gx') { |
| | | this.sailingReport.city = '高新区' |
| | | } else { |
| | | this.sailingReport.city = '浑南区' |
| | | } |
| | | exportDocx('/sailingReport.docx', this.sailingReport, `${obj.name}.docx`) |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | // 下载无人机报告 |
| | | exUAVReport(obj) { |
| | | this.$request({ |
| | | url: '', |
| | | method: 'get', |
| | | params: { |
| | | id: obj.id |
| | | } |
| | | }).then(res => { |
| | | const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | var images = [['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], [], [], [], [], [], [], [], [], [], [], []] |
| | | var info = 0 |
| | | var num = 0 |
| | | for (let i = 0; i < images.length; i++) { |
| | | if (!this.UAVReport.fileLists[i]) this.UAVReport.fileLists[i] = [] |
| | | if (images[i].length) { |
| | | num++ |
| | | info += images[i].length |
| | | if (i === 0) this.UAVReport.num1 = images[i].length |
| | | else if (i === 1) this.UAVReport.num2 = images[i].length |
| | | else if (i === 2) this.UAVReport.num3 = images[i].length |
| | | else if (i === 3) this.UAVReport.num4 = images[i].length |
| | | else if (i === 4) this.UAVReport.num5 = images[i].length |
| | | else if (i === 5) this.UAVReport.num6 = images[i].length |
| | | else if (i === 6) this.UAVReport.num7 = images[i].length |
| | | else if (i === 7) this.UAVReport.num8 = images[i].length |
| | | else if (i === 8) this.UAVReport.num9 = images[i].length |
| | | else if (i === 9) this.UAVReport.num10 = images[i].length |
| | | else if (i === 10) this.UAVReport.num11 = images[i].length |
| | | else if (i === 11) this.UAVReport.num12 = images[i].length |
| | | else if (i === 12) this.UAVReport.num13 = images[i].length |
| | | else if (i === 13) this.UAVReport.num14 = images[i].length |
| | | else if (i === 14) this.UAVReport.num15 = images[i].length |
| | | else if (i === 15) this.UAVReport.num16 = images[i].length |
| | | else if (i === 16) this.UAVReport.num17 = images[i].length |
| | | for (let j = 0; j < images[i].length; j++) { |
| | | this.UAVReport.fileLists[i].push(baseUrl + images[i][j]) |
| | | } |
| | | } |
| | | } |
| | | this.UAVReport.index = info |
| | | this.UAVReport.num = num |
| | | var data2 = obj.date.split('-') |
| | | this.UAVReport.date2 = data2[0] + '年' + data2[1] + '月' + data2[2] + '日' |
| | | var time = [] |
| | | for (let i = 0; i < res.data.code.time.length; i++) { |
| | | time.push(res.data.code.time[i]) |
| | | } |
| | | this.UAVReport.time0 = time[0] |
| | | if (time.length === 2) { |
| | | this.UAVReport.time1 = time[1] |
| | | } |
| | | if (time.length === 3) { |
| | | this.UAVReport.time1 = time[1] |
| | | this.UAVReport.time2 = time[2] |
| | | } |
| | | if (this.cityChoose === 'gx') { |
| | | this.UAVReport.city = '高新区' |
| | | } else { |
| | | this.UAVReport.city = '浑南区' |
| | | } |
| | | exportUAVImage('/UAVReport.docx', this.UAVReport, `${obj.name}.docx`) |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | |
| | | return arr |
| | | } |
| | | }, |
| | | // 时间处理函数,日期是单个 |
| | | OneDayNew(time) { |
| | | var date = new Date(time) |
| | | 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 |
| | | return y + '-' + m + '-' + d |
| | | }, |
| | | // 无人机所有图片转base64 |
| | | async UAVAllImageToBase64() { |
| | | if (this.fileListPlan1.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan1.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan1[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan1[i] = res |
| | | }) |
| | | } |
| | | // this.fileListPlan1 = fileListPlan1 |
| | | } |
| | | if (this.fileListPlan2.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan2.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan2[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan2[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan3.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan3.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan3[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan3[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan4.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan4.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan4[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan4[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan5.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan5.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan5[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan5[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan6.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan6.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan6[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan6[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan7.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan7.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan7[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan7[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan8.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan8.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan8[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan8[i] = res |
| | | }) |
| | | } |
| | | } |
| | | if (this.fileListPlan9.length > 0) { |
| | | for (let i = 0; i < this.fileListPlan9.length; i++) { |
| | | var p = this.getBase64(this.fileListPlan9[i].raw) |
| | | await p.then(res => { |
| | | this.fileBase64Plan9[i] = res |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | // 图片转base64函数 |
| | | getBase64(file) { |
| | | // console.log(file) |
| | | return new Promise(function(resolve, reject) { |
| | | var reader = new FileReader() |
| | | let imgResult = '' |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 无人机图片上传 |
| | | handleChangePlan1(file, fileList) { |
| | | // console.log(file, fileList) |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan1 = fileList |
| | | }, |
| | | handleRemovePlan1(file, fileList) { |
| | | this.fileListPlan1 = fileList |
| | | }, |
| | | handleChangePlan2(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan2 = fileList |
| | | }, |
| | | handleRemovePlan2(file, fileList) { |
| | | this.fileListPlan2 = fileList |
| | | }, |
| | | handleChangePlan3(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan3 = fileList |
| | | }, |
| | | handleRemovePlan3(file, fileList) { |
| | | this.fileListPlan3 = fileList |
| | | }, |
| | | handleChangePlan4(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan4 = fileList |
| | | }, |
| | | handleRemovePlan4(file, fileList) { |
| | | this.fileListPlan4 = fileList |
| | | }, |
| | | handleChangePlan5(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan5 = fileList |
| | | }, |
| | | handleRemovePlan5(file, fileList) { |
| | | this.fileListPlan5 = fileList |
| | | }, |
| | | handleChangePlan6(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan6 = fileList |
| | | }, |
| | | handleRemovePlan6(file, fileList) { |
| | | this.fileListPlan6 = fileList |
| | | }, |
| | | handleChangePlan7(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan7 = fileList |
| | | }, |
| | | handleRemovePlan7(file, fileList) { |
| | | this.fileListPlan7 = fileList |
| | | }, |
| | | handleChangePlan8(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan8 = fileList |
| | | }, |
| | | handleRemovePlan8(file, fileList) { |
| | | this.fileListPlan8 = fileList |
| | | }, |
| | | handleChangePlan9(file, fileList) { |
| | | if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') { |
| | | this.$refs.uploadPlan1.handleRemove(file) |
| | | this.$message.warning(`上传文件格式不符合`) |
| | | return |
| | | } |
| | | this.fileListPlan9 = fileList |
| | | }, |
| | | handleRemovePlan9(file, fileList) { |
| | | this.fileListPlan9 = fileList |
| | | }, |
| | | // 限制一天 |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`) |
| | | }, |
| | | // 上传文件到upload |
| | | // 走航车上传文件到upload |
| | | handleChange1(file, fileList) { |
| | | // console.log(file, fileList) |
| | | this.fileList1 = fileList |
| | | this.fileLists[0] = fileList |
| | | // this.getBase64(file.raw).then(res => { |
| | | // console.log(res) |
| | | // }) |
| | | }, |
| | | handleRemove1(file, fileList) { |
| | | this.fileList1 = fileList |