Ver Fonte

fix: 商用工程登录图纸显示上传名称

Howie há 1 ano atrás
pai
commit
83a26c2391

+ 3 - 3
src/views/commercialEngineering/components/base.vue

@@ -407,15 +407,15 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">图纸上传:</div>
-          <div class="value" style="justify-content: flex-end; position: relative">
-            <FileUpload v-if="module !== 'detail' && module !== 'examine'" :file-list="formData.fileList"   :limit="1" class="file" />
+          <div class="value" style="justify-content: flex-end; position: relative;overflow: hidden;">
+            <FileUpload v-if="module !== 'detail' && module !== 'examine'" :file-list="formData.fileList"   :limit="2" class="file" />
             <el-link
               v-if="(module == 'detail' || module == 'examine' )&& formData.fileList && formData.fileList.length"
               style="position: absolute; left: 5px"
               type="primary"
               :underline="false"
               @click="openPdf(formData.fileList[0])"
-              >{{ formData.fileList[0].name }}下载</el-link
+              >{{ formData.fileList[0].fileName }}</el-link
             >
             <!-- <el-input v-model="formData.drawUpload"    clearable /> -->
           </div>

+ 4 - 2
src/views/commercialEngineering/mixin/index.js

@@ -205,12 +205,14 @@ export default {
           fileList: []
         }
         if (res.data.drawUpload) {
+          const name = res.data.drawUpload.substring(0, res.data.drawUpload.lastIndexOf(".")).replace('uploadfile/', '')
+          const fileName =res.data.drawUpload.replace('uploadfile/', '')
           this.formData.fileList = [
             {
-              name: '图纸文件.xlsx',
+              name,
+              fileName,
               status: 'success',
               url: res.data.drawUpload,
-              uid: '111'
             }
           ]
         }