cnhis-design-vue 3.1.12-beta.4 → 3.1.12-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/es/packages/big-table/index.d.ts +0 -8
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +0 -8
  3. package/es/packages/big-table/src/bigTableState.js +1 -1
  4. package/es/packages/fabric-chart/index.d.ts +195 -1
  5. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +196 -1
  6. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +269 -6
  7. package/es/packages/fabric-chart/src/components/PopupMenu.d.ts +46 -0
  8. package/es/packages/fabric-chart/src/components/PopupMenu.js +105 -0
  9. package/es/packages/fabric-chart/src/components/PopupTip.js +4 -0
  10. package/es/packages/fabric-chart/src/components/PopupTip.vue.d.ts +63 -0
  11. package/es/packages/fabric-chart/src/components/PopupTip.vue_vue_type_script_setup_true_lang.js +32 -0
  12. package/es/packages/fabric-chart/src/components/useStyle.d.ts +7 -0
  13. package/es/packages/fabric-chart/src/components/useStyle.js +36 -0
  14. package/es/packages/fabric-chart/src/hooks/constant.d.ts +14 -0
  15. package/es/packages/fabric-chart/src/hooks/constant.js +36 -0
  16. package/es/packages/fabric-chart/src/hooks/index.d.ts +9 -0
  17. package/es/packages/fabric-chart/src/hooks/index.js +9 -0
  18. package/es/packages/fabric-chart/src/hooks/useBottom.d.ts +4 -0
  19. package/es/packages/fabric-chart/src/hooks/useBottom.js +86 -0
  20. package/es/packages/fabric-chart/src/hooks/useCenter.d.ts +29 -0
  21. package/es/packages/fabric-chart/src/hooks/useCenter.js +475 -0
  22. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +7 -0
  23. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +53 -0
  24. package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +42 -0
  25. package/es/packages/fabric-chart/src/hooks/useDraw.js +86 -0
  26. package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +1 -0
  27. package/es/packages/fabric-chart/src/hooks/useEvent.js +10 -0
  28. package/es/packages/fabric-chart/src/hooks/useGrid.d.ts +4 -0
  29. package/es/packages/fabric-chart/src/hooks/useGrid.js +44 -0
  30. package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +4 -0
  31. package/es/packages/fabric-chart/src/hooks/useLeft.js +180 -0
  32. package/es/packages/fabric-chart/src/hooks/useOther.d.ts +4 -0
  33. package/es/packages/fabric-chart/src/hooks/useOther.js +34 -0
  34. package/es/packages/fabric-chart/src/hooks/useRight.d.ts +4 -0
  35. package/es/packages/fabric-chart/src/hooks/useRight.js +87 -0
  36. package/es/packages/fabric-chart/src/hooks/useShadow.d.ts +6 -0
  37. package/es/packages/fabric-chart/src/hooks/useShadow.js +127 -0
  38. package/es/packages/fabric-chart/src/hooks/useTop.d.ts +4 -0
  39. package/es/packages/fabric-chart/src/hooks/useTop.js +148 -0
  40. package/es/packages/fabric-chart/src/interface.d.ts +115 -0
  41. package/es/packages/fabric-chart/src/interface.js +3 -0
  42. package/es/packages/fabric-chart/src/utils/index.d.ts +2 -0
  43. package/es/packages/fabric-chart/src/utils/index.js +15334 -0
  44. package/es/packages/fabric-chart/style/index.css +43 -0
  45. package/es/packages/form-render/src/components/renderer/cascader.js +14 -0
  46. package/es/packages/form-render/src/components/renderer/checkbox.d.ts +2 -0
  47. package/es/packages/form-render/src/components/renderer/checkbox.js +4 -5
  48. package/es/packages/form-render/src/components/renderer/date.js +42 -10
  49. package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
  50. package/es/packages/form-render/src/components/renderer/index.js +1 -0
  51. package/es/packages/form-render/src/components/renderer/linebar.js +1 -1
  52. package/es/packages/form-render/src/components/renderer/select.js +11 -0
  53. package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +2 -0
  54. package/es/packages/form-render/src/components/renderer/simpleComponent.js +64 -0
  55. package/es/packages/form-render/src/components/renderer/slider.js +1 -1
  56. package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
  57. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +24 -15
  58. package/es/packages/index.css +50 -2
  59. package/es/packages/scale-view/src/components/formitem/r-collection.d.ts +1 -1
  60. package/es/packages/scale-view/src/components/formitem/r-collection.js +2 -4
  61. package/es/packages/scale-view/src/hooks/scaleview-computed.js +1 -1
  62. package/es/packages/scale-view/src/hooks/scaleview-init.js +3 -1
  63. package/es/packages/scale-view/src/hooks/use-component.d.ts +5 -5
  64. package/es/packages/scale-view/style/index.css +0 -2
  65. package/es/packages/select-label/style/index.css +7 -0
  66. package/package.json +2 -2
@@ -1 +1,149 @@
1
+ import { onMounted, nextTick } from 'vue';
2
+ import { fabric } from '../utils/index.js';
3
+ import { defaultStyle, drawTextGroup, defaultTextStyle, defaultRectStyle } from './useDraw.js';
1
4
 
5
+ function useTop(canvas, propItems) {
6
+ const {
7
+ originY,
8
+ grid,
9
+ originX,
10
+ xCellWidth,
11
+ gridXNumber,
12
+ top,
13
+ dateHeight,
14
+ hospitalDaysHeight,
15
+ operationDaysHeight,
16
+ xScalevalueHeight,
17
+ iconsWidth
18
+ } = propItems;
19
+ function drawTop() {
20
+ let list = [];
21
+ let topY = 0;
22
+ let topList = [];
23
+ for (let i in top) {
24
+ if (top[i].show) {
25
+ topList.push({
26
+ ...top[i],
27
+ key: i
28
+ });
29
+ }
30
+ }
31
+ topList.sort((a, b) => a.seq - b.seq);
32
+ topList.forEach((item, index) => {
33
+ if (index > 0) {
34
+ topY += propItems[`${topList[index - 1].key}Height`];
35
+ }
36
+ if (item.key == "xScalevalue") {
37
+ drawDay(list, topY);
38
+ drawTime(list, topY);
39
+ } else {
40
+ propItems[`${item.key}Height`] && drawDate(item, list, topY);
41
+ }
42
+ });
43
+ const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
44
+ group && group.sendToBack();
45
+ group && canvas.value.add(group);
46
+ }
47
+ function drawTime(list, topY) {
48
+ var _a;
49
+ const dayHeight = top.xScalevalue.show ? top.dayHeight || 0 : 0;
50
+ const height = xScalevalueHeight - dayHeight;
51
+ const title = drawTextGroup({
52
+ width: originX - iconsWidth,
53
+ height: xScalevalueHeight,
54
+ ...defaultRectStyle
55
+ }, {
56
+ value: top.xScalevalue.title,
57
+ ...defaultTextStyle,
58
+ ...((_a = top.date) == null ? void 0 : _a.style) || {}
59
+ }, {
60
+ left: iconsWidth,
61
+ top: topY
62
+ });
63
+ list.push(title);
64
+ let timeList = [];
65
+ for (let j = 0; j < grid.mainXCell; j++) {
66
+ timeList.push(top.xScalevalue.list);
67
+ }
68
+ timeList.flat().forEach((v, i) => {
69
+ var _a2;
70
+ const left = originX + i * xCellWidth;
71
+ const textGroup = drawTextGroup({
72
+ width: xCellWidth,
73
+ height
74
+ }, {
75
+ value: v,
76
+ ...defaultTextStyle,
77
+ ...((_a2 = top.date) == null ? void 0 : _a2.style) || {}
78
+ }, {
79
+ left,
80
+ top: topY + dayHeight
81
+ });
82
+ list.push(textGroup);
83
+ });
84
+ }
85
+ function drawDay(list, topY) {
86
+ var _a;
87
+ if (!top.dayHeight)
88
+ return false;
89
+ const height = top.dayHeight;
90
+ const width = xCellWidth * grid.subSecondXCell;
91
+ const dayList = gridXNumber / grid.subSecondXCell;
92
+ for (let i = 0; i < dayList; i++) {
93
+ const left = originX + i * width;
94
+ const value = i % 2 === 0 ? "\u4E0A\u5348" : "\u4E0B\u5348";
95
+ const textGroup = drawTextGroup({
96
+ width,
97
+ height
98
+ }, {
99
+ value,
100
+ ...defaultTextStyle,
101
+ ...((_a = top.date) == null ? void 0 : _a.style) || {}
102
+ }, {
103
+ left,
104
+ top: topY
105
+ });
106
+ list.push(textGroup);
107
+ }
108
+ }
109
+ function drawDate(item, list, topY) {
110
+ let height = propItems[`${item.key}Height`];
111
+ const title = drawTextGroup({
112
+ width: originX - iconsWidth,
113
+ height,
114
+ ...defaultRectStyle
115
+ }, {
116
+ value: item.title,
117
+ ...defaultTextStyle,
118
+ ...(item == null ? void 0 : item.style) || {}
119
+ }, {
120
+ left: iconsWidth,
121
+ top: topY
122
+ });
123
+ list.push(title);
124
+ const width = xCellWidth * grid.subXCell;
125
+ item.list.forEach((v, i) => {
126
+ const left = originX + i * width;
127
+ const textGroup = drawTextGroup({
128
+ width,
129
+ height
130
+ }, {
131
+ value: v,
132
+ ...defaultTextStyle,
133
+ ...(item == null ? void 0 : item.style) || {}
134
+ }, {
135
+ left,
136
+ top: topY
137
+ });
138
+ list.push(textGroup);
139
+ });
140
+ }
141
+ onMounted(() => {
142
+ nextTick(() => {
143
+ drawTop();
144
+ canvas.value.renderAll();
145
+ });
146
+ });
147
+ }
148
+
149
+ export { useTop };
@@ -0,0 +1,115 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { fabric } from './utils';
3
+ interface IEvent {
4
+ selectable: boolean;
5
+ evented: boolean;
6
+ }
7
+ interface IGrid {
8
+ mainXCell: number;
9
+ subXCell: number;
10
+ subSecondXCell: number;
11
+ mainYCell: number;
12
+ subYCell: number;
13
+ mainLineStyle?: fabric.ILineOptions;
14
+ subLineStyle?: fabric.ILineOptions;
15
+ subSecondLineStyle?: fabric.ILineOptions;
16
+ event?: Partial<IEvent>;
17
+ }
18
+ export interface IPropItems {
19
+ canvasWidth: number;
20
+ canvasHeight: number;
21
+ borderStyle: fabric.ILineOptions;
22
+ dateHeight: number;
23
+ hospitalDaysHeight: number;
24
+ operationDaysHeight: number;
25
+ xScalevalueHeight: number;
26
+ breathingHeight: number;
27
+ grid: IGrid;
28
+ top: ITop;
29
+ left: ILeft;
30
+ right: IRight | undefined;
31
+ bottom: any;
32
+ other: IOther;
33
+ painIndex: number;
34
+ painHeight: number;
35
+ painOriginY: any;
36
+ vitalSignsOriginY: any;
37
+ gridXNumber: number;
38
+ gridYNumber: number;
39
+ iconsWidth: number;
40
+ originX: number;
41
+ originY: number;
42
+ endX: number;
43
+ endY: number;
44
+ xCellWidth: number;
45
+ yCellHeight: number;
46
+ xScaleList: Array<string | number>;
47
+ xScaleCell: number;
48
+ breatheYCell: number;
49
+ pulseYCell: number;
50
+ temperatureYCell: number;
51
+ painYCell: number;
52
+ event: Partial<IEvent>;
53
+ itemList: Array<any>;
54
+ }
55
+ export interface IPoint {
56
+ time: string;
57
+ value: string | number;
58
+ [key: string]: any;
59
+ }
60
+ interface IOther {
61
+ style?: fabric.ITextOptions;
62
+ list: Array<IPoint>;
63
+ }
64
+ export interface IDate {
65
+ seq: number;
66
+ show?: boolean;
67
+ title: string;
68
+ height?: number;
69
+ list: Array<string | number>;
70
+ style?: fabric.ITextOptions;
71
+ [key: string]: any;
72
+ }
73
+ export interface ITop {
74
+ dateStyle?: fabric.ITextOptions;
75
+ titleWidth: number;
76
+ date: IDate;
77
+ xScalevalue: IDate;
78
+ dayHeight?: number;
79
+ hospitalDays?: IDate;
80
+ operationDays?: IDate;
81
+ }
82
+ interface ILeft {
83
+ spaceGridNumber?: number;
84
+ yScaleValue: Array<any>;
85
+ icons?: any;
86
+ }
87
+ interface IRight {
88
+ width?: number;
89
+ yScaleValue: any;
90
+ }
91
+ export interface IData {
92
+ width: number;
93
+ height: number;
94
+ borderStyle?: fabric.ILineOptions;
95
+ grid: IGrid;
96
+ other?: IOther;
97
+ top: ITop;
98
+ left: ILeft;
99
+ right?: IRight;
100
+ bottom: any;
101
+ }
102
+ export interface ICoordinateValue {
103
+ x: number;
104
+ y: number;
105
+ }
106
+ export declare type IPointType = 'breathe' | 'pulse' | 'temperature' | 'pain';
107
+ export interface ILineOptions extends fabric.ILineOptions {
108
+ [key: string]: any;
109
+ }
110
+ export interface ITextOptions extends fabric.ITextOptions {
111
+ [key: string]: any;
112
+ }
113
+ export declare const InjectionCanvas: InjectionKey<Ref<fabric.Canvas>>;
114
+ export declare const InjectionPropItems: InjectionKey<IPropItems>;
115
+ export {};
@@ -1 +1,4 @@
1
+ const InjectionCanvas = Symbol("canvas");
2
+ const InjectionPropItems = Symbol("propItems");
1
3
 
4
+ export { InjectionCanvas, InjectionPropItems };
@@ -0,0 +1,2 @@
1
+ /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
2
+ export const fabric: any;