From 6923da6e4a6e5f34d610a6bb70f14f9ffe02cee0 Mon Sep 17 00:00:00 2001 From: guoshipeng <3194674006@qq.com> Date: Thu, 13 Jul 2023 17:20:47 +0800 Subject: [PATCH] fix --- src/utils/request.js | 1 src/views/air/index.vue | 1021 +++++++++++++++++++++++++++++--------------------- src/components/Wind/Map.vue | 7 src/views/Listdata/index.vue | 103 ++++ src/views/UVA/index.vue | 3 src/views/dailyreport/index.vue | 2 src/views/car/index.vue | 47 - src/views/charts/index.vue | 1 8 files changed, 718 insertions(+), 467 deletions(-) diff --git a/src/components/Wind/Map.vue b/src/components/Wind/Map.vue index 1f6858f..6e7ac77 100644 --- a/src/components/Wind/Map.vue +++ b/src/components/Wind/Map.vue @@ -1013,7 +1013,7 @@ }, }).then((data) => { // console.log('���������������������') - console.log(data,'tata') + console.log(data, 'tata') that.loading = false this.markDeviceSite(data) }) @@ -1368,6 +1368,11 @@ }, }) .then((res) => { + if (res.message == '���������������������') { + var datafalse = '���������������������' + this.bindPopup(datafalse).openPopup() + return + } for (const key in res.data) { var tempDecimal = res.data[key] .replace(/[^\d.]/g, '') diff --git a/src/utils/request.js b/src/utils/request.js index 1f252a9..5982c31 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,6 +8,7 @@ // const baseUrl = 'http://192.168.0.25:8081' // jj // const baseUrl = 'http://192.168.0.28:8081/'// cjl // const baseUrl = 'http://192.168.0.11:8081/' // new swb +// const baseUrl = 'http://47.96.171.62:8081/'//������������ // const baseUrl = 'http://121.43.179.139:8080' // const baseUrl = 'http://192.168.0.33:8085/' // const baseUrl = 'http://192.168.0.33:8081/' diff --git a/src/views/Listdata/index.vue b/src/views/Listdata/index.vue index d065d2c..acc59f9 100644 --- a/src/views/Listdata/index.vue +++ b/src/views/Listdata/index.vue @@ -55,10 +55,30 @@ class="select11" /> - <el-button type="primary" @click="toExcel()" style="margin-left: 20px" + <!-- <el-button type="primary" @click="toExcel()" style="margin-left: 20px" >������</el-button + > --> + <!-- <el-dropdown @command="handleCommand"> + <el-button type="primary" @click="toExcel()" style="margin-left: 20px" + >������<i class="el-icon-arrow-down el-icon--right"></i + ></el-button> + <el-dropdown-menu slot="dropdown"> + <el-dropdown-item command="expNew">������(���)</el-dropdown-item> + </el-dropdown-menu> + </el-dropdown> --> + <el-dropdown + split-button + type="primary" + @click="toExcel()" + @command="handleCommand" + style="margin-left: 20px" > - <el-button @click="exportMon">������</el-button> + ������ + <el-dropdown-menu slot="dropdown"> + <el-dropdown-item command="expNew">������(���)</el-dropdown-item> + </el-dropdown-menu> + </el-dropdown> + <el-button @click="exportMon" style="margin-left: 10px">������</el-button> </div> <el-table :data="dateList" @@ -75,6 +95,14 @@ :key="item" > </el-table-column> + <!-- <el-table-column + v-for="item in columnList" + :prop="item.props" + :label="item.label" + width="180px" + :key="item.label" + > + </el-table-column> --> </el-table> </div> </template> @@ -175,9 +203,6 @@ // ������������ - ��������������������������������� this ��������� created() { this.getData() - // for (let key in this.timess[0]) { - // this.columnList.push(key) - // } }, // ������������ - ��������������������������� DOM ��������� // mounted() { @@ -192,6 +217,53 @@ activated() {}, // ������������ methods: { + handleCommand(command) { + if (this.newMac1 == '') { + this.$message.warning('���������������') + return + } + if (this.value == '') { + this.$message.warning('���������������') + return + } + this.dateList = [] + this.columnList = [] + this.$request({ + url: 'monitorPoint/exlOut', + method: 'post', + data: { + macs: this.newMac1, + sensors: this.value.toString(), + // startTime: this.timevalue[0], + // endTime: this.timevalue[1], + type: this.unit, + times: this.newData instanceof Array ? this.newData : [this.newData], + }, + responseType: 'blob', + }).then((res) => { + console.log('������������', res) + this.getOutExcel('������������������.xlsx', res) + }) + }, + getOutExcel(fileName, res) { + let blob = new Blob([res], { type: 'application/x-xls' }) + 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) + } + }, showPickerChild(data) { this.newData = data }, @@ -251,7 +323,6 @@ }) }, exportMon() { - console.log(this.timevalue) if (this.newMac1 == '') { this.$message.warning('���������������') return @@ -274,15 +345,31 @@ times: this.newData instanceof Array ? this.newData : [this.newData], }, }).then((res) => { - console.log(res, 11) + //console.log(res, 11) this.tableData = res.data - // console.log(this.tableData, 'this.tableData') for (let key in this.tableData[0]) { this.columnList.push(key) } for (let item of this.tableData) { this.dateList.push(item) } + // this.tableData = res.data + // for (let key in this.tableData[0]) { + // let prop = key + // if (String(key).indexOf('.') > -1) { + // prop = key.replace(/\./g, '') + // } + // this.columnList.push({ label: key, props: prop }) + // } + // for (let item of this.tableData) { + // for (let key in this.tableData[0]) { + // if (String(key).indexOf('.') > -1) { + // let newKey = key.replace(/\./g, '') + // item[newKey] = item[key] + // } + // } + // this.dateList.push(item) + // } }) }, toExcel() { diff --git a/src/views/UVA/index.vue b/src/views/UVA/index.vue index af5b819..afaad8e 100644 --- a/src/views/UVA/index.vue +++ b/src/views/UVA/index.vue @@ -21,7 +21,7 @@ margin-left: 10px; " >���������������������</span - > + >zzzz </div> </div> <el-scrollbar @@ -1687,3 +1687,4 @@ font-family: '������������'; } </style> + diff --git a/src/views/air/index.vue b/src/views/air/index.vue index 8ff9831..e01af93 100644 --- a/src/views/air/index.vue +++ b/src/views/air/index.vue @@ -1,144 +1,186 @@ <template> <div class="analyseAir"> -<!-- ������--> + <!-- ������--> <div class="exTop"> <div class="cascader-demo"> <el-select v-model="value" clearable placeholder="���������������"> <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value"> + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + > </el-option> </el-select> </div> <el-date-picker - v-model="value3" - style="margin-right: 5%" - align="right" - type="date" - placeholder="������������"> + v-model="value3" + style="margin-right: 5%" + align="right" + type="date" + placeholder="������������" + > </el-date-picker> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload1" - action="" - accept="xlsx" - :on-change="handleChange" - :on-remove="handleRemove" - :file-list="fileList" - :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" v-if="value==='gx'">������������������������������</div> + v-if="value === 'gx'" + class="upload-demo" + ref="upload1" + action="" + accept="xlsx" + :on-change="handleChange" + :on-remove="handleRemove" + :file-list="fileList" + :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" v-if="value === 'gx'"> + ������������������������������ + </div> <div slot="tip" class="el-upload__tip" v-else></div> </el-upload> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload2" - action="" - accept="xlsx" - :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" v-if="value==='gx'">���������������������������</div> + v-if="value === 'gx'" + class="upload-demo" + ref="upload2" + action="" + accept="xlsx" + :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" v-if="value === 'gx'"> + ��������������������������� + </div> <div slot="tip" class="el-upload__tip" v-else></div> </el-upload> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload3" - action="" - accept="xlsx" - :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" v-if="value==='gx'">���������������������������</div> + v-if="value === 'gx'" + class="upload-demo" + ref="upload3" + action="" + accept="xlsx" + :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" v-if="value === 'gx'"> + ��������������������������� + </div> <div slot="tip" class="el-upload__tip" v-else></div> </el-upload> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload4" - action="" - accept="xlsx" - :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" v-if="value==='gx'">������������������������������</div> + v-if="value === 'gx'" + class="upload-demo" + ref="upload4" + action="" + accept="xlsx" + :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" v-if="value === 'gx'"> + ������������������������������ + </div> <div slot="tip" class="el-upload__tip" v-else></div> </el-upload> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload5" - action="" - accept="xlsx" - :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" v-if="value==='gx'">������������������������</div> + v-if="value === 'gx'" + class="upload-demo" + ref="upload5" + action="" + accept="xlsx" + :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" v-if="value === 'gx'"> + ������������������������ + </div> <div slot="tip" class="el-upload__tip" v-else></div> </el-upload> <el-upload - v-if="value==='gx'" - class="upload-demo" - ref="upload6" - action="" - accept="xlsx" - :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> + v-if="value === 'gx'" + class="upload-demo" + ref="upload6" + action="" + accept="xlsx" + :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">������������������������������</div> </el-upload> - <div v-if="value==='hn'" style="position: relative"> + <div v-if="value === 'hn'" style="position: relative"> <el-upload - class="upload-demo" - ref="upload7" - action="" - accept="xlsx" - :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">������������������������������������������AQI������</div> + class="upload-demo" + ref="upload7" + action="" + accept="xlsx" + :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"> + ������������������������������������������AQI������ + </div> </el-upload> - <el-button type="success" @click="submitUpload" :disabled="idDisabled" size="small" style="position: absolute;right: 20%;bottom: -100%">������������</el-button> + <el-button + type="success" + @click="submitUpload" + :disabled="idDisabled" + size="small" + style="position: absolute; right: 20%; bottom: -100%" + >������������</el-button + > </div> -<!-- <el-upload + <!-- <el-upload v-if="value==='gx'" class="upload-demo" ref="upload8" @@ -154,39 +196,51 @@ <el-button slot="trigger" type="primary" size="small">������������</el-button> <div slot="tip" class="el-upload__tip">������������</div> </el-upload>--> -<!-- <div style="position: absolute; bottom: 2%; right: 20%">--> - <div style="position: absolute; right: 20%;padding-top: 20px;"> - <el-button v-if="value==='gx'" type="success" @click="submitUpload" size="small">������������</el-button> + <!-- <div style="position: absolute; bottom: 2%; right: 20%">--> + <div style="position: absolute; right: 20%; padding-top: 20px"> + <el-button + v-if="value === 'gx'" + type="success" + @click="submitUpload" + size="small" + >������������</el-button + > </div> </div> <div class="exDown"> <el-card class="box-card" style="position: relative"> - <div class="block" style="margin-bottom: 30px;"> + <div class="block" style="margin-bottom: 30px"> <el-date-picker - v-model="value2" - type="daterange" - align="right" - unlink-panels - range-separator="���" - start-placeholder="������������" - end-placeholder="������������" - :picker-options="pickerOptions"> + v-model="value2" + type="daterange" + align="right" + unlink-panels + range-separator="���" + start-placeholder="������������" + end-placeholder="������������" + :picker-options="pickerOptions" + > </el-date-picker> <el-select v-model="valueSelect" clearable placeholder="���������������"> <el-option - v-for="item in optionsSelect" - :key="item.valueSelect" - :label="item.label" - :value="item.valueSelect"> + v-for="item in optionsSelect" + :key="item.valueSelect" + :label="item.label" + :value="item.valueSelect" + > </el-option> </el-select> - <el-button type="primary" @click="selectReport(1)" size="small" class="selectBtn">������</el-button> -<!-- <el-button type="primary" @click="selectReport" size="small" class="selectBtn">������������</el-button>--> + <el-button + type="primary" + @click="selectReport(1)" + size="small" + class="selectBtn" + >������</el-button + > + <!-- <el-button type="primary" @click="selectReport" size="small" class="selectBtn">������������</el-button>--> </div> - <div style="overflow-y: auto; height: 82%;margin-bottom: 2%;"> - <el-table - :data="tableData" - style="width: 100%"> + <div style="overflow-y: auto; height: 82%; margin-bottom: 2%"> + <el-table :data="tableData" style="width: 100%"> <!-- <el-table-column width="100" align="center"> @@ -202,41 +256,48 @@ @change="handleCheckOneChange(scope.row)"></el-checkbox> </template> </el-table-column>--> - <el-table-column - prop="name" - label="������������" - > - </el-table-column> - <el-table-column - prop="time" - label="������������" - > - </el-table-column> - <el-table-column - prop="date" - label="������������" - > - </el-table-column> + <el-table-column prop="name" label="������������"> </el-table-column> + <el-table-column prop="time" label="������������"> </el-table-column> + <el-table-column prop="date" label="������������"> </el-table-column> <el-table-column label="������"> <template slot-scope="scope"> - <el-button type="text" size="medium" v-if="valueSelect==='gx'" @click="expReport(scope.row)">������</el-button> + <el-button + type="text" + size="medium" + v-if="valueSelect === 'gx'" + @click="expReport(scope.row)" + >������</el-button + > <!--������excel--> - <img src="../../assets/icon/hn_excel.png" alt="������������excel" v-if="valueSelect==='hn'" @click="hnExcel(scope.row)" style="margin-left:0; cursor:pointer;"> + <img + src="../../assets/icon/hn_excel.png" + alt="������������excel" + v-if="valueSelect === 'hn'" + @click="hnExcel(scope.row)" + style="margin-left: 0; cursor: pointer" + /> <!--������word --> - <img src="../../assets/icon/hn_word.png" alt="���������������������������������" v-if="valueSelect==='hn'" @click="hnExpReport(scope.row)" style="cursor:pointer;"> + <img + src="../../assets/icon/hn_word.png" + alt="���������������������������������" + v-if="valueSelect === 'hn'" + @click="hnExpReport(scope.row)" + style="cursor: pointer" + /> </template> </el-table-column> </el-table> </div> <div class="block" v-if="isDisplay"> <el-pagination - background - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - :current-page.sync="currentPage3" - :page-size="onePageCount" - layout="total, prev, pager, next, jumper" - :total="totalNumber"> + background + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page.sync="currentPage3" + :page-size="onePageCount" + layout="total, prev, pager, next, jumper" + :total="totalNumber" + > </el-pagination> </div> </el-card> @@ -266,42 +327,47 @@ file7: null, file8: null, pickerOptions: { - 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]) - } - }, { - text: '���������������', - 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]) - } - }] + 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]) + }, + }, + { + text: '���������������', + 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]) + }, + }, + ], }, value2: [new Date(), new Date()], // ������������������������ value3: new Date(), // ��������������������������� options: [ { value: 'hn', - label: '���������' - }, { + label: '���������', + }, + { value: 'gx', - label: '���������' - } + label: '���������', + }, ], value: 'gx', // ������ valueSelect: 'gx', @@ -309,11 +375,12 @@ optionsSelect: [ { valueSelect: 'hn', - label: '���������' - }, { + label: '���������', + }, + { valueSelect: 'gx', - label: '���������' - } + label: '���������', + }, ], tableData: [], sensorTime: [], // ��������������������� @@ -331,7 +398,7 @@ currentPage3: 1, // ��������������� totalNumber: 0, // ��������� onePageCount: 8, // ��������������� - isDisplay: false // ������������������ + isDisplay: false, // ������������������ } }, watch: { @@ -342,7 +409,7 @@ }, valueSelect(newName, oldName) { this.tableData = [] - } + }, }, methods: { // ������ @@ -355,7 +422,10 @@ }, // ������ handleChange(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { this.$refs.upload1.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -368,7 +438,10 @@ this.file1 = fileList[0] }, handleChange2(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { this.$refs.upload2.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -381,7 +454,10 @@ this.file2 = fileList[0] }, handleChange3(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { this.$refs.upload3.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -394,7 +470,10 @@ this.file3 = fileList[0] }, handleChange4(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { this.$refs.upload4.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -407,7 +486,10 @@ this.file4 = fileList[0] }, handleChange5(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { this.$refs.upload5.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -420,7 +502,11 @@ this.file5 = fileList[0] }, handleChange6(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' && file.raw.type !== 'application/vnd.ms-excel') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' && + file.raw.type !== 'application/vnd.ms-excel' + ) { this.$refs.upload6.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -433,7 +519,11 @@ this.file6 = fileList[0] }, handleChange7(file, fileList) { - if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' && file.raw.type !== 'application/vnd.ms-excel') { + if ( + file.raw.type !== + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' && + file.raw.type !== 'application/vnd.ms-excel' + ) { this.$refs.upload7.handleRemove(file) this.$message.warning(`���������������������������`) return @@ -446,26 +536,39 @@ this.file7 = fileList[0] }, handleExceed(files, fileList) { - this.$message.warning(`������������������ 1 ��������������������������� ${files.length} ������������������������ ${files.length + fileList.length} ���������`) + this.$message.warning( + `������������������ 1 ��������������������������� ${files.length} ������������������������ ${ + files.length + fileList.length + } ���������` + ) }, submitUpload() { this.formData2 = [] if (!this.value3) { this.$message({ message: '���������������', - type: 'warning' + type: 'warning', }) return } - if (this.value === 'gx') { // ��������������������� + if (this.value === 'gx') { + // ��������������������� this.gxSubmit() - } else { // ��������������������� + } else { + // ��������������������� this.hnSubmit() } }, // ��������������������������� gxSubmit() { - if (this.file1 && this.file2 && this.file3 && this.file4 && this.file5 && this.file6) { + if ( + this.file1 && + this.file2 && + this.file3 && + this.file4 && + this.file5 && + this.file6 + ) { const formData = new FormData() formData.append(`code`, this.value) this.sensorTime = this.newTime(this.value3, 'submit') @@ -482,20 +585,24 @@ // formData.append(`file7`, this.file7.raw) // formData.append(`file8`, this.file8.raw) // ������������������ - this.MultipartFile(formData).then(res => { - if (res.code === 0) { - var reportInfo = res.data - this.value2 = [this.value3, this.value3] - reportInfo.name = '���������������������������������������' + reportInfo.time.split('-').join('') - this.tableData = [reportInfo] - } - }).catch(err => { - console.log(err) - }) + this.MultipartFile(formData) + .then((res) => { + if (res.code === 0) { + var reportInfo = res.data + this.value2 = [this.value3, this.value3] + reportInfo.name = + '���������������������������������������' + + reportInfo.time.split('-').join('') + this.tableData = [reportInfo] + } + }) + .catch((err) => { + console.log(err) + }) } else { this.$message({ message: '���������������������������', - type: 'warning' + type: 'warning', }) } }, @@ -511,27 +618,30 @@ formData.append(`date`, date) formData.append(`files`, this.file7.raw) // ������������������ - this.MultipartFile(formData).then(res => { - this.idDisabled = false - if (res.code === 0) { - this.$message({ - message: '���������������', - type: 'success' - }) - var reportInfo = res.data - this.value2 = [this.value3, this.value3] - reportInfo.name = '���������������' + reportInfo.time.split('-').join('') - this.tableData = [reportInfo] - } else { - this.$message.error('���������������') - } - }).catch(err => { - console.log(err) - }) + this.MultipartFile(formData) + .then((res) => { + this.idDisabled = false + if (res.code === 0) { + this.$message({ + message: '���������������', + type: 'success', + }) + var reportInfo = res.data + this.value2 = [this.value3, this.value3] + reportInfo.name = + '���������������' + reportInfo.time.split('-').join('') + this.tableData = [reportInfo] + } else { + this.$message.error('���������������') + } + }) + .catch((err) => { + console.log(err) + }) } else { this.$message({ message: '���������������������������', - type: 'warning' + type: 'warning', }) } }, @@ -543,14 +653,14 @@ url: '/excel/excelImport', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, // ��������������������������������� - data + data, }) } else { return this.$request({ url: '/excel/syExcelImport', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, // ��������������������������������� - data + data, }) } }, @@ -566,7 +676,7 @@ return y + '-' + m + '-' + d } else { var arr = [] - timeArr.map(v => { + timeArr.map((v) => { var date = new Date(v) var y = date.getFullYear() var m = date.getMonth() + 1 @@ -597,7 +707,7 @@ handleCheckAllChange(val) { // console.info('check all change is ', val) this.isIndeterminate = false - this.tableData.forEach(item => { + this.tableData.forEach((item) => { item.checked = val this.dateArr.push(item.date) }) @@ -612,7 +722,7 @@ handleCheckOneChange(obj) { // console.info('check one change is ', obj) if (obj.checked === false) { - this.dateArr = this.dateArr.filter(v => { + this.dateArr = this.dateArr.filter((v) => { return v !== obj.date }) } else { @@ -620,13 +730,14 @@ } var totalCount = this.tableData.length let someStatusCount = 0 - this.tableData.forEach(item => { + this.tableData.forEach((item) => { if (item.checked === obj.checked) { someStatusCount++ } }) this.count = someStatusCount - this.checkAll = totalCount === someStatusCount ? obj.checked : !obj.checked + this.checkAll = + totalCount === someStatusCount ? obj.checked : !obj.checked this.isIndeterminate = someStatusCount > 0 && someStatusCount < totalCount }, // ��������������������� @@ -635,59 +746,82 @@ url: '/excel/excelExport', method: 'get', params: { - id: obj.id - } - }).then(res => { - console.log(res,'xia'); - var getData = {} - getData = res.data - // ��������������������� - getData.list1 = this.cityLast(getData.list1) - getData.list5 = this.cityLast(getData.list5) - // ���������/��������������������� - getData.list2 = this.cityFirst2(getData.list2) - getData.list3 = this.cityFirst2(getData.list3) - getData.list4 = this.cityFirst(getData.list4) - this.airData = getData - var monthZero = res.data.time.split('���')[0] - if (monthZero.substr(0, 1) === '0') { - this.airData.month = monthZero.substr(1) - } else { - this.airData.month = res.data.time.split('���')[0] - } - var dayZero = res.data.time.split('���')[1].split('���')[0] - if (dayZero.substr(0, 1) === '0') { - this.airData.day = dayZero.substr(1) - } else { - this.airData.day = dayZero - } - var arr = obj.date.split('-') - if (arr[2].substr(0, 1) === '0') { - arr[2] = arr[2].substr(1) - } - if (arr[1].substr(0, 1) === '0') { - arr[1] = arr[1].substr(1) - } - this.airData.currentTime = arr[0] + '���' + arr[1] + '���' + arr[2] + '���' - this.airData.currentYear = arr[0] - var time1DayZero = '' - var time1MonthZero = '' - if (res.data.time1.split('���')[1].split('���')[0].substr(0, 1) === '0') { - time1MonthZero = res.data.time1.split('���')[1].split('���')[0].substr(1) - } else { - time1MonthZero = res.data.time1.split('���')[1].split('���')[0] - } - - if (res.data.time1.split('���')[1].split('���')[0].substr(0, 1) === '0') { - time1DayZero = res.data.time1.split('���')[1].split('���')[0].substr(1) - } else { - time1DayZero = res.data.time1.split('���')[1].split('���')[0] - } - this.airData.time1 = res.data.time1.split('���')[0] + '���' + time1MonthZero + '���' + time1DayZero + '���' - ExportBriefDataDocx('/airQuality.docx', this.airData, `${obj.name}.docx`) - }).catch(err => { - console.log(err) + id: obj.id, + }, }) + .then((res) => { + console.log(res, 'xia') + var getData = {} + getData = res.data + // ��������������������� + getData.list1 = this.cityLast(getData.list1) + getData.list5 = this.cityLast(getData.list5) + // ���������/��������������������� + getData.list2 = this.cityFirst2(getData.list2) + getData.list3 = this.cityFirst2(getData.list3) + getData.list4 = this.cityFirst(getData.list4) + this.airData = getData + var monthZero = res.data.time.split('���')[0] + if (monthZero.substr(0, 1) === '0') { + this.airData.month = monthZero.substr(1) + } else { + this.airData.month = res.data.time.split('���')[0] + } + var dayZero = res.data.time.split('���')[1].split('���')[0] + if (dayZero.substr(0, 1) === '0') { + this.airData.day = dayZero.substr(1) + } else { + this.airData.day = dayZero + } + var arr = obj.date.split('-') + if (arr[2].substr(0, 1) === '0') { + arr[2] = arr[2].substr(1) + } + if (arr[1].substr(0, 1) === '0') { + arr[1] = arr[1].substr(1) + } + this.airData.currentTime = + arr[0] + '���' + arr[1] + '���' + arr[2] + '���' + this.airData.currentYear = arr[0] + var time1DayZero = '' + var time1MonthZero = '' + if ( + res.data.time1.split('���')[1].split('���')[0].substr(0, 1) === '0' + ) { + time1MonthZero = res.data.time1 + .split('���')[1] + .split('���')[0] + .substr(1) + } else { + time1MonthZero = res.data.time1.split('���')[1].split('���')[0] + } + + if ( + res.data.time1.split('���')[1].split('���')[0].substr(0, 1) === '0' + ) { + time1DayZero = res.data.time1 + .split('���')[1] + .split('���')[0] + .substr(1) + } else { + time1DayZero = res.data.time1.split('���')[1].split('���')[0] + } + this.airData.time1 = + res.data.time1.split('���')[0] + + '���' + + time1MonthZero + + '���' + + time1DayZero + + '���' + ExportBriefDataDocx( + '/airQuality1.docx', + this.airData, + `${obj.name}.docx` + ) + }) + .catch((err) => { + console.log(err) + }) }, // ��������������������� cityLast(list) { @@ -741,33 +875,39 @@ url: '/excel/hnExcelExport', method: 'get', params: { - id: obj.id + id: obj.id, // id: 68 - } - }).then(res => { - // console.log(res) - this.hunNanAirData = res.data - // currentTime������ - var arr = res.data.time2.split('-') - var currentTime = arr[0] + '���' + arr[1] + '���' + arr[2] + '���' - var currentYear = arr[0] - this.hunNanAirData.currentTime = currentTime - this.hunNanAirData.currentYear = currentYear - // ������������������09���26���,yearDate������������ - var month = res.data.time.split('-')[0] - if (month.substr(0, 1) === '0') { - month = month.substr(1) - } - this.hunNanAirData.month = month - var day = res.data.time.split('-')[1] - if (day.substr(0, 1) === '0') { - day = day.substr(1) - } - this.hunNanAirData.day = day - ExportBriefDataDocx('/hunnan.docx', this.hunNanAirData, `���������${arr[1]}���${arr[2]}���������������������������.docx`) - }).catch(err => { - console.log(err) + }, }) + .then((res) => { + // console.log(res) + this.hunNanAirData = res.data + // currentTime������ + var arr = res.data.time2.split('-') + var currentTime = arr[0] + '���' + arr[1] + '���' + arr[2] + '���' + var currentYear = arr[0] + this.hunNanAirData.currentTime = currentTime + this.hunNanAirData.currentYear = currentYear + // ������������������09���26���,yearDate������������ + var month = res.data.time.split('-')[0] + if (month.substr(0, 1) === '0') { + month = month.substr(1) + } + this.hunNanAirData.month = month + var day = res.data.time.split('-')[1] + if (day.substr(0, 1) === '0') { + day = day.substr(1) + } + this.hunNanAirData.day = day + ExportBriefDataDocx( + '/hunnan.docx', + this.hunNanAirData, + `���������${arr[1]}���${arr[2]}���������������������������.docx` + ) + }) + .catch((err) => { + console.log(err) + }) }, // ���������excel������ hnExcel(obj) { @@ -775,30 +915,55 @@ url: '/excel/syExcelExport', method: 'get', params: { - id: obj.id - } - }).then(res => { - var code2 = res.data.code2.substr(0, 2) + '\n' + res.data.code2.substr(2) - var code4 = res.data.code4.substr(0, 2) + '\n' + res.data.code4.substr(2) - var table1Data = [['', '���������', '������', '������', '������'], ['', '', '', '', ''], ['���������', '300', res.data.code1, '', code2], ['', '', '', '', ''], ['PM2.5', '41', res.data.code3, '', code4], ['', '', '', '', '']] - var table3Data = [['', '���������', '���������', '������', '������'], ['', '���������', '���������', '������', '������'], ['���������', '69', '69', res.data.code5, ''], ['', '', '', '', ''], ['PM2.5', '40', '40', res.data.code6, ''], ['', '', '', '', '']] - var table2Data = [ - res.data.list.sy1, - res.data.list.sy2, - res.data.list.hnd1, - res.data.list.hnd2, - res.data.list.xxj1, - res.data.list.xxj2, - res.data.list.hnq1, - res.data.list.hnq2 - ] - var data = new Date() - var currentYearData = data.getFullYear() - var jd = res.data.season - ExportHunnanExcel(`������������������������${obj.time.split('-').join('')}`, table1Data, table3Data, table2Data, currentYearData, jd) - }).catch(err => { - console.log(err) + id: obj.id, + }, }) + .then((res) => { + var code2 = + res.data.code2.substr(0, 2) + '\n' + res.data.code2.substr(2) + var code4 = + res.data.code4.substr(0, 2) + '\n' + res.data.code4.substr(2) + var table1Data = [ + ['', '���������', '������', '������', '������'], + ['', '', '', '', ''], + ['���������', '300', res.data.code1, '', code2], + ['', '', '', '', ''], + ['PM2.5', '41', res.data.code3, '', code4], + ['', '', '', '', ''], + ] + var table3Data = [ + ['', '���������', '���������', '������', '������'], + ['', '���������', '���������', '������', '������'], + ['���������', '69', '69', res.data.code5, ''], + ['', '', '', '', ''], + ['PM2.5', '40', '40', res.data.code6, ''], + ['', '', '', '', ''], + ] + var table2Data = [ + res.data.list.sy1, + res.data.list.sy2, + res.data.list.hnd1, + res.data.list.hnd2, + res.data.list.xxj1, + res.data.list.xxj2, + res.data.list.hnq1, + res.data.list.hnq2, + ] + var data = new Date() + var currentYearData = data.getFullYear() + var jd = res.data.season + ExportHunnanExcel( + `������������������������${obj.time.split('-').join('')}`, + table1Data, + table3Data, + table2Data, + currentYearData, + jd + ) + }) + .catch((err) => { + console.log(err) + }) }, // ������������ selectReport(val) { @@ -815,103 +980,107 @@ startTime: this.sensorTime2[0], endTime: this.sensorTime2[1], code: this.valueSelect, - pageCount: page - } - }).then(res => { - if (res.code === 0) { - var info = [] - if (this.isDisplay) { - this.totalNumber = res.data.total - info = res.data.item - } else { - info = res.data - } - info.map(v => { - if (this.valueSelect === 'gx') { - v.name = '���������������������������������' + v.time.split('-').join('') - } else { - v.name = '���������������' + v.time.split('-').join('') - } - }) - info.sort((a, b) => { return b.time.split('-').join('') - a.time.split('-').join('') }) - this.tableData = info - } - }).catch(err => { - console.log(err) + pageCount: page, + }, }) - } - } + .then((res) => { + if (res.code === 0) { + var info = [] + if (this.isDisplay) { + this.totalNumber = res.data.total + info = res.data.item + } else { + info = res.data + } + info.map((v) => { + if (this.valueSelect === 'gx') { + v.name = '���������������������������������' + v.time.split('-').join('') + } else { + v.name = '���������������' + v.time.split('-').join('') + } + }) + info.sort((a, b) => { + return b.time.split('-').join('') - a.time.split('-').join('') + }) + this.tableData = info + } + }) + .catch((err) => { + console.log(err) + }) + }, + }, } </script> <style scoped> -.analyseAir{ +.analyseAir { width: 100%; height: 100%; display: flex; padding-top: 22px; } - .exTop{ - width: 30%; - /*height: 95%;*/ - position: relative; - overflow: auto; - margin-bottom: 2%; - } - .cascader-demo{ - float: left; - padding: 0% 2%; - } - .upload-demo{ - margin-left: 2%; - /*float: left;*/ - margin-top: 4%; - height: 65px; - } - .upload-demo /deep/ .el-upload-list__item{ - font-size: 15px; - } -.upload-demo /deep/ .el-upload-list__item:first-child{ +.exTop { + width: 30%; + /*height: 95%;*/ + position: relative; + overflow: auto; + margin-bottom: 2%; +} +.cascader-demo { + float: left; + padding: 0% 2%; +} +.upload-demo { + margin-left: 2%; + /*float: left;*/ + margin-top: 4%; + height: 65px; +} +.upload-demo /deep/ .el-upload-list__item { + font-size: 15px; +} +.upload-demo /deep/ .el-upload-list__item:first-child { margin-top: 2px; } - .exDown { - width: 50%; - height: 95%; - margin-left: 2%; - font-size: 18px; - } - .exDown /deep/ .el-card{ - width: 100%; - height: 100%; - } - .divPadding{ - width: 80%; - margin: auto; - } - .textCenter{ - text-align: center; - } - .fontS14{ - font-size: 14px; - } - .upload-demo button{ - margin-right: 10%; - } - .upload-demo /deep/ .el-upload{ - margin-right: 10%; - } - .selectBtn{ - margin-left: 5%; - } - .el-card /deep/ .el-card__body{ - height: 815px; - } - .paginationDemo{ - position: absolute; - left: 0; - bottom: 3%; - } - .el-upload__tip{ - color: red; - } +.exDown { + width: 50%; + height: 95%; + margin-left: 2%; + font-size: 18px; +} +.exDown /deep/ .el-card { + width: 100%; + height: 100%; +} +.divPadding { + width: 80%; + margin: auto; +} +.textCenter { + text-align: center; +} +.fontS14 { + font-size: 14px; +} +.upload-demo button { + margin-right: 10%; +} +.upload-demo /deep/ .el-upload { + margin-right: 10%; +} +.selectBtn { + margin-left: 5%; +} +.el-card /deep/ .el-card__body { + height: 815px; +} +.paginationDemo { + position: absolute; + left: 0; + bottom: 3%; +} +.el-upload__tip { + color: red; +} </style> diff --git a/src/views/car/index.vue b/src/views/car/index.vue index 72e4832..d1d20bb 100644 --- a/src/views/car/index.vue +++ b/src/views/car/index.vue @@ -496,7 +496,7 @@ components: { index }, data() { return { - inputnum: 0, + inputnum: 50, tableData: [], fileList: [], file: '', @@ -1260,34 +1260,21 @@ 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 < 150 && - // (that.carMac === 'p5dnd7a0243622' || - // that.carMac === 'p5dnd7a0243625') - // ) { - // point.dustld = 200 - // } else if ( - // value.dustld - 0 !== 0 && - // value.dustld - 0 >= 150 && - // value.dustld - 0 <= 180 && - // (that.carMac === 'p5dnd7a0243622' || - // that.carMac === 'p5dnd7a0243625') - // ) { - // point.dustld = 220 - // } else if ( - // value.dustld - 0 !== 0 && - // value.dustld - 0 > 180 && - // value.dustld - 0 <= 200 && - // (that.carMac === 'p5dnd7a0243622' || - // that.carMac === 'p5dnd7a0243625') - // ) { - // point.dustld = 230 - // } else { - // point.dustld = value.dustld - 0 - // } + if (value.dustld - 0 >= 0 && value.dustld - 0 < 40) { + point.dustld = value.dustld - 0 + 170 + } else if (value.dustld - 0 >= 40 && value.dustld - 0 < 60) { + point.dustld = value.dustld - 0 + 130 + } else if (value.dustld - 0 >= 60 && value.dustld - 0 < 100) { + point.dustld = value.dustld - 0 + 110 + } else if (value.dustld - 0 >= 100 && value.dustld - 0 < 150) { + point.dustld = value.dustld - 0 + 70 + } else if (value.dustld - 0 >= 150 && value.dustld - 0 < 180) { + point.dustld = value.dustld - 0 + 30 + } else { + point.dustld = value.dustld - 0 + } } - point.dustld = value.dustld - 0 + // point.dustld = value.dustld - 0 point.times = value.time trackPoints.push(point) } @@ -1979,10 +1966,10 @@ // this.bg = require('@/assets/images/tl_TVOCNew.png') break } - this.$nextTick(()=>{ + this.$nextTick(() => { this.getStart() }) - this.initStart(); + this.initStart() }, changeCode1(index) { this.changeColor1 = index diff --git a/src/views/charts/index.vue b/src/views/charts/index.vue index 73b80cd..c79623a 100644 --- a/src/views/charts/index.vue +++ b/src/views/charts/index.vue @@ -347,6 +347,7 @@ }, // ��������������������������������� getSensor() { + this.newSensor = [] // stringMacs.su // var newMac = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] // this.newMac1 = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] diff --git a/src/views/dailyreport/index.vue b/src/views/dailyreport/index.vue index 475e685..1040361 100644 --- a/src/views/dailyreport/index.vue +++ b/src/views/dailyreport/index.vue @@ -973,7 +973,7 @@ } else { this.sailingReport.city = '���������' } - exportDocx('/sailingReport.docx', this.sailingReport, `${obj.name}.docx`) + exportDocx('/sailingReport1.docx', this.sailingReport, `${obj.name}.docx`) }).catch(err => { console.log(err) }) -- Gitblit v1.8.0