From 1a55d5008d2484e4730a5e8919cdb95e14da98d5 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期三, 09 八月 2023 23:51:37 +0800 Subject: [PATCH] 完善各模块的视频上传功能,显示正在上传和上传完成提示 --- ruoyi-ui/src/views/economy/economyInfo.vue | 130 +++++++++++++++++------------------------- 1 files changed, 53 insertions(+), 77 deletions(-) diff --git a/ruoyi-ui/src/views/economy/economyInfo.vue b/ruoyi-ui/src/views/economy/economyInfo.vue index 2dab199..0ccd2e5 100644 --- a/ruoyi-ui/src/views/economy/economyInfo.vue +++ b/ruoyi-ui/src/views/economy/economyInfo.vue @@ -1,39 +1,36 @@ <template> <div class="app-container"> <div class="form-header mt"> - <h4 class="dt h4">瀹跺涵鏀舵敮鍙拌处淇℃伅 </h4> + <h4 class="dt h4">瀹跺涵鏀舵敮鍙拌处璇︾粏淇℃伅 </h4> </div> <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px"> - <!-- <el-form-item label="搴忓彿" prop="id"> - <el-input v-model="formData.id" placeholder="璇疯緭鍏d" :maxlength="11" show-word-limit :disabled="true" - clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input> - </el-form-item> --> - <el-form-item label="鍩洪噾/鍙拌处" prop="type"> - <el-select v-model="formData.type=== 1 ? '鍙拌处':'鍩洪噾'" placeholder="璇烽�夋嫨鍩洪噾/鍙拌处" clearable :style="{width: '100%'}" :disabled="dsb" > + + <el-form-item label="鍙拌处" prop="type"> + <el-select v-model="formData.type" placeholder="璇疯緭鍏ュ彴璐﹀唴瀹�" clearable :style="{width: '100%'}" :disabled="dsb" > </el-select> </el-form-item> <el-form-item label="鏃堕棿" prop="createTime"> - <el-input v-model="formData.createTime" placeholder="璇烽�夋嫨鏃堕棿" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> + <el-input v-model="formData.createTime" placeholder="璇烽�夋嫨鏃堕棿" type="date" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> </el-form-item> <el-form-item label="鏀跺叆/鏀嚭" prop="price"> - <el-input v-model="formData.price" placeholder="璇疯緭鍏ョ敤閫�" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="formData.price" placeholder="璇疯緭鍏ラ�夋嫨鏀跺叆/鏀嚭" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> <el-form-item label="鐢ㄩ��" prop="useFor"> - <el-input v-model="formData.useFor" placeholder="璇疯緭鍏ヤ娇鐢ㄤ汉" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="formData.useFor" placeholder="璇疯緭鍏ョ敤閫�" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> <el-form-item label="浣跨敤浜�" prop="usePeople"> - <el-input v-model="formData.usePeople" placeholder="璇疯緭鍏ユ寔鏈変汉" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-input v-model="formData.usePeople" placeholder="璇疯緭鍏ヤ娇鐢ㄤ汉" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> - <el-form-item label="鐜伴噾/鑷姩鍒掓墸" prop="kind"> - <el-input v-model="formData.kind=== 1 ? '鑷姩鍒掓墸':'鐜伴噾'" placeholder="璇烽�夋嫨鐜伴噾/鑷姩鍒掓墸" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-form-item label="浠樻鏂瑰紡" prop="kind"> + <el-input v-model="formData.kind" placeholder="璇疯緭鍏ヤ粯娆炬柟寮�" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> - <el-form-item label="浣欓" prop="balance"> + <el-form-item label="閲戦" prop="balance"> <el-input v-model="formData.balance" placeholder="璇疯緭鍏ヤ綑棰�" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> </el-form-item> <el-form-item label="澶囨敞" prop="remark"> @@ -41,7 +38,7 @@ </el-form-item> - <h4 class="form-header">鐩稿叧鍥剧墖 </h4> + <h4 class="form-header">鐢靛瓙鏂囦欢 </h4> <el-upload action="#" list-type="picture-card" @@ -49,7 +46,8 @@ :http-request="requestUpload" :file-list="fileList" > - <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" @@ -61,14 +59,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)" > @@ -95,12 +93,12 @@ multiple list-type="picture-card" :on-preview="handleFileCardPreview" - :on-remove="handleRemove" + :on-remove="handleRemoveFile" :http-request="requestUpload" :show-file-list="true" > - - <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" @@ -111,20 +109,19 @@ > <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" - @click="handleRemove(file)" - class="el-upload-list__item-delete" + class="el-upload-list__item-delete" + @click="handleDownload(file.url)" > - <i class="el-icon-download"></i> - </span> + <i class="el-icon-download"></i> + </span> <span v-if="isShow" class="el-upload-list__item-delete" @@ -174,6 +171,7 @@ dsb:true, btn:false, isShow:true, + uploading: false, formData: { type: undefined, createTime: undefined, @@ -187,47 +185,42 @@ dialogVisible: false, disabled: false, rules: { - // id: [{ - // required: true, - // message: '璇疯緭鍏d', - // trigger: 'blur' - // }], - type: [{ - required: true, - message: '璇烽�夋嫨鍩洪噾/鍙拌处', - trigger: 'change' - }], - title: [{ - required: true, - message: '璇疯緭鍏ユ爣棰�', - trigger: 'blur' - }], usePeople: [{ required: true, message: '璇疯緭鍏ヤ娇鐢ㄤ汉', trigger: 'blur' }], + useFor: [{ required: true, message: '璇疯緭鍏ョ敤閫�', trigger: 'blur' }], - price: [{ + type: [{ required: true, - message: '璇疯緭鍏ユ敹鍏�/鏀嚭', + message: '璇疯緭鍏ュ彴璐﹀唴瀹�', + trigger: 'blur' + }], + balance: [{ + required: true, + message: '璇疯緭鍏ラ噾棰�', trigger: 'blur' }], kind: [{ - required: true, - message: '璇烽�夋嫨鐜伴噾/鍒掓墸', + // required: true, + message: '璇疯緭鍏ユ敮浠樻柟寮�', trigger: 'blur' }], createTime: [{ required: true, - message: '璇疯緭鍏ュ娉�', - trigger: 'blur' + message: '璇烽�夋嫨鏃ユ湡閫夋嫨', + trigger: 'change' }], - + price: [{ + required: true, + message: '璇烽�夋嫨鏀跺叆/鏀嚭', + trigger: 'change' + }], }, typeOptions: [{ value: '0', @@ -250,12 +243,12 @@ 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 } @@ -289,32 +282,14 @@ }, mounted() {}, methods: { - getSrc1(type) { - if (type === 0) { - return '鍩洪噾' + getSrc1(price) { + if (price === 鏀跺叆) { + return '鏀跺叆' }else { - return '鍙拌处' + return '鏀嚭' } }, - getSrc2(kind) { - if (kind == 0) { - return '鐜伴噾' - }else { - return '鑷姩鎵e垝' - } - }, - /** 鏌ヨ绫诲埆淇℃伅 */ - getCateInfor() - { - let _this = this - getCategory().then(response=>{ - - response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ - _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) - }) - }) - }, submitForm() { let ul = this.fileList.map(function (elem){ return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") @@ -406,10 +381,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}) -- Gitblit v1.9.1