cnhis-design-vue 3.1.47-release.2 → 3.1.47-release.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +87 -87
  2. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  3. package/es/components/button-print/src/utils/print.d.ts +3 -3
  4. package/es/components/button-print/src/utils/print.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  6. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  7. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
  8. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -1
  9. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.d.ts +4 -0
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -0
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -0
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -0
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +4 -1
  19. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +8 -0
  21. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  22. package/es/components/fabric-chart/src/utils/index.d.ts +7 -0
  23. package/es/components/fabric-chart/src/utils/index.js +1 -1
  24. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  25. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  26. package/es/components/index.css +1 -1
  27. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  28. package/es/components/info-header/style/index.css +1 -1
  29. package/es/components/scale-view/index.d.ts +1 -0
  30. package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -0
  31. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  32. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  33. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  34. package/es/components/select-person/index.d.ts +4 -0
  35. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  36. package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -0
  37. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  38. package/es/components/select-person/src/utils/index.d.ts +1 -1
  39. package/es/components/select-person/src/utils/index.js +1 -1
  40. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  41. package/es/components/shortcut-provider/src/types/index.d.ts +1 -1
  42. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  43. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  44. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  45. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +5 -2
  46. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  47. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -2
  48. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -2
  49. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  50. package/es/env.d.ts +25 -25
  51. package/es/shared/assets/img/failure.png.js +1 -1
  52. package/es/shared/assets/img/no-permission.png.js +1 -1
  53. package/es/shared/assets/img/nodata.png.js +1 -1
  54. package/es/shared/assets/img/notfound.png.js +1 -1
  55. package/es/shared/assets/img/qr.png.js +1 -1
  56. package/es/shared/assets/img/success.png.js +1 -1
  57. package/es/shared/assets/img/video.png.js +1 -1
  58. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  59. package/es/shared/assets/img/xb_big.png.js +1 -1
  60. package/es/shared/assets/img/xb_small.png.js +1 -1
  61. package/es/shared/package.json.js +1 -1
  62. package/package.json +2 -2
  63. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  64. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  65. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  66. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  67. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  68. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  69. package/es/shared/utils/tapable/index.d.ts +0 -139
  70. package/es/shared/utils/tapableLess.d.ts +0 -28
  71. package/es/shared/utils/tapableLess.js +0 -1
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as g}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function p(p,c,d,f,y,m,v,w,S,b,Y){var x,j;const{getEqualXTypes:C,handleAddPrevent:T}=g(p,d),{originY:X,endY:k,originX:N,endX:V,xCellWidth:M,yCellHeight:L,left:W,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:R,canvasWidth:_,canvasHeight:B,getRightInfo:J,borderStyle:$}=c;function q(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let g=G,c=N;"right"===s&&(g=V,c=V+(null!=(r=null==R?void 0:R.width)?r:0));const d=[],f=A&&"right"!==s?o.length-1:o.length,y=(c-g)/f,m=y+(c-g)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:g,showMaxMinNumber:c,style:d,title:f}=n,y=l({width:N-G,height:A,...$},{value:`${f}`,...i,...d||{}},{left:G,top:I.originY}),m=e([G,I.originY,N,I.originY],$),v=[];if(s||h){const{lineXMain:e,textLeft:i}=a(g,G,N-G),l=o.length;o.forEach(((o,a)=>{let g=I.endY-a*L*r;if(0===a&&(g=k-5),!h||(0===a||a===l-1)&&!c||v.push(u(o,n,i,g)),s&&0!==a){const[i,n]=e,o=new t.Line([i,g,n,g],{...$,...d});v.push(o)}}))}p.value.add(m,y,...v),y.sendToBack()}(o);const c=[],f=0===r?m:y,v=0===r?g:m+g+(r-1)*y,w="right"===s?0:E.originY,S="right"===s?B:E.endY,b=r>0?e([v,w,v,S],{objectCaching:!1,...$}):null;b&&c.push(b);const Y=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:T,position:X,showMaxMinNumber:V}=o;if(C||T){const{lineXMain:t,lineXSub:e,textLeft:i}=a(X,v,f),n=x.length;x.forEach(((l,r)=>{const s=E.endY-r*L*j;if(T&&(!(0===r||r===n-1)||V)){const t=0==r?s-5:s,e=u(l,o,i,t),n=E.originY+e.height/2;t<n&&e.set({top:n}),c.push(e)}c.push(...h(o,r,t,e,s,L,E.originY))}))}let M=o.title||"";o.unit&&(M+="\n"+o.unit),M&&c.push(new t.Text(String(M),{...i,left:Y,top:E.originY+L*j/2,textAlign:"center",...o.style}));const W=new t.Group(c,{...n,objectCaching:!1});d.push(W)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&p.value.add(v),v&&v.sendToBack()}function z(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=k}G&&function(){const e=JSON.parse(JSON.stringify(H));let i=k;const l=G-W.icons.marginRight;e.reverse().forEach((e=>{i-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...n,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:i,lineHeight:1,fontSize:12}),h=o(e.type,{left:l,top:i-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:r(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:i-(u.height||30)/2-1,...c.event});var g;i-=u.height||30,(g=h).on("moving",(()=>{g.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(g),z(g)?f(g):y.show=!1})),g.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&z(g)){const t=C(g.left,"_type",M).includes(g.origin._type),e=b(g.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:w(g.left),value:S(g.origin.type,g.top),...s(g.origin.type)?{key:g.origin.key}:{}},...g.origin};d("add",t),Y(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(g)})),p.value.add(u,h)}))}();const D=W.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==R?void 0:R.width)&&"left"===(null==(x=null==R?void 0:R.yScaleValue)?void 0:x.layout)&&(null==(j=null==R?void 0:R.yScaleValue)?void 0:j.show)&&D.push(J),O>0&&W.yScaleValue[O].show){const t=W.yScaleValue[O];0===O&&W.yScaleValue.length>1&&D.unshift(t),O==W.yScaleValue.length-1&&D.push(t)}const P=D.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=D[P];return P>-1&&D.splice(P,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),q(D),p.value.add(new t.Rect({left:G,top:0,width:_-G-$.strokeWidth,height:B-$.strokeWidth,fill:"transparent",...$})),{drawScaleValue:q}}export{p as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,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"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,d,f,m,y,v,w,S,Y,b){var x,j;const{getEqualXTypes:X,handleAddPrevent:C,isGridLimit:N}=c(g,d,p),{originY:T,endY:V,originX:k,endX:L,xCellWidth:M,yCellHeight:W,left:E,vitalSignsOriginY:G,painOriginY:O,painHeight:A,iconsWidth:H,itemList:I,painIndex:R,right:_,canvasWidth:B,canvasHeight:J,getRightInfo:$,borderStyle:q}=p;function D(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,p=k;"right"===r&&(c=L,p=L+(null!=(s=null==_?void 0:_.width)?s:0));const d=[],f=A&&"right"!==r?o.length-1:o.length,m=(p-c)/f,y=m+(p-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:p,style:d,title:f}=n,m=l({width:k-H,height:A,...q},{value:`${f}`,...i,...d||{}},{left:H,top:O.originY}),y=e([H,O.originY,k,O.originY],q),v=[];if(r||h){const{lineXMain:e,textLeft:i}=a(c,H,k-H),l=o.length;o.forEach(((o,a)=>{let c=O.endY-a*W*s;if(0===a&&(c=V-5),!h||(0===a||a===l-1)&&!p||v.push(u(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...q,...d});v.push(o)}}))}g.value.add(y,m,...v),m.sendToBack()}(o);const p=[],f=0===s?y:m,v=0===s?c:y+c+(s-1)*m,w="right"===r?0:G.originY,S="right"===r?J:G.endY,Y=s>0?e([v,w,v,S],{objectCaching:!1,...q}):null;Y&&p.push(Y);const b=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:X,showNumber:C,position:N,showMaxMinNumber:T}=o;if(X||C){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,v,f),n=x.length;x.forEach(((l,s)=>{const r=G.endY-s*W*j;if(C&&(!(0===s||s===n-1)||T)){const t=0==s?r-5:r,e=u(l,o,i,t),n=G.originY+e.height/2;t<n&&e.set({top:n}),p.push(e)}p.push(...h(o,s,t,e,r,W,G.originY))}))}let L=o.title||"";o.unit&&(L+="\n"+o.unit),L&&p.push(new t.Text(String(L),{...i,left:b,top:G.originY+W*j/2,textAlign:"center",...o.style}));const M=new t.Group(p,{...n,objectCaching:!1});d.push(M)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&g.value.add(v),v&&v.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=V;const i=H-E.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...p.event}});var u;e-=l.height||30,(u=a).on("moving",(()=>{u.set("originX","center"),function(t){if(t.left>=k&&t.left<=L){t.setCoords();const e="pain"===t.origin.type?O:G;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(u),N(u)?f(u):m.show=!1})),u.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&N(u)){const t=X(u.left,"_type",M).includes(u.origin._type),e=Y(u.left);if(!e||t)t&&e&&C("repeat");else{const t={data:{time:w(u.left),value:S(u.origin.type,u.top),...r(u.origin.type)?{key:u.origin.key}:{}},...u.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),g.value.add(l,a)}))}();const P=E.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==_?void 0:_.width)&&"left"===(null==(x=null==_?void 0:_.yScaleValue)?void 0:x.layout)&&(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.show)&&P.push($),R>0&&E.yScaleValue[R].show){const t=E.yScaleValue[R];0===R&&E.yScaleValue.length>1&&P.unshift(t),R==E.yScaleValue.length-1&&P.push(t)}const z=P.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=P[z];return z>-1&&P.splice(z,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),D(P),g.value.add(new t.Rect({left:H,top:0,width:B-H-q.strokeWidth,height:J-q.strokeWidth,fill:"transparent",...q})),{drawScaleValue:D}}export{g as useLeft};
@@ -1,6 +1,9 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function): {
3
+ import { IObject } from '../interface';
4
+ import { AnyObject } from '../../../../../es/shared/types';
5
+ export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
4
6
  getEqualXTypes: (pointX: number, field: string, range?: number) => string[];
5
7
  handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
8
+ isGridLimit: (point: IObject) => boolean;
6
9
  };
@@ -1 +1 @@
1
- const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t){return{getEqualXTypes:function(e,t,r=6){const i=[],o=r/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&i.push(n.origin[t])})),[...new Set(i)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})}}}export{n as useCommon};
1
+ const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t,i){return{getEqualXTypes:function(e,t,i=6){const r=[],o=i/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&r.push(n.origin[t])})),[...new Set(r)]},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:c,endY:u}=i;return n>=r&&n<=o&&t>=c&&t<=u}}}export{n as useCommon};
@@ -1,5 +1,6 @@
1
1
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
2
2
  import { ILineOptions, ITextOptions } from '../interface';
3
+ import { AnyObject } from '../../../../../es/shared/types';
3
4
  export declare const defaultStyle: {
4
5
  evented: boolean;
5
6
  selectable: boolean;
@@ -48,3 +49,10 @@ export declare function drawText([x, y]: [x: number, y: number], style: ITextOpt
48
49
  export declare function drawArrow([x, y1, y2]: [x: number, y1: number, y2: number], style: ITextOptions | any, type?: string): fabric.Group;
49
50
  export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>, showRect?: boolean): fabric.Group;
50
51
  export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
52
+ export declare function drawTextAndIconGroup(title: string, item: AnyObject, option: {
53
+ text: AnyObject;
54
+ icon: AnyObject;
55
+ }, direction?: string): {
56
+ text: fabric.Text;
57
+ icon: fabric.Object;
58
+ };
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},i={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,r){return new e.Line(t,{...n,...r})}function s([t,r],n){return new e.Text(String(n.value),{...o,left:t,top:r,...n})}function a([r,n,i],o,a="down"){const l=c([r,n,r,i],{strokeWidth:1,stroke:o.fill}),g=s([r+.5,"up"===a?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===a?180:0,objectCaching:!1,...o});return new e.Group([l,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function l(r,n,c,s=!1){const a=new e.Rect({...i,...r,...s?{}:{stroke:"transparent"}}),{value:l="标题",textAlign:g="center",verticalAlign:u="center"}=n,h=r.width/2,f=r.height/2,d=new e.Text(String(l),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-h:h}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-f:f}:{}});return new e.Group([a,d],{objectCaching:!1,...t,...c})}function g(t="circle",r){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},i=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(r.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([i,o])};return new e.Group([i(),t()],{scale:1,...n})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([i(),o],{scale:1,...n})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}export{r as defaultBorderStyle,n as defaultLineStyle,i as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,a as drawArrow,c as drawLine,g as drawPoint,s as drawText,l as drawTextGroup};
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,h=i.width/2,f=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-h:h}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-f:f}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t="circle",i){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...i},r=()=>new e.Circle({objectCaching:!1,strokeWidth:i.strokeWidth||1,stroke:i.stroke||"red",radius:i.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(i.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((i.radius||5)+(i.strokeWidth||1)),n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([r,o])};return new e.Group([r(),t()],{scale:1,...n})}case"koumai":{const t=(i.radius||5)+(i.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([r(),o],{scale:1,...n})}default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}function u(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:u}=r.icon,h=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,f=null!=a?a:u+c.width+5;return{text:c,icon:g(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:f,originTop:h,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:f,top:h})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,g as drawPoint,l as drawText,u as drawTextAndIconGroup,a as drawTextGroup};
@@ -16,3 +16,10 @@ export declare function isOverlapPoint(pointObj1: any, pointObj2: any): boolean;
16
16
  export declare function getFloorNumber(value: number, n?: number): number;
17
17
  export declare function getChildrenSize(treeData: ITreeItem[]): number;
18
18
  export declare function getTime(value: number | string): number;
19
+ /**
20
+ * @description: 获取y轴刻度数值列表
21
+ * @param {[number, number]} range
22
+ * @param {number} spaceValue
23
+ * @return {number[]}
24
+ */
25
+ export declare function getScaleNumberList(range: [number, number], spaceValue: number): number[];
@@ -1 +1 @@
1
- import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>d(t.time)>d(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function d(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,d as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
1
+ import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>d(t.time)>d(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return s(n.left,1)===s(t.left,1)&&Math.abs(s(n.top,1)-s(t.top,1))<=2}function s(n,t=100){return Math.floor(n*t)/t}function a(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=a(n.children):t++})),t}function d(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function p(n,t){const e=[],[r,u]=n;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}export{r as deleteProperty,a as getChildrenSize,s as getFloorNumber,u as getIndex,p as getScaleNumberList,d as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
@@ -1 +1 @@
1
- import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as a,isFunction as s}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as f,NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as l,queryInput as d,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as h}from"../utils/schema.js";function x({formModel:t,formRenderRef:n,formUUID:s,getFieldList:u,formItemDepsCollector:p}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return a(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(m)),o=!0)})),!o&&t.push(m(r)),t}function m(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),a=e.messages.map((e=>function(e,t){var r;return t&&i(t.fieldItem)?g(null!=(r=t.fieldItem.defined_error_msg)?r:e,t.fieldItem):e}(e,r.get("decoratorProps")))),m=l(e.address,n.value,s);return{...e,messages:a,title:o,decoratorElement:m,...d(m)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(u(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=y(u(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return a();const o=c(e,t,s);if(o)return a(o);const i=h(e,r);return i?(p.trigger(f+i,!0),await m(),a(c(e,t,s))):a();function a(e){return{decoratorElement:e,...d(e)}}}(e,n.value,u()):null}}function I({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(a){var m;if(e.enterToNextWidget&&a.target){if("TEXTAREA"===a.target.tagName&&!a.ctrlKey)return;a.preventDefault()}if(await n(0),Reflect.get(a,"stopCapture")||!e.enterToNextWidget||!r.value)return;const f=t(a.target,(e=>e.classList.contains("form-render__formItem")));if(!f)return;const l=`.form-render__formItem${u.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===f.id));if(!~c)return;const{widget:g,field:v}=p(d,c,a.target);if(g)if(s(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(m=t.decoratorProps)?void 0:m.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{I as useFormDomEvent,x as useFormExposeEvent};
1
+ import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isArray as s,isString as a,isFunction as m}from"lodash-es";import{nextTick as f}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as u,NESTED_FORM_ITEM_TYPE as l}from"../constants/index.js";import{queryDecoratorByAddress as d,queryInput as c,queryDecoratorByFieldKey as p,findNextWidget as g}from"../utils/dom.js";import{validateMessageParser as v,combineExtendKey as y,splitExtendKey as h}from"../utils/index.js";import{getParentLinebar as x}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:m,getFieldList:l,formItemDepsCollector:g}){return{validate(r="*"){return t.validate(r).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(o,[]):e)));function o(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(f)),o=!0)})),!o&&t.push(f(r)),t}function f(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return v(r&&a(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),f=d(e.address,n.value,m);return{...e,messages:s,title:o,decoratorElement:f,...c(f)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=y(l(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=h(l(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=p(e,t,m);if(o)return s(o);const i=x(e,r);return i?(g.trigger(u+i,!0),await f(),s(p(e,t,m))):s();function s(e){return{decoratorElement:e,...c(e)}}}(e,n.value,l()):null}}function j({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(s){var a;if(e.enterToNextWidget&&s.target){if("TEXTAREA"===s.target.tagName&&!s.ctrlKey)return;s.preventDefault()}if(await n(0),Reflect.get(s,"stopCapture")||!e.enterToNextWidget||!r.value)return;const f=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!f)return;const u=`.form-render__formItem${l.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(u)),c=d.findIndex((e=>e.id===f.id));if(!~c)return;const{widget:p,field:v}=g(d,c,s.target);if(p)if(m(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(a=t.decoratorProps)?void 0:a.fieldItem)?y():i({target:p})}else y();async function y(){await n(0),p.focus()}}}}export{j as useFormDomEvent,I as useFormExposeEvent};
@@ -1 +1 @@
1
- import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as i,isNumber as a}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=i(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&e&&(t(e)||a(e))&&(console.log("value=>",e),n.componentProps={maxTagCount:+e,...n.componentProps})},_=new Map([["multi_select_value",f],["is_null",(e,t,n,o)=>{"1"!==e&&"0"===e&&(o[n.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!r(e))return;t.componentProps={...Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[n,o])=>(t[n]=e[o],t)),{}),...t.componentProps}}],["dateValidate",(e,t)=>{r(e)&&(t.isDateDisabled=(t,n)=>{if(!r(n))return;const{startDate:o,endDate:i}=e;let a=!1;return o&&(a=new Date(n[o]).getTime()>t),i&&(a=a||new Date(n[i]).getTime()<t),a})}],["date_format","valueFormat"],...["open","close"].map((e=>[e,d])),["is_edit",{property:"isEdit",valueMap:u}],["html_type",(e,n,o)=>{var i;if(!t(e))return;if("DATE"===e)return void(n.formType=t(o.date_format)&&o.date_format.startsWith("HH:mm")?"time":"date");n.formType=null!=(i=c.get(e))?i:e;const a="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===o.multi_select:null));a&&(n.componentProps={multiple:a,...n.componentProps})}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],["alias",(e,t,n)=>{t.title=`${e}${n.suffix?`(${n.suffix})`:""}`}]]),E=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:m}],["multi_select_value",f],["setting",{fieldMap:_,assign:!0}]]);return l.map((e=>g(e,p,E)));function g(a,l,p){if(!p)return e(a);const m={};return Object.entries(a).forEach((([e,o])=>{const i=p.get(e);return i?i!==s?t(i)?m[i]=o:n(i)?i(o,m,a,l):void(r(i)&&(i.assign?Object.assign(m,u(o,i)):m[i.property||e]=u(o,i))):void 0:m[e]=o})),m.componentProps=Object.assign({},m.componentProps,o(m,["options","isDateDisabled"])),m;function u(e,t){var o,a;return!r(t)||n(t)?e:i(e)?e.map((e=>u(e,t))):r(e)?g(e,l,t.fieldMap):null!=(a=null==(o=t.valueMap)?void 0:o.get(e))?a:e}}}(l.fieldList),editRules:p}:{fieldList:[],editRules:p}}}}export{l as useColumnConfigAdaptor};
1
+ import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as i,isNumber as a}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=i(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&e&&(t(e)||a(e))&&(console.log("value=>",e),n.componentProps={maxTagCount:+e,...n.componentProps})},_=new Map([["multi_select_value",f],["is_null",(e,t,n,o)=>{"1"!==e&&"0"===e&&(o[n.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!r(e))return;t.componentProps={...Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[n,o])=>(t[n]=e[o],t)),{}),...t.componentProps}}],["dateValidate",(e,t)=>{r(e)&&(t.isDateDisabled=(t,n)=>{if(!r(n))return;const{startDate:o,endDate:i}=e;let a=!1;return o&&(a=new Date(n[o]).getTime()>t),i&&(a=a||new Date(n[i]).getTime()<t),a})}],["date_format","valueFormat"],...["open","close"].map((e=>[e,d])),["is_edit",{property:"isEdit",valueMap:u}],["html_type",(e,n,o)=>{var i;if(!t(e))return;if("DATE"===e)return void(n.formType=t(o.date_format)&&o.date_format.startsWith("HH:mm")?"time":"date");n.formType=null!=(i=c.get(e))?i:e;const a="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===o.multi_select:null));a&&(n.componentProps={multiple:a,...n.componentProps})}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],...["alias","name"].map((e=>[e,(e,t,n)=>{var o;t.title=`${null!=(o=n.alias)?o:n.name}${n.suffix?`(${n.suffix})`:""}`}]))]),v=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:m}],["multi_select_value",f],["setting",{fieldMap:_,assign:!0}]]);return l.map((e=>E(e,p,v)));function E(a,l,p){if(!p)return e(a);const m={};return Object.entries(a).forEach((([e,o])=>{const i=p.get(e);return i?i!==s?t(i)?m[i]=o:n(i)?i(o,m,a,l):void(r(i)&&(i.assign?Object.assign(m,u(o,i)):m[i.property||e]=u(o,i))):void 0:m[e]=o})),m.componentProps=Object.assign({},m.componentProps,o(m,["options","isDateDisabled"])),m;function u(e,t){var o,a;return!r(t)||n(t)?e:i(e)?e.map((e=>u(e,t))):r(e)?E(e,l,t.fieldMap):null!=(a=null==(o=t.valueMap)?void 0:o.get(e))?a:e}}}(l.fieldList),editRules:p}:{fieldList:[],editRules:p}}}}export{l as useColumnConfigAdaptor};