cnhis-design-vue 3.1.33-beta.3 → 3.1.33-beta.5

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 (50) hide show
  1. package/README.md +123 -123
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/fabric-chart/index.d.ts +219 -187
  7. package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +49 -0
  8. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +220 -188
  9. package/es/components/fabric-chart/src/FabricChart.vue.js +20 -327
  10. package/es/components/fabric-chart/src/TemperatureChart.vue.d.ts +215 -0
  11. package/es/components/fabric-chart/src/TemperatureChart.vue.js +347 -0
  12. package/es/components/fabric-chart/src/constants/index.d.ts +4 -0
  13. package/es/components/fabric-chart/src/constants/index.js +4 -0
  14. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -0
  15. package/es/components/fabric-chart/src/hooks/useGrid.js +27 -1
  16. package/es/components/fabric-chart/src/interface.d.ts +23 -6
  17. package/es/components/fabric-chart/src/interface.js +0 -3
  18. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  19. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +2 -4
  20. package/es/components/form-render/src/hooks/useFormRenderOptions.js +14 -8
  21. package/es/components/index.css +1 -1
  22. package/es/components/info-header/src/InfoHeader.vue.js +14 -10
  23. package/es/components/info-header/style/index.css +1 -1
  24. package/es/shared/assets/img/failure.js +1 -1
  25. package/es/shared/assets/img/failure.png.js +1 -1
  26. package/es/shared/assets/img/icon-asc.js +1 -1
  27. package/es/shared/assets/img/icon-desc.js +1 -1
  28. package/es/shared/assets/img/no-permission.js +1 -1
  29. package/es/shared/assets/img/no-permission.png.js +1 -1
  30. package/es/shared/assets/img/nodata.js +1 -1
  31. package/es/shared/assets/img/nodata.png.js +1 -1
  32. package/es/shared/assets/img/notfound.js +1 -1
  33. package/es/shared/assets/img/notfound.png.js +1 -1
  34. package/es/shared/assets/img/qr.js +1 -1
  35. package/es/shared/assets/img/qr.png.js +1 -1
  36. package/es/shared/assets/img/success.js +1 -1
  37. package/es/shared/assets/img/success.png.js +1 -1
  38. package/es/shared/assets/img/video.js +1 -1
  39. package/es/shared/assets/img/video.png.js +1 -1
  40. package/es/shared/assets/img/video_default_cover.js +1 -1
  41. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  42. package/es/shared/assets/img/video_hover.js +1 -1
  43. package/es/shared/assets/img/video_play_hover.js +1 -1
  44. package/es/shared/assets/img/xb_big.js +1 -1
  45. package/es/shared/assets/img/xb_big.png.js +1 -1
  46. package/es/shared/assets/img/xb_small.js +1 -1
  47. package/es/shared/assets/img/xb_small.png.js +1 -1
  48. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  49. package/es/shared/utils/tapable/index.d.ts +139 -0
  50. package/package.json +2 -2
@@ -0,0 +1,347 @@
1
+ import { defineComponent, ref, computed, reactive, onMounted, onBeforeUnmount, openBlock, createElementBlock, Fragment, createElementVNode, unref, createBlock, mergeProps, createCommentVNode } from 'vue';
2
+ import { fabric } from './utils/index.js';
3
+ import { defaultBorderStyle } from './hooks/useDraw.js';
4
+ import { useCumputedPoint } from './hooks/useCumputedPoint.js';
5
+ import { useTop } from './hooks/useTop.js';
6
+ import { useLeft } from './hooks/useLeft.js';
7
+ import { useRight } from './hooks/useRight.js';
8
+ import { useCenter } from './hooks/useCenter.js';
9
+ import { useBottom } from './hooks/useBottom.js';
10
+ import { useOther } from './hooks/useOther.js';
11
+ import { useEvent, useCanvasEvent } from './hooks/useEvent.js';
12
+ import PopupTip from './components/PopupTip.vue.js';
13
+ import PopupMenu from './components/PopupMenu.js';
14
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
15
+
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ __name: "TemperatureChart",
18
+ props: {
19
+ data: { type: Object, required: true },
20
+ addRenderItem: { type: Function }
21
+ },
22
+ emits: [
23
+ "change",
24
+ "add",
25
+ "select"
26
+ ],
27
+ setup(__props, { expose, emit: emits }) {
28
+ const props = __props;
29
+ const defaultHeight = 15;
30
+ let select = ref();
31
+ const canvasRef = ref(null);
32
+ let canvas = ref();
33
+ const dateHeight = computed(() => {
34
+ const { top } = props.data;
35
+ return top.date.show && (top.date.height || defaultHeight) || 0;
36
+ });
37
+ const hospitalDaysHeight = computed(() => {
38
+ var _a;
39
+ const { top } = props.data;
40
+ return ((_a = top.hospitalDays) == null ? void 0 : _a.show) && (top.hospitalDays.height || defaultHeight) || 0;
41
+ });
42
+ const operationDaysHeight = computed(() => {
43
+ var _a;
44
+ const { top } = props.data;
45
+ return ((_a = top.operationDays) == null ? void 0 : _a.show) && (top.operationDays.height || defaultHeight) || 0;
46
+ });
47
+ const xScalevalueHeight = computed(() => {
48
+ var _a, _b, _c;
49
+ const { top } = props.data;
50
+ const height = ((_a = top.xScalevalue) == null ? void 0 : _a.show) && (top.xScalevalue.height || defaultHeight) || 0;
51
+ const dayHeight = ((_b = top.xScalevalue) == null ? void 0 : _b.show) ? (_c = top.dayHeight) != null ? _c : 0 : 0;
52
+ return height + dayHeight;
53
+ });
54
+ const breathingHeight = computed(() => {
55
+ var _a;
56
+ const { bottom } = props.data;
57
+ return ((_a = bottom == null ? void 0 : bottom.breathing) == null ? void 0 : _a.show) && (bottom.breathing.height || defaultHeight * 2) || 0;
58
+ });
59
+ const gridXNumber = computed(() => {
60
+ const { grid } = props.data;
61
+ return grid.mainXCell * grid.subXCell + grid.surplusXCell;
62
+ });
63
+ const gridYNumber = computed(() => {
64
+ const { grid } = props.data;
65
+ return grid.mainYCell * grid.subYCell + grid.surplusYCell;
66
+ });
67
+ const endX = computed(() => {
68
+ var _a;
69
+ const { width, right = null, top } = props.data;
70
+ if (!right)
71
+ return width;
72
+ const endWidth = (_a = right.width) != null ? _a : 0;
73
+ return width - endWidth;
74
+ });
75
+ const endXLimit = computed(() => {
76
+ const { grid } = props.data;
77
+ return endX.value - grid.surplusXCell * xCellWidth.value;
78
+ });
79
+ const originX = computed(() => {
80
+ const { top, left } = props.data;
81
+ const originX2 = top.titleWidth + iconsWidth.value;
82
+ return originX2;
83
+ });
84
+ const endY = computed(() => {
85
+ const { bottom = null, height } = props.data;
86
+ if (!bottom)
87
+ return height;
88
+ const endHeight = bottom.height || 30;
89
+ return height - endHeight;
90
+ });
91
+ const originY = computed(() => {
92
+ var _a;
93
+ const { top } = props.data;
94
+ const dayHeight = top.xScalevalue.show && ((_a = top.dayHeight) != null ? _a : 0) || 0;
95
+ const xScaleHeight = top.xScalevalue.show && (top.xScalevalue.height || defaultHeight) || 0;
96
+ const topHeight = dateHeight.value + dayHeight + xScaleHeight + hospitalDaysHeight.value + operationDaysHeight.value;
97
+ return topHeight;
98
+ });
99
+ const originYLimit = computed(() => {
100
+ const { grid } = props.data;
101
+ return originY.value + grid.surplusYCell * yCellHeight.value;
102
+ });
103
+ const xCellWidth = computed(() => {
104
+ return (endX.value - originX.value) / gridXNumber.value;
105
+ });
106
+ const yCellHeight = computed(() => {
107
+ return (endY.value - originY.value) / gridYNumber.value;
108
+ });
109
+ const iconsWidth = computed(() => {
110
+ var _a, _b;
111
+ const { left } = props.data;
112
+ return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
113
+ });
114
+ const xScaleList = computed(() => {
115
+ const { top } = props.data;
116
+ const dateList = top.date.list;
117
+ const times = top.xScalevalue.times;
118
+ let left = originX.value - xCellWidth.value;
119
+ function getDate(date) {
120
+ const [year = "2022", month = "01", day = "01"] = String(date).match(/\d+/g) || [];
121
+ return `20${year}`.slice(-4) + "-" + `00${month}`.slice(-2) + "-" + `00${day}`.slice(-2);
122
+ }
123
+ const timeList = dateList.map((item) => {
124
+ return times.map((v) => {
125
+ left += xCellWidth.value;
126
+ const start = new Date(`${getDate(item)} ${v.start}`).getTime();
127
+ const end = new Date(`${getDate(item)} ${v.end}`).getTime();
128
+ return {
129
+ start,
130
+ end,
131
+ left,
132
+ center: left + xCellWidth.value / 2,
133
+ scaleCell: (end - start) / xCellWidth.value
134
+ };
135
+ });
136
+ });
137
+ return timeList.flat();
138
+ });
139
+ const breatheYCell = computed(() => {
140
+ return computedYCell("breathe");
141
+ });
142
+ const pulseYCell = computed(() => {
143
+ return computedYCell("pulse");
144
+ });
145
+ const temperatureYCell = computed(() => {
146
+ return computedYCell("temperature");
147
+ });
148
+ const painYCell = computed(() => {
149
+ return computedYCell("pain");
150
+ });
151
+ const event = computed(() => {
152
+ var _a;
153
+ return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
154
+ });
155
+ const itemList = computed(() => {
156
+ const { left } = props.data;
157
+ return left.yScaleValue.map((item) => {
158
+ return item.dataList.map((v, dataIndex) => {
159
+ return {
160
+ ...v,
161
+ bigType: item.type,
162
+ unit: item.unit,
163
+ dataIndex
164
+ };
165
+ });
166
+ }).flat();
167
+ });
168
+ const painIndex = computed(() => {
169
+ const { left } = props.data;
170
+ return left.yScaleValue.findIndex((v) => v.type === "pain");
171
+ });
172
+ const painHeight = computed(() => {
173
+ const { grid } = props.data;
174
+ return painIndex.value === -1 ? 0 : yCellHeight.value * grid.subYCell;
175
+ });
176
+ const painOriginY = computed(() => {
177
+ const { left } = props.data;
178
+ let obj = {
179
+ originY: endY.value,
180
+ endY: endY.value
181
+ };
182
+ if (painIndex.value === 0 && left.yScaleValue.length > 1) {
183
+ obj.originY = originYLimit.value;
184
+ obj.endY = originYLimit.value + painHeight.value;
185
+ } else if (painIndex.value === left.yScaleValue.length - 1) {
186
+ obj.originY = endY.value - painHeight.value;
187
+ obj.endY = endY.value;
188
+ }
189
+ return obj;
190
+ });
191
+ const vitalSignsOriginY = computed(() => {
192
+ const { left } = props.data;
193
+ let obj = {
194
+ originY: originY.value,
195
+ endY: endY.value
196
+ };
197
+ if (painIndex.value === 0 && left.yScaleValue.length > 1) {
198
+ obj.originY = originYLimit.value + painHeight.value;
199
+ obj.endY = endY.value;
200
+ } else if (painIndex.value === left.yScaleValue.length - 1) {
201
+ obj.originY = originYLimit.value;
202
+ obj.endY = endY.value - painHeight.value;
203
+ }
204
+ return obj;
205
+ });
206
+ const topList = computed(() => {
207
+ const { top } = props.data;
208
+ let topList2 = [];
209
+ for (let i in top) {
210
+ if (top[i].show) {
211
+ topList2.push({
212
+ ...top[i],
213
+ key: i
214
+ });
215
+ }
216
+ }
217
+ return topList2.sort((a, b) => a.seq - b.seq);
218
+ });
219
+ const getRightInfo = computed(() => {
220
+ var _a;
221
+ const { left, right } = props.data;
222
+ const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
223
+ const yScaleValue = (right == null ? void 0 : right.yScaleValue) || {};
224
+ if ((_a = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a.length) {
225
+ Object.assign(yScaleValue, {
226
+ list: temperatureObj.list.map((v) => Math.floor((1.8 * v + 32) * 100) / 100),
227
+ spaceGridNumber: temperatureObj.spaceGridNumber
228
+ });
229
+ }
230
+ return yScaleValue;
231
+ });
232
+ const propItems = reactive({
233
+ canvasWidth: props.data.width,
234
+ canvasHeight: props.data.height,
235
+ borderStyle: props.data.borderStyle || defaultBorderStyle,
236
+ selectionStyle: props.data.selectionStyle || {},
237
+ dateHeight: dateHeight.value,
238
+ hospitalDaysHeight: hospitalDaysHeight.value,
239
+ operationDaysHeight: operationDaysHeight.value,
240
+ xScalevalueHeight: xScalevalueHeight.value,
241
+ topList: topList.value,
242
+ breathingHeight: breathingHeight.value,
243
+ hospitalizationDate: props.data.hospitalizationDate,
244
+ grid: props.data.grid,
245
+ top: props.data.top,
246
+ left: props.data.left,
247
+ right: props.data.right,
248
+ bottom: props.data.bottom,
249
+ other: props.data.other,
250
+ painIndex: painIndex.value,
251
+ painHeight: painHeight.value,
252
+ painOriginY: painOriginY.value,
253
+ vitalSignsOriginY: vitalSignsOriginY.value,
254
+ gridXNumber: gridXNumber.value,
255
+ gridYNumber: gridYNumber.value,
256
+ iconsWidth: iconsWidth.value,
257
+ originX: originX.value,
258
+ originY: originY.value,
259
+ originYLimit: originYLimit.value,
260
+ endX: endX.value,
261
+ endXLimit: endXLimit.value,
262
+ endY: endY.value,
263
+ xCellWidth: xCellWidth.value,
264
+ yCellHeight: yCellHeight.value,
265
+ xScaleList: xScaleList.value,
266
+ breatheYCell: breatheYCell.value,
267
+ pulseYCell: pulseYCell.value,
268
+ temperatureYCell: temperatureYCell.value,
269
+ painYCell: painYCell.value,
270
+ event: event.value,
271
+ itemList: itemList.value,
272
+ getRightInfo: getRightInfo.value,
273
+ config: props.data.config || {}
274
+ });
275
+ function computedYCell(type) {
276
+ const { yScaleValue } = props.data.left;
277
+ const item = yScaleValue.find((v) => v.type === type);
278
+ const list = (item == null ? void 0 : item.list) || [];
279
+ if (!list.length)
280
+ return 0;
281
+ return yCellHeight.value / ((list[1] - list[0]) / item.spaceGridNumber);
282
+ }
283
+ const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
284
+ useTop(canvas, propItems);
285
+ const { setPopup, getEqualXTypes, isAddPoint, updateData, redrawPoints, pointTipProps, pointMenuProps, clickMenu } = useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, props.addRenderItem);
286
+ const { drawScaleValue } = useLeft(
287
+ canvas,
288
+ propItems,
289
+ emits,
290
+ setPopup,
291
+ pointTipProps,
292
+ getXValue,
293
+ getYValue,
294
+ getEqualXTypes,
295
+ isAddPoint,
296
+ updateData
297
+ );
298
+ useRight(canvas, propItems, drawScaleValue);
299
+ useBottom(canvas, propItems);
300
+ useOther(canvas, propItems, cumputedX);
301
+ onMounted(() => {
302
+ canvas.value = new fabric.Canvas(canvasRef.value, {
303
+ width: propItems.canvasWidth,
304
+ height: propItems.canvasHeight,
305
+ backgroundColor: "#fff",
306
+ selection: false,
307
+ containerClass: "c-fabric-chart",
308
+ fireRightClick: true
309
+ });
310
+ useEvent(canvasRef.value);
311
+ const { select: selectFunc } = useCanvasEvent(canvas, propItems, emits);
312
+ select.value = selectFunc;
313
+ });
314
+ onBeforeUnmount(() => {
315
+ canvas.value.clear();
316
+ canvas.value = null;
317
+ });
318
+ expose({
319
+ redrawPoints,
320
+ select,
321
+ canvas
322
+ });
323
+ return (_ctx, _cache) => {
324
+ return openBlock(), createElementBlock(Fragment, null, [
325
+ createElementVNode("canvas", {
326
+ ref_key: "canvasRef",
327
+ ref: canvasRef
328
+ }, null, 512),
329
+ unref(canvas) && unref(pointTipProps) ? (openBlock(), createBlock(PopupTip, mergeProps({
330
+ key: 0,
331
+ propItems
332
+ }, unref(pointTipProps)), null, 16, ["propItems"])) : createCommentVNode("v-if", true),
333
+ unref(canvas) && unref(pointTipProps) ? (openBlock(), createBlock(unref(PopupMenu), mergeProps({
334
+ key: 1,
335
+ propItems
336
+ }, unref(pointMenuProps), {
337
+ show: unref(pointMenuProps).show,
338
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => unref(pointMenuProps).show = $event),
339
+ onClickMenu: unref(clickMenu)
340
+ }), null, 16, ["propItems", "show", "onClickMenu"])) : createCommentVNode("v-if", true)
341
+ ], 64);
342
+ };
343
+ }
344
+ });
345
+ var TemperatureChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "TemperatureChart.vue"]]);
346
+
347
+ export { TemperatureChart as default };
@@ -0,0 +1,4 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { fabric } from '../utils';
3
+ export declare const InjectionCanvas: InjectionKey<Ref<fabric.Canvas>>;
4
+ export declare const InjectionCanvasRef: InjectionKey<Ref<any | null>>;
@@ -0,0 +1,4 @@
1
+ const InjectionCanvas = Symbol("canvas");
2
+ const InjectionCanvasRef = Symbol();
3
+
4
+ export { InjectionCanvas, InjectionCanvasRef };
@@ -2,3 +2,4 @@ import { Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { IPropItems } from '../interface';
4
4
  export default function useGrid(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
5
+ export declare function useBirthProcessGrid(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
@@ -45,5 +45,31 @@ function useGrid(canvas, propItems) {
45
45
  });
46
46
  });
47
47
  }
48
+ function useBirthProcessGrid(canvas, propItems) {
49
+ var _a, _b;
50
+ const { gridYNumber, originY, grid, originX, endX, xCellWidth, yCellHeight, gridXNumber, endY } = propItems;
51
+ const yList = [];
52
+ const xList = [];
53
+ for (let i = 0; i <= gridYNumber; i++) {
54
+ const y = originY + parseInt(String(yCellHeight * (gridYNumber - i)));
55
+ const line = drawLine([originX, y, endX, y], { ...defaultBorderStyle, ...((_a = grid.mainLineStyle) == null ? void 0 : _a.x) || {} });
56
+ yList.push(line);
57
+ }
58
+ for (let i = 0; i <= gridXNumber; i++) {
59
+ const x = originX + parseInt(String(xCellWidth * i));
60
+ const line = drawLine([x, originY, x, endY], { ...defaultBorderStyle, ...((_b = grid.mainLineStyle) == null ? void 0 : _b.y) || {} });
61
+ xList.push(line);
62
+ }
63
+ const group = new fabric.Group([...xList, ...yList], {
64
+ evented: false,
65
+ selectable: false
66
+ });
67
+ onMounted(() => {
68
+ nextTick(() => {
69
+ canvas.value.add(group);
70
+ canvas.value.sendToBack(group);
71
+ });
72
+ });
73
+ }
48
74
 
49
- export { useGrid as default };
75
+ export { useGrid as default, useBirthProcessGrid };
@@ -1,6 +1,6 @@
1
- import { InjectionKey, Ref } from 'vue';
2
1
  import { fabric } from './utils';
3
2
  import { AnyObject } from '../../../../es/shared/types';
3
+ export declare type IMode = 'temperature' | 'birthProcess' | undefined;
4
4
  interface IEvent {
5
5
  selectable: boolean;
6
6
  evented: boolean;
@@ -107,15 +107,15 @@ export interface IData {
107
107
  width: number;
108
108
  height: number;
109
109
  borderStyle?: fabric.ILineOptions;
110
- selectionStyle?: any;
110
+ selectionStyle?: AnyObject;
111
111
  hospitalizationDate: string;
112
112
  grid: IGrid;
113
113
  other?: IOther;
114
114
  top: ITop;
115
115
  left: ILeft;
116
116
  right?: IRight;
117
- bottom: any;
118
- config?: any;
117
+ bottom: AnyObject;
118
+ config?: AnyObject;
119
119
  }
120
120
  export interface ICoordinateValue {
121
121
  x: number;
@@ -128,6 +128,23 @@ export interface ILineOptions extends fabric.ILineOptions {
128
128
  export interface ITextOptions extends fabric.ITextOptions {
129
129
  [key: string]: any;
130
130
  }
131
- export declare const InjectionCanvas: InjectionKey<Ref<fabric.Canvas>>;
132
- export declare const InjectionPropItems: InjectionKey<IPropItems>;
131
+ interface IBirthProcessOther {
132
+ fetalPresentationPositionLine?: fabric.ILineOptions;
133
+ alertLine?: fabric.ILineOptions;
134
+ processLine?: fabric.ILineOptions;
135
+ }
136
+ interface IBirthProcessXAxis {
137
+ time: AnyObject;
138
+ processTime: AnyObject;
139
+ }
140
+ export interface IBirthProcessData {
141
+ width: number;
142
+ height: number;
143
+ borderStyle?: fabric.ILineOptions;
144
+ selectionStyle?: AnyObject;
145
+ grid: AnyObject;
146
+ other?: IBirthProcessOther;
147
+ xAxis: IBirthProcessXAxis;
148
+ scaleValues: AnyObject[];
149
+ }
133
150
  export {};
@@ -1,4 +1 @@
1
- const InjectionCanvas = Symbol("canvas");
2
- const InjectionPropItems = Symbol("propItems");
3
1
 
4
- export { InjectionCanvas, InjectionPropItems };