Sfoglia il codice sorgente

Merge branch 'lcq' into test

morphone1995 5 anni fa
parent
commit
22c70b1cc0
1 ha cambiato i file con 45 aggiunte e 2 eliminazioni
  1. 45 2
      src/components/icss/AddMedicinePrompt.vue

+ 45 - 2
src/components/icss/AddMedicinePrompt.vue

@@ -47,7 +47,9 @@
                         <el-input v-model="form.fileTitle"></el-input>
                 </el-form-item>
                  <el-form-item  v-if="upload" label="上传文件:" ref="upload" prop="fileList" label-width="160px">
-                      <el-upload                         
+                      <el-upload 
+                          @mouseenter.native="handleMouseenter"                        
+                          @mouseleave.native="handleMouseleave"                        
                           class="upload-demo"
                           :action="config.urls.promptServer"
                           name="upfile"
@@ -64,6 +66,7 @@
                           <el-button size="small" type="primary" v-if="showUpLoad">点击上传</el-button>
                              <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
                       </el-upload>
+                      <span class="tipInfo" v-show="isShowTip">{{form.fileList[0]&&form.fileList[0].name}}</span>
                       <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
                 </el-form-item>
                 <el-form-item  label-width="160px"><div class="uploadInfo" v-if="isSuccessUpload===1">文件上传中,请稍等...</div></el-form-item>
@@ -142,6 +145,7 @@
         upload: false,
         showConfirm: true,
         isSuccessUpload: 0, //是否上传成功  0: 不在上传  1: 上传过程中  2: 上传成功
+        isShowTip: false
       }
     },
 
@@ -192,6 +196,8 @@
         });
       }
     },
+    mounted(){
+    },
     beforeRouteLeave (to, from, next) {     
        if(this.isSuccessUpload === 1 ) {
         this.$confirm('文件正在上传,是否确定返回?', '提示', {
@@ -221,6 +227,14 @@
 
     },
     methods: {
+      handleMouseenter(){
+        if(this.form.fileList.length !== 0 ){
+          this.isShowTip = true
+        }
+      },
+      handleMouseleave(){
+        this.isShowTip = false
+      },
       changeWord(newVal){
         const name = newVal.nameType;
         this.form.selectedTermName = name;
@@ -515,6 +529,7 @@
       color: #22ccc8!important;
     }
     .upload-demo{
+      width: 300px;
       /deep/.el-upload-list__item .el-icon-close-tip{
         display: none !important;
       } 
@@ -535,7 +550,35 @@
       margin-top: -20px;
       color: #606266;
     }
-
+    .tipInfo{
+      position: absolute;
+      // position: relative;
+      line-height: 24px;
+      top: -56px;
+      left: 20px;
+      // background-color: transparent;
+      // color: #606266;
+      padding: 3px 10px;
+      border-radius: 4px;
+      margin: 100px auto;
+      background-color: #4D4D4D;
+      text-align: center;
+      color: #fff;
+      font-size: 14px;
+    }
+    .tipInfo:before{
+      content: '';
+      display: block;
+      position: absolute;
+      // bottom: 9px;
+      top: -10px;
+      left: 18px;
+      border-bottom: 6px solid #4D4D4D;
+      border-top: 6px solid transparent;
+      border-left: 6px solid transparent;
+      border-right: 6px solid transparent;
+      // border-right: 6px solid #4D4D4D;
+    }