css实现Mac端滚动条

 // 导入excel,csv格式
    importExcel(file) {

      if (file.status !== 'ready') return
 // 通过截取字符串获取文件格式
      const types = file.name.split('.')[1]
      判断当前文件格式是否是xlsx
      if (types !== 'xlsx') {
        this.$notify({
          title: '提示',
          message: `文件格式不正确,只支持.xlsx文件`,
          type: 'error',
        })
        return
      }
      this.fileExcel(file).then((tabJson) => {
        console.log('解析文件', tabJson)
        if (tabJson && tabJson.length > 0) {
          this.xlsxJson = tabJson
          console.log('解析文件1', this.xlsxJson)
        }
        if (this.totalLength > 5000) {
          this.openError()
          return
        }
        if (this.tableData.length) {
          // 有错误!!!!
          this.dialogVisible = true
        } else {
          this.importLoading = true
          this.submitUpload()
        }
      })
    },



        <div class="dialogUploadProduct-upload">
          <!-- <el-button plain size="small" @click="importProductInformation"
            >上传文件</el-button
          > -->

          <el-upload
            class="avatar-uploader"
            :on-change="importExcel"
            :action="excelUrl"
            :show-file-list="false"
            :http-request="httpRequest"
            :before-upload="beforeAvatarUpload"
          >
            <!-- :on-success="handleAvatarSuccess" -->
            <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">
              支持扩展名:'xlsx'
            </div>
          </el-upload>

          <!-- <span style="color: #a4a4a2">支持扩展名:'xls、xlsx、csv'</span> -->
          <a @click="downloadTemplate">点击下载商品清单模版</a>
        </div>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值