cnhis-design-vue 3.1.15-beta.1 → 3.1.15-beta.4
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/annotation-edit/src/AnnotationEdit.js +2 -1
- package/es/packages/big-table/index.d.ts +8 -11
- package/es/packages/big-table/src/BigTable.vue.d.ts +24 -19
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +17 -11
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -3
- package/es/packages/big-table/src/bigTableProps.js +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-date.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-select.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.js +8 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +2 -1
- package/es/packages/big-table/src/hooks/useAnnotation.d.ts +4 -0
- package/es/packages/big-table/src/hooks/useAnnotation.js +22 -0
- package/es/packages/big-table/src/hooks/useEdit.d.ts +2 -1
- package/es/packages/big-table/style/index.css +27 -1
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +1 -1
- package/es/packages/fabric-chart/index.d.ts +1 -0
- package/es/packages/fabric-chart/src/FabricChart.js +17 -17
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +12 -10
- package/es/packages/fabric-chart/src/hooks/useCenter.js +7 -5
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +4 -2
- package/es/packages/fabric-chart/src/hooks/useLeft.js +4 -2
- package/es/packages/form-render/src/components/renderer/cascader.js +7 -7
- package/es/packages/form-render/src/components/renderer/combination.js +11 -8
- package/es/packages/form-render/src/components/renderer/complex.d.ts +2 -0
- package/es/packages/form-render/src/components/renderer/complex.js +2 -5
- package/es/packages/form-render/src/components/renderer/date.d.ts +29 -0
- package/es/packages/form-render/src/components/renderer/date.js +63 -56
- package/es/packages/form-render/src/components/renderer/select.js +7 -7
- package/es/packages/form-render/src/hooks/useCommonInjection.d.ts +6 -0
- package/es/packages/form-render/src/hooks/useCommonInjection.js +19 -0
- package/es/packages/form-render/src/utils/index.d.ts +1 -0
- package/es/packages/form-render/src/utils/index.js +30 -2
- package/es/packages/form-render/style/index.css +11 -10
- package/es/packages/index.css +38 -11
- package/es/packages/shortcut-provider/index.d.ts +2 -11
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +1 -5
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +2 -11
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +11 -8
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +44 -28
- package/es/packages/shortcut-provider/src/types/index.d.ts +32 -4
- package/es/packages/shortcut-provider/src/utils/index.d.ts +3 -0
- package/es/packages/shortcut-provider/src/utils/index.js +15 -5
- package/es/packages/shortcut-setter/index.d.ts +6 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +6 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +6 -4
- package/global.d.ts +8 -8
- package/package.json +1 -1
|
@@ -129,6 +129,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
function setCanvasEvent() {
|
|
132
|
+
if (!propItems.event.evented)
|
|
133
|
+
return;
|
|
132
134
|
canvas.value.on("mouse:up", (event) => {
|
|
133
135
|
var _a;
|
|
134
136
|
if (event.button === 3) {
|
|
@@ -157,7 +159,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
157
159
|
title: v.title,
|
|
158
160
|
unit: v.unit,
|
|
159
161
|
type: v.bigType,
|
|
160
|
-
dataIndex: v.dataIndex
|
|
162
|
+
dataIndex: v.dataIndex,
|
|
163
|
+
key: v.key
|
|
161
164
|
},
|
|
162
165
|
pointer: event.pointer
|
|
163
166
|
});
|
|
@@ -338,7 +341,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
338
341
|
coolLine,
|
|
339
342
|
coolPoint,
|
|
340
343
|
lockMovementX: true,
|
|
341
|
-
...pointAttr
|
|
344
|
+
...pointAttr,
|
|
345
|
+
...propItems.event
|
|
342
346
|
};
|
|
343
347
|
if (previousLine) {
|
|
344
348
|
point = drawPoint(type, {
|
|
@@ -488,14 +492,12 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
488
492
|
return getTime >= minMinute && getTime <= maxMinute;
|
|
489
493
|
}
|
|
490
494
|
function getPointer(v, scaleValue) {
|
|
491
|
-
let points;
|
|
492
495
|
const objOriginY = scaleValue.type === "pain" ? painOriginY : vitalSignsOriginY;
|
|
493
496
|
if (isEffectiveNode(v) && isLimit(v.time)) {
|
|
494
497
|
const x = cumputedX(v.time);
|
|
495
498
|
const y = cumputedY(scaleValue.type, scaleValue.list, v.value);
|
|
496
|
-
|
|
499
|
+
return [x, y < objOriginY.originY ? objOriginY.originY : y > objOriginY.endY ? objOriginY.endY : y];
|
|
497
500
|
}
|
|
498
|
-
return points;
|
|
499
501
|
}
|
|
500
502
|
function clickMenu({ item, target }) {
|
|
501
503
|
if (!target) {
|
|
@@ -31,10 +31,12 @@ function useCumputedPoint(propItems) {
|
|
|
31
31
|
const residueX = pointX - item.left;
|
|
32
32
|
const residueTime = item.scaleCell * residueX;
|
|
33
33
|
const time = item.start + residueTime;
|
|
34
|
-
|
|
34
|
+
const d = new Date(time);
|
|
35
35
|
const month = `00${d.getMonth() + 1}`.slice(-2);
|
|
36
36
|
const day = `00${d.getDate()}`.slice(-2);
|
|
37
|
-
const
|
|
37
|
+
const hours = `00${d.getHours()}`.slice(-2);
|
|
38
|
+
const minutes = `00${d.getMinutes()}`.slice(-2);
|
|
39
|
+
const date = `${d.getFullYear()}-${month}-${day} ${hours}:${minutes}`;
|
|
38
40
|
return date;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -195,10 +195,12 @@ ${item.title.slice(-2)}`,
|
|
|
195
195
|
title: item.title,
|
|
196
196
|
unit: item.unit,
|
|
197
197
|
type: item.bigType,
|
|
198
|
-
dataIndex: item.dataIndex
|
|
198
|
+
dataIndex: item.dataIndex,
|
|
199
|
+
key: item.key
|
|
199
200
|
},
|
|
200
201
|
originLeft: leftX,
|
|
201
|
-
originTop: topY - (text.height || 30) / 2
|
|
202
|
+
originTop: topY - (text.height || 30) / 2,
|
|
203
|
+
...propItems.event
|
|
202
204
|
});
|
|
203
205
|
topY -= text.height || 30;
|
|
204
206
|
setPointEvent(icon);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { isEqual } from 'lodash-es';
|
|
4
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
4
5
|
import { InjectAsyncQueue } from '../../constants/index.js';
|
|
5
6
|
import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
|
|
6
7
|
import { connect, mapProps } from '@formily/vue';
|
|
@@ -123,13 +124,12 @@ const script = defineComponent({
|
|
|
123
124
|
return (_a = target == null ? void 0 : target.depth) != null ? _a : -1;
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
127
|
+
const {
|
|
128
|
+
injectValueValidate,
|
|
129
|
+
injectValueWatchFromEmpty
|
|
130
|
+
} = useCommonInjection();
|
|
131
|
+
injectValueWatchFromEmpty(() => props.value, fetchData);
|
|
132
|
+
injectValueValidate(() => props.value);
|
|
133
133
|
watch(() => props.urlConfig, async (config, oldConfig) => {
|
|
134
134
|
if (isEqual(config, oldConfig))
|
|
135
135
|
return;
|
|
@@ -3,7 +3,7 @@ import { isField } from '@formily/core';
|
|
|
3
3
|
import { Path } from '../../../../../node_modules/@formily/path/esm/index.js';
|
|
4
4
|
import { flatten, isNumber } from 'lodash-es';
|
|
5
5
|
import { useFormField } from '../../../../../packages/form-render';
|
|
6
|
-
import { arrayed, assignUpdateValue, formRenderLog } from '../../utils/index.js';
|
|
6
|
+
import { arrayed, assignUpdateValue, mergeDeepProperties, formRenderLog } from '../../utils/index.js';
|
|
7
7
|
import { connect, mapProps } from '@formily/vue';
|
|
8
8
|
import { useDebounceFn, isObject } from '@vueuse/core';
|
|
9
9
|
import { NButton } from 'naive-ui';
|
|
@@ -64,7 +64,7 @@ const script = defineComponent({
|
|
|
64
64
|
});
|
|
65
65
|
function add() {
|
|
66
66
|
groupNum.value++;
|
|
67
|
-
_values.value.push({});
|
|
67
|
+
_values.value.push(mergeDeepProperties({}, props.getProperties()));
|
|
68
68
|
emitChange();
|
|
69
69
|
}
|
|
70
70
|
function remove(idx) {
|
|
@@ -82,7 +82,7 @@ const script = defineComponent({
|
|
|
82
82
|
immediate: true
|
|
83
83
|
});
|
|
84
84
|
const _values = ref([{}]);
|
|
85
|
-
function initValues(data) {
|
|
85
|
+
function initValues(data, withInitialData = false) {
|
|
86
86
|
if (!data)
|
|
87
87
|
return;
|
|
88
88
|
try {
|
|
@@ -92,10 +92,10 @@ const script = defineComponent({
|
|
|
92
92
|
parsed.forEach((v, idx) => {
|
|
93
93
|
if (idx > maxGroupNum.value - 1)
|
|
94
94
|
return;
|
|
95
|
-
if (isObject(v))
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
if (isObject(v)) {
|
|
96
|
+
_values.value[idx] = v;
|
|
97
|
+
withInitialData && mergeDeepProperties(v, props.getProperties());
|
|
98
|
+
}
|
|
99
99
|
});
|
|
100
100
|
groupNum.value = Math.min(_values.value.length, maxGroupNum.value);
|
|
101
101
|
} catch (e) {
|
|
@@ -115,7 +115,10 @@ const script = defineComponent({
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
watch(() => props.value, (value) => initValues(value));
|
|
118
|
-
onMounted(() =>
|
|
118
|
+
onMounted(() => {
|
|
119
|
+
initValues(props.value || "[{}]", true);
|
|
120
|
+
emitChange();
|
|
121
|
+
});
|
|
119
122
|
function stop(event) {
|
|
120
123
|
event.stopPropagation();
|
|
121
124
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, PropType } from 'vue';
|
|
2
2
|
export declare const COMPLEX: import("vue").DefineComponent<{
|
|
3
|
+
onChange: {};
|
|
3
4
|
span: {
|
|
4
5
|
type: NumberConstructor;
|
|
5
6
|
default: number;
|
|
@@ -13,6 +14,7 @@ export declare const COMPLEX: import("vue").DefineComponent<{
|
|
|
13
14
|
default: () => {};
|
|
14
15
|
};
|
|
15
16
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
onChange: {};
|
|
16
18
|
span: {
|
|
17
19
|
type: NumberConstructor;
|
|
18
20
|
default: number;
|
|
@@ -4,6 +4,7 @@ import { assignUpdateValue } from '../../utils/index.js';
|
|
|
4
4
|
|
|
5
5
|
const script = defineComponent({
|
|
6
6
|
props: {
|
|
7
|
+
onChange: {},
|
|
7
8
|
span: {
|
|
8
9
|
type: Number,
|
|
9
10
|
default: 6
|
|
@@ -20,16 +21,12 @@ const script = defineComponent({
|
|
|
20
21
|
setup(props, {
|
|
21
22
|
slots
|
|
22
23
|
}) {
|
|
23
|
-
function onChange(e) {
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
}
|
|
26
24
|
return () => {
|
|
27
25
|
return createVNode("section", {
|
|
28
26
|
"class": "form-render__complex"
|
|
29
27
|
}, [createVNode("section", {
|
|
30
28
|
"class": `form-render__complexContent--${props.display}`,
|
|
31
|
-
"style": props.wrapperStyle
|
|
32
|
-
"onChange": onChange
|
|
29
|
+
"style": props.wrapperStyle
|
|
33
30
|
}, [slots.default && slots.default()])]);
|
|
34
31
|
};
|
|
35
32
|
}
|
|
@@ -1,7 +1,36 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
export declare const DATE: import("vue").DefineComponent<{
|
|
2
3
|
onChange: {};
|
|
3
4
|
value: {};
|
|
5
|
+
validate: {
|
|
6
|
+
type: PropType<Partial<{
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
|
9
|
+
vali_obj: string;
|
|
10
|
+
max_value: string | number;
|
|
11
|
+
min_value: string | number;
|
|
12
|
+
min_length: string | number;
|
|
13
|
+
max_length: string | number;
|
|
14
|
+
decimal_length: string | number;
|
|
15
|
+
regular_expression: string | RegExp;
|
|
16
|
+
regular_error_tip: string;
|
|
17
|
+
}>>;
|
|
18
|
+
};
|
|
4
19
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
20
|
onChange: {};
|
|
6
21
|
value: {};
|
|
22
|
+
validate: {
|
|
23
|
+
type: PropType<Partial<{
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
|
26
|
+
vali_obj: string;
|
|
27
|
+
max_value: string | number;
|
|
28
|
+
min_value: string | number;
|
|
29
|
+
min_length: string | number;
|
|
30
|
+
max_length: string | number;
|
|
31
|
+
decimal_length: string | number;
|
|
32
|
+
regular_expression: string | RegExp;
|
|
33
|
+
regular_error_tip: string;
|
|
34
|
+
}>>;
|
|
35
|
+
};
|
|
7
36
|
}>>, {}>;
|
|
@@ -1,18 +1,75 @@
|
|
|
1
|
-
import { defineComponent, createVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { isObject } from '@vueuse/core';
|
|
5
5
|
import { NDatePicker } from 'naive-ui';
|
|
6
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
6
7
|
|
|
7
8
|
const script = defineComponent({
|
|
8
9
|
props: {
|
|
9
10
|
onChange: {},
|
|
10
|
-
value: {}
|
|
11
|
+
value: {},
|
|
12
|
+
validate: {
|
|
13
|
+
type: Object
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
setup(props) {
|
|
17
|
+
useCommonInjection().injectValueValidate(() => props.value);
|
|
18
|
+
function minCurrentDate() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
|
|
21
|
+
}
|
|
22
|
+
function maxCurrentDate() {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
|
|
25
|
+
}
|
|
26
|
+
function isDateDisabled(time) {
|
|
27
|
+
return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
|
|
28
|
+
function yesterday() {
|
|
29
|
+
return Date.now() - 24 * 60 * 60 * 1e3;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isTimeDisabled(time) {
|
|
33
|
+
const checkDate = new Date(time);
|
|
34
|
+
const currentDate = new Date();
|
|
35
|
+
return {
|
|
36
|
+
isHourDisabled,
|
|
37
|
+
isMinuteDisabled
|
|
38
|
+
};
|
|
39
|
+
function checkHour() {
|
|
40
|
+
return checkDate.getHours();
|
|
41
|
+
}
|
|
42
|
+
function currentHour() {
|
|
43
|
+
return currentDate.getHours();
|
|
44
|
+
}
|
|
45
|
+
function currentMinute() {
|
|
46
|
+
return currentDate.getMinutes();
|
|
47
|
+
}
|
|
48
|
+
function isHourDisabled(hour) {
|
|
49
|
+
return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
|
|
50
|
+
}
|
|
51
|
+
function isMinuteDisabled(minute) {
|
|
52
|
+
if (checkHour() === currentHour()) {
|
|
53
|
+
return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
|
|
54
|
+
}
|
|
55
|
+
return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const validateConfig = computed(() => {
|
|
59
|
+
const result = {};
|
|
60
|
+
if (isObject(props.validate)) {
|
|
61
|
+
const {
|
|
62
|
+
min_date,
|
|
63
|
+
max_date
|
|
64
|
+
} = props.validate;
|
|
65
|
+
if (min_date || max_date) {
|
|
66
|
+
result.isDateDisabled = isDateDisabled;
|
|
67
|
+
result.isTimeDisabled = isTimeDisabled;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
});
|
|
72
|
+
return () => createVNode(NDatePicker, validateConfig.value, null);
|
|
16
73
|
}
|
|
17
74
|
});
|
|
18
75
|
const DATE = connect(script, mapProps((props, field) => {
|
|
@@ -26,58 +83,8 @@ const DATE = connect(script, mapProps((props, field) => {
|
|
|
26
83
|
field.setValue(v);
|
|
27
84
|
}
|
|
28
85
|
});
|
|
29
|
-
if (isObject(props.validate)) {
|
|
30
|
-
const {
|
|
31
|
-
min_date,
|
|
32
|
-
max_date
|
|
33
|
-
} = props.validate;
|
|
34
|
-
if (min_date || max_date) {
|
|
35
|
-
_props.isDateDisabled = isDateDisabled;
|
|
36
|
-
_props.isTimeDisabled = isTimeDisabled;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
86
|
}
|
|
40
87
|
return _props;
|
|
41
|
-
function minCurrentDate() {
|
|
42
|
-
var _a;
|
|
43
|
-
return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
|
|
44
|
-
}
|
|
45
|
-
function maxCurrentDate() {
|
|
46
|
-
var _a;
|
|
47
|
-
return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
|
|
48
|
-
}
|
|
49
|
-
function isDateDisabled(time) {
|
|
50
|
-
return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
|
|
51
|
-
function yesterday() {
|
|
52
|
-
return Date.now() - 24 * 60 * 60 * 1e3;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function isTimeDisabled(time) {
|
|
56
|
-
const checkDate = new Date(time);
|
|
57
|
-
const currentDate = new Date();
|
|
58
|
-
return {
|
|
59
|
-
isHourDisabled,
|
|
60
|
-
isMinuteDisabled
|
|
61
|
-
};
|
|
62
|
-
function checkHour() {
|
|
63
|
-
return checkDate.getHours();
|
|
64
|
-
}
|
|
65
|
-
function currentHour() {
|
|
66
|
-
return currentDate.getHours();
|
|
67
|
-
}
|
|
68
|
-
function currentMinute() {
|
|
69
|
-
return currentDate.getMinutes();
|
|
70
|
-
}
|
|
71
|
-
function isHourDisabled(hour) {
|
|
72
|
-
return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
|
|
73
|
-
}
|
|
74
|
-
function isMinuteDisabled(minute) {
|
|
75
|
-
if (checkHour() === currentHour()) {
|
|
76
|
-
return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
|
|
77
|
-
}
|
|
78
|
-
return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
88
|
}));
|
|
82
89
|
|
|
83
90
|
export { DATE };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { isEqual, cloneDeep } from 'lodash-es';
|
|
4
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
4
5
|
import { InjectionChangeContextCollector, InjectAsyncQueue, InjectionFormItemDepsCollector } from '../../constants/index.js';
|
|
5
6
|
import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
|
|
6
7
|
import { connect, mapProps } from '@formily/vue';
|
|
@@ -106,13 +107,12 @@ const script = defineComponent({
|
|
|
106
107
|
}, {
|
|
107
108
|
immediate: true
|
|
108
109
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
110
|
+
const {
|
|
111
|
+
injectValueValidate,
|
|
112
|
+
injectValueWatchFromEmpty
|
|
113
|
+
} = useCommonInjection();
|
|
114
|
+
injectValueWatchFromEmpty(() => props.value, fetchData);
|
|
115
|
+
injectValueValidate(() => props.value);
|
|
116
116
|
function focusDecorator(onFocus) {
|
|
117
117
|
return (...args) => {
|
|
118
118
|
if (isField(field.value)) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Func } from '../../../../../es/src/types';
|
|
2
|
+
import { WatchSource } from '@vue/runtime-core';
|
|
3
|
+
export declare function useCommonInjection(): {
|
|
4
|
+
injectValueValidate: (traverser: WatchSource) => void;
|
|
5
|
+
injectValueWatchFromEmpty: (traverser: WatchSource, trigger: Func) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isField } from '@formily/core';
|
|
2
|
+
import { watch } from 'vue';
|
|
3
|
+
import { useFormField } from '../../../../packages/form-render';
|
|
4
|
+
|
|
5
|
+
function useCommonInjection() {
|
|
6
|
+
function injectValueValidate(traverser) {
|
|
7
|
+
const { field } = useFormField();
|
|
8
|
+
watch(traverser, () => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function injectValueWatchFromEmpty(traverser, trigger) {
|
|
14
|
+
watch(traverser, (n, o) => n != null && o == null && trigger(), { immediate: true });
|
|
15
|
+
}
|
|
16
|
+
return { injectValueValidate, injectValueWatchFromEmpty };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useCommonInjection };
|
|
@@ -12,6 +12,7 @@ export declare function transformDateFormat(format?: string): "date" | "datetime
|
|
|
12
12
|
export declare function isIdCard(idCardNo: string): boolean;
|
|
13
13
|
export declare function isMobile(mobile: string): boolean;
|
|
14
14
|
export declare function parseBirthday(birthday: string): AgeContext;
|
|
15
|
+
export declare function mergeDeepProperties(target: AnyObject, fieldList: FieldItem[], traverseProperties?: string[], property?: string, targetProperty?: string): AnyObject;
|
|
15
16
|
export declare function parseIdCard(idCardNo: string): IdCardParseInfo;
|
|
16
17
|
export declare function injectOrProvide<T>(key: InjectionKey<T>, creator: () => T): T;
|
|
17
18
|
export declare function traverseDependKey(dependKeys: DependKeyType, handler: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { inject, provide, computed, createVNode, Fragment } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { isObject } from '@vue/shared';
|
|
3
|
+
import { isArray, isString, isFunction } from 'lodash-es';
|
|
3
4
|
import { FIELD_SEX_VALUE } from '../constants/index.js';
|
|
4
5
|
import { isField } from '@formily/core';
|
|
5
6
|
import differenceInDays from '../../../../node_modules/date-fns/esm/differenceInDays/index.js';
|
|
@@ -46,6 +47,33 @@ function parseBirthday(birthday) {
|
|
|
46
47
|
result.age = result.year = differenceInYears(d, birthDate);
|
|
47
48
|
return result;
|
|
48
49
|
}
|
|
50
|
+
function mergeDeepProperties(target, fieldList, traverseProperties = ["children", "properties", "suffixConfig"], property = "val_key", targetProperty = "default_val") {
|
|
51
|
+
function traverse(_target, _fieldList) {
|
|
52
|
+
_fieldList.forEach((field) => {
|
|
53
|
+
if (!isObject(field))
|
|
54
|
+
return;
|
|
55
|
+
if (targetPropertyFor(field) != null && _target[propertyFor(field)] == null) {
|
|
56
|
+
_target[propertyFor(field)] = targetPropertyFor(field);
|
|
57
|
+
}
|
|
58
|
+
traverseProperties.forEach((p) => {
|
|
59
|
+
if (!field[p])
|
|
60
|
+
return;
|
|
61
|
+
if (!_target[propertyFor(field)]) {
|
|
62
|
+
_target[propertyFor(field)] = {};
|
|
63
|
+
}
|
|
64
|
+
traverse(_target[propertyFor(field)], arrayed(field[p]));
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
traverse(target, fieldList);
|
|
69
|
+
return target;
|
|
70
|
+
function propertyFor(field) {
|
|
71
|
+
return field[property];
|
|
72
|
+
}
|
|
73
|
+
function targetPropertyFor(field) {
|
|
74
|
+
return field[targetProperty];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
49
77
|
function parseIdCard(idCardNo) {
|
|
50
78
|
const parseInner = (certificateNo, idxSexStart, birthYearSpan) => {
|
|
51
79
|
const res = {};
|
|
@@ -172,4 +200,4 @@ function createInputSlot(props) {
|
|
|
172
200
|
});
|
|
173
201
|
}
|
|
174
202
|
|
|
175
|
-
export { arrayed, assignUpdateValue, createInputSlot, createLinebarId, createSlot, elementIdEscape, fieldKeyEscape, formRenderLog, getParentLinebar, injectOrProvide, isIdCard, isMobile, parseBirthday, parseIdCard, queryDecorator, queryInput, transformDateFormat, traverseDependKey, traverseSchema, uuidGenerator };
|
|
203
|
+
export { arrayed, assignUpdateValue, createInputSlot, createLinebarId, createSlot, elementIdEscape, fieldKeyEscape, formRenderLog, getParentLinebar, injectOrProvide, isIdCard, isMobile, mergeDeepProperties, parseBirthday, parseIdCard, queryDecorator, queryInput, transformDateFormat, traverseDependKey, traverseSchema, uuidGenerator };
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
.form-render__formItem {
|
|
26
26
|
grid-column: span var(--form-item-column) / span var(--form-item-column);
|
|
27
27
|
}
|
|
28
|
-
.form-render__formItem .n-date-picker
|
|
28
|
+
.form-render__formItem .n-date-picker,
|
|
29
|
+
.form-render__formItem .n-input-number {
|
|
29
30
|
width: 100%;
|
|
30
31
|
}
|
|
31
32
|
.form-render__formItemLabel {
|
|
@@ -42,6 +43,15 @@
|
|
|
42
43
|
transform: translateY(-50%);
|
|
43
44
|
right: calc(var(--icon-right) * 1px);
|
|
44
45
|
}
|
|
46
|
+
.form-render__formItem .n-form-item-label {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
}
|
|
49
|
+
.form-render__formItem .n-form-item-label [annotation-hover-show='true'] {
|
|
50
|
+
visibility: hidden;
|
|
51
|
+
}
|
|
52
|
+
.form-render__formItem .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
53
|
+
visibility: visible;
|
|
54
|
+
}
|
|
45
55
|
.form-render__linebar {
|
|
46
56
|
grid-column: span var(--column) / span var(--column);
|
|
47
57
|
}
|
|
@@ -131,12 +141,3 @@
|
|
|
131
141
|
display: flex !important;
|
|
132
142
|
gap: 0 8px;
|
|
133
143
|
}
|
|
134
|
-
.form-render .n-form-item-label {
|
|
135
|
-
display: inline-flex;
|
|
136
|
-
}
|
|
137
|
-
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
138
|
-
visibility: hidden;
|
|
139
|
-
}
|
|
140
|
-
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
141
|
-
visibility: visible;
|
|
142
|
-
}
|
package/es/packages/index.css
CHANGED
|
@@ -291,7 +291,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
291
291
|
width: 100%;
|
|
292
292
|
}
|
|
293
293
|
.custom-big-table .filter-box .text-over-tooltip-components {
|
|
294
|
-
max-width: calc(100% -
|
|
294
|
+
max-width: calc(100% - 40px);
|
|
295
295
|
}
|
|
296
296
|
.custom-big-table .filter-box .vxe-filter--btn {
|
|
297
297
|
border-top-color: #c0c4cc;
|
|
@@ -539,6 +539,21 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
539
539
|
margin-right: 6px;
|
|
540
540
|
box-shadow: 0px 2px 4px 0px rgba(99, 129, 249, 0.5);
|
|
541
541
|
}
|
|
542
|
+
.annotation-edit {
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
color: #0067ee;
|
|
545
|
+
font-size: 16px;
|
|
546
|
+
user-select: none;
|
|
547
|
+
display: inline-flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
}
|
|
550
|
+
.annotation-edit.is-active {
|
|
551
|
+
color: rgba(255, 152, 40);
|
|
552
|
+
}
|
|
553
|
+
.annotation-edit__icon {
|
|
554
|
+
display: inline-flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
}
|
|
542
557
|
.no-data-tip {
|
|
543
558
|
display: flex;
|
|
544
559
|
flex-direction: column;
|
|
@@ -601,6 +616,17 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
601
616
|
fill: currentColor;
|
|
602
617
|
overflow: hidden;
|
|
603
618
|
}
|
|
619
|
+
.vxe-header--column [annotation-hover-show='true'] {
|
|
620
|
+
visibility: hidden;
|
|
621
|
+
}
|
|
622
|
+
.vxe-header--column:hover [annotation-hover-show='true'] {
|
|
623
|
+
visibility: visible;
|
|
624
|
+
}
|
|
625
|
+
.big-table__annotationWrapper {
|
|
626
|
+
width: 20px;
|
|
627
|
+
display: inline-flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
}
|
|
604
630
|
.people-tree {
|
|
605
631
|
display: flex;
|
|
606
632
|
}
|
|
@@ -2830,7 +2856,8 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2830
2856
|
.form-render__formItem {
|
|
2831
2857
|
grid-column: span var(--form-item-column) / span var(--form-item-column);
|
|
2832
2858
|
}
|
|
2833
|
-
.form-render__formItem .n-date-picker
|
|
2859
|
+
.form-render__formItem .n-date-picker,
|
|
2860
|
+
.form-render__formItem .n-input-number {
|
|
2834
2861
|
width: 100%;
|
|
2835
2862
|
}
|
|
2836
2863
|
.form-render__formItemLabel {
|
|
@@ -2847,6 +2874,15 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2847
2874
|
transform: translateY(-50%);
|
|
2848
2875
|
right: calc(var(--icon-right) * 1px);
|
|
2849
2876
|
}
|
|
2877
|
+
.form-render__formItem .n-form-item-label {
|
|
2878
|
+
display: inline-flex;
|
|
2879
|
+
}
|
|
2880
|
+
.form-render__formItem .n-form-item-label [annotation-hover-show='true'] {
|
|
2881
|
+
visibility: hidden;
|
|
2882
|
+
}
|
|
2883
|
+
.form-render__formItem .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
2884
|
+
visibility: visible;
|
|
2885
|
+
}
|
|
2850
2886
|
.form-render__linebar {
|
|
2851
2887
|
grid-column: span var(--column) / span var(--column);
|
|
2852
2888
|
}
|
|
@@ -2936,15 +2972,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2936
2972
|
display: flex !important;
|
|
2937
2973
|
gap: 0 8px;
|
|
2938
2974
|
}
|
|
2939
|
-
.form-render .n-form-item-label {
|
|
2940
|
-
display: inline-flex;
|
|
2941
|
-
}
|
|
2942
|
-
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
2943
|
-
visibility: hidden;
|
|
2944
|
-
}
|
|
2945
|
-
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
2946
|
-
visibility: visible;
|
|
2947
|
-
}
|
|
2948
2975
|
.c-fabric-chart-popup-tip,
|
|
2949
2976
|
.c-fabric-chart-popup-menu {
|
|
2950
2977
|
position: absolute;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../../../es/src/types';
|
|
2
2
|
export * from './src/hooks';
|
|
3
3
|
export * from './src/types';
|
|
4
|
-
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{
|
|
5
|
-
cacheKey: StringConstructor;
|
|
6
|
-
}, {
|
|
4
|
+
declare const ShortcutProvider: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
7
5
|
shortcutWrapperRef: import("vue").Ref<HTMLElement | undefined>;
|
|
8
|
-
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
-
cacheKey: StringConstructor;
|
|
10
|
-
}>> & {
|
|
11
|
-
[x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
12
|
-
}>>;
|
|
13
6
|
manager: import("./src/hooks").ShortcutManager;
|
|
14
|
-
},
|
|
15
|
-
cacheKey: StringConstructor;
|
|
16
|
-
}>>, {}>>;
|
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
17
8
|
export default ShortcutProvider;
|
|
@@ -5,13 +5,9 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
|
5
5
|
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "ShortcutProvider",
|
|
8
|
-
props: {
|
|
9
|
-
cacheKey: String
|
|
10
|
-
},
|
|
11
8
|
setup(__props) {
|
|
12
|
-
const props = __props;
|
|
13
9
|
const shortcutWrapperRef = ref();
|
|
14
|
-
const manager = new ShortcutManager(shortcutWrapperRef
|
|
10
|
+
const manager = new ShortcutManager(shortcutWrapperRef).start();
|
|
15
11
|
provide(InjectionShortcutManager, manager);
|
|
16
12
|
onBeforeUnmount(() => {
|
|
17
13
|
manager.destroy();
|