cnhis-design-vue 3.1.16-beta.14 → 3.1.16-beta.15
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.
- package/es/packages/big-table/src/BigTable.vue.d.ts +6 -1
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -3
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -0
- package/es/packages/big-table/src/hooks/useSeparateRow.js +5 -2
- package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +11 -2
- package/es/packages/form-render/src/components/renderer/date.js +12 -4
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.js +11 -1
- package/package.json +1 -1
|
@@ -1126,7 +1126,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1126
1126
|
textColorGhostHoverWarning: string;
|
|
1127
1127
|
textColorGhostPressedWarning: string;
|
|
1128
1128
|
textColorGhostFocusWarning: string;
|
|
1129
|
-
textColorGhostDisabledWarning: string;
|
|
1129
|
+
textColorGhostDisabledWarning: string; /**
|
|
1130
|
+
* 判断是否渲染EditForm
|
|
1131
|
+
* @param {*} row
|
|
1132
|
+
* @param {*} column
|
|
1133
|
+
* @returns
|
|
1134
|
+
*/
|
|
1130
1135
|
borderWarning: string;
|
|
1131
1136
|
borderHoverWarning: string;
|
|
1132
1137
|
borderPressedWarning: string;
|
|
@@ -354,10 +354,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
354
354
|
showSeq = true
|
|
355
355
|
} = map;
|
|
356
356
|
if (isEdit) {
|
|
357
|
-
|
|
357
|
+
Object.assign(state.editConfig, editConfig);
|
|
358
358
|
state.rowConfig.height = 48;
|
|
359
359
|
}
|
|
360
|
-
|
|
360
|
+
Object.assign(state.rowConfig, rowConfig);
|
|
361
361
|
state.rowConfig.keyField = handleRowId.value;
|
|
362
362
|
if (selectType) {
|
|
363
363
|
isBatchSelect = 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../src/utils';
|
|
2
3
|
import { isFunction } from 'lodash-es';
|
|
3
4
|
import { NDatePicker } from 'naive-ui';
|
|
4
5
|
|
|
@@ -25,7 +26,6 @@ var EditDate = defineComponent({
|
|
|
25
26
|
emits: ["formChange"],
|
|
26
27
|
setup(props, {
|
|
27
28
|
attrs,
|
|
28
|
-
slots,
|
|
29
29
|
emit
|
|
30
30
|
}) {
|
|
31
31
|
const onConfirm = (value) => {
|
|
@@ -102,11 +102,21 @@ var EditDate = defineComponent({
|
|
|
102
102
|
return customDateDisabled(ts, props.row);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
const formatConfig = computed(() => {
|
|
106
|
+
const valueFormat = props.col.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
107
|
+
return {
|
|
108
|
+
valueFormat,
|
|
109
|
+
format: valueFormat,
|
|
110
|
+
timePickerProps: {
|
|
111
|
+
format: generateTimeFormat(valueFormat)
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
});
|
|
105
115
|
const config = {
|
|
106
116
|
type: props.col.type || props.col.dateType || "datetime",
|
|
107
117
|
clearable: props.col.clearable || true,
|
|
108
118
|
disabled: props.col.disabled || false,
|
|
109
|
-
|
|
119
|
+
...formatConfig.value,
|
|
110
120
|
isDateDisabled: customDateDisabledDecorator(props.col.isDateDisabled) || isDateDisabled,
|
|
111
121
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
112
122
|
...props.col.componentProps || {}
|
|
@@ -41,6 +41,7 @@ var editTime = defineComponent({
|
|
|
41
41
|
const config = {
|
|
42
42
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
43
43
|
valueFormat: props.col.valueFormat || "HH:mm",
|
|
44
|
+
format: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
44
45
|
...props.col.componentProps || {}
|
|
45
46
|
};
|
|
46
47
|
return () => createVNode(NTimePicker, mergeProps(attrs, config, {
|
|
@@ -84,13 +84,15 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
(await res).push(...Array.from({ length: getColumnInfoMaxLength(parsedRowData) }).map((_, index) => {
|
|
87
|
+
const separateData = getSeparateRowData(parsedRowData, index);
|
|
87
88
|
if (index === 0) {
|
|
88
89
|
separateDataMap.value.set(row, {
|
|
89
90
|
row,
|
|
90
91
|
rawRow: rawData[dataIndex],
|
|
91
92
|
index,
|
|
92
|
-
separateData
|
|
93
|
+
separateData
|
|
93
94
|
});
|
|
95
|
+
row.$__SEPARATE_DATA = [separateData];
|
|
94
96
|
return row;
|
|
95
97
|
}
|
|
96
98
|
const data2 = { $__SEPARATE: true };
|
|
@@ -98,8 +100,9 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
98
100
|
row: data2,
|
|
99
101
|
rawRow: rawData[dataIndex],
|
|
100
102
|
index,
|
|
101
|
-
separateData
|
|
103
|
+
separateData
|
|
102
104
|
});
|
|
105
|
+
row.$__SEPARATE_DATA.push(separateData);
|
|
103
106
|
return data2;
|
|
104
107
|
}));
|
|
105
108
|
return res;
|
|
@@ -20,8 +20,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
style: normalizeStyle(unref(pointStyle))
|
|
21
21
|
}, [
|
|
22
22
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item) => {
|
|
23
|
-
return openBlock(), createElementBlock("li",
|
|
24
|
-
}),
|
|
23
|
+
return openBlock(), createElementBlock("li", { key: item }, toDisplayString(item), 1);
|
|
24
|
+
}), 128))
|
|
25
25
|
], 4), [
|
|
26
26
|
[vShow, __props.show]
|
|
27
27
|
])
|
|
@@ -430,9 +430,18 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
430
430
|
x: point.left,
|
|
431
431
|
y: point.top
|
|
432
432
|
};
|
|
433
|
-
|
|
434
|
-
pointTipProps.list = [`${title} ${yValue}${unit || ""}`, `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
433
|
+
pointTipProps.list = [getListValue(), `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
435
434
|
pointTipProps.show = true;
|
|
435
|
+
function getListValue() {
|
|
436
|
+
const { value, drugReduce, physicsReduce } = data;
|
|
437
|
+
if (drugReduce) {
|
|
438
|
+
return `\u836F\u7269\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${drugReduce}${unit || ""}`;
|
|
439
|
+
}
|
|
440
|
+
if (physicsReduce) {
|
|
441
|
+
return `\u7269\u7406\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${physicsReduce}${unit || ""}`;
|
|
442
|
+
}
|
|
443
|
+
return `${title} ${value}${unit || ""}`;
|
|
444
|
+
}
|
|
436
445
|
}
|
|
437
446
|
function moveLimit(point) {
|
|
438
447
|
point.setCoords();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, watch, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../src/utils';
|
|
2
3
|
import { connect, mapProps } from '@formily/vue';
|
|
3
4
|
import { isObject } from '@vueuse/core';
|
|
4
5
|
import { format } from 'date-fns';
|
|
@@ -66,9 +67,7 @@ const script = defineComponent({
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
const validateConfig = computed(() => {
|
|
69
|
-
const result = {
|
|
70
|
-
valueFormat: props.valueFormat
|
|
71
|
-
};
|
|
70
|
+
const result = {};
|
|
72
71
|
if (isObject(props.validate)) {
|
|
73
72
|
const {
|
|
74
73
|
min_date,
|
|
@@ -81,6 +80,15 @@ const script = defineComponent({
|
|
|
81
80
|
}
|
|
82
81
|
return result;
|
|
83
82
|
});
|
|
83
|
+
const formatConfig = computed(() => {
|
|
84
|
+
return {
|
|
85
|
+
valueFormat: props.valueFormat,
|
|
86
|
+
format: props.valueFormat,
|
|
87
|
+
timePickerProps: {
|
|
88
|
+
format: generateTimeFormat(props.valueFormat)
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
84
92
|
function formatDate(value) {
|
|
85
93
|
if (!value)
|
|
86
94
|
return value;
|
|
@@ -95,7 +103,7 @@ const script = defineComponent({
|
|
|
95
103
|
get: () => formatDate(props.value),
|
|
96
104
|
set: (value) => emit("update:value", value)
|
|
97
105
|
});
|
|
98
|
-
return () => createVNode(NDatePicker, mergeProps(validateConfig.value, {
|
|
106
|
+
return () => createVNode(NDatePicker, mergeProps(validateConfig.value, formatConfig.value, {
|
|
99
107
|
"formatted-value": valueRef.value,
|
|
100
108
|
"onUpdate:formatted-value": ($event) => valueRef.value = $event
|
|
101
109
|
}), null);
|
|
@@ -88,6 +88,7 @@ class ShortcutManager {
|
|
|
88
88
|
const callback = this.shortcutCallbackMap.get(keySignature);
|
|
89
89
|
if (!callback)
|
|
90
90
|
return;
|
|
91
|
+
event.preventDefault();
|
|
91
92
|
const shortcutItem = Object.values(this.shortcutCache.value).find((item) => item.currentKeySignature === keySignature);
|
|
92
93
|
if (!shortcutItem || shortcutItem.status !== ShortcutStatus.ACTIVE || shortcutItem.disabled)
|
|
93
94
|
return;
|
package/es/src/utils/index.d.ts
CHANGED
package/es/src/utils/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isString } from 'lodash-es';
|
|
2
|
+
|
|
1
3
|
function safeComponentRegister(app, component, cName = component.name, scheduler) {
|
|
2
4
|
if (!cName)
|
|
3
5
|
throw new Error(`[CUI]: invalid component name for ${component}`);
|
|
@@ -11,5 +13,13 @@ function safeComponentRegister(app, component, cName = component.name, scheduler
|
|
|
11
13
|
app.component(cName, component);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
16
|
+
function generateTimeFormat(format) {
|
|
17
|
+
if (!isString(format))
|
|
18
|
+
return;
|
|
19
|
+
const matched = format.match(/[Hms:]+/);
|
|
20
|
+
if (!matched)
|
|
21
|
+
return;
|
|
22
|
+
return matched[0];
|
|
23
|
+
}
|
|
14
24
|
|
|
15
|
-
export { safeComponentRegister };
|
|
25
|
+
export { generateTimeFormat, safeComponentRegister };
|