@lingshugroup/web-plus 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/core/index/index.js +9 -9
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/core/index/index.js.br +0 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/core/index/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/shared/index/index.js +6 -6
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/shared/index/index.js.br +0 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/shared/index/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/utils/dom/style/index.js +3 -3
- package/lib/node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/utils/dom/style/index.js.br +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/utils/dom/style/index.js.gz +0 -0
- package/lib/packages/ls-components/components/_directives/auth/index.cjs +1 -1
- package/lib/packages/ls-components/components/_directives/auth/index.js +25 -19
- package/lib/packages/ls-components/components/_directives/auth/index.js.br +0 -0
- package/lib/packages/ls-components/components/_directives/auth/index.js.gz +0 -0
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.cjs +1 -1
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js +42 -40
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js.br +0 -0
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js.gz +0 -0
- package/lib/packages/ls-components/components/button/Button.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index.js +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index2.js +26 -24
- package/lib/packages/ls-components/components/button/Button.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/button/Button.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js +43 -38
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/dialog/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/types/index.js +8 -4
- package/lib/packages/ls-components/components/preview/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js +58 -55
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/table/Table.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/table/Table.vue/index.js +2 -2
- package/lib/packages/ls-components/components/table/Table.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/table/Table.vue/index2.js +24 -24
- package/lib/packages/ls-components/components/table/Table.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/table/Table.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +99 -97
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ce=Object.defineProperty;var a=(v,L)=>ce(v,"name",{value:L,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),x=,/* empty css */de=,/* empty css */fe=,/* empty css */y=,/* empty css */I=;/* empty css */;/* empty css */;/* empty css */const me=,/* empty css */E=,/* empty css */ve=,/* empty css */pe=a(v=>(e.pushScopeId("data-v-12b1af67"),v=v(),e.popScopeId(),v),"_withScopeId"),ge={class:"ls-drag"},he={class:"drag-txt ls-color-brand6"},we=pe(()=>e.createElementVNode("div",{class:"drag-txt ls-color-text2"},"拖拽到此区域",-1)),ke={key:0,class:"btn-picture-card"},ye={key:0,class:"ls-tip"},Fe=e.defineComponent({name:"LSUpload",inheritAttrs:!1,__name:"Index",props:x.lsUploadProps,emits:["uploadErrorFunc","onChangeFunc","httpResponseFunc"],setup(v,{emit:L}){const b=e.useSlots(),F=e.useAttrs(),O=fe.useNamespace("upload").b(),f=e.ref(),s=e.ref(!1),p=e.reactive({isCover:!0,accept:"",disabled:s}),l=e.reactive({uploadFileList:[],initUploadStatus:!0,showPreview:!1,typePreview:"",sourcePreview:"",iconColor:de.getVariable("colorText1")}),n=v,_=L,P=e.computed(()=>{var t,o;return(((t=n==null?void 0:n.item)==null?void 0:t.isToast)||typeof((o=n==null?void 0:n.item)==null?void 0:o.isToast))==="undefined"}),g=e.computed(()=>{var o;const t=(o=n==null?void 0:n.item)==null?void 0:o.isCover;return typeof t>"u"?!0:t}),w=e.computed(()=>F.multiple),k=e.computed(()=>{const t=F["auto-upload"];return typeof t>"u"?!0:t}),j=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.emptyFileMsg)||""}),W=e.computed(()=>F["list-type"]),h=e.computed(()=>W.value===x.UPLOAD_TYPE_MAP.picCard),C=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitFile)||[]}),G=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitFileMsg)||""}),M=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitSize)||2}),X=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitSizeMsg)||""}),Y=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitNumMsg)||""}),A=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.profile)||!1}),T=e.computed(()=>F.drag),V=e.computed(()=>{const t=h.value?"图片":"文件";let o=`选择${t}`;return s.value?o="正在上传...":g.value&&!w.value?k.value?l.initUploadStatus?o="点击上传":o="重新上传":l.initUploadStatus?o=`选择${t}`:o="重新上传":k.value&&(o="点击上传"),o}),H=e.computed(()=>{let t="不限制上传格式,";return h.value&&(t="文件须为图片格式,"),`${t}文件大小不超过${M.value}M`}),q=e.computed(()=>{var t;return(t=n==null?void 0:n.item)==null?void 0:t.httpRequestFunc}),B=e.computed(()=>{var t;return(t=n==null?void 0:n.item)==null?void 0:t.textPreview});e.watch([g,q],([t,o])=>{p.isCover=t,o&&o instanceof Function&&(p["http-request"]=re)},{immediate:!0,deep:!0}),e.watch(()=>C.value,t=>{t&&t.length>0&&J(t)},{immediate:!0,deep:!0});function J(t){p.accept="",t.forEach(o=>{const r=x.fileTypeMap[o]||"";r&&(p.accept&&(p.accept+=","),p.accept+=r)})}a(J,"updateFileAccept");function S(t){const{formRuleFunc:o,formValidateFunc:r}=e.toRefs(n==null?void 0:n.item);if(o&&o.value instanceof Function&&r&&r.value instanceof Function){const i=o.value(),{message:u}=i;i.message=t,r.value(),i.message=u}_("uploadErrorFunc",t)}a(S,"validateForm");function K(t,o){if(s.value=!1,n.onExceed)return n.onExceed(t,o);const r=`当前限制选择 ${F.limit} 个文件,本次选择了 ${t.length} 个文件,共选择了 ${t.length+o.length} 个文件`||Y.value;P.value?setTimeout(()=>{E.ElMessage.warning(r)},200):S(r)}a(K,"onExceedAction");function Q(t){if(n.beforeUpload){const r=n.beforeUpload(t);return r&&g.value&&!w.value&&U(),r}const o=N(t,!0);return o&&k.value&&g.value&&!w.value&&U(),o}a(Q,"beforeUploadAction");function N(t,o){let r=!0;const{size:i,name:u}=t,c=C.value.length>0&&!$(u),d=i/1024/1024>M.value;if(c){const m=G.value||`上传文件 ${t.name} 只能是 ${C.value.filter(se=>se).join(",").toLocaleLowerCase()} 格式!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):S(m),r=!1}if(d){const m=X.value||`上传文件 ${t.name} 大小不能超过 ${M.value}MB!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):S(m),r=!1}if(h.value&&!$(u,x.IMG_SUFFIX_LIST)){const m=`上传文件 ${t.name} 不是图片格式的文件!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):S(m),r=!1}return r}a(N,"validateUploadFile");function $(t,o){let r=[];if(C.value.length>0?r=C.value:o&&(r=o),r.length<=0)return!0;for(let i=0;i<r.length;i++){const u=(r[i]||"").toLowerCase();if(t.toLowerCase().endsWith(u))return!0}return!1}a($,"fileTypeMatch");function U(t,o){l.uploadFileList.splice(t||0,o||l.uploadFileList.length-1)}a(U,"updateCoverFileList");function Z(t,o){l.uploadFileList=o;const r=t.raw&&N(t.raw,!k.value);if(r&&g.value&&!w.value&&U(),n.onChange)return n.onChange(t,o);const{size:i}=t;if(i<=0){R();const u=j.value||"禁止上传空文件,请检查后重新上传!";P.value?E.ElMessage.error(u):S(u);return}t.raw&&(!k.value&&!r?R():(t.blob=URL.createObjectURL(t.raw)||"",_("onChangeFunc",t)))}a(Z,"onChangeAction");function R(){let t=0;l.uploadFileList.length>1&&(t=l.uploadFileList.length-1),U(t,1),_("onChangeFunc",{})}a(R,"setChangeRes");function ee(t,o,r){s.value=!1,l.initUploadStatus=!1;const{formRuleFunc:i,formValidateFunc:u}=e.toRefs(n==null?void 0:n.item);if(i&&i.value instanceof Function&&u&&u.value instanceof Function&&u.value(),n.onSuccess)return n.onSuccess(t,o,r)}a(ee,"onSuccessAction");function te(t,o,r){if(s.value=!1,n.onError)return n.onError(t,o,r)}a(te,"onErrorAction");function oe(t,o){if(l.initUploadStatus=!o.length,n.onRemove)return n.onRemove(t,o)}a(oe,"onRemoveAction");function ne(t){if(n.onPreview)return n.onPreview(t);const{raw:o,url:r,blob:i,name:u}=t,{type:c}=o||{};o?B.value&&B.value.length>0?c!=null&&c.startsWith("image")?(l.typePreview="image",l.sourcePreview=h.value?[r]:[i],l.showPreview=!0):B.value.includes("pdf")&&c=="application/pdf"?(l.typePreview="pdf",l.sourcePreview=i,l.showPreview=!0):B.value.includes("xlsx")&&["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(c)?(l.typePreview="xlsx",fetch(i).then(d=>d.blob()).then(d=>{l.sourcePreview=new File([d],u,{type:c}),l.showPreview=!0})):B.value.includes("docx")&&c=="application/vnd.openxmlformats-officedocument.wordprocessingml.document"&&(l.typePreview="docx",fetch(i).then(d=>d.blob()).then(d=>d.arrayBuffer()).then(d=>{l.sourcePreview=d,l.showPreview=!0})):h.value&&c!=null&&c.startsWith("image")&&(l.typePreview="image",l.sourcePreview=[r],l.showPreview=!0):h.value&&(l.typePreview="image",l.sourcePreview=[r],l.showPreview=!0)}a(ne,"onPreviewAction");async function re(t){const{file:o}=t;if(!o)return;const{size:r}=o;if(r<=0||!N(o,!1))return;if(n.httpRequest)return n.httpRequest(t);const i=new FormData;if(i.append("file",o),q.value instanceof Function){s.value=!0;let u={};try{u=await q.value(i)}catch(c){u=c}finally{s.value=!1,_("httpResponseFunc",u)}}}a(re,"httpRequestAction");function z(){let t=!1;for(let o=0;o<l.uploadFileList.length;o++)if(l.uploadFileList[o].status===x.UPLOAD_STATUS_MAP.ready){t=!0;break}return t}a(z,"hasReadyFile");function D(){var t;(t=f==null?void 0:f.value)==null||t.submit()}a(D,"comfirmUpload");function le(t){f==null||f.value.handleRemove(t)}a(le,"removeFile");function ie(){l.uploadFileList.forEach(t=>{var o;if(t)try{(o=f==null?void 0:f.value)==null||o.abort(t),le(t)}catch{}})}a(ie,"cancelUpload");function ae(){s.value=!0}a(ae,"onProgressAction");function ue(){l.showPreview=!1,l.sourcePreview=""}return a(ue,"closePreview"),(t,o)=>{const r=ve.ElUpload,i=e.resolveComponent("LSPreview");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(O),e.unref(T)?"ls-upload-drag":"",e.unref(A)?"ls-profile":""])},[e.createVNode(r,e.mergeProps({ref_key:"uploadRef",ref:f},e.unref(me.default)(e.unref(p),t.$attrs),{"on-exceed":K,"before-upload":Q,"on-change":Z,"on-success":ee,"on-error":te,"on-remove":oe,"on-preview":ne,"on-progress":ae}),e.createSlots({trigger:e.withCtx(()=>[e.unref(A)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(b).trigger?e.renderSlot(t.$slots,"trigger",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(s)?(e.openBlock(),e.createBlock(y.default,{key:0,text:"",loading:e.unref(s)},null,8,["loading"])):(e.openBlock(),e.createBlock(I.default,{key:1,class:"upload-icon",name:"UploadFilled",size:"56",color:"#E7E7E7"})),e.createElementVNode("div",ge,[e.createElementVNode("div",he,e.toDisplayString(e.unref(V)),1),e.unref(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" / "),we],64))])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(h)?(e.openBlock(),e.createElementBlock("div",ke,[e.unref(s)?(e.openBlock(),e.createBlock(y.default,{key:0,text:"",loading:e.unref(s)},null,8,["loading"])):(e.openBlock(),e.createBlock(I.default,{key:1,class:"upload-btn-plus",name:"Plus",size:28,color:e.unref(l).iconColor},null,8,["color"])),e.createElementVNode("div",null,e.toDisplayString(e.unref(V)),1)])):(e.openBlock(),e.createBlock(y.default,{key:1,plain:"",icon:"upload",loading:e.unref(s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1},8,["loading"]))],64))],64))],64))]),default:e.withCtx(()=>[e.unref(b).default?e.renderSlot(t.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(k)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["upload-btn-handle",[e.unref(T)?"drag-css":"nor-css",!e.unref(g)||e.unref(w)?"multi-css":""]])},[e.unref(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(g)||e.unref(w)?(e.openBlock(),e.createBlock(y.default,{key:0,type:"primary",onClick:ie,class:"ls-upload-btn-com ls-upload-btn-cancel"},{default:e.withCtx(()=>[e.createTextVNode("取消上传")]),_:1})):e.createCommentVNode("",!0),e.createVNode(y.default,{class:e.normalizeClass(["start-upload ls-upload-btn-com ls-upload-btn-comfirm",{"is-ready":z()}]),type:"primary",loading:e.unref(s),onClick:D},{default:e.withCtx(()=>[e.createTextVNode("开始上传")]),_:1},8,["class","loading"])],64)):(e.openBlock(),e.createBlock(y.default,{key:0,type:"primary",class:e.normalizeClass(["ls-upload-btn-com ls-upload-btn-comfirm",{"is-ready":z()}]),loading:e.unref(s),onClick:D},{default:e.withCtx(()=>[e.createTextVNode("开始上传 ")]),_:1},8,["class","loading"]))],2))],64))]),tip:e.withCtx(()=>[e.unref(b).tip?e.renderSlot(t.$slots,"tip",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",ye,e.toDisplayString(e.unref(H)),1))]),_:2},[e.unref(b).file?{name:"file",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"file",{},void 0,!0)]),key:"0"}:void 0]),1040),e.createVNode(i,{modelValue:e.unref(l).showPreview,"onUpdate:modelValue":o[0]||(o[0]=u=>e.unref(l).showPreview=u),"on-close":ue,type:e.unref(l).typePreview,source:e.unref(l).sourcePreview},null,8,["modelValue","type","source"])],2)}}});exports.default=Fe;
|
|
1
|
+
"use strict";var de=Object.defineProperty;var a=(v,L)=>de(v,"name",{value:L,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),S=,/* empty css */fe=,/* empty css */me=,/* empty css */y=,/* empty css */I=;/* empty css */;/* empty css */;/* empty css */const ve=,/* empty css */E=,/* empty css */pe=,/* empty css */ge=a(v=>(e.pushScopeId("data-v-c1121064"),v=v(),e.popScopeId(),v),"_withScopeId"),he={class:"ls-drag"},we={class:"drag-txt ls-color-brand6"},ke=ge(()=>e.createElementVNode("div",{class:"drag-txt ls-color-text2"},"拖拽到此区域",-1)),ye={key:0,class:"btn-picture-card"},Fe={key:0,class:"ls-tip"},Pe=e.defineComponent({name:"LSUpload",inheritAttrs:!1,__name:"Index",props:S.lsUploadProps,emits:["uploadErrorFunc","onChangeFunc","httpResponseFunc"],setup(v,{expose:L,emit:O}){const b=e.useSlots(),F=e.useAttrs(),j=me.useNamespace("upload").b(),d=e.ref(),s=e.ref(!1),p=e.reactive({isCover:!0,accept:"",disabled:s}),l=e.reactive({uploadFileList:[],initUploadStatus:!0,showPreview:!1,typePreview:"",sourcePreview:"",iconColor:fe.getVariable("colorText1")}),n=v,_=O,P=e.computed(()=>{var t,o;return(((t=n==null?void 0:n.item)==null?void 0:t.isToast)||typeof((o=n==null?void 0:n.item)==null?void 0:o.isToast))==="undefined"}),g=e.computed(()=>{var o;const t=(o=n==null?void 0:n.item)==null?void 0:o.isCover;return typeof t>"u"?!0:t}),w=e.computed(()=>F.multiple),k=e.computed(()=>{const t=F["auto-upload"];return typeof t>"u"?!0:t}),W=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.emptyFileMsg)||""}),G=e.computed(()=>F["list-type"]),h=e.computed(()=>G.value===S.UPLOAD_TYPE_MAP.picCard),C=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitFile)||[]}),X=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitFileMsg)||""}),M=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitSize)||2}),Y=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitSizeMsg)||""}),H=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.limitNumMsg)||""}),A=e.computed(()=>{var t;return((t=n==null?void 0:n.item)==null?void 0:t.profile)||!1}),T=e.computed(()=>F.drag),V=e.computed(()=>{const t=h.value?"图片":"文件";let o=`选择${t}`;return s.value?o="正在上传...":g.value&&!w.value?k.value?l.initUploadStatus?o="点击上传":o="重新上传":l.initUploadStatus?o=`选择${t}`:o="重新上传":k.value&&(o="点击上传"),o}),J=e.computed(()=>{let t="不限制上传格式,";return h.value&&(t="文件须为图片格式,"),`${t}文件大小不超过${M.value}M`}),q=e.computed(()=>{var t;return(t=n==null?void 0:n.item)==null?void 0:t.httpRequestFunc}),x=e.computed(()=>{var t;return(t=n==null?void 0:n.item)==null?void 0:t.textPreview});e.watch([g,q],([t,o])=>{p.isCover=t,o&&o instanceof Function&&(p["http-request"]=le)},{immediate:!0,deep:!0}),e.watch(()=>C.value,t=>{t&&t.length>0&&K(t)},{immediate:!0,deep:!0});function K(t){p.accept="",t.forEach(o=>{const r=S.fileTypeMap[o]||"";r&&(p.accept&&(p.accept+=","),p.accept+=r)})}a(K,"updateFileAccept");function B(t){const{formRuleFunc:o,formValidateFunc:r}=e.toRefs(n==null?void 0:n.item);if(o&&o.value instanceof Function&&r&&r.value instanceof Function){const i=o.value(),{message:u}=i;i.message=t,r.value(),i.message=u}_("uploadErrorFunc",t)}a(B,"validateForm");function Q(t,o){if(s.value=!1,n.onExceed)return n.onExceed(t,o);const r=`当前限制选择 ${F.limit} 个文件,本次选择了 ${t.length} 个文件,共选择了 ${t.length+o.length} 个文件`||H.value;P.value?setTimeout(()=>{E.ElMessage.warning(r)},200):B(r)}a(Q,"onExceedAction");function Z(t){if(n.beforeUpload){const r=n.beforeUpload(t);return r&&g.value&&!w.value&&U(),r}const o=N(t,!0);return o&&k.value&&g.value&&!w.value&&U(),o}a(Z,"beforeUploadAction");function N(t,o){let r=!0;const{size:i,name:u}=t,c=C.value.length>0&&!$(u),f=i/1024/1024>M.value;if(c){const m=X.value||`上传文件 ${t.name} 只能是 ${C.value.filter(ce=>ce).join(",").toLocaleLowerCase()} 格式!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):B(m),r=!1}if(f){const m=Y.value||`上传文件 ${t.name} 大小不能超过 ${M.value}MB!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):B(m),r=!1}if(h.value&&!$(u,S.IMG_SUFFIX_LIST)){const m=`上传文件 ${t.name} 不是图片格式的文件!`;P.value&&o?setTimeout(()=>{E.ElMessage.error(m)},200):B(m),r=!1}return r}a(N,"validateUploadFile");function $(t,o){let r=[];if(C.value.length>0?r=C.value:o&&(r=o),r.length<=0)return!0;for(let i=0;i<r.length;i++){const u=(r[i]||"").toLowerCase();if(t.toLowerCase().endsWith(u))return!0}return!1}a($,"fileTypeMatch");function U(t,o){l.uploadFileList.splice(t||0,o||l.uploadFileList.length-1)}a(U,"updateCoverFileList");function ee(t,o){l.uploadFileList=o;const r=t.raw&&N(t.raw,!k.value);if(r&&g.value&&!w.value&&U(),n.onChange)return n.onChange(t,o);const{size:i}=t;if(i<=0){R();const u=W.value||"禁止上传空文件,请检查后重新上传!";P.value?E.ElMessage.error(u):B(u);return}t.raw&&(!k.value&&!r?R():(t.blob=URL.createObjectURL(t.raw)||"",_("onChangeFunc",t)))}a(ee,"onChangeAction");function R(){let t=0;l.uploadFileList.length>1&&(t=l.uploadFileList.length-1),U(t,1),_("onChangeFunc",{})}a(R,"setChangeRes");function te(t,o,r){s.value=!1,l.initUploadStatus=!1;const{formRuleFunc:i,formValidateFunc:u}=e.toRefs(n==null?void 0:n.item);if(i&&i.value instanceof Function&&u&&u.value instanceof Function&&u.value(),n.onSuccess)return n.onSuccess(t,o,r)}a(te,"onSuccessAction");function oe(t,o,r){if(s.value=!1,n.onError)return n.onError(t,o,r)}a(oe,"onErrorAction");function ne(t,o){if(l.initUploadStatus=!o.length,n.onRemove)return n.onRemove(t,o)}a(ne,"onRemoveAction");function re(t){if(n.onPreview)return n.onPreview(t);const{raw:o,url:r,blob:i,name:u}=t,{type:c}=o||{};o?x.value&&x.value.length>0?c!=null&&c.startsWith("image")?(l.typePreview="image",l.sourcePreview=h.value?[r]:[i],l.showPreview=!0):x.value.includes("pdf")&&c=="application/pdf"?(l.typePreview="pdf",l.sourcePreview=i,l.showPreview=!0):x.value.includes("xlsx")&&["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(c)?(l.typePreview="xlsx",fetch(i).then(f=>f.blob()).then(f=>{l.sourcePreview=new File([f],u,{type:c}),l.showPreview=!0})):x.value.includes("docx")&&c=="application/vnd.openxmlformats-officedocument.wordprocessingml.document"&&(l.typePreview="docx",fetch(i).then(f=>f.blob()).then(f=>f.arrayBuffer()).then(f=>{l.sourcePreview=f,l.showPreview=!0})):h.value&&c!=null&&c.startsWith("image")&&(l.typePreview="image",l.sourcePreview=[r],l.showPreview=!0):h.value&&(l.typePreview="image",l.sourcePreview=[r],l.showPreview=!0)}a(re,"onPreviewAction");async function le(t){const{file:o}=t;if(!o)return;const{size:r}=o;if(r<=0||!N(o,!1))return;if(n.httpRequest)return n.httpRequest(t);const i=new FormData;if(i.append("file",o),q.value instanceof Function){s.value=!0;let u={};try{u=await q.value(i)}catch(c){u=c}finally{s.value=!1,_("httpResponseFunc",u)}}}a(le,"httpRequestAction");function z(){let t=!1;for(let o=0;o<l.uploadFileList.length;o++)if(l.uploadFileList[o].status===S.UPLOAD_STATUS_MAP.ready){t=!0;break}return t}a(z,"hasReadyFile");function D(){var t;(t=d==null?void 0:d.value)==null||t.submit()}a(D,"comfirmUpload");function ie(t){d==null||d.value.handleRemove(t)}a(ie,"removeFile");function ae(){l.uploadFileList.forEach(t=>{var o;if(t)try{(o=d==null?void 0:d.value)==null||o.abort(t),ie(t)}catch{}})}a(ae,"cancelUpload");function ue(){s.value=!0}a(ue,"onProgressAction");function se(){l.showPreview=!1,l.sourcePreview=""}return a(se,"closePreview"),L({uploadRef:d}),(t,o)=>{const r=pe.ElUpload,i=e.resolveComponent("LSPreview");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(j),e.unref(T)?"ls-upload-drag":"",e.unref(A)?"ls-profile":""])},[e.createVNode(r,e.mergeProps({ref_key:"uploadRef",ref:d},e.unref(ve.default)(e.unref(p),t.$attrs),{"on-exceed":Q,"before-upload":Z,"on-change":ee,"on-success":te,"on-error":oe,"on-remove":ne,"on-preview":re,"on-progress":ue}),e.createSlots({trigger:e.withCtx(()=>[e.unref(A)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(b).trigger?e.renderSlot(t.$slots,"trigger",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(s)?(e.openBlock(),e.createBlock(y.default,{key:0,text:"",loading:e.unref(s)},null,8,["loading"])):(e.openBlock(),e.createBlock(I.default,{key:1,class:"upload-icon",name:"UploadFilled",size:"56",color:"#E7E7E7"})),e.createElementVNode("div",he,[e.createElementVNode("div",we,e.toDisplayString(e.unref(V)),1),e.unref(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" / "),ke],64))])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(h)?(e.openBlock(),e.createElementBlock("div",ye,[e.unref(s)?(e.openBlock(),e.createBlock(y.default,{key:0,text:"",loading:e.unref(s)},null,8,["loading"])):(e.openBlock(),e.createBlock(I.default,{key:1,class:"upload-btn-plus",name:"Plus",size:28,color:e.unref(l).iconColor},null,8,["color"])),e.createElementVNode("div",null,e.toDisplayString(e.unref(V)),1)])):(e.openBlock(),e.createBlock(y.default,{key:1,plain:"",icon:"upload",loading:e.unref(s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1},8,["loading"]))],64))],64))],64))]),default:e.withCtx(()=>[e.unref(b).default?e.renderSlot(t.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(k)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["upload-btn-handle",[e.unref(T)?"drag-css":"nor-css",!e.unref(g)||e.unref(w)?"multi-css":""]])},[e.unref(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(g)||e.unref(w)?(e.openBlock(),e.createBlock(y.default,{key:0,type:"primary",onClick:ae,class:"ls-upload-btn-com ls-upload-btn-cancel"},{default:e.withCtx(()=>[e.createTextVNode("取消上传")]),_:1})):e.createCommentVNode("",!0),e.createVNode(y.default,{class:e.normalizeClass(["start-upload ls-upload-btn-com ls-upload-btn-comfirm",{"is-ready":z()}]),type:"primary",loading:e.unref(s),onClick:D},{default:e.withCtx(()=>[e.createTextVNode("开始上传")]),_:1},8,["class","loading"])],64)):(e.openBlock(),e.createBlock(y.default,{key:0,type:"primary",class:e.normalizeClass(["ls-upload-btn-com ls-upload-btn-comfirm",{"is-ready":z()}]),loading:e.unref(s),onClick:D},{default:e.withCtx(()=>[e.createTextVNode("开始上传 ")]),_:1},8,["class","loading"]))],2))],64))]),tip:e.withCtx(()=>[e.unref(b).tip?e.renderSlot(t.$slots,"tip",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",Fe,e.toDisplayString(e.unref(J)),1))]),_:2},[e.unref(b).file?{name:"file",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"file",{},void 0,!0)]),key:"0"}:void 0]),1040),e.createVNode(i,{modelValue:e.unref(l).showPreview,"onUpdate:modelValue":o[0]||(o[0]=u=>e.unref(l).showPreview=u),"on-close":se,type:e.unref(l).typePreview,source:e.unref(l).sourcePreview},null,8,["modelValue","type","source"])],2)}}});exports.default=Pe;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var r = (w, O) =>
|
|
1
|
+
var xe = Object.defineProperty;
|
|
2
|
+
var r = (w, O) => xe(w, "name", { value: O, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import { lsUploadProps as
|
|
8
|
-
import { getVariable as
|
|
9
|
-
import { useNamespace as
|
|
6
|
+
import { defineComponent as Le, useSlots as Ue, useAttrs as Te, ref as ee, reactive as te, computed as u, watch as oe, resolveComponent as Ae, openBlock as c, createElementBlock as p, normalizeClass as V, unref as l, createVNode as Y, mergeProps as Ee, createSlots as $e, withCtx as h, Fragment as S, createBlock as b, createElementVNode as B, toDisplayString as D, createTextVNode as E, createCommentVNode as N, renderSlot as q, toRefs as ie, pushScopeId as Me, popScopeId as Re } from "vue";
|
|
7
|
+
import { lsUploadProps as ze, UPLOAD_TYPE_MAP as Ie, fileTypeMap as Ve, UPLOAD_STATUS_MAP as De, IMG_SUFFIX_LIST as Ne } from "../types/index.js";
|
|
8
|
+
import { getVariable as qe } from "../../_utils/config/index.js";
|
|
9
|
+
import { useNamespace as Be } from "../../_hooks/useNamespace/index.js";
|
|
10
10
|
import _ from "../../button/Button.vue/index.js";
|
|
11
11
|
import ne from "../../icon/Index.vue/index.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
|
-
import
|
|
14
|
+
import Oe from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
15
15
|
import { ElMessage as $ } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
16
|
-
import { ElUpload as
|
|
17
|
-
const
|
|
16
|
+
import { ElUpload as We } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
17
|
+
const je = /* @__PURE__ */ r((w) => (Me("data-v-c1121064"), w = w(), Re(), w), "_withScopeId"), Ge = { class: "ls-drag" }, Xe = { class: "drag-txt ls-color-brand6" }, Ye = /* @__PURE__ */ je(() => /* @__PURE__ */ B("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1)), He = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "btn-picture-card"
|
|
20
|
-
},
|
|
20
|
+
}, Je = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "ls-tip"
|
|
23
|
-
},
|
|
23
|
+
}, mt = /* @__PURE__ */ Le({
|
|
24
24
|
name: "LSUpload",
|
|
25
25
|
inheritAttrs: !1,
|
|
26
26
|
__name: "Index",
|
|
27
|
-
props:
|
|
27
|
+
props: ze,
|
|
28
28
|
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
|
|
29
|
-
setup(w, {
|
|
30
|
-
const M =
|
|
29
|
+
setup(w, { expose: O, emit: le }) {
|
|
30
|
+
const M = Ue(), x = Te(), se = Be("upload").b(), m = ee(), f = ee(!1), y = te({
|
|
31
31
|
isCover: !0,
|
|
32
32
|
accept: "",
|
|
33
33
|
disabled: f
|
|
@@ -37,8 +37,8 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
37
37
|
showPreview: !1,
|
|
38
38
|
typePreview: "",
|
|
39
39
|
sourcePreview: "",
|
|
40
|
-
iconColor:
|
|
41
|
-
}), o = w, R =
|
|
40
|
+
iconColor: qe("colorText1")
|
|
41
|
+
}), o = w, R = le, L = u(() => {
|
|
42
42
|
var e, t;
|
|
43
43
|
return (((e = o == null ? void 0 : o.item) == null ? void 0 : e.isToast) || typeof ((t = o == null ? void 0 : o.item) == null ? void 0 : t.isToast)) === "undefined";
|
|
44
44
|
}), F = u(() => {
|
|
@@ -48,22 +48,22 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
48
48
|
}), k = u(() => x.multiple), C = u(() => {
|
|
49
49
|
const e = x["auto-upload"];
|
|
50
50
|
return typeof e > "u" ? !0 : e;
|
|
51
|
-
}),
|
|
51
|
+
}), re = u(() => {
|
|
52
52
|
var e;
|
|
53
53
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
54
|
-
}),
|
|
54
|
+
}), ae = u(() => x["list-type"]), P = u(() => ae.value === Ie.picCard), U = u(() => {
|
|
55
55
|
var e;
|
|
56
56
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.limitFile) || [];
|
|
57
|
-
}),
|
|
57
|
+
}), ue = u(() => {
|
|
58
58
|
var e;
|
|
59
59
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.limitFileMsg) || "";
|
|
60
60
|
}), W = u(() => {
|
|
61
61
|
var e;
|
|
62
62
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.limitSize) || 2;
|
|
63
|
-
}),
|
|
63
|
+
}), ce = u(() => {
|
|
64
64
|
var e;
|
|
65
65
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
66
|
-
}),
|
|
66
|
+
}), fe = u(() => {
|
|
67
67
|
var e;
|
|
68
68
|
return ((e = o == null ? void 0 : o.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
69
69
|
}), H = u(() => {
|
|
@@ -73,7 +73,7 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
73
73
|
const e = P.value ? "图片" : "文件";
|
|
74
74
|
let t = `选择${e}`;
|
|
75
75
|
return f.value ? t = "正在上传..." : F.value && !k.value ? C.value ? n.initUploadStatus ? t = "点击上传" : t = "重新上传" : n.initUploadStatus ? t = `选择${e}` : t = "重新上传" : C.value && (t = "点击上传"), t;
|
|
76
|
-
}),
|
|
76
|
+
}), de = u(() => {
|
|
77
77
|
let e = "不限制上传格式,";
|
|
78
78
|
return P.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${W.value}M`;
|
|
79
79
|
}), G = u(() => {
|
|
@@ -86,7 +86,7 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
86
86
|
oe(
|
|
87
87
|
[F, G],
|
|
88
88
|
([e, t]) => {
|
|
89
|
-
y.isCover = e, t && t instanceof Function && (y["http-request"] =
|
|
89
|
+
y.isCover = e, t && t instanceof Function && (y["http-request"] = Pe);
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
immediate: !0,
|
|
@@ -95,20 +95,20 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
95
95
|
), oe(
|
|
96
96
|
() => U.value,
|
|
97
97
|
(e) => {
|
|
98
|
-
e && e.length > 0 &&
|
|
98
|
+
e && e.length > 0 && me(e);
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
immediate: !0,
|
|
102
102
|
deep: !0
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
function
|
|
105
|
+
function me(e) {
|
|
106
106
|
y.accept = "", e.forEach((t) => {
|
|
107
|
-
const i =
|
|
107
|
+
const i = Ve[t] || "";
|
|
108
108
|
i && (y.accept && (y.accept += ","), y.accept += i);
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
r(
|
|
111
|
+
r(me, "updateFileAccept");
|
|
112
112
|
function A(e) {
|
|
113
113
|
const { formRuleFunc: t, formValidateFunc: i } = ie(o == null ? void 0 : o.item);
|
|
114
114
|
if (t && t.value instanceof Function && i && i.value instanceof Function) {
|
|
@@ -118,16 +118,16 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
118
118
|
R("uploadErrorFunc", e);
|
|
119
119
|
}
|
|
120
120
|
r(A, "validateForm");
|
|
121
|
-
function
|
|
121
|
+
function ve(e, t) {
|
|
122
122
|
if (f.value = !1, o.onExceed)
|
|
123
123
|
return o.onExceed(e, t);
|
|
124
|
-
const i = `当前限制选择 ${x.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length + t.length} 个文件` ||
|
|
124
|
+
const i = `当前限制选择 ${x.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length + t.length} 个文件` || fe.value;
|
|
125
125
|
L.value ? setTimeout(() => {
|
|
126
126
|
$.warning(i);
|
|
127
127
|
}, 200) : A(i);
|
|
128
128
|
}
|
|
129
|
-
r(
|
|
130
|
-
function
|
|
129
|
+
r(ve, "onExceedAction");
|
|
130
|
+
function pe(e) {
|
|
131
131
|
if (o.beforeUpload) {
|
|
132
132
|
const i = o.beforeUpload(e);
|
|
133
133
|
return i && F.value && !k.value && I(), i;
|
|
@@ -135,23 +135,23 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
135
135
|
const t = X(e, !0);
|
|
136
136
|
return t && C.value && F.value && !k.value && I(), t;
|
|
137
137
|
}
|
|
138
|
-
r(
|
|
138
|
+
r(pe, "beforeUploadAction");
|
|
139
139
|
function X(e, t) {
|
|
140
140
|
let i = !0;
|
|
141
|
-
const { size: s, name: a } = e, d = U.value.length > 0 && !J(a),
|
|
141
|
+
const { size: s, name: a } = e, d = U.value.length > 0 && !J(a), v = s / 1024 / 1024 > W.value;
|
|
142
142
|
if (d) {
|
|
143
|
-
const g =
|
|
143
|
+
const g = ue.value || `上传文件 ${e.name} 只能是 ${U.value.filter((_e) => _e).join(",").toLocaleLowerCase()} 格式!`;
|
|
144
144
|
L.value && t ? setTimeout(() => {
|
|
145
145
|
$.error(g);
|
|
146
146
|
}, 200) : A(g), i = !1;
|
|
147
147
|
}
|
|
148
|
-
if (
|
|
149
|
-
const g =
|
|
148
|
+
if (v) {
|
|
149
|
+
const g = ce.value || `上传文件 ${e.name} 大小不能超过 ${W.value}MB!`;
|
|
150
150
|
L.value && t ? setTimeout(() => {
|
|
151
151
|
$.error(g);
|
|
152
152
|
}, 200) : A(g), i = !1;
|
|
153
153
|
}
|
|
154
|
-
if (P.value && !J(a,
|
|
154
|
+
if (P.value && !J(a, Ne)) {
|
|
155
155
|
const g = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
156
156
|
L.value && t ? setTimeout(() => {
|
|
157
157
|
$.error(g);
|
|
@@ -176,7 +176,7 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
176
176
|
n.uploadFileList.splice(e || 0, t || n.uploadFileList.length - 1);
|
|
177
177
|
}
|
|
178
178
|
r(I, "updateCoverFileList");
|
|
179
|
-
function
|
|
179
|
+
function ge(e, t) {
|
|
180
180
|
n.uploadFileList = t;
|
|
181
181
|
const i = e.raw && X(e.raw, !C.value);
|
|
182
182
|
if (i && F.value && !k.value && I(), o.onChange)
|
|
@@ -184,47 +184,47 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
184
184
|
const { size: s } = e;
|
|
185
185
|
if (s <= 0) {
|
|
186
186
|
K();
|
|
187
|
-
const a =
|
|
187
|
+
const a = re.value || "禁止上传空文件,请检查后重新上传!";
|
|
188
188
|
L.value ? $.error(a) : A(a);
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
e.raw && (!C.value && !i ? K() : (e.blob = URL.createObjectURL(e.raw) || "", R("onChangeFunc", e)));
|
|
192
192
|
}
|
|
193
|
-
r(
|
|
193
|
+
r(ge, "onChangeAction");
|
|
194
194
|
function K() {
|
|
195
195
|
let e = 0;
|
|
196
196
|
n.uploadFileList.length > 1 && (e = n.uploadFileList.length - 1), I(e, 1), R("onChangeFunc", {});
|
|
197
197
|
}
|
|
198
198
|
r(K, "setChangeRes");
|
|
199
|
-
function
|
|
199
|
+
function he(e, t, i) {
|
|
200
200
|
f.value = !1, n.initUploadStatus = !1;
|
|
201
201
|
const { formRuleFunc: s, formValidateFunc: a } = ie(o == null ? void 0 : o.item);
|
|
202
202
|
if (s && s.value instanceof Function && a && a.value instanceof Function && a.value(), o.onSuccess)
|
|
203
203
|
return o.onSuccess(e, t, i);
|
|
204
204
|
}
|
|
205
|
-
r(
|
|
206
|
-
function
|
|
205
|
+
r(he, "onSuccessAction");
|
|
206
|
+
function we(e, t, i) {
|
|
207
207
|
if (f.value = !1, o.onError)
|
|
208
208
|
return o.onError(e, t, i);
|
|
209
209
|
}
|
|
210
|
-
r(
|
|
211
|
-
function
|
|
210
|
+
r(we, "onErrorAction");
|
|
211
|
+
function ye(e, t) {
|
|
212
212
|
if (n.initUploadStatus = !t.length, o.onRemove)
|
|
213
213
|
return o.onRemove(e, t);
|
|
214
214
|
}
|
|
215
|
-
r(
|
|
216
|
-
function
|
|
215
|
+
r(ye, "onRemoveAction");
|
|
216
|
+
function Fe(e) {
|
|
217
217
|
if (o.onPreview)
|
|
218
218
|
return o.onPreview(e);
|
|
219
219
|
const { raw: t, url: i, blob: s, name: a } = e, { type: d } = t || {};
|
|
220
|
-
t ? T.value && T.value.length > 0 ? d != null && d.startsWith("image") ? (n.typePreview = "image", n.sourcePreview = P.value ? [i] : [s], n.showPreview = !0) : T.value.includes("pdf") && d == "application/pdf" ? (n.typePreview = "pdf", n.sourcePreview = s, n.showPreview = !0) : T.value.includes("xlsx") && ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d) ? (n.typePreview = "xlsx", fetch(s).then((
|
|
221
|
-
n.sourcePreview = new File([
|
|
222
|
-
})) : T.value.includes("docx") && d == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" && (n.typePreview = "docx", fetch(s).then((
|
|
223
|
-
n.sourcePreview =
|
|
220
|
+
t ? T.value && T.value.length > 0 ? d != null && d.startsWith("image") ? (n.typePreview = "image", n.sourcePreview = P.value ? [i] : [s], n.showPreview = !0) : T.value.includes("pdf") && d == "application/pdf" ? (n.typePreview = "pdf", n.sourcePreview = s, n.showPreview = !0) : T.value.includes("xlsx") && ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d) ? (n.typePreview = "xlsx", fetch(s).then((v) => v.blob()).then((v) => {
|
|
221
|
+
n.sourcePreview = new File([v], a, { type: d }), n.showPreview = !0;
|
|
222
|
+
})) : T.value.includes("docx") && d == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" && (n.typePreview = "docx", fetch(s).then((v) => v.blob()).then((v) => v.arrayBuffer()).then((v) => {
|
|
223
|
+
n.sourcePreview = v, n.showPreview = !0;
|
|
224
224
|
})) : P.value && d != null && d.startsWith("image") && (n.typePreview = "image", n.sourcePreview = [i], n.showPreview = !0) : P.value && (n.typePreview = "image", n.sourcePreview = [i], n.showPreview = !0);
|
|
225
225
|
}
|
|
226
|
-
r(
|
|
227
|
-
async function
|
|
226
|
+
r(Fe, "onPreviewAction");
|
|
227
|
+
async function Pe(e) {
|
|
228
228
|
const { file: t } = e;
|
|
229
229
|
if (!t)
|
|
230
230
|
return;
|
|
@@ -246,11 +246,11 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
r(
|
|
249
|
+
r(Pe, "httpRequestAction");
|
|
250
250
|
function Q() {
|
|
251
251
|
let e = !1;
|
|
252
252
|
for (let t = 0; t < n.uploadFileList.length; t++)
|
|
253
|
-
if (n.uploadFileList[t].status ===
|
|
253
|
+
if (n.uploadFileList[t].status === De.ready) {
|
|
254
254
|
e = !0;
|
|
255
255
|
break;
|
|
256
256
|
}
|
|
@@ -259,53 +259,55 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
259
259
|
r(Q, "hasReadyFile");
|
|
260
260
|
function Z() {
|
|
261
261
|
var e;
|
|
262
|
-
(e =
|
|
262
|
+
(e = m == null ? void 0 : m.value) == null || e.submit();
|
|
263
263
|
}
|
|
264
264
|
r(Z, "comfirmUpload");
|
|
265
|
-
function
|
|
266
|
-
|
|
265
|
+
function Se(e) {
|
|
266
|
+
m == null || m.value.handleRemove(e);
|
|
267
267
|
}
|
|
268
|
-
r(
|
|
269
|
-
function
|
|
268
|
+
r(Se, "removeFile");
|
|
269
|
+
function be() {
|
|
270
270
|
n.uploadFileList.forEach((e) => {
|
|
271
271
|
var t;
|
|
272
272
|
if (e)
|
|
273
273
|
try {
|
|
274
|
-
(t =
|
|
274
|
+
(t = m == null ? void 0 : m.value) == null || t.abort(e), Se(e);
|
|
275
275
|
} catch {
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
r(
|
|
280
|
-
function
|
|
279
|
+
r(be, "cancelUpload");
|
|
280
|
+
function ke() {
|
|
281
281
|
f.value = !0;
|
|
282
282
|
}
|
|
283
|
-
r(
|
|
284
|
-
function
|
|
283
|
+
r(ke, "onProgressAction");
|
|
284
|
+
function Ce() {
|
|
285
285
|
n.showPreview = !1, n.sourcePreview = "";
|
|
286
286
|
}
|
|
287
|
-
return r(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
return r(Ce, "closePreview"), O({
|
|
288
|
+
uploadRef: m
|
|
289
|
+
}), (e, t) => {
|
|
290
|
+
const i = We, s = Ae("LSPreview");
|
|
291
|
+
return c(), p("div", {
|
|
292
|
+
class: V([l(se), l(z) ? "ls-upload-drag" : "", l(H) ? "ls-profile" : ""])
|
|
291
293
|
}, [
|
|
292
|
-
Y(i,
|
|
294
|
+
Y(i, Ee({
|
|
293
295
|
ref_key: "uploadRef",
|
|
294
|
-
ref:
|
|
295
|
-
}, l(
|
|
296
|
-
"on-exceed":
|
|
297
|
-
"before-upload":
|
|
298
|
-
"on-change":
|
|
299
|
-
"on-success":
|
|
300
|
-
"on-error":
|
|
301
|
-
"on-remove":
|
|
302
|
-
"on-preview":
|
|
303
|
-
"on-progress":
|
|
304
|
-
}),
|
|
296
|
+
ref: m
|
|
297
|
+
}, l(Oe)(l(y), e.$attrs), {
|
|
298
|
+
"on-exceed": ve,
|
|
299
|
+
"before-upload": pe,
|
|
300
|
+
"on-change": ge,
|
|
301
|
+
"on-success": he,
|
|
302
|
+
"on-error": we,
|
|
303
|
+
"on-remove": ye,
|
|
304
|
+
"on-preview": Fe,
|
|
305
|
+
"on-progress": ke
|
|
306
|
+
}), $e({
|
|
305
307
|
trigger: h(() => [
|
|
306
|
-
l(H) ? N("", !0) : (c(),
|
|
307
|
-
l(M).trigger ? q(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(),
|
|
308
|
-
l(z) ? (c(),
|
|
308
|
+
l(H) ? N("", !0) : (c(), p(S, { key: 0 }, [
|
|
309
|
+
l(M).trigger ? q(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), p(S, { key: 0 }, [
|
|
310
|
+
l(z) ? (c(), p(S, { key: 0 }, [
|
|
309
311
|
l(f) ? (c(), b(_, {
|
|
310
312
|
key: 0,
|
|
311
313
|
text: "",
|
|
@@ -317,15 +319,15 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
317
319
|
size: "56",
|
|
318
320
|
color: "#E7E7E7"
|
|
319
321
|
})),
|
|
320
|
-
B("div",
|
|
321
|
-
B("div",
|
|
322
|
-
l(f) ? N("", !0) : (c(),
|
|
322
|
+
B("div", Ge, [
|
|
323
|
+
B("div", Xe, D(l(j)), 1),
|
|
324
|
+
l(f) ? N("", !0) : (c(), p(S, { key: 0 }, [
|
|
323
325
|
E(" / "),
|
|
324
|
-
|
|
326
|
+
Ye
|
|
325
327
|
], 64))
|
|
326
328
|
])
|
|
327
|
-
], 64)) : (c(),
|
|
328
|
-
l(P) ? (c(),
|
|
329
|
+
], 64)) : (c(), p(S, { key: 1 }, [
|
|
330
|
+
l(P) ? (c(), p("div", He, [
|
|
329
331
|
l(f) ? (c(), b(_, {
|
|
330
332
|
key: 0,
|
|
331
333
|
text: "",
|
|
@@ -354,16 +356,16 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
354
356
|
], 64))
|
|
355
357
|
]),
|
|
356
358
|
default: h(() => [
|
|
357
|
-
l(M).default ? q(e.$slots, "default", { key: 1 }, void 0, !0) : (c(),
|
|
358
|
-
l(C) ? N("", !0) : (c(),
|
|
359
|
+
l(M).default ? q(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), p(S, { key: 0 }, [
|
|
360
|
+
l(C) ? N("", !0) : (c(), p("div", {
|
|
359
361
|
key: 0,
|
|
360
362
|
class: V(["upload-btn-handle", [l(z) ? "drag-css" : "nor-css", !l(F) || l(k) ? "multi-css" : ""]])
|
|
361
363
|
}, [
|
|
362
|
-
l(z) ? (c(),
|
|
364
|
+
l(z) ? (c(), p(S, { key: 1 }, [
|
|
363
365
|
!l(F) || l(k) ? (c(), b(_, {
|
|
364
366
|
key: 0,
|
|
365
367
|
type: "primary",
|
|
366
|
-
onClick:
|
|
368
|
+
onClick: be,
|
|
367
369
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
368
370
|
}, {
|
|
369
371
|
default: h(() => [
|
|
@@ -398,7 +400,7 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
398
400
|
], 64))
|
|
399
401
|
]),
|
|
400
402
|
tip: h(() => [
|
|
401
|
-
l(M).tip ? q(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(),
|
|
403
|
+
l(M).tip ? q(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), p("div", Je, D(l(de)), 1))
|
|
402
404
|
]),
|
|
403
405
|
_: 2
|
|
404
406
|
}, [
|
|
@@ -413,7 +415,7 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
413
415
|
Y(s, {
|
|
414
416
|
modelValue: l(n).showPreview,
|
|
415
417
|
"onUpdate:modelValue": t[0] || (t[0] = (a) => l(n).showPreview = a),
|
|
416
|
-
"on-close":
|
|
418
|
+
"on-close": Ce,
|
|
417
419
|
type: l(n).typePreview,
|
|
418
420
|
source: l(n).sourcePreview
|
|
419
421
|
}, null, 8, ["modelValue", "type", "source"])
|
|
@@ -422,5 +424,5 @@ const We = /* @__PURE__ */ r((w) => ($e("data-v-12b1af67"), w = w(), Me(), w), "
|
|
|
422
424
|
}
|
|
423
425
|
});
|
|
424
426
|
export {
|
|
425
|
-
|
|
427
|
+
mt as default
|
|
426
428
|
};
|
|
Binary file
|
|
Binary file
|