1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0a3858"],{"0310":function(t,s,e){"use strict";e.r(s);var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("el-dialog",{attrs:{visible:t.visible,title:t.$t("oss.upload"),"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(s){t.visible=s}}},[e("el-upload",{staticClass:"text-center",attrs:{action:t.url,"file-list":t.fileList,drag:"",multiple:"","before-upload":t.beforeUploadHandle,"on-success":t.successHandle}},[e("i",{staticClass:"el-icon-upload"}),e("div",{staticClass:"el-upload__text",domProps:{innerHTML:t._s(t.$t("upload.text"))}}),e("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v(t._s(t.$t("upload.tip",{format:"jpg、png、gif"})))])])],1)},a=[],l=(e("99af"),e("a78e")),n=e.n(l),o={data:function(){return{visible:!1,url:"",num:0,fileList:[]}},methods:{init:function(){this.visible=!0,this.url="".concat(window.SITE_CONFIG["apiURL"],"/sys/oss/upload?token=").concat(n.a.get("token")),this.num=0,this.fileList=[]},beforeUploadHandle:function(t){if("image/jpg"!==t.type&&"image/jpeg"!==t.type&&"image/png"!==t.type&&"image/gif"!==t.type)return this.$message.error(this.$t("upload.tip",{format:"jpg、png、gif"})),!1;this.num++},successHandle:function(t,s,e){var i=this;if(0!==t.code)return this.$message.error(t.msg);this.fileList=e,this.num--,0===this.num&&this.$message({message:this.$t("prompt.success"),type:"success",duration:500,onClose:function(){i.visible=!1,i.$emit("successSubmit")}})}}},u=o,c=e("2877"),p=Object(c["a"])(u,i,a,!1,null,null,null);s["default"]=p.exports}}]); |