From df438ecd2e03416f0454cf98a667d9e53a1b5dd8 Mon Sep 17 00:00:00 2001 From: guoshipeng <3194674006@qq.com> Date: Mon, 09 Jan 2023 13:19:18 +0800 Subject: [PATCH] 1.空气质量报告模板修改,2.走航监测报告模板修改,3.道路尘负荷页面03区间修改,4.尘负荷走航报告模板名字修改 --- src/views/sectionReport/index.vue | 64 ++++++++++++++++--------------- 1 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/views/sectionReport/index.vue b/src/views/sectionReport/index.vue index 9ecd23b..3bb6094 100644 --- a/src/views/sectionReport/index.vue +++ b/src/views/sectionReport/index.vue @@ -60,7 +60,12 @@ </div> <el-dialog title="���������������" :visible.sync="dialogVisible" width="60%"> <div style="margin-top: 1rem"> - <el-table :data="tableData1.slice((this.PageNum-1)*PageSize,PageNum*PageSize)" style="width: 100%"> + <el-table + :data=" + tableData1.slice((this.PageNum - 1) * PageSize, PageNum * PageSize) + " + style="width: 100%" + > <el-table-column type="index" width="180" label="������"> </el-table-column> <el-table-column label="������" prop="road"> </el-table-column> @@ -164,7 +169,6 @@ fileLists: [[], []], index: 0, num: 0, - fileList: [], date: '', time: '', list1: [], @@ -195,6 +199,7 @@ return time.getTime() > new Date() } }, + reportName: '' }, } }, @@ -211,6 +216,7 @@ //������������ methods: { baoC() { + this.valueDate.fileLists=[] // const baseUrl = `${requestObj.baseUrl}/static/img/` // var images = [ // ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], @@ -244,7 +250,7 @@ // this.valueDate.fileLists[i] = [{ url: baseUrl + imagesObj[i] }] // } // } - + console.log(this.fileList, '123') const formData = new FormData() formData.append(`id`, this.id) this.fileList.map((v) => { @@ -260,14 +266,16 @@ }).then((res) => { console.log(res) // this.valueDate=res.data - const baseUrl = `${requestObj.baseUrl}static/img/` - if (res.data.images === null) { - var images = [[], []] + const baseUrl = `${requestObj.baseUrl}/static/img/` + if (res.data.images.file2 === ''&&res.data.images.file1 === '') { + res.data.images.file1=[] + res.data.images.file2=[] + var images = [res.data.images.file1, res.data.images.file2] } else if (res.data.images.file2 === '') { - res.data.images.file2 = [] + res.data.images.file2=[] var images = [[res.data.images.file1], res.data.images.file2] } else if (res.data.images.file1 === '') { - res.data.images.file1 = [] + res.data.images.file1=[] var images = [res.data.images.file1, res.data.images.file2.split(',')] } else { var images = [ @@ -275,11 +283,10 @@ res.data.images.file2.split(','), ] } - console.log(images) var info = 0 var num = 0 for (let i = 0; i < images.length; i++) { - console.log(images) + // console.log(images) if (!this.valueDate.fileLists[i]) this.valueDate.fileLists[i] = [] if (images[i].length) { num++ @@ -290,6 +297,8 @@ } } } + // images=[] + console.log(this.valueDate.fileLists,'images'); res.data.list1.map((item, index) => { item.index = index + 1 }) @@ -302,20 +311,20 @@ this.valueDate.list1 = res.data.list1 this.valueDate.list2 = res.data.list2 this.valueDate.time = res.data.time - console.log(this.valueDate, 'this.valueDate') - exportLUImage('/Section.docx', this.valueDate, `������������������������.docx`) + exportLUImage('/Section.docx', this.valueDate, `${this.reportName}.docx`) }) }, handleRemove(file, fileList) { console.log(file, fileList) }, handleChange(file, fileList) { + // console.log(file); this.file = file this.fileList = fileList console.log(this.fileList) }, handleSizeChange(size) { - this.PageNum = 1; + this.PageNum = 1 this.PageSize = size }, handleCurrentChange(num) { @@ -325,20 +334,8 @@ this.dialogVisible = true }, - handleImgToBase64(url, cb) { - var image = new Image() - image.crossOrigin = '*' - image.src = url - image.onload = function () { - const base64 = imageToBase64(image) // ���������base64 - const file = base64ToFile(base64, +new Date() + '.png') // base64���File - // ��������������������������������������������������������������������������������������� - cb && typeof cb === 'function' && cb(file) - return file - } - }, selectReport() { - if (this.carInput == '') { + if (this.carInput === '') { this.$message('������������������') return false } @@ -353,7 +350,7 @@ }, }) .then((res) => { - console.log(res) + // console.log(res) this.tableData = res var info = res.data // console.log(info.length); @@ -364,8 +361,13 @@ } info.map((v) => { console.log(v) - var time = v.time.substring(0, 10) - v.time = `������������������������������������${time}` + var time = v.time.substring(0, 10).split('-').join('') + if (this.cityChoose === 'gx') { + v.time = `���������������������������������������������������${time}` + } else { + v.time = `������������������������������������${time}` + } + this.reportName = v.time }) this.tableData = info }) @@ -385,7 +387,7 @@ id: obj.id, }, }).then((res) => { - console.log(res) + // console.log(res) this.tableData1 = res.data.list this.total = res.data.count // console.log(this.pagesize) @@ -448,4 +450,4 @@ /deep/.el-upload-list__item { width: 30%; } -</style> \ No newline at end of file +</style> -- Gitblit v1.8.0