From 0edf2cc107cd03e8e007f97f38387d66f480cd3d Mon Sep 17 00:00:00 2001 From: linwenling <3256558519@qq.com> Date: 星期二, 26 九月 2023 16:54:53 +0800 Subject: [PATCH] 修改家大事记 的图片文件上传 直调接口 --- ruoyi-ui/src/views/healthy/healthyInfo.vue | 75 ++++++++++++++++++++++--------------- 1 files changed, 44 insertions(+), 31 deletions(-) diff --git a/ruoyi-ui/src/views/healthy/healthyInfo.vue b/ruoyi-ui/src/views/healthy/healthyInfo.vue index 232c9cb..23bcdbc 100644 --- a/ruoyi-ui/src/views/healthy/healthyInfo.vue +++ b/ruoyi-ui/src/views/healthy/healthyInfo.vue @@ -1,8 +1,15 @@ <template> - <div class="app-container"> + <div class="app-container" id="printable-content"> <div class="form-header mt"> - <h4 class="dt h4">闅愮璇︾粏淇℃伅 </h4> - + <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;" > + <span>鍋ュ悍璁板綍璇︾粏淇℃伅</span> + <div style="display: flex; align-items: center;"> + <el-button size="mini" type="text" v-print="'#printable-content'" v-hasPermi="['person:information:memo']"> + <div class="form" ><el-icon style="padding-right:100px;"></el-icon> + <span class="text" style="width: 69px;height: 26px;font-size: 16px; + font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">鎵撳嵃</span></div> + </el-button></div> + </h1> </div> <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px"> @@ -38,8 +45,11 @@ multiple :http-request="requestUpload" :file-list="fileList" + :disabled="!btn" + :class="{ hide: !btn }" > - <i slot="default" class="el-icon-plus"></i> + <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> + <i v-if="!uploading" slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> <img class="el-upload-list__item-thumbnail" @@ -51,14 +61,14 @@ > <span class="el-upload-list__item-actions"> <span - v-if="isShow" + class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)" > <i class="el-icon-zoom-in"></i> </span> <span - v-if="isShow" + class="el-upload-list__item-delete" @click="handleDownload(file.url)" > @@ -88,9 +98,11 @@ :on-remove="handleRemoveFile" :http-request="requestUpload" :show-file-list="true" + :disabled="!btn" + :class="{ hide: !btn }" > - - <i slot="default" class="el-icon-plus"></i> + <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> + <i v-if="!uploading" slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> <img class="el-upload-list__item-thumbnail" @@ -101,14 +113,14 @@ > <span class="el-upload-list__item-actions"> <span - v-if="isShow" + class="el-upload-list__item-preview" @click="handleFileCardPreview(file)" > <i class="el-icon-zoom-in"></i> </span> <span - v-if="isShow" + class="el-upload-list__item-delete" @click="handleDownload(file.url)" > @@ -141,7 +153,7 @@ </div> </template> <script> -import {getSecretInfo, uploadPic, download, updateSecret} from "@/api/secret/index"; +import {getHealthInfo, uploadPic, download, updateHealth} from "@/api/healthy/index"; import {addRole, updateRole} from "@/api/system/role"; import {blobValidate} from "@/utils/ruoyi"; import errorCode from "@/utils/errorCode"; @@ -152,8 +164,8 @@ props: [], data() { return { - cdi:"闅愮璇︾粏淇℃伅", - udi:"闅愮淇℃伅淇敼", + cdi:"鍋ュ悍璇︾粏淇℃伅", + udi:"鍋ュ悍淇℃伅淇敼", fot:[".jpg",".jif"], fileList:[ ], @@ -163,11 +175,11 @@ dsb:true, btn:false, isShow:true, + uploading: false, formData: { type: undefined, happenTime: undefined, accNo:undefined, - validityDate:undefined, password:undefined, validityDate:undefined, isFinger:undefined, @@ -246,20 +258,21 @@ this.btn= jd this.dsb = !jd this.isShow=true - document.title = "淇敼闅愮璇︾粏淇℃伅"; - this.$route.meta.title = "淇敼闅愮璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + document.title = "淇敼鍋ュ悍璇︾粏淇℃伅"; + this.$route.meta.title = "淇敼鍋ュ悍璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� } else{ - document.title = "鏌ョ湅闅愮璇︾粏淇℃伅"; - this.$route.meta.title = "鏌ョ湅闅愮璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + document.title = "鏌ョ湅鍋ュ悍璇︾粏淇℃伅"; + this.$route.meta.title = "鏌ョ湅鍋ュ悍璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� this.isShow=false + this.btn = false; } let _this = this if (id) { this.loading = true; - getSecretInfo(query).then((response) => { + getHealthInfo({id}).then((response) => { this.formData = response.data; let paths = response.data.url.split(","); for(let i = 0; i < paths.length; i++) @@ -317,7 +330,7 @@ if (valid) { if (this.formData.id != undefined) { - updateSecret(this.formData).then(response => { + updateHealth(this.formData).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); // this.open = false; this.btn=false @@ -377,7 +390,7 @@ download(formData).then(async (response) => { const isLogin = await blobValidate(response); let nt = new Date().getTime() - let filename = 'familyevent_'+nt+'.'+suffix + let filename = 'healthyInfo'+nt+'.'+suffix const blob = new Blob([response]) saveAs(blob, filename) }) @@ -385,7 +398,7 @@ handleEdit() { this.dsb = false - // this.btn = true + this.btn = true this.isShow=false }, requestUpload(params) @@ -394,10 +407,11 @@ var formData = new FormData(); formData.append('uploadFile', file); let _this = this - + this.uploading = true; uploadPic(formData).then(response => { let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) - + this.uploading = false; + this.$modal.msgSuccess("涓婁紶鎴愬姛"); if(_this.fot.includes(pth) === true) { _this.fileList.push({name:response.data.fileName, "url":response.data.url}) @@ -411,13 +425,6 @@ }) }, - - /** 瀵煎嚭鎸夐挳鎿嶄綔 */ - handleExport() { - this.download('/zfEconomy/export', { - ...this.queryParams - }, `zfEconomy_${new Date().getTime()}.xlsx`) - } } } @@ -438,4 +445,10 @@ display: block; position: absolute; } +.hide .el-upload--picture-card { + display: none; +} +.form{ + background:center/11% no-repeat url('../../assets/icons/form.png') ; +} </style> -- Gitblit v1.9.1