12345 |
- <<<<<<<< HEAD:dist/assets/index-legacy.3a3809b6.js
- !function(){function e(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||t(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,n){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,i,a=[],l=!0,o=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(a.push(r.value),!n||a.length!==n);l=!0);}catch(u){o=!0,i=u}finally{try{l||null==t.return||t.return()}finally{if(o)throw i}}return a}(e,n)||t(e,n)||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 t(e,n){if(e){if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(e,n):void 0}}function r(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}System.register(["./index-legacy.48c8d62c.js","./index-legacy.71f28922.js","./index-legacy.0e0de364.js","./function-call-legacy.ac971547.js"],(function(t){"use strict";var r,i,a,l,o,u,c,s,f,d,p,v,m,g,y,b,w,h,x,S,A,z,j,k,I,F,R,U,V,C;return{setters:[function(e){r=e.t,i=e.a2,a=e.M,l=e.d,o=e.z,u=e.av,c=e.c,s=e.a5,f=e.L,d=e.bx,p=e.a1,v=e.aN,m=e.N,g=e.w,y=e.u,b=e.v,w=e.aw,h=e.R,x=e.ab,S=e.W,A=e.b1,z=e.ac,j=e.aQ,k=e.K,I=e.al,F=e.E,R=e.r,U=e.D},function(){},function(e){V=e.I},function(e){C=e.s}],execute:function(){var L=n(r("uploader"),3),O=L[0],P=L[1],T=L[2];function B(e,n){return new Promise((function(t){if("file"!==n){var r=new FileReader;r.onload=function(e){t(e.target.result)},"dataUrl"===n?r.readAsDataURL(e):"text"===n&&r.readAsText(e)}else t()}))}function D(e,n){return i(e).some((function(e){return!!e.file&&(a(n)?n(e.file):e.file.size>n)}))}var N=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;function E(e){return!!e.isImage||(e.file&&e.file.type?0===e.file.type.indexOf("image"):e.url?(n=e.url,N.test(n)):"string"==typeof e.content&&0===e.content.indexOf("data:image"));var n}var M=l({props:{name:o,item:u(Object),index:Number,imageFit:String,lazyLoad:Boolean,deletable:Boolean,previewSize:[Number,String,Array],beforeDelete:Function},emits:["delete","preview"],setup:function(e,n){var t=n.emit,r=n.slots,i=function(){var n=e.item,t=n.status,r=n.message;if("uploading"===t||"failed"===t){var i="failed"===t?c(s,{name:"close",class:P("mask-icon")},null):c(f,{class:P("loading")},null),a=p(r)&&""!==r;return c("div",{class:P("mask")},[i,a&&c("div",{class:P("mask-message")},[r])])}},a=function(n){var r=e.name,i=e.item,a=e.index,l=e.beforeDelete;n.stopPropagation(),v(l,{args:[i,{name:r,index:a}],done:function(){return t("delete")}})},l=function(){return t("preview")},o=function(){if(e.deletable&&"uploading"!==e.item.status){var n=r["preview-delete"];return c("div",{role:"button",class:P("preview-delete",{shadow:!n}),tabindex:0,"aria-label":T("delete"),onClick:a},[n?n():c(s,{name:"cross",class:P("preview-delete-icon")},null)])}},u=function(){if(r["preview-cover"]){var n=e.index,t=e.item;return c("div",{class:P("preview-cover")},[r["preview-cover"](m({index:n},t))])}};return function(){return c("div",{class:P("preview")},[(n=e.item,t=e.lazyLoad,r=e.imageFit,a=e.previewSize,E(n)?c(V,{fit:r,src:n.content||n.url,class:P("preview-image"),width:Array.isArray(a)?a[0]:a,height:Array.isArray(a)?a[1]:a,lazyLoad:t,onClick:l},{default:u}):c("div",{class:P("file"),style:d(e.previewSize)},[c(s,{class:P("file-icon"),name:"description"},null),c("div",{class:[P("file-name"),"van-ellipsis"]},[n.file?n.file.name:n.url]),u()])),i(),o()]);var n,t,r,a}}}),K={name:g(""),accept:y("image/*"),capture:String,multiple:Boolean,disabled:Boolean,readonly:Boolean,lazyLoad:Boolean,maxCount:g(1/0),imageFit:y("cover"),resultType:y("dataUrl"),uploadIcon:y("photograph"),uploadText:String,deletable:b,afterRead:Function,showUpload:b,modelValue:w(),beforeRead:Function,beforeDelete:Function,previewSize:[Number,String,Array],previewImage:b,previewOptions:Object,previewFullImage:b,maxSize:{type:[Number,String,Function],default:1/0}},Q=l({name:O,props:K,emits:["delete","oversize","clickUpload","closePreview","clickPreview","update:modelValue"],setup:function(n,t){var r,a=t.emit,l=t.slots,o=h(),u=[],f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.modelValue.length;return{name:n.name,index:e}},p=function(){o.value&&(o.value.value="")},v=function(t){if(p(),D(t,n.maxSize)){if(!Array.isArray(t))return void a("oversize",t,f());var r=function(e,n){var t=[],r=[];return e.forEach((function(e){D(e,n)?r.push(e):t.push(e)})),{valid:t,invalid:r}}(t,n.maxSize);if(t=r.valid,a("oversize",r.invalid,f()),!t.length)return}t=R(t),a("update:modelValue",[].concat(e(n.modelValue),e(i(t)))),n.afterRead&&n.afterRead(t,f())},g=function(e){var t=n.maxCount,r=n.modelValue,i=n.resultType;if(Array.isArray(e)){var a=+t-r.length;e.length>a&&(e=e.slice(0,a)),Promise.all(e.map((function(e){return B(e,i)}))).then((function(n){var t=e.map((function(e,t){var r={file:e,status:"",message:""};return n[t]&&(r.content=n[t]),r}));v(t)}))}else B(e,i).then((function(n){var t={file:e,status:"",message:""};n&&(t.content=n),v(t)}))},y=function(e){var t=e.target.files;if(!n.disabled&&t&&t.length){var r=1===t.length?t[0]:[].slice.call(t);if(n.beforeRead){var i=n.beforeRead(r,f());if(!i)return void p();if(k(i))return void i.then((function(e){g(e||r)})).catch(p)}g(r)}},b=function(){return a("closePreview")},w=function(e,t){var i=["imageFit","deletable","previewSize","beforeDelete"],o=m(I(n,i),I(e,i,!0));return c(M,F({item:e,index:t,onClick:function(){return a("clickPreview",e,f(t))},onDelete:function(){return function(e,t){var r=n.modelValue.slice(0);r.splice(t,1),a("update:modelValue",r),a("delete",e,f(t))}(e,t)},onPreview:function(){return function(e){if(n.previewFullImage){var t=n.modelValue.filter(E),i=t.map((function(e){return e.file&&!e.url&&"failed"!==e.status&&(e.url=URL.createObjectURL(e.file),u.push(e.url)),e.url})).filter(Boolean);r=C(m({images:i,startPosition:t.indexOf(e),onClose:b},n.previewOptions))}}(e)}},I(n,["name","lazyLoad"]),o),I(l,["preview-cover","preview-delete"]))},U=function(){if(n.previewImage)return n.modelValue.map(w)},V=function(e){return a("clickUpload",e)},L=function(){if(!(n.modelValue.length>=n.maxCount)){var e=n.readonly?null:c("input",{ref:o,type:"file",class:P("input"),accept:n.accept,capture:n.capture,multiple:n.multiple,disabled:n.disabled,onChange:y},null);return l.default?c("div",{class:P("input-wrapper"),onClick:V},[l.default(),e]):z(c("div",{class:P("upload",{readonly:n.readonly}),style:d(n.previewSize),onClick:V},[c(s,{name:n.uploadIcon,class:P("upload-icon")},null),n.uploadText&&c("span",{class:P("upload-text")},[n.uploadText]),e]),[[j,n.showUpload]])}};return x((function(){u.forEach((function(e){return URL.revokeObjectURL(e)}))})),S({chooseFile:function(){o.value&&!n.disabled&&o.value.click()},closeImagePreview:function(){r&&r.close()}}),A((function(){return n.modelValue})),function(){return c("div",{class:P()},[c("div",{class:P("wrapper",{disabled:n.disabled})},[U(),L()])])}}});t("U",U(Q))}}}))}();
- ========
- !function(){function e(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||t(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,n){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,i,a=[],l=!0,o=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(a.push(r.value),!n||a.length!==n);l=!0);}catch(u){o=!0,i=u}finally{try{l||null==t.return||t.return()}finally{if(o)throw i}}return a}(e,n)||t(e,n)||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 t(e,n){if(e){if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(e,n):void 0}}function r(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}System.register(["./index-legacy.c1f63540.js","./index-legacy.ffbb8461.js","./index-legacy.45d07924.js","./function-call-legacy.f2346a20.js"],(function(t){"use strict";var r,i,a,l,o,u,c,s,f,d,p,v,m,g,y,b,w,h,x,S,A,z,j,k,I,R,F,U,V,C;return{setters:[function(e){r=e.t,i=e.a2,a=e.M,l=e.d,o=e.z,u=e.aB,c=e.c,s=e.a5,f=e.L,d=e.bB,p=e.a1,v=e.aR,m=e.N,g=e.w,y=e.u,b=e.v,w=e.av,h=e.R,x=e.ab,S=e.W,A=e.b4,z=e.ac,j=e.ay,k=e.K,I=e.am,R=e.E,F=e.r,U=e.D},function(){},function(e){V=e.I},function(e){C=e.s}],execute:function(){var L=n(r("uploader"),3),O=L[0],P=L[1],B=L[2];function T(e,n){return new Promise((function(t){if("file"!==n){var r=new FileReader;r.onload=function(e){t(e.target.result)},"dataUrl"===n?r.readAsDataURL(e):"text"===n&&r.readAsText(e)}else t()}))}function D(e,n){return i(e).some((function(e){return!!e.file&&(a(n)?n(e.file):e.file.size>n)}))}var E=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;function N(e){return!!e.isImage||(e.file&&e.file.type?0===e.file.type.indexOf("image"):e.url?(n=e.url,E.test(n)):"string"==typeof e.content&&0===e.content.indexOf("data:image"));var n}var M=l({props:{name:o,item:u(Object),index:Number,imageFit:String,lazyLoad:Boolean,deletable:Boolean,previewSize:[Number,String,Array],beforeDelete:Function},emits:["delete","preview"],setup:function(e,n){var t=n.emit,r=n.slots,i=function(){var n=e.item,t=n.status,r=n.message;if("uploading"===t||"failed"===t){var i="failed"===t?c(s,{name:"close",class:P("mask-icon")},null):c(f,{class:P("loading")},null),a=p(r)&&""!==r;return c("div",{class:P("mask")},[i,a&&c("div",{class:P("mask-message")},[r])])}},a=function(n){var r=e.name,i=e.item,a=e.index,l=e.beforeDelete;n.stopPropagation(),v(l,{args:[i,{name:r,index:a}],done:function(){return t("delete")}})},l=function(){return t("preview")},o=function(){if(e.deletable&&"uploading"!==e.item.status){var n=r["preview-delete"];return c("div",{role:"button",class:P("preview-delete",{shadow:!n}),tabindex:0,"aria-label":B("delete"),onClick:a},[n?n():c(s,{name:"cross",class:P("preview-delete-icon")},null)])}},u=function(){if(r["preview-cover"]){var n=e.index,t=e.item;return c("div",{class:P("preview-cover")},[r["preview-cover"](m({index:n},t))])}};return function(){return c("div",{class:P("preview")},[(n=e.item,t=e.lazyLoad,r=e.imageFit,a=e.previewSize,N(n)?c(V,{fit:r,src:n.content||n.url,class:P("preview-image"),width:Array.isArray(a)?a[0]:a,height:Array.isArray(a)?a[1]:a,lazyLoad:t,onClick:l},{default:u}):c("div",{class:P("file"),style:d(e.previewSize)},[c(s,{class:P("file-icon"),name:"description"},null),c("div",{class:[P("file-name"),"van-ellipsis"]},[n.file?n.file.name:n.url]),u()])),i(),o()]);var n,t,r,a}}}),K={name:g(""),accept:y("image/*"),capture:String,multiple:Boolean,disabled:Boolean,readonly:Boolean,lazyLoad:Boolean,maxCount:g(1/0),imageFit:y("cover"),resultType:y("dataUrl"),uploadIcon:y("photograph"),uploadText:String,deletable:b,afterRead:Function,showUpload:b,modelValue:w(),beforeRead:Function,beforeDelete:Function,previewSize:[Number,String,Array],previewImage:b,previewOptions:Object,previewFullImage:b,maxSize:{type:[Number,String,Function],default:1/0}},W=l({name:O,props:K,emits:["delete","oversize","clickUpload","closePreview","clickPreview","update:modelValue"],setup:function(n,t){var r,a=t.emit,l=t.slots,o=h(),u=[],f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.modelValue.length;return{name:n.name,index:e}},p=function(){o.value&&(o.value.value="")},v=function(t){if(p(),D(t,n.maxSize)){if(!Array.isArray(t))return void a("oversize",t,f());var r=function(e,n){var t=[],r=[];return e.forEach((function(e){D(e,n)?r.push(e):t.push(e)})),{valid:t,invalid:r}}(t,n.maxSize);if(t=r.valid,a("oversize",r.invalid,f()),!t.length)return}t=F(t),a("update:modelValue",[].concat(e(n.modelValue),e(i(t)))),n.afterRead&&n.afterRead(t,f())},g=function(e){var t=n.maxCount,r=n.modelValue,i=n.resultType;if(Array.isArray(e)){var a=+t-r.length;e.length>a&&(e=e.slice(0,a)),Promise.all(e.map((function(e){return T(e,i)}))).then((function(n){var t=e.map((function(e,t){var r={file:e,status:"",message:""};return n[t]&&(r.content=n[t]),r}));v(t)}))}else T(e,i).then((function(n){var t={file:e,status:"",message:""};n&&(t.content=n),v(t)}))},y=function(e){var t=e.target.files;if(!n.disabled&&t&&t.length){var r=1===t.length?t[0]:[].slice.call(t);if(n.beforeRead){var i=n.beforeRead(r,f());if(!i)return void p();if(k(i))return void i.then((function(e){g(e||r)})).catch(p)}g(r)}},b=function(){return a("closePreview")},w=function(e,t){var i=["imageFit","deletable","previewSize","beforeDelete"],o=m(I(n,i),I(e,i,!0));return c(M,R({item:e,index:t,onClick:function(){return a("clickPreview",e,f(t))},onDelete:function(){return function(e,t){var r=n.modelValue.slice(0);r.splice(t,1),a("update:modelValue",r),a("delete",e,f(t))}(e,t)},onPreview:function(){return function(e){if(n.previewFullImage){var t=n.modelValue.filter(N),i=t.map((function(e){return e.file&&!e.url&&"failed"!==e.status&&(e.url=URL.createObjectURL(e.file),u.push(e.url)),e.url})).filter(Boolean);r=C(m({images:i,startPosition:t.indexOf(e),onClose:b},n.previewOptions))}}(e)}},I(n,["name","lazyLoad"]),o),I(l,["preview-cover","preview-delete"]))},U=function(){if(n.previewImage)return n.modelValue.map(w)},V=function(e){return a("clickUpload",e)},L=function(){if(!(n.modelValue.length>=n.maxCount)){var e=n.readonly?null:c("input",{ref:o,type:"file",class:P("input"),accept:n.accept,capture:n.capture,multiple:n.multiple,disabled:n.disabled,onChange:y},null);return l.default?c("div",{class:P("input-wrapper"),onClick:V},[l.default(),e]):z(c("div",{class:P("upload",{readonly:n.readonly}),style:d(n.previewSize),onClick:V},[c(s,{name:n.uploadIcon,class:P("upload-icon")},null),n.uploadText&&c("span",{class:P("upload-text")},[n.uploadText]),e]),[[j,n.showUpload]])}};return x((function(){u.forEach((function(e){return URL.revokeObjectURL(e)}))})),S({chooseFile:function(){o.value&&!n.disabled&&o.value.click()},closeImagePreview:function(){r&&r.close()}}),A((function(){return n.modelValue})),function(){return c("div",{class:P()},[c("div",{class:P("wrapper",{disabled:n.disabled})},[U(),L()])])}}});t("U",U(W))}}}))}();
- >>>>>>>> online:dist/assets/index-legacy.cd65292c.js
|