cnhis-design-vue 3.4.0-beta.55 → 3.4.0-beta.58

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.
@@ -1,4 +1,4 @@
1
- import { reactive, computed, watch, toRefs } from 'vue';
1
+ import { reactive, watch, toRefs } from 'vue';
2
2
  import { defaultBorderStyle } from '../useDraw.js';
3
3
  import '../../../../../shared/utils/fabricjs/index.js';
4
4
  import { useCumputedPoint } from '../useCumputedPoint.js';
@@ -28,284 +28,206 @@ function useTemperatureChart(canvas, props, emits, canvasRef, pointTipProps, poi
28
28
  redrawPoints: null,
29
29
  clickMenu: null
30
30
  });
31
- const painSurplusCell = computed(() => {
32
- const { painSurplusCell: painSurplusCell2 = [0, 0] } = props.data.grid || {};
33
- if (!~painIndex.value)
34
- return [0, 0];
35
- return painSurplusCell2;
36
- });
37
- const surplusCell = computed(() => {
38
- var _a, _b;
39
- const surplusCell2 = ((_b = (_a = props.data.grid) == null ? void 0 : _a.surplusCell) == null ? void 0 : _b.slice()) || [0, 0, 0, 0];
40
- if (painIndex.value === 0) {
41
- surplusCell2[0] = surplusCell2[0] + painSurplusCell.value[1];
42
- } else if (painIndex.value > 0) {
43
- surplusCell2[2] = surplusCell2[2] + painSurplusCell.value[0];
44
- }
45
- return surplusCell2;
46
- });
47
- const mainSurplusCell = computed(() => {
48
- if (painIndex.value === 0) {
49
- return [painSurplusCell.value[0], surplusCell.value[1], surplusCell.value[2], surplusCell.value[3]];
50
- } else if (painIndex.value > 0) {
51
- return [surplusCell.value[0], surplusCell.value[1], painSurplusCell.value[1], surplusCell.value[3]];
52
- }
53
- return surplusCell.value;
54
- });
55
- const dateHeight = computed(() => {
56
- const { top } = props.data;
57
- return top.date.show && (top.date.height || defaultHeight) || 0;
58
- });
59
- const hospitalDaysHeight = computed(() => {
60
- var _a;
61
- const { top } = props.data;
62
- return ((_a = top.hospitalDays) == null ? void 0 : _a.show) && (top.hospitalDays.height || defaultHeight) || 0;
63
- });
64
- const operationDaysHeight = computed(() => {
65
- var _a;
66
- const { top } = props.data;
67
- return ((_a = top.operationDays) == null ? void 0 : _a.show) && (top.operationDays.height || defaultHeight) || 0;
68
- });
69
- const xScalevalueHeight = computed(() => {
70
- var _a, _b, _c;
71
- const { top } = props.data;
72
- const height = ((_a = top.xScalevalue) == null ? void 0 : _a.show) && (top.xScalevalue.height || defaultHeight) || 0;
73
- const dayHeight = ((_b = top.xScalevalue) == null ? void 0 : _b.show) ? (_c = top.dayHeight) != null ? _c : 0 : 0;
74
- return height + dayHeight;
75
- });
76
- const childbirthDaysHeight = computed(() => {
77
- var _a;
78
- const { top } = props.data;
79
- return ((_a = top.childbirthDays) == null ? void 0 : _a.show) && (top.childbirthDays.height || defaultHeight) || 0;
80
- });
81
- const breathingHeight = computed(() => {
82
- var _a;
83
- const { bottom } = props.data;
84
- return ((_a = bottom == null ? void 0 : bottom.breathing) == null ? void 0 : _a.show) && (bottom.breathing.height || defaultHeight * 2) || 0;
85
- });
86
- const gridXNumber = computed(() => {
87
- const { grid } = props.data;
88
- return grid.mainXCell * grid.subXCell + surplusCell.value[1] + surplusCell.value[3];
89
- });
90
- const gridYNumber = computed(() => {
91
- const { mainYCell, subYCell, painSubYCell = 5 } = props.data.grid;
92
- const painSurplusCellNumber = painIndex.value > 0 ? painSurplusCell.value[1] : painSurplusCell.value[0];
93
- return (mainYCell - 1) * subYCell + painSubYCell + surplusCell.value[0] + surplusCell.value[2] + painSurplusCellNumber;
94
- });
95
- const endX = computed(() => {
96
- var _a;
97
- const { width, right = null, top } = props.data;
98
- if (!right)
99
- return width;
100
- const endWidth = (_a = right.width) != null ? _a : 0;
101
- return width - endWidth;
102
- });
103
- const endXLimit = computed(() => {
104
- return endX.value - surplusCell.value[1] * xCellWidth.value;
105
- });
106
- const originX = computed(() => {
107
- const { top, left } = props.data;
108
- const originX2 = top.titleWidth + iconsWidth.value;
109
- return originX2;
110
- });
111
- const endY = computed(() => {
112
- const { bottom = null, height } = props.data;
113
- if (!bottom)
114
- return height;
115
- const endHeight = bottom.height || 30;
116
- return height - endHeight;
117
- });
118
- const originY = computed(() => {
119
- var _a;
120
- const { top } = props.data;
121
- const dayHeight = top.xScalevalue.show && ((_a = top.dayHeight) != null ? _a : 0) || 0;
122
- const xScaleHeight = top.xScalevalue.show && (top.xScalevalue.height || defaultHeight) || 0;
123
- const topHeight = dateHeight.value + dayHeight + xScaleHeight + hospitalDaysHeight.value + operationDaysHeight.value + childbirthDaysHeight.value;
124
- return topHeight;
125
- });
126
- const xCellWidth = computed(() => {
127
- return (endX.value - originX.value) / gridXNumber.value;
128
- });
129
- const yCellHeight = computed(() => {
130
- return (endY.value - originY.value) / gridYNumber.value;
131
- });
132
- const iconsWidth = computed(() => {
133
- var _a, _b;
134
- const { left } = props.data;
135
- return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
136
- });
137
- const xScaleList = computed(() => {
138
- var _a, _b;
139
- const { top, grid } = props.data;
140
- const dateList = ((_b = (_a = top.date.list) == null ? void 0 : _a.slice) == null ? void 0 : _b.call(_a, 0, grid.mainXCell)) || [];
141
- const times = top.xScalevalue.times;
142
- let left = originX.value - xCellWidth.value;
143
- const startDate = top.date.startDate || format(new Date(), "yyyy-MM-dd");
144
- const newDateList = dateList.reduce(
145
- (arr, item, index) => index === 0 ? arr.concat(startDate) : arr.concat(format(addDays(new Date(startDate.replace(/-/g, "/")), index), "yyyy-MM-dd")),
146
- []
147
- );
148
- const timeList = newDateList.map((item) => {
149
- return times.map((v) => {
150
- left += xCellWidth.value;
151
- const start = Date.parse(`${item} ${v.start}`);
152
- const end = Date.parse(`${item} ${v.end}`);
153
- return {
154
- start,
155
- end,
156
- left,
157
- center: left + xCellWidth.value / 2,
158
- scaleCell: (end - start) / xCellWidth.value
159
- };
160
- });
161
- });
162
- return flatten(timeList);
163
- });
164
- const event = computed(() => {
165
- var _a;
166
- return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
167
- });
168
- const itemList = computed(() => {
169
- const { left } = props.data;
170
- return flatten(
171
- left.yScaleValue.filter((v) => v.show).map((item) => {
172
- return item.dataList.filter((v) => v.show).map((v, dataIndex) => {
31
+ function buildDerived() {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
33
+ const { grid, top, left, right, bottom } = props.data;
34
+ const iconsWidth = ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
35
+ const dateHeight = top.date.show && (top.date.height || defaultHeight) || 0;
36
+ const hospitalDaysHeight = ((_c = top.hospitalDays) == null ? void 0 : _c.show) && (top.hospitalDays.height || defaultHeight) || 0;
37
+ const operationDaysHeight = ((_d = top.operationDays) == null ? void 0 : _d.show) && (top.operationDays.height || defaultHeight) || 0;
38
+ const xScaleHeight = ((_e = top.xScalevalue) == null ? void 0 : _e.show) && (top.xScalevalue.height || defaultHeight) || 0;
39
+ const dayHeight = ((_f = top.xScalevalue) == null ? void 0 : _f.show) ? (_g = top.dayHeight) != null ? _g : 0 : 0;
40
+ const xScalevalueHeight = xScaleHeight + dayHeight;
41
+ const childbirthDaysHeight = ((_h = top.childbirthDays) == null ? void 0 : _h.show) && (top.childbirthDays.height || defaultHeight) || 0;
42
+ const breathingHeight = ((_i = bottom == null ? void 0 : bottom.breathing) == null ? void 0 : _i.show) && (bottom.breathing.height || defaultHeight * 2) || 0;
43
+ const painIndex = (() => {
44
+ const index = left.yScaleValue.findIndex((v) => v.type === "pain");
45
+ return index > -1 && left.yScaleValue[index].show ? index : -1;
46
+ })();
47
+ const painSurplusCell = (() => {
48
+ const { painSurplusCell: painSurplusCell2 = [0, 0] } = grid || {};
49
+ if (!~painIndex)
50
+ return [0, 0];
51
+ return painSurplusCell2;
52
+ })();
53
+ const surplusCell = (() => {
54
+ var _a2;
55
+ const sc = ((_a2 = grid == null ? void 0 : grid.surplusCell) == null ? void 0 : _a2.slice()) || [0, 0, 0, 0];
56
+ if (painIndex === 0) {
57
+ sc[0] = sc[0] + painSurplusCell[1];
58
+ } else if (painIndex > 0) {
59
+ sc[2] = sc[2] + painSurplusCell[0];
60
+ }
61
+ return sc;
62
+ })();
63
+ const mainSurplusCell = (() => {
64
+ if (painIndex === 0) {
65
+ return [painSurplusCell[0], surplusCell[1], surplusCell[2], surplusCell[3]];
66
+ } else if (painIndex > 0) {
67
+ return [surplusCell[0], surplusCell[1], painSurplusCell[1], surplusCell[3]];
68
+ }
69
+ return surplusCell;
70
+ })();
71
+ const originX = top.titleWidth + iconsWidth;
72
+ const endX = !right ? props.data.width : props.data.width - ((_j = right.width) != null ? _j : 0);
73
+ const endXLimit = endX - surplusCell[1] * ((endX - originX) / (grid.mainXCell * grid.subXCell + surplusCell[1] + surplusCell[3]));
74
+ const endY = !bottom ? props.data.height : props.data.height - (bottom.height || 30);
75
+ const originY = dateHeight + dayHeight + xScaleHeight + hospitalDaysHeight + operationDaysHeight + childbirthDaysHeight;
76
+ const gridXNumber = grid.mainXCell * grid.subXCell + surplusCell[1] + surplusCell[3];
77
+ const { mainYCell, subYCell, painSubYCell = 5 } = grid;
78
+ const painSurplusCellNumber = painIndex > 0 ? painSurplusCell[1] : painSurplusCell[0];
79
+ const gridYNumber = (mainYCell - 1) * subYCell + painSubYCell + surplusCell[0] + surplusCell[2] + painSurplusCellNumber;
80
+ const xCellWidth = (endX - originX) / gridXNumber;
81
+ const yCellHeight = (endY - originY) / gridYNumber;
82
+ const xScaleList = (() => {
83
+ var _a2, _b2;
84
+ const dateList = ((_b2 = (_a2 = top.date.list) == null ? void 0 : _a2.slice) == null ? void 0 : _b2.call(_a2, 0, grid.mainXCell)) || [];
85
+ const times = top.xScalevalue.times;
86
+ let leftPos = originX - xCellWidth;
87
+ const startDate = top.date.startDate || format(new Date(), "yyyy-MM-dd");
88
+ const newDateList = dateList.reduce(
89
+ (arr, _item, index) => index === 0 ? arr.concat(startDate) : arr.concat(format(addDays(new Date(startDate.replace(/-/g, "/")), index), "yyyy-MM-dd")),
90
+ []
91
+ );
92
+ const timeList = newDateList.map((item) => {
93
+ return times.map((v) => {
94
+ leftPos += xCellWidth;
95
+ const start = Date.parse(`${item} ${v.start}`);
96
+ const end = Date.parse(`${item} ${v.end}`);
173
97
  return {
174
- ...v,
175
- bigType: setOtherType(v.key, item.type),
176
- unit: item.unit,
177
- dataIndex,
178
- isOneLine: isOneLine(item)
98
+ start,
99
+ end,
100
+ left: leftPos,
101
+ center: leftPos + xCellWidth / 2,
102
+ scaleCell: (end - start) / xCellWidth
179
103
  };
180
104
  });
181
- })
105
+ });
106
+ return flatten(timeList);
107
+ })();
108
+ const event = ((_k = props.data.grid) == null ? void 0 : _k.event) || { selectable: true, evented: true, hovered: true };
109
+ const itemList = flatten(
110
+ left.yScaleValue.filter((v) => v.show).map(
111
+ (item) => item.dataList.filter((v) => v.show).map((v, dataIndex) => ({
112
+ ...v,
113
+ bigType: setOtherType(v.key, item.type),
114
+ unit: item.unit,
115
+ dataIndex,
116
+ isOneLine: isOneLine(item)
117
+ }))
118
+ )
182
119
  );
183
- });
184
- const painScalePositionSurplusHeight = computed(() => {
185
- const { left } = props.data;
186
120
  const painItem = left.yScaleValue.find((v) => v.type === "pain");
187
- if (!painItem)
188
- return 0;
189
- const { numberVerticalPosition = "bottom", spaceGridNumber = 1 } = painItem;
190
- return numberVerticalPosition === "center" ? yCellHeight.value * spaceGridNumber / 2 : 0;
191
- });
192
- const painIndex = computed(() => {
193
- const { left } = props.data;
194
- const index = left.yScaleValue.findIndex((v) => v.type === "pain");
195
- return index > -1 && left.yScaleValue[index].show ? index : -1;
196
- });
197
- const painHeight = computed(() => {
198
- const { painSubYCell = 5 } = props.data.grid;
199
- return painIndex.value === -1 ? 0 : yCellHeight.value * painSubYCell;
200
- });
201
- const painBorderColor = computed(() => {
202
- const { left } = props.data;
203
- return (left.yScaleValue.find((v) => v.type === "pain") || {}).borderColor;
204
- });
205
- const painOriginY = computed(() => {
206
- const { left } = props.data;
207
- const obj = {
208
- originY: originY.value + painSurplusCell.value[0] * yCellHeight.value,
209
- endY: endY.value - painSurplusCell.value[1] * yCellHeight.value - painScalePositionSurplusHeight.value
210
- };
211
- if (painIndex.value === 0 && left.yScaleValue.length > 1) {
212
- obj.endY = obj.originY + painHeight.value - painScalePositionSurplusHeight.value;
213
- } else if (painIndex.value === left.yScaleValue.length - 1) {
214
- obj.originY = obj.endY - painHeight.value + painScalePositionSurplusHeight.value;
215
- }
216
- return obj;
217
- });
218
- const vitalSignsOriginY = computed(() => {
219
- const { left } = props.data;
220
- const obj = {
221
- originY: originY.value + surplusCell.value[0] * yCellHeight.value,
222
- endY: endY.value - surplusCell.value[2] * yCellHeight.value
223
- };
224
- if (painIndex.value === 0 && left.yScaleValue.length > 1) {
225
- obj.originY = painOriginY.value.endY + painScalePositionSurplusHeight.value + surplusCell.value[0] * yCellHeight.value;
226
- } else if (painIndex.value === left.yScaleValue.length - 1) {
227
- obj.endY = painOriginY.value.originY - surplusCell.value[2] * yCellHeight.value;
228
- }
229
- return obj;
230
- });
231
- const topList = computed(() => {
232
- var _a, _b;
233
- const { top, grid } = props.data;
234
- const topList2 = [];
235
- for (const i in top) {
236
- if (top[i].show) {
237
- topList2.push({
238
- ...top[i],
239
- list: ((_b = (_a = top[i].list) == null ? void 0 : _a.slice) == null ? void 0 : _b.call(_a, 0, grid.mainXCell)) || [],
240
- key: i
121
+ const painScalePositionSurplusHeight = (() => {
122
+ if (!painItem)
123
+ return 0;
124
+ const { numberVerticalPosition = "bottom", spaceGridNumber = 1 } = painItem;
125
+ return numberVerticalPosition === "center" ? yCellHeight * spaceGridNumber / 2 : 0;
126
+ })();
127
+ const painHeight = painIndex === -1 ? 0 : yCellHeight * ((_l = grid.painSubYCell) != null ? _l : 5);
128
+ const painBorderColor = (painItem || {}).borderColor;
129
+ const painOriginY = (() => {
130
+ const obj = {
131
+ originY: originY + painSurplusCell[0] * yCellHeight,
132
+ endY: endY - painSurplusCell[1] * yCellHeight - painScalePositionSurplusHeight
133
+ };
134
+ if (painIndex === 0 && left.yScaleValue.length > 1) {
135
+ obj.endY = obj.originY + painHeight - painScalePositionSurplusHeight;
136
+ } else if (painIndex === left.yScaleValue.length - 1) {
137
+ obj.originY = obj.endY - painHeight + painScalePositionSurplusHeight;
138
+ }
139
+ return obj;
140
+ })();
141
+ const vitalSignsOriginY = (() => {
142
+ const obj = {
143
+ originY: originY + surplusCell[0] * yCellHeight,
144
+ endY: endY - surplusCell[2] * yCellHeight
145
+ };
146
+ if (painIndex === 0 && left.yScaleValue.length > 1) {
147
+ obj.originY = painOriginY.endY + painScalePositionSurplusHeight + surplusCell[0] * yCellHeight;
148
+ } else if (painIndex === left.yScaleValue.length - 1) {
149
+ obj.endY = painOriginY.originY - surplusCell[2] * yCellHeight;
150
+ }
151
+ return obj;
152
+ })();
153
+ const topList = (() => {
154
+ var _a2, _b2;
155
+ const list = [];
156
+ for (const i in top) {
157
+ if (top[i].show) {
158
+ list.push({
159
+ ...top[i],
160
+ list: ((_b2 = (_a2 = top[i].list) == null ? void 0 : _a2.slice) == null ? void 0 : _b2.call(_a2, 0, grid.mainXCell)) || [],
161
+ key: i
162
+ });
163
+ }
164
+ }
165
+ return list.sort((a, b) => a.seq - b.seq);
166
+ })();
167
+ const getRightInfo = (() => {
168
+ var _a2;
169
+ const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
170
+ const yScaleValue = (right == null ? void 0 : right.yScaleValue) ? { ...right.yScaleValue } : {};
171
+ if ((_a2 = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a2.length) {
172
+ const detailedList = (yScaleValue == null ? void 0 : yScaleValue.showdetailedScale) ? temperatureObj.list.reduce((res) => {
173
+ const lastItem = res[res.length - 1];
174
+ return lastItem ? res.concat([lastItem + 1, lastItem + 2]) : res.concat([92]);
175
+ }, []) : [];
176
+ const list = temperatureObj.list.map((v) => getFloorNumber(1.8 * v + 32));
177
+ Object.assign(yScaleValue, {
178
+ list,
179
+ detailedList,
180
+ spaceGridNumber: temperatureObj.spaceGridNumber
241
181
  });
242
182
  }
243
- }
244
- return topList2.sort((a, b) => a.seq - b.seq);
245
- });
246
- const getRightInfo = computed(() => {
247
- var _a;
248
- const { left, right } = props.data;
249
- const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
250
- const yScaleValue = (right == null ? void 0 : right.yScaleValue) || {};
251
- if ((_a = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a.length) {
252
- const detailedList = (yScaleValue == null ? void 0 : yScaleValue.showdetailedScale) ? temperatureObj.list.reduce((res) => {
253
- const lastItem = res[res.length - 1];
254
- return lastItem ? res.concat([lastItem + 1, lastItem + 2]) : res.concat([92]);
255
- }, []) : [];
256
- const list = temperatureObj.list.map((v) => getFloorNumber(1.8 * v + 32));
257
- Object.assign(yScaleValue, {
258
- list,
259
- detailedList,
260
- spaceGridNumber: temperatureObj.spaceGridNumber
261
- });
262
- }
263
- return yScaleValue;
264
- });
265
- const propItems = reactive({
266
- canvasWidth: props.data.width,
267
- canvasHeight: props.data.height,
268
- borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle || {} },
269
- selectionStyle: props.data.selectionStyle || {},
270
- dateHeight: dateHeight.value,
271
- hospitalDaysHeight: hospitalDaysHeight.value,
272
- operationDaysHeight: operationDaysHeight.value,
273
- xScalevalueHeight: xScalevalueHeight.value,
274
- childbirthDaysHeight: childbirthDaysHeight.value,
275
- topList: topList.value,
276
- breathingHeight: breathingHeight.value,
277
- hospitalizationDate: props.data.hospitalizationDate,
278
- grid: props.data.grid,
279
- top: props.data.top,
280
- left: props.data.left,
281
- right: props.data.right,
282
- bottom: props.data.bottom,
283
- other: props.data.other,
284
- painIndex: painIndex.value,
285
- painHeight: painHeight.value,
286
- painOriginY: painOriginY.value,
287
- vitalSignsOriginY: vitalSignsOriginY.value,
288
- gridXNumber: gridXNumber.value,
289
- gridYNumber: gridYNumber.value,
290
- iconsWidth: iconsWidth.value,
291
- originX: originX.value,
292
- originY: originY.value,
293
- endX: endX.value,
294
- endXLimit: endXLimit.value,
295
- endY: endY.value,
296
- xCellWidth: xCellWidth.value,
297
- yCellHeight: yCellHeight.value,
298
- xScaleList: xScaleList.value,
299
- event: event.value,
300
- itemList: itemList.value,
301
- getRightInfo: getRightInfo.value,
302
- config: props.data.config || {},
303
- surplusCell: surplusCell.value,
304
- painSurplusCell: painSurplusCell.value,
305
- mainSurplusCell: mainSurplusCell.value,
306
- painScalePositionSurplusHeight: painScalePositionSurplusHeight.value,
307
- painBorderColor: painBorderColor.value
308
- });
183
+ return yScaleValue;
184
+ })();
185
+ return {
186
+ canvasWidth: props.data.width,
187
+ canvasHeight: props.data.height,
188
+ borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
189
+ selectionStyle: props.data.selectionStyle || {},
190
+ dateHeight,
191
+ hospitalDaysHeight,
192
+ operationDaysHeight,
193
+ xScalevalueHeight,
194
+ childbirthDaysHeight,
195
+ topList,
196
+ breathingHeight,
197
+ hospitalizationDate: props.data.hospitalizationDate,
198
+ grid: props.data.grid,
199
+ top: props.data.top,
200
+ left: props.data.left,
201
+ right: props.data.right,
202
+ bottom: props.data.bottom,
203
+ other: props.data.other,
204
+ painIndex,
205
+ painHeight,
206
+ painOriginY,
207
+ vitalSignsOriginY,
208
+ gridXNumber,
209
+ gridYNumber,
210
+ iconsWidth,
211
+ originX,
212
+ originY,
213
+ endX,
214
+ endXLimit,
215
+ endY,
216
+ xCellWidth,
217
+ yCellHeight,
218
+ xScaleList,
219
+ event,
220
+ itemList,
221
+ getRightInfo,
222
+ config: props.data.config || {},
223
+ surplusCell,
224
+ painSurplusCell,
225
+ mainSurplusCell,
226
+ painScalePositionSurplusHeight,
227
+ painBorderColor
228
+ };
229
+ }
230
+ const propItems = reactive(buildDerived());
309
231
  const { computedX, computedY, getXValue, getYValue } = useCumputedPoint(propItems);
310
232
  watch(
311
233
  () => canvas.value,
@@ -39,6 +39,14 @@ function useNewLowCodeReactions(configListRef, formModel) {
39
39
  createFieldHandler((state, isPositive) => {
40
40
  state.disabled = isPositive;
41
41
  })
42
+ ],
43
+ [
44
+ ["setValue", "_"],
45
+ createFieldHandler((state, isPositive, { actionConfig: { value } = {} }) => {
46
+ if (!isPositive)
47
+ return;
48
+ state.value = value === null ? "null" : value === void 0 ? "undefined" : value;
49
+ })
42
50
  ]
43
51
  ]);
44
52
  const relativeFieldMap = computed(() => {
@@ -601,7 +601,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
601
601
  }, {
602
602
  default: withCtx(() => [!unref(isAudioOrVideoMessage)(item.content) ? (openBlock(), createElementBlock(Fragment, {
603
603
  key: 0
604
- }, [createCommentVNode(' <n-button\n quaternary\n size="tiny"\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\n >\n <template #icon>\n <n-icon size="17" :component="HappyOutline" />\n </template>\n </n-button> '), createVNode(unref(NButton), {
604
+ }, [createCommentVNode(' <n-button\r\n quaternary\r\n size="tiny"\r\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\r\n >\r\n <template #icon>\r\n <n-icon size="17" :component="HappyOutline" />\r\n </template>\r\n </n-button> '), createVNode(unref(NButton), {
605
605
  quaternary: "",
606
606
  size: "tiny",
607
607
  onClick: () => setReferenceMsg(item)
@@ -170,7 +170,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
170
170
  round: "",
171
171
  size: 100,
172
172
  onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
173
- }, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\n <n-upload-trigger #="{ handleClick }" abstract>\n <n-button\n circle\n secondary\n class="edit-avatar"\n v-show="userDetail.id === state.userInfo.id"\n @click="handleClick"\n >\n <template #icon>\n <n-icon size="16" color="#666666" :component="Camera" />\n </template>\n </n-button>\n </n-upload-trigger>\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
173
+ }, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\r\n <n-upload-trigger #="{ handleClick }" abstract>\r\n <n-button\r\n circle\r\n secondary\r\n class="edit-avatar"\r\n v-show="userDetail.id === state.userInfo.id"\r\n @click="handleClick"\r\n >\r\n <template #icon>\r\n <n-icon size="16" color="#666666" :component="Camera" />\r\n </template>\r\n </n-button>\r\n </n-upload-trigger>\r\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
174
174
  class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
175
175
  }, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
176
176
  strong: "",
@@ -247,7 +247,7 @@ function initData(props, emit) {
247
247
  }
248
248
  async function openSession(session) {
249
249
  try {
250
- const item = typeof session === "string" ? state.sessionList.find((_session) => _session.id === session) : session;
250
+ const item = typeof session === "string" ? state.sessionList.find((_session) => session && (_session.id, _session.sessionKey).includes(session)) : session;
251
251
  if (!item)
252
252
  return;
253
253
  if (item.status === STATUS.REMOVED) {
package/es/env.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_APP_TYPE: string;
5
- // 更多环境变量...
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }
11
-
12
- declare module '*.vue' {
13
- // @ts-ignore
14
- import type { App, defineComponent } from 'vue';
15
- // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
- // // const component: DefineComponent<{}, {}, any>
17
- const component: ReturnType<typeof defineComponent> & {
18
- install(app: App): void;
19
- };
20
- // @ts-ignore
21
- export default component;
22
- }
23
-
24
- declare module '*.js';
25
-
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TYPE: string;
5
+ // 更多环境变量...
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }
11
+
12
+ declare module '*.vue' {
13
+ // @ts-ignore
14
+ import type { App, defineComponent } from 'vue';
15
+ // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
+ // // const component: DefineComponent<{}, {}, any>
17
+ const component: ReturnType<typeof defineComponent> & {
18
+ install(app: App): void;
19
+ };
20
+ // @ts-ignore
21
+ export default component;
22
+ }
23
+
24
+ declare module '*.js';
25
+
@@ -1,5 +1,5 @@
1
1
  var name = "@cnhis-design-vue/shared";
2
- var version = "3.4.0-beta.55";
2
+ var version = "3.4.0-beta.58";
3
3
  var main = "index.ts";
4
4
  var peerDependencies = {
5
5
  "naive-ui": "^2.30.0",
@@ -88,19 +88,20 @@ export declare namespace LowCodeTypes {
88
88
  __oppositeBindField: reactionConfig;
89
89
  __oppositeTargetField: reactionConfig;
90
90
  }>;
91
- type reactionActionType = 'show' | 'hide' | 'required' | 'notRequired' | 'enabled' | 'disabled';
91
+ type reactionActionType = 'show' | 'hide' | 'required' | 'notRequired' | 'enabled' | 'disabled' | 'setValue';
92
92
  type reactionAction = {
93
93
  action: reactionActionType;
94
94
  fields: string[];
95
95
  actionConfig?: Partial<{
96
96
  restoreDefault: boolean;
97
97
  restoreEmpty: boolean;
98
+ value: unknown;
98
99
  }>;
99
100
  };
100
101
  type LowCodeConditions = {
101
102
  field: string;
102
103
  type: VALUE_RELATION;
103
- valueType?: 'const' | 'field';
104
+ valueType?: 'const' | 'field' | 'range';
104
105
  value?: any;
105
106
  };
106
107
  type newReactionConfig = {