cnhis-design-vue 3.1.48-release.0 → 3.1.48-release.2
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/es/components/base-search/style/index.css +1 -1
- package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +24 -3
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-reader-sdk/src/types/index.d.ts +21 -15
- package/es/components/classification/index.d.ts +3 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +3 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +2 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +2 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/field-set/index.d.ts +21 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +22 -2
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +8 -0
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +0 -1
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +2 -1
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +9 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -1
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +13 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -0
- package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/index.d.ts +2 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +2 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +2 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.d.ts +9 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +3 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/index.d.ts +1 -0
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/index.d.ts +1 -0
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w,C,x){const D=15,j=e(),V=e(),X=e(),H=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||D)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||D)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||D)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),
|
|
1
|
+
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w,C,x){const D=15,j=e(),V=e(),X=e(),H=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||D)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||D)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||D)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*z.value})),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||D)||0;return H.value+a+l+L.value+I.value})),q=t((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*T.value})),z=t((()=>(W.value-k.value)/N.value)),T=t((()=>(G.value-R.value)/O.value)),A=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-z.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=S.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=t((()=>{const{grid:e}=S.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value,t.endY=q.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=t((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=q.value,t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ue=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:ae.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:q.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{h(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,C,x);V.value=l,X.value=u;const{drawScaleValue:r}=p(Y,ue,b,e,C,re,ne,oe,se,t,a,i);g(Y,ue,r),f(Y,ue),y(Y,ue,re),n(w.value);const{select:s}=o(Y,ue,b);j.value=s}))})),{propItems:ue,redrawPoints:V,select:j,clickMenu:X}}export{Y as useTemperatureChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:v,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";import"../../../../../shared/utils/index.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:v,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const x=S.length>0?new t.Group([...S],{...l,objectCaching:!1}):null;x&&x.sendToBack(),x&&o.value.add(x)}()}export{o as useTop};
|
|
@@ -3,7 +3,7 @@ import { fabric } from '../../../../../es/shared/utils/fabricjs';
|
|
|
3
3
|
import { IObject } from '../interface';
|
|
4
4
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
5
5
|
export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
|
|
6
|
-
getEqualXTypes: (pointX: number, field: string, range?:
|
|
6
|
+
getEqualXTypes: (points: any[], pointX: number, field: string, range?: any) => string[];
|
|
7
7
|
handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
|
|
8
8
|
isGridLimit: (point: IObject) => boolean;
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t,i){return{getEqualXTypes:function(e,t,i
|
|
1
|
+
const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t,i){return{getEqualXTypes:function(e,n,t,r=i.xCellWidth){const o=[],d=r/2;return e.forEach((e=>{e.origin&&!e.origin.isMenu&&Math.abs(n-e.left)<=d&&o.push(e.origin[t])})),[...new Set(o)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})},isGridLimit:function(e){const{left:n,top:t}=e,{originX:r,endX:o,originY:d,endY:c}=i;return n>=r&&n<=o&&t>=d&&t<=c}}}export{n as useCommon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:1,stroke:o.fill}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,
|
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:1,stroke:o.fill}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,f=i.width/2,h=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function u(t="circle",i){var n;const r={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...i},o=i.radius?(i.radius||5)+(i.strokeWidth||1):null!=(n=i.width)?n:0;switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...r});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...r});case"image":return new e.Image(i.element,r);case"yemai":{const t=()=>{const t=2*o,n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,o,t,o],n),c=new e.Line([o,0,o,t],n);return new e.Group([r,c])};return new e.Group([g(i),t()],r)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:o-.5,top:o-.5});return new e.Group([g(i),t],r)}case"circleAndText":{const t=new e.Text(String(i.text),{fontFamily:"微软雅黑",fontSize:12,originX:"center",originY:"center",fill:i.stroke,left:o-.5,top:o-1,objectCaching:!1});return new e.Group([g(i),t],r)}default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...r})}}function f(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:g}=r.icon,f=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:u(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:f,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:h,top:f})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,u as drawPoint,l as drawText,f as drawTextAndIconGroup,a as drawTextGroup};
|
|
@@ -40,6 +40,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
40
40
|
groupSetting: {
|
|
41
41
|
type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
|
|
42
42
|
};
|
|
43
|
+
customColumns: {
|
|
44
|
+
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
45
|
+
default: () => never[];
|
|
46
|
+
};
|
|
43
47
|
}, {
|
|
44
48
|
fieldsMapping: Record<string, string>;
|
|
45
49
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -82,6 +86,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
82
86
|
groupSetting: {
|
|
83
87
|
type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
|
|
84
88
|
};
|
|
89
|
+
customColumns: {
|
|
90
|
+
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
91
|
+
default: () => never[];
|
|
92
|
+
};
|
|
85
93
|
}>> & {
|
|
86
94
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
87
95
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -89,7 +97,14 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
89
97
|
}>>;
|
|
90
98
|
emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
|
|
91
99
|
newFields: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
|
|
92
|
-
columns: import("vue").Ref<
|
|
100
|
+
columns: import("vue").Ref<{
|
|
101
|
+
title: string;
|
|
102
|
+
type: "text" | "checkbox" | "select" | "input" | "inputNumber";
|
|
103
|
+
field: string;
|
|
104
|
+
checkedAll?: boolean | undefined;
|
|
105
|
+
disabledAll?: boolean | undefined;
|
|
106
|
+
isShow?: boolean | undefined;
|
|
107
|
+
}[]>;
|
|
93
108
|
fieldList: import("vue").ComputedRef<import("../../../es/shared/types").AnyObject[]>;
|
|
94
109
|
handleFieldSave: () => void;
|
|
95
110
|
onCancle: () => void;
|
|
@@ -354,6 +369,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
354
369
|
groupSetting: {
|
|
355
370
|
type: import("vue").PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("..").IhoTableRowGroupItem[]>> | undefined>;
|
|
356
371
|
};
|
|
372
|
+
customColumns: {
|
|
373
|
+
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
374
|
+
default: () => never[];
|
|
375
|
+
};
|
|
357
376
|
}>> & {
|
|
358
377
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
359
378
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -380,5 +399,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
380
399
|
}>[];
|
|
381
400
|
footerFlag: boolean;
|
|
382
401
|
isEdit: boolean;
|
|
402
|
+
customColumns: import("./src/types").FieldSetColumnItem[];
|
|
383
403
|
}>>;
|
|
384
404
|
export default FieldSet;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { setStyle, isDisable } from './utils';
|
|
3
|
-
import { FieldSetColumnName } from '../../../../es/components/field-set/src/types';
|
|
3
|
+
import { FieldSetColumnName, FieldSetColumnItem } from '../../../../es/components/field-set/src/types';
|
|
4
4
|
import { AnyObject } from '../../../../es/shared/types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
fields: {
|
|
@@ -42,6 +42,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
groupSetting: {
|
|
43
43
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
44
44
|
};
|
|
45
|
+
customColumns: {
|
|
46
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
47
|
+
default: () => never[];
|
|
48
|
+
};
|
|
45
49
|
}, {
|
|
46
50
|
fieldsMapping: Record<string, string>;
|
|
47
51
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -84,6 +88,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
88
|
groupSetting: {
|
|
85
89
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
86
90
|
};
|
|
91
|
+
customColumns: {
|
|
92
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
93
|
+
default: () => never[];
|
|
94
|
+
};
|
|
87
95
|
}>> & {
|
|
88
96
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
89
97
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -91,7 +99,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
91
99
|
}>>;
|
|
92
100
|
emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
|
|
93
101
|
newFields: import("vue").Ref<AnyObject[]>;
|
|
94
|
-
columns: import("vue").Ref<
|
|
102
|
+
columns: import("vue").Ref<{
|
|
103
|
+
title: string;
|
|
104
|
+
type: "text" | "checkbox" | "select" | "input" | "inputNumber";
|
|
105
|
+
field: string;
|
|
106
|
+
checkedAll?: boolean | undefined;
|
|
107
|
+
disabledAll?: boolean | undefined;
|
|
108
|
+
isShow?: boolean | undefined;
|
|
109
|
+
}[]>;
|
|
95
110
|
fieldList: import("vue").ComputedRef<AnyObject[]>;
|
|
96
111
|
handleFieldSave: () => void;
|
|
97
112
|
onCancle: () => void;
|
|
@@ -356,6 +371,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
356
371
|
groupSetting: {
|
|
357
372
|
type: PropType<Partial<Record<"firstRowGroup" | "secondRowGroup" | "thirdRowGroup" | "fourthRowGroup" | "fifthRowGroup" | "sixthRowGroup" | "seventhRowGroup" | "eighthRowGroup" | "ninthRowGroup" | "tenthRowGroup", import("../../../../es/components/iho-table").IhoTableRowGroupItem[]>> | undefined>;
|
|
358
373
|
};
|
|
374
|
+
customColumns: {
|
|
375
|
+
type: PropType<FieldSetColumnItem[]>;
|
|
376
|
+
default: () => never[];
|
|
377
|
+
};
|
|
359
378
|
}>> & {
|
|
360
379
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
361
380
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -382,5 +401,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
401
|
}>[];
|
|
383
402
|
footerFlag: boolean;
|
|
384
403
|
isEdit: boolean;
|
|
404
|
+
customColumns: FieldSetColumnItem[];
|
|
385
405
|
}>;
|
|
386
406
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as r,createBlock as u,withCtx as f,createTextVNode as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as r,createBlock as u,withCtx as f,createTextVNode as m,toDisplayString as h,createCommentVNode as p,createVNode as y,renderSlot as v}from"vue";import{NCheckbox as b,NPopconfirm as k,NButton as g}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import A from"./components/Row.vue.js";import{isArray as _,cloneDeep as w}from"lodash-es";import{setStyle as C,getGroupTree as S,isDisable as W}from"./utils/index.js";import{isString as E}from"xe-utils";const F={class:"c-field-set"},N={class:"c-field-set__table-header"},R={class:"c-field-set__table-body"},j=["tabindex"],q={key:0,class:"c-field-set__table-footer"};var U=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:D}){const V=e,O={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},T=l([]),B=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"show"},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"}]),P=t((()=>T.value.flat())),G=()=>{D("save",{tableFields:$()})},H=()=>{D("close")};function I(){T.value=L(),J(),D("reset")}function L(){const e=w(V.fields);return Object.keys(O).forEach((l=>{e.forEach((e=>{"old"==V.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[O[l]]=1==e[l]:e[O[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1)}))})),function(e){if(V.groupSetting){return S(V.groupSetting,e).reduce(((t,i)=>{const d=E(i)?e.find((e=>e.name===i)):l(i.children);return d&&t.push(d),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}const $=()=>"old"==V.type?P.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,...V.isEdit?{required:e.required,editable:e.editable}:{}}))):P.value;function z({checked:e,column:l}){const t=!e||K(l.field);l.checkedAll=!t}function J(){var e,l;(null==(e=V.showColumnNames)?void 0:e.length)&&(B.value=B.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=V.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=V.customColumns)?void 0:l.length)&&B.value.push(...V.customColumns),B.value.forEach((e=>{if(function(e){const l=["editable","required"].includes(e.field);return l&&V.isEdit||!l}(e)&&(e.isShow=!0),"checkbox"===e.type){const l=T.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!K(e.field)&&!l}}))}function K(e){return T.value.flat().some((l=>!W(l,e)&&!l[e]&&"0001"!=l.id))}return i([()=>V.fields,()=>{var e;return null==(e=V.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(T.value=L(),J())}),{immediate:!0,deep:!0}),U({getTableFields:$}),(l,t)=>(d(),o("div",F,[a("div",N,[(d(!0),o(s,null,c(B.value,((e,l)=>(d(),o(s,{key:l},[e.isShow?(d(),o("span",{key:0,class:"table-cell",style:n(r(C)(e))},["checkbox"===e.type?(d(),u(r(b),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void P.value.forEach((e=>{W(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:f((()=>[m(h(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])):p("v-if",!0),m(" "+h("checkbox"!==e.type?e.title:""),1)],4)):p("v-if",!0)],64)))),128))]),a("div",R,[y(r(x),{modelValue:T.value,"onUpdate:modelValue":t[0]||(t[0]=e=>T.value=e),animation:"150","item-key":"id",draggable:".item"},{item:f((({element:e,index:l})=>[e.hide?p("v-if",!0):(d(),o("div",{key:0,class:"item",tabindex:l},[r(_)(e)?(d(!0),o(s,{key:0},c(e,((e,l)=>(d(),u(A,{key:l,element:e,columns:B.value,onUpdateChecked:z},null,8,["element","columns"])))),128)):(d(),u(A,{key:1,element:e,columns:B.value,onUpdateChecked:z},null,8,["element","columns"]))],8,j))])),_:1},8,["modelValue"])]),e.footerFlag?(d(),o("div",q,[p(" 底部按钮插槽 "),v(l.$slots,"footer",{},(()=>[y(r(k),{onPositiveClick:I},{trigger:f((()=>[y(r(g),{style:{"margin-right":"8px"}},{default:f((()=>[m("恢复默认设置")])),_:1})])),default:f((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),y(r(g),{style:{"margin-right":"8px"},onClick:H},{default:f((()=>[m("取消")])),_:1}),y(r(g),{type:"primary",onClick:G},{default:f((()=>[m("保存")])),_:1})]))])):p("v-if",!0)]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as a,normalizeStyle as i,unref as d,
|
|
1
|
+
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as a,normalizeStyle as i,unref as d,createBlock as u,withCtx as o,createVNode as p,createCommentVNode as m,createTextVNode as f,toDisplayString as c,withDirectives as v,vShow as r,createElementVNode as s}from"vue";import{NTooltip as y,NIcon as k,NCheckbox as b,NSelect as h,NInput as x,NInputNumber as U}from"naive-ui";import{setStyle as g,isDisable as N}from"../utils/index.js";import{ReorderTwoOutline as C}from"@vicons/ionicons5";const E={class:"row"},w=["title"],O=s("span",null,"拖拽调整顺序",-1);var S=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]}},emits:["updateChecked"],setup(e,{emit:s}){const S=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],_=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function j(e){return"fixedWay"===e.field?S:_}return(S,_)=>(l(),t("div",E,[(l(!0),t(n,null,a(e.columns,((a,E)=>(l(),t(n,{key:E},[a.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[a.field],style:i(d(g)(a))},["text"===a.type?(l(),t(n,{key:0},[0===E?(l(),u(d(y),{key:0,trigger:"hover"},{trigger:o((()=>[p(d(k),{style:{"margin-right":"5px",top:"2px"},component:d(C)},null,8,["component"])])),default:o((()=>[O])),_:1})):m("v-if",!0),f(" "+c(e.element[a.field]),1)],64)):m("v-if",!0),"checkbox"===a.type?v((l(),u(d(b),{key:1,disabled:d(N)(e.element,a.field),checked:e.element[a.field],"onUpdate:checked":[l=>e.element[a.field]=l,e=>function(e,l){s("updateChecked",{checked:e,column:l})}(e,a)]},null,8,["disabled","checked","onUpdate:checked"])),[[r,"0001"!=e.element.id]]):m("v-if",!0),"select"===a.type?v((l(),u(d(h),{key:2,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l,options:j(a)},null,8,["value","onUpdate:value","options"])),[[r,"fixedWay"===a.field||"0001"!=e.element.id]]):m("v-if",!0),"input"===a.type?v((l(),u(d(x),{key:3,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[r,"0001"!=e.element.id]]):m("v-if",!0),"inputNumber"===a.type?(l(),u(d(U),{key:4,value:e.element[a.field],"onUpdate:value":l=>e.element[a.field]=l},null,8,["value","onUpdate:value"])):m("v-if",!0)],12,w)):m("v-if",!0)],64)))),128))]))}});export{S as default};
|
|
@@ -17,3 +17,11 @@ export declare type FieldSetItem = Partial<{
|
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
}>;
|
|
19
19
|
export declare type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'fixedWay' | 'alias' | 'columnWidth';
|
|
20
|
+
export declare type FieldSetColumnItem = {
|
|
21
|
+
title: string;
|
|
22
|
+
type: 'text' | 'checkbox' | 'select' | 'input' | 'inputNumber';
|
|
23
|
+
field: string;
|
|
24
|
+
checkedAll?: boolean;
|
|
25
|
+
disabledAll?: boolean;
|
|
26
|
+
isShow?: boolean;
|
|
27
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as
|
|
1
|
+
import{isArray as e,isObject as t}from"lodash-es";import{IhoTableRowGroupSequence as i}from"../../../iho-table/src/constants/index.js";function n(e){const t={flex:"1 1 90px"};switch(e.type){case"text":"title"===e.field&&Object.assign(t,{flex:"0 0 120px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"});break;case"checkbox":t.flex="1 1 60px";break;case"select":t.flex="1 1 80px";break;case"input":t.flex="1 1 100px"}return t}function s(e,t){return["editable","required"].includes(t)&&e[`${t}Disable`]||["sort"].includes(t)&&1==e.notParticipatingSort}function r(n,s,r=(e=>e.name)){const l=s.map((e=>r(e)));return i.some((i=>{const s=n[i];if(!e(s))return!0;s.forEach((i=>{if(!e(i.list)||!i.list.length)return;const n=[];let s=null;i.list.forEach(((e,r)=>{const c=function(e,i,n){return i.findIndex((i=>i!==n&&(t(i)?i.fieldName:i)===e))}(e,l,s);~c&&(n.push(l[c]),0===r?l.splice(c,1,s={fieldName:i.title,children:n}):l.splice(c,1))}))}))})),l}export{r as getGroupTree,s as isDisable,n as setStyle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormAsyncQueue}from"./src/hooks/useFormAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormAsyncQueue}from"./src/hooks/useFormAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as w,onFieldReact as B,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as w,onFieldReact as B,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../index.js";import{createObjSchema as Z}from"./utils/schema.js";import{useFieldListAdaptor as ee}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as oe}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as te}from"./hooks/useFormValidator.js";import{useAnchor as re}from"./hooks/useAnchor.js";import{useFormContext as se}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();te();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=se(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=re(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Oe}=$(),Re=L({initialValues:me.initialData,effects(e){O("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Oe(o),we(t,o.value),_e(t),Ve(t,o.value)})),R("*",Ae),w("*",Le),me.linebarAutoHidden&&(B("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&B("*",ve)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:Be}=z(t((()=>me.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Re),{wordbookSettingHandler:Ve}=Y(Re,ge);s(Be),s(De);const{schemaAdaptor:Ie}=ee(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=oe().traverse(H(me.fieldList),me.fieldVisitor),Z(Ie(Ne))):Z({}))),{onKeydown:We}=G({formModel:Re,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Re,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Re,validate:(e="*")=>Ke.validate(e),getFormValues:(e=!0)=>Ke.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Re)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,watch as r,inject as a,onBeforeUnmount as i,createVNode as m}from"vue";import{isObjectField as n}from"@formily/core";import{autorun as l}from"@formily/reactive";import{connect as s,RecursionField as u}from"@formily/vue";import{AddCircleOutline as p,RemoveCircle as c}from"@vicons/ionicons5";import{isNumber as d,isArray as f,isFunction as v,range as b}from"lodash-es";import{NButton as y,NIcon as h}from"naive-ui";import"../../../index.js";import{InjectionBusinessCollector as x}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{createObjSchema as _}from"../../utils/schema.js";import{useFormField as j}from"../../hooks/useFormField.js";import{useFieldListAdaptor as C}from"../../hooks/useFieldListAdaptor.js";const k=s(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:s,fieldKey:k}=j(),F=o(1),I=t((()=>d(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));function N(){F.value++}r((()=>e.value),(e=>{f(e)&&(F.value=Math.min(Math.max(e.length,1),I.value))}),{immediate:!0});const A=a(x),{schemaAdaptor:D}=C(A),G=o([]);return i(l((()=>{f(s.value.value)&&(G.value=s.value.value.map(((o,t)=>v(e.combinationItemDeletable)?e.combinationItemDeletable(o||{},t):e.combinationItemDeletable)))}))),()=>m("section",{class:"form-render__combination"},[m("header",{class:"form-render__combinationHeader"},[m("div",{class:"form-render__combinationHeaderText"},[e.title]),m(y,{onClick:N,text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:F.value>=I.value||e.disabled},{icon:()=>m(h,{component:p},null),default:()=>"新增"})]),b(F.value).map(((o,t)=>m("section",{class:"form-render__combinationContent"},[m(u,{schema:_(D(e.properties)),name:t},null),m(y,{text:!0,disabled:!G.value[t],type:"error",class:"form-render__combinationClose",onClick:()=>async function(e){if(F.value>1)F.value--,await s.value.remove(e);else{const o=s.value.query(`${k.value}.${e}`).take();if(!o||!n(o))return;await o.reset()}}(t)},{icon:()=>m(h,{component:c},null)})])))])}}));export{k as COMBINATION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as
|
|
1
|
+
import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as p}from"../../utils/schema.js";const s=t(e({props:{onChange:{},span:{type:Number,default:6},display:{type:String,default:"grid"},wrapperStyle:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("section",{class:"form-render__complex"},[r("section",{class:`form-render__complexContent--${e.display}`,style:e.wrapperStyle},[t.default&&t.default()])])}),o(p));export{s as COMPLEX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as a,createVNode as r,mergeProps as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as a,createVNode as r,mergeProps as o}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as m}from"date-fns";import l from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"lodash-es";import"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),a=new Date,r=new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0);const o=new Date(t);o.setHours(23),o.setMinutes(59),o.setSeconds(59);const i=r>a,n=o<a,u=t.getHours(),s=a.getHours(),m=a.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<s||p()&&!n&&e>s},isMinuteDisabled:function(e){if(u===s)return c()&&!i&&e<m||p()&&!n&&e>m;return c()&&!i&&u<s||p()&&!n&&u>s}}}u((()=>e.value));const D=t((()=>{const t={};if(s(e.validate)){const{min_date:a,max_date:r}=e.validate;(a||r)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function g(t){return t?m(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&g(e)!==e&&n("update:value",g(e))}));const h=t({get:()=>g(e.value),set:e=>{n("update:value",e)}}),w=v(h);return()=>r(l,o({key:w.value},D.value,j.value,{"formatted-value":h.value,"onUpdate:formatted-value":e=>h.value=e}),null)}}),u(v,c));export{p as DATE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,createVNode as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,createVNode as o,isVNode as a}from"vue";import{connect as l,mapProps as r}from"@formily/vue";import{promiseTimeout as i}from"@vueuse/shared";import{NSpace as u,NRadio as n,NRadioGroup as p,NCheckbox as d,NCheckboxGroup as s}from"naive-ui";import"../../../index.js";import{useComplexOptions as m}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"date-fns";import{assignUpdateValue as c,createVisitedSetter as v}from"../../utils/schema.js";import{useAutographOptions as f}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{useFormField as h}from"../../hooks/useFormField.js";function b(l,r,n){return e({name:l,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:l}){const{field:d}=h(),{renderComplexOption:s,valueRef:c}=m(e,l),{labelKey:b,valueKey:j,fullOptions:g}=f(e,c),{injectValueBindKey:k,injectValueValidate:S}=y();S(c);const F=k(c),C=t();return()=>o(r,{key:F.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:v(d)},{default:()=>[o(u,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=g.value)?void 0:t.map((t=>{let l;return o(n,{key:t[j.value],value:t[j.value],disabled:t.disabled,onClick:()=>async function(t){if(null==C?void 0:C.disabled)return;if(r!==p||!e.clearable)return;const o=c.value;await i(0),o===t[j.value]&&(c.value=null)}(t)},"function"==typeof(u=l=s({value:c.value,option:t,valueKey:j.value,labelKey:b.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(u)&&!a(u)?l:{default:()=>[l]});var u}))]}})]})}})}const j=l(b("FormRadio",p,n),r({dataSource:"options"},c)),g=l(b("FormCheckbox",s,d),r({dataSource:"options"},c));export{g as CHECKBOX,j as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as m,createVisitedSetter as v,traverseDependKey as f}from"../../utils/schema.js";import{useFormField as y}from"../../hooks/useFormField.js";import{NCascader as h}from"naive-ui";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as k,mapProps as j}from"@formily/vue";import"./index.js";import"../../hooks/useFormRenderOptions.js";const g=k(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:m,emit:k}){const j=t(),{field:g,title:b}=y(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){k("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(p);async function x(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return i(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}j.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&f(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),x),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(j.value=null,C.value?e.lazyRequest||(x(),C.value=!C.value):await x())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&x()}const W=a((()=>j.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(h,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:x,onFocus:v(g)},m)}}),j({dataSource:"options"},m));export{g as SEARCH_CASCADER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,inject as o,ref as a,useAttrs as l,createVNode as r}from"vue";import{useDebounceFn as s}from"@vueuse/core";import{cloneDeep as u,isArray as n,isString as i}from"lodash-es";import{useCommonInjection as p,useSelectOptionProps as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as c}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/
|
|
1
|
+
import{defineComponent as e,computed as t,inject as o,ref as a,useAttrs as l,createVNode as r}from"vue";import{useDebounceFn as s}from"@vueuse/core";import{cloneDeep as u,isArray as n,isString as i}from"lodash-es";import{useCommonInjection as p,useSelectOptionProps as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as c}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"date-fns";import{assignUpdateValue as d,assignClearBindVisited as v,createVisitedSetter as y}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";import{NSelect as h}from"naive-ui";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as j,mapProps as b}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as k,useAutographOptions as S,useRecommendOptions as g,searchContentMatcher as F}from"../../hooks/useFormRenderOptions.js";const A=j(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:d,emit:v}){const j=t({get:()=>e.value,async set(e){v("update:value",e),O(e)}}),{labelKey:b,valueKey:A,fetchData:C,fullOptions:H,filterOptions:B}=e.urlConfig?k(e,j):S(e,j),{getRecommend:x,postRecommend:O,sortedOptions:R}=g(e,B,v,b,A),{field:V,fieldKey:w}=f();o(c).setContext(w.value,(e=>{return{currentOption:u((t=e,n(t)?function(e){const t=H.value.reduce(((e,t)=>(e[t[A.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(o=t,H.value.find((e=>e[A.value]===o)))))};var t,o}));const L=a(""),N=s((async(e="")=>{L.value=e,C(e),x(e)}),300),{injectValueValidate:K,injectValueWatchFromEmpty:P,injectValueBindKey:W}=p();P(j,N),K(j);const q=W(j),{menuProps:I,nodeProps:U}=m();function z(e){const t=e[b.value];if(!t||!i(t))return"";const o=F(L.value,t);return o?r("section",null,[o.map(((e,t)=>0!==t&&e?r("span",{style:{color:t%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):t}const D=t((()=>R.value.length||!e.allowCreate?R.value:L.value?[{[b.value]:L.value,[A.value]:L.value},...R.value]:R.value)),E=l(),G=t((()=>{if(e.allowCreate)return j.value;const t=E.multiple&&n(j.value);return D.value.find((e=>t?j.value.includes(e[A.value]):e[A.value]===j.value))?j.value:null}));return()=>r(h,{key:q.value,remote:!0,filterable:!0,value:G.value,onUpdateValue:e=>j.value=e,"menu-props":I,"node-props":U,labelField:b.value,valueField:A.value,options:D.value,onSearch:N,"onUpdate:show":e=>e&&N(),onFocus:y(V),renderLabel:z},d)}}),b({dataSource:"options"},d,v));export{A as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as
|
|
1
|
+
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as i}from"vue";import{NSwitch as t}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as n,assignValueBindKey as l}from"../../utils/schema.js";import{connect as u,mapProps as p}from"@formily/vue";const c=u(e({name:"FormSwitch",props:{openDescription:{type:Object},closeDescription:{type:Object},onChange:{}},setup:e=>()=>{const n=r((()=>{var r,o;return null==(o=null==(r=e.openDescription)?void 0:r.value)||o})),l=r((()=>{var r,o;return null!=(o=null==(r=e.closeDescription)?void 0:r.value)&&o}));return o(t,{checkedValue:n.value,uncheckedValue:l.value},{checked:()=>{var r,o;return i(null!=(o=null==(r=e.openDescription)?void 0:r.describe)?o:"")},unchecked:()=>{var r,o;return i(null!=(o=null==(r=e.closeDescription)?void 0:r.describe)?o:"")}})}}),p(n,l));export{c as SWITCH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,createVNode as o}from"vue";import{useCommonInjection as
|
|
1
|
+
import{defineComponent as e,computed as t,createVNode as o}from"vue";import{useCommonInjection as r}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as i,assignClearBindVisited as m}from"../../utils/schema.js";import{connect as a,mapProps as u}from"@formily/vue";import{NInput as p}from"naive-ui";const s=a(e({name:"FormTextarea",props:{value:{type:String}},emits:["update:value"],setup(e,{emit:i}){const m=t({get:()=>e.value,set:e=>i("update:value",e)}),a=r().injectValueBindKey(m);return()=>o(p,{type:"textarea",key:a.value,value:m.value,"onUpdate:value":e=>m.value=e},null)}}),u(i,m));export{s as TEXTAREA};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as t,watchOnce as
|
|
1
|
+
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as t,watchOnce as o}from"@vueuse/core";import{ref as r,computed as n,nextTick as l}from"vue";import{FormItemLineBarDepKeyPrepend as i}from"../constants/index.js";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"lodash-es";import"../../index.js";import"date-fns";import{createLinebarId as a}from"../utils/schema.js";function s(s,u,c,m){const v=r(),p=r(""),f=r([]),d=async function(e){var t;f.value=Object.values(e.fields).reduce(((e,t)=>{var o,r;return"LINEBAR"===t.componentType&&"visible"===t.selfDisplay&&e.push({title:null!=(r=null==(o=t.componentProps)?void 0:o.title)?r:t.title,name:t.address.toString()}),e}),[]),await l(),null==(t=v.value)||t.syncBarPosition()};let h=!1;async function y(t){h=!0;try{if(!c.value)return;m.trigger(i+t,!0),await l();const o=c.value.querySelector(`#${a(t)}`);if(!o)return;await new Promise((t=>{e(c.value.scrollTop,o.offsetTop,300,(e=>{var t;null==(t=c.value)||t.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(t,300)))}))}finally{h=!1}}const T=t((function(e){var t;if(h||!c.value)return;const{scrollTop:o,clientHeight:r}=c.value,n=f.value.find(((e,t,n)=>{const l=n[t+1];if(!l)return!0;const i=c.value.querySelector(`#${a(l.name)}`);return i?i.offsetTop>o+r/2:void 0}))||f.value[f.value.length-1];p.value=null!=(t=null==n?void 0:n.name)?t:"",u("scroll",e)}),300);o(f,(e=>{var t,o;p.value=null!=(o=null==(t=e[0])?void 0:t.name)?o:""}));return{currentAnchor:n({get:()=>p.value,async set(e){p.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:v}}export{s as useAnchor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"
|
|
1
|
+
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s){const i=this.getField(t);i&&e.setFieldState(i.val_key,(e=>{if(e.value===s)return;const n=this.typeLockMap.get(t);this.typeLockMap.set(t,r(n)?n+1:1),e.value=this.formatter({value:s,type:t,fieldKey:i.val_key})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y),this.setValueByType(i,n.AGE,h),this.setValueByType(i,n.SEX,u.sex),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)))}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r),this.setValueByType(e,n.AGE,i)}function p(s){const i=this.getValueByType(s,n.AGE),a=this.getValueByType(s,n.AGE_UNIT);(t(i)||r(i))&&""!==i&&t(a)&&""!==a&&this.setValueByType(s,n.BIRTHDAY,h(+i,a,e.call(this)))}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p).registerChangeBusiness(n.AGE,p).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFunction as t}from"lodash-es";import"
|
|
1
|
+
import{isFunction as t}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"../../index.js";import"date-fns";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,o){e(r,(e=>{const r=this.collector.get(e)||new Map;r.set(t,o),this.collector.set(e,r)}))}getDeps(t){return this.collector.get(t)}trigger(e,r){var o;this.triggerDisabled||null==(o=this.getDeps(e))||o.forEach((e=>t(e)&&e(r)))}}function o(){return{create:function(){return new r}}}export{r as FormItemDepsCollector,o as useFormItemDeps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useForm as
|
|
1
|
+
import{checkInSetupEnv as e,jsonParse as n,keywordMatcher as t}from"../../../../shared/utils/index.js";import{useForm as l}from"@formily/vue";import{useMemoize as u,useDebounceFn as o}from"@vueuse/core";import{identity as r,uniqBy as a,isString as i,isEqual as c,isArray as s,omit as v,isFunction as m}from"lodash-es";import{computed as f,inject as d,ref as y,toRaw as p,watch as h}from"vue";import"../../index.js";import{InjectionAsyncQueue as g,InjectionFormLifeCycleCaller as w,InjectionFormItemDepsCollector as k}from"../constants/index.js";import{useFormField as b}from"./useFormField.js";import{createUrlConfigParams as R,formRenderLog as C}from"../utils/index.js";import{useFormRequest as F}from"./useFormRequest.js";function K(e,n){const t=y();return f({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const q=(()=>{const e=u((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:r});return(n,t)=>t.match(e(n))})();function O(){const e=y();return{searchContent:e,optionSearchFilter:function(n,l,u){if(!e.value)return n;const o=s(u)?u.filter((e=>e&&i(e))):[];return n.filter((n=>function(n,l,u){if(!e.value)return!0;const o=n?n[l]:"";return!!i(o)&&(!!q(e.value,o)||!!t(e.value,n.keyword)||!!u.length&&u.some((t=>i(n[t])&&n[t].includes(e.value))))}(n,l,o)))}}}function j(e,t,l,u,o){const r=K(e,"commonList"),i=K(e,"recentList"),{searchContent:c,optionSearchFilter:s}=O();function y(e){return n(e.itemObj)}const p=f((()=>{var e,n;return null!=(n=null==(e=r.value)?void 0:e.map(y))?n:[]})),h=f((()=>{var e,n;return null!=(n=null==(e=i.value)?void 0:e.map(y))?n:[]})),w=f((()=>{if(!e.recommend||!p.value.length&&!h.value.length)return t.value;const n=a(p.value.concat(h.value),(e=>e[o.value])),l=t.value.filter((e=>n.every((function(n){return n[o.value]!==e[o.value]}))));return[...s(n,u.value),...l]})),{getRecommendRequestInfo:k,getHttpInstance:R}=F();function C(n){const{url:t,getRecommendIds:l}=k(),u=m(l)?l():{},o=m(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:q}=b(),j=d(g);return{postRecommend:async function(n){if(!e.recommend)return;const t=R();if(!t)return;const{url:u,info:r}=C("post"),a=w.value.find((e=>e[o.value]===n));a&&l("postRecommend",await t.post(u,{...r,keyword:"",itemId:o.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(c.value=n,r.value&&i.value&&e.recommendCache)return;const t=await j.addAsync(function(n,t){const{url:l,info:u}=C("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(q.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(v(n,["type"])):"recently"===n.type&&e.recently.push(v(n,["type"])),e)),{commonly:[],recently:[]});r.value=l.slice(0,e.commonNum),i.value=u.slice(0,e.recentNum)},sortedOptions:w}}function I(n,t){e();const l=d(g),u=d(w),r=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),a=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:s,optionSearchFilter:v}=O(),m=y(null),{field:F,fieldKey:K}=b(),q=o((async function(e){if(s.value=e||"",!n.urlConfig)return m.value=null;try{const e=await l.addAsync(await R({config:n.urlConfig,cache:n.requestCache,field:F.value}));p(m.value)!==e&&(m.value=e,u("afterOptionInit",[K.value,m.value]))}catch(e){i(e)&&C(e)}}),300),j=f((()=>m.value?v(m.value,r.value):Array.isArray(n.options)?v(n.options,r.value):[])),I=f((()=>m.value||n.options||[])),x=d(k);return h((()=>n.urlConfig),((e,l)=>{if(!c(e,l)){if(m.value=null,!e)return m.value=null;x.setDeps(K.value,e.dependKey||[],(async()=>{m.value=null,t.value=null,!n.lazyRequest&&await q()})),(t.value||!n.lazyRequest)&&q()}}),{immediate:!0}),{labelKey:r,valueKey:a,filterOptions:j,fullOptions:I,fetchData:q}}function x(n,t){e();const u=d(g),r=d(w),a=l(),v=f((()=>{var e,t,l,u;const o=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0];if(i(o))return o;let r=null==(l=n.wordbook)?void 0:l.show_key;return s(r)&&(r=r[0]),i(r)?r:null!=(u=n.labelField)?u:"text"})),m=f((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),R=f((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:K,optionSearchFilter:q}=O(),j=y(null),{fieldKey:I}=b(),{getSearchRequestInfo:x}=F(),A=o((async function(e){if(K.value=e||"",!n.autograph||!n.wordbook)return j.value=null;try{const e=await u.addAsync(function(e,t,l){var u,o,r;const i={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};if(null==(u=e.queryParams)?void 0:u.length){const n=null!=(r=null==(o=a.value)?void 0:o.getFormState().values)?r:{};e.queryParams.forEach((e=>{i[e]=n[e]}))}return console.log(i),{...x(),params:i,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,I.value));p(j.value)!==e&&(j.value=e,r("afterOptionInit",[I.value,j.value]))}catch(e){i(e)&&C(e)}}),300),S=f((()=>j.value?q(j.value,v.value,R.value):Array.isArray(n.options)?q(n.options,v.value):[])),N=f((()=>j.value||n.options||[])),_=d(k);return h((()=>n.wordbook),((e,l)=>{if(!c(e,l)){if(j.value=null,!e)return j.value=null;_.setDeps(I.value,e.queryParams||[],(async()=>{j.value=null,A()})),(t.value||!n.lazyRequest)&&A()}}),{immediate:!0}),{labelKey:v,valueKey:m,filterOptions:S,fullOptions:N,fetchData:A}}export{q as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as
|
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as r,isString as a}from"lodash-es";import"vue";import{registerValidateLocale as s}from"@formily/core";import"@formily/path";import"@vue/shared";import{isFunction as i}from"@vueuse/core";import"../../index.js";import{isIdCard as l}from"../utils/business.js";function t(){const r=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(r){var s;if(null!=r&&""!==r)return a(r)&&l(r)?void 0:null!=(s=null==e?void 0:e.message)?s:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:r,regular_error_tip:a})=>({pattern:r||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),s={triggerType:"onBlur"};return{createValidatorSchema:function(a){const l=[],{validate:{vali_obj:t,max_length:o,min_length:m,message:n,max_value:u,min_value:g,decimal_length:d}={},validator:v}=a;if(v&&e(v).forEach((e=>{i(e)&&l.push({validator:r=>e(r,a)})})),o&&l.push({max:o,message:n}),m&&l.push({min:m,message:n}),u&&l.push({maximum:u,message:n}),g&&l.push({minimum:g,message:n}),null!=d&&l.push(((e,r)=>{const a=null!=r?r:`小数位数最多${e}位`;return{validator(r){var s;return(null==(s=String(r).split(".")[1])?void 0:s.length)>e?a:""}}})(+d,n)),t){const e=r.get(t)||(({validate:e})=>({format:t,message:null==e?void 0:e.message}));l.push(Object.assign({},s,e(a)))}return l}}}const o=r((()=>{s({"zh-CN":{required:"${alias}为必填"}})}));export{t as useFormValidator,o as validateMessageLocale};
|