qirong
2023-12-12 1357e7d57eb6a27333f86cbcb8517428f3f4ea9a
修改上传
5个文件已修改
89 ■■■■ 已修改文件
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FileUpload/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip
Binary files differ
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("正在上传文件,请稍候...");
    number.value++;
    return true;
}
@@ -159,7 +159,7 @@
    proxy?.$modal.msgError("上传文件失败");
}
const handleUploadProgress=(e: any) => {
  downloadLoadingInstance = ElLoading.service({ text: '正在上传文件,请稍候', 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();
    }
}
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 = '数据正在处理,请勿重复提交';
          console.warn(`[${s_url}]: ` + message);
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);
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;
}