odc.xiaohui
2023-12-21 ca26e87474787aa197211398f5b961d6dd4ea1a5
src/views/index.vue
@@ -23,8 +23,9 @@
        <el-row  style="text-align: center">
          <el-col>
          <el-input v-model="input1" placeholder="请输入提取码" style="width: 150px">
    </el-input>
               </el-input>
            <el-button type="primary" @click="downloadFile">下载</el-button>
            <el-button type="primary" plain icon="Upload" @click="handleFile" v-if="isContains(useUserStore().permissions, 'system:oss:upload')">上传文件</el-button>
          </el-col>
<!--          <el-col :span="1.5">-->
@@ -68,7 +69,7 @@
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
      <el-form ref="ossFormRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="文件名">
          <fileUpload ref="childFile" @closePopup="getList();lookPawsd($event)"  v-model="form.file"  v-if="type === 0" />
          <fileUpload ref="childFile" @closePopup="getList();lookPawsd($event)" @openPopup="lookPawsd($event)" v-model="form.file"  v-if="type === 0" />
          <imageUpload v-model="form.file" v-if="type === 1" />
          <video-upload v-model="form.file" v-if="type === 2" />
        </el-form-item>
@@ -95,6 +96,19 @@
        </div>
      </template>
    </el-dialog>
    <el-dialog
      v-model="dialogVisible"
      title=""
      width="37%"
      :close-on-click-modal = "false"
      :close-on-press-escape = "false"
      :show-close = "false"
    >
    <span @closePopup1="lookPawsd1()">
    <el-progress type="dashboard" :percentage="percentage2" style="display: flex;justify-content: center" :color="colors" />
    </span>
    </el-dialog>
  </div>
</template>
@@ -107,6 +121,7 @@
import usePermissionStore from "@/store/modules/permission";
import { isHttp } from "@/utils/validate";
import router from '@/router';
import { ref } from "vue";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const ossList = ref<OssVO[]>([]);
@@ -122,6 +137,13 @@
const previewListResource = ref(true);
const dateRangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']);
const visibleCode = ref(false);
const colors = [
  { color: '#f56c6c', percentage: 20 },
  { color: '#e6a23c', percentage: 40 },
  { color: '#5cb87a', percentage: 60 },
  { color: '#1989fa', percentage: 80 },
  { color: '#6f7ad3', percentage: 100 },
]
const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
@@ -141,7 +163,8 @@
const ossFormRef = ref<ElFormInstance>();
const queryFormRef = ref<ElFormInstance>();
const dialogVisible = ref(false)
const percentage2 = ref(0)
const initFormData = {
  file: undefined,
}
@@ -266,6 +289,7 @@
/** 任务日志列表查询 */
/** 文件按钮操作 */
const handleFile = () => {
  percentage2.value = 0;
  reset();
  type.value = 0;
  dialog.visible = true;
@@ -290,13 +314,39 @@
  await childFile.value.handleCilck()
  dialog.visible = false;
}
const lookPawsd = async (row:any) => {
  console.log(row);
  // row.msg = ':/"123456'
      testtxt.value = row.msg.slice(2);
      titleDownload.value = '查看提取码'
      pasTxt.value = ''
      visibleCode.value = true
const state = reactive({
  mytime:0,//定义定时器
})
watch(percentage2, (new1,new2) => {
  console.log(new1,new2)
  if(new1 == 95){
    clearInterval(state.mytime);
    state.mytime = 0;
  }
})
const lookPawsd1 = async () => {
  dialogVisible.value = true;
}
const lookPawsd = async (row: any) => {
  console.log(row, row.ossId);
  clearInterval(state.mytime);
  state.mytime = 0;
  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 = 0;
    testtxt.value = row.password;
    titleDownload.value = '查看提取码'
    pasTxt.value = ''
    visibleCode.value = true
  }
}
const handleCode = async (row: OssVO) => {
  console.log(row, row.ossId);
@@ -304,7 +354,7 @@
  await examineIds(row.ossId).then(res => {
    console.log(res);
    if (res.code == 200) {
      testtxt.value = res.msg;
      testtxt.value = res.data.password
      titleDownload.value = '查看提取码'
      pasTxt.value = ''
      // inputSty.value ={