cnhis-design-vue 3.1.33 → 3.1.34-beta.1
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/components/button-print/src/ButtonPrint.vue2.js +2 -0
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +1 -7
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +2 -5
- package/es/components/form-render/src/components/renderer/radio.js +2 -2
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +1 -7
- package/es/components/form-render/src/components/renderer/remoteSearch.js +2 -5
- package/es/components/form-render/src/components/renderer/searchCascade.js +4 -12
- package/es/components/form-render/src/components/renderer/select.d.ts +1 -7
- package/es/components/form-render/src/components/renderer/select.js +2 -5
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/form-render/src/utils/schema.d.ts +1 -1
- package/es/components/form-render/src/utils/schema.js +4 -4
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +8 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +8 -12
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/{useCommon.d.ts → useAutoFocus.d.ts} +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/{useCommon.js → useAutoFocus.js} +6 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +12 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +11 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +5 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +14 -15
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +9 -9
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +6 -9
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +8 -2
- package/es/components/iho-table/src/utils/index.d.ts +5 -8
- package/es/components/iho-table/src/utils/index.js +24 -23
- package/es/components/index.js +1 -1
- package/es/components/select-person/index.d.ts +1 -2
- package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -2
- package/es/components/select-person/src/SelectPerson.vue2.js +20 -19
- package/es/components/select-person/src/utils/index.d.ts +1 -0
- package/es/components/select-person/src/utils/index.js +15 -1
- package/package.json +2 -2
|
@@ -200,6 +200,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
200
200
|
};
|
|
201
201
|
if (props.strategy === "MULTI") {
|
|
202
202
|
for (let i = 0; i < state.printParams.length; i++) {
|
|
203
|
+
if (i > 0)
|
|
204
|
+
queryParams.printdlgshow = "0";
|
|
203
205
|
printInstance.printDirect({
|
|
204
206
|
...queryParams,
|
|
205
207
|
params: getPrintParams(i)
|
|
@@ -20,7 +20,7 @@ export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, f
|
|
|
20
20
|
export * from '@formily/core';
|
|
21
21
|
export { businessDateParser, isIdCard, isMobile, parseAge2Birthday, parseAge2FromContext, parseBirthday, parseIdCard, transformDateFormat } from './src/utils/business.js';
|
|
22
22
|
export { findNextWidget, queryDecorator, queryInput } from './src/utils/dom.js';
|
|
23
|
-
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema
|
|
23
|
+
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, createVisitedSetter, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema } from './src/utils/schema.js';
|
|
24
24
|
|
|
25
25
|
const FormRender = script;
|
|
26
26
|
FormRender.install = function(app) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
declare type ValueType = string | AnyObject[];
|
|
4
4
|
export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
@@ -6,9 +6,6 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
6
6
|
type: PropType<AnyObject[]>;
|
|
7
7
|
default: () => never[];
|
|
8
8
|
};
|
|
9
|
-
onFocus: {
|
|
10
|
-
type: PropType<Func<any[], any>>;
|
|
11
|
-
};
|
|
12
9
|
autograph: {
|
|
13
10
|
type: StringConstructor;
|
|
14
11
|
required: true;
|
|
@@ -49,9 +46,6 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
49
46
|
type: PropType<AnyObject[]>;
|
|
50
47
|
default: () => never[];
|
|
51
48
|
};
|
|
52
|
-
onFocus: {
|
|
53
|
-
type: PropType<Func<any[], any>>;
|
|
54
|
-
};
|
|
55
49
|
autograph: {
|
|
56
50
|
type: StringConstructor;
|
|
57
51
|
required: true;
|
|
@@ -8,7 +8,7 @@ import { formRenderLog } from '../../utils/index.js';
|
|
|
8
8
|
import { connect, mapProps } from '@formily/vue';
|
|
9
9
|
import SearchCascader from '../../../../search-cascader/index.js';
|
|
10
10
|
import script$1 from '../../../../../shared/components/no-data/NoData.vue.js';
|
|
11
|
-
import {
|
|
11
|
+
import { createVisitedSetter, assignUpdateValue } from '../../utils/schema.js';
|
|
12
12
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
13
13
|
import { useFormRequest } from '../../hooks/useFormRequest.js';
|
|
14
14
|
|
|
@@ -19,9 +19,6 @@ const script = defineComponent({
|
|
|
19
19
|
type: Array,
|
|
20
20
|
default: () => []
|
|
21
21
|
},
|
|
22
|
-
onFocus: {
|
|
23
|
-
type: Function
|
|
24
|
-
},
|
|
25
22
|
autograph: {
|
|
26
23
|
type: String,
|
|
27
24
|
required: true
|
|
@@ -264,7 +261,7 @@ const script = defineComponent({
|
|
|
264
261
|
"labelKey": labelKey.value,
|
|
265
262
|
"valueKey": valueKey.value,
|
|
266
263
|
"search": fetchData,
|
|
267
|
-
"onFocus":
|
|
264
|
+
"onFocus": createVisitedSetter(field)
|
|
268
265
|
}, {
|
|
269
266
|
empty: () => createVNode(script$1, null, null)
|
|
270
267
|
});
|
|
@@ -6,7 +6,7 @@ import '../../../index.js';
|
|
|
6
6
|
import '../../utils/index.js';
|
|
7
7
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
8
8
|
import { useAutographOptions } from '../../hooks/useFormRenderOptions.js';
|
|
9
|
-
import {
|
|
9
|
+
import { createVisitedSetter, assignUpdateValue } from '../../utils/schema.js';
|
|
10
10
|
import { useCommonInjection } from '../../hooks/useCommonInjection.js';
|
|
11
11
|
|
|
12
12
|
function _isSlot(s) {
|
|
@@ -78,7 +78,7 @@ const script = defineComponent({
|
|
|
78
78
|
"key": key.value,
|
|
79
79
|
"value": valueRef.value,
|
|
80
80
|
"onUpdate:value": ($event) => valueRef.value = $event,
|
|
81
|
-
"onClick":
|
|
81
|
+
"onClick": createVisitedSetter(field)
|
|
82
82
|
}, {
|
|
83
83
|
default: () => [createVNode(NSpace, {
|
|
84
84
|
"vertical": props.vertical
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
import { UrlConfig } from '../../../../../../es/components/form-render';
|
|
4
4
|
export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
@@ -16,9 +16,6 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
16
16
|
urlConfig: {
|
|
17
17
|
type: PropType<UrlConfig>;
|
|
18
18
|
};
|
|
19
|
-
onFocus: {
|
|
20
|
-
type: PropType<Func<any[], any>>;
|
|
21
|
-
};
|
|
22
19
|
onChange: {};
|
|
23
20
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
21
|
value: {
|
|
@@ -35,9 +32,6 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
35
32
|
urlConfig: {
|
|
36
33
|
type: PropType<UrlConfig>;
|
|
37
34
|
};
|
|
38
|
-
onFocus: {
|
|
39
|
-
type: PropType<Func<any[], any>>;
|
|
40
|
-
};
|
|
41
35
|
onChange: {};
|
|
42
36
|
}>> & {
|
|
43
37
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -8,7 +8,7 @@ import { InjectionAsyncQueue, InjectionChangeContextCollector, InjectionFormItem
|
|
|
8
8
|
import { createUrlConfigParams, formRenderLog } from '../../utils/index.js';
|
|
9
9
|
import { useCommonInjection, useSelectOptionProps } from '../../hooks/useCommonInjection.js';
|
|
10
10
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
11
|
-
import {
|
|
11
|
+
import { createVisitedSetter, assignUpdateValue, assignClearBindVisited } from '../../utils/schema.js';
|
|
12
12
|
|
|
13
13
|
const script = defineComponent({
|
|
14
14
|
name: "FormRemoteSearch",
|
|
@@ -27,9 +27,6 @@ const script = defineComponent({
|
|
|
27
27
|
urlConfig: {
|
|
28
28
|
type: Object
|
|
29
29
|
},
|
|
30
|
-
onFocus: {
|
|
31
|
-
type: Function
|
|
32
|
-
},
|
|
33
30
|
onChange: {}
|
|
34
31
|
},
|
|
35
32
|
emits: ["update:value"],
|
|
@@ -132,7 +129,7 @@ const script = defineComponent({
|
|
|
132
129
|
"onSearch": fetchData,
|
|
133
130
|
"onUpdate:show": (show) => show && fetchData(),
|
|
134
131
|
"options": parsedOptions.value,
|
|
135
|
-
"onFocus":
|
|
132
|
+
"onFocus": createVisitedSetter(field)
|
|
136
133
|
}, slots);
|
|
137
134
|
};
|
|
138
135
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, inject, watch, createVNode, nextTick } from 'vue';
|
|
2
|
-
import { isField } from '@formily/core';
|
|
3
2
|
import { isEqual, isArray } from 'lodash-es';
|
|
3
|
+
import '../../../index.js';
|
|
4
4
|
import { useCommonInjection } from '../../hooks/useCommonInjection.js';
|
|
5
5
|
import { InjectionAsyncQueue, InjectionFormUUID } from '../../constants/index.js';
|
|
6
6
|
import '../../../../../shared/utils/index.js';
|
|
7
|
-
import '../../../index.js';
|
|
8
7
|
import '../../utils/index.js';
|
|
9
8
|
import { useFormField } from '../../hooks/useFormField.js';
|
|
10
9
|
import '@vueuse/core';
|
|
@@ -19,12 +18,13 @@ import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
|
19
18
|
import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
20
19
|
import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
21
20
|
import '../../hooks/useFormValidator.js';
|
|
21
|
+
import '@formily/core';
|
|
22
22
|
import 'date-fns';
|
|
23
23
|
import '@vue/shared';
|
|
24
24
|
import { connect, mapProps } from '@formily/vue';
|
|
25
25
|
import './index.js';
|
|
26
26
|
import { NCascader } from 'naive-ui';
|
|
27
|
-
import { assignUpdateValue, traverseDependKey } from '../../utils/schema.js';
|
|
27
|
+
import { createVisitedSetter, assignUpdateValue, traverseDependKey } from '../../utils/schema.js';
|
|
28
28
|
|
|
29
29
|
const script = defineComponent({
|
|
30
30
|
name: "FormCascader",
|
|
@@ -210,14 +210,6 @@ const script = defineComponent({
|
|
|
210
210
|
const parsedOptions = computed(() => {
|
|
211
211
|
return remoteOptions.value || props.options || [];
|
|
212
212
|
});
|
|
213
|
-
function visitedDecorator(onFocus) {
|
|
214
|
-
return (...args) => {
|
|
215
|
-
if (isField(field.value)) {
|
|
216
|
-
field.value.visited = true;
|
|
217
|
-
}
|
|
218
|
-
onFocus == null ? void 0 : onFocus(...args);
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
213
|
const remote = computed(() => !props.filterable);
|
|
222
214
|
const key = injectValueBindKey(valueRef);
|
|
223
215
|
return () => {
|
|
@@ -238,7 +230,7 @@ const script = defineComponent({
|
|
|
238
230
|
"valueField": valueKey.value,
|
|
239
231
|
"options": parsedOptions.value,
|
|
240
232
|
"onLoad": fetchData,
|
|
241
|
-
"onFocus":
|
|
233
|
+
"onFocus": createVisitedSetter(field)
|
|
242
234
|
}, slots);
|
|
243
235
|
};
|
|
244
236
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble
|
|
1
|
+
import { AnyObject, ArrayAble } from '../../../../../../es/shared/types';
|
|
2
2
|
import { RecommendItem } from '../../../../../../es/components/recommend-search/src/types';
|
|
3
3
|
import { RecommendIds } from '../../hooks';
|
|
4
4
|
import { UrlConfig } from '../../types';
|
|
@@ -19,9 +19,6 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
19
19
|
type: PropType<AnyObject[]>;
|
|
20
20
|
default: () => never[];
|
|
21
21
|
};
|
|
22
|
-
onFocus: {
|
|
23
|
-
type: PropType<Func<any[], any>>;
|
|
24
|
-
};
|
|
25
22
|
onChange: {};
|
|
26
23
|
urlConfig: {
|
|
27
24
|
type: PropType<UrlConfig>;
|
|
@@ -84,9 +81,6 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
84
81
|
type: PropType<AnyObject[]>;
|
|
85
82
|
default: () => never[];
|
|
86
83
|
};
|
|
87
|
-
onFocus: {
|
|
88
|
-
type: PropType<Func<any[], any>>;
|
|
89
|
-
};
|
|
90
84
|
onChange: {};
|
|
91
85
|
urlConfig: {
|
|
92
86
|
type: PropType<UrlConfig>;
|
|
@@ -25,7 +25,7 @@ import { connect, mapProps } from '@formily/vue';
|
|
|
25
25
|
import './index.js';
|
|
26
26
|
import { useUrlConfigOptions, useAutographOptions, useRecommendOptions } from '../../hooks/useFormRenderOptions.js';
|
|
27
27
|
import { NSelect } from 'naive-ui';
|
|
28
|
-
import {
|
|
28
|
+
import { createVisitedSetter, assignUpdateValue, assignClearBindVisited } from '../../utils/schema.js';
|
|
29
29
|
|
|
30
30
|
const script = defineComponent({
|
|
31
31
|
name: "FormSelect",
|
|
@@ -45,9 +45,6 @@ const script = defineComponent({
|
|
|
45
45
|
type: Array,
|
|
46
46
|
default: () => []
|
|
47
47
|
},
|
|
48
|
-
onFocus: {
|
|
49
|
-
type: Function
|
|
50
|
-
},
|
|
51
48
|
onChange: {},
|
|
52
49
|
urlConfig: {
|
|
53
50
|
type: Object
|
|
@@ -147,7 +144,7 @@ const script = defineComponent({
|
|
|
147
144
|
"options": sortedOptions.value,
|
|
148
145
|
"onSearch": fetchData,
|
|
149
146
|
"onUpdate:show": (show) => show && fetchData(),
|
|
150
|
-
"onFocus":
|
|
147
|
+
"onFocus": createVisitedSetter(field)
|
|
151
148
|
}, slots);
|
|
152
149
|
}
|
|
153
150
|
});
|
|
@@ -9,7 +9,7 @@ import '../../index.js';
|
|
|
9
9
|
import { NESTED_FORM_ITEM_TYPE } from '../constants/index.js';
|
|
10
10
|
import 'date-fns';
|
|
11
11
|
import { traverseDependKey } from './schema.js';
|
|
12
|
-
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema
|
|
12
|
+
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, createVisitedSetter, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema } from './schema.js';
|
|
13
13
|
|
|
14
14
|
function formRenderLog(message) {
|
|
15
15
|
console.warn(`[FormRender]: ${message}`);
|
|
@@ -80,4 +80,4 @@ export declare function createObjSchema(properties: Record<string, ISchema>): {
|
|
|
80
80
|
"x-compile-omitted"?: string[] | undefined;
|
|
81
81
|
}>>;
|
|
82
82
|
};
|
|
83
|
-
export declare function
|
|
83
|
+
export declare function createVisitedSetter(field: Ref<GeneralField>, callback?: Func): (...args: unknown[]) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isField } from '@formily/core';
|
|
2
2
|
import { isObject } from '@vue/shared';
|
|
3
|
-
import { isString, isArray } from 'lodash-es';
|
|
3
|
+
import { isString, isArray, isFunction } from 'lodash-es';
|
|
4
4
|
|
|
5
5
|
function traverseSchema(schema, handler) {
|
|
6
6
|
handler(schema);
|
|
@@ -93,13 +93,13 @@ function assignClearBindVisited(props, field) {
|
|
|
93
93
|
function createObjSchema(properties) {
|
|
94
94
|
return { type: "object", properties };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function createVisitedSetter(field, callback) {
|
|
97
97
|
return (...args) => {
|
|
98
98
|
if (isField(field.value)) {
|
|
99
99
|
field.value.visited = true;
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return isFunction(callback) ? callback(...args) : void 0;
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema
|
|
105
|
+
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, createVisitedSetter, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema };
|
|
@@ -16,7 +16,7 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
16
16
|
field: _field.columnName,
|
|
17
17
|
showOverflow: Reflect.has(_field, "showOverflow") ? _field.showOverflow : "tooltip",
|
|
18
18
|
visible: _field.isShow !== IHO_TABLE_NUMBER_STATUS.NEGATIVE,
|
|
19
|
-
|
|
19
|
+
minWidth: _field.colWidth,
|
|
20
20
|
slots: { ..._field.slots, default: _field.slotFn, header: _field.headerSlotFn },
|
|
21
21
|
...pick(_field, ["title", "treeNode", "resizable"])
|
|
22
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Func } from '../../../../../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
4
4
|
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
value: {
|
|
@@ -8,14 +8,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
default: undefined;
|
|
9
9
|
};
|
|
10
10
|
column: {
|
|
11
|
-
type: PropType<
|
|
11
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
12
12
|
required: true;
|
|
13
13
|
};
|
|
14
14
|
row: {
|
|
15
15
|
type: PropType<AnyObject>;
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
rowIndex: {
|
|
19
19
|
type: NumberConstructor;
|
|
20
20
|
required: true;
|
|
21
21
|
};
|
|
@@ -27,22 +27,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
default: undefined;
|
|
28
28
|
};
|
|
29
29
|
column: {
|
|
30
|
-
type: PropType<
|
|
30
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
31
31
|
required: true;
|
|
32
32
|
};
|
|
33
33
|
row: {
|
|
34
34
|
type: PropType<AnyObject>;
|
|
35
35
|
required: true;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
rowIndex: {
|
|
38
38
|
type: NumberConstructor;
|
|
39
39
|
required: true;
|
|
40
40
|
};
|
|
41
41
|
}>> & {
|
|
42
42
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
43
43
|
}>>;
|
|
44
|
+
emitFormChangeWithParams: (params?: AnyObject) => void;
|
|
44
45
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
45
|
-
globEmit: import("../../../../../../../../es/components/iho-table").IhoTableEmits;
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
48
|
formattedValue: import("vue").Ref<string | undefined>;
|
|
@@ -77,14 +77,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
77
77
|
default: undefined;
|
|
78
78
|
};
|
|
79
79
|
column: {
|
|
80
|
-
type: PropType<
|
|
80
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
81
81
|
required: true;
|
|
82
82
|
};
|
|
83
83
|
row: {
|
|
84
84
|
type: PropType<AnyObject>;
|
|
85
85
|
required: true;
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
rowIndex: {
|
|
88
88
|
type: NumberConstructor;
|
|
89
89
|
required: true;
|
|
90
90
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, useAttrs,
|
|
1
|
+
import { defineComponent, useAttrs, ref, computed, watch, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, isRef } from 'vue';
|
|
2
2
|
import { generateTimeFormat } from '../../../../../../../shared/utils/index.js';
|
|
3
3
|
import { isFunction, isNaN } from 'lodash-es';
|
|
4
4
|
import { NPopover, NInput, NDatePicker } from 'naive-ui';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useIhoTableFormEvent } from '../../../../utils/index.js';
|
|
6
|
+
import { useAutoFocus } from '../hooks/useAutoFocus.js';
|
|
7
7
|
import _export_sfc from '../../../../../../../_virtual/plugin-vue_export-helper.js';
|
|
8
8
|
|
|
9
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -12,23 +12,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
value: { type: String, default: void 0 },
|
|
13
13
|
column: { type: Object, required: true },
|
|
14
14
|
row: { type: Object, required: true },
|
|
15
|
-
|
|
15
|
+
rowIndex: { type: Number, required: true }
|
|
16
16
|
},
|
|
17
17
|
emits: ["update:value"],
|
|
18
18
|
setup(__props, { emit }) {
|
|
19
19
|
const props = __props;
|
|
20
20
|
const attr = useAttrs();
|
|
21
|
-
const
|
|
22
|
-
const { formRef, isShow } =
|
|
21
|
+
const { emitFormChangeWithParams } = useIhoTableFormEvent(props);
|
|
22
|
+
const { formRef, isShow } = useAutoFocus();
|
|
23
23
|
const formattedValue = ref();
|
|
24
24
|
const onConfirm = (value) => {
|
|
25
|
+
const oldValue = props.value;
|
|
25
26
|
emit("update:value", value);
|
|
26
|
-
|
|
27
|
-
value,
|
|
28
|
-
row: props.row,
|
|
29
|
-
column: props.column,
|
|
30
|
-
index: props.index
|
|
31
|
-
});
|
|
27
|
+
emitFormChangeWithParams({ oldValue });
|
|
32
28
|
};
|
|
33
29
|
const { isStartDate = false, isEndDate = false } = attr;
|
|
34
30
|
const connectField = attr.connectField || "";
|
|
@@ -17,7 +17,7 @@ function dateRendererPlugin() {
|
|
|
17
17
|
emitFormClick,
|
|
18
18
|
row,
|
|
19
19
|
column,
|
|
20
|
-
|
|
20
|
+
rowIndex
|
|
21
21
|
}) => {
|
|
22
22
|
return [createVNode(EditDate, mergeProps({
|
|
23
23
|
"value": row[column.field],
|
|
@@ -25,7 +25,7 @@ function dateRendererPlugin() {
|
|
|
25
25
|
}, fieldItem.componentProps, {
|
|
26
26
|
"column": column,
|
|
27
27
|
"row": row,
|
|
28
|
-
"index":
|
|
28
|
+
"row-index": rowIndex,
|
|
29
29
|
"onClick": emitFormClick
|
|
30
30
|
}), null)];
|
|
31
31
|
})
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ref, onMounted } from 'vue';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const useAutoFocus = () => {
|
|
4
4
|
const formRef = ref(null);
|
|
5
|
+
function setRef(ref2) {
|
|
6
|
+
formRef.value = ref2;
|
|
7
|
+
}
|
|
5
8
|
const isShow = ref(false);
|
|
6
9
|
onMounted(() => {
|
|
7
10
|
var _a;
|
|
@@ -10,8 +13,9 @@ const useCommon = () => {
|
|
|
10
13
|
});
|
|
11
14
|
return {
|
|
12
15
|
formRef,
|
|
16
|
+
setRef,
|
|
13
17
|
isShow
|
|
14
18
|
};
|
|
15
19
|
};
|
|
16
20
|
|
|
17
|
-
export {
|
|
21
|
+
export { useAutoFocus };
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js
CHANGED
|
@@ -10,21 +10,28 @@ function inputRendererPlugin() {
|
|
|
10
10
|
return defineTablePlugin({
|
|
11
11
|
name: pluginName,
|
|
12
12
|
vxe(instance) {
|
|
13
|
+
let oldValue = "";
|
|
13
14
|
instance.renderer.add(EDITABLE_WIDGET_TYPE.INPUT, {
|
|
14
15
|
renderCell: IhoTableRenderHelper.createDefaultRenderCell(),
|
|
15
16
|
renderEdit: IhoTableRenderHelper.createRenderEdit(({
|
|
16
17
|
fieldItem,
|
|
17
18
|
row,
|
|
18
19
|
column,
|
|
19
|
-
|
|
20
|
+
emitFormChangeWithParams,
|
|
20
21
|
emitFormClick
|
|
21
22
|
}) => {
|
|
22
23
|
return [createVNode(NInput, mergeProps({
|
|
23
24
|
"value": row[column.field],
|
|
24
|
-
"onUpdate:value": ($event) => row[column.field] = $event
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
25
|
+
"onUpdate:value": ($event) => row[column.field] = $event
|
|
26
|
+
}, fieldItem.componentProps, {
|
|
27
|
+
"onChange": () => {
|
|
28
|
+
emitFormChangeWithParams({
|
|
29
|
+
oldValue
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
"onClick": emitFormClick,
|
|
33
|
+
"onFocus": () => oldValue = row[column.field]
|
|
34
|
+
}), null)];
|
|
28
35
|
})
|
|
29
36
|
});
|
|
30
37
|
}
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js
CHANGED
|
@@ -17,8 +17,7 @@ function numberRendererPlugin() {
|
|
|
17
17
|
column,
|
|
18
18
|
fieldItem,
|
|
19
19
|
emitFormClick,
|
|
20
|
-
|
|
21
|
-
createCustomEvent
|
|
20
|
+
emitFormChangeWithParams
|
|
22
21
|
}) => {
|
|
23
22
|
const {
|
|
24
23
|
placeholder = "\u8BF7\u8F93\u5165"
|
|
@@ -27,10 +26,17 @@ function numberRendererPlugin() {
|
|
|
27
26
|
...fieldItem.componentProps || {},
|
|
28
27
|
clearable: true,
|
|
29
28
|
placeholder,
|
|
30
|
-
onBlur:
|
|
31
|
-
type: "blur"
|
|
29
|
+
onBlur: () => emitFormChangeWithParams({
|
|
30
|
+
type: "blur",
|
|
31
|
+
oldValue: row[column.field]
|
|
32
32
|
}),
|
|
33
|
-
onUpdateValue:
|
|
33
|
+
onUpdateValue: (value) => {
|
|
34
|
+
const oldValue = row[column.field];
|
|
35
|
+
row[column.field] = value;
|
|
36
|
+
emitFormChangeWithParams({
|
|
37
|
+
oldValue
|
|
38
|
+
});
|
|
39
|
+
},
|
|
34
40
|
onClick: emitFormClick
|
|
35
41
|
};
|
|
36
42
|
return [createVNode(NInputNumber, mergeProps({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
3
3
|
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
value: {
|
|
@@ -7,14 +7,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
column: {
|
|
10
|
-
type: PropType<
|
|
10
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
13
|
row: {
|
|
14
14
|
type: PropType<AnyObject>;
|
|
15
15
|
required: true;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
rowIndex: {
|
|
18
18
|
type: NumberConstructor;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
@@ -24,14 +24,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
default: undefined;
|
|
25
25
|
};
|
|
26
26
|
column: {
|
|
27
|
-
type: PropType<
|
|
27
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
28
28
|
required: true;
|
|
29
29
|
};
|
|
30
30
|
row: {
|
|
31
31
|
type: PropType<AnyObject>;
|
|
32
32
|
required: true;
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
rowIndex: {
|
|
35
35
|
type: NumberConstructor;
|
|
36
36
|
required: true;
|
|
37
37
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
2
2
|
import { NSelect } from 'naive-ui';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIhoTableFormEvent } from '../../../../utils/index.js';
|
|
4
|
+
import { useAutoFocus } from '../hooks/useAutoFocus.js';
|
|
5
5
|
|
|
6
6
|
var EditSelect = defineComponent({
|
|
7
7
|
name: "EditSelect",
|
|
@@ -22,7 +22,7 @@ var EditSelect = defineComponent({
|
|
|
22
22
|
type: Object,
|
|
23
23
|
required: true
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
rowIndex: {
|
|
26
26
|
type: Number,
|
|
27
27
|
required: true
|
|
28
28
|
}
|
|
@@ -30,25 +30,24 @@ var EditSelect = defineComponent({
|
|
|
30
30
|
emits: ["update:value"],
|
|
31
31
|
setup(props, {
|
|
32
32
|
attrs,
|
|
33
|
-
slots,
|
|
34
33
|
emit
|
|
35
34
|
}) {
|
|
36
|
-
const globEmit = inject(InjectionIhoTableEmits);
|
|
37
35
|
const {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} =
|
|
36
|
+
isShow,
|
|
37
|
+
setRef
|
|
38
|
+
} = useAutoFocus();
|
|
39
|
+
const {
|
|
40
|
+
emitFormChangeWithParams
|
|
41
|
+
} = useIhoTableFormEvent(props);
|
|
41
42
|
function onUpdateValue(value) {
|
|
43
|
+
const oldValue = props.value;
|
|
42
44
|
emit("update:value", value);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
row: props.row,
|
|
46
|
-
column: props.column,
|
|
47
|
-
index: props.index
|
|
45
|
+
emitFormChangeWithParams({
|
|
46
|
+
oldValue
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
return () => createVNode(NSelect, mergeProps({
|
|
51
|
-
"ref":
|
|
50
|
+
"ref": setRef,
|
|
52
51
|
"show": isShow.value,
|
|
53
52
|
"onUpdate:show": ($event) => isShow.value = $event
|
|
54
53
|
}, attrs, {
|
|
@@ -24,12 +24,12 @@ function selectRendererPlugin() {
|
|
|
24
24
|
emitFormClick,
|
|
25
25
|
row,
|
|
26
26
|
column,
|
|
27
|
-
|
|
27
|
+
rowIndex
|
|
28
28
|
}) => {
|
|
29
29
|
return [createVNode(EditSelect, mergeProps(fieldItem.componentProps, {
|
|
30
30
|
"column": column,
|
|
31
31
|
"row": row,
|
|
32
|
-
"index":
|
|
32
|
+
"row-index": rowIndex,
|
|
33
33
|
"value": row[column.field],
|
|
34
34
|
"onUpdate:value": ($event) => row[column.field] = $event,
|
|
35
35
|
"onClick": emitFormClick
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
2
2
|
import { CSSProperties, PropType } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
value: {};
|
|
6
6
|
height: {
|
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
default: number;
|
|
9
9
|
};
|
|
10
10
|
column: {
|
|
11
|
-
type: PropType<
|
|
11
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
12
12
|
required: true;
|
|
13
13
|
};
|
|
14
14
|
row: {
|
|
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
type: StringConstructor;
|
|
20
20
|
default: string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
rowIndex: {
|
|
23
23
|
type: NumberConstructor;
|
|
24
24
|
required: true;
|
|
25
25
|
};
|
|
@@ -31,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
31
|
default: number;
|
|
32
32
|
};
|
|
33
33
|
column: {
|
|
34
|
-
type: PropType<
|
|
34
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
35
35
|
required: true;
|
|
36
36
|
};
|
|
37
37
|
row: {
|
|
@@ -42,15 +42,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
type: StringConstructor;
|
|
43
43
|
default: string;
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
rowIndex: {
|
|
46
46
|
type: NumberConstructor;
|
|
47
47
|
required: true;
|
|
48
48
|
};
|
|
49
49
|
}>> & {
|
|
50
50
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
51
51
|
}>>;
|
|
52
|
-
|
|
53
|
-
tableHandler: import("../../../../../../../../es/components/iho-table").IhoTableHandler;
|
|
52
|
+
tableHandler: import("../../../../types").IhoTableHandler;
|
|
54
53
|
popoverRef: import("vue").Ref<any>;
|
|
55
54
|
editContent: import("vue").Ref<any>;
|
|
56
55
|
setEditContent: (value: any) => void;
|
|
@@ -58,6 +57,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
57
|
setShow: (v: boolean) => void;
|
|
59
58
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
60
59
|
onShow: () => Promise<void>;
|
|
60
|
+
emitFormChangeWithParams: (params?: AnyObject) => void;
|
|
61
61
|
onClose: () => Promise<void>;
|
|
62
62
|
updateShow: (show: boolean) => void;
|
|
63
63
|
style: import("vue").ComputedRef<CSSProperties>;
|
|
@@ -70,7 +70,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
70
|
default: number;
|
|
71
71
|
};
|
|
72
72
|
column: {
|
|
73
|
-
type: PropType<
|
|
73
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
74
74
|
required: true;
|
|
75
75
|
};
|
|
76
76
|
row: {
|
|
@@ -81,7 +81,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
type: StringConstructor;
|
|
82
82
|
default: string;
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
rowIndex: {
|
|
85
85
|
type: NumberConstructor;
|
|
86
86
|
required: true;
|
|
87
87
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, watch, computed, onMounted, onDeactivated, openBlock, createBlock, unref, withCtx, createElementVNode, withModifiers, normalizeStyle, toDisplayString, renderSlot, createVNode } from 'vue';
|
|
2
2
|
import { cloneDeep, isObject, isArray } from 'lodash-es';
|
|
3
3
|
import { NPopover, NInput } from 'naive-ui';
|
|
4
|
-
import {
|
|
4
|
+
import { InjectionIhoTableHandler } from '../../../../constants/index.js';
|
|
5
|
+
import { useIhoTableFormEvent } from '../../../../utils/index.js';
|
|
5
6
|
import _export_sfc from '../../../../../../../_virtual/plugin-vue_export-helper.js';
|
|
6
7
|
|
|
7
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -12,12 +13,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
13
|
column: { type: Object, required: true },
|
|
13
14
|
row: { type: Object, required: true },
|
|
14
15
|
displayContent: { type: String, default: "" },
|
|
15
|
-
|
|
16
|
+
rowIndex: { type: Number, required: true }
|
|
16
17
|
},
|
|
17
18
|
emits: ["update:value"],
|
|
18
19
|
setup(__props, { emit }) {
|
|
19
20
|
const props = __props;
|
|
20
|
-
const globEmit = inject(InjectionIhoTableEmits);
|
|
21
21
|
const tableHandler = inject(InjectionIhoTableHandler);
|
|
22
22
|
const popoverRef = ref();
|
|
23
23
|
const editContent = ref();
|
|
@@ -36,18 +36,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
(_a = popoverRef.value) == null ? void 0 : _a.syncPosition();
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
+
const { emitFormChangeWithParams } = useIhoTableFormEvent(props);
|
|
39
40
|
async function onClose() {
|
|
40
41
|
if (!isObject(editContent.value) && !isArray(editContent.value)) {
|
|
41
42
|
if (props.value === editContent.value)
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
45
|
+
const oldValue = props.value;
|
|
44
46
|
emit("update:value", editContent.value);
|
|
45
|
-
|
|
46
|
-
value: editContent.value,
|
|
47
|
-
row: props.row,
|
|
48
|
-
column: props.column,
|
|
49
|
-
index: props.dataIndex
|
|
50
|
-
});
|
|
47
|
+
emitFormChangeWithParams({ oldValue });
|
|
51
48
|
tableHandler.updateTableDataRef();
|
|
52
49
|
}
|
|
53
50
|
function updateShow(show2) {
|
|
@@ -53,11 +53,11 @@ function separateRendererPlugins() {
|
|
|
53
53
|
return [createVNode(EditSeparate, {
|
|
54
54
|
"value": row[column.field],
|
|
55
55
|
"onUpdate:value": ($event) => row[column.field] = $event,
|
|
56
|
-
"
|
|
56
|
+
"row-index": separateRow == null ? void 0 : separateRow.index,
|
|
57
57
|
"height": height,
|
|
58
58
|
"column": column,
|
|
59
59
|
"row": row,
|
|
60
|
-
"
|
|
60
|
+
"display-content": (_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field],
|
|
61
61
|
"onClick": emitFormClick
|
|
62
62
|
}, slots)];
|
|
63
63
|
})
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js
CHANGED
|
@@ -16,7 +16,7 @@ function timeRendererPlugin() {
|
|
|
16
16
|
fieldItem,
|
|
17
17
|
row,
|
|
18
18
|
column,
|
|
19
|
-
|
|
19
|
+
emitFormChangeWithParams,
|
|
20
20
|
emitFormClick
|
|
21
21
|
}) => {
|
|
22
22
|
const {
|
|
@@ -28,7 +28,13 @@ function timeRendererPlugin() {
|
|
|
28
28
|
placeholder,
|
|
29
29
|
valueFormat,
|
|
30
30
|
format: valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
31
|
-
onUpdateFormattedValue:
|
|
31
|
+
onUpdateFormattedValue: (value) => {
|
|
32
|
+
const oldValue = row[column.field];
|
|
33
|
+
row[column.field] = value;
|
|
34
|
+
emitFormChangeWithParams({
|
|
35
|
+
oldValue
|
|
36
|
+
});
|
|
37
|
+
},
|
|
32
38
|
onClick: emitFormClick
|
|
33
39
|
};
|
|
34
40
|
return [createVNode(NTimePicker, mergeProps({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnyObject, Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
|
-
import {
|
|
3
|
+
import { VxeTableInstance } from 'vxe-table';
|
|
4
4
|
import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
|
|
5
|
-
import { EventListenerToEventName, IhoTableFieldItem,
|
|
5
|
+
import { EventListenerToEventName, IhoTableFieldItem, LowCodeTableFieldItem } from '../../../../../es/components/iho-table';
|
|
6
6
|
export declare function IhoTableLog(message: string): void;
|
|
7
7
|
export declare function IhoTableWarn(message: string): void;
|
|
8
8
|
export declare const IhoTableUtils: Readonly<{
|
|
@@ -15,14 +15,11 @@ export declare function useUUIDMap<T>(creator: () => T, isReactive?: boolean): {
|
|
|
15
15
|
removeItemFromUUID: (uuid: string) => void;
|
|
16
16
|
};
|
|
17
17
|
export declare function getColumnRenderWidth(column: AnyObject, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
|
|
18
|
-
export declare function useIhoTableFormEvent(
|
|
19
|
-
row: AnyObject;
|
|
20
|
-
column: VxeTableDefines.ColumnInfo;
|
|
21
|
-
$rowIndex: number;
|
|
22
|
-
}): {
|
|
18
|
+
export declare function useIhoTableFormEvent(payload: Pick<VxeGlobalRendererHandles.RenderEditParams, 'row' | 'rowIndex' | 'column'>): {
|
|
23
19
|
emitFormChange: () => void;
|
|
24
20
|
emitFormClick: () => void;
|
|
25
|
-
|
|
21
|
+
emitFormChangeWithParams: (params?: AnyObject) => void;
|
|
22
|
+
emitFormClickWithParams: (params?: AnyObject) => void;
|
|
26
23
|
};
|
|
27
24
|
export declare function getLowCodeFieldFromField(field: IhoTableFieldItem): LowCodeTableFieldItem | undefined;
|
|
28
25
|
declare function createDefaultRenderCell(): ((renderOpts: import("vxe-table").VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.RenderCellParams) => VxeGlobalRendererHandles.RenderResult) | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject, reactive, nextTick, unref, createVNode } from 'vue';
|
|
2
|
-
import { isNumber } from 'lodash-es';
|
|
3
|
-
import {
|
|
1
|
+
import { inject, reactive, nextTick, unref, toRaw, createVNode } from 'vue';
|
|
2
|
+
import { isNumber, cloneDeep } from 'lodash-es';
|
|
3
|
+
import { InjectionIhoTableEmits, InjectionIhoTableConfig } from '../constants/index.js';
|
|
4
4
|
|
|
5
5
|
function IhoTableWarn(message) {
|
|
6
6
|
return console.warn(`[IhoTable]: ${message}`);
|
|
@@ -50,38 +50,39 @@ async function getColumnRenderWidth(column, $table) {
|
|
|
50
50
|
return isNumber(column.width) ? column.width : 64;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function useIhoTableFormEvent({
|
|
54
|
-
row,
|
|
55
|
-
column,
|
|
56
|
-
$rowIndex
|
|
57
|
-
}) {
|
|
53
|
+
function useIhoTableFormEvent(payload) {
|
|
58
54
|
const emit = inject(InjectionIhoTableEmits);
|
|
59
55
|
function getPayload() {
|
|
60
56
|
return {
|
|
61
|
-
value: row[column.field],
|
|
62
|
-
row,
|
|
63
|
-
column,
|
|
64
|
-
index:
|
|
57
|
+
value: payload.row[payload.column.field],
|
|
58
|
+
row: payload.row,
|
|
59
|
+
column: payload.column,
|
|
60
|
+
index: payload.rowIndex
|
|
65
61
|
};
|
|
66
62
|
}
|
|
63
|
+
function emitFormChangeWithParams(params = {}) {
|
|
64
|
+
emit("formChange", {
|
|
65
|
+
...getPayload(),
|
|
66
|
+
...cloneDeep(toRaw(params))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function emitFormClickWithParams(params = {}) {
|
|
70
|
+
emit("formClick", {
|
|
71
|
+
...getPayload(),
|
|
72
|
+
...cloneDeep(toRaw(params))
|
|
73
|
+
});
|
|
74
|
+
}
|
|
67
75
|
function emitFormChange() {
|
|
68
|
-
|
|
76
|
+
emitFormChangeWithParams();
|
|
69
77
|
}
|
|
70
78
|
function emitFormClick() {
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
function createCustomEvent(eventName, params) {
|
|
74
|
-
return function() {
|
|
75
|
-
emit(eventName, {
|
|
76
|
-
...getPayload(),
|
|
77
|
-
...params
|
|
78
|
-
});
|
|
79
|
-
};
|
|
79
|
+
emitFormClickWithParams();
|
|
80
80
|
}
|
|
81
81
|
return {
|
|
82
82
|
emitFormChange,
|
|
83
83
|
emitFormClick,
|
|
84
|
-
|
|
84
|
+
emitFormChangeWithParams,
|
|
85
|
+
emitFormClickWithParams
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
function getLowCodeFieldFromField(field) {
|
package/es/components/index.js
CHANGED
|
@@ -64,7 +64,7 @@ export { useCommonInjection, useSelectOptionProps } from './form-render/src/hook
|
|
|
64
64
|
export { useAutographOptions, useRecommendOptions, useUrlConfigOptions } from './form-render/src/hooks/useFormRenderOptions.js';
|
|
65
65
|
export { businessDateParser, isIdCard, isMobile, parseAge2Birthday, parseAge2FromContext, parseBirthday, parseIdCard, transformDateFormat } from './form-render/src/utils/business.js';
|
|
66
66
|
export { findNextWidget, queryDecorator, queryInput } from './form-render/src/utils/dom.js';
|
|
67
|
-
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema
|
|
67
|
+
export { assignClearBindVisited, assignUpdateValue, assignValueBindKey, createLinebarId, createObjSchema, createVisitedSetter, dotEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema } from './form-render/src/utils/schema.js';
|
|
68
68
|
export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, formRenderLog, injectOrProvide, isNestedFieldType, isNestedType, mergeDeepProperties, optionMatcherWithKeyword, parseNumberFromMaybeString, presetRequestHandler, splitExtendKey, validateMessageParser } from './form-render/src/utils/index.js';
|
|
69
69
|
export * from '@formily/core';
|
|
70
70
|
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './shortcut-provider/src/hooks/useShortcuts.js';
|
|
@@ -104,14 +104,13 @@ declare const SelectPerson: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
104
104
|
allCheckedKeys: never[];
|
|
105
105
|
isRemote: import("vue").ComputedRef<boolean>;
|
|
106
106
|
init: () => void;
|
|
107
|
-
transformTree: (tree: any) => void;
|
|
108
107
|
setDisabled: (data: any) => void;
|
|
109
108
|
renderLabel: ({ option }: {
|
|
110
109
|
option: any;
|
|
111
110
|
}) => any;
|
|
112
111
|
getLabelName: (option: any) => any;
|
|
113
112
|
setAllCheckedKeys: (tree: any) => void;
|
|
114
|
-
|
|
113
|
+
onSearch: () => Promise<void>;
|
|
115
114
|
setTreeCheckd: (tree: any, checked: any) => void;
|
|
116
115
|
checkedAllChange: (checked: any) => void;
|
|
117
116
|
uniq: (arr: any) => any;
|
|
@@ -103,14 +103,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
103
|
allCheckedKeys: never[];
|
|
104
104
|
isRemote: import("vue").ComputedRef<boolean>;
|
|
105
105
|
init: () => void;
|
|
106
|
-
transformTree: (tree: any) => void;
|
|
107
106
|
setDisabled: (data: any) => void;
|
|
108
107
|
renderLabel: ({ option }: {
|
|
109
108
|
option: any;
|
|
110
109
|
}) => any;
|
|
111
110
|
getLabelName: (option: any) => any;
|
|
112
111
|
setAllCheckedKeys: (tree: any) => void;
|
|
113
|
-
|
|
112
|
+
onSearch: () => Promise<void>;
|
|
114
113
|
setTreeCheckd: (tree: any, checked: any) => void;
|
|
115
114
|
checkedAllChange: (checked: any) => void;
|
|
116
115
|
uniq: (arr: any) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, watch, openBlock, createBlock, unref, withCtx, createVNode, withKeys, createTextVNode, toDisplayString, withDirectives, vShow, createCommentVNode, createElementBlock, createElementVNode, Fragment, renderList } from 'vue';
|
|
2
2
|
import { NGrid, NGi, NSpace, NInputGroup, NInput, NButton, NCheckbox, NTree, NIcon, NTooltip } from 'naive-ui';
|
|
3
3
|
import { CloseCircleSharp } from '@vicons/ionicons5';
|
|
4
|
-
import { filterTree } from './utils/index.js';
|
|
4
|
+
import { filterTree, getExpandedKeys } from './utils/index.js';
|
|
5
5
|
import { cloneDeep } from 'lodash-es';
|
|
6
6
|
|
|
7
7
|
const _hoisted_1 = {
|
|
@@ -88,22 +88,22 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
88
|
setTagData(temp);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
function transformTree(tree) {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
for (let i = 0, len = tree.length; i < len; i++) {
|
|
94
|
+
const item = tree[i];
|
|
95
|
+
item.title = getLabelName(item);
|
|
96
|
+
if (!item.key)
|
|
97
|
+
item.key = item[props.wordbookChild.user_id_obj] || item[props.wordbook.parent_id_obj] || Date.now();
|
|
98
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
99
|
+
transformTree(item.children);
|
|
100
|
+
setDisabled(item);
|
|
101
|
+
} else if (((_b = item.children) == null ? void 0 : _b.length) === 0) {
|
|
102
|
+
Reflect.deleteProperty(item, "children");
|
|
103
|
+
}
|
|
104
|
+
if (!item.disabled && !item.children)
|
|
105
|
+
allCheckedKeys.push(item.key);
|
|
104
106
|
}
|
|
105
|
-
if (!item.disabled && !item.children)
|
|
106
|
-
allCheckedKeys.push(item.key);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function setDisabled(data) {
|
|
@@ -141,7 +141,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
141
141
|
allCheckedKeys.push(item.key);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
144
|
+
async function onSearch() {
|
|
145
145
|
if (!isRemote.value) {
|
|
146
146
|
treeData.value = filterTree(temp, keyword.value);
|
|
147
147
|
allCheckedKeys = [];
|
|
@@ -150,6 +150,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
150
|
} else {
|
|
151
151
|
treeData.value = await props.queryTreeSearch(keyword.value);
|
|
152
152
|
}
|
|
153
|
+
expandedKeys.value = treeData.value.length && keyword.value ? getExpandedKeys(treeData.value) : [];
|
|
153
154
|
}
|
|
154
155
|
function setTreeCheckd(tree, checked) {
|
|
155
156
|
for (let i = 0, len = tree.length; i < len; i++) {
|
|
@@ -223,10 +224,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
223
224
|
value: keyword.value,
|
|
224
225
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => keyword.value = $event),
|
|
225
226
|
placeholder: __props.searchPlaceholder,
|
|
226
|
-
onKeyup: withKeys(
|
|
227
|
+
onKeyup: withKeys(onSearch, ["enter"])
|
|
227
228
|
}, null, 8, ["value", "placeholder", "onKeyup"]), createVNode(unref(NButton), {
|
|
228
229
|
type: "primary",
|
|
229
|
-
onClick:
|
|
230
|
+
onClick: onSearch
|
|
230
231
|
}, {
|
|
231
232
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
|
232
233
|
_: 1
|
|
@@ -40,5 +40,19 @@ function filterHandle(data) {
|
|
|
40
40
|
return false;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
function getExpandedKeys(tree) {
|
|
44
|
+
const expandedKeys = [];
|
|
45
|
+
getExpandedKeys2(tree);
|
|
46
|
+
function getExpandedKeys2(tree2) {
|
|
47
|
+
for (let i = 0, len = tree2.length; i < len; i++) {
|
|
48
|
+
const item = tree2[i];
|
|
49
|
+
if (item.children) {
|
|
50
|
+
expandedKeys.push(item.key);
|
|
51
|
+
getExpandedKeys2(item.children);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return expandedKeys;
|
|
56
|
+
}
|
|
43
57
|
|
|
44
|
-
export { filterTree };
|
|
58
|
+
export { filterTree, getExpandedKeys };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.34-beta.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "ec71ec029282a8d1463f23fb466b505ff2c1ccb4"
|
|
65
65
|
}
|