cnhis-design-vue 3.1.21-beta.4 → 3.1.21-beta.6

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.
@@ -200,7 +200,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
200
200
  resetInlineBatchEdit: FunctionConstructor;
201
201
  resetBatchEditRowStatus: FunctionConstructor;
202
202
  anchor: {
203
- type: ArrayConstructor;
203
+ type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
204
204
  default: () => never[];
205
205
  };
206
206
  }, {
@@ -547,12 +547,15 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
547
547
  resetInlineBatchEdit: FunctionConstructor;
548
548
  resetBatchEditRowStatus: FunctionConstructor;
549
549
  anchor: {
550
- type: ArrayConstructor;
550
+ type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
551
551
  default: () => never[];
552
552
  };
553
553
  }>> & {
554
554
  [x: `on${string}`]: ((...args: any[]) => any) | undefined;
555
555
  }>>;
556
+ attr: {
557
+ [x: string]: unknown;
558
+ };
556
559
  formatData: (data?: {
557
560
  tableList: any[];
558
561
  fieldList: any[];
@@ -579,6 +582,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
579
582
  'border-color': any;
580
583
  color?: undefined;
581
584
  };
585
+ getAttr: (field: string) => any;
582
586
  imgs2imgArr: (imgs: any) => any;
583
587
  parseDurationValue: (v: any, duration: any) => string | undefined;
584
588
  parseCombinationValue: (value: any, setting: any) => any;
@@ -621,9 +625,6 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
621
625
  $event: KeyboardEvent;
622
626
  }) => void;
623
627
  scroll: (params: any) => void;
624
- attr: {
625
- [x: string]: unknown;
626
- };
627
628
  currentCheckedKeys: import("vue").ComputedRef<never[]>;
628
629
  visibleCancelCheckAllBtn: import("vue").ComputedRef<boolean>;
629
630
  singleCheckedKey: import("vue").ComputedRef<string>;
@@ -1116,13 +1117,13 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
1116
1117
  resetInlineBatchEdit: FunctionConstructor;
1117
1118
  resetBatchEditRowStatus: FunctionConstructor;
1118
1119
  anchor: {
1119
- type: ArrayConstructor;
1120
+ type: import("vue").PropType<import("../../../es/shared/types").AnyObject[]>;
1120
1121
  default: () => never[];
1121
1122
  };
1122
1123
  }>> & {
1123
1124
  [x: `on${string}`]: ((...args: any[]) => any) | undefined;
1124
1125
  }, {
1125
- anchor: unknown[];
1126
+ anchor: import("../../../es/shared/types").AnyObject[];
1126
1127
  data: unknown[];
1127
1128
  showFooter: boolean;
1128
1129
  columnConfig: Record<string, any>;
@@ -198,7 +198,7 @@ declare const _default: import("vue").DefineComponent<{
198
198
  resetInlineBatchEdit: FunctionConstructor;
199
199
  resetBatchEditRowStatus: FunctionConstructor;
200
200
  anchor: {
201
- type: ArrayConstructor;
201
+ type: import("vue").PropType<import("../../../shared/types").AnyObject[]>;
202
202
  default: () => never[];
203
203
  };
204
204
  }, {
@@ -545,12 +545,15 @@ declare const _default: import("vue").DefineComponent<{
545
545
  resetInlineBatchEdit: FunctionConstructor;
546
546
  resetBatchEditRowStatus: FunctionConstructor;
547
547
  anchor: {
548
- type: ArrayConstructor;
548
+ type: import("vue").PropType<import("../../../shared/types").AnyObject[]>;
549
549
  default: () => never[];
550
550
  };
551
551
  }>> & {
552
552
  [x: `on${string}`]: ((...args: any[]) => any) | undefined;
553
553
  }>>;
554
+ attr: {
555
+ [x: string]: unknown;
556
+ };
554
557
  formatData: (data?: {
555
558
  tableList: any[];
556
559
  fieldList: any[];
@@ -577,6 +580,7 @@ declare const _default: import("vue").DefineComponent<{
577
580
  'border-color': any;
578
581
  color?: undefined;
579
582
  };
583
+ getAttr: (field: string) => any;
580
584
  imgs2imgArr: (imgs: any) => any;
581
585
  parseDurationValue: (v: any, duration: any) => string | undefined;
582
586
  parseCombinationValue: (value: any, setting: any) => any;
@@ -619,9 +623,6 @@ declare const _default: import("vue").DefineComponent<{
619
623
  $event: KeyboardEvent;
620
624
  }) => void;
621
625
  scroll: (params: any) => void;
622
- attr: {
623
- [x: string]: unknown;
624
- };
625
626
  currentCheckedKeys: import("vue").ComputedRef<never[]>;
626
627
  visibleCancelCheckAllBtn: import("vue").ComputedRef<boolean>;
627
628
  singleCheckedKey: import("vue").ComputedRef<string>;
@@ -1114,13 +1115,13 @@ declare const _default: import("vue").DefineComponent<{
1114
1115
  resetInlineBatchEdit: FunctionConstructor;
1115
1116
  resetBatchEditRowStatus: FunctionConstructor;
1116
1117
  anchor: {
1117
- type: ArrayConstructor;
1118
+ type: import("vue").PropType<import("../../../shared/types").AnyObject[]>;
1118
1119
  default: () => never[];
1119
1120
  };
1120
1121
  }>> & {
1121
1122
  [x: `on${string}`]: ((...args: any[]) => any) | undefined;
1122
1123
  }, {
1123
- anchor: unknown[];
1124
+ anchor: import("../../../shared/types").AnyObject[];
1124
1125
  data: unknown[];
1125
1126
  showFooter: boolean;
1126
1127
  columnConfig: Record<string, any>;
@@ -57,11 +57,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
57
57
  const xGrid = ref({});
58
58
  const copyState = XEUtils.clone(bigTableState, true);
59
59
  const state = reactive(copyState);
60
+ const attr = useAttrs();
60
61
  const {
61
62
  formatData,
62
63
  htmlToText,
63
- getBtnStyle
64
- } = useFormat(state);
64
+ getBtnStyle,
65
+ getAttr
66
+ } = useFormat(state, attr);
65
67
  const {
66
68
  imgs2imgArr,
67
69
  parseDurationValue,
@@ -104,7 +106,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
104
106
  keyDown,
105
107
  scroll
106
108
  } = useEvent(props, state, emit, xGrid, anchorEvent);
107
- const attr = useAttrs();
108
109
  const currentCheckedKeys = computed(() => {
109
110
  var _a;
110
111
  return ((_a = state.checkedRows) == null ? void 0 : _a.map((row) => row[props.primaryKey])) || [];
@@ -2334,20 +2335,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2334
2335
  "cell-class-name": _ctx.columnConfig.cellClassName || null,
2335
2336
  "row-config": {
2336
2337
  ...state.rowConfig,
2337
- ..._ctx.$attrs.rowConfig || {}
2338
+ ...unref(getAttr)("row-config")
2338
2339
  },
2339
2340
  "show-footer": _ctx.showFooter && !props.isInlineOperating,
2340
2341
  "footer-method": footerMethod,
2341
2342
  "sort-config": {
2342
2343
  trigger: "cell",
2343
2344
  remote: true,
2344
- ..._ctx.$attrs.sortConfig || {}
2345
+ ...unref(getAttr)("sort-config")
2345
2346
  },
2346
2347
  "span-method": colspanMethod,
2347
2348
  "footer-span-method": footerRowspanMethod,
2348
2349
  "tooltip-config": {
2349
2350
  enterable: false,
2350
- ..._ctx.$attrs.tooltipConfig || {}
2351
+ ...unref(getAttr)("tooltip-config")
2351
2352
  },
2352
2353
  "checkbox-config": {
2353
2354
  checkField: "checked",
@@ -2357,18 +2358,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2357
2358
  trigger: "cell",
2358
2359
  reserve: true,
2359
2360
  highlight: true,
2360
- ..._ctx.$attrs.checkboxConfig || {}
2361
+ ...unref(getAttr)("checkbox-config")
2361
2362
  },
2362
2363
  "radio-config": {
2363
2364
  checkField: "checked",
2364
2365
  trigger: "cell",
2365
2366
  reserve: true,
2366
2367
  highlight: true,
2367
- ..._ctx.$attrs.radioConfig || {}
2368
+ ...unref(getAttr)("radio-config")
2368
2369
  },
2369
2370
  "scroll-y": {
2370
2371
  gt: 50,
2371
- ..._ctx.$attrs.scrollY || {}
2372
+ ...unref(getAttr)("scroll-y")
2372
2373
  },
2373
2374
  "row-style": unref(getRowStyle),
2374
2375
  "edit-config": state.editConfig,
@@ -2379,7 +2380,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2379
2380
  toggleMethod: unref(toggleExpandMethod),
2380
2381
  iconOpen: "iconfont icon-a-xitongtubiaozhediejian",
2381
2382
  iconClose: "iconfont icon-a-xitongtubiaotianjia",
2382
- ..._ctx.$attrs.expandConfig || {}
2383
+ ...unref(getAttr)("expand-config")
2383
2384
  },
2384
2385
  "keyboard-config": _ctx.columnConfig.keyboardConfig || {},
2385
2386
  "edit-rules": _ctx.columnConfig.editRules || {},
@@ -200,7 +200,7 @@ declare const bigTableProps: {
200
200
  resetInlineBatchEdit: FunctionConstructor;
201
201
  resetBatchEditRowStatus: FunctionConstructor;
202
202
  anchor: {
203
- type: ArrayConstructor;
203
+ type: PropType<AnyObject[]>;
204
204
  default: () => never[];
205
205
  };
206
206
  };
@@ -1,4 +1,5 @@
1
- export declare const useFormat: (state: any) => {
1
+ import { AnyObject } from '../../../../../es/shared/types';
2
+ export declare const useFormat: (state: any, attr: AnyObject) => {
2
3
  formatData: (data?: {
3
4
  tableList: any[];
4
5
  fieldList: any[];
@@ -25,4 +26,5 @@ export declare const useFormat: (state: any) => {
25
26
  'border-color': any;
26
27
  color?: undefined;
27
28
  };
29
+ getAttr: (field: string) => any;
28
30
  };
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import 'moment';
3
3
 
4
- const useFormat = (state) => {
4
+ const useFormat = (state, attr) => {
5
5
  const formatData = (data = {
6
6
  tableList: [],
7
7
  fieldList: [],
@@ -482,10 +482,19 @@ const useFormat = (state) => {
482
482
  "border-color": v.color
483
483
  };
484
484
  };
485
+ function getAttr(field) {
486
+ if (attr[field])
487
+ return attr[field];
488
+ const newField = field.replace(/-(\w)/g, ($0, $1) => {
489
+ return $1.toUpperCase();
490
+ });
491
+ return attr[newField] || {};
492
+ }
485
493
  return {
486
494
  formatData,
487
495
  htmlToText,
488
- getBtnStyle
496
+ getBtnStyle,
497
+ getAttr
489
498
  };
490
499
  };
491
500
 
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, createVNode, Teleport, withDirectives, vShow } from 'vue';
1
+ import { defineComponent, ref, watch, createVNode, Teleport, withDirectives, vShow } from 'vue';
2
2
  import { NSpace, NInputNumber } from 'naive-ui';
3
3
  import useStyle from './useStyle2.js';
4
4
  import { onClickOutside } from '@vueuse/core';
@@ -31,9 +31,11 @@ var PopupMenu = defineComponent({
31
31
  slots,
32
32
  emit
33
33
  }) {
34
+ let setNoShow = false;
34
35
  const popupRef = ref(null);
35
36
  onClickOutside(popupRef, (event) => {
36
- emit("update:show", false);
37
+ !setNoShow && emit("update:show", false);
38
+ setNoShow = false;
37
39
  });
38
40
  const {
39
41
  left
@@ -81,6 +83,11 @@ var PopupMenu = defineComponent({
81
83
  });
82
84
  }
83
85
  }
86
+ watch(() => props.show, (value) => {
87
+ if (value) {
88
+ setNoShow = true;
89
+ }
90
+ });
84
91
  return () => {
85
92
  return createVNode(Teleport, {
86
93
  "to": ".c-fabric-chart"
@@ -64,7 +64,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
64
64
  left.yScaleValue.forEach((scaleValue) => {
65
65
  drawPositionLine(scaleValue);
66
66
  scaleValue.dataList.forEach((item, dataIndex) => {
67
- drawPolyLine(item, dataIndex, scaleValue);
67
+ if (scaleValue.type !== "temperature" || item.enable) {
68
+ drawPolyLine(item, dataIndex, scaleValue);
69
+ }
68
70
  });
69
71
  });
70
72
  drawShaDow();
@@ -228,13 +230,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
228
230
  });
229
231
  }
230
232
  function drawPolyLine(item, dataIndex, scaleValue) {
231
- const {
232
- pointAttr = {},
233
- lineAttr = {},
234
- type: pointType = "circle",
235
- upArrowShow = false,
236
- limitValueShow = false
237
- } = item;
238
233
  const {
239
234
  type,
240
235
  noRiseStyle = {},
@@ -242,13 +237,22 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
242
237
  reduceStyle = {},
243
238
  pacemaker = {},
244
239
  upArrowStyle = {},
245
- limitValueStyle = {}
240
+ limitValueStyle = {},
241
+ dataList = []
246
242
  } = scaleValue;
247
243
  const pointList = [];
248
244
  const lineList = [];
249
245
  const otherList = [];
250
246
  item.list.forEach((v, index) => {
251
- var _a, _b;
247
+ var _a;
248
+ const _item = type !== "temperature" ? item : dataList.find((_v) => _v.key === v.key);
249
+ const {
250
+ pointAttr = {},
251
+ lineAttr = {},
252
+ type: pointType = "circle",
253
+ upArrowShow = false,
254
+ limitValueShow = false
255
+ } = _item;
252
256
  const points = getPointer(v, scaleValue);
253
257
  const nextV = item.list[index + 1];
254
258
  const nextPoint = getPointer(nextV, scaleValue);
@@ -330,9 +334,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
330
334
  line = drawLine([...points, ...nextPoint], {
331
335
  ...lineAttr
332
336
  });
333
- } else if (points && !nextPoint && !v.breakpoint && type === "temperature" && dataIndex < scaleValue.dataList.length - 1 && index === item.list.length - 1) {
334
- const nextV2 = (_b = scaleValue.dataList[dataIndex + 1].list) == null ? void 0 : _b[0];
335
- const nextLinePoint = getPointer(nextV2, scaleValue);
337
+ } else if (points && !nextPoint && !v.breakpoint) {
338
+ const nextLinePoint = getPointer(nextV, scaleValue);
336
339
  line = nextLinePoint ? drawLine([...points, ...nextLinePoint], {
337
340
  ...lineAttr
338
341
  }) : null;
@@ -373,12 +376,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
373
376
  } else {
374
377
  if (points) {
375
378
  pointAttrNew.leftLine = null;
376
- if (type == "temperature" && index === 0) {
377
- const objLine = [...prevLines].find((v2) => v2.dataIndex === dataIndex - 1);
378
- if (objLine) {
379
- pointAttrNew.leftLine = objLine.line;
380
- }
381
- }
382
379
  point = drawPoint(currentPointType, {
383
380
  left: points[0],
384
381
  top: points[1],
@@ -536,6 +533,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
536
533
  value: target.origin.data.value
537
534
  };
538
535
  data[`${item.type}`] = item.value;
536
+ if (target.origin.type === "temperature") {
537
+ data["key"] = target.origin.key;
538
+ }
539
539
  emits("change", {
540
540
  ...target.origin,
541
541
  data
@@ -212,7 +212,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
212
212
  });
213
213
  const icon = drawPoint(item.type, {
214
214
  left: leftX,
215
- top: topY - (text.height || 30) / 2,
215
+ top: topY - (text.height || 30) / 2 - 1,
216
216
  ...item.pointAttr,
217
217
  originY: "center",
218
218
  originX: "right",
@@ -224,7 +224,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
224
224
  key: item.key
225
225
  },
226
226
  originLeft: leftX,
227
- originTop: topY - (text.height || 30) / 2,
227
+ originTop: topY - (text.height || 30) / 2 - 1,
228
228
  ...propItems.event
229
229
  });
230
230
  topY -= text.height || 30;
@@ -46,6 +46,10 @@ const script = defineComponent({
46
46
  function isTimeDisabled(time) {
47
47
  const checkDate = new Date(time);
48
48
  const currentDate = new Date();
49
+ const checkDateDuplicate = new Date(checkDate);
50
+ checkDateDuplicate.setHours(0);
51
+ checkDateDuplicate.setMinutes(0);
52
+ checkDateDuplicate.setSeconds(0);
49
53
  return {
50
54
  isHourDisabled,
51
55
  isMinuteDisabled
@@ -59,10 +63,17 @@ const script = defineComponent({
59
63
  function currentMinute() {
60
64
  return currentDate.getMinutes();
61
65
  }
66
+ function isOverDate() {
67
+ return checkDateDuplicate > currentDate;
68
+ }
62
69
  function isHourDisabled(hour) {
70
+ if (isOverDate())
71
+ return false;
63
72
  return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
64
73
  }
65
74
  function isMinuteDisabled(minute) {
75
+ if (isOverDate())
76
+ return false;
66
77
  if (checkHour() === currentHour()) {
67
78
  return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
68
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.21-beta.4",
3
+ "version": "3.1.21-beta.6",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -66,5 +66,5 @@
66
66
  "iOS 7",
67
67
  "last 3 iOS versions"
68
68
  ],
69
- "gitHead": "7ef5767506d850cf000b061261bea68a2aaac601"
69
+ "gitHead": "35a72eb95288d77dc5cef7da908186ff8bce079a"
70
70
  }