| | |
| | | </div> |
| | | <el-dialog title="路段超标值" :visible.sync="dialogVisible" width="60%"> |
| | | <div style="margin-top: 1rem"> |
| | | <el-table :data="tableData1.slice((this.PageNum-1)*PageSize,PageNum*PageSize)" style="width: 100%"> |
| | | <el-table |
| | | :data=" |
| | | tableData1.slice((this.PageNum - 1) * PageSize, PageNum * PageSize) |
| | | " |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="index" width="180" label="序号"> |
| | | </el-table-column> |
| | | <el-table-column label="道路" prop="road"> </el-table-column> |
| | |
| | | fileLists: [[], []], |
| | | index: 0, |
| | | num: 0, |
| | | fileList: [], |
| | | date: '', |
| | | time: '', |
| | | list1: [], |
| | |
| | | return time.getTime() > new Date() |
| | | } |
| | | }, |
| | | reportName: '' |
| | | }, |
| | | } |
| | | }, |
| | |
| | | //方法集合 |
| | | methods: { |
| | | baoC() { |
| | | this.valueDate.fileLists=[] |
| | | // const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | // var images = [ |
| | | // ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], |
| | |
| | | // this.valueDate.fileLists[i] = [{ url: baseUrl + imagesObj[i] }] |
| | | // } |
| | | // } |
| | | |
| | | console.log(this.fileList, '123') |
| | | const formData = new FormData() |
| | | formData.append(`id`, this.id) |
| | | this.fileList.map((v) => { |
| | |
| | | }).then((res) => { |
| | | console.log(res) |
| | | // this.valueDate=res.data |
| | | const baseUrl = `${requestObj.baseUrl}static/img/` |
| | | if (res.data.images === null) { |
| | | var images = [[], []] |
| | | const baseUrl = `${requestObj.baseUrl}/static/img/` |
| | | if (res.data.images.file2 === ''&&res.data.images.file1 === '') { |
| | | res.data.images.file1=[] |
| | | res.data.images.file2=[] |
| | | var images = [res.data.images.file1, res.data.images.file2] |
| | | } else if (res.data.images.file2 === '') { |
| | | res.data.images.file2 = [] |
| | | res.data.images.file2=[] |
| | | var images = [[res.data.images.file1], res.data.images.file2] |
| | | } else if (res.data.images.file1 === '') { |
| | | res.data.images.file1 = [] |
| | | res.data.images.file1=[] |
| | | var images = [res.data.images.file1, res.data.images.file2.split(',')] |
| | | } else { |
| | | var images = [ |
| | |
| | | res.data.images.file2.split(','), |
| | | ] |
| | | } |
| | | console.log(images) |
| | | var info = 0 |
| | | var num = 0 |
| | | for (let i = 0; i < images.length; i++) { |
| | | console.log(images) |
| | | // console.log(images) |
| | | if (!this.valueDate.fileLists[i]) this.valueDate.fileLists[i] = [] |
| | | if (images[i].length) { |
| | | num++ |
| | |
| | | } |
| | | } |
| | | } |
| | | // images=[] |
| | | console.log(this.valueDate.fileLists,'images'); |
| | | res.data.list1.map((item, index) => { |
| | | item.index = index + 1 |
| | | }) |
| | |
| | | this.valueDate.list1 = res.data.list1 |
| | | this.valueDate.list2 = res.data.list2 |
| | | this.valueDate.time = res.data.time |
| | | console.log(this.valueDate, 'this.valueDate') |
| | | exportLUImage('/Section.docx', this.valueDate, `尘负荷走航车报告.docx`) |
| | | 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) { |
| | |
| | | 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 |
| | | } |
| | |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | // console.log(res) |
| | | this.tableData = res |
| | | var info = res.data |
| | | // console.log(info.length); |
| | |
| | | } |
| | | 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 |
| | | }) |
| | |
| | | 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) |
| | |
| | | /deep/.el-upload-list__item { |
| | | width: 30%; |
| | | } |
| | | </style> |
| | | </style> |