From 1a1654bbd7d91df6cf4864986748e0940907c8eb Mon Sep 17 00:00:00 2001 From: yz3456 <2753272399@qq.com> Date: 星期六, 06 四月 2024 16:07:33 +0800 Subject: [PATCH] 修改了241之前的新bug --- ruoyi-ui/src/views/self/show.vue | 83 +++++++++++++++++++++++++-- ruoyi-ui/src/views/travel/edit.vue | 6 + ruoyi-ui/src/views/self/memoInfo.vue | 42 +++++++++++++ ruoyi-ui/src/views/bignote/index.vue | 2 ruoyi-ui/src/views/collection/index.vue | 41 +++++++++---- 5 files changed, 150 insertions(+), 24 deletions(-) diff --git a/ruoyi-ui/src/views/bignote/index.vue b/ruoyi-ui/src/views/bignote/index.vue index 70835d5..944d6e8 100644 --- a/ruoyi-ui/src/views/bignote/index.vue +++ b/ruoyi-ui/src/views/bignote/index.vue @@ -310,7 +310,7 @@ :http-request="requestUpload1" :show-file-list="true" > -<i slot="default" class="el-icon-plus"></i> + <i slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> <!-- 娣诲姞video鍏冪礌鐢ㄤ簬鏄剧ず瑙嗛 --> <video diff --git a/ruoyi-ui/src/views/collection/index.vue b/ruoyi-ui/src/views/collection/index.vue index 72dc517..6be8625 100644 --- a/ruoyi-ui/src/views/collection/index.vue +++ b/ruoyi-ui/src/views/collection/index.vue @@ -374,7 +374,7 @@ style="margin-left: 10px" size="small" type="success" - + @click="picUpload" >涓婁紶鍒版湇鍔″櫒</el-button> <h4 class="form-header">鍏朵粬闄勪欢 </h4> @@ -416,9 +416,9 @@ > <i class="el-icon-zoom-in"></i> </span> - + <span - + class="el-upload-list__item-delete" @click="handleRemoveFile(file)" > @@ -712,7 +712,7 @@ this.$delete(this.fileList,i); this.$delete(this.uploadFileList,i); } - + } }, handleRemoveFile(file) { @@ -720,10 +720,10 @@ { if(this.fileListOther[i].url==file.url) { - + this.$delete(this.fileListOther,i); this.$delete(this.uploadFileList1,i); - + } } }, @@ -828,6 +828,7 @@ this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; // 娓呯┖formDat瀵硅薄鐨勬暟鎹� + this.newOption = ''; Object.keys(this.formDat).forEach(key => { this.formDat[key] = ''; }); @@ -842,10 +843,22 @@ }); } }); + // 娓呯┖formDat瀵硅薄鐨勬暟鎹� + Object.keys(this.formDat).forEach(key => { + this.formDat[key] = ''; + }); + + for(let i = 0; i <= this.fileList.length; i++) + { + this.handleRemove(this.fileList[0]); + } + for(let i = 0; i < this.fileListOther.length; i++){ + this.handleRemoveFile(this.fileListOther[0]); + } }, handleChange(file, fileList1) { //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍 - + // this.uploadFileList.push(file.raw); console.log("=========5555=========") console.log(file) @@ -868,7 +881,7 @@ }, fileUpload(){ // var file = params.file; - + var formData = new FormData(); this.$refs.upload1.submit(); // formData.append('uploadFile', file); @@ -878,18 +891,18 @@ } this.uploadFileList1.forEach((elem)=>{ formData.append("files", elem) - + }) - + let _this = this - + this.uploading = true; uploadPic(formData).then(response => { _this.uploadFileList1 = [] _this.formDat.url = _this.formDat.url+","+response.fileNames _this.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛!"); }) - + }, picUpload() { @@ -904,7 +917,7 @@ //console.log(this.uploadFileList) this.uploadFileList.forEach((elem)=>{ formData.append("files", elem) - + }) //alert(90) let _this = this @@ -914,7 +927,7 @@ _this.formDat.url = _this.formDat.url+","+response.fileNames _this.uploadFileList = [] _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛"); - + }); }, requestUpload(params) { diff --git a/ruoyi-ui/src/views/self/memoInfo.vue b/ruoyi-ui/src/views/self/memoInfo.vue index dcb20c7..5f57b82 100644 --- a/ruoyi-ui/src/views/self/memoInfo.vue +++ b/ruoyi-ui/src/views/self/memoInfo.vue @@ -120,12 +120,15 @@ action="" :file-list="fileListOther" class="upload-demo" + ref="upload1" multiple list-type="picture-card" :on-preview="handleFileCardPreview" :on-remove="handleRemoveFile" + :on-change="handleChange1" :http-request="requestUpload1" :show-file-list="true" + :auto-upload="false" :disabled="!btn" :class="{ hide: !btn }" > @@ -175,12 +178,20 @@ </el-upload> + <el-button + style="margin-left: 10px" + size="small" + type="success" + v-if="btn" + @click="fileUpload" + >涓婁紶鍒版湇鍔″櫒</el-button> + <h4 class="form-header"> </h4> <el-form-item size="large"> <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼</el-button> </el-form-item> </el-form> - </div> +</div> <el-dialog :visible.sync="dialogVisible"> <img w-full :src="dialogImageUrl" style="width: 100%; height: 100%" alt="Preview Image" /> </el-dialog> @@ -499,6 +510,35 @@ // console.log(this.uploadFileList) // this.fileList = fileList }, + fileUpload(){ + // var file = params.file; + + var formData = new FormData(); + //this.$refs.upload1.submit(); + // alert(this.uploadFileList1.length) + // formData.append('uploadFile', file); + if(this.uploadFileList1.length==0){ + this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�"); + return} + + this.uploadFileList1.forEach((elem)=>{ + formData.append("files", elem) + + }) + console.log(this.uploadFileList1) + let _this = this + + this.uploading = true; + uploadPic(formData).then(response => { + _this.uploadFileList1 = [] + _this.formData.url = _this.formData.url+","+response.fileNames + updateNote(_this.formData).then(response => { + this.$modal.msgSuccess("鏂囨。涓婁紶鎴愬姛"); + // this.open = false; + }); + }) + + }, picUpload(){ var formData = new FormData(); if(this.uploadFileList.length==0){ diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue index 2ae5ebb..3dd4a39 100644 --- a/ruoyi-ui/src/views/self/show.vue +++ b/ruoyi-ui/src/views/self/show.vue @@ -336,24 +336,67 @@ @click="picUpload" >涓婁紶鍒版湇鍔″櫒</el-button> <h4 class="form-header">鍏朵粬闄勪欢 </h4> + + <el-upload action="" :file-list="fileListOther" class="upload-demo" multiple - + ref="upload1" + :on-change="handleChange1" + :auto-upload="false" + list-type="picture-card" :on-remove="handleRemove" :http-request="requestUpload1m" :show-file-list="true" > - <el-button type="primary">鐐瑰嚮涓婁紶</el-button> - <div v-if="uploading1" class="upload-status">姝e湪涓婁紶...</div> - <template #tip> - <div class="el-upload__tip"> - </div> - </template> + + <i slot="default" class="el-icon-plus"></i> + <div slot="file" slot-scope="{file}"> + <!-- 娣诲姞video鍏冪礌鐢ㄤ簬鏄剧ず瑙嗛 --> + <video + v-if="file.url.includes('.mp4')" + class="el-upload-list__item-thumbnail" + :src="file.url" + style="width: 147px; height: 147px" + fit="cover" + ></video> + <img v-else + class="el-upload-list__item-thumbnail" + :src="file.url" + alt="" + style="width: 100%; height: 100%" + fit="cover"></img> + + <span class="el-upload-list__item-actions"> + <span class="el-upload-list__item-name">{{ file.name }}</span> + <span + class="el-upload-list__item-preview" + @click="handleFileCardPreview(file)" + > + <i class="el-icon-zoom-in"></i> + </span> + + <span + + class="el-upload-list__item-delete" + @click="handleRemoveFile(file)" + > + <i class="el-icon-delete"></i> + </span> + </span> + + </div> + </el-upload> + <el-button + style="margin-left: 10px" + size="small" + type="success" + @click="fileUpload" + >涓婁紶鍒版湇鍔″櫒</el-button> </el-form> <h4 class="form-header"> </h4> @@ -1193,6 +1236,32 @@ } }, + fileUpload(){ + // var file = params.file; + + var formData = new FormData(); + this.$refs.upload1.submit(); + // formData.append('uploadFile', file); + if(this.uploadFileList1.length==0){ + this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖!"); + return + } + this.uploadFileList1.forEach((elem)=>{ + formData.append("files", elem) + + }) + + let _this = this + + this.uploading = true; + uploadPic(formData).then(response => { + _this.uploadFileList1 = [] + _this.formDat.url = _this.formDat.url+","+response.fileNames + _this.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛!"); + }) + + }, + picUpload() { var formData = new FormData(); diff --git a/ruoyi-ui/src/views/travel/edit.vue b/ruoyi-ui/src/views/travel/edit.vue index 5275ee3..092dd2c 100644 --- a/ruoyi-ui/src/views/travel/edit.vue +++ b/ruoyi-ui/src/views/travel/edit.vue @@ -37,6 +37,10 @@ <el-input v-model="formData.groupTotal" placeholder="璇疯緭鍏ュ洟璐�" clearable :style="{width: '100%'}" :disabled="dsb"> </el-input> </el-form-item> + <el-form-item label="鎰熻█" prop="spee"> + <el-input v-model="formData.spee" placeholder="璇疯緭鍏ユ劅瑷�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> @@ -87,7 +91,7 @@ property: undefined, manner: undefined, groupTotal: undefined, - + spee: undefined }, dialogImageUrl: '', dialogVisible: false, -- Gitblit v1.9.1