cnhis-design-vue 3.2.7-beta.1 → 3.2.7-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/classification/index.d.ts +39 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +39 -0
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +39 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +39 -0
- package/es/components/date-picker/index.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +11 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
- package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/utils/schema.d.ts +1 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/iho-chat/index.d.ts +160 -45
- package/es/components/iho-chat/src/Index.vue.d.ts +160 -45
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +25 -10
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +29 -10
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +39 -11
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +21 -5
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +25 -10
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
- package/es/components/iho-chat/src/hooks/useState.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
- package/es/components/index.css +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +26 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +26 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +26 -0
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +52 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +52 -0
- package/es/components/time-picker/index.d.ts +20 -2
- package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/business.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import{getScaleInfo as
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as d}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=d(p,f,g),{originY:L,endY:k,originX:E,endX:M,xCellWidth:W,yCellHeight:G,left:I,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let d=H,g=E;"right"===r&&(d=M,g=M+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=A&&"right"!==r?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:u,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=R.originY-F[0]*G,v=l({width:E-H,height:A+(F[0]+F[1])*G,...P},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,E,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,H,E-H),l=o.length;o.forEach(((o,a)=>{let c=R.endY-a*G*s;if(0===a&&0===F[1]&&(c=k-5),u&&(!(0===a||a===l-1)||d||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===r?0:O.originY,b="right"===r?q:O.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:M=[],showdetailedScale:W,showRange:I=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=W&&!M.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):W&&(null==M?void 0:M.length)?M:j,[s=l[0],r=u(l)]=I;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=O.endY-u*G*(W?C/2:C),d=[s,r].includes(n);if(N&&(!d||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=O.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,G,O.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=O.originY+G;0!==B&&z[0]>1&&(J=L+G*z[0]/2),_&&g.push(new e.Text(String(_),{...i,left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(_));let t=k;const i=H-I.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=E&&e.left<=M){e.setCoords();const t="pain"===e.origin.type?R:O;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),p.value.add(l,u)}))}();const Q=I.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&I.yScaleValue[B].show){const e=I.yScaleValue[B];0===B&&I.yScaleValue.length>1&&Q.unshift(e),B==I.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),p.value.add(new e.Rect({left:H,top:0,width:$-H-P.strokeWidth,height:q-P.strokeWidth,fill:"transparent",...P})),{drawScaleValue:K}}export{p as useLeft};
|
@@ -3,8 +3,13 @@ import { fabric } from '../../../../../shared/utils/fabricjs';
|
|
3
3
|
import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
|
4
4
|
import { AnyObject } from '../../../../../shared/types';
|
5
5
|
export declare function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
|
6
|
+
select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
7
|
+
redrawPoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
8
|
+
clickMenu?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
9
|
+
updatePolyline?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
10
|
+
useMeasureRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
11
|
+
useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
12
|
+
useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
13
|
+
useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
6
14
|
propItems: any;
|
7
|
-
redrawPoints: Ref<any>;
|
8
|
-
select: Ref<any>;
|
9
|
-
clickMenu: Ref<any>;
|
10
15
|
};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,Y,w,b,C){const x=15,D=e({select:null,redrawPoints:null,clickMenu:null}),j=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~U.value?e:[0,0]})),V=a((()=>{var e,a;const t=(null==(a=null==(e=S.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===U.value?t[0]=t[0]+j.value[1]:U.value>0&&(t[2]=t[2]+j.value[0]),t})),H=a((()=>0===U.value?[j.value[0],V.value[1],V.value[2],V.value[3]]:U.value>0?[V.value[0],V.value[1],j.value[1],V.value[3]]:V.value)),X=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),P=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),M=a((()=>{var e,a,t;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),I=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),N=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),k=a((()=>{const{grid:e}=S.data,a=U.value>0?j.value[1]:j.value[0];return e.mainYCell*e.subYCell+V.value[0]+V.value[2]+a})),O=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),R=a((()=>O.value-V.value[1]*q.value)),W=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+T.value})),$=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),G=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+P.value})),q=a((()=>(O.value-W.value)/N.value)),z=a((()=>($.value-G.value)/k.value)),T=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),A=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=W.value-q.value;const r=t.date.startDate||s(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=q.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+q.value/2,scaleCell:(l-t)/q.value}}))));return v(o)})),B=a((()=>ue("breathe"))),E=a((()=>ue("pulse"))),F=a((()=>ue("temperature"))),J=a((()=>ue("pain"))),K=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Q=a((()=>{const{left:e}=S.data;return v(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),U=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),Z=a((()=>{const{grid:e}=S.data;return-1===U.value?0:z.value*e.subYCell})),_=a((()=>{const{left:e}=S.data,a={originY:G.value+j.value[0]*z.value,endY:$.value-j.value[1]*z.value};return 0===U.value&&e.yScaleValue.length>1?a.endY=a.originY+Z.value:U.value===e.yScaleValue.length-1&&(a.originY=a.endY-Z.value),a})),ee=a((()=>{const{left:e}=S.data,a={originY:G.value+V.value[0]*z.value,endY:$.value-V.value[2]*z.value};return 0===U.value&&e.yScaleValue.length>1?a.originY=_.value.endY+V.value[0]*z.value:U.value===e.yScaleValue.length-1&&(a.endY=_.value.originY-V.value[2]*z.value),a})),ae=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),te=a((()=>{var e;const{left:a,right:t}=S.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),le=e({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:P.value,xScalevalueHeight:M.value,topList:ae.value,breathingHeight:I.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:U.value,painHeight:Z.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:N.value,gridYNumber:k.value,iconsWidth:T.value,originX:W.value,originY:G.value,endX:O.value,endXLimit:R.value,endY:$.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:A.value,breatheYCell:B.value,pulseYCell:E.value,temperatureYCell:F.value,painYCell:J.value,event:K.value,itemList:Q.value,getRightInfo:te.value,config:S.data.config||{},surplusCell:V.value,painSurplusCell:j.value,mainSurplusCell:H.value});function ue(e){const{yScaleValue:a}=S.data.left,t=a.find((a=>a.type===e)),l=(null==t?void 0:t.list)||[];return l.length?z.value/((l[1]-l[0])/t.spaceGridNumber):0}const{computedX:ie,computedY:ne,getXValue:re,getYValue:oe}=i(le);return t((()=>y.value),(e=>{e&&function(){c(y,le);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=g(y,le,Y,ie,ne,re,oe,S.addRenderItem,b,C);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(y,le,Y,e,b,ie,ne,re,oe,a,t,i);h(y,le,o),m(y,le),f(y,le,Y,ie,ne,r);const{select:v}=n(y,le,Y);D.select=v}()}),{immediate:!0}),{propItems:le,...l(D)}}export{y as useTemperatureChart};
|
@@ -13,4 +13,4 @@ export declare function getScaleInfo(position: string | undefined, x: number, wi
|
|
13
13
|
textLeft: number;
|
14
14
|
};
|
15
15
|
export declare function drawScaleNumber(text: string | number, item: AnyObject, left: number, top: number): fabric.Text;
|
16
|
-
export declare function drawScaleLine(item: AnyObject, i: number, lineXMain: number[], lineXSub: number[], baseTop: number, yCellHeight: number, originY: number, _listLen?: number): Array<fabric.Object | fabric.Line>;
|
16
|
+
export declare function drawScaleLine(item: AnyObject, i: number, lineXMain: number[], lineXSub: number[], baseTop: number, yCellHeight: number, originY: number, _listLen?: number, _spaceGridNumber?: number): Array<fabric.Object | fabric.Line>;
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{defaultTextStyle as t,defaultBorderStyle as n}from"./useDraw.js";function i(e="center",t,n){let i=t+n/2,r=[i-4.5,i+4.5],l=[i-2.5,i+2.5],o=i;return"right"===e&&(i=t,r=[i,i+9],l=[i,i+5],o=r[1]),"left"===e&&(i=t+n,r=[i-9,i],l=[i-5,i],o=r[0]),{lineXMain:r,lineXSub:l,textLeft:o}}function r(n,i,r,l){const{position:o,style:s,scaleNumberStyle:c}=i;return new e.Text(String(n),{...t,originX:"left"==o?"right":"right"==o?"left":"center",left:r,top:l,...s||c||{}})}function l(t,i,r){const l=new e.Line(i,{...n,...t.style||t.scaleLineStyle||{}});r.push(l)}function o(e,t,n,i,r,o,s,c){var
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{defaultTextStyle as t,defaultBorderStyle as n}from"./useDraw.js";function i(e="center",t,n){let i=t+n/2,r=[i-4.5,i+4.5],l=[i-2.5,i+2.5],o=i;return"right"===e&&(i=t,r=[i,i+9],l=[i,i+5],o=r[1]),"left"===e&&(i=t+n,r=[i-9,i],l=[i-5,i],o=r[0]),{lineXMain:r,lineXSub:l,textLeft:o}}function r(n,i,r,l){const{position:o,style:s,scaleNumberStyle:c}=i;return new e.Text(String(n),{...t,originX:"left"==o?"right":"right"==o?"left":"center",left:r,top:l,...s||c||{}})}function l(t,i,r){const l=new e.Line(i,{...n,...t.style||t.scaleLineStyle||{}});r.push(l)}function o(e,t,n,i,r,o,s,c,u){var f,a;const h=[],d=c||(e.showdetailedScale?2*(null==(f=e.list)?void 0:f.length)-1:null==(a=e.list)?void 0:a.length),p=e.position||"center",m=((e.showdetailedScale?e.spaceGridNumber/2:e.spaceGridNumber)||u||5)*o/5;if(e.showScale&&t!==d-1)for(let o=0;o<5;o++)if(o>0||!e.showNumber||"center"!==p){const c=0==o?n[0]:i[0],u=0==o?n[1]:i[1],f=r-o*m;f>s&&(l(e,[c,f,u,f],h),t==d-2&&4==o&&l(e,[n[0],f-m,n[1],f-m],h))}return h}export{o as drawScaleLine,r as drawScaleNumber,i as getScaleInfo};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type Ref } from 'vue';
|
2
2
|
import { fabric } from '../../../shared/utils/fabricjs';
|
3
|
-
import { AnyObject } from '../../../shared/types';
|
3
|
+
import { AnyObject, AnyFn } from '../../../shared/types';
|
4
4
|
export type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | 'electrocardiogram' | 'newBirthProcess' | undefined;
|
5
5
|
export type ILineCoordinate = [number, number, number, number];
|
6
6
|
interface IEvent {
|
@@ -180,4 +180,14 @@ export type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
|
|
180
180
|
};
|
181
181
|
export type IFabricChartMainParam = [Ref<fabric.Canvas>, any, any, Ref<any>, IPointTipProps, IPointMenuProps];
|
182
182
|
export type IPointer = [number, number];
|
183
|
+
export type IexposeMethods = Partial<{
|
184
|
+
select: AnyFn | null;
|
185
|
+
redrawPoints: AnyFn | null;
|
186
|
+
clickMenu: AnyFn | null;
|
187
|
+
updatePolyline: AnyFn | null;
|
188
|
+
useMeasureRuler: AnyFn | null;
|
189
|
+
useCaliper: AnyFn | null;
|
190
|
+
useCaliperRuler: AnyFn | null;
|
191
|
+
useRectRuler: AnyFn | null;
|
192
|
+
}>;
|
183
193
|
export {};
|
@@ -713,6 +713,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
713
713
|
allowedInvalidValue: {
|
714
714
|
type: StringConstructor;
|
715
715
|
};
|
716
|
+
to: {
|
717
|
+
type: PropType<string | false | HTMLElement>;
|
718
|
+
default: string;
|
719
|
+
};
|
716
720
|
}, {
|
717
721
|
attrs: {
|
718
722
|
[x: string]: unknown;
|
@@ -733,6 +737,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
733
737
|
allowedInvalidValue: {
|
734
738
|
type: StringConstructor;
|
735
739
|
};
|
740
|
+
to: {
|
741
|
+
type: PropType<string | false | HTMLElement>;
|
742
|
+
default: string;
|
743
|
+
};
|
736
744
|
}>> & {
|
737
745
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
738
746
|
}>>;
|
@@ -769,10 +777,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
769
777
|
allowedInvalidValue: {
|
770
778
|
type: StringConstructor;
|
771
779
|
};
|
780
|
+
to: {
|
781
|
+
type: PropType<string | false | HTMLElement>;
|
782
|
+
default: string;
|
783
|
+
};
|
772
784
|
}>> & {
|
773
785
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
774
786
|
}, {
|
775
787
|
updateUnchangedValue: boolean;
|
788
|
+
to: string | false | HTMLElement;
|
776
789
|
}>>;
|
777
790
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
778
791
|
data: {
|
@@ -982,6 +995,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
982
995
|
allowedInvalidValue: {
|
983
996
|
type: StringConstructor;
|
984
997
|
};
|
998
|
+
to: {
|
999
|
+
type: PropType<string | false | HTMLElement>;
|
1000
|
+
default: string;
|
1001
|
+
};
|
985
1002
|
}, {
|
986
1003
|
attrs: {
|
987
1004
|
[x: string]: unknown;
|
@@ -1002,6 +1019,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
1002
1019
|
allowedInvalidValue: {
|
1003
1020
|
type: StringConstructor;
|
1004
1021
|
};
|
1022
|
+
to: {
|
1023
|
+
type: PropType<string | false | HTMLElement>;
|
1024
|
+
default: string;
|
1025
|
+
};
|
1005
1026
|
}>> & {
|
1006
1027
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
1007
1028
|
}>>;
|
@@ -1038,10 +1059,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
1038
1059
|
allowedInvalidValue: {
|
1039
1060
|
type: StringConstructor;
|
1040
1061
|
};
|
1062
|
+
to: {
|
1063
|
+
type: PropType<string | false | HTMLElement>;
|
1064
|
+
default: string;
|
1065
|
+
};
|
1041
1066
|
}>> & {
|
1042
1067
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
1043
1068
|
}, {
|
1044
1069
|
updateUnchangedValue: boolean;
|
1070
|
+
to: string | false | HTMLElement;
|
1045
1071
|
}>>;
|
1046
1072
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1047
1073
|
data: {
|
@@ -102,6 +102,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
102
102
|
allowedInvalidValue: {
|
103
103
|
type: StringConstructor;
|
104
104
|
};
|
105
|
+
to: {
|
106
|
+
type: PropType<string | false | HTMLElement>;
|
107
|
+
default: string;
|
108
|
+
};
|
105
109
|
}, {
|
106
110
|
attrs: {
|
107
111
|
[x: string]: unknown;
|
@@ -122,6 +126,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
126
|
allowedInvalidValue: {
|
123
127
|
type: StringConstructor;
|
124
128
|
};
|
129
|
+
to: {
|
130
|
+
type: PropType<string | false | HTMLElement>;
|
131
|
+
default: string;
|
132
|
+
};
|
125
133
|
}>> & {
|
126
134
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
127
135
|
}>>;
|
@@ -158,10 +166,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
158
166
|
allowedInvalidValue: {
|
159
167
|
type: StringConstructor;
|
160
168
|
};
|
169
|
+
to: {
|
170
|
+
type: PropType<string | false | HTMLElement>;
|
171
|
+
default: string;
|
172
|
+
};
|
161
173
|
}>> & {
|
162
174
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
163
175
|
}, {
|
164
176
|
updateUnchangedValue: boolean;
|
177
|
+
to: string | false | HTMLElement;
|
165
178
|
}>>;
|
166
179
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
167
180
|
data: {
|
@@ -242,6 +242,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
242
242
|
allowedInvalidValue: {
|
243
243
|
type: StringConstructor;
|
244
244
|
};
|
245
|
+
to: {
|
246
|
+
type: PropType<string | false | HTMLElement>;
|
247
|
+
default: string;
|
248
|
+
};
|
245
249
|
}, {
|
246
250
|
attrs: {
|
247
251
|
[x: string]: unknown;
|
@@ -262,6 +266,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
262
266
|
allowedInvalidValue: {
|
263
267
|
type: StringConstructor;
|
264
268
|
};
|
269
|
+
to: {
|
270
|
+
type: PropType<string | false | HTMLElement>;
|
271
|
+
default: string;
|
272
|
+
};
|
265
273
|
}>> & {
|
266
274
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
267
275
|
}>>;
|
@@ -298,10 +306,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
298
306
|
allowedInvalidValue: {
|
299
307
|
type: StringConstructor;
|
300
308
|
};
|
309
|
+
to: {
|
310
|
+
type: PropType<string | false | HTMLElement>;
|
311
|
+
default: string;
|
312
|
+
};
|
301
313
|
}>> & {
|
302
314
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
303
315
|
}, {
|
304
316
|
updateUnchangedValue: boolean;
|
317
|
+
to: string | false | HTMLElement;
|
305
318
|
}>>;
|
306
319
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
307
320
|
data: {
|
@@ -511,6 +524,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
511
524
|
allowedInvalidValue: {
|
512
525
|
type: StringConstructor;
|
513
526
|
};
|
527
|
+
to: {
|
528
|
+
type: PropType<string | false | HTMLElement>;
|
529
|
+
default: string;
|
530
|
+
};
|
514
531
|
}, {
|
515
532
|
attrs: {
|
516
533
|
[x: string]: unknown;
|
@@ -531,6 +548,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
531
548
|
allowedInvalidValue: {
|
532
549
|
type: StringConstructor;
|
533
550
|
};
|
551
|
+
to: {
|
552
|
+
type: PropType<string | false | HTMLElement>;
|
553
|
+
default: string;
|
554
|
+
};
|
534
555
|
}>> & {
|
535
556
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
536
557
|
}>>;
|
@@ -567,10 +588,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
567
588
|
allowedInvalidValue: {
|
568
589
|
type: StringConstructor;
|
569
590
|
};
|
591
|
+
to: {
|
592
|
+
type: PropType<string | false | HTMLElement>;
|
593
|
+
default: string;
|
594
|
+
};
|
570
595
|
}>> & {
|
571
596
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
572
597
|
}, {
|
573
598
|
updateUnchangedValue: boolean;
|
599
|
+
to: string | false | HTMLElement;
|
574
600
|
}>>;
|
575
601
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
576
602
|
data: {
|
@@ -200,6 +200,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
200
200
|
allowedInvalidValue: {
|
201
201
|
type: StringConstructor;
|
202
202
|
};
|
203
|
+
to: {
|
204
|
+
type: PropType<string | false | HTMLElement>;
|
205
|
+
default: string;
|
206
|
+
};
|
203
207
|
}, {
|
204
208
|
attrs: {
|
205
209
|
[x: string]: unknown;
|
@@ -220,6 +224,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
220
224
|
allowedInvalidValue: {
|
221
225
|
type: StringConstructor;
|
222
226
|
};
|
227
|
+
to: {
|
228
|
+
type: PropType<string | false | HTMLElement>;
|
229
|
+
default: string;
|
230
|
+
};
|
223
231
|
}>> & {
|
224
232
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
225
233
|
}>>;
|
@@ -256,10 +264,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
256
264
|
allowedInvalidValue: {
|
257
265
|
type: StringConstructor;
|
258
266
|
};
|
267
|
+
to: {
|
268
|
+
type: PropType<string | false | HTMLElement>;
|
269
|
+
default: string;
|
270
|
+
};
|
259
271
|
}>> & {
|
260
272
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
261
273
|
}, {
|
262
274
|
updateUnchangedValue: boolean;
|
275
|
+
to: string | false | HTMLElement;
|
263
276
|
}>>;
|
264
277
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
265
278
|
data: {
|
@@ -1911,7 +1911,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
1911
1911
|
wrapperStyle?: Record<string, string> | undefined;
|
1912
1912
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1913
1913
|
childWidthMode?: "inner" | "outer" | undefined;
|
1914
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
1914
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
1915
1915
|
reactions?: {
|
1916
1916
|
[x: string]: any;
|
1917
1917
|
dependencies?: string[] | undefined;
|
@@ -2158,7 +2158,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2158
2158
|
wrapperStyle?: Record<string, string> | undefined;
|
2159
2159
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2160
2160
|
childWidthMode?: "inner" | "outer" | undefined;
|
2161
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
2161
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2162
2162
|
reactions?: {
|
2163
2163
|
[x: string]: any;
|
2164
2164
|
dependencies?: string[] | undefined;
|
@@ -2376,7 +2376,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2376
2376
|
wrapperStyle?: Record<string, string> | undefined;
|
2377
2377
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2378
2378
|
childWidthMode?: "inner" | "outer" | undefined;
|
2379
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
2379
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2380
2380
|
reactions?: {
|
2381
2381
|
[x: string]: any;
|
2382
2382
|
dependencies?: string[] | undefined;
|
@@ -1914,7 +1914,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1914
1914
|
wrapperStyle?: Record<string, string> | undefined;
|
1915
1915
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1916
1916
|
childWidthMode?: "inner" | "outer" | undefined;
|
1917
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
1917
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
1918
1918
|
reactions?: {
|
1919
1919
|
[x: string]: any;
|
1920
1920
|
dependencies?: string[] | undefined;
|
@@ -2161,7 +2161,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2161
2161
|
wrapperStyle?: Record<string, string> | undefined;
|
2162
2162
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2163
2163
|
childWidthMode?: "inner" | "outer" | undefined;
|
2164
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
2164
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2165
2165
|
reactions?: {
|
2166
2166
|
[x: string]: any;
|
2167
2167
|
dependencies?: string[] | undefined;
|
@@ -2379,7 +2379,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2379
2379
|
wrapperStyle?: Record<string, string> | undefined;
|
2380
2380
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2381
2381
|
childWidthMode?: "inner" | "outer" | undefined;
|
2382
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
2382
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2383
2383
|
reactions?: {
|
2384
2384
|
[x: string]: any;
|
2385
2385
|
dependencies?: string[] | undefined;
|
@@ -417,7 +417,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
417
417
|
wrapperStyle?: Record<string, string> | undefined;
|
418
418
|
childFieldStrategy?: "checked" | "all" | undefined;
|
419
419
|
childWidthMode?: "inner" | "outer" | undefined;
|
420
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
420
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
421
421
|
reactions?: {
|
422
422
|
[x: string]: any;
|
423
423
|
dependencies?: string[] | undefined;
|
@@ -664,7 +664,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
664
664
|
wrapperStyle?: Record<string, string> | undefined;
|
665
665
|
childFieldStrategy?: "checked" | "all" | undefined;
|
666
666
|
childWidthMode?: "inner" | "outer" | undefined;
|
667
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
667
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
668
668
|
reactions?: {
|
669
669
|
[x: string]: any;
|
670
670
|
dependencies?: string[] | undefined;
|
@@ -882,7 +882,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
882
882
|
wrapperStyle?: Record<string, string> | undefined;
|
883
883
|
childFieldStrategy?: "checked" | "all" | undefined;
|
884
884
|
childWidthMode?: "inner" | "outer" | undefined;
|
885
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
885
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
886
886
|
reactions?: {
|
887
887
|
[x: string]: any;
|
888
888
|
dependencies?: string[] | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,onMounted as
|
1
|
+
import{defineComponent as e,ref as a,watch as o,onMounted as t,createVNode as l}from"vue";import{arrayed as u}from"../../../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{connect as i,mapProps as n}from"@formily/vue";import{isArray as m,property as s}from"lodash-es";import"../../../../index.js";import"../../../../../iho-table/index.js";import p from"../../../../../iho-table/src/IhoTable.vue.js";import{useCombination as f}from"./hooks/useCombination.js";import{assignUpdateValue as v}from"../../../utils/schema.js";import{useColumnConfigAdaptor as d}from"../../../../../iho-table/src/hooks/useColumnConfigAdaptor.js";import{useFormField as c}from"../../../hooks/useFormField.js";const b=i(e({name:"FormTableCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:i}){const{formConfigLikeAdaptor:n}=d(),{fieldList:v,editRules:b}=n({fieldList:e.properties}),{currentGroupNum:h,renderRemoveBtn:y,renderHeader:j}=f(e),g=a({editRules:b}),C=a(e.value);async function N(){h.value++,m(C.value)?C.value.push({}):(C.value=[{}],i("update:value",C.value))}o((()=>e.value),(e=>{C.value=e}));const x=v.concat({alias:"操作",columnName:"operation",width:60,isFixed:2,align:"center",slots:{default:({rowIndex:e})=>y({onClick:()=>async function(e){if(m(C.value))if(h.value>1)h.value--,C.value.splice(e,1);else if(1===C.value.length){const e=C.value[0];v.forEach((a=>{a.columnName&&(a.defaultValue?e[a.columnName]=a.defaultValue:Reflect.deleteProperty(e,a.columnName))}))}}(e)},e)}});t((()=>{if(!m(C.value))return C.value=[{}],void i("update:value",C.value);C.value.length||C.value.push({})}));const{field:k}=c(),F=a();async function A(){if(!F.value)return;const e=await F.value.$table.validate(!0);return e?Object.values(e).map((e=>e.map(s("rule.message")))).join(","):""}return t((()=>{if(!r(k.value))return;const e=k.value.validator;k.value.validator=[{validator:A},...e?u(e):[]]})),()=>l("section",{class:"form-render__combination"},[j({onClick:N}),l(p,{ref:F,fieldList:x,tableConfig:g.value,tableData:C.value},null)])}}),n(v));export{b as TABLE_COMBINATION};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function x(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),v=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,g;const y=v(e);e.urlConfig?x(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=f(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=f(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=f(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=f(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?x(n,e):e.autograph&&u(n,e),n},w=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=v(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=v(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:N(n)}),i},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{_ as useFieldListAdaptor};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=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(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=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(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:(a,i,r)=>e(a,m,r)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FormRequestDefine } from '../../../../shared/hooks';
|
2
2
|
import { AnyObject, ArrayAble, LowCodeTypes } from '../../../../shared/types';
|
3
|
+
import { Field } from '@formily/core';
|
3
4
|
import { SchemaEffectTypes, SchemaTypes } from '@formily/vue';
|
4
5
|
import { VNode } from 'vue';
|
5
6
|
import { DependKeyType, FormCommonState } from '../../../../components/form-render';
|
@@ -158,7 +159,7 @@ export type FieldItem = {
|
|
158
159
|
* @param fieldItem 配置参数
|
159
160
|
* @return {void|string} 返回校验信息
|
160
161
|
*/
|
161
|
-
validator: (value: unknown, fieldItem: FieldItem) => void | string;
|
162
|
+
validator: (value: unknown, fieldItem: FieldItem, field: Field) => void | string;
|
162
163
|
reactions: ArrayAble<ReactionType>;
|
163
164
|
[key: string]: any;
|
164
165
|
}>;
|
@@ -3,7 +3,7 @@ import { GeneralField } from '@formily/core';
|
|
3
3
|
import { ISchema } from '@formily/json-schema/esm/types';
|
4
4
|
import { Ref } from 'vue';
|
5
5
|
import { DependKeyType, FieldItem, ObjectDependKey } from '../../../../components/form-render';
|
6
|
-
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
|
6
|
+
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema, parent?: ISchema) => void, parent?: ISchema): void;
|
7
7
|
export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
|
8
8
|
export declare function dotEscape(id: string): string;
|
9
9
|
export declare function createFieldAddressId(id: string): string;
|
@@ -1 +1 @@
|
|
1
|
-
import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r){r(e),t(e.properties)&&Object.values(e.properties).forEach((
|
1
|
+
import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r,n){r(e,n),t(e.properties)&&Object.values(e.properties).forEach((t=>{i(t,r,e)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};
|