VerifyTemplateMapData-086fa359.js 9.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import{D as X,aW as K,z as m,b as C,e as J,aX as ee,d as T,aY as te,aZ as R,h as p,a_ as se,a$ as ne,b0 as P,b1 as ie,v as oe,b2 as re,V as q,ac as E,av as ae,b3 as le,aa as M,R as ue,aI as O,b4 as de,b5 as fe,b6 as pe,b7 as j,T as L,S as x,b8 as ce,Y as A,Z as F,b9 as ve,a4 as me,a0 as he,ba as be,bb as ge,aR as ye,am as Q,aw as U}from"./index-dee576f2.js";import{g as Se}from"./get-slot-1efb97e5.js";function Re(e){if(typeof e=="number")return{"":e.toString()};const i={};return e.split(/ +/).forEach(s=>{if(s==="")return;const[t,n]=s.split(":");n===void 0?i[""]=t:i[t]=n}),i}function I(e,i){var s;if(e==null)return;const t=Re(e);if(i===void 0)return t[""];if(typeof i=="string")return(s=t[i])!==null&&s!==void 0?s:t[""];if(Array.isArray(i)){for(let n=i.length-1;n>=0;--n){const r=i[n];if(r in t)return t[r]}return t[""]}else{let n,r=-1;return Object.keys(t).forEach(o=>{const a=Number(o);!Number.isNaN(a)&&i>=a&&a>=r&&(r=a,n=t[o])}),n}}function _e(e){var i;const s=(i=e.dirs)===null||i===void 0?void 0:i.find(({dir:t})=>t===X);return!!(s&&s.value===!1)}const we={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function $e(e){return`(min-width: ${e}px)`}const k={};function xe(e=we){if(!K)return m(()=>[]);if(typeof window.matchMedia!="function")return m(()=>[]);const i=C({}),s=Object.keys(e),t=(n,r)=>{n.matches?i.value[r]=!0:i.value[r]=!1};return s.forEach(n=>{const r=e[n];let o,a;k[r]===void 0?(o=window.matchMedia($e(r)),o.addEventListener?o.addEventListener("change",d=>{a.forEach(u=>{u(d,n)})}):o.addListener&&o.addListener(d=>{a.forEach(u=>{u(d,n)})}),a=new Set,k[r]={mql:o,cbs:a}):(o=k[r].mql,a=k[r].cbs),a.add(t),o.matches&&a.forEach(d=>{d(o,n)})}),J(()=>{s.forEach(n=>{const{cbs:r}=k[e[n]];r.has(t)&&r.delete(t)})}),m(()=>{const{value:n}=i;return s.filter(r=>n[r])})}const W=1,Y=ee("n-grid"),H=1,B={span:{type:[Number,String],default:H},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}},Ce=se(B),Ge=T({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:B,setup(){const{isSsrRef:e,xGapRef:i,itemStyleRef:s,overflowRef:t,layoutShiftDisabledRef:n}=te(Y),r=ne();return{overflow:t,itemStyle:s,layoutShiftDisabled:n,mergedXGap:m(()=>R(i.value||0)),deriveStyle:()=>{e.value;const{privateSpan:o=H,privateShow:a=!0,privateColStart:d=void 0,privateOffset:u=0}=r.vnode.props,{value:g}=i,b=R(g||0);return{display:a?"":"none",gridColumn:`${d??`span ${o}`} / span ${o}`,marginLeft:u?`calc((100% - (${o} - 1) * ${b}) / ${o} * ${u} + ${b} * ${u})`:""}}}},render(){var e,i;if(this.layoutShiftDisabled){const{span:s,offset:t,mergedXGap:n}=this;return p("div",{style:{gridColumn:`span ${s} / span ${s}`,marginLeft:t?`calc((100% - (${s} - 1) * ${n}) / ${s} * ${t} + ${n} * ${t})`:""}},this.$slots)}return p("div",{style:[this.itemStyle,this.deriveStyle()]},(i=(e=this.$slots).default)===null||i===void 0?void 0:i.call(e,{overflow:this.overflow}))}}),Ne=Object.assign(Object.assign({},B),re),De=T({__GRID_ITEM__:!0,name:"FormItemGridItem",alias:["FormItemGi"],props:Ne,setup(){const e=C(null);return{formItemInstRef:e,validate:(...t)=>{const{value:n}=e;if(n)return n.validate(...t)},restoreValidation:()=>{const{value:t}=e;t&&t.restoreValidation()}}},render(){return p(Ge,P(this.$.vnode.props||{},Ce),{default:()=>{const e=P(this.$props,ie);return p(oe,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}}),Ie={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},Z=24,z="__ssr__",ke={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:Z},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},Pe=T({name:"Grid",inheritAttrs:!1,props:ke,setup(e){const{mergedClsPrefixRef:i,mergedBreakpointsRef:s}=q(e),t=/^\d+$/,n=C(void 0),r=xe((s==null?void 0:s.value)||Ie),o=E(()=>!!(e.itemResponsive||!t.test(e.cols.toString())||!t.test(e.xGap.toString())||!t.test(e.yGap.toString()))),a=m(()=>{if(o.value)return e.responsive==="self"?n.value:r.value}),d=E(()=>{var f;return(f=Number(I(e.cols.toString(),a.value)))!==null&&f!==void 0?f:Z}),u=E(()=>I(e.xGap.toString(),a.value)),g=E(()=>I(e.yGap.toString(),a.value)),b=f=>{n.value=f.contentRect.width},v=f=>{fe(b,f)},G=C(!1),_=m(()=>{if(e.responsive==="self")return v}),c=C(!1),y=C();return ae(()=>{const{value:f}=y;f&&f.hasAttribute(z)&&(f.removeAttribute(z),c.value=!0)}),le(Y,{layoutShiftDisabledRef:M(e,"layoutShiftDisabled"),isSsrRef:c,itemStyleRef:M(e,"itemStyle"),xGapRef:u,overflowRef:G}),{isSsr:!ue,contentEl:y,mergedClsPrefix:i,style:m(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:R(e.xGap),rowGap:R(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${d.value}, minmax(0, 1fr))`,columnGap:R(u.value),rowGap:R(g.value)}),isResponsive:o,responsiveQuery:a,responsiveCols:d,handleResize:_,overflow:G}},render(){if(this.layoutShiftDisabled)return p("div",O({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var i,s,t,n,r,o,a;this.overflow=!1;const d=pe(Se(this)),u=[],{collapsed:g,collapsedRows:b,responsiveCols:v,responsiveQuery:G}=this;d.forEach(l=>{var N,S,h,w;if(((N=l==null?void 0:l.type)===null||N===void 0?void 0:N.__GRID_ITEM__)!==!0)return;if(_e(l)){const $=j(l);$.props?$.props.privateShow=!1:$.props={privateShow:!1},u.push({child:$,rawChildSpan:0});return}l.dirs=((S=l.dirs)===null||S===void 0?void 0:S.filter(({dir:$})=>$!==X))||null;const V=j(l),D=Number((w=I((h=V.props)===null||h===void 0?void 0:h.span,G))!==null&&w!==void 0?w:W);D!==0&&u.push({child:V,rawChildSpan:D})});let _=0;const c=(i=u[u.length-1])===null||i===void 0?void 0:i.child;if(c!=null&&c.props){const l=(s=c.props)===null||s===void 0?void 0:s.suffix;l!==void 0&&l!==!1&&(_=(n=(t=c.props)===null||t===void 0?void 0:t.span)!==null&&n!==void 0?n:W,c.props.privateSpan=_,c.props.privateColStart=v+1-_,c.props.privateShow=(r=c.props.privateShow)!==null&&r!==void 0?r:!0)}let y=0,f=!1;for(const{child:l,rawChildSpan:N}of u){if(f&&(this.overflow=!0),!f){const S=Number((a=I((o=l.props)===null||o===void 0?void 0:o.offset,G))!==null&&a!==void 0?a:0),h=Math.min(N+S,v);if(l.props?(l.props.privateSpan=h,l.props.privateOffset=S):l.props={privateSpan:h,privateOffset:S},g){const w=y%v;h+w>v&&(y+=v-w),h+y+_>b*v?f=!0:y+=h}}f&&(l.props?l.props.privateShow!==!0&&(l.props.privateShow=!1):l.props={privateShow:!1})}return p("div",O({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[z]:this.isSsr||void 0},this.$attrs),u.map(({child:l})=>l))};return this.isResponsive&&this.responsive==="self"?p(de,{onResize:this.handleResize},{default:e}):e()}}),Ee=L([L("@keyframes spin-rotate",`
  2. from {
  3. transform: rotate(0);
  4. }
  5. to {
  6. transform: rotate(360deg);
  7. }
  8. `),x("spin-container",{position:"relative"},[x("spin-body",`
  9. position: absolute;
  10. top: 50%;
  11. left: 50%;
  12. transform: translateX(-50%) translateY(-50%);
  13. `,[ce()])]),x("spin-body",`
  14. display: inline-flex;
  15. align-items: center;
  16. justify-content: center;
  17. flex-direction: column;
  18. `),x("spin",`
  19. display: inline-flex;
  20. height: var(--n-size);
  21. width: var(--n-size);
  22. font-size: var(--n-size);
  23. color: var(--n-color);
  24. `,[A("rotate",`
  25. animation: spin-rotate 2s linear infinite;
  26. `)]),x("spin-description",`
  27. display: inline-block;
  28. font-size: var(--n-font-size);
  29. color: var(--n-text-color);
  30. transition: color .3s var(--n-bezier);
  31. margin-top: 8px;
  32. `),x("spin-content",`
  33. opacity: 1;
  34. transition: opacity .3s var(--n-bezier);
  35. pointer-events: all;
  36. `,[A("spinning",`
  37. user-select: none;
  38. -webkit-user-select: none;
  39. pointer-events: none;
  40. opacity: var(--n-opacity-spinning);
  41. `)])]),Te={small:20,medium:18,large:16},ze=Object.assign(Object.assign({},F.props),{description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0}}),Me=T({name:"Spin",props:ze,setup(e){const{mergedClsPrefixRef:i,inlineThemeDisabled:s}=q(e),t=F("Spin","-spin",Ee,ve,e,i),n=m(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:a},self:d}=t.value,{opacitySpinning:u,color:g,textColor:b}=d,v=typeof o=="number"?R(o):d[me("size",o)];return{"--n-bezier":a,"--n-opacity-spinning":u,"--n-size":v,"--n-color":g,"--n-text-color":b}}),r=s?he("spin",m(()=>{const{size:o}=e;return typeof o=="number"?String(o):o[0]}),n,e):void 0;return{mergedClsPrefix:i,compitableShow:be(e,["spinning","show"]),mergedStrokeWidth:m(()=>{const{strokeWidth:o}=e;if(o!==void 0)return o;const{size:a}=e;return Te[typeof a=="number"?"medium":a]}),cssVars:s?void 0:n,themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender}},render(){var e,i;const{$slots:s,mergedClsPrefix:t,description:n}=this,r=s.icon&&this.rotate,o=(n||s.description)&&p("div",{class:`${t}-spin-description`},n||((e=s.description)===null||e===void 0?void 0:e.call(s))),a=s.icon?p("div",{class:[`${t}-spin-body`,this.themeClass]},p("div",{class:[`${t}-spin`,r&&`${t}-spin--rotate`],style:s.default?"":this.cssVars},s.icon()),o):p("div",{class:[`${t}-spin-body`,this.themeClass]},p(ge,{clsPrefix:t,style:s.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${t}-spin`}),o);return(i=this.onRender)===null||i===void 0||i.call(this),s.default?p("div",{class:[`${t}-spin-container`,this.themeClass],style:this.cssVars},p("div",{class:[`${t}-spin-content`,this.compitableShow&&`${t}-spin-content--spinning`]},s),p(ye,{name:"fade-in-transition"},{default:()=>this.compitableShow?a:null})):a}}),Oe=e=>Q.request({method:"POST",url:"/VerifyTemplateMapData/List",data:e,baseURL:U}),je=e=>Q.request({method:"POST",url:"/VerifyTemplateMapData/Pu",data:e,baseURL:U});export{Me as _,De as a,Pe as b,Oe as g,je as p};