From 1357e7d57eb6a27333f86cbcb8517428f3f4ea9a Mon Sep 17 00:00:00 2001 From: qirong <2032486488@qq.com> Date: 星期二, 12 十二月 2023 14:01:57 +0800 Subject: [PATCH] 修改上传 --- src/views/index.vue | 75 ++++++++++++++++++++++++++++++++++++- dist.zip | 0 src/views/login.vue | 3 + src/utils/request.ts | 2 src/components/FileUpload/index.vue | 9 ++-- 5 files changed, 80 insertions(+), 9 deletions(-) diff --git a/dist.zip b/dist.zip index a377bcc..593cb12 100644 --- a/dist.zip +++ b/dist.zip Binary files differ diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index d7af105..edc462e 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -12,13 +12,14 @@ ref="fileUploadRef" :auto-upload="false" :on-exceed="handleExceed" + :before-upload="handleBeforeUpload" > <!-- 涓婁紶鎸夐挳 --> <el-button type="primary">閫夊彇鏂囦欢</el-button> </el-upload> <!-- 涓婁紶鎻愮ず --> <div class="el-upload__tip" v-if="showTip"> - <span>璇蜂笂浼犳枃浠�</span> + <span>涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃200MB</span> </div> </div> @@ -144,7 +145,6 @@ return false; } } - proxy?.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��..."); number.value++; return true; } @@ -159,7 +159,7 @@ proxy?.$modal.msgError("涓婁紶鏂囦欢澶辫触"); } const handleUploadProgress=(e: any) => { - downloadLoadingInstance = ElLoading.service({ text: '姝e湪涓婁紶鏂囦欢锛岃绋嶅��', background: 'rgba(0, 0, 0, 0.7)' }); + emit('closePopup','123123'); } // 涓婁紶鎴愬姛鍥炶皟 const handleUploadSuccess = (res: any, file: UploadFile) => { @@ -172,7 +172,7 @@ fileUploadRef.value!.clearFiles() downloadLoadingInstance.close(); // uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId }); - // uploadedSuccessfully(); + uploadedSuccessfully(); }else if (res.code == 401) { location.reload() } else { @@ -181,7 +181,6 @@ proxy?.$modal.msgError(res.msg); fileUploadRef.value?.handleRemove(file); uploadedSuccessfully(); - downloadLoadingInstance.close(); } } diff --git a/src/utils/request.ts b/src/utils/request.ts index 95773be..55f7498 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -66,7 +66,7 @@ const s_url = sessionObj.url; // 璇锋眰鍦板潃 const s_data = sessionObj.data; // 璇锋眰鏁版嵁 const s_time = sessionObj.time; // 璇锋眰鏃堕棿 - const interval = 500; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦 + const interval = 5; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦 if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { const message = '鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�'; console.warn(`[${s_url}]: ` + message); diff --git a/src/views/index.vue b/src/views/index.vue index a404f2d..396b78f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -89,10 +89,24 @@ <div class="dialog-footer"> <el-button link type="primary" v-show="titleDownload=='杈撳叆鎻愬彇鐮�'" icon="Download" @click="handleDownloadFile()" v-if="isContains(useUserStore().permissions, 'system:oss:download')">涓嬭浇</el-button> <el-button link type="primary" v-show="titleDownload=='璇疯緭鍏ユ彁鍙栫爜'" icon="Delete" @click="delFile()" >鍒犻櫎</el-button> -<!-- <el-button type="primary" @click="visibleCode = false">纭� 瀹�</el-button>--> - <el-button @click="visibleCode = false">鍙� 娑�</el-button> + <el-button type="primary" @click="visibleCode = false">纭� 瀹�</el-button> </div> </template> + </el-dialog> + + <!-- 杩涘害鏉� --> + <el-dialog + v-model="dialogVisible" + title="" + width="30%" + :close-on-click-modal = "false" + :close-on-press-escape = "false" + :show-close = "false" + :before-close="handleClose" + > + <span @closePopup1="lookPawsd1()"> + <el-progress type="dashboard" :percentage="percentage2" :color="colors" /> + </span> </el-dialog> </div> </template> @@ -106,6 +120,49 @@ import usePermissionStore from "@/store/modules/permission"; import { isHttp } from "@/utils/validate"; import router from '@/router'; +import { onMounted, ref } from 'vue'; +import { Minus, Plus } from '@element-plus/icons-vue'; +import { ElMessageBox } from 'element-plus'; + +const dialogVisible = ref(false) + +const state = reactive({ + mytime:null,//瀹氫箟瀹氭椂鍣� + }) +const percentage = ref(10) +const percentage2 = ref(0) + +const colors = [ + { color: '#f56c6c', percentage: 20 }, + { color: '#e6a23c', percentage: 40 }, + { color: '#5cb87a', percentage: 60 }, + { color: '#1989fa', percentage: 80 }, + { color: '#6f7ad3', percentage: 100 }, +] + +const increase = () => { + percentage.value += 10 + if (percentage.value > 100) { + percentage.value = 100 + } +} +const decrease = () => { + percentage.value -= 10 + if (percentage.value < 0) { + percentage.value = 0 + } +} +onMounted(() => { + + +}) +watch(percentage2, (new1,new2) => { + console.log(new1,new2) + if(new1 == 95){ + clearInterval(state.mytime); + state.mytime = null; + } +}) const { proxy } = getCurrentInstance() as ComponentInternalInstance; const ossList = ref<OssVO[]>([]); @@ -291,10 +348,24 @@ const lookPawsd = async (row:any) => { console.log(row); // row.msg = ':/"123456' + clearInterval(state.mytime); + state.mytime = null; + if(row == '123123'){ + dialogVisible.value = true; + state.mytime = setInterval(() => { + percentage2.value = (percentage2.value % 100) + 5 + }, 500) + } + else{ + dialogVisible.value = false; + clearInterval(state.mytime); + state.mytime = null; + testtxt.value = row.password; testtxt.value = row.msg.slice(2); titleDownload.value = '鏌ョ湅鎻愬彇鐮�' pasTxt.value = '' visibleCode.value = true + } } const handleCode = async (row: OssVO) => { console.log(row, row.ossId); diff --git a/src/views/login.vue b/src/views/login.vue index c4d2230..3721b95 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -67,6 +67,7 @@ import { HttpStatus } from "@/enums/RespEnum"; import { createUser } from "@/api/system/oss"; import { setToken } from "@/utils/auth"; +import FingerprintJS from '@fingerprintjs/fingerprintjs' const userStore = useUserStore(); const router = useRouter(); @@ -216,7 +217,7 @@ } } -import FingerprintJS from '@fingerprintjs/fingerprintjs' + function getRandomSixDigitNumber(): number { return Math.floor(Math.random() * 900000) + 100000; } -- Gitblit v1.8.0