sand-components-vben 1.3.3 → 1.3.4
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/package.json
CHANGED
package/sand-components-vben.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ant-select[data-v-3e16c2d0]{width:100%}[data-v-
|
|
1
|
+
.ant-select[data-v-3e16c2d0]{width:100%}[data-v-a5cb131d]{box-sizing:border-box}.upload-image[data-v-a5cb131d]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start}.image-item[data-v-a5cb131d]{position:relative;margin-right:8px;margin-bottom:8px}.delete-image[data-v-a5cb131d]{position:absolute;top:-6px;right:-6px;display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:#fff;cursor:pointer;background:#000c;border-radius:100px;font-size:12px}.upload-add[data-v-a5cb131d]{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;margin-right:8px;margin-bottom:8px;overflow:hidden;font-size:13px;background:#00000005;border:1px dashed #d9d9d9;border-radius:4px}.desc[data-v-a5cb131d]{position:absolute;bottom:-100%;left:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0 6px;font-size:11px;color:#fff;-webkit-user-select:none;user-select:none;background:#000000b3}.upload-add:hover .desc[data-v-a5cb131d]{bottom:0;transition:.4s}[data-v-a5cb131d] .ant-image-img{object-fit:cover;border-radius:4px!important}
|
package/sand-components-vben.js
CHANGED
|
@@ -6108,7 +6108,7 @@ const Sa = /* @__PURE__ */ I({
|
|
|
6108
6108
|
file: c
|
|
6109
6109
|
}
|
|
6110
6110
|
);
|
|
6111
|
-
n("change", f);
|
|
6111
|
+
console.log(f), n("change", f);
|
|
6112
6112
|
} catch (f) {
|
|
6113
6113
|
console.log(f);
|
|
6114
6114
|
}
|
|
@@ -6200,11 +6200,13 @@ const Sa = /* @__PURE__ */ I({
|
|
|
6200
6200
|
), U(
|
|
6201
6201
|
a,
|
|
6202
6202
|
(c) => {
|
|
6203
|
-
n("update:value", c.join(","));
|
|
6203
|
+
console.log(c), n("update:value", c.join(","));
|
|
6204
6204
|
},
|
|
6205
6205
|
{ deep: !0 }
|
|
6206
6206
|
);
|
|
6207
|
-
const s = (c) =>
|
|
6207
|
+
const s = (c) => {
|
|
6208
|
+
console.log(c), a.value.push(c);
|
|
6209
|
+
};
|
|
6208
6210
|
return (c, f) => {
|
|
6209
6211
|
const u = xt("a-image");
|
|
6210
6212
|
return se(), Xe("div", pu, [
|
|
@@ -6254,7 +6256,7 @@ const Sa = /* @__PURE__ */ I({
|
|
|
6254
6256
|
]);
|
|
6255
6257
|
};
|
|
6256
6258
|
}
|
|
6257
|
-
}), yu = /* @__PURE__ */ Wr(hu, [["__scopeId", "data-v-
|
|
6259
|
+
}), yu = /* @__PURE__ */ Wr(hu, [["__scopeId", "data-v-a5cb131d"]]), bu = [Na, Sa, yu], Cu = function(e) {
|
|
6258
6260
|
bu.forEach((t) => {
|
|
6259
6261
|
e.component(t.name, t);
|
|
6260
6262
|
});
|
|
@@ -109,4 +109,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
109
109
|
${Object.keys(n).map(l=>`--${e}-${l}: ${n[l]};`).join(`
|
|
110
110
|
`)}
|
|
111
111
|
}
|
|
112
|
-
`.trim()}function xs(e,t){const n=Cs(e,t);ve()?Je(n,`${bs}-dynamic-theme`):Ze(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}const Ss=e=>{const[t,n]=mt();return zt(a.computed(()=>({theme:t.value,token:n.value,hashId:"",path:["ant-design-icons",e.value]})),()=>[{[`.${e.value}`]:h(h({},qi()),{[`.${e.value} .${e.value}-icon`]:{display:"block"}})}])};function ws(e,t){const n=a.computed(()=>(e==null?void 0:e.value)||{}),r=a.computed(()=>n.value.inherit===!1||!(t!=null&&t.value)?Er:t.value);return a.computed(()=>{if(!(e!=null&&e.value))return t==null?void 0:t.value;const i=h({},r.value.components);return Object.keys(e.value.components||{}).forEach(l=>{i[l]=h(h({},i[l]),e.value.components[l])}),h(h(h({},r.value),n.value),{token:h(h({},r.value.token),n.value.token),components:i})})}var Os=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const $s="ant";function Ae(){return H.prefixCls||$s}function Yo(){return H.iconPrefixCls||Pt}const Cn=a.reactive({}),H=a.reactive({});a.watchEffect(()=>{h(H,Cn),H.prefixCls=Ae(),H.iconPrefixCls=Yo(),H.getPrefixCls=(e,t)=>t||(e?`${H.prefixCls}-${e}`:H.prefixCls),H.getRootPrefixCls=()=>H.prefixCls?H.prefixCls:Ae()});let xn;const Ps=e=>{xn&&xn(),xn=a.watchEffect(()=>{h(Cn,a.reactive(e)),h(H,a.reactive(e))}),e.theme&&xs(Ae(),e.theme)},Ts=()=>({getPrefixCls:(e,t)=>t||(e?`${Ae()}-${e}`:Ae()),getIconPrefixCls:Yo,getRootPrefixCls:()=>H.prefixCls?H.prefixCls:Ae()}),Xe=a.defineComponent({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:fa(),setup(e,t){let{slots:n}=t;const r=_t(),o=(C,_)=>{const{prefixCls:M="ant"}=e;if(_)return _;const ie=M||r.getPrefixCls("");return C?`${ie}-${C}`:ie},i=a.computed(()=>e.iconPrefixCls||r.iconPrefixCls.value||Pt),l=a.computed(()=>i.value!==r.iconPrefixCls.value),c=a.computed(()=>{var C;return e.csp||((C=r.csp)===null||C===void 0?void 0:C.value)}),u=Ss(i),s=ws(a.computed(()=>e.theme),a.computed(()=>{var C;return(C=r.theme)===null||C===void 0?void 0:C.value})),f=C=>(e.renderEmpty||n.renderEmpty||r.renderEmpty||il)(C),d=a.computed(()=>{var C,_;return(C=e.autoInsertSpaceInButton)!==null&&C!==void 0?C:(_=r.autoInsertSpaceInButton)===null||_===void 0?void 0:_.value}),p=a.computed(()=>{var C;return e.locale||((C=r.locale)===null||C===void 0?void 0:C.value)});a.watch(p,()=>{Cn.locale=p.value},{immediate:!0});const m=a.computed(()=>{var C;return e.direction||((C=r.direction)===null||C===void 0?void 0:C.value)}),y=a.computed(()=>{var C,_;return(C=e.space)!==null&&C!==void 0?C:(_=r.space)===null||_===void 0?void 0:_.value}),v=a.computed(()=>{var C,_;return(C=e.virtual)!==null&&C!==void 0?C:(_=r.virtual)===null||_===void 0?void 0:_.value}),S=a.computed(()=>{var C,_;return(C=e.dropdownMatchSelectWidth)!==null&&C!==void 0?C:(_=r.dropdownMatchSelectWidth)===null||_===void 0?void 0:_.value}),b=a.computed(()=>{var C;return e.getTargetContainer!==void 0?e.getTargetContainer:(C=r.getTargetContainer)===null||C===void 0?void 0:C.value}),w=a.computed(()=>{var C;return e.getPopupContainer!==void 0?e.getPopupContainer:(C=r.getPopupContainer)===null||C===void 0?void 0:C.value}),T=a.computed(()=>{var C;return e.pageHeader!==void 0?e.pageHeader:(C=r.pageHeader)===null||C===void 0?void 0:C.value}),O=a.computed(()=>{var C;return e.input!==void 0?e.input:(C=r.input)===null||C===void 0?void 0:C.value}),x=a.computed(()=>{var C;return e.pagination!==void 0?e.pagination:(C=r.pagination)===null||C===void 0?void 0:C.value}),P=a.computed(()=>{var C;return e.form!==void 0?e.form:(C=r.form)===null||C===void 0?void 0:C.value}),g=a.computed(()=>{var C;return e.select!==void 0?e.select:(C=r.select)===null||C===void 0?void 0:C.value}),$=a.computed(()=>e.componentSize),E=a.computed(()=>e.componentDisabled),W=a.computed(()=>{var C,_;return(C=e.wave)!==null&&C!==void 0?C:(_=r.wave)===null||_===void 0?void 0:_.value}),Z={csp:c,autoInsertSpaceInButton:d,locale:p,direction:m,space:y,virtual:v,dropdownMatchSelectWidth:S,getPrefixCls:o,iconPrefixCls:i,theme:a.computed(()=>{var C,_;return(C=s.value)!==null&&C!==void 0?C:(_=r.theme)===null||_===void 0?void 0:_.value}),renderEmpty:f,getTargetContainer:b,getPopupContainer:w,pageHeader:T,input:O,pagination:x,form:P,select:g,componentSize:$,componentDisabled:E,transformCellText:a.computed(()=>e.transformCellText),wave:W},U=a.computed(()=>{const C=s.value||{},{algorithm:_,token:M}=C,ie=Os(C,["algorithm","token"]),On=_&&(!Array.isArray(_)||_.length>0)?Qn(_):void 0;return h(h({},ie),{theme:On,token:h(h({},ft),M)})}),wn=a.computed(()=>{var C,_;let M={};return p.value&&(M=((C=p.value.Form)===null||C===void 0?void 0:C.defaultValidateMessages)||((_=je.Form)===null||_===void 0?void 0:_.defaultValidateMessages)||{}),e.form&&e.form.validateMessages&&(M=h(h({},M),e.form.validateMessages)),M});pa(Z),da({validateMessages:wn}),ll($),ga(E);const Ke=C=>{var _,M;let ie=l.value?u((_=n.default)===null||_===void 0?void 0:_.call(n)):(M=n.default)===null||M===void 0?void 0:M.call(n);if(e.theme){const On=function(){return ie}();ie=a.createVNode(tl,{value:U.value},{default:()=>[On]})}return a.createVNode(Rc,{locale:p.value||C,ANT_MARK__:mn},{default:()=>[ie]})};return a.watchEffect(()=>{m.value&&(ae.config({rtl:m.value==="rtl"}),Me.config({rtl:m.value==="rtl"}))}),()=>a.createVNode(Rn,{children:(C,_,M)=>Ke(M)},null)}});Xe.config=Ps,Xe.install=function(e){e.component(Xe.name,Xe)};const qe={requestClient:null,VITE_GLOB_UPLOAD_URL:"",VITE_GLOB_BASE_URL:""};function _s(e){qe.requestClient=e.requestClient,qe.VITE_GLOB_UPLOAD_URL=e.VITE_GLOB_UPLOAD_URL,qe.VITE_GLOB_BASE_URL=e.VITE_GLOB_BASE_URL}const Sn=a.defineComponent({__name:"BaseUpload",props:{type:{type:String,default:"file"},fileType:{type:Array,default:()=>[]},size:{type:Number,default:0},url:{type:String,default:""}},emits:["change"],setup(e,{emit:t}){const n=t,r=e;let o;o=new Zo(qe.requestClient);const i=async s=>{try{const f=await o.upload(r.url?r.url:qe.VITE_GLOB_UPLOAD_URL+"/infra/file/upload",{file:s});n("change",f)}catch(f){console.log(f)}},l=a.reactive({fileData:void 0});let{fileData:c}=a.toRefs(l);const u=s=>{const f=s.name.split(".").pop();return r.type==="image"&&!s.type.includes("image")?(ae.error(`图片格式不正确, 请上传${r.fileType.join("/")}图片格式文件!`),!1):r.type==="file"&&r.fileType.length&&!r.fileType.includes(f)?(ae.error(`文件格式不正确, 请上传${r.fileType.join("/")}后缀的格式文件!`),!1):r.size>0&&s.size/1024/1024>r.size?(ae.error(`上传文件大小不能超过 ${r.size/1024/1024} MB!`),!1):(c.value=s,!1)};return a.watch(c,()=>{c.value&&i(c.value)}),(s,f)=>{const d=a.resolveComponent("a-upload");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(d,{"before-upload":u,showUploadList:!1},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3})])}}}),Es={class:"upload-image"},Ns=["onClick"],Is={class:"upload-add-top"},Ms={class:"desc"},Qo=$n(a.defineComponent({__name:"UploadImage",props:{value:{type:String,default:""},imageWidth:{type:[Number,String],default:100},limit:{type:Number,default:1},size:{type:Number,default:0},fileType:{type:Array,default:()=>[]},url:{type:String,default:""},buttonTitle:{type:String,default:"上传图片"},desc:{type:String,default:"只支持jpg/png格式,建议使用尺寸100*100像素"}},emits:["update:value"],setup(e,{emit:t}){const n=t,r=e,o=a.reactive({imageList:[]});let{imageList:i}=a.toRefs(o),{value:l}=a.toRefs(r);const c=s=>i.value.splice(s,1);a.watch(l,s=>{console.log(s),s&&(i.value=s.split(","))},{deep:!0}),a.watch(i,s=>{n("update:value",s.join(","))},{deep:!0});const u=s=>i.value.push(s);return(s,f)=>{const d=a.resolveComponent("a-image");return a.openBlock(),a.createElementBlock("div",Es,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),(p,m)=>(a.openBlock(),a.createElementBlock("div",{class:"image-item",key:m,style:a.normalizeStyle(`height:${parseInt(e.imageWidth+"")}px;width:${parseInt(e.imageWidth+"")}px`)},[a.createVNode(d,{width:e.imageWidth,height:e.imageWidth,src:p},null,8,["width","height","src"]),a.createElementVNode("div",{class:"delete-image",onClick:y=>c(m)},[a.createVNode(a.unref(Te))],8,Ns)],4))),128)),a.unref(i).length<e.limit?(a.openBlock(),a.createBlock(Sn,{key:0,type:"image",size:e.size,fileType:e.fileType,url:e.url,onChange:u},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"upload-add",style:a.normalizeStyle(`height:${parseInt(e.imageWidth+"")}px;width:${parseInt(e.imageWidth+"")}px`)},[a.createElementVNode("div",Is,[a.createVNode(a.unref(pn)),a.createTextVNode(" "+a.toDisplayString(e.buttonTitle),1)]),a.createElementVNode("div",Ms,a.toDisplayString(e.desc),1)],4)]),_:1},8,["size","fileType","url"])):a.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-
|
|
112
|
+
`.trim()}function xs(e,t){const n=Cs(e,t);ve()?Je(n,`${bs}-dynamic-theme`):Ze(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}const Ss=e=>{const[t,n]=mt();return zt(a.computed(()=>({theme:t.value,token:n.value,hashId:"",path:["ant-design-icons",e.value]})),()=>[{[`.${e.value}`]:h(h({},qi()),{[`.${e.value} .${e.value}-icon`]:{display:"block"}})}])};function ws(e,t){const n=a.computed(()=>(e==null?void 0:e.value)||{}),r=a.computed(()=>n.value.inherit===!1||!(t!=null&&t.value)?Er:t.value);return a.computed(()=>{if(!(e!=null&&e.value))return t==null?void 0:t.value;const i=h({},r.value.components);return Object.keys(e.value.components||{}).forEach(l=>{i[l]=h(h({},i[l]),e.value.components[l])}),h(h(h({},r.value),n.value),{token:h(h({},r.value.token),n.value.token),components:i})})}var Os=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const $s="ant";function Ae(){return H.prefixCls||$s}function Yo(){return H.iconPrefixCls||Pt}const Cn=a.reactive({}),H=a.reactive({});a.watchEffect(()=>{h(H,Cn),H.prefixCls=Ae(),H.iconPrefixCls=Yo(),H.getPrefixCls=(e,t)=>t||(e?`${H.prefixCls}-${e}`:H.prefixCls),H.getRootPrefixCls=()=>H.prefixCls?H.prefixCls:Ae()});let xn;const Ps=e=>{xn&&xn(),xn=a.watchEffect(()=>{h(Cn,a.reactive(e)),h(H,a.reactive(e))}),e.theme&&xs(Ae(),e.theme)},Ts=()=>({getPrefixCls:(e,t)=>t||(e?`${Ae()}-${e}`:Ae()),getIconPrefixCls:Yo,getRootPrefixCls:()=>H.prefixCls?H.prefixCls:Ae()}),Xe=a.defineComponent({compatConfig:{MODE:3},name:"AConfigProvider",inheritAttrs:!1,props:fa(),setup(e,t){let{slots:n}=t;const r=_t(),o=(C,_)=>{const{prefixCls:M="ant"}=e;if(_)return _;const ie=M||r.getPrefixCls("");return C?`${ie}-${C}`:ie},i=a.computed(()=>e.iconPrefixCls||r.iconPrefixCls.value||Pt),l=a.computed(()=>i.value!==r.iconPrefixCls.value),c=a.computed(()=>{var C;return e.csp||((C=r.csp)===null||C===void 0?void 0:C.value)}),u=Ss(i),s=ws(a.computed(()=>e.theme),a.computed(()=>{var C;return(C=r.theme)===null||C===void 0?void 0:C.value})),f=C=>(e.renderEmpty||n.renderEmpty||r.renderEmpty||il)(C),d=a.computed(()=>{var C,_;return(C=e.autoInsertSpaceInButton)!==null&&C!==void 0?C:(_=r.autoInsertSpaceInButton)===null||_===void 0?void 0:_.value}),p=a.computed(()=>{var C;return e.locale||((C=r.locale)===null||C===void 0?void 0:C.value)});a.watch(p,()=>{Cn.locale=p.value},{immediate:!0});const m=a.computed(()=>{var C;return e.direction||((C=r.direction)===null||C===void 0?void 0:C.value)}),y=a.computed(()=>{var C,_;return(C=e.space)!==null&&C!==void 0?C:(_=r.space)===null||_===void 0?void 0:_.value}),v=a.computed(()=>{var C,_;return(C=e.virtual)!==null&&C!==void 0?C:(_=r.virtual)===null||_===void 0?void 0:_.value}),S=a.computed(()=>{var C,_;return(C=e.dropdownMatchSelectWidth)!==null&&C!==void 0?C:(_=r.dropdownMatchSelectWidth)===null||_===void 0?void 0:_.value}),b=a.computed(()=>{var C;return e.getTargetContainer!==void 0?e.getTargetContainer:(C=r.getTargetContainer)===null||C===void 0?void 0:C.value}),w=a.computed(()=>{var C;return e.getPopupContainer!==void 0?e.getPopupContainer:(C=r.getPopupContainer)===null||C===void 0?void 0:C.value}),T=a.computed(()=>{var C;return e.pageHeader!==void 0?e.pageHeader:(C=r.pageHeader)===null||C===void 0?void 0:C.value}),O=a.computed(()=>{var C;return e.input!==void 0?e.input:(C=r.input)===null||C===void 0?void 0:C.value}),x=a.computed(()=>{var C;return e.pagination!==void 0?e.pagination:(C=r.pagination)===null||C===void 0?void 0:C.value}),P=a.computed(()=>{var C;return e.form!==void 0?e.form:(C=r.form)===null||C===void 0?void 0:C.value}),g=a.computed(()=>{var C;return e.select!==void 0?e.select:(C=r.select)===null||C===void 0?void 0:C.value}),$=a.computed(()=>e.componentSize),E=a.computed(()=>e.componentDisabled),W=a.computed(()=>{var C,_;return(C=e.wave)!==null&&C!==void 0?C:(_=r.wave)===null||_===void 0?void 0:_.value}),Z={csp:c,autoInsertSpaceInButton:d,locale:p,direction:m,space:y,virtual:v,dropdownMatchSelectWidth:S,getPrefixCls:o,iconPrefixCls:i,theme:a.computed(()=>{var C,_;return(C=s.value)!==null&&C!==void 0?C:(_=r.theme)===null||_===void 0?void 0:_.value}),renderEmpty:f,getTargetContainer:b,getPopupContainer:w,pageHeader:T,input:O,pagination:x,form:P,select:g,componentSize:$,componentDisabled:E,transformCellText:a.computed(()=>e.transformCellText),wave:W},U=a.computed(()=>{const C=s.value||{},{algorithm:_,token:M}=C,ie=Os(C,["algorithm","token"]),On=_&&(!Array.isArray(_)||_.length>0)?Qn(_):void 0;return h(h({},ie),{theme:On,token:h(h({},ft),M)})}),wn=a.computed(()=>{var C,_;let M={};return p.value&&(M=((C=p.value.Form)===null||C===void 0?void 0:C.defaultValidateMessages)||((_=je.Form)===null||_===void 0?void 0:_.defaultValidateMessages)||{}),e.form&&e.form.validateMessages&&(M=h(h({},M),e.form.validateMessages)),M});pa(Z),da({validateMessages:wn}),ll($),ga(E);const Ke=C=>{var _,M;let ie=l.value?u((_=n.default)===null||_===void 0?void 0:_.call(n)):(M=n.default)===null||M===void 0?void 0:M.call(n);if(e.theme){const On=function(){return ie}();ie=a.createVNode(tl,{value:U.value},{default:()=>[On]})}return a.createVNode(Rc,{locale:p.value||C,ANT_MARK__:mn},{default:()=>[ie]})};return a.watchEffect(()=>{m.value&&(ae.config({rtl:m.value==="rtl"}),Me.config({rtl:m.value==="rtl"}))}),()=>a.createVNode(Rn,{children:(C,_,M)=>Ke(M)},null)}});Xe.config=Ps,Xe.install=function(e){e.component(Xe.name,Xe)};const qe={requestClient:null,VITE_GLOB_UPLOAD_URL:"",VITE_GLOB_BASE_URL:""};function _s(e){qe.requestClient=e.requestClient,qe.VITE_GLOB_UPLOAD_URL=e.VITE_GLOB_UPLOAD_URL,qe.VITE_GLOB_BASE_URL=e.VITE_GLOB_BASE_URL}const Sn=a.defineComponent({__name:"BaseUpload",props:{type:{type:String,default:"file"},fileType:{type:Array,default:()=>[]},size:{type:Number,default:0},url:{type:String,default:""}},emits:["change"],setup(e,{emit:t}){const n=t,r=e;let o;o=new Zo(qe.requestClient);const i=async s=>{try{const f=await o.upload(r.url?r.url:qe.VITE_GLOB_UPLOAD_URL+"/infra/file/upload",{file:s});console.log(f),n("change",f)}catch(f){console.log(f)}},l=a.reactive({fileData:void 0});let{fileData:c}=a.toRefs(l);const u=s=>{const f=s.name.split(".").pop();return r.type==="image"&&!s.type.includes("image")?(ae.error(`图片格式不正确, 请上传${r.fileType.join("/")}图片格式文件!`),!1):r.type==="file"&&r.fileType.length&&!r.fileType.includes(f)?(ae.error(`文件格式不正确, 请上传${r.fileType.join("/")}后缀的格式文件!`),!1):r.size>0&&s.size/1024/1024>r.size?(ae.error(`上传文件大小不能超过 ${r.size/1024/1024} MB!`),!1):(c.value=s,!1)};return a.watch(c,()=>{c.value&&i(c.value)}),(s,f)=>{const d=a.resolveComponent("a-upload");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(d,{"before-upload":u,showUploadList:!1},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3})])}}}),Es={class:"upload-image"},Ns=["onClick"],Is={class:"upload-add-top"},Ms={class:"desc"},Qo=$n(a.defineComponent({__name:"UploadImage",props:{value:{type:String,default:""},imageWidth:{type:[Number,String],default:100},limit:{type:Number,default:1},size:{type:Number,default:0},fileType:{type:Array,default:()=>[]},url:{type:String,default:""},buttonTitle:{type:String,default:"上传图片"},desc:{type:String,default:"只支持jpg/png格式,建议使用尺寸100*100像素"}},emits:["update:value"],setup(e,{emit:t}){const n=t,r=e,o=a.reactive({imageList:[]});let{imageList:i}=a.toRefs(o),{value:l}=a.toRefs(r);const c=s=>i.value.splice(s,1);a.watch(l,s=>{console.log(s),s&&(i.value=s.split(","))},{deep:!0}),a.watch(i,s=>{console.log(s),n("update:value",s.join(","))},{deep:!0});const u=s=>{console.log(s),i.value.push(s)};return(s,f)=>{const d=a.resolveComponent("a-image");return a.openBlock(),a.createElementBlock("div",Es,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),(p,m)=>(a.openBlock(),a.createElementBlock("div",{class:"image-item",key:m,style:a.normalizeStyle(`height:${parseInt(e.imageWidth+"")}px;width:${parseInt(e.imageWidth+"")}px`)},[a.createVNode(d,{width:e.imageWidth,height:e.imageWidth,src:p},null,8,["width","height","src"]),a.createElementVNode("div",{class:"delete-image",onClick:y=>c(m)},[a.createVNode(a.unref(Te))],8,Ns)],4))),128)),a.unref(i).length<e.limit?(a.openBlock(),a.createBlock(Sn,{key:0,type:"image",size:e.size,fileType:e.fileType,url:e.url,onChange:u},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"upload-add",style:a.normalizeStyle(`height:${parseInt(e.imageWidth+"")}px;width:${parseInt(e.imageWidth+"")}px`)},[a.createElementVNode("div",Is,[a.createVNode(a.unref(pn)),a.createTextVNode(" "+a.toDisplayString(e.buttonTitle),1)]),a.createElementVNode("div",Ms,a.toDisplayString(e.desc),1)],4)]),_:1},8,["size","fileType","url"])):a.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-a5cb131d"]]),As=[Pn,Sn,Qo],ks={install:function(e){As.forEach(t=>{e.component(t.name,t)})}},js=e=>_s(e);X.ApiSelect=Pn,X.BaseUpload=Sn,X.UploadImage=Qo,X.default=ks,X.sandInit=js,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|