白酒新熟山中归,黄鸡啄黍秋正肥。 呼童烹鸡酌白酒,儿女嬉笑牵人衣。 高歌取醉欲自慰,起舞落日争光辉。 游说万乘苦不早,著鞭跨马涉远道。 会稽愚妇轻买臣,余亦辞家西入秦。 仰天大笑出门去,我辈岂是蓬蒿人。

Vue Element-ui el-upload

<el-form-item prop="" label="幻灯图">
          <el-upload
            :name="'attachment'"
            :action="uploaderRequestUrl"
            list-type="picture-card"
            :on-preview="handlePreview"
            :before-remove="beforeHandleRemove"
            :on-remove="handleRemove"
            :headers="uploadHeader"
            :on-success="handleSuccess"
            :on-error="handleError"
            :auto-upload="true"
            :before-upload="beforeUpload"
            :limit="slideLimit"
            :file-list="slideFileList"
            :on-exceed="handleExceed"
          >
            <i class="el-icon-plus"></i>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>
handlePreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },

beforeHandleRemove(file, fileList) {
      return true;
    },
    handleRemove(file, fileList) {
      if (file && file.status === "success") {
        this.slideFileList = fileList;
        this.form.cover.slide = [];
        if (this.slideFileList.length > 0) {
          for (let i = 0; i < this.slideFileList.length; i++) {
            this.form.cover.slide[i] = this.slideFileList[i].url;
          }
        }
      }
    },

beforeUpload(file) {
      let limit = 5;
      const isLtxM = file.size / 1024 / 1024 < limit;
      if (!isLtxM) {
        this.$message.error("上传文件大小不能超过" + limit + "MB!");
        return false;
      }
      return true;
    },
    handleSuccess(res) {
      if (res.error !== 0) {
        console.log("err");
        this.uploadErrorTip(res.message);
      } else {
        console.log("succ");
        this.uploadSuccessTip();
        // console.log(res);
        let filePath = res.data.file_path;
        this.form.cover.slide.push(filePath);
        // console.log(this.form.cover.slide);
        this.slideFileList = this.form.cover.slide.map(item => {
          return {
            name: item,
            url: item
          };
        });
        // console.log(this.slideFileList);
      }
      this.listLoading = false;
      this.isUploading = false;
    },
    handleError(res) {
      this.uploadErrorTip("上传失败");
      this.listLoading = false;
      this.isUploading = false;
    },

uploadErrorTip(msg) {
      this.$message.error(msg);
    },
    uploadSuccessTip() {
      this.$message({
        message: "上传成功",
        type: "success"
      });
    },
    handleExceed(files, fileList) {
      this.$message.warning(`最多可以 ${this.slideLimit} 个文件`);
    }
computed: {
    uploaderRequestUrl() {
      return `${process.env.VUE_APP_BASE_API}remote-upload`;
    }
  },

 

阿斯达按时打算打算打算大所多按时

posted @ 2021-01-12 15:52  格罗玛什·地狱咆哮  阅读(162)  评论(1编辑  收藏  举报

君不见黄河之水天上来,奔流到海不复回。
君不见高堂明镜悲白发,朝如青丝暮成雪。
人生得意须尽欢,莫使金樽空对月。
天生我材必有用,千金散尽还复来。
烹羊宰牛且为乐,会须一饮三百杯。
岑夫子,丹丘生,将进酒,君莫停。
与君歌一曲,请君为我侧耳听。
钟鼓馔玉何足贵,但愿长醉不复醒。
古来圣贤皆寂寞,惟有饮者留其名。
陈王昔时宴平乐,斗酒十千恣欢谑。
主人何为言少钱,径须沽取对君酌。
五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。