cnhis-design-vue 3.1.14-beta.1 → 3.1.14-beta.10
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/README.md +1 -1
- package/es/packages/annotation-edit/index.d.ts +17 -0
- package/es/packages/annotation-edit/index.js +10 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.d.ts +16 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.js +119 -0
- package/es/packages/annotation-edit/style/index.css +15 -0
- package/es/packages/big-table/index.d.ts +2 -9
- package/es/packages/big-table/src/BigTable.vue.d.ts +30 -18
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +53 -25
- package/es/packages/big-table/src/bigTableEmits.js +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +25 -8
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +29 -9
- package/es/packages/big-table/src/components/separate.vue.d.ts +3 -4
- package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +7 -3
- package/es/packages/big-table/src/hooks/useEdit.d.ts +25 -7
- package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +14 -10
- package/es/packages/big-table/src/utils.js +3 -3
- package/es/packages/big-table/style/index.css +15 -2
- package/es/packages/button-print/index.d.ts +1 -0
- package/es/packages/button-print/index.js +1 -0
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/packages/button-print/src/utils/index.d.ts +1 -0
- package/es/packages/button-print/src/utils/index.js +1 -0
- 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 +7 -2
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +8 -3
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +40 -9
- package/es/packages/fabric-chart/src/hooks/index.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/index.js +2 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +19 -14
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +6 -0
- package/es/packages/fabric-chart/src/hooks/useEvent.js +67 -1
- package/es/packages/fabric-chart/src/hooks/useLeft.js +14 -14
- package/es/packages/fabric-chart/src/hooks/useRight.js +2 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +10 -20
- package/es/packages/fabric-chart/src/interface.d.ts +7 -0
- package/es/packages/form-render/index.d.ts +1 -1
- package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +1 -1
- package/es/packages/form-render/src/components/renderer/cascader.js +4 -8
- package/es/packages/form-render/src/components/renderer/formItem.js +8 -92
- package/es/packages/form-render/src/components/renderer/input.js +5 -16
- package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +12 -0
- package/es/packages/form-render/src/components/renderer/inputNumber.js +11 -4
- package/es/packages/form-render/src/components/renderer/select.js +9 -2
- package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +15 -2
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +16 -15
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +10 -6
- package/es/packages/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/packages/form-render/src/utils/index.d.ts +9 -2
- package/es/packages/form-render/src/utils/index.js +43 -14
- package/es/packages/form-render/style/index.css +17 -15
- package/es/packages/index.css +32 -17
- package/es/packages/index.d.ts +1 -0
- package/es/packages/index.js +1 -0
- package/es/packages/info-header/index.d.ts +1375 -358
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +689 -178
- package/es/packages/info-header/src/HiddenContent.vue_vue_type_script_setup_true_lang.js +11 -13
- package/es/packages/info-header/src/InfoEllipsis.js +4 -0
- package/es/packages/info-header/src/InfoEllipsis.vue.d.ts +833 -0
- package/es/packages/info-header/src/InfoEllipsis.vue_vue_type_script_setup_true_lang.js +41 -0
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1375 -358
- package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +9 -13
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.d.ts +3 -5
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.js +9 -9
- package/es/src/components/SlotRender/index.d.ts +2 -0
- package/es/src/components/SlotRender/index.js +2 -0
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, inject, computed,
|
|
1
|
+
import { defineComponent, inject, computed, createVNode } from 'vue';
|
|
2
2
|
import { isVoidField } from '@formily/core';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
|
-
import { FileTrayFull, FileTray } from '@vicons/ionicons5';
|
|
5
4
|
import { isBoolean } from 'lodash-es';
|
|
6
|
-
import { NFormItem
|
|
5
|
+
import { NFormItem } from 'naive-ui';
|
|
6
|
+
import AnnotationEdit from '../../../../../packages/annotation-edit';
|
|
7
7
|
import { InjectionAnnotation } from '../../../../../packages/form-render/src/constants';
|
|
8
8
|
|
|
9
9
|
const script = defineComponent({
|
|
@@ -27,96 +27,12 @@ const script = defineComponent({
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
function renderTextarea() {
|
|
31
|
-
return createVNode(NInput, {
|
|
32
|
-
"type": "textarea",
|
|
33
|
-
"value": annotationContent.value,
|
|
34
|
-
"onUpdate:value": ($event) => annotationContent.value = $event
|
|
35
|
-
}, null);
|
|
36
|
-
}
|
|
37
|
-
const __showPopper = ref(false);
|
|
38
|
-
const showPopper = computed({
|
|
39
|
-
get() {
|
|
40
|
-
return __showPopper.value;
|
|
41
|
-
},
|
|
42
|
-
async set(value) {
|
|
43
|
-
__showPopper.value = value;
|
|
44
|
-
if (!value && isEdit.value) {
|
|
45
|
-
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
46
|
-
isEdit.value = false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const isEdit = ref(false);
|
|
51
|
-
let clickTimer;
|
|
52
|
-
function iconClick() {
|
|
53
|
-
clearTimeout(clickTimer);
|
|
54
|
-
if (showPopper.value && isEdit.value) {
|
|
55
|
-
showPopper.value = false;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
clickTimer = setTimeout(() => {
|
|
59
|
-
if (!annotationContent.value) {
|
|
60
|
-
isEdit.value = showPopper.value = true;
|
|
61
|
-
}
|
|
62
|
-
}, 200);
|
|
63
|
-
}
|
|
64
|
-
function iconDbClick() {
|
|
65
|
-
clearTimeout(clickTimer);
|
|
66
|
-
if (!annotationContent.value)
|
|
67
|
-
return;
|
|
68
|
-
showPopper.value = true;
|
|
69
|
-
isEdit.value = true;
|
|
70
|
-
}
|
|
71
|
-
function iconMouseenter() {
|
|
72
|
-
if (!annotationContent.value)
|
|
73
|
-
return;
|
|
74
|
-
showPopper.value = true;
|
|
75
|
-
}
|
|
76
|
-
function iconMouseleave() {
|
|
77
|
-
if (!annotationContent.value || isEdit.value)
|
|
78
|
-
return;
|
|
79
|
-
showPopper.value = false;
|
|
80
|
-
}
|
|
81
30
|
function renderAnnotation() {
|
|
82
|
-
return createVNode(
|
|
83
|
-
"class":
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"--icon-right": "-5"
|
|
88
|
-
},
|
|
89
|
-
"form-item-hover-show": !annotationContent.value && !isEdit.value
|
|
90
|
-
}, [createVNode(NPopover, {
|
|
91
|
-
"style": {
|
|
92
|
-
maxWidth: "200px",
|
|
93
|
-
wordBreak: "break-all"
|
|
94
|
-
},
|
|
95
|
-
"show": showPopper.value,
|
|
96
|
-
"onUpdate:show": ($event) => showPopper.value = $event,
|
|
97
|
-
"trigger": "manual",
|
|
98
|
-
"duration": 100
|
|
99
|
-
}, {
|
|
100
|
-
default: renderDefault,
|
|
101
|
-
trigger: renderTrigger
|
|
102
|
-
})]);
|
|
103
|
-
function renderText() {
|
|
104
|
-
return createVNode("span", null, [annotationContent.value]);
|
|
105
|
-
}
|
|
106
|
-
function renderDefault() {
|
|
107
|
-
return createVNode("div", null, [isEdit.value ? renderTextarea() : renderText()]);
|
|
108
|
-
}
|
|
109
|
-
function renderTrigger() {
|
|
110
|
-
return createVNode("div", {
|
|
111
|
-
"class": "form-render__formItemLabel--icon",
|
|
112
|
-
"onMouseleave": iconMouseleave,
|
|
113
|
-
"onMouseenter": iconMouseenter,
|
|
114
|
-
"onDblclick": iconDbClick,
|
|
115
|
-
"onClick": iconClick
|
|
116
|
-
}, [createVNode(NIcon, {
|
|
117
|
-
"component": annotationContent.value ? FileTrayFull : FileTray
|
|
118
|
-
}, null)]);
|
|
119
|
-
}
|
|
31
|
+
return createVNode(AnnotationEdit, {
|
|
32
|
+
"class": "form-render__formItemLabel--annotation",
|
|
33
|
+
"modelValue": annotationContent.value,
|
|
34
|
+
"onUpdate:modelValue": ($event) => annotationContent.value = $event
|
|
35
|
+
}, null);
|
|
120
36
|
}
|
|
121
37
|
const showAnnotation = computed(() => {
|
|
122
38
|
return annotation.value && (!isBoolean(props.annotation) || props.annotation);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, createVNode } from 'vue';
|
|
2
|
+
import { createInputSlot, assignUpdateValue } from '../../utils/index.js';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NInput } from 'naive-ui';
|
|
5
5
|
|
|
@@ -13,21 +13,10 @@ const script = defineComponent({
|
|
|
13
13
|
type: String
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
setup(props
|
|
17
|
-
|
|
18
|
-
}) {
|
|
19
|
-
const _slots = computed(() => {
|
|
20
|
-
const res = {};
|
|
21
|
-
if (props.prefix) {
|
|
22
|
-
res.prefix = () => createVNode(Fragment, null, [createSlot(props.prefix, props).default()]);
|
|
23
|
-
}
|
|
24
|
-
if (props.suffix) {
|
|
25
|
-
res.suffix = () => createVNode(Fragment, null, [createSlot(props.suffix, props).default()]);
|
|
26
|
-
}
|
|
27
|
-
return res;
|
|
28
|
-
});
|
|
16
|
+
setup(props) {
|
|
17
|
+
const _slots = createInputSlot(props);
|
|
29
18
|
return () => {
|
|
30
|
-
return createVNode(NInput,
|
|
19
|
+
return createVNode(NInput, null, _slots.value);
|
|
31
20
|
};
|
|
32
21
|
}
|
|
33
22
|
});
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export declare const INPUT_NUMBER: import("vue").DefineComponent<{
|
|
2
2
|
onChange: {};
|
|
3
|
+
prefix: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
suffix: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
};
|
|
3
9
|
}, () => 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<{
|
|
4
10
|
onChange: {};
|
|
11
|
+
prefix: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
};
|
|
14
|
+
suffix: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
};
|
|
5
17
|
}>>, {}>;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import { assignUpdateValue } from '../../utils/index.js';
|
|
2
|
+
import { createInputSlot, assignUpdateValue } from '../../utils/index.js';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { NInputNumber } from 'naive-ui';
|
|
5
5
|
|
|
6
6
|
const script = defineComponent({
|
|
7
7
|
props: {
|
|
8
|
-
onChange: {}
|
|
8
|
+
onChange: {},
|
|
9
|
+
prefix: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
suffix: {
|
|
13
|
+
type: String
|
|
14
|
+
}
|
|
9
15
|
},
|
|
10
|
-
setup(
|
|
16
|
+
setup(props) {
|
|
17
|
+
const _slots = createInputSlot(props);
|
|
11
18
|
return () => {
|
|
12
|
-
return createVNode(NInputNumber, null,
|
|
19
|
+
return createVNode(NInputNumber, null, _slots.value);
|
|
13
20
|
};
|
|
14
21
|
}
|
|
15
22
|
});
|
|
@@ -2,7 +2,7 @@ import { defineComponent, ref, inject, computed, watch, nextTick, createVNode }
|
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { cloneDeep } from 'lodash-es';
|
|
4
4
|
import { InjectAsyncQueue, InjectionFormItemDepsCollector, InjectionChangeContextCollector } from '../../constants/index.js';
|
|
5
|
-
import { assignUpdateValue, formRenderLog,
|
|
5
|
+
import { assignUpdateValue, formRenderLog, traverseDependKey } from '../../utils/index.js';
|
|
6
6
|
import { isObject } from '@vueuse/core';
|
|
7
7
|
import { connect, mapProps } from '@formily/vue';
|
|
8
8
|
import { NSelect } from 'naive-ui';
|
|
@@ -65,9 +65,16 @@ const script = defineComponent({
|
|
|
65
65
|
remoteOptions.value = null;
|
|
66
66
|
}
|
|
67
67
|
function createParams(config2, field2) {
|
|
68
|
+
const _params = {};
|
|
69
|
+
traverseDependKey(config2.dependKey, (dependKey, valueKey2) => {
|
|
70
|
+
const _field = field2.query(dependKey).take();
|
|
71
|
+
if (isField(_field)) {
|
|
72
|
+
_params[valueKey2] = _field.value;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
68
75
|
return {
|
|
69
76
|
...config2,
|
|
70
|
-
params: Object.assign({}, config2.params,
|
|
77
|
+
params: Object.assign({}, config2.params, _params)
|
|
71
78
|
};
|
|
72
79
|
}
|
|
73
80
|
}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
export declare const TEXT:
|
|
2
|
-
|
|
1
|
+
export declare const TEXT: {
|
|
2
|
+
(props: any): JSX.Element;
|
|
3
|
+
props: {
|
|
4
|
+
content: {};
|
|
5
|
+
fieldItem: {};
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const BUTTON: {
|
|
9
|
+
(props: any): JSX.Element;
|
|
10
|
+
props: {
|
|
11
|
+
onClick: {};
|
|
12
|
+
fieldItem: {};
|
|
13
|
+
content: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { createVNode
|
|
1
|
+
import { createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
3
|
import { isFunction } from 'lodash-es';
|
|
4
4
|
import { NButton } from 'naive-ui';
|
|
5
5
|
import { createSlot } from '../../../../../packages/form-render/src/utils';
|
|
6
6
|
|
|
7
|
-
function _isSlot(s) {
|
|
8
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
9
|
-
}
|
|
10
7
|
function createPropFor(props) {
|
|
11
8
|
return (property) => {
|
|
12
9
|
var _a;
|
|
@@ -14,9 +11,12 @@ function createPropFor(props) {
|
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
13
|
const textScript = (props) => {
|
|
17
|
-
var _a, _b
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
var _a, _b;
|
|
15
|
+
return createVNode("div", null, [(_b = (_a = createSlot(props.content, props)).default) == null ? void 0 : _b.call(_a)]);
|
|
16
|
+
};
|
|
17
|
+
textScript.props = {
|
|
18
|
+
content: {},
|
|
19
|
+
fieldItem: {}
|
|
20
20
|
};
|
|
21
21
|
const TEXT = connect(textScript, mapProps((props) => {
|
|
22
22
|
var _a;
|
|
@@ -26,19 +26,20 @@ const TEXT = connect(textScript, mapProps((props) => {
|
|
|
26
26
|
};
|
|
27
27
|
}));
|
|
28
28
|
const buttonScript = (props) => {
|
|
29
|
-
var _a;
|
|
30
|
-
let _slot;
|
|
31
29
|
const propFor = createPropFor(props);
|
|
32
30
|
function onClick() {
|
|
33
|
-
var
|
|
34
|
-
const cb = propFor("onClick") || ((
|
|
31
|
+
var _a;
|
|
32
|
+
const cb = propFor("onClick") || ((_a = propFor("componentProps")) == null ? void 0 : _a.onClick);
|
|
35
33
|
return () => isFunction(cb) && cb(props.fieldItem);
|
|
36
34
|
}
|
|
37
|
-
return createVNode(NButton,
|
|
35
|
+
return createVNode(NButton, {
|
|
38
36
|
"onClick": onClick()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
}, createSlot(props.content, props));
|
|
38
|
+
};
|
|
39
|
+
buttonScript.props = {
|
|
40
|
+
onClick: {},
|
|
41
|
+
fieldItem: {},
|
|
42
|
+
content: {}
|
|
42
43
|
};
|
|
43
44
|
const BUTTON = connect(buttonScript, mapProps((props) => {
|
|
44
45
|
var _a;
|
|
@@ -3,7 +3,7 @@ import { ISchema } from '@formily/json-schema/esm/types';
|
|
|
3
3
|
import { FormItemDepsCollector } from '../../../../../es/packages/form-render';
|
|
4
4
|
export declare function useAnchor(props: Readonly<AnyObject>, collector: FormItemDepsCollector): {
|
|
5
5
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
6
|
-
onScroll: () =>
|
|
6
|
+
onScroll: () => void;
|
|
7
7
|
formHeight: import("vue").ComputedRef<any>;
|
|
8
8
|
anchorIdList: import("vue").Ref<{
|
|
9
9
|
name: string;
|
|
@@ -3,7 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
|
|
|
3
3
|
import { isNumber } from 'lodash-es';
|
|
4
4
|
import { ref, computed, watch, nextTick } from 'vue';
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../../../../packages/form-render/src/constants';
|
|
6
|
-
import {
|
|
6
|
+
import { createLinebarId, traverseSchema } from '../../../../packages/form-render/src/utils';
|
|
7
7
|
|
|
8
8
|
function useAnchor(props, collector) {
|
|
9
9
|
const __currentAnchor = ref("");
|
|
@@ -44,13 +44,13 @@ function useAnchor(props, collector) {
|
|
|
44
44
|
scrollLock = false;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const onScroll = useDebounceFn(
|
|
47
|
+
const onScroll = useDebounceFn(function() {
|
|
48
48
|
var _a;
|
|
49
49
|
if (scrollLock || !scrollbarRef.value)
|
|
50
50
|
return;
|
|
51
51
|
const { scrollTop, clientHeight } = scrollbarRef.value;
|
|
52
52
|
const result = anchorIdList.value.find((anchor) => {
|
|
53
|
-
const node = scrollbarRef.value.querySelector(`#${anchor.name}`);
|
|
53
|
+
const node = scrollbarRef.value.querySelector(`#${createLinebarId(anchor.name)}`);
|
|
54
54
|
if (!node)
|
|
55
55
|
return;
|
|
56
56
|
return node.offsetTop >= scrollTop || node.offsetTop < scrollTop && node.clientHeight + node.offsetTop > scrollTop + clientHeight;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
|
-
import {
|
|
2
|
+
import { pick } from 'lodash-es';
|
|
3
3
|
import { useFormValidator, useTypeNormalize } from '../../../../packages/form-render';
|
|
4
|
-
import {
|
|
4
|
+
import { fieldKeyEscape, arrayed, createLinebarId, transformDateFormat } from '../utils/index.js';
|
|
5
5
|
|
|
6
6
|
function useFieldListAdaptor(collector, uuid) {
|
|
7
7
|
const { createValidatorSchema } = useFormValidator();
|
|
@@ -108,7 +108,9 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
108
108
|
Object.assign(schema["x-component-props"], {
|
|
109
109
|
precision: decimal_length || (validate == null ? void 0 : validate.decimal_length),
|
|
110
110
|
max: validate == null ? void 0 : validate.max_value,
|
|
111
|
-
min: validate == null ? void 0 : validate.min_value
|
|
111
|
+
min: validate == null ? void 0 : validate.min_value,
|
|
112
|
+
prefix: item.prefix,
|
|
113
|
+
suffix: item.suffix
|
|
112
114
|
});
|
|
113
115
|
return schema;
|
|
114
116
|
};
|
|
@@ -174,13 +176,15 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
174
176
|
return creator(item);
|
|
175
177
|
};
|
|
176
178
|
const createWidgetCombinationSchema = (item) => {
|
|
179
|
+
if (!item.suffixConfig)
|
|
180
|
+
return createWidgetSchema(item);
|
|
177
181
|
const suffixList = arrayed(item.suffixConfig);
|
|
178
182
|
const fieldList = [{ ...item, suffixConfig: void 0 }].concat(suffixList.map((suffix) => {
|
|
179
183
|
return { ...suffix, is_show: item.is_show, alias: " " };
|
|
180
184
|
}));
|
|
181
185
|
return {
|
|
182
186
|
type: "void",
|
|
183
|
-
name: fieldList
|
|
187
|
+
name: fieldKeyEscape(fieldList),
|
|
184
188
|
title: item.alias || item.name,
|
|
185
189
|
"x-component": "INPUT_GROUP",
|
|
186
190
|
"x-component-props": { span: item.elem_width },
|
|
@@ -211,8 +215,8 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
211
215
|
return schema;
|
|
212
216
|
}
|
|
213
217
|
function createFieldName(fieldItem) {
|
|
214
|
-
if (
|
|
215
|
-
return [fieldItem
|
|
218
|
+
if (fieldItem.suffixConfig) {
|
|
219
|
+
return fieldKeyEscape([fieldItem, ...arrayed(fieldItem.suffixConfig)]);
|
|
216
220
|
}
|
|
217
221
|
return fieldItem.val_key;
|
|
218
222
|
}
|
|
@@ -64,11 +64,12 @@ export declare type FieldItem = {
|
|
|
64
64
|
urlConfig: Partial<{
|
|
65
65
|
url: string;
|
|
66
66
|
method: 'post' | 'get' | 'put' | 'patch' | 'delete';
|
|
67
|
-
dependKey: string | string[]
|
|
67
|
+
dependKey: string | string[] | Record<string, string>;
|
|
68
68
|
params: AnyObject;
|
|
69
69
|
nameKey: string;
|
|
70
70
|
valueKey: string;
|
|
71
71
|
}>;
|
|
72
|
+
suffixConfig: FieldItem[] | FieldItem;
|
|
72
73
|
fieldType: 'string' | 'object' | 'array' | 'number' | 'void' | 'boolean' | 'datetime';
|
|
73
74
|
content: string | FormRenderer | Record<string, FormRenderer>;
|
|
74
75
|
properties: FieldItem[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyObject, ArrayAble } from '../../../../../es/src/types';
|
|
2
2
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
3
3
|
import { GeneralField } from '@formily/core';
|
|
4
|
-
import { InjectionKey, VNode } from 'vue';
|
|
4
|
+
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
5
5
|
import { AgeContext, FieldItem, IdCardParseInfo } from '../types';
|
|
6
6
|
export declare function formRenderLog(message: string, type?: keyof Console): void;
|
|
7
7
|
export declare function arrayed<T>(maybeArray: T): T extends Array<any> ? T : [T];
|
|
@@ -14,7 +14,12 @@ export declare function isMobile(mobile: string): boolean;
|
|
|
14
14
|
export declare function parseBirthday(birthday: string): AgeContext;
|
|
15
15
|
export declare function parseIdCard(idCardNo: string): IdCardParseInfo;
|
|
16
16
|
export declare function injectOrProvide<T>(key: InjectionKey<T>, creator: () => T): T;
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function traverseDependKey(dependKeys: ArrayAble<string> | Record<string, string> | ArrayAble<{
|
|
18
|
+
paramName: string;
|
|
19
|
+
paramValue: string;
|
|
20
|
+
}>, handler: {
|
|
21
|
+
(dependKey: string, valueKey: string): void;
|
|
22
|
+
}): void;
|
|
18
23
|
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
|
|
19
24
|
export declare function uuidGenerator(): string;
|
|
20
25
|
export declare function createSlot(renderer: unknown, props: any): Record<string, () => ArrayAble<VNode>> | {
|
|
@@ -27,3 +32,5 @@ export declare function queryInput(decoratorElement?: HTMLElement | null): {
|
|
|
27
32
|
};
|
|
28
33
|
export declare function getParentLinebar(key: string, fieldList: FieldItem[]): string | null;
|
|
29
34
|
export declare function createLinebarId(id: string): string;
|
|
35
|
+
export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
|
|
36
|
+
export declare function createInputSlot(props: AnyObject): import("vue").ComputedRef<Record<string, FunctionalComponent<{}, {}>>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, provide, computed, createVNode, Fragment } from 'vue';
|
|
2
|
+
import { isArray, isObject, isString, isFunction } from 'lodash-es';
|
|
2
3
|
import { FIELD_SEX_VALUE } from '../constants/index.js';
|
|
3
4
|
import { isField } from '@formily/core';
|
|
4
5
|
import differenceInDays from '../../../../node_modules/date-fns/esm/differenceInDays/index.js';
|
|
5
6
|
import differenceInMonths from '../../../../node_modules/date-fns/esm/differenceInMonths/index.js';
|
|
6
7
|
import differenceInYears from '../../../../node_modules/date-fns/esm/differenceInYears/index.js';
|
|
7
8
|
import '../../../../node_modules/date-fns/esm/parse/_lib/parsers/index.js';
|
|
8
|
-
import { inject, provide } from 'vue';
|
|
9
9
|
|
|
10
10
|
function formRenderLog(message, type = "log") {
|
|
11
11
|
console[type](`[FormRender]: ${message}`);
|
|
@@ -16,7 +16,9 @@ function arrayed(maybeArray) {
|
|
|
16
16
|
return [maybeArray];
|
|
17
17
|
}
|
|
18
18
|
function assignUpdateValue(props, field) {
|
|
19
|
-
const _props = {
|
|
19
|
+
const _props = {
|
|
20
|
+
...props
|
|
21
|
+
};
|
|
20
22
|
if (isField(field)) {
|
|
21
23
|
Object.assign(_props, {
|
|
22
24
|
"onUpdate:value"(value) {
|
|
@@ -69,17 +71,29 @@ function injectOrProvide(key, creator) {
|
|
|
69
71
|
}
|
|
70
72
|
return injected;
|
|
71
73
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
function traverseDependKey(dependKeys, handler) {
|
|
75
|
+
if (!dependKeys)
|
|
76
|
+
return;
|
|
77
|
+
Object.entries(createDependKeyMap()).forEach(([dependKey, valueKey]) => {
|
|
78
|
+
handler(dependKey, valueKey);
|
|
79
|
+
});
|
|
80
|
+
function createDependKeyMap() {
|
|
81
|
+
let result = {};
|
|
82
|
+
if (isArray(dependKeys)) {
|
|
83
|
+
dependKeys.forEach((k) => {
|
|
84
|
+
if (isObject(k)) {
|
|
85
|
+
result[k.paramName] = k.paramValue;
|
|
86
|
+
} else {
|
|
87
|
+
result[k] = k;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
} else if (isObject(dependKeys)) {
|
|
91
|
+
result = dependKeys;
|
|
92
|
+
} else if (isString(dependKeys)) {
|
|
93
|
+
result[dependKeys] = dependKeys;
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
81
96
|
}
|
|
82
|
-
return result;
|
|
83
97
|
}
|
|
84
98
|
function traverseSchema(schema, handler) {
|
|
85
99
|
handler(schema);
|
|
@@ -139,5 +153,20 @@ function getParentLinebar(key, fieldList) {
|
|
|
139
153
|
function createLinebarId(id) {
|
|
140
154
|
return `id-${id}`;
|
|
141
155
|
}
|
|
156
|
+
function fieldKeyEscape(fieldList) {
|
|
157
|
+
return fieldList.map((f) => f.val_key).join("-").replace(/[.]/g, "_");
|
|
158
|
+
}
|
|
159
|
+
function createInputSlot(props) {
|
|
160
|
+
return computed(() => {
|
|
161
|
+
const res = {};
|
|
162
|
+
if (props.prefix) {
|
|
163
|
+
res.prefix = () => createVNode(Fragment, null, [createSlot(props.prefix, props).default()]);
|
|
164
|
+
}
|
|
165
|
+
if (props.suffix) {
|
|
166
|
+
res.suffix = () => createVNode(Fragment, null, [createSlot(props.suffix, props).default()]);
|
|
167
|
+
}
|
|
168
|
+
return res;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
142
171
|
|
|
143
|
-
export { arrayed, assignUpdateValue, createLinebarId, createSlot,
|
|
172
|
+
export { arrayed, assignUpdateValue, createInputSlot, createLinebarId, createSlot, fieldKeyEscape, formRenderLog, getParentLinebar, injectOrProvide, isIdCard, isMobile, parseBirthday, parseIdCard, queryDecorator, queryInput, transformDateFormat, traverseDependKey, traverseSchema, uuidGenerator };
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
.annotation-edit {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
color: #0067ee;
|
|
4
|
+
font-size: 16px;
|
|
5
|
+
user-select: none;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
.annotation-edit.is-active {
|
|
10
|
+
color: rgba(255, 152, 40);
|
|
11
|
+
}
|
|
12
|
+
.annotation-edit__icon {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
1
16
|
.form-render__wrapper {
|
|
2
17
|
display: grid !important;
|
|
3
18
|
grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
|
|
@@ -21,24 +36,11 @@
|
|
|
21
36
|
.form-render__formItemLabel--text.has-annotation {
|
|
22
37
|
margin-right: 15px;
|
|
23
38
|
}
|
|
24
|
-
.form-render__formItemLabel--icon {
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
}
|
|
28
39
|
.form-render__formItemLabel--annotation {
|
|
29
40
|
position: absolute;
|
|
30
41
|
top: 50%;
|
|
31
42
|
transform: translateY(-50%);
|
|
32
43
|
right: calc(var(--icon-right) * 1px);
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
color: #0067ee;
|
|
35
|
-
font-size: 16px;
|
|
36
|
-
user-select: none;
|
|
37
|
-
display: inline-flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
}
|
|
40
|
-
.form-render__formItemLabel--annotation.is-active {
|
|
41
|
-
color: rgba(255, 152, 40);
|
|
42
44
|
}
|
|
43
45
|
.form-render__linebar {
|
|
44
46
|
grid-column: span var(--column) / span var(--column);
|
|
@@ -132,9 +134,9 @@
|
|
|
132
134
|
.form-render .n-form-item-label {
|
|
133
135
|
display: inline-flex;
|
|
134
136
|
}
|
|
135
|
-
.form-render .n-form-item-label [
|
|
137
|
+
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
136
138
|
visibility: hidden;
|
|
137
139
|
}
|
|
138
|
-
.form-render .n-form-item-label:hover [
|
|
140
|
+
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
139
141
|
visibility: visible;
|
|
140
142
|
}
|
package/es/packages/index.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
margin-top: 6px;
|
|
19
19
|
}
|
|
20
20
|
.big-table-filter-wrap .sort-item {
|
|
21
|
-
|
|
21
|
+
height: 32px;
|
|
22
22
|
padding: 0 13px;
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
.big-table-filter-wrap .checkbox-btn-wrap {
|
|
99
99
|
display: flex;
|
|
100
|
-
padding: 9px 10px
|
|
100
|
+
padding: 9px 10px 9px 14px;
|
|
101
101
|
}
|
|
102
102
|
.big-table-filter-wrap .checkbox-btn-wrap .checkbox-btn {
|
|
103
103
|
width: 56px;
|
|
@@ -131,6 +131,16 @@
|
|
|
131
131
|
width: 25px;
|
|
132
132
|
height: 20px;
|
|
133
133
|
}
|
|
134
|
+
.big-table__separate {
|
|
135
|
+
padding: 4px;
|
|
136
|
+
}
|
|
137
|
+
.big-table__separatePlaceholder {
|
|
138
|
+
display: inline-block;
|
|
139
|
+
visibility: hidden;
|
|
140
|
+
max-width: 0;
|
|
141
|
+
word-break: keep-all;
|
|
142
|
+
width: 0;
|
|
143
|
+
}
|
|
134
144
|
body > .vxe-table--tooltip-wrapper {
|
|
135
145
|
display: none !important;
|
|
136
146
|
}
|
|
@@ -139,6 +149,9 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
139
149
|
/* 行内表单样式 */
|
|
140
150
|
/* 行内表单样式 */
|
|
141
151
|
}
|
|
152
|
+
.custom-big-table .n-input {
|
|
153
|
+
width: fit-content;
|
|
154
|
+
}
|
|
142
155
|
.custom-big-table .img-wrap {
|
|
143
156
|
padding: 2px 0;
|
|
144
157
|
line-height: 1;
|
|
@@ -2643,6 +2656,21 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2643
2656
|
font-size: 14px;
|
|
2644
2657
|
text-decoration: none !important;
|
|
2645
2658
|
}
|
|
2659
|
+
.annotation-edit {
|
|
2660
|
+
cursor: pointer;
|
|
2661
|
+
color: #0067ee;
|
|
2662
|
+
font-size: 16px;
|
|
2663
|
+
user-select: none;
|
|
2664
|
+
display: inline-flex;
|
|
2665
|
+
align-items: center;
|
|
2666
|
+
}
|
|
2667
|
+
.annotation-edit.is-active {
|
|
2668
|
+
color: rgba(255, 152, 40);
|
|
2669
|
+
}
|
|
2670
|
+
.annotation-edit__icon {
|
|
2671
|
+
display: inline-flex;
|
|
2672
|
+
align-items: center;
|
|
2673
|
+
}
|
|
2646
2674
|
.form-render__wrapper {
|
|
2647
2675
|
display: grid !important;
|
|
2648
2676
|
grid-template-columns: repeat(var(--column), minmax(0px, 1fr));
|
|
@@ -2666,24 +2694,11 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2666
2694
|
.form-render__formItemLabel--text.has-annotation {
|
|
2667
2695
|
margin-right: 15px;
|
|
2668
2696
|
}
|
|
2669
|
-
.form-render__formItemLabel--icon {
|
|
2670
|
-
display: inline-flex;
|
|
2671
|
-
align-items: center;
|
|
2672
|
-
}
|
|
2673
2697
|
.form-render__formItemLabel--annotation {
|
|
2674
2698
|
position: absolute;
|
|
2675
2699
|
top: 50%;
|
|
2676
2700
|
transform: translateY(-50%);
|
|
2677
2701
|
right: calc(var(--icon-right) * 1px);
|
|
2678
|
-
cursor: pointer;
|
|
2679
|
-
color: #0067ee;
|
|
2680
|
-
font-size: 16px;
|
|
2681
|
-
user-select: none;
|
|
2682
|
-
display: inline-flex;
|
|
2683
|
-
align-items: center;
|
|
2684
|
-
}
|
|
2685
|
-
.form-render__formItemLabel--annotation.is-active {
|
|
2686
|
-
color: rgba(255, 152, 40);
|
|
2687
2702
|
}
|
|
2688
2703
|
.form-render__linebar {
|
|
2689
2704
|
grid-column: span var(--column) / span var(--column);
|
|
@@ -2777,10 +2792,10 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
2777
2792
|
.form-render .n-form-item-label {
|
|
2778
2793
|
display: inline-flex;
|
|
2779
2794
|
}
|
|
2780
|
-
.form-render .n-form-item-label [
|
|
2795
|
+
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
2781
2796
|
visibility: hidden;
|
|
2782
2797
|
}
|
|
2783
|
-
.form-render .n-form-item-label:hover [
|
|
2798
|
+
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
2784
2799
|
visibility: visible;
|
|
2785
2800
|
}
|
|
2786
2801
|
.c-fabric-chart-popup-tip,
|