From 4e15972e4db30f68e4ea74759fd04f00e6e44be2 Mon Sep 17 00:00:00 2001
From: yichenxi <yichenxi0601@163.com>
Date: Tue, 13 Dec 2022 11:21:23 +0800
Subject: [PATCH] 1、尘负荷走航路段报告

---
 src/views/sectionReport/index.vue |   49 +++++++++++++++++++++++--------------------------
 1 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/src/views/sectionReport/index.vue b/src/views/sectionReport/index.vue
index 9ecd23b..5b6c504 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: [],
@@ -211,6 +215,7 @@
   //������������
   methods: {
     baoC() {
+        this.valueDate.fileLists=[]
       // const baseUrl = `${requestObj.baseUrl}/static/img/`
       // var images = [
       //   ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'],
@@ -244,7 +249,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 +265,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 +282,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 +296,8 @@
             }
           }
         }
+        // images=[]
+        console.log(this.valueDate.fileLists,'images');
         res.data.list1.map((item, index) => {
           item.index = index + 1
         })
@@ -302,20 +310,21 @@
         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`)
+       
       })
     },
     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,18 +334,6 @@
       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 == '') {
         this.$message('������������������')
@@ -353,7 +350,7 @@
         },
       })
         .then((res) => {
-          console.log(res)
+          // console.log(res)
           this.tableData = res
           var info = res.data
           // console.log(info.length);
@@ -385,7 +382,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)

--
Gitblit v1.8.0