From 416eb6356e6fca5d633597bba18958ae664ad6c6 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Fri, 15 Mar 2024 17:20:21 +0800 Subject: [PATCH] fix: 走航报告下载修改 --- src/views/dailyreport/index.vue | 1987 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 1,699 insertions(+), 288 deletions(-) diff --git a/src/views/dailyreport/index.vue b/src/views/dailyreport/index.vue index e67516a..1eb87b7 100644 --- a/src/views/dailyreport/index.vue +++ b/src/views/dailyreport/index.vue @@ -1,16 +1,41 @@ <template> -<div class="dailyreport"> - <div class="dailyBox"> - <div class="dailyTop"> - <el-select v-model="cityChoose" placeholder="���������"> - <el-option + <div class="dailyreport"> + <div class="dailyBox"> + <div class="dailyTop"> + <!-- <el-select + v-model="cityChoose" + placeholder="���������������" + > + <el-option v-for="item in cityOptions" :key="item.value" :label="item.label" - :value="item.value"> - </el-option> - </el-select> - <el-date-picker + :value="item.value" + /> + </el-select> --> + <el-cascader + ref="myCascader" + v-model="newRegion" + placeholder="" + :options="options" + :props="{ checkStrictly: true }" + clearable + change-on-select + style="flex: 1" + @change="getCity" + /> + <el-select + v-model="equipChoose1" + placeholder="���������������" + > + <el-option + v-for="item in equipOptions1" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + <el-date-picker v-model="value1" type="daterange" align="right" @@ -18,241 +43,934 @@ range-separator="���" start-placeholder="������������" end-placeholder="������������" - :picker-options="pickerOptions1"> - </el-date-picker> - <el-input v-model="carInput" placeholder="������������������������" clearable style="width: 180px;display: inline-block"></el-input> - <el-button type="primary" @click="selectExport" style="margin-right: 10px;">������</el-button> - <el-button type="primary" @click="openBox=true" style="margin-left: 0">������</el-button> - <!-- <el-input v-model="carInput" placeholder="������������������������" clearable style="width: 180px;display: inline-block"></el-input>--> -<!-- <el-button type="primary" @click="carExport">���������������������</el-button>--> - </div> - <div class="dailyDown" style="overflow-y: auto"> - <el-card class="boxCard"> - <el-table + :picker-options="pickerOptions1" + /> + <el-select + v-if="equipChoose1==='car'" + v-model="carInput" + collapse-tags + multiple + clearable + placeholder="������������������" + style="width: 280px;display: inline-block" + > + <el-option + v-for="(item,index) in carMac" + :key="index" + :label="item.name" + :value="item.mac" + /> + </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" + :label="item.name" + :value="item.mac" + /> + </el-select> + <el-button + type="primary" + style="margin-right: 10px;" + @click="selectExport" + > + ������ + </el-button> + <el-button + type="primary" + style="margin-left: 0" + @click="upImgBtn" + > + ������ + </el-button> + <!-- <el-button type="primary" @click="exportDom">������demo</el-button>--> + </div> + <div + class="dailyDown" + style="overflow-y: auto" + > + <el-card class="boxCard"> + <div style="text-align: right;"> + <el-button + v-if="equipChoose1==='car'" + type="primary" + size="mini" + :disabled="handSelectData.length===0" + @click="expReport()" + > + ������ + </el-button> + <el-button + v-else + type="primary" + size="mini" + @click="exUAVReport()" + > + ������ + </el-button> + </div> + <el-table :data="tableData" - style="width: 100%;overflow-y: auto; height: 82%;"> - <el-table-column + style="width: 100%;overflow-y: auto; height: 82%;" + @selection-change="handleSelectionChange" + > + <el-table-column + type="selection" + align="center" + width="55" + /> + <el-table-column prop="name" + align="center" label="������������" - > - </el-table-column> - <el-table-column + /> + <el-table-column + prop="mac" + align="center" + label="mac" + /> + <el-table-column prop="time" + align="center" label="������������" - > - </el-table-column> - <el-table-column + /> + <el-table-column prop="date" + align="center" label="������������" - > - </el-table-column> - <el-table-column label="������"> - <template slot-scope="scope"> - <el-button type="text" size="medium" @click="expReport(scope.row)">������</el-button> - </template> - </el-table-column> - </el-table> - </el-card> + /> + <!-- <el-table-column + label="������ " + align="center" + > --> + <!-- <template slot-scope="scope"> + <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-card> + </div> </div> - </div> - <el-dialog title="������������" :visible.sync="openBox"> - <div class="openTop"> - <el-date-picker - v-model="value2" - align="right" - type="date" - placeholder="������������" - :picker-options="pickerOptions"> - </el-date-picker> - <el-input v-model="carInput2" placeholder="������������������������" clearable style="width: 180px;display: inline-block"></el-input> - </div> - <div class="uploadDiv" style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between"> - <el-upload + <el-dialog + title="������������" + :visible.sync="openBox" + > + <div class="openTop"> + <!-- <el-select + v-model="cityChoose2" + placeholder="���������������" + > + <el-option + v-for="item in cityOptions2" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> --> + <el-cascader + ref="myUpCascader" + v-model="newUpRegion" + placeholder="" + :options="options" + :props="{ checkStrictly: true }" + clearable + change-on-select + style="flex: 1" + @change="getUpCity" + /> + <el-select + v-model="equipChoose2" + placeholder="���������������" + > + <el-option + v-for="item in equipOptions2" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + <el-select + v-if="equipChoose2==='car'" + v-model="carInput2" + 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-select> + <el-select + v-else + v-model="planSelect2" + clearable + placeholder="������������������" + style="width: 180px;display: inline-block" + > + <el-option + v-for="(item, index) in planMac" + :key="index" + :label="item.name" + :value="item.mac" + /> + </el-select> + <el-input + v-if="equipChoose2==='car'" + v-model="areaInput3" + placeholder="���������������������" + clearable + style="width: 180px;display: inline-block" + /> + <el-input + v-else + v-model="planInput2" + placeholder="���������������������" + clearable + style="width: 180px;display: inline-block" + /> + <el-button + v-if="equipChoose2!=='car'" + type="primary" + @click="innerVisible = true" + > + ������������ + </el-button> + <div + v-if="equipChoose2==='car'" + class="dateTimeBox" + > + <div> + <el-date-picker + v-model="value2" + type="datetimerange" + range-separator="���" + start-placeholder="������������" + end-placeholder="������������" + :picker-options="value2Pic" + @change="value2Change" + /> + <el-button + style="padding: 6px 8px;" + :disabled="isDidAdd" + @click="addDate('add')" + > + + + </el-button> + <el-button + style="padding: 6px 10px;" + :disabled="isDisMinus" + @click="addDate('minus')" + > + - + </el-button> + </div> + <div :style="{display:dateTime2}"> + <el-date-picker + v-model="value3" + type="datetimerange" + range-separator="���" + start-placeholder="������������" + end-placeholder="������������" + :picker-options="value3Pic" + @change="value3Change" + /> + </div> + <div :style="{display:dateTime3}"> + <el-date-picker + v-model="value4" + type="datetimerange" + range-separator="���" + start-placeholder="������������" + end-placeholder="������������" + :picker-options="value4Pic" + @change="value4Change" + /> + </div> + </div> + <div v-else> + <el-date-picker + v-model="planUpTime" + type="date" + placeholder="������������" + /> + </div> + </div> + <div + v-if="equipChoose2==='car'" + class="uploadDiv" + style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between" + > + <el-upload + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange1" :on-remove="handleRemove1" :file-list="fileList1" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������������������������������</div> - <!-- <div slot="tip" class="el-upload__tip">������������jpg/png���������������������500kb</div>--> - </el-upload> - <el-upload + :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 + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange2" :on-remove="handleRemove2" :file-list="fileList2" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������PM2.5������������������</div> - </el-upload> - <el-upload + :auto-upload="false" + > + <el-button + slot="trigger" + type="primary" + size="small" + > + ������������ + </el-button> + <div + slot="tip" + class="el-upload__tip" + > + ���������PM2.5������������������ + </div> + </el-upload> + <el-upload + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange3" :on-remove="handleRemove3" :file-list="fileList3" + :limit="1" + :on-exceed="handleExceed" 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 + :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 + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange4" :on-remove="handleRemove4" :file-list="fileList4" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������NO2������������������</div> - </el-upload> - <el-upload + :auto-upload="false" + > + <el-button + slot="trigger" + type="primary" + size="small" + > + ������������ + </el-button> + <div + slot="tip" + class="el-upload__tip" + > + ���������NO2������������������ + </div> + </el-upload> + <el-upload + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange5" :on-remove="handleRemove5" :file-list="fileList5" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������CO������������������</div> - </el-upload> - <el-upload + :auto-upload="false" + > + <el-button + slot="trigger" + type="primary" + size="small" + > + ������������ + </el-button> + <div + slot="tip" + class="el-upload__tip" + > + ���������CO������������������ + </div> + </el-upload> + <el-upload + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange6" :on-remove="handleRemove6" :file-list="fileList6" + :limit="1" + :on-exceed="handleExceed" 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 + :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 + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange7" :on-remove="handleRemove7" :file-list="fileList7" + :limit="1" + :on-exceed="handleExceed" 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 + :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 + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange8" :on-remove="handleRemove8" :file-list="fileList8" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������VOCs������������������</div> - </el-upload> - <el-upload + :auto-upload="false" + > + <el-button + slot="trigger" + type="primary" + size="small" + > + ������������ + </el-button> + <div + slot="tip" + class="el-upload__tip" + > + ���������VOCs������������������ + </div> + </el-upload> + <el-upload + ref="upload" class="upload-demo" action="" - ref="upload" :on-change="handleChange9" :on-remove="handleRemove9" :file-list="fileList9" + :limit="1" + :on-exceed="handleExceed" multiple - :auto-upload="false"> - <el-button slot="trigger" type="primary" size="small">������������</el-button> - <div slot="tip" class="el-upload__tip">���������������������</div> - </el-upload> - </div> - <div slot="footer" class="dialog-footer"> - <el-button @click="openBox = false">��� ���</el-button> -<!-- <el-button class="btnPosition" type="primary" plain @click="submitImgs">������</el-button>--> - <el-button type="primary" @click="submitImgs">��� ���</el-button> - </div> - </el-dialog> -</div> + :auto-upload="false" + > + <el-button + slot="trigger" + type="primary" + size="small" + > + ������������ + </el-button> + <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 + ref="uploadPlan1" + class="upload-demo" + action="" + :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 + ref="uploadPlan2" + class="upload-demo" + action="" + :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 + ref="uploadPlan3" + class="upload-demo" + action="" + :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 + ref="uploadPlan4" + class="upload-demo" + action="" + :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 + ref="uploadPlan5" + class="upload-demo" + action="" + :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 + ref="uploadPlan6" + class="upload-demo" + action="" + :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 + ref="uploadPlan7" + class="upload-demo" + action="" + :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 + ref="uploadPlan8" + class="upload-demo" + action="" + :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 + ref="uploadPlan9" + class="upload-demo" + action="" + :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" + :disabled="isDisplay" + @click="submitImgs" + > + ��� ��� + </el-button> + </div> + <el-dialog + class="innerDialog" + width="70%" + height="90%" + margin-top="7vh" + title="������ Dialog" + :visible.sync="innerVisible" + append-to-body + > + <Map /> + </el-dialog> + </el-dialog> + </div> </template> <script> -// import { exportDocx } from '@/utils/exportDocx' -import { exportDocx } from '@/utils/exportImageFile' +// import { exportDocx } from '@/utils/exportImageFile' +import { exportUAVImage } from '@/utils/exportUAVImage' import requestObj from '@/utils/request' +import Map from '@/components/PlanMap/Map' export default { - data() { + components: { Map }, + data () { return { - cityChoose: 'gx', // ������������������������������ - cityOptions: [{ - value: 'gx', - label: '���������' + handSelectData: [], + options: [], + newRegion: [], + newUpRegion: [], + cityForm: {}, + cityUpForm: {}, + cityChoose: '', // ������������������������������ + cityChoose2: '', // ��������������������������� + equipChoose1: 'car', + equipChoose2: 'car', + equipOptions1: [{ + value: 'car', + label: '���������' + }, { + value: 'plan', + label: '���������' }], - carInput: '', // ������������������������������ + equipOptions2: [{ + value: 'car', + label: '���������' + }, { + value: 'plan', + label: '���������' + }], carInput2: '', // ������������������������������ + carMac: [], // ���������mac������ + carInput: [], // ������������������������������ + areaInput3: '', // ������������ value1: [new Date(), new Date()], // ������������������ - value2: new Date(), // ������������ + value2: [new Date(), new Date()], // ������������1 + value3: [], // ������������2 + value4: [], // ������������3 + planUpTime: new Date(), // ��������������������� pickerOptions1: { shortcuts: [{ text: '������������', - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); - picker.$emit('pick', [start, end]); + onClick (picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', [start, end]) } }, { text: '���������������', - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); - picker.$emit('pick', [start, end]); + onClick (picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + picker.$emit('pick', [start, end]) } }, { text: '���������������', - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); - picker.$emit('pick', [start, end]); + onClick (picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + picker.$emit('pick', [start, end]) } }] }, pickerOptions: { // ��������� - disabledDate(time) { + disabledDate (time) { return time.getTime() > Date.now() }, shortcuts: [{ text: '������', - onClick(picker) { + onClick (picker) { picker.$emit('pick', new Date()) } }, { text: '������', - onClick(picker) { + onClick (picker) { const date = new Date() date.setTime(date.getTime() - 3600 * 1000 * 24) picker.$emit('pick', date) } }, { text: '���������', - onClick(picker) { + onClick (picker) { const date = new Date() date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) picker.$emit('pick', date) } }] + }, + carMacArr: [{ + value: 'p5dnd7a0243624', + label: '���������������' + }, { + value: 'p5dnd7a0243622', + label: '���������622' + }, { + value: 'p5dnd7a0243625', + label: '���������625' + }], + timeOne: '', + timeTwo: '', + timeThree: '', + value2Pic: { + 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() + } + } + }, + value3Pic: { + onPick: ({ maxDate, minDate }) => { + // ������������ ������������ + this.timeTwo = minDate.getTime() // ��������������������� ������������������ + // ������������������������������������������������������������ + if (maxDate) this.timeTwo = '' + }, + disabledDate: time => { + if (this.timeTwo) { + const WEEK = 3 * 24 * 3600 * 1000 - 1 // ������������3���������1��������� ������3��������� + const minTime = this.timeTwo// ������������ + const maxTime = this.timeTwo + WEEK // ������������ + return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date() + } else { + return time.getTime() > new Date() + } + } + }, + value4Pic: { + onPick: ({ maxDate, minDate }) => { + // ������������ ������������ + this.timeThree = minDate.getTime() // ��������������������� ������������������ + // ������������������������������������������������������������ + if (maxDate) this.timeThree = '' + }, + disabledDate: time => { + if (this.timeThree) { + const WEEK = 3 * 24 * 3600 * 1000 - 1 // ������������3���������1��������� ������3��������� + const minTime = this.timeThree// ������������ + const maxTime = this.timeThree + WEEK // ������������ + return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date() + } else { + return time.getTime() > new Date() + } + } }, selectTime: [], upTime: [], @@ -268,127 +986,453 @@ fileLists: [[], [], [], [], [], [], [], [], []], sailingReport: { fileLists: [ - // fileList1: [], - // fileList2: [], - // fileList3: [], - // fileList4: [], - // fileList5: [], - // fileList6: [], - // fileList7: [], - // fileList8: [], - // fileList9: [] [], [], [], [], [], [], [], [], [] ], - index: 5, + index: 0, fileList: [] }, openBox: false, // ������������������ // tableData: [] - tableData: [{ - date: '2016-05-02', - name: '���������', - time: '������������������������������ 1518 ���' - }, { - date: '2016-05-04', - name: '���������', - time: '������������������������������ 1517 ���' - }, { - date: '2016-05-01', - name: '���������', - time: '������������������������������ 1519 ���' - }, { - date: '2016-05-03', - name: '���������', - time: '������������������������������ 1516 ���' - }], + tableData: [], urlList: [], - numList: [0, 0, 0, 0, 0, 0, 0, 0, 0] + numList: [0, 0, 0, 0, 0, 0, 0, 0, 0], + isDisplay: false, + dateTime2: 'none', + dateTime3: 'none', + isDidAdd: false, // ��������������� + isDisMinus: true, // ��������������� + planSelect: '', // ������������������������ + planSelect2: '', // ������������������������ + planMac: [], // ��������������� + planInput: '', // ��������������������������� + planInput2: '', // ��������������������������� + innerVisible: false, // ������������������������ + radioSeven: 'PM2.5', + fileListPlan1: [], + fileListPlan2: [], + fileListPlan3: [], + fileListPlan4: [], + fileListPlan5: [], + fileListPlan6: [], + fileListPlan7: [], + fileListPlan8: [], + fileListPlan9: [], + fileBase64Plan1: [], + fileBase64Plan2: [], + fileBase64Plan3: [], + fileBase64Plan4: [], + fileBase64Plan5: [], + fileBase64Plan6: [], + fileBase64Plan7: [], + fileBase64Plan8: [], + fileBase64Plan9: [], + UAVReport: { + fileLists: [], + }, // ��������������� } }, + watch: { + value1 (n, o) { + if (n === null) { + this.value1 = [] + } + }, + value2 (n, o) { + if (n === null) { + this.value2 = [] + } + }, + value3 (n, o) { + if (n === null) { + this.value3 = [] + } + }, + value4 (n, o) { + 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.getRegion() + // ��������������� + this.$request({ + url: 'cruiser/selectCruisers', + method: 'get' + }).then(res => { + this.carMac = res.data + this.planMac = res.data // ������������������������������������ + }).catch(err => { + console.log(err) + }) + }, methods: { - // ��������������������� - selectExport() { - this.upTime = this.newTime(this.value1) + getCity () { + console.log('this.$refs.myCascader.getCheckedNodes()[0]', this.$refs.myCascader.getCheckedNodes()[0]) + if (this.newRegion.length > 0) { // ������������������������������change������������������������������������������������������������������������������ + const { label: org, value: orgid } = + this.$refs.myCascader.getCheckedNodes()[0] + this.cityForm = { org, orgid } + console.log('this.cityForm', this.cityForm) + this.cityChoose = orgid + } else { + this.cityForm = {} + this.cityChoose = '' + } + }, + getUpCity () { + if (this.newUpRegion.length > 0) { // ������������������������������change������������������������������������������������������������������������������ + const { label: org, value: orgid } = + this.$refs.myUpCascader.getCheckedNodes()[0] + this.cityUpForm = { org, orgid } + console.log('this.cityUpForm', this.cityUpForm) + this.cityChoose2 = orgid + } else { + this.cityUpForm = {} + this.cityChoose2 = '' + } + }, + getRegion () { this.$request({ - url: '', + url: '/organization/getMapPath', method: 'get', params: { - startTime: this.upTime[0], - endTime: this.upTime[1], - mac: this.carInput + organizationId: this.$store.state.orgId } - }).then(res => { - console.log(res) - var info = res.data - info.map(v => { - var time = v.time.split('-').json('') - v.name = `���������������������${time}` - }) - }).catch(err => { - console.log(err) }) + .then((res) => { + const data = res.data + for (let i = 0; i < data.length; i++) { + this.options.push({ + value: data[i].provinceCode, + label: data[i].provinceName + }) + this.options[i].children = [] + for (let j = 0; j < data[i].cities.length; j++) { + this.options[i].children.push({ + value: data[i].cities[j].cityCode, + label: data[i].cities[j].cityName + }) + // ��������������������� + if (data[i].cities[j].cityCode !== 320900) { + this.options[i].children[j].children = [] + for (let k = 0; k < data[i].cities[j].areas.length; k++) { + this.options[i].children[j].children.push({ + value: data[i].cities[j].areas[k].areaCode, + label: data[i].cities[j].areas[k].areaName + }) + } + } + } + } + }) + .catch((err) => { + // console.log('������Region������') + console.log(err) + }) + // console.log('������Region������') }, - // ��������������������� - carExport() { - 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/178d92d1-4729-4019-9b60-776a8c8653ac.jpg` - // console.log(url, 'url') - this.sailingReport.fileLists[0].push({ url: url1 }) - this.sailingReport.fileLists[0].push({ url: url1 }) - this.sailingReport.fileLists[1].push({ url: url2 }) - this.sailingReport.fileLists[1].push({ url: url2 }) - this.sailingReport.fileLists[2].push({ url: url2 }) - this.sailingReport.city = '���������' - // console.log(this.sailingReport.fileLists, 'this.sailingReport.fileLists') - this.sailingReport.fileList.push({ url: url1 }) - this.sailingReport.fileList.push({ url: url2 }) - exportDocx('/sailingReport.docx', this.sailingReport, `���������������.docx`) + handleSelectionChange (e) { + this.handSelectData = e.map(i => i.id) + console.log('this.handSelectData', this.handSelectData) + }, + // ������������ + exportDom () { + 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 () { + console.log(this.carInput) + this.selectTime = this.newTime(this.value1) + if (this.cityChoose && this.equipChoose1 && this.selectTime[1]) { + // ���������������or��������� + var mac = null + if (this.equipChoose1 === 'car') { + mac = this.carInput.join(',') + } else { + mac = this.planSelect + } + this.$request({ + url: '/cruiser/selectDaily', + method: 'get', + params: { + code: this.cityChoose, + type: this.equipChoose1, + startTime: this.selectTime[0], + endTime: this.selectTime[1], + mac: mac + } + }).then(res => { + this.carInput2 = this.carInput + var info = res.data + if (info.length === 0) { + this.$message('������������') + this.tableData = info + return + } + info.map(v => { + var time = v.time.split('-').join('') + + // if (this.cityChoose === 'gx') { + // v.name = `���������������������������${time}` + // } else if (this.cityChoose === 'yc') { + // v.name = `���������������������������${time}` + // } else { + // v.name = `���������������������������${time}` + // } + v.name = this.cityForm.org + `${time}` + }) + info.sort((a, b) => { return b.time.split('-').join('') - a.time.split('-').join('') }) + this.tableData = info + }).catch(err => { + console.log(err) + }) + } else { + this.$message('���������������') + } }, // ������������ - submitImgs() { - // ������������ - this.openBox = false - 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] - console.log(this.numList, 'this.numList') - this.upTime = this.newTime(this.value2, 'submit') - const formData = new FormData() - formData.append(`code`, this.cityOptions) - formData.append(`time`, this.upTime) - formData.append(`mac`, this.carInput2) - this.fileLists.map(v => { - v.map(item => { - formData.append(`files`, item.raw) + submitImgs () { + 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] + var num = 0 + this.numList.map(v => { + if (v > 0) { + num++ + } }) - }) - // this.MultipartFile(formData).then(res => { - // console.log(res) - // if (res.code === 0) { - // this.$message({ - // message: '���������������', - // type: 'success' - // }) - // var reportInfo = res.data - // this.value1 = [this.value2, this.value2] - // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') - // this.tableData = [reportInfo] - // } else { - // this.$message.error('���������������') - // } - // }).catch(err => { - // console.log(err) - // }) + 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) + formData.append(`type`, this.equipChoose2) + formData.append(`mac`, this.carInput2) + formData.append(`area`, this.areaInput3) + formData.append(`time1`, this.upTime[0]) + formData.append(`time2`, this.upTime[1]) + var upTime2 = [] + var upTime3 = [] + if (this.dateTime2 === 'block' && this.value3.length) { // ��������������������������� + upTime2 = this.newTime(this.value3, 'submit') + formData.append(`time3`, upTime2[0]) + formData.append(`time4`, upTime2[1]) + } + if (this.dateTime3 === 'block' && this.value4.length) { // ��������������������������� + upTime3 = this.newTime(this.value4, 'submit') + formData.append(`time5`, upTime3[0]) + formData.append(`time6`, upTime3[1]) + } + this.fileLists.map(v => { + v.map(item => { + formData.append(`files`, item.raw) + }) + }) + // ������������ + this.openBox = false + this.MultipartFile(formData).then(res => { + this.isDisplay = false + if (res.code === 0) { + this.$message({ + message: '���������������', + type: 'success' + }) + 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 + // if (this.cityChoose2 === 'gx') { + // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') + // } else if (this.cityChoose === 'yc') { + // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') + // } else { + // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') + // } + reportInfo.name = this.cityForm.org + '������������������' + 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('���������������') + } + } 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') + // const formData = new FormData() + // formData.append(`objJson`, objJson) + // ������������ + this.openBox = false + this.$request({ + url: 'uav/getUavDaily', + // data: formData, + data: { objJson: objJson }, + method: 'post', + contentType: 'application/json' + }).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 if (this.cityChoose === 'yc') { + // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') + // } else { + // reportInfo.name = '���������������������������' + reportInfo.time.split('-').join('') + // } + reportInfo.name = this.cityForm.org + '������������������' + 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('���������������') + } }, // ������������������������ - MultipartFile(data) { + MultipartFile (data) { return this.$request({ - url: '', + url: '/cruiser/getDaily', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, // ��������������������������������� data }) }, - // ������������ - expReport(obj) { + // ��������������������� + expReport (obj) { + this.$request({ + url: '/cruiser/loadDaily', + method: 'post', + responseType: 'blob', + data: { + ids: this.handSelectData + } + }).then(res => { + // if (this.cityChoose === 'gx') { + // this.sailingReport.city = '���������' + // } else if (this.cityChoose === 'yc') { + // this.sailingReport.city = '���������' + // } else { + // this.sailingReport.city = '���������' + // } + this.sailingReport.city = this.cityForm.org + this.getOutExcel(`${this.sailingReport.city}.docx`, res) + }).catch(err => { + console.log(err) + }) + }, + getOutExcel (fileName, res) { + const blob = new Blob([res], { type: 'application/msword' }) + if (window.navigator.msSaveOrOpenBlob) { + // ������ IE & EDGE + navigator.msSaveBlob(blob, fileName) + } else { + var link = document.createElement('a') + // ������������������������URL������ + const url = window.URL || window.webkitURL || window.moxURL + // ������������������ + link.href = url.createObjectURL(blob) + // ������������������ + link.download = fileName + // ������������������ + link.click() + // ������������������������ + url.revokeObjectURL(link.href) + } + }, + // ��������������������� + exUAVReport (obj) { this.$request({ url: '', method: 'get', @@ -396,24 +1440,183 @@ id: obj.id } }).then(res => { - console.log(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 === 'yc') { + // this.UAVReport.city = '���������' + // } else if (this.cityChoose === 'gx') { + // this.UAVReport.city = '���������' + // } else { + // this.UAVReport.city = '���������' + // } + this.UAVReport.city = this.cityForm.org + exportUAVImage('/UAVReport.docx', this.UAVReport, `${obj.name}.docx`) }).catch(err => { console.log(err) }) - exportDocx('/sailingReport.docx', this.sailingReport, `���������������������������.docx`) + }, + // ������������ + upImgBtn () { + this.openBox = true + this.isDisplay = false + }, + // ��������������������������������� + addDate (name) { + if (name === 'add') { // ��� + if (this.dateTime2 === 'none') { // ������dateTime2 + this.dateTime2 = 'block' + this.value3 = [new Date(), new Date()] + this.isDisMinus = false + } else if (this.dateTime2 === 'block' && this.dateTime3 === 'none') { // ������dateTime3 + this.dateTime3 = 'block' + this.value4 = [new Date(), new Date()] + this.isDidAdd = true + } else { // dateTime2���dateTime3������������ + this.isDidAdd = true + } + } else { // ��� + if (this.dateTime3 === 'block') { + this.dateTime3 = 'none' + this.isDidAdd = false + this.value4 = [] + } else if (this.dateTime3 === 'none' && this.dateTime2 === 'block') { + this.value3 = [] + this.dateTime2 = 'none' + this.isDisMinus = true + } else { // dateTime2���dateTime3��������������� + this.isDisMinus = true + this.isDidAdd = false + } + } + }, + // value2���������������������value3���value4 + value2Change (e) { + var time2 = [] + var time3 = [] + var time4 = [] + if (this.value2 !== null) { + if (this.value3.length && this.value4.length) { // value3���value4��������� + for (let i = 0; i < 2; i++) { + time2.push(e[i].getTime()) + time3.push(this.value3[i].getTime()) + time4.push(this.value4[i].getTime()) + } + if (!(time2[0] > time4[1] || time2[1] < time4[0]) || !(time2[0] > time3[1] || time2[1] < time3[0])) { // ��������� + this.value2 = [] + this.$message('���������������������������������') + } + } else if (this.value3.length) { // ������value3������ + for (let i = 0; i < 2; i++) { + time3.push(this.value3[i].getTime()) + time2.push(e[i].getTime()) + } + if (!(time2[0] > time3[1] || time2[1] < time3[0])) { // ��������� + this.value2 = [] + this.$message('���������������������������������') + } + } else if (this.value4.length) { // ������value3������ + for (let i = 0; i < 2; i++) { + time4.push(this.value4[i].getTime()) + time2.push(e[i].getTime()) + } + if (!(time2[0] > time4[1] || time2[1] < time4[0])) { // ��������� + this.value2 = [] + this.$message('���������������������������������') + } + } + } + }, + // value3������������������������value2���������,���������value2������ + value3Change (e) { + if (this.value3 !== null) { + if (this.value2.length) { + var time2 = [] + var time3 = [] + for (let i = 0; i < 2; i++) { + time3.push(e[i].getTime()) + time2.push(this.value2[i].getTime()) + } + if (!(time3[0] > time2[1] || time3[1] < time2[0])) { // ��������� + this.value3 = [] + this.$message('���������������������������������') + } + } else { + this.value3 = [] + this.$message('���������������������������') + } + } + }, + // value4������������������������value2���value3��������� + value4Change (e) { + if (this.value4 !== null) { + if (this.value2.length && this.value3.length) { + var time2 = [] + var time3 = [] + var time4 = [] + for (let i = 0; i < 2; i++) { + time2.push(this.value2[i].getTime()) + time3.push(this.value3[i].getTime()) + time4.push(this.value4[i].getTime()) + } + if (!(time4[0] > time2[1] || time4[1] < time2[0]) || !(time4[0] > time3[1] || time4[1] < time3[0])) { // ��������� + this.value4 = [] + this.$message('���������������������������������') + } + } else { + this.value4 = [] + this.$message('���������������������������������') + } + } }, // ������������������������������0��� - newTime(timeArr, name) { + newTime (timeArr, name) { + var arr = [] if (name === 'submit') { - var date = new Date(timeArr) - 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 - } else { - var arr = [] timeArr.map(v => { var date = new Date(v) var y = date.getFullYear() @@ -428,99 +1631,300 @@ var s = date.getSeconds() s = s < 10 ? '0' + s : s arr.push(y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s) - // arr.push(y + '-' + m + '-' + d) + }) + return arr + } else { + 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 + arr.push(y + '-' + m + '-' + d) }) return arr } }, - // ���������������upload - handleChange1(file, fileList) { - console.log(file, fileList) + // ������������������������������������ + 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 = '' + reader.readAsDataURL(file) + reader.onload = function () { + imgResult = reader.result + } + reader.onerror = function (error) { + reject(error) + } + reader.onloadend = function () { + resolve(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 + handleChange1 (file, fileList) { this.fileList1 = fileList this.fileLists[0] = fileList }, - handleRemove1(file, fileList) { - console.log(file, fileList) + handleRemove1 (file, fileList) { this.fileList1 = fileList this.fileLists[0] = fileList }, - handleChange2(file, fileList) { - console.log(file, fileList) + handleChange2 (file, fileList) { this.fileList2 = fileList this.fileLists[1] = fileList }, - handleRemove2(file, fileList) { - console.log(file, fileList) + handleRemove2 (file, fileList) { this.fileList2 = fileList this.fileLists[1] = fileList }, - handleChange3(file, fileList) { - console.log(file, fileList) + handleChange3 (file, fileList) { this.fileList3 = fileList this.fileLists[2] = fileList }, - handleRemove3(file, fileList) { - console.log(file, fileList) + handleRemove3 (file, fileList) { this.fileList3 = fileList this.fileLists[2] = fileList }, - handleChange4(file, fileList) { - console.log(file, fileList) + handleChange4 (file, fileList) { this.fileList4 = fileList this.fileLists[3] = fileList }, - handleRemove4(file, fileList) { - console.log(file, fileList) + handleRemove4 (file, fileList) { this.fileList4 = fileList this.fileLists[3] = fileList }, - handleChange5(file, fileList) { - console.log(file, fileList) + handleChange5 (file, fileList) { this.fileList5 = fileList this.fileLists[4] = fileList }, - handleRemove5(file, fileList) { - console.log(file, fileList) + handleRemove5 (file, fileList) { this.fileList5 = fileList this.fileLists[4] = fileList }, - handleChange6(file, fileList) { - console.log(file, fileList) + handleChange6 (file, fileList) { this.fileList6 = fileList this.fileLists[5] = fileList }, - handleRemove6(file, fileList) { - console.log(file, fileList) + handleRemove6 (file, fileList) { this.fileList6 = fileList this.fileLists[5] = fileList }, - handleChange7(file, fileList) { - console.log(file, fileList) + handleChange7 (file, fileList) { this.fileList7 = fileList this.fileLists[6] = fileList }, - handleRemove7(file, fileList) { - console.log(file, fileList) + handleRemove7 (file, fileList) { this.fileList7 = fileList this.fileLists[6] = fileList }, - handleChange8(file, fileList) { - console.log(file, fileList) + handleChange8 (file, fileList) { this.fileList8 = fileList this.fileLists[7] = fileList }, - handleRemove8(file, fileList) { - console.log(file, fileList) + handleRemove8 (file, fileList) { this.fileList8 = fileList this.fileLists[7] = fileList }, - handleChange9(file, fileList) { - console.log(file, fileList) + handleChange9 (file, fileList) { this.fileList9 = fileList this.fileLists[8] = fileList }, - handleRemove9(file, fileList) { - console.log(file, fileList) + handleRemove9 (file, fileList) { this.fileList9 = fileList this.fileLists[8] = fileList } @@ -528,7 +1932,7 @@ } </script> -<style scoped> +<style scoped > .dailyreport{ width: 100%; height: 100%; @@ -538,9 +1942,9 @@ width: 0; } .dailyTop{ - width: 80%; + text-align: center; margin:auto; - padding: 1%; + padding: 10px 0; margin-bottom: 3%; } .dailyDown{ @@ -637,5 +2041,12 @@ } .openTop>div{ margin-right: 15px; + margin-bottom: 15px; +} +.dateTimeBox>div{ + margin-bottom: 10px; +} +.innerDialog /deep/ .el-dialog__body{ + height: 90%; } </style> -- Gitblit v1.8.0