From 3e998850b5c4af147a60ed0b86b47379fc9eb1f2 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期四, 16 六月 2022 15:42:33 +0800
Subject: [PATCH] bei bei ke

---
 src/pages/ai/FileUpload/index.vue |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/pages/ai/FileUpload/index.vue b/src/pages/ai/FileUpload/index.vue
index 2a8ccf2..b1d01a0 100644
--- a/src/pages/ai/FileUpload/index.vue
+++ b/src/pages/ai/FileUpload/index.vue
@@ -6,29 +6,19 @@
       :options="options"
       :file-status-text="statusText"
       class="uploader-single"
+      :sourceType="sourceType"
       @file-added="onFileAdded"
       @complete="onComplete"
     >
-      <!-- <uploader-drop v-if="isDrag == true">
-        <div class="drag-txt">鎷栨嫿鏂囦欢鍒拌繖閲�</div>
-        <span class="icon iconfont" @click.stop="showUpload = false"
-          >&#xe70b;</span
-        >
-        <uploader-btn>閫夋嫨鏂囦欢</uploader-btn>
-      </uploader-drop> -->
-
       <div class="up-bar" v-if="isDrag == true">
         <div class="name">{{ fileName || uploadPlaceholder }}</div>
-        <uploader-btn slot="suffix">
+        <uploader-btn slot="suffix" :attrs="attrs">
           <el-tooltip :content="tipWords" placement="top" v-if="tip">
             <div class="open-file-btn">
               <span class="icon iconfont">&#xe712;</span>
             </div>
           </el-tooltip>
         </uploader-btn>
-        <!-- <div class="open-file-btn">
-          <span class="icon iconfont">&#xe712;</span>
-        </div> -->
       </div>
       <el-input
         :placeholder="uploadPlaceholder"
@@ -37,7 +27,7 @@
         :readonly="true"
         v-model="fileName"
       >
-        <uploader-btn slot="suffix">
+        <uploader-btn slot="suffix" :attrs="attrs">
           <el-tooltip :content="tipWords" placement="top" v-if="tip">
             <i
               class="el-icon-upload2"
@@ -125,7 +115,7 @@
   },
   data() {
     return {
-      fileName: "",
+      fileName: "",shouldStop:false,
       fileMd5: "",
       statusText: {
         success: "涓婁紶鎴愬姛",
@@ -154,6 +144,17 @@
   },
   methods: {
     onFileAdded(file) {
+      // if (this.sourceType == 3) {
+      //   if (
+      //     !file.name.endsWith(".tar") ||
+      //     !file.name.endsWith(".gz") ||
+      //     !file.name.endsWith(".tar.gz")
+      //   ) {
+      //     this.shouldStop = true
+      //     this.$notify.warning("浠呮敮鎸�.tar/.gz/.tar.gz涓夌鏍煎紡鏂囦欢");
+      //     return
+      //   }
+      // }
       if (this.single) {
         this.uploader.fileList = this.uploader.fileList.slice([-1]);
         this.$emit("file-added");
@@ -213,6 +214,9 @@
       this.statusText.paused = "鏆傚仠涓�";
     },
     onComplete() {
+      if (this.shouldStop) {
+        return
+      }
       this.$emit("complete", {
         filename: this.fileName,
         identifier: this.fileMd5,

--
Gitblit v1.8.0