@bsgoal/common 0.0.5 → 0.0.7

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/lib/index.umd.js DELETED
@@ -1,2 +0,0 @@
1
- (function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w["bsgoal-common"]={},w.Vue,w["element-plus"]))})(this,function(w,e,D){"use strict";var Dt=Object.defineProperty;var le=Object.getOwnPropertySymbols;var Ft=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var ce=(w,e,D)=>e in w?Dt(w,e,{enumerable:!0,configurable:!0,writable:!0,value:D}):w[e]=D,re=(w,e)=>{for(var D in e||(e={}))Ft.call(e,D)&&ce(w,D,e[D]);if(le)for(var D of le(e))Ot.call(e,D)&&ce(w,D,e[D]);return w};const t={INPUT:"text",INPUT_NUMBER:"number",INPUT_TEXT_AREA:"textarea",SELECT:"select",SLIDER:"slider",SWITCH:"switch",RADIO:"radio",CHECKBOX:"checkbox",DATE:"date",WEEK:"week",MONTH:"month",YEAR:"year",DATE_RANGE:"daterange",MONTH_RANGE:"monthrange",TIME:"time",TIME_RANGE:"timerange",DATE_TIME:"datetime",DATE_TIME_RANGE:"datetimerange",OPERATION:"operation"};let J=null;const Q=l=>{const d=[],c=[],i=(a=[])=>{const r=a.map(g=>g.width),h=Math.max(...r);a.forEach(g=>{const{labelEl:C}=g;C.style.width=`${h}px`})},_=()=>{if(l){const a=l.querySelectorAll(".el-form-item__label");if(a&&a.length){let r=0;a.forEach((h,g)=>{h.style.width="initial",h.style.whiteSpace="nowrap";const{x:C=0,width:V=0}=h.getBoundingClientRect(),T={x:C,width:V,labelEl:h};g===0&&(r=C),C===r?d.push(T):c.push(T)})}}};J&&clearTimeout(J),J=setTimeout(()=>{_(),i(d),i(c)},50)},Z={align:{created(l){window.addEventListener("resize",()=>{Q(l)})},mounted(l){Q(l)},unmounted(l){window.removeEventListener("resize",Q(l))}},height:(l,{value:d=65,arg:c=""})=>{if(l){const{y:i=0}=l.getBoundingClientRect();l.style.height=`calc(100vh - ${i+d}px)`}}},St="",Mt="",S=(l,d)=>{const c=l.__vccOpts||l;for(const[i,_]of d)c[i]=_;return c},se={class:"bsgoal-base-form"},ie={class:"base_form"},de={key:1},_e=S(Object.assign({name:"BsgoalBaseForm"},{props:{configOptions:{type:[Array],default:()=>[]},medium:{type:[Number,String],default:24},values:{type:[Object],default:()=>({})}},emits:["on-form","on-clear","on-change","on-fold"],setup(l,{expose:d,emit:c}){const i=l,_=e.ref(null),a=Z.align,r=e.ref({});e.watchEffect(()=>{const{configOptions:p,values:f}=i,E=e.unref(p),u=e.unref(f);E.forEach(B=>{const{value:b="",prop:N="",type:x=""}=B;[t.INPUT,t.INPUT_TEXT_AREA].includes(x),r.value[N]=u[N]||b})});const h=e.computed(()=>{const{configOptions:p}=i;return e.unref(p).map(u=>{let{rules:B=!1,label:b=""}=u;const N={required:!0,message:`${b}不能为空`,trigger:"blur"};return B&&(typeof B=="boolean"?B=[N]:Array.isArray(B)?B=[N,...B]:B=[N,B]),u.rules=B,u})}),g=(p="",f="",E="")=>{if(!E)switch(p){case t.INPUT:case t.INPUT_TEXT_AREA:return`请输入${f}`;case t.SELECT:case t.DATE:case t.WEEK:case t.MONTH:case t.YEAR:case t.DATE_TIME:case t.TIME:return`请选择${f}`;case t.DATE_RANGE:case t.DATE_TIME_RANGE:return["开始日期","结束日期"];case t.TIME_RANGE:return["开始时间","结束时间"];case t.MONTH_RANGE:return["开始月份","结束月份"]}return E},C=(p="",f="")=>{if(!f)switch(p){case t.WEEK:return"ww";case t.DATE:case t.DATE_RANGE:return"YYYY-MM-DD";case t.MONTH:return"MM";case t.YEAR:return"YYYY";case t.MONTH_RANGE:return"YYYY-MM";case t.TIME:case t.TIME_RANGE:return"HH:mm:ss";case t.DATE_TIME:case t.DATE_TIME_RANGE:return"YYYY-MM-DD HH:mm:ss"}return f},V=()=>{const p=e.unref(r),{configOptions:f}=i,E=e.unref(f);for(const u of E){const{type:B="",range:b=[],prop:N=""}=u;if(B.endsWith("range")&&b&&b.length===2){const{0:x="",1:F=""}=p[N],{0:A="",1:$=""}=b;p[A]=x,p[$]=F}}return c("on-form",p),p},T=()=>{_.value.resetFields(),c("on-clear",r.value)},k=(p,f)=>{const E={type:p,prop:f,value:r.value[f]||""};c("on-change",E)};return d({triggerOperationClear:T,triggerOperationForm:V,validateForm:(p=()=>{})=>{_.value.validate((f=!1,E={})=>{if(f){const u=V();p(u)}else{p(!1),console.log("field",E);const u=Object.keys(E)[0],{[u]:{0:{message:B=""}}}=E;D.ElMessage.error(B)}})}}),(p,f)=>{const E=e.resolveComponent("el-input"),u=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-radio"),b=e.resolveComponent("el-radio-group"),N=e.resolveComponent("el-option"),x=e.resolveComponent("el-select"),F=e.resolveComponent("el-slider"),A=e.resolveComponent("el-switch"),$=e.resolveComponent("el-date-picker"),U=e.resolveComponent("el-time-picker"),Y=e.resolveComponent("el-checkbox"),j=e.resolveComponent("el-checkbox-group"),H=e.resolveComponent("el-form-item"),te=e.resolveComponent("el-col"),oe=e.resolveComponent("el-row"),ne=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",ie,[e.withDirectives((e.openBlock(),e.createBlock(ne,{ref_key:"EL_FORM_REF",ref:_,"label-suffix":":",model:r.value},{default:e.withCtx(()=>[e.createVNode(oe,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),({label:O="",prop:m="",type:n="text",placeholder:s="",readonly:M=!1,clearable:X=!0,rows:K=2,min:q=1,max:W=10,range:L=[],format:R="",rules:P=[]}={},G)=>(e.openBlock(),e.createBlock(te,{key:G,xs:24,sm:24,md:l.medium},{default:e.withCtx(()=>[e.createVNode(H,{label:O,prop:m,rules:P},{default:e.withCtx(()=>[M?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(r.value[m]),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n===e.unref(t).INPUT?(e.openBlock(),e.createBlock(E,{key:0,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,placeholder:g(n,O,s),clearable:X,onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","placeholder","clearable","onChange"])):e.createCommentVNode("",!0),n===e.unref(t).INPUT_TEXT_AREA?(e.openBlock(),e.createBlock(E,{key:1,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,type:"textarea",rows:K,clearable:X,placeholder:g(n,O,s),onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","rows","clearable","placeholder","onChange"])):e.createCommentVNode("",!0),n===e.unref(t).INPUT_NUMBER?(e.openBlock(),e.createBlock(u,{key:2,modelValue:p.num,"onUpdate:modelValue":f[0]||(f[0]=o=>p.num=o),min:q,max:W,onChange:k},null,8,["modelValue","min","max"])):e.createCommentVNode("",!0),n===e.unref(t).RADIO?(e.openBlock(),e.createBlock(b,{key:3,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,onChange:o=>k(n,m)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L,(o,I)=>(e.openBlock(),e.createBlock(B,{key:I,label:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):e.createCommentVNode("",!0),n===e.unref(t).SELECT?(e.openBlock(),e.createBlock(x,{key:4,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,placeholder:g(n,O,s),onChange:o=>k(n,m)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L,(o,I)=>(e.openBlock(),e.createBlock(N,{key:I,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])):e.createCommentVNode("",!0),n===e.unref(t).SLIDER?(e.openBlock(),e.createBlock(F,{key:5,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,min:q,max:W,onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","min","max","onChange"])):e.createCommentVNode("",!0),n===e.unref(t).SWITCH?(e.openBlock(),e.createBlock(A,{key:6,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,"active-value":L[0]||!0,"inactive-value":L[1]||!1,onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value","onChange"])):e.createCommentVNode("",!0),[e.unref(t).DATE,e.unref(t).MONTH,e.unref(t).YEAR,e.unref(t).DATE_TIME].includes(n)?(e.openBlock(),e.createBlock($,{key:7,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,format:C(n,R),"value-format":C(n,R),type:n,placeholder:g(n,O,s),onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","format","value-format","type","placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).DATE_RANGE,e.unref(t).MONTH_RANGE,e.unref(t).DATE_TIME_RANGE].includes(n)?(e.openBlock(),e.createBlock($,{key:8,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,type:n,"value-format":C(n,R),"start-placeholder":g(n,O,s)[0],"end-placeholder":g(n,O,s)[1],onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","type","value-format","start-placeholder","end-placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).TIME].includes(n)?(e.openBlock(),e.createBlock(U,{key:9,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,"arrow-control":"","value-format":C(n,R),placeholder:g(n,O,s),onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","value-format","placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).TIME_RANGE].includes(n)?(e.openBlock(),e.createBlock(U,{key:10,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,"is-range":"","value-format":C(n,R),"start-placeholder":g(n,O,s)[0],"end-placeholder":g(n,O,s)[1],onChange:o=>k(n,m)},null,8,["modelValue","onUpdate:modelValue","value-format","start-placeholder","end-placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).CHECKBOX].includes(n)?(e.openBlock(),e.createBlock(j,{key:11,modelValue:r.value[m],"onUpdate:modelValue":o=>r.value[m]=o,onChange:o=>k(n,m)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L,(o,I)=>(e.openBlock(),e.createBlock(Y,{key:I,label:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):e.createCommentVNode("",!0),[].includes(n)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[],64)):e.createCommentVNode("",!0)],64))]),_:2},1032,["label","prop","rules"])]),_:2},1032,["md"]))),128))]),_:1})]),_:1},8,["model"])),[[e.unref(a)]])])])}}}),[["__scopeId","data-v-8c079baa"]]),Ut="",Lt="",ue={class:"bsgoal-base-table-content"},me={class:"bas_tabl_content"},fe=S(Object.assign({name:"BsgoalBaseTableContent"},{props:{data:{type:[String,Number,Object,Number,Boolean],default:""}},setup(l){return(d,c)=>(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",me,e.toDisplayString(l.data),1)]))}}),[["__scopeId","data-v-a66a56ec"]]);/*! Element Plus v2.3.3 */var pe={name:"zh-cn",el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"}}};const Yt="",Ht="",he=l=>(e.pushScopeId("data-v-05353ff7"),l=l(),e.popScopeId(),l),ge={class:"bsgoal-base-table-pagination"},Ee={class:"base_table_pagination"},Be=he(()=>e.createElementVNode("span",null,"总数",-1)),ke=S(Object.assign({name:"BsgoalBaseTablePagination"},{props:{currentPage:{type:[Number],default:1},pageSizes:{type:[Array],default:()=>[10,20,30,40,50,100]},pageSize:{type:[Number],default:10},total:{type:[Number],default:0}},emits:["on-size-change","on-current-change"],setup(l,{emit:d}){const c=(a=0)=>{d("on-size-change",a)},i=(a=1)=>{d("on-current-change",a)},_=e.ref(1);return(a,r)=>{const h=e.resolveComponent("el-pagination"),g=e.resolveComponent("el-config-provider");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",Ee,[e.createVNode(g,{locale:e.unref(pe)},{default:e.withCtx(()=>[e.createVNode(h,{background:"",layout:"total, sizes, prev, pager, next, jumper","current-page":_.value,"onUpdate:currentPage":r[0]||(r[0]=C=>_.value=C),"page-sizes":l.pageSizes,"page-size":l.pageSize,total:l.total,onSizeChange:c,onCurrentChange:i},{next:e.withCtx(()=>[Be]),_:1},8,["current-page","page-sizes","page-size","total"])]),_:1},8,["locale"])])])}}}),[["__scopeId","data-v-05353ff7"]]),Ce=(l=null,{expression:d=65,arg:c={}}={})=>{const i=e.unref(l);if(i){const _=i.querySelector(".el-table");_&&e.nextTick(()=>{const{y:a=0}=_.getBoundingClientRect();_.style.height=`calc(100vh - ${a+d}px)`})}},v=(l=Promise.resolve(),d=null,c=e.ref(!1),i=e.ref(null))=>{const _=e.ref("");return c.value=!0,l.then((a={})=>{const{data:r={},message:h=""}=a;i.value=r,_.value=h,d&&d(!0,r),c.value=!1}).catch((a={})=>{if(typeof a=="object"){const{message:r=""}=a;_.value=r}else _.value=a;d(!1,a),c.value=!1}).finally(()=>{c.value=!1}),{data:i,message:_,loading:c}},Wt="",Xt="",Ve={class:"bsgoal-base-table"},be={class:"base_table"},Ne={key:0,class:"base_table_menu"},ae=S(Object.assign({name:"BsgoalBaseTable"},{props:{configOptions:{type:[Array],default:()=>[]},data:{type:[Array],default:()=>[]},selection:{type:[Boolean],default:!1},operation:{type:[Boolean],default:!1},operationWidth:{type:[String,Number],default:100},loading:{type:[Boolean],default:!1},fetch:{type:[Object,Function],default:null},call:{type:[Object,Function],default:null},mapProps:{type:[Object],default:()=>({currentPage:"currentPage",pageSize:"pageSize",rows:"rows",total:"total"})}},setup(l,{expose:d}){const c=l,i=e.computed(()=>{const{configOptions:u=[],operation:B=!1,operationWidth:b=0}=c,N=e.unref(u),x=[];return B&&x.push({label:"操作",fixed:"right",prop:"operation",width:b}),[...N,...x]}),_=e.ref(null),a=e.inject("transferFoldStatus");e.watchEffect(()=>{const u=a?a.value:!1;Ce(_,{arg:u})});const r=e.ref(1),h=e.ref(10),g=e.ref(0),C=e.ref({}),V=e.ref(c.loading),T=e.ref(c.data),k=e.ref({}),y=()=>{const{fetch:u,call:B,mapProps:b}=c,N=C.value,x=r.value,F=h.value,A=re({},N),$=e.unref(b);A[$.currentPage]=x,A[$.pageSize]=F,v(u(A),B,V,k)};e.watch(k,u=>{const{mapProps:B}=c,b=e.unref(B);T.value=u[b.rows],g.value=u[b.total]});const p=(u={})=>{C.value=u,r.value=1,y()},f=(u=1)=>{r.value=u},E=(u=10)=>{h.value=u};return e.watch([r,h],()=>{y()}),d({refreshList:p}),(u,B)=>{const b=e.resolveComponent("el-table-column"),N=e.resolveComponent("el-table"),x=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",be,[u.$slots.menu?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(u.$slots,"menu",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"EL_TABLE_WRAP_REF",ref:_},[e.withDirectives((e.openBlock(),e.createBlock(N,{stripe:"",border:"","highlight-current-row":"",style:{width:"100%"},data:T.value,"header-cell-style":{fontWeight:"bold",backgroundColor:"#EBEEF5",color:"rgba(0,0,0,.85)",fontSize:"14px"}},{empty:e.withCtx(()=>[]),default:e.withCtx(()=>[l.selection?(e.openBlock(),e.createBlock(b,{key:0,fixed:"left",type:"selection",width:"40"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),({prop:F="",label:A="",align:$="center",width:U="",fixed:Y=!1}={},j)=>(e.openBlock(),e.createBlock(b,{key:j,label:A,align:$,width:U,fixed:Y,"min-width":`${A.length*14+24}px`},{default:e.withCtx(({row:H})=>[e.renderSlot(u.$slots,F,{row:H},()=>[e.createVNode(fe,{data:H[F]},null,8,["data"])],!0)]),_:2},1032,["label","align","width","fixed","min-width"]))),128))]),_:3},8,["data","header-cell-style"])),[[x,V.value]])],512),e.createVNode(ke,{total:g.value,onOnCurrentChange:f,onOnSizeChange:E},null,8,["total"])])])}}}),[["__scopeId","data-v-05083aef"]]),Jt="",Qt="",ee=S(Object.assign({name:"BsgoalBaseLine"},{props:{vertical:{type:[Boolean],default:!1}},setup(l){return(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["bsgoal-base-line",{"bsgoal-base-line__vertical":l.vertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["base_line",{base_line__vertical:l.vertical}])},null,2)],2))}}),[["__scopeId","data-v-b52ba9cb"]]);/*! Element Plus Icons Vue v2.1.0 */var z=(l,d)=>{let c=l.__vccOpts||l;for(let[i,_]of d)c[i]=_;return c},Te={name:"ArrowDown"},we={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},xe=e.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null,-1),ye=[xe];function Ae(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",we,ye)}var $e=z(Te,[["render",Ae],["__file","arrow-down.vue"]]),De={name:"ArrowLeft"},Fe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Oe=e.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"},null,-1),Se=[Oe];function Me(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",Fe,Se)}var Re=z(De,[["render",Me],["__file","arrow-left.vue"]]),Ie={name:"ArrowRight"},Ue={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Le=e.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null,-1),Pe=[Le];function ze(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",Ue,Pe)}var Ye=z(Ie,[["render",ze],["__file","arrow-right.vue"]]),He={name:"ArrowUp"},Ge={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},je=e.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0z"},null,-1),We=[je];function Xe(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",Ge,We)}var Ke=z(He,[["render",Xe],["__file","arrow-up.vue"]]),qe={name:"Delete"},Je={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},Qe=e.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"},null,-1),Ze=[Qe];function ve(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",Je,Ze)}var et=z(qe,[["render",ve],["__file","delete.vue"]]),tt={name:"Search"},ot={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},nt=e.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704z"},null,-1),at=[nt];function lt(l,d,c,i,_,a){return e.openBlock(),e.createElementBlock("svg",ot,at)}var ct=z(tt,[["render",lt],["__file","search.vue"]]);const eo="",to="",rt={class:"bsgoal-base-search-operation"},st=S(Object.assign({name:"BsgoalBaseSearchOperation"},{props:{fold:{type:[Boolean],default:!1}},emits:["on-fold"],setup(l,{emit:d}){const c=e.ref(!1),i=()=>{c.value=!e.unref(c),d("on-fold",c.value)};return(_,a)=>{const r=e.resolveComponent("el-button"),h=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(r,{type:"primary",icon:e.unref(ct),onClick:a[0]||(a[0]=g=>_.$emit("on-search"))},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1},8,["icon"]),e.createVNode(r,{icon:e.unref(et),onClick:a[1]||(a[1]=g=>_.$emit("on-clear"))},{default:e.withCtx(()=>[e.createTextVNode("清空")]),_:1},8,["icon"]),l.fold?(e.openBlock(),e.createElementBlock("div",{key:0,class:"operation_fold",style:{color:"var(--el-color-primary)"},onClick:i},[e.createTextVNode(e.toDisplayString(c.value?"收起":"展开"),1),e.createVNode(h,{color:"#409EFC"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(Ke),null,null,512),[[e.vShow,c.value]]),e.withDirectives(e.createVNode(e.unref($e),null,null,512),[[e.vShow,!c.value]])]),_:1})])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-b5796be8"]]),ao="",lo="",it={class:"bsgoal-base-search"},dt={class:"base_search"},_t={key:1},ut=S(Object.assign({name:"BsgoalBaseSearch"},{props:{configOptions:{type:[Array],default:()=>[]},medium:{type:[Number,String],default:6}},emits:["on-search","on-clear","on-change","on-fold"],setup(l,{emit:d}){const c=l,i=e.ref(null),_=Z.align,a=e.ref({});e.watchEffect(()=>{const{configOptions:f}=c;e.unref(f).forEach(u=>{const{value:B="",prop:b="",type:N=""}=u;[t.INPUT,t.INPUT_TEXT_AREA].includes(N),a.value[b]=B})});const r=e.computed(()=>{const{configOptions:f}=c,E=e.unref(f),u={type:t.OPERATION};return[...E,u]}),h=(f="",E="",u="")=>{if(!u)switch(f){case t.INPUT:case t.INPUT_TEXT_AREA:return`请输入${E}`;case t.SELECT:case t.DATE:case t.WEEK:case t.MONTH:case t.YEAR:case t.DATE_TIME:case t.TIME:return`请选择${E}`;case t.DATE_RANGE:case t.DATE_TIME_RANGE:return["开始日期","结束日期"];case t.TIME_RANGE:return["开始时间","结束时间"];case t.MONTH_RANGE:return["开始月份","结束月份"]}return u},g=(f="",E="")=>{if(!E)switch(f){case t.WEEK:return"ww";case t.DATE:case t.DATE_RANGE:return"YYYY-MM-DD";case t.MONTH:return"MM";case t.YEAR:return"YYYY";case t.MONTH_RANGE:return"YYYY-MM";case t.TIME:case t.TIME_RANGE:return"HH:mm:ss";case t.DATE_TIME:case t.DATE_TIME_RANGE:return"YYYY-MM-DD HH:mm:ss"}return E},C=()=>{const f=e.unref(a),{configOptions:E}=c,u=e.unref(E);for(const B of u){const{type:b="",range:N=[],prop:x=""}=B;if(b.endsWith("range")&&N&&N.length===2){const{0:F="",1:A=""}=f[x],{0:$="",1:U=""}=N;f[$]=F,f[U]=A}}d("on-search",f)};e.nextTick(()=>{C()});const V=()=>{i.value.resetFields(),d("on-clear",a.value)},T=e.inject("transferFoldStatus"),k=e.ref(!1),y=(f=!1)=>{k.value=f,T&&(T.value=f),d("on-fold",k)},p=(f,E)=>{C();const u={type:f,prop:E,value:a.value[E]||""};d("on-change",u)};return(f,E)=>{const u=e.resolveComponent("el-input"),B=e.resolveComponent("el-input-number"),b=e.resolveComponent("el-radio"),N=e.resolveComponent("el-radio-group"),x=e.resolveComponent("el-option"),F=e.resolveComponent("el-select"),A=e.resolveComponent("el-slider"),$=e.resolveComponent("el-switch"),U=e.resolveComponent("el-date-picker"),Y=e.resolveComponent("el-time-picker"),j=e.resolveComponent("el-checkbox"),H=e.resolveComponent("el-checkbox-group"),te=e.resolveComponent("el-form-item"),oe=e.resolveComponent("el-col"),ne=e.resolveComponent("el-row"),O=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",dt,[e.withDirectives((e.openBlock(),e.createBlock(O,{ref_key:"EL_FORM_REF",ref:i,"label-suffix":":","show-message":!1,model:a.value},{default:e.withCtx(()=>[e.createVNode(ne,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),({label:m="",prop:n="",type:s="text",placeholder:M="",readonly:X=!1,clearable:K=!0,rows:q=2,min:W=1,max:L=10,range:R=[],format:P=""}={},G)=>e.withDirectives((e.openBlock(),e.createBlock(oe,{key:G,xs:24,sm:12,md:l.medium},{default:e.withCtx(()=>[e.createVNode(te,{label:m,prop:n},{default:e.withCtx(()=>[X?(e.openBlock(),e.createElementBlock("div",_t,e.toDisplayString(a.value[n]),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s===e.unref(t).INPUT?(e.openBlock(),e.createBlock(u,{key:0,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,placeholder:h(s,m,M),clearable:K,onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","placeholder","clearable","onChange"])):e.createCommentVNode("",!0),s===e.unref(t).INPUT_TEXT_AREA?(e.openBlock(),e.createBlock(u,{key:1,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,type:"textarea",rows:q,clearable:K,placeholder:h(s,m,M),onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","rows","clearable","placeholder","onChange"])):e.createCommentVNode("",!0),s===e.unref(t).INPUT_NUMBER?(e.openBlock(),e.createBlock(B,{key:2,modelValue:f.num,"onUpdate:modelValue":E[0]||(E[0]=o=>f.num=o),min:W,max:L,onChange:p},null,8,["modelValue","min","max"])):e.createCommentVNode("",!0),s===e.unref(t).RADIO?(e.openBlock(),e.createBlock(N,{key:3,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,onChange:o=>p(s,n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(o,I)=>(e.openBlock(),e.createBlock(b,{key:I,label:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):e.createCommentVNode("",!0),s===e.unref(t).SELECT?(e.openBlock(),e.createBlock(F,{key:4,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,placeholder:h(s,m,M),onChange:o=>p(s,n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(o,I)=>(e.openBlock(),e.createBlock(x,{key:I,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])):e.createCommentVNode("",!0),s===e.unref(t).SLIDER?(e.openBlock(),e.createBlock(A,{key:5,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,min:W,max:L,onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","min","max","onChange"])):e.createCommentVNode("",!0),s===e.unref(t).SWITCH?(e.openBlock(),e.createBlock($,{key:6,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,"active-value":R[0]||!0,"inactive-value":R[1]||!1,onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value","onChange"])):e.createCommentVNode("",!0),[e.unref(t).DATE,e.unref(t).MONTH,e.unref(t).YEAR,e.unref(t).DATE_TIME].includes(s)?(e.openBlock(),e.createBlock(U,{key:7,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,format:g(s,P),"value-format":g(s,P),type:s,placeholder:h(s,m,M),onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","format","value-format","type","placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).DATE_RANGE,e.unref(t).MONTH_RANGE,e.unref(t).DATE_TIME_RANGE].includes(s)?(e.openBlock(),e.createBlock(U,{key:8,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,type:s,"value-format":g(s,P),"start-placeholder":h(s,m,M)[0],"end-placeholder":h(s,m,M)[1],onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","type","value-format","start-placeholder","end-placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).TIME].includes(s)?(e.openBlock(),e.createBlock(Y,{key:9,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,"arrow-control":"","value-format":g(s,P),placeholder:h(s,m,M),onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","value-format","placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).TIME_RANGE].includes(s)?(e.openBlock(),e.createBlock(Y,{key:10,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,"is-range":"","value-format":g(s,P),"start-placeholder":h(s,m,M)[0],"end-placeholder":h(s,m,M)[1],onChange:o=>p(s,n)},null,8,["modelValue","onUpdate:modelValue","value-format","start-placeholder","end-placeholder","onChange"])):e.createCommentVNode("",!0),[e.unref(t).CHECKBOX].includes(s)?(e.openBlock(),e.createBlock(H,{key:11,modelValue:a.value[n],"onUpdate:modelValue":o=>a.value[n]=o,onChange:o=>p(s,n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(o,I)=>(e.openBlock(),e.createBlock(j,{key:I,label:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):e.createCommentVNode("",!0),[].includes(s)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[],64)):e.createCommentVNode("",!0),[e.unref(t).OPERATION].includes(s)?(e.openBlock(),e.createBlock(st,{key:13,fold:G>=7,onOnSearch:C,onOnClear:V,onOnFold:y},null,8,["fold"])):e.createCommentVNode("",!0)],64))]),_:2},1032,["label","prop"])]),_:2},1032,["md"])),[[e.vShow,G<7||s===e.unref(t).OPERATION||G>=7&&k.value]])),128))]),_:1})]),_:1},8,["model"])),[[e.unref(_)]])]),e.createVNode(ee)])}}}),[["__scopeId","data-v-c4e64d40"]]),so="",io="",mt={class:"bsgoal-base-search-table"},ft={class:"base_search_table"},pt=S(Object.assign({name:"BsgoalBaseSearchTable"},{props:{configOptions:{type:[Array],default:()=>[]},tableData:{type:[Array],default:()=>[]},selection:{type:[Boolean],default:!1},operation:{type:[Boolean],default:!1},operationWidth:{type:[String,Number],default:100},fetch:{type:[Object,Function],default:null},call:{type:[Object,Function],default:null}},setup(l){const d=l,c=e.ref(!1);e.provide("transferFoldStatus",c);const i=e.unref(d.configOptions),_=e.computed(()=>i),a=e.computed(()=>i),r=e.useSlots(),h=e.ref(Object.keys(r)),g=e.ref(null),C=V=>{g.value.refreshList(V)};return(V,T)=>(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("div",ft,[e.createVNode(ut,{"config-options":e.unref(_),onOnSearch:C,onOnClear:C},null,8,["config-options"]),e.createVNode(ae,{ref_key:"BSGOAL_BASE_TABLE_REF",ref:g,operationWidth:l.operationWidth,"config-options":e.unref(a),data:l.tableData,selection:l.selection,operation:l.operation,fetch:l.fetch,call:l.call},e.createSlots({_:2},[e.renderList(h.value,k=>({name:k,fn:e.withCtx(({row:y={}})=>[e.renderSlot(V.$slots,k,{row:y},void 0,!0)])}))]),1032,["operationWidth","config-options","data","selection","operation","fetch","call"])])]))}}),[["__scopeId","data-v-9ec9045a"]]),mo="",fo="",ht={class:"bsgoal-base-tree-fold"},gt=S(Object.assign({name:"BsgoalBaseTreeFold"},{props:["modelValue"],emits:["update:modelValue"],setup(l,{emit:d}){let c=e.ref(!0);const i=()=>{c.value=!c.value,d("update:modelValue",c.value)};return(_,a)=>{const r=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",{class:e.normalizeClass(["base_tree_fold",{"base_tree_fold--hide":!e.unref(c)}]),onClick:i},[e.createVNode(r,{color:"#fff"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(Re),null,null,512),[[e.vShow,e.unref(c)]]),e.withDirectives(e.createVNode(e.unref(Ye),null,null,512),[[e.vShow,!e.unref(c)]])]),_:1})],2)])}}}),[["__scopeId","data-v-b5171812"]]),go="",Eo="",Et={class:"bsgoal-base-tree"},Bt={class:"base_tree"},kt={class:"base_tree_main"},Ct=S(Object.assign({name:"BsgoalBaseTree"},{props:{gasket:{type:[String,Number],default:10},data:{type:[Object,Array],default:()=>[]},treeProps:{type:[Object],default:()=>({label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",class:"class"})},lazyLoad:{type:[Function],default:()=>{}},initNode:{type:[Function],default:()=>{}}},emits:["on-click"],setup(l,{emit:d}){const c=l,i=Z.height,_=e.ref(""),a=e.ref(null);e.watch(_,V=>{a.value.filter(V)});const r=(V,T)=>V?T.label.includes(V):!0,h=e.ref(!0),g=(V,T,k,y)=>{d("on-click",V,T,k,y)},C=async(V,T,k)=>{if(V.level===0){const y=await k.initNode(V);return T(y||[])}else{const y=await k.lazyLoad(V);T(y||[])}};return(V,T)=>{const k=e.resolveComponent("el-input"),y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Et,[e.withDirectives((e.openBlock(),e.createElementBlock("div",Bt,[e.withDirectives(e.createElementVNode("div",kt,[e.createVNode(k,{modelValue:_.value,"onUpdate:modelValue":T[0]||(T[0]=p=>_.value=p),class:"base_tree_main_input",placeholder:"输入关键字过滤"},null,8,["modelValue"]),e.createVNode(y,{ref_key:"EL_TREE_REF",ref:a,lazy:"","highlight-current":"","empty-text":"暂无数据",load:(p,f)=>C(p,f,c),"expand-on-click-node":!1,props:l.treeProps,"filter-node-method":r,onNodeClick:g},null,8,["load","props"])],512),[[e.vShow,h.value]]),e.withDirectives(e.createVNode(ee,{vertical:""},null,512),[[e.vShow,h.value]]),e.createVNode(gt,{modelValue:h.value,"onUpdate:modelValue":T[1]||(T[1]=p=>h.value=p)},null,8,["modelValue"])])),[[e.unref(i),l.gasket]])])}}}),[["__scopeId","data-v-35fba25c"]]),Co="",Vo="",Vt={class:"bsgoal-base-dialog"},bt={class:"base_dialog"},Nt={class:"base_dialog_header"},Tt={class:"base_dialog_content"},wt={class:"base_dialog_footer"},xt=S(Object.assign({name:"BsgoalBaseDialog"},{props:{modelValue:{type:[Boolean],default:!1},title:{type:[String],default:"标题"},cancelTxt:{type:[String],default:"取消"},confirmTxt:{type:[String],default:"确定"}},emits:["update:modelValue","on-confirm"],setup(l,{emit:d}){const c=l,i=e.ref(c.modelValue.value),_=()=>{i.value=!1},a=()=>{i.value=!1,d("on-confirm")};return e.watch(()=>c.modelValue,r=>{i.value=r}),e.watch(i,r=>{d("update:modelValue",r)}),(r,h)=>{const g=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",bt,[e.createVNode(C,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=V=>i.value=V),"custom-class":"bsgoal_base_dialog_main"},{header:e.withCtx(()=>[e.createElementVNode("div",Nt,e.toDisplayString(l.title),1)]),footer:e.withCtx(()=>[e.createElementVNode("span",wt,[e.createVNode(g,{onClick:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelTxt),1)]),_:1}),e.createVNode(g,{type:"primary",onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmTxt),1)]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",Tt,[e.renderSlot(r.$slots,"default",{},void 0,!0)])]),_:3},8,["modelValue"])])])}}}),[["__scopeId","data-v-435caf75"]]),yt=t,At=v,$t={install(l,d={}){const{exclude:c=[]}=d,i={BsgoalBaseForm:_e,BsgoalBaseTable:ae,BsgoalBaseLine:ee,BsgoalBaseSearchTable:pt,BsgoalBaseTree:Ct,BsgoalBaseDialog:xt};for(const[_,a]of Object.entries(i))c.includes(_)||l.component(_,a)},enumType:t,useFetch:v};w.EnumType=yt,w.default=$t,w.useFetchApi=At,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
2
- //# sourceMappingURL=index.umd.js.map