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

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.
@@ -60,6 +60,5 @@ export declare const OVERLAP: {
60
60
  };
61
61
  export declare enum ECG {
62
62
  SMALLCELLNUMBER = 5,
63
- MAXLINENUMBER = 13,
64
63
  DEFAULTMAINXCELLVALUE = 0.2
65
64
  }
@@ -82,7 +82,6 @@ const OVERLAP = {
82
82
  };
83
83
  var ECG = /* @__PURE__ */ ((ECG2) => {
84
84
  ECG2[ECG2["SMALLCELLNUMBER"] = 5] = "SMALLCELLNUMBER";
85
- ECG2[ECG2["MAXLINENUMBER"] = 13] = "MAXLINENUMBER";
86
85
  ECG2[ECG2["DEFAULTMAINXCELLVALUE"] = 0.2] = "DEFAULTMAINXCELLVALUE";
87
86
  return ECG2;
88
87
  })(ECG || {});
@@ -36,7 +36,8 @@ function useElectrocardiogram(canvas, propItems, flag) {
36
36
  titleStyle,
37
37
  titleOffset,
38
38
  config,
39
- calibrationLineHeight
39
+ calibrationLineHeight,
40
+ maxLineNumber
40
41
  } = propItems;
41
42
  const gridPoints = /* @__PURE__ */ new Set();
42
43
  const fixedPointsCache = /* @__PURE__ */ new Set();
@@ -66,17 +67,17 @@ function useElectrocardiogram(canvas, propItems, flag) {
66
67
  function drawPolyLine(startIdx = 0) {
67
68
  const overflowIsScroll = config.overflow === "scroll";
68
69
  dataList.forEach((lineItem, idx) => {
69
- if (idx === ECG.MAXLINENUMBER - 1 && arguments.length && !overflowIsScroll)
70
+ if (idx === maxLineNumber - 1 && arguments.length && !overflowIsScroll)
70
71
  return;
71
72
  const { x, y, rowIdx, limitX } = lineItem.origin;
72
73
  const lineLength = lineItem.data.length;
73
- const showLength = idx < ECG.MAXLINENUMBER - 1 ? getShowLength(lineItem.data) : lineLength;
74
+ const showLength = idx < maxLineNumber - 1 ? getShowLength(lineItem.data) : lineLength;
74
75
  const points = [];
75
76
  let pointIndex = 0;
76
77
  for (let _idx = startIdx; _idx <= startIdx + showLength && _idx < lineLength; _idx++) {
77
78
  const value = lineItem.data[_idx];
78
79
  const point = { x: computedX(pointIndex + 1), y: computedY(-+value) + y };
79
- if (idx < ECG.MAXLINENUMBER - 1 && point.x > limitX) {
80
+ if (idx < maxLineNumber - 1 && point.x > limitX) {
80
81
  break;
81
82
  }
82
83
  points.push(point);
@@ -107,7 +108,7 @@ function useElectrocardiogram(canvas, propItems, flag) {
107
108
  detailRadius: 370,
108
109
  beforeEvent: () => flag.value && Promise.reject()
109
110
  });
110
- if (idx < ECG.MAXLINENUMBER - 1 || overflowIsScroll) {
111
+ if (idx < maxLineNumber - 1 || overflowIsScroll) {
111
112
  gridPoints.add(polyline);
112
113
  } else {
113
114
  fixedPointsCache.add(polyline);
@@ -33,6 +33,7 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
33
33
  const list = cloneDeep(dataList);
34
34
  const matchItem = list.find((item) => config.lastDataKey && item.key === config.lastDataKey);
35
35
  const __dataList = matchItem ? [...list, matchItem] : list;
36
+ const maxLineNumber = list.length + 1;
36
37
  const { grid } = props.data;
37
38
  const totalLength = (_c = (_b = (_a = last(__dataList)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
38
39
  const totalSeconds = totalLength / config.hz;
@@ -47,9 +48,9 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
47
48
  const xCellWidth = (endX - originX) / gridXNumber;
48
49
  const yCellHeight = (endY - originY) / gridYNumber;
49
50
  const event = ((_e = props.data.grid) == null ? void 0 : _e.event) || { selectable: true, evented: true };
50
- const { mode = "2-6" } = props.data;
51
- const [columnNumber, rowNumber] = mode.split("-").map((n) => +n);
52
- const rowSpace = Math.round(gridYNumber / (rowNumber + (totalLineLength === ECG.MAXLINENUMBER ? 1 : 0)));
51
+ const columnNumber = +(props.data.columnNumber || 2);
52
+ const rowNumber = Math.ceil(list.length / columnNumber);
53
+ const rowSpace = ~~(gridYNumber / (rowNumber + (totalLineLength === maxLineNumber ? 1 : 0)));
53
54
  const columnWidth = props.data.width / columnNumber;
54
55
  const baseYCellNumber = Math.ceil(rowSpace / 2);
55
56
  function getFirstRowLineMaxHeight() {
@@ -60,10 +61,10 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
60
61
  if (columnNumber !== 2) {
61
62
  return data1MaxHeight;
62
63
  }
63
- const data7 = __dataList[6].data;
64
- const data7Max = Math.max(...data7);
65
- const data7MaxHeight = computedY(data7Max);
66
- return Math.max(data1MaxHeight, data7MaxHeight);
64
+ const halfIndexData = __dataList[rowNumber].data;
65
+ const halfIndexDataMax = Math.max(...halfIndexData);
66
+ const halfIndexDataMaxHeight = computedY(halfIndexDataMax);
67
+ return Math.max(data1MaxHeight, halfIndexDataMaxHeight);
67
68
  function computedY(value) {
68
69
  const currentMV = valueUnit === "uv" ? value * 1e-3 : valueUnit === "v" ? value * 1e3 : value;
69
70
  return currentMV / mainYCellValue2 * yCellHeight;
@@ -74,8 +75,9 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
74
75
  const baseY = columnNumber === 1 || _baseY < firstRowLineMaxHeight ? yCellHeight * Math.ceil(firstRowLineMaxHeight / yCellHeight) : _baseY;
75
76
  const baseX = xCellWidth;
76
77
  const derivedDataList = __dataList.map((item, idx) => {
77
- const itemRowIdx = ECG.MAXLINENUMBER === totalLineLength && idx === totalLineLength - 1 ? rowNumber : idx % rowNumber;
78
- const itemColumnIdx = ECG.MAXLINENUMBER === totalLineLength && idx === totalLineLength - 1 ? 0 : Math.floor(idx / rowNumber);
78
+ const isLastLine = maxLineNumber === totalLineLength && idx === totalLineLength - 1;
79
+ const itemRowIdx = isLastLine ? rowNumber : idx % rowNumber;
80
+ const itemColumnIdx = isLastLine ? 0 : ~~(idx / rowNumber);
79
81
  return {
80
82
  ...item,
81
83
  origin: {
@@ -111,7 +113,8 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
111
113
  columnNumber,
112
114
  rowNumber,
113
115
  config: props.data.config,
114
- calibrationLineHeight
116
+ calibrationLineHeight,
117
+ maxLineNumber
115
118
  };
116
119
  }
117
120
  const propItems = reactive(buildDerived());
@@ -85,7 +85,7 @@ function useColumnConfigAdaptor() {
85
85
  return;
86
86
  }
87
87
  result.formType = (_a = htmlTypeValueMap.get(value)) != null ? _a : value;
88
- const multiple = value === "SEARCH" ? false : value === "SEARCH_MORE" ? true : value === "SELECT" ? fieldItem.multi_select === "0" : null;
88
+ const multiple = value === "SEARCH" ? false : ["SEARCH_MORE", "CHECKBOX", "CHECKBOX_BLOCK"].includes(value) ? true : value === "SELECT" ? fieldItem.multi_select === "0" : null;
89
89
  if (multiple) {
90
90
  result.componentProps = {
91
91
  multiple,
@@ -1,5 +1,5 @@
1
1
  var name = "@cnhis-design-vue/shared";
2
- var version = "3.4.0-beta.58";
2
+ var version = "3.4.0-beta.60";
3
3
  var main = "index.ts";
4
4
  var peerDependencies = {
5
5
  "naive-ui": "^2.30.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.4.0-beta.58",
3
+ "version": "3.4.0-beta.60",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -73,5 +73,5 @@
73
73
  "iOS 7",
74
74
  "last 3 iOS versions"
75
75
  ],
76
- "gitHead": "e1fd269cd0c3d98a766885c3abe074ec04c136d0"
76
+ "gitHead": "8bd05157ab043e7ef037ee69e52191ef2c335bf3"
77
77
  }