cnhis-design-vue 3.1.14-beta.14 → 3.1.14-beta.17
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/node_modules/@formily/path/esm/contexts.js +22 -0
- package/es/node_modules/@formily/path/esm/destructor.js +124 -0
- package/es/node_modules/@formily/path/esm/index.js +579 -0
- package/es/node_modules/@formily/path/esm/matcher.js +199 -0
- package/es/node_modules/@formily/path/esm/parser.js +402 -0
- package/es/node_modules/@formily/path/esm/shared.js +73 -0
- package/es/node_modules/@formily/path/esm/tokenizer.js +287 -0
- package/es/node_modules/@formily/path/esm/tokens.js +240 -0
- package/es/node_modules/@formily/path/esm/types.js +17 -0
- package/es/packages/big-table/index.d.ts +13 -0
- package/es/packages/big-table/src/BigTable.vue.d.ts +18 -12
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +7 -4
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
- package/es/packages/big-table/src/bigTableProps.js +1 -0
- package/es/packages/big-table/src/components/edit-form/edit-date.js +11 -3
- package/es/packages/big-table/src/components/edit-form/edit-input.js +15 -4
- package/es/packages/big-table/src/components/edit-form/edit-time.d.ts +43 -0
- package/es/packages/big-table/src/components/edit-form/edit-time.js +52 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +51 -12
- package/es/packages/big-table/src/hooks/useEdit.d.ts +42 -0
- package/es/packages/big-table/src/hooks/useEdit.js +2 -0
- package/es/packages/big-table/src/hooks/useFormat.js +8 -1
- package/es/packages/big-table/src/utils.js +1 -0
- package/es/packages/big-table/style/index.css +11 -0
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +4 -4
- package/es/packages/form-render/index.d.ts +0 -1
- package/es/packages/form-render/src/FormRender.js +2 -2
- package/es/packages/form-render/src/FormRender.vue.d.ts +0 -1
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +4 -4
- package/es/packages/form-render/src/components/renderer/cascader.js +44 -45
- package/es/packages/form-render/src/components/renderer/combination.d.ts +6 -0
- package/es/packages/form-render/src/components/renderer/combination.js +53 -16
- package/es/packages/form-render/src/components/renderer/formItem.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.d.ts +12 -4
- package/es/packages/form-render/src/components/renderer/radio.js +23 -5
- package/es/packages/form-render/src/components/renderer/select.js +46 -52
- package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +4 -2
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +4 -3
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useChangeContext.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useChangeContext.js +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +3 -2
- package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +4 -3
- package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +123 -35
- package/es/packages/form-render/src/types/index.d.ts +4 -2
- package/es/packages/form-render/src/utils/index.d.ts +3 -6
- package/es/packages/index.css +14 -0
- package/es/packages/info-header/style/index.css +3 -0
- package/es/packages/shortcut-provider/src/types/index.d.ts +11 -9
- package/es/packages/shortcut-provider/src/utils/index.js +5 -5
- package/es/packages/shortcut-setter/index.d.ts +3247 -1486
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +9 -5
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +3247 -1486
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +24 -11
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1700 -1661
- package/es/src/utils/anime.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const bigTableProps = {
|
|
2
2
|
data: { type: Array, default: () => [] },
|
|
3
3
|
maxCheckSize: { type: Number, default: 0 },
|
|
4
|
+
checkboxBindRowClick: { type: Boolean, default: true },
|
|
4
5
|
showFooter: Boolean,
|
|
5
6
|
sumData: { type: Object, default: () => ({}) },
|
|
6
7
|
avgData: { type: Object, default: () => ({}) },
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { isFunction } from 'lodash-es';
|
|
2
3
|
import { NDatePicker } from 'naive-ui';
|
|
3
4
|
|
|
4
5
|
var EditDate = defineComponent({
|
|
@@ -94,16 +95,23 @@ var EditDate = defineComponent({
|
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
};
|
|
98
|
+
function customDateDisabledDecorator(customDateDisabled) {
|
|
99
|
+
if (!isFunction(customDateDisabled))
|
|
100
|
+
return null;
|
|
101
|
+
return (ts) => {
|
|
102
|
+
return customDateDisabled(ts, props.row);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
97
105
|
const config = {
|
|
98
|
-
type: props.col.type || "datetime",
|
|
106
|
+
type: props.col.type || props.col.dateType || "datetime",
|
|
99
107
|
clearable: props.col.clearable || true,
|
|
100
108
|
disabled: props.col.disabled || false,
|
|
101
109
|
valueFormat: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
102
|
-
isDateDisabled: props.col.isDateDisabled || isDateDisabled,
|
|
110
|
+
isDateDisabled: customDateDisabledDecorator(props.col.isDateDisabled) || isDateDisabled,
|
|
103
111
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9"
|
|
104
112
|
};
|
|
105
113
|
if (config.type.includes("time")) {
|
|
106
|
-
config.isTimeDisabled = props.col.isTimeDisabled || isTimeDisabled;
|
|
114
|
+
config.isTimeDisabled = customDateDisabledDecorator(props.col.isTimeDisabled) || isTimeDisabled;
|
|
107
115
|
}
|
|
108
116
|
return () => createVNode(NDatePicker, mergeProps(attrs, config, {
|
|
109
117
|
"onUpdateFormattedValue": onConfirm
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
1
|
+
import { defineComponent, ref, createVNode, mergeProps } from 'vue';
|
|
2
2
|
import { NInput, NInputNumber } from 'naive-ui';
|
|
3
3
|
|
|
4
4
|
var EditInput = defineComponent({
|
|
@@ -29,9 +29,9 @@ var EditInput = defineComponent({
|
|
|
29
29
|
emits: ["formChange"],
|
|
30
30
|
setup(props, {
|
|
31
31
|
attrs,
|
|
32
|
-
slots,
|
|
33
32
|
emit
|
|
34
33
|
}) {
|
|
34
|
+
const __value = ref(attrs.value);
|
|
35
35
|
const onUpdateValue = (value) => {
|
|
36
36
|
emit("formChange", {
|
|
37
37
|
value,
|
|
@@ -40,11 +40,22 @@ var EditInput = defineComponent({
|
|
|
40
40
|
index: props.index
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
+
function onBlur() {
|
|
44
|
+
emit("formChange", {
|
|
45
|
+
value: __value.value,
|
|
46
|
+
row: props.row,
|
|
47
|
+
column: props.col,
|
|
48
|
+
index: props.index
|
|
49
|
+
});
|
|
50
|
+
}
|
|
43
51
|
const config = {
|
|
44
|
-
placeholder: props.col.placeholder || "\u8BF7\u8F93\u5165"
|
|
52
|
+
placeholder: props.col.placeholder || "\u8BF7\u8F93\u5165",
|
|
53
|
+
...props.col.componentProps || {}
|
|
45
54
|
};
|
|
46
55
|
return () => props.type === "input" ? createVNode(NInput, mergeProps(attrs, config, {
|
|
47
|
-
"
|
|
56
|
+
"value": __value.value,
|
|
57
|
+
"onUpdate:value": ($event) => __value.value = $event,
|
|
58
|
+
"onBlur": onBlur
|
|
48
59
|
}), null) : createVNode(NInputNumber, mergeProps(attrs, config, {
|
|
49
60
|
"onUpdateValue": onUpdateValue
|
|
50
61
|
}), null);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
type: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
col: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
row: {
|
|
11
|
+
type: ObjectConstructor;
|
|
12
|
+
default: () => {};
|
|
13
|
+
};
|
|
14
|
+
index: {
|
|
15
|
+
type: (NumberConstructor | ObjectConstructor)[];
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
type: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
col: {
|
|
24
|
+
type: ObjectConstructor;
|
|
25
|
+
default: () => {};
|
|
26
|
+
};
|
|
27
|
+
row: {
|
|
28
|
+
type: ObjectConstructor;
|
|
29
|
+
default: () => {};
|
|
30
|
+
};
|
|
31
|
+
index: {
|
|
32
|
+
type: (NumberConstructor | ObjectConstructor)[];
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
}>> & {
|
|
36
|
+
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
type: string;
|
|
39
|
+
col: Record<string, any>;
|
|
40
|
+
row: Record<string, any>;
|
|
41
|
+
index: number | Record<string, any>;
|
|
42
|
+
}>;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { NTimePicker } from 'naive-ui';
|
|
3
|
+
|
|
4
|
+
var editTime = defineComponent({
|
|
5
|
+
name: "EditTime",
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
components: {
|
|
8
|
+
NTimePicker
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
type: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "input"
|
|
14
|
+
},
|
|
15
|
+
col: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => ({})
|
|
18
|
+
},
|
|
19
|
+
row: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({})
|
|
22
|
+
},
|
|
23
|
+
index: {
|
|
24
|
+
type: [Number, Object],
|
|
25
|
+
default: 0
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: ["formChange"],
|
|
29
|
+
setup(props, {
|
|
30
|
+
attrs,
|
|
31
|
+
emit
|
|
32
|
+
}) {
|
|
33
|
+
const onUpdateValue = (value) => {
|
|
34
|
+
emit("formChange", {
|
|
35
|
+
value,
|
|
36
|
+
row: props.row,
|
|
37
|
+
column: props.col,
|
|
38
|
+
index: props.index
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const config = {
|
|
42
|
+
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
43
|
+
valueFormat: props.col.valueFormat || "HH:mm",
|
|
44
|
+
...props.col.componentProps || {}
|
|
45
|
+
};
|
|
46
|
+
return () => createVNode(NTimePicker, mergeProps(attrs, config, {
|
|
47
|
+
"onUpdateValue": onUpdateValue
|
|
48
|
+
}), null);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { editTime as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cloneDeep, isString, isFunction, isArray } from 'lodash-es';
|
|
2
|
+
import { isObject } from '@vue/shared';
|
|
2
3
|
|
|
3
4
|
const REMOVE_PROPERTY = Symbol("remove property");
|
|
4
5
|
function useColumnConfigAdaptor() {
|
|
@@ -23,21 +24,59 @@ function useColumnConfigAdaptor() {
|
|
|
23
24
|
["1", 1]
|
|
24
25
|
]);
|
|
25
26
|
const htmlTypeValueMap = new Map([
|
|
26
|
-
...["RADIO", "RADIO_BLOCK", "CHECKBOX", "CHECKBOX_BLOCK", "SELECT"].map((type) => [
|
|
27
|
+
...["RADIO", "RADIO_BLOCK", "CHECKBOX", "CHECKBOX_BLOCK", "SELECT", "SWITCH_COMPONENT"].map((type) => [
|
|
28
|
+
type,
|
|
29
|
+
"select"
|
|
30
|
+
]),
|
|
27
31
|
...["INPUT"].map((type) => [type, "input"]),
|
|
28
32
|
...["DIGITAL"].map((type) => [type, "number"])
|
|
29
33
|
]);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
const isNullHandler = (value, result, _fieldItem, _editRules) => {
|
|
35
|
+
if (value === "1")
|
|
36
|
+
return;
|
|
37
|
+
if (value === "0")
|
|
38
|
+
_editRules[_fieldItem.val_key] = [{ required: true, message: "\u5FC5\u586B" }];
|
|
39
|
+
};
|
|
40
|
+
const validateHandler = (value, result) => {
|
|
41
|
+
if (!isObject(value))
|
|
42
|
+
return;
|
|
43
|
+
result.componentProps = Object.assign({}, result.comonentProps, {
|
|
44
|
+
maxlength: value.max_length,
|
|
45
|
+
minlength: value.min_length,
|
|
46
|
+
max: value.max_value,
|
|
47
|
+
min: value.min_value,
|
|
48
|
+
precision: value.decimal_length
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const dateRangeValidate = (value, result) => {
|
|
52
|
+
if (!isObject(value))
|
|
53
|
+
return;
|
|
54
|
+
result.isDateDisabled = (ts, row) => {
|
|
55
|
+
if (!isObject(row))
|
|
56
|
+
return;
|
|
57
|
+
const { startDate, endDate } = value;
|
|
58
|
+
let invalid = false;
|
|
59
|
+
if (startDate) {
|
|
60
|
+
invalid = new Date(row[startDate]).getTime() > ts;
|
|
39
61
|
}
|
|
40
|
-
|
|
62
|
+
if (endDate) {
|
|
63
|
+
invalid = invalid || new Date(row[endDate]).getTime() < ts;
|
|
64
|
+
}
|
|
65
|
+
return invalid;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const switchOptionHandler = (value, result) => {
|
|
69
|
+
if (!isObject(value))
|
|
70
|
+
return;
|
|
71
|
+
const option = { label: value.describe, ...value };
|
|
72
|
+
result.options = isArray(result.options) ? [...result.options, option] : [option];
|
|
73
|
+
};
|
|
74
|
+
const settingMap = new Map([
|
|
75
|
+
["multi_select_value", { property: "multiple", valueMap: multipleValueMap }],
|
|
76
|
+
["is_null", isNullHandler],
|
|
77
|
+
["validate", validateHandler],
|
|
78
|
+
["dateValidate", dateRangeValidate],
|
|
79
|
+
...["open", "close"].map((key) => [key, switchOptionHandler]),
|
|
41
80
|
["is_edit", { property: "isEdit", valueMap: isEditValueMap }],
|
|
42
81
|
["html_type", { property: "formType", valueMap: htmlTypeValueMap }],
|
|
43
82
|
["option", { property: "options", fieldMap: /* @__PURE__ */ new Map([["text", "label"]]) }]
|
|
@@ -150,6 +150,48 @@ export declare const comps: {
|
|
|
150
150
|
row: Record<string, any>;
|
|
151
151
|
index: number | Record<string, any>;
|
|
152
152
|
}>;
|
|
153
|
+
time: import("vue").DefineComponent<{
|
|
154
|
+
type: {
|
|
155
|
+
type: StringConstructor;
|
|
156
|
+
default: string;
|
|
157
|
+
};
|
|
158
|
+
col: {
|
|
159
|
+
type: ObjectConstructor;
|
|
160
|
+
default: () => {};
|
|
161
|
+
};
|
|
162
|
+
row: {
|
|
163
|
+
type: ObjectConstructor;
|
|
164
|
+
default: () => {};
|
|
165
|
+
};
|
|
166
|
+
index: {
|
|
167
|
+
type: (NumberConstructor | ObjectConstructor)[];
|
|
168
|
+
default: number;
|
|
169
|
+
};
|
|
170
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formChange"[], "formChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
171
|
+
type: {
|
|
172
|
+
type: StringConstructor;
|
|
173
|
+
default: string;
|
|
174
|
+
};
|
|
175
|
+
col: {
|
|
176
|
+
type: ObjectConstructor;
|
|
177
|
+
default: () => {};
|
|
178
|
+
};
|
|
179
|
+
row: {
|
|
180
|
+
type: ObjectConstructor;
|
|
181
|
+
default: () => {};
|
|
182
|
+
};
|
|
183
|
+
index: {
|
|
184
|
+
type: (NumberConstructor | ObjectConstructor)[];
|
|
185
|
+
default: number;
|
|
186
|
+
};
|
|
187
|
+
}>> & {
|
|
188
|
+
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
type: string;
|
|
191
|
+
col: Record<string, any>;
|
|
192
|
+
row: Record<string, any>;
|
|
193
|
+
index: number | Record<string, any>;
|
|
194
|
+
}>;
|
|
153
195
|
separate: import("vue").DefineComponent<{
|
|
154
196
|
col: {
|
|
155
197
|
type: import("vue").PropType<import("../../../../src/types").AnyObject>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import EditTime from '../../../../packages/big-table/src/components/edit-form/edit-time';
|
|
1
2
|
import EditInput from '../components/edit-form/edit-input.js';
|
|
2
3
|
import EditSelect from '../components/edit-form/edit-select.js';
|
|
3
4
|
import EditDate from '../components/edit-form/edit-date.js';
|
|
@@ -8,6 +9,7 @@ const comps = {
|
|
|
8
9
|
number: EditInput,
|
|
9
10
|
select: EditSelect,
|
|
10
11
|
date: EditDate,
|
|
12
|
+
time: EditTime,
|
|
11
13
|
separate: EditSeparate
|
|
12
14
|
};
|
|
13
15
|
const useEdit = (props, state, emit, xGrid) => {
|
|
@@ -133,7 +133,14 @@ const useFormat = (state) => {
|
|
|
133
133
|
item[key] = temp.change_text;
|
|
134
134
|
} else {
|
|
135
135
|
if (temp.background != "#ffffff") {
|
|
136
|
-
|
|
136
|
+
const reg = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/;
|
|
137
|
+
let color = temp.background;
|
|
138
|
+
let iconHtml = `<span class="${temp.icon}"></span>`;
|
|
139
|
+
if (reg.test(temp.icon)) {
|
|
140
|
+
color = temp.icon;
|
|
141
|
+
iconHtml = `<span class="icon-dot-custom" style="--table-icon-color:${temp.icon};--table-icon-shadow:${temp.icon}80"></span>`;
|
|
142
|
+
}
|
|
143
|
+
item[key] = `<span class="field-span" style="color:${color}">${iconHtml}${temp.change_text || ""}</span>`;
|
|
137
144
|
} else {
|
|
138
145
|
item[key] = temp.change_text;
|
|
139
146
|
}
|
|
@@ -599,6 +599,7 @@ const setTableConfig = (config, state) => {
|
|
|
599
599
|
state.openOnly = config.openOnly;
|
|
600
600
|
state.isExpand = config.spreadAllBtn;
|
|
601
601
|
state.levelLazyLoadSetting = Object.assign({}, config.levelLazyLoadSetting);
|
|
602
|
+
state.checkWidth = Object.assign({}, state.checkWidth, config.checkWidth);
|
|
602
603
|
};
|
|
603
604
|
const setTreeGroupTitle = (formatList, key, GROUP_TITLE_KEY) => {
|
|
604
605
|
formatList.forEach((row) => {
|
|
@@ -396,6 +396,17 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
396
396
|
height: var(--tableImageHeight);
|
|
397
397
|
width: var(--tableImageWidth);
|
|
398
398
|
}
|
|
399
|
+
.custom-big-table .domPropsInnerHTML-span .icon-dot-custom {
|
|
400
|
+
width: 8px;
|
|
401
|
+
height: 8px;
|
|
402
|
+
-webkit-border-radius: 50%;
|
|
403
|
+
-moz-border-radius: 50%;
|
|
404
|
+
border-radius: 50%;
|
|
405
|
+
background: var(--table-icon-color);
|
|
406
|
+
display: inline-block;
|
|
407
|
+
margin-right: 6px;
|
|
408
|
+
box-shadow: 0px 2px 4px 0px var(--table-icon-shadow);
|
|
409
|
+
}
|
|
399
410
|
.custom-big-table .domPropsInnerHTML-span .icon-dot-red {
|
|
400
411
|
width: 8px;
|
|
401
412
|
height: 8px;
|
|
@@ -13,7 +13,7 @@ const testHttpFn = axios.create({
|
|
|
13
13
|
const httpFn = axios.create({ withCredentials: false });
|
|
14
14
|
class Print {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.
|
|
16
|
+
this.messageHandlerQueue = [];
|
|
17
17
|
var _a;
|
|
18
18
|
const _window = window;
|
|
19
19
|
this.webview = (_a = _window.chrome) == null ? void 0 : _a.webview;
|
|
@@ -23,13 +23,13 @@ class Print {
|
|
|
23
23
|
this.webview.addEventListener("message", this.currentMessageHandler);
|
|
24
24
|
}
|
|
25
25
|
messageHandler(e) {
|
|
26
|
-
const handler = this.
|
|
26
|
+
const handler = this.messageHandlerQueue.pop();
|
|
27
27
|
if (!handler)
|
|
28
28
|
return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
|
|
29
29
|
const { resolve, reject } = handler;
|
|
30
30
|
try {
|
|
31
31
|
console.log(e);
|
|
32
|
-
resolve(JSON.parse(e.data));
|
|
32
|
+
resolve(JSON.parse(e.data.res));
|
|
33
33
|
} catch (e2) {
|
|
34
34
|
reject(e2);
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ class Print {
|
|
|
38
38
|
if (!this.webview)
|
|
39
39
|
return Promise.reject();
|
|
40
40
|
return new Promise((resolve, reject) => {
|
|
41
|
-
this.
|
|
41
|
+
this.messageHandlerQueue.push({ resolve, reject });
|
|
42
42
|
this.webview.postMessage(data);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -408,7 +408,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
408
408
|
title: string;
|
|
409
409
|
}[]>;
|
|
410
410
|
formHeight: import("vue").ComputedRef<any>;
|
|
411
|
-
scrollTo: (id: string) => Promise<void>;
|
|
412
411
|
onScroll: () => void;
|
|
413
412
|
queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: import("./src/types").FieldItem[]) => Promise<{
|
|
414
413
|
widgetElement: HTMLInputElement | null | undefined;
|
|
@@ -74,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
}
|
|
75
75
|
return { type: "object", properties: {} };
|
|
76
76
|
});
|
|
77
|
-
const { currentAnchor, scrollbarRef, generateAnchorList, anchorIdList, formHeight,
|
|
77
|
+
const { currentAnchor, scrollbarRef, generateAnchorList, anchorIdList, formHeight, onScroll } = useAnchor(props, formItemDepsCollector);
|
|
78
78
|
watch(parsedSchema, generateAnchorList, { immediate: true });
|
|
79
79
|
async function queryWidget(key, wrapperElement, fieldList) {
|
|
80
80
|
if (!scrollbarRef.value)
|
|
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
formModel.setFieldState(path, handler);
|
|
112
112
|
},
|
|
113
113
|
resetFields(path = "*") {
|
|
114
|
-
formModel.setFieldState(path,
|
|
114
|
+
formModel.setFieldState(path, (field) => {
|
|
115
115
|
var _a;
|
|
116
116
|
if (isField(field)) {
|
|
117
117
|
field.modified = false;
|
|
@@ -408,7 +408,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
408
408
|
title: string;
|
|
409
409
|
}[]>;
|
|
410
410
|
formHeight: import("vue").ComputedRef<any>;
|
|
411
|
-
scrollTo: (id: string) => Promise<void>;
|
|
412
411
|
onScroll: () => void;
|
|
413
412
|
queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: FieldItem[]) => Promise<{
|
|
414
413
|
widgetElement: HTMLInputElement | null | undefined;
|
|
@@ -6,11 +6,11 @@ declare type DependKeyObj = {
|
|
|
6
6
|
paramValue: string;
|
|
7
7
|
};
|
|
8
8
|
declare type UrlConfig = {
|
|
9
|
-
method
|
|
10
|
-
nameKey
|
|
11
|
-
|
|
9
|
+
method?: FormRequestType;
|
|
10
|
+
nameKey?: string;
|
|
11
|
+
valueKey?: string;
|
|
12
|
+
dependKey?: ArrayAble<string> | Record<string, string> | ArrayAble<DependKeyObj>;
|
|
12
13
|
url: string;
|
|
13
|
-
valueKey: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
16
16
|
options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
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
4
|
import { InjectAsyncQueue } from '../../constants/index.js';
|
|
@@ -32,18 +32,43 @@ const script = defineComponent({
|
|
|
32
32
|
slots,
|
|
33
33
|
emit
|
|
34
34
|
}) {
|
|
35
|
-
const remoteOptions = ref(
|
|
36
|
-
const asyncQueue = inject(InjectAsyncQueue);
|
|
35
|
+
const remoteOptions = ref();
|
|
37
36
|
const {
|
|
38
37
|
field,
|
|
39
38
|
title
|
|
40
39
|
} = useFormField();
|
|
40
|
+
const labelKey = computed(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
|
|
43
|
+
});
|
|
44
|
+
const valueKey = computed(() => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
47
|
+
});
|
|
48
|
+
const _value = computed(() => {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = Array.isArray(props.value) ? props.value : JSON.parse(props.value || "");
|
|
51
|
+
if (!Array.isArray(parsed) || !parsed.length)
|
|
52
|
+
return null;
|
|
53
|
+
return parsed.map((option) => option[labelKey.value]).join(" / ");
|
|
54
|
+
} catch (e) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function updateValue(_, __, options) {
|
|
59
|
+
emit("update:value", options.map(optionSimplify));
|
|
60
|
+
function optionSimplify(option) {
|
|
61
|
+
return {
|
|
62
|
+
...option,
|
|
63
|
+
label: option[labelKey.value],
|
|
64
|
+
children: void 0,
|
|
65
|
+
parent: void 0
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const asyncQueue = inject(InjectAsyncQueue);
|
|
41
70
|
async function fetchData(option) {
|
|
42
|
-
if (
|
|
43
|
-
return;
|
|
44
|
-
if (!configFor(props))
|
|
45
|
-
return;
|
|
46
|
-
if (deepFor(option) + 1 >= deepFor(props))
|
|
71
|
+
if (notNeedToFetchData(props, option))
|
|
47
72
|
return;
|
|
48
73
|
const data = await asyncQueue.addAsync(createRequestParams(deepFor(option), configFor(props), title.value, option));
|
|
49
74
|
if (!data.length && option) {
|
|
@@ -54,6 +79,9 @@ const script = defineComponent({
|
|
|
54
79
|
}
|
|
55
80
|
const result = data.map((item) => optionNormalize(item, deepFor(option)));
|
|
56
81
|
option ? option.children = result : remoteOptions.value = result;
|
|
82
|
+
function notNeedToFetchData(props2, option2) {
|
|
83
|
+
return !configFor(props2) || !option2 && remoteOptions.value || deepFor(option2) >= deepFor(props2) - 1;
|
|
84
|
+
}
|
|
57
85
|
function createRequestParams(deep, config, key, option2) {
|
|
58
86
|
const params = {
|
|
59
87
|
lvlnr: deep + 1 + ""
|
|
@@ -95,9 +123,6 @@ const script = defineComponent({
|
|
|
95
123
|
return (_a = target == null ? void 0 : target.depth) != null ? _a : -1;
|
|
96
124
|
}
|
|
97
125
|
}
|
|
98
|
-
const parsedOptions = computed(() => {
|
|
99
|
-
return remoteOptions.value || props.options || [];
|
|
100
|
-
});
|
|
101
126
|
watch(() => props.value, (n, o) => {
|
|
102
127
|
var _a, _b;
|
|
103
128
|
n != null && o == null && fetchData();
|
|
@@ -111,40 +136,14 @@ const script = defineComponent({
|
|
|
111
136
|
remoteOptions.value = null;
|
|
112
137
|
await fetchData();
|
|
113
138
|
});
|
|
114
|
-
const labelKey = computed(() => {
|
|
115
|
-
var _a, _b;
|
|
116
|
-
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
|
|
117
|
-
});
|
|
118
|
-
const valueKey = computed(() => {
|
|
119
|
-
var _a, _b;
|
|
120
|
-
return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
|
|
121
|
-
});
|
|
122
|
-
const _value = computed(() => {
|
|
123
|
-
try {
|
|
124
|
-
const parsed = Array.isArray(props.value) ? props.value : JSON.parse(props.value || "");
|
|
125
|
-
if (!Array.isArray(parsed) || !parsed.length)
|
|
126
|
-
return null;
|
|
127
|
-
return parsed.map((option) => option[labelKey.value]).join(" / ");
|
|
128
|
-
} catch (e) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
function updateValue(_, __, options) {
|
|
133
|
-
emit("update:value", options.map(optionSimplify));
|
|
134
|
-
function optionSimplify(option) {
|
|
135
|
-
return {
|
|
136
|
-
...option,
|
|
137
|
-
label: option[labelKey.value],
|
|
138
|
-
children: void 0,
|
|
139
|
-
parent: void 0
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
139
|
const show = ref(false);
|
|
144
140
|
function updateShow(v) {
|
|
145
141
|
show.value = !!v;
|
|
146
142
|
v && fetchData();
|
|
147
143
|
}
|
|
144
|
+
const parsedOptions = computed(() => {
|
|
145
|
+
return remoteOptions.value || props.options || [];
|
|
146
|
+
});
|
|
148
147
|
function focusDecorator(onFocus) {
|
|
149
148
|
return (...args) => {
|
|
150
149
|
if (isField(field.value)) {
|
|
@@ -155,17 +154,17 @@ const script = defineComponent({
|
|
|
155
154
|
}
|
|
156
155
|
return () => {
|
|
157
156
|
return createVNode(NCascader, {
|
|
158
|
-
"
|
|
157
|
+
"remote": true,
|
|
158
|
+
"checkStrategy": "child",
|
|
159
159
|
"show": !!show.value,
|
|
160
|
+
"onUpdate:show": updateShow,
|
|
161
|
+
"value": _value.value,
|
|
160
162
|
"onUpdate:value": updateValue,
|
|
161
|
-
"remote": true,
|
|
162
163
|
"labelField": labelKey.value,
|
|
163
164
|
"valueField": valueKey.value,
|
|
164
165
|
"options": parsedOptions.value,
|
|
165
|
-
"checkStrategy": "child",
|
|
166
166
|
"onLoad": fetchData,
|
|
167
|
-
"onFocus": focusDecorator(props.onFocus)
|
|
168
|
-
"onUpdate:show": updateShow
|
|
167
|
+
"onFocus": focusDecorator(props.onFocus)
|
|
169
168
|
}, slots);
|
|
170
169
|
};
|
|
171
170
|
}
|
|
@@ -8,6 +8,9 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
8
8
|
value: {
|
|
9
9
|
type: StringConstructor;
|
|
10
10
|
};
|
|
11
|
+
maxGroupNum: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
};
|
|
11
14
|
getProperties: {
|
|
12
15
|
type: PropType<() => FieldItem[]>;
|
|
13
16
|
default: () => never[];
|
|
@@ -20,6 +23,9 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
20
23
|
value: {
|
|
21
24
|
type: StringConstructor;
|
|
22
25
|
};
|
|
26
|
+
maxGroupNum: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
};
|
|
23
29
|
getProperties: {
|
|
24
30
|
type: PropType<() => FieldItem[]>;
|
|
25
31
|
default: () => never[];
|