index-legacy.3fcfb05e.js 12 KB

1
  1. !function(){function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,l,o=[],i=!0,a=!1;try{for(t=t.call(e);!(i=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);i=!0);}catch(u){a=!0,l=u}finally{try{i||null==t.return||t.return()}finally{if(a)throw l}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function t(e,n,t,r,l,o,i){try{var a=e[o](i),u=a.value}catch(s){return void t(s)}a.done?n(u):Promise.resolve(u).then(r,l)}function r(e){return function(){var n=this,r=arguments;return new Promise((function(l,o){var i=e.apply(n,r);function a(e){t(i,l,o,a,u,"next",e)}function u(e){t(i,l,o,a,u,"throw",e)}a(void 0)}))}}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){i(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var a=document.createElement("style");a.innerHTML="._uploadSection_1nixx_1{width:150px;height:85px;background:#f8faf9;border-radius:10px;border:1px solid rgba(45,199,170,.26);font-size:14px;color:#2dc7aa;line-height:20px}._uploadFile_1nixx_11{width:100%;min-width:300px;height:50px;border:1px solid rgba(142,142,142,.26);border-radius:10px;display:flex;align-items:center;padding:0 15px;color:var(--el-text-color-regular)}._uploadFile_1nixx_11 .el-icon{margin-right:5px}._fileUpload_1nixx_25 .el-upload--text{width:100%}._fileUpload_1nixx_25 .el-loading-spinner{display:flex;align-items:center;height:42px!important;justify-content:center;margin-top:-20px!important}._fileUpload_1nixx_25 .el-loading-spinner svg{width:20px;height:20px;margin-right:5px}._uploadClass_1nixx_40{height:85px;width:100%}._uploadClass_1nixx_40 .el-loading-spinner{margin-top:-33px;height:85px}\n",document.head.appendChild(a),System.register(["./index-legacy.90803b59.js","./icon_upload-legacy.0e79f69b.js"],(function(n){"use strict";var t,l,i,a,u,s,c,d,p,f,g,v,b,m,h,x,y,w,k,_,S,C,j,O,P,A,L,E,U,T;return{setters:[function(e){t=e.t,l=e.f,i=e.r,a=e.bE,u=e.$,s=e.h,c=e.D,d=e.a0,p=e.a1,f=e.c,g=e.T,v=e.bF,b=e.S,m=e.n,h=e.b2,x=e.bG,y=e.bH,w=e.bI,k=e.ad,_=e.b8,S=e.bJ,C=e.d,j=e.be,O=e.b,P=e.bK,A=e.H,L=e.bL,E=e.a},function(e){U=e.E,T=e.i}],execute:function(){function V(e){var n,r=t("loading"),b=l(!1),m=i(o(o({},e),{},{originalPosition:"",originalOverflow:"",visible:!1}));function h(){var e=m.parent;if(!e.vLoadingAddClassList){var n=e.getAttribute("loading-number");(n=Number.parseInt(n)-1)?e.setAttribute("loading-number",n.toString()):(v(e,r.bm("parent","relative")),e.removeAttribute("loading-number")),v(e,r.bm("parent","hidden"))}x(),w.unmount()}function x(){var e,n;null==(n=null==(e=k.$el)?void 0:e.parentNode)||n.removeChild(k.$el)}function y(){b.value&&(b.value=!1,h())}var w=a({name:"ElLoading",setup:function(){return function(){var e=m.spinner||m.svg,n=s("svg",o({class:"circular",viewBox:m.svgViewBox?m.svgViewBox:"25 25 50 50"},e?{innerHTML:e}:{}),[s("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none"})]),t=m.text?s("p",{class:r.b("text")},[m.text]):void 0;return s(g,{name:r.b("fade"),onAfterLeave:y},{default:c((function(){return[d(f("div",{style:{backgroundColor:m.background||""},class:[r.b("mask"),m.customClass,m.fullscreen?"is-fullscreen":""]},[s("div",{class:r.b("spinner")},[n,t])]),[[p,m.visible]])]}))})}}}),k=w.mount(document.createElement("div"));return o(o({},u(m)),{},{setText:function(e){m.text=e},removeElLoadingChild:x,close:function(){var t;e.beforeClose&&!e.beforeClose()||(m.parent.vLoadingAddClassList=void 0,b.value=!0,clearTimeout(n),n=window.setTimeout((function(){b.value&&(b.value=!1,h())}),400),m.visible=!1,null==(t=e.closed)||t.call(e))},handleAfterLeave:y,vm:k,get $el(){return k.$el}})}var I=void 0,B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(b){var n=$(e);if(n.fullscreen&&I)return I;var t=V(o(o({},n),{},{closed:function(){var e;null==(e=n.closed)||e.call(n),n.fullscreen&&(I=void 0)}}));F(n,n.parent,t),R(n,n.parent,t),n.parent.vLoadingAddClassList=function(){return R(n,n.parent,t)};var r=n.parent.getAttribute("loading-number");return r=r?"".concat(Number.parseInt(r)+1):"1",n.parent.setAttribute("loading-number",r),n.parent.appendChild(t.$el),m((function(){return t.visible.value=n.visible})),n.fullscreen&&(I=t),t}},$=function(e){var n,t,r,l,o;return{parent:(o=h(e.target)?null!=(n=document.querySelector(e.target))?n:document.body:e.target||document.body)===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&(null==(t=e.fullscreen)||t),lock:null!=(r=e.lock)&&r,customClass:e.customClass||"",visible:null==(l=e.visible)||l,target:o}},F=function(){var n=r(regeneratorRuntime.mark((function n(t,r,l){var o,i,a,u,s,c,d,p,f,g,v,b,h,w,k;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=x(),i=o.nextZIndex,a={},!t.fullscreen){n.next=8;break}l.originalPosition.value=y(document.body,"position"),l.originalOverflow.value=y(document.body,"overflow"),a.zIndex=i(),n.next=17;break;case 8:if(t.parent!==document.body){n.next=16;break}return l.originalPosition.value=y(document.body,"position"),n.next=12,m();case 12:for(u=0,s=["top","left"];u<s.length;u++)d="top"===(c=s[u])?"scrollTop":"scrollLeft",a[c]="".concat(t.target.getBoundingClientRect()[c]+document.body[d]+document.documentElement[d]-Number.parseInt(y(document.body,"margin-".concat(c)),10),"px");for(p=0,f=["height","width"];p<f.length;p++)a[g=f[p]]="".concat(t.target.getBoundingClientRect()[g],"px");n.next=17;break;case 16:l.originalPosition.value=y(r,"position");case 17:for(v=0,b=Object.entries(a);v<b.length;v++)h=e(b[v],2),w=h[0],k=h[1],l.$el.style[w]=k;case 18:case"end":return n.stop()}}),n)})));return function(e,t,r){return n.apply(this,arguments)}}(),R=function(e,n,r){var l=t("loading");"absolute"!==r.originalPosition.value&&"fixed"!==r.originalPosition.value?w(n,l.bm("parent","relative")):v(n,l.bm("parent","relative")),e.fullscreen&&e.lock?w(n,l.bm("parent","hidden")):v(n,l.bm("parent","hidden"))},D=Symbol("ElLoading"),N=function(e,n){var t,r,o,i,a=n.instance,u=function(e){return k(n.value)?n.value[e]:void 0},s=function(n){return t=u(n)||e.getAttribute("element-loading-".concat(S(n))),(r=h(t)&&(null==a?void 0:a[t])||t)?l(r):r;var t,r},c=null!=(t=u("fullscreen"))?t:n.modifiers.fullscreen,d={text:s("text"),svg:s("svg"),svgViewBox:s("svgViewBox"),spinner:s("spinner"),background:s("background"),customClass:s("customClass"),fullscreen:c,target:null!=(r=u("target"))?r:c?void 0:e,body:null!=(o=u("body"))?o:n.modifiers.body,lock:null!=(i=u("lock"))?i:n.modifiers.lock};e[D]={options:d,instance:B(d)}},z={mounted:function(e,n){n.value&&N(e,n)},updated:function(e,n){var t=e[D];n.oldValue!==n.value&&(n.value&&!n.oldValue?N(e,n):n.value&&n.oldValue?k(n.value)&&function(e,n){for(var t=0,r=Object.keys(n);t<r.length;t++){var l=r[t];_(n[l])&&(n[l].value=e[l])}}(n.value,t.options):null==t||t.instance.close())},unmounted:function(e){var n;null==(n=e[D])||n.instance.close()}},K=n("E",{install:function(e){e.directive("loading",z),e.config.globalProperties.$loading=B},directive:z,service:B}),M={uploadSection:"_uploadSection_1nixx_1",uploadFile:"_uploadFile_1nixx_11",fileUpload:"_fileUpload_1nixx_25",uploadClass:"_uploadClass_1nixx_40"};n("C",C({name:"col-upload",props:{modelValue:{type:String,default:""},uploadType:{type:String,default:"image"},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},size:{type:Number,default:5},accept:{type:String,default:".png,.jpg,.jpeg"},tips:{type:String,default:"请上传图片"},extraTips:{type:String,default:"图片最大不能超过5MB"},onChange:{type:Function,default:function(){}}},data:function(){return{ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},fileList:[],loading:null}},methods:{handleSuccess:function(){var e;null===(e=this.loading)||void 0===e||e.close();var n=this.ossUploadUrl+"/"+this.dataObj.key;console.log(n),this.$emit("update:modelValue",n),this.onChange(n)},handleRemove:function(){console.log("remove")},handleChange:function(){console.log("handleChange")},handleProgress:function(){console.log("handleProgress")},handleError:function(){var e;null===(e=this.loading)||void 0===e||e.close()},beforeUpload:function(e){var n=this;return r(regeneratorRuntime.mark((function t(){var r,l,o,i,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log(e),!0,!n.size){t.next=7;break}if(e.size/1024/1024<n.size){t.next=7;break}return j.error("文件大小不能超过".concat(n.size,"M!")),t.abrupt("return",!1);case 7:return n.loading=K.service({target:n.$refs.uploadDom,lock:!0,fullscreen:!1,text:"上传中...",background:"rgba(0, 0, 0, 0.7)"}),console.log(n.loading),t.prev=9,r=e.name.replaceAll(" ","_"),l=(new Date).getTime()+r,o={filename:r,bucketName:n.bucket,postData:{filename:r,acl:"public-read",key:l,unknowValueField:[]}},t.next=15,O.post("/api-website/getUploadSign",{data:o});case 15:i=t.sent,a=i.data,n.dataObj={policy:a.policy,signature:a.signature,key:l,KSSAccessKeyId:a.kssAccessKeyId,acl:"public-read",name:r},t.next=23;break;case 20:t.prev=20,t.t0=t.catch(9),n.loading.close();case 23:case"end":return t.stop()}}),t,null,[[9,20]])})))()},fileName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split("/").pop()},handleExceed:function(){}},render:function(){var e=this;return f("div",{class:[M.colUpload,"w-full"]},[f(U,{disabled:this.disabled,action:this.ossUploadUrl,data:this.dataObj,onSuccess:this.handleSuccess,onRemove:this.handleRemove,onChange:this.handleChange,onProgress:this.handleProgress,onError:this.handleError,fileList:this.fileList,showFileList:!1,accept:this.accept,beforeUpload:this.beforeUpload,onExceed:this.handleExceed,ref:"uploadRef",class:"file"===this.uploadType?M.fileUpload:""},{default:function(){return[f("div",{ref:"uploadDom",class:[M.uploadClass,"w-full"],style:{height:"image"===e.uploadType?"85px":"48px"}},[e.modelValue?"image"===e.uploadType?f(P,{src:e.modelValue,fit:"cover",class:M.uploadSection},null):f("div",{class:M.uploadFile},[f(A,null,{default:function(){return[f(L,null,null)]}}),f("span",{class:"whitespace-nowrap overflow-hidden text-ellipsis"},[e.fileName(e.modelValue)])]):"image"===e.uploadType?f("div",{class:[M.uploadSection,"flex items-center flex-col justify-center"]},[f("img",{src:T,class:"w-8 h-7 mb-3"},null),f("p",null,[e.tips])]):f("div",{class:M.uploadFile},[f(A,null,{default:function(){return[f(L,null,null)]}}),E("上传文件")])])]}}),f("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips])])}}))}}}))}();