@94ai/nf-search-form 9.0.0 → 10.0.0
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/lib/index.d.ts +2922 -2922
- package/lib/nf-column-check-dialog.vue.d.ts +150 -150
- package/lib/nf-column-check-drawer.vue.d.ts +105 -105
- package/lib/nf-number-range.vue.d.ts +100 -100
- package/lib/nf-search-form-item.vue.d.ts +112 -112
- package/lib/nf-search-form.cjs.js +23 -54
- package/lib/nf-search-form.esm-bundler.js +23 -54
- package/lib/nf-search-form.vue.d.ts +648 -648
- package/lib/nf-time-range.vue.d.ts +36 -36
- package/lib/style/css.d.ts +1 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/types.d.ts +87 -87
- package/package/nf-column-check-drawer.vue +9 -38
- package/package/nf-number-range.vue +1 -5
- package/package/nf-search-form-item.vue +1 -1
- package/package/nf-search-form.vue +9 -48
- package/package/nf-time-range.vue +1 -1
- package/package.json +23 -23
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
-
value?: string[] | undefined;
|
|
3
|
-
endPlaceholder?: string | undefined;
|
|
4
|
-
startPlaceholder?: string | undefined;
|
|
5
|
-
}>, {
|
|
6
|
-
value: () => never[];
|
|
7
|
-
}>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
8
|
-
input: (event: [string | undefined, string | undefined]) => void;
|
|
9
|
-
change: (event: [string | undefined, string | undefined]) => void;
|
|
10
|
-
}, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
-
value?: string[] | undefined;
|
|
12
|
-
endPlaceholder?: string | undefined;
|
|
13
|
-
startPlaceholder?: string | undefined;
|
|
14
|
-
}>, {
|
|
15
|
-
value: () => never[];
|
|
16
|
-
}>>>, {
|
|
17
|
-
value: string[];
|
|
18
|
-
}>;
|
|
19
|
-
export default _default;
|
|
20
|
-
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
-
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
declare type __VLS_WithDefaults<P, D> = {
|
|
30
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
31
|
-
default: D[K];
|
|
32
|
-
}> : P[K];
|
|
33
|
-
};
|
|
34
|
-
declare type __VLS_Prettify<T> = {
|
|
35
|
-
[K in keyof T]: T[K];
|
|
36
|
-
} & {};
|
|
1
|
+
declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
value?: string[] | undefined;
|
|
3
|
+
endPlaceholder?: string | undefined;
|
|
4
|
+
startPlaceholder?: string | undefined;
|
|
5
|
+
}>, {
|
|
6
|
+
value: () => never[];
|
|
7
|
+
}>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
8
|
+
input: (event: [string | undefined, string | undefined]) => void;
|
|
9
|
+
change: (event: [string | undefined, string | undefined]) => void;
|
|
10
|
+
}, string, Readonly<import("vue-demi").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
value?: string[] | undefined;
|
|
12
|
+
endPlaceholder?: string | undefined;
|
|
13
|
+
startPlaceholder?: string | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
value: () => never[];
|
|
16
|
+
}>>>, {
|
|
17
|
+
value: string[];
|
|
18
|
+
}>;
|
|
19
|
+
export default _default;
|
|
20
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
30
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
31
|
+
default: D[K];
|
|
32
|
+
}> : P[K];
|
|
33
|
+
};
|
|
34
|
+
declare type __VLS_Prettify<T> = {
|
|
35
|
+
[K in keyof T]: T[K];
|
|
36
|
+
} & {};
|
package/lib/style/css.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/style/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/types.d.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
export interface IBtnItems {
|
|
2
|
-
btnType?: 'search' | 'export' | 'reset';
|
|
3
|
-
name?: string;
|
|
4
|
-
type?: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
plain?: boolean;
|
|
7
|
-
size?: string;
|
|
8
|
-
round?: boolean;
|
|
9
|
-
circle?: boolean;
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
class?: string;
|
|
13
|
-
validate?: boolean;
|
|
14
|
-
onClick?: (formData: Record<string, any>) => void;
|
|
15
|
-
show?: boolean | ((formData: Record<string, any>) => boolean);
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
interface IExchangeKey {
|
|
19
|
-
type: number;
|
|
20
|
-
value?: any;
|
|
21
|
-
}
|
|
22
|
-
export declare type NfSearchFormItemOption = {
|
|
23
|
-
key?: string;
|
|
24
|
-
_index?: number;
|
|
25
|
-
__index?: number;
|
|
26
|
-
initHidden?: boolean;
|
|
27
|
-
destory?: boolean | ((any: any) => boolean);
|
|
28
|
-
label?: string | ((any: any) => string);
|
|
29
|
-
addLabel?: string;
|
|
30
|
-
prop?: string;
|
|
31
|
-
width?: string;
|
|
32
|
-
isShowColon?: boolean;
|
|
33
|
-
hidden?: boolean;
|
|
34
|
-
required?: boolean;
|
|
35
|
-
rules?: Record<string, any>;
|
|
36
|
-
size?: 'medium' | 'small' | 'mini';
|
|
37
|
-
labelWidth?: string;
|
|
38
|
-
'is-range'?: boolean;
|
|
39
|
-
showMessage?: boolean;
|
|
40
|
-
inlineMessage?: boolean;
|
|
41
|
-
getOptions?: (callback: (options: any[]) => void, formData: Record<string, any>) => void;
|
|
42
|
-
changeProps?: string[];
|
|
43
|
-
show?: (formData: Record<string, any>) => boolean;
|
|
44
|
-
exchangeKey?: IExchangeKey;
|
|
45
|
-
category?: string;
|
|
46
|
-
initValue?: any;
|
|
47
|
-
slot?: string;
|
|
48
|
-
labelSlot?: string;
|
|
49
|
-
inputSlot?: {
|
|
50
|
-
prepend?: string;
|
|
51
|
-
append?: string;
|
|
52
|
-
suffix?: string;
|
|
53
|
-
prefix?: string;
|
|
54
|
-
doublePrepend?: string;
|
|
55
|
-
doubleAppend?: string;
|
|
56
|
-
doubleSuffix?: string;
|
|
57
|
-
doublePrefix?: string;
|
|
58
|
-
doubleSegment?: string;
|
|
59
|
-
};
|
|
60
|
-
class?: string;
|
|
61
|
-
tooltip?: {
|
|
62
|
-
slot: string;
|
|
63
|
-
};
|
|
64
|
-
type?: 'monthrange' | 'datetimerange' | 'daterange' | 'yearrange' | 'halfyearrange' | 'quarterrange' | 'date' | 'month' | 'week' | 'dates';
|
|
65
|
-
element?: 'el-input' | 'el-select' | 'custom-select' | 'ai-select' | 'ai-custom-select' | 'nf-lazy-select' | 'el-input-number' | 'el-date-picker' | 'el-cascader' | 'el-time-select' | 'el-time-picker' | 'number-range' | 'nf-date-picker' | 'nf-timezone-picker' | 'nf-quarter-picker' | 'nf-half-year-picker' | 'nf-double-year' | 'nf-double-week' | 'nf-double-half-year' | 'nf-double-quarter' | 'nf-transfer-select';
|
|
66
|
-
events?: Record<string, Function>;
|
|
67
|
-
placeholder?: string;
|
|
68
|
-
virtualList?: boolean;
|
|
69
|
-
'controls-position'?: 'right' | 'left';
|
|
70
|
-
clearable?: boolean;
|
|
71
|
-
startPlaceholder?: string;
|
|
72
|
-
rangeSeparator?: string;
|
|
73
|
-
endPlaceholder?: string;
|
|
74
|
-
defaultTime?: string[];
|
|
75
|
-
options?: {
|
|
76
|
-
label: string;
|
|
77
|
-
value: string | number;
|
|
78
|
-
}[];
|
|
79
|
-
'picker-options'?: {
|
|
80
|
-
start: string;
|
|
81
|
-
step: string;
|
|
82
|
-
end: string;
|
|
83
|
-
};
|
|
84
|
-
valueFormat?: string;
|
|
85
|
-
min?: 0;
|
|
86
|
-
};
|
|
87
|
-
export {};
|
|
1
|
+
export interface IBtnItems {
|
|
2
|
+
btnType?: 'search' | 'export' | 'reset';
|
|
3
|
+
name?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
plain?: boolean;
|
|
7
|
+
size?: string;
|
|
8
|
+
round?: boolean;
|
|
9
|
+
circle?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
validate?: boolean;
|
|
14
|
+
onClick?: (formData: Record<string, any>) => void;
|
|
15
|
+
show?: boolean | ((formData: Record<string, any>) => boolean);
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
interface IExchangeKey {
|
|
19
|
+
type: number;
|
|
20
|
+
value?: any;
|
|
21
|
+
}
|
|
22
|
+
export declare type NfSearchFormItemOption = {
|
|
23
|
+
key?: string;
|
|
24
|
+
_index?: number;
|
|
25
|
+
__index?: number;
|
|
26
|
+
initHidden?: boolean;
|
|
27
|
+
destory?: boolean | ((any: any) => boolean);
|
|
28
|
+
label?: string | ((any: any) => string);
|
|
29
|
+
addLabel?: string;
|
|
30
|
+
prop?: string;
|
|
31
|
+
width?: string;
|
|
32
|
+
isShowColon?: boolean;
|
|
33
|
+
hidden?: boolean;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
rules?: Record<string, any>;
|
|
36
|
+
size?: 'medium' | 'small' | 'mini';
|
|
37
|
+
labelWidth?: string;
|
|
38
|
+
'is-range'?: boolean;
|
|
39
|
+
showMessage?: boolean;
|
|
40
|
+
inlineMessage?: boolean;
|
|
41
|
+
getOptions?: (callback: (options: any[]) => void, formData: Record<string, any>) => void;
|
|
42
|
+
changeProps?: string[];
|
|
43
|
+
show?: (formData: Record<string, any>) => boolean;
|
|
44
|
+
exchangeKey?: IExchangeKey;
|
|
45
|
+
category?: string;
|
|
46
|
+
initValue?: any;
|
|
47
|
+
slot?: string;
|
|
48
|
+
labelSlot?: string;
|
|
49
|
+
inputSlot?: {
|
|
50
|
+
prepend?: string;
|
|
51
|
+
append?: string;
|
|
52
|
+
suffix?: string;
|
|
53
|
+
prefix?: string;
|
|
54
|
+
doublePrepend?: string;
|
|
55
|
+
doubleAppend?: string;
|
|
56
|
+
doubleSuffix?: string;
|
|
57
|
+
doublePrefix?: string;
|
|
58
|
+
doubleSegment?: string;
|
|
59
|
+
};
|
|
60
|
+
class?: string;
|
|
61
|
+
tooltip?: {
|
|
62
|
+
slot: string;
|
|
63
|
+
};
|
|
64
|
+
type?: 'monthrange' | 'datetimerange' | 'daterange' | 'yearrange' | 'halfyearrange' | 'quarterrange' | 'date' | 'month' | 'week' | 'dates';
|
|
65
|
+
element?: 'el-input' | 'el-select' | 'custom-select' | 'ai-select' | 'ai-custom-select' | 'nf-lazy-select' | 'el-input-number' | 'el-date-picker' | 'el-cascader' | 'el-time-select' | 'el-time-picker' | 'number-range' | 'nf-date-picker' | 'nf-timezone-picker' | 'nf-quarter-picker' | 'nf-half-year-picker' | 'nf-double-year' | 'nf-double-week' | 'nf-double-half-year' | 'nf-double-quarter' | 'nf-transfer-select';
|
|
66
|
+
events?: Record<string, Function>;
|
|
67
|
+
placeholder?: string;
|
|
68
|
+
virtualList?: boolean;
|
|
69
|
+
'controls-position'?: 'right' | 'left';
|
|
70
|
+
clearable?: boolean;
|
|
71
|
+
startPlaceholder?: string;
|
|
72
|
+
rangeSeparator?: string;
|
|
73
|
+
endPlaceholder?: string;
|
|
74
|
+
defaultTime?: string[];
|
|
75
|
+
options?: {
|
|
76
|
+
label: string;
|
|
77
|
+
value: string | number;
|
|
78
|
+
}[];
|
|
79
|
+
'picker-options'?: {
|
|
80
|
+
start: string;
|
|
81
|
+
step: string;
|
|
82
|
+
end: string;
|
|
83
|
+
};
|
|
84
|
+
valueFormat?: string;
|
|
85
|
+
min?: 0;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
|
@@ -269,15 +269,11 @@ const pullAwayColumn = (column) => {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
const insertColumn = (column
|
|
272
|
+
const insertColumn = (column) => {
|
|
273
273
|
const unFixedIndex = unFixedColumn.value.findIndex(item => item.prop === column.prop)
|
|
274
274
|
const fixedIndex = fixedColumn.value.findIndex(item => item.prop === column.prop)
|
|
275
275
|
if (unFixedIndex === -1 && fixedIndex === -1) {
|
|
276
|
-
|
|
277
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column)
|
|
278
|
-
} else {
|
|
279
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).unshift(column)
|
|
280
|
-
}
|
|
276
|
+
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column)
|
|
281
277
|
}
|
|
282
278
|
}
|
|
283
279
|
|
|
@@ -340,13 +336,14 @@ const handleCheckAllChange = (v) => {
|
|
|
340
336
|
if (item) {
|
|
341
337
|
item.initHidden = false
|
|
342
338
|
const cloneItem = deepClone(item)
|
|
343
|
-
if (!cloneItem.attr) {
|
|
344
|
-
cloneItem.attr = {}
|
|
345
|
-
}
|
|
346
339
|
newColumns.push(cloneItem)
|
|
347
340
|
}
|
|
348
341
|
})
|
|
349
342
|
currentTable.value = newColumns
|
|
343
|
+
if (columnName.value) {
|
|
344
|
+
searchValue = currentTable.value.filter(item => (item.addLabel || item.label).includes(columnName.value))
|
|
345
|
+
setFields(searchValue)
|
|
346
|
+
}
|
|
350
347
|
currentTable.value.map(item => {
|
|
351
348
|
if (item.attr.fixed) {
|
|
352
349
|
fixedColumn.value.push(item)
|
|
@@ -364,7 +361,7 @@ const handleCheckAllChange = (v) => {
|
|
|
364
361
|
searchValue.map(item => {
|
|
365
362
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
366
363
|
if (v) { // 追加
|
|
367
|
-
insertColumn(item
|
|
364
|
+
insertColumn(item)
|
|
368
365
|
} else {
|
|
369
366
|
pullAwayColumn(item)
|
|
370
367
|
}
|
|
@@ -377,7 +374,7 @@ const handleCheckAllChange = (v) => {
|
|
|
377
374
|
currentTable.value.map(item => {
|
|
378
375
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
379
376
|
if (v) { // 追加
|
|
380
|
-
insertColumn(item
|
|
377
|
+
insertColumn(item)
|
|
381
378
|
} else {
|
|
382
379
|
pullAwayColumn(item)
|
|
383
380
|
}
|
|
@@ -402,37 +399,12 @@ const handleCheckedChange = (v, prop) => {
|
|
|
402
399
|
item.initHidden = !v
|
|
403
400
|
// 清除列目时,清除固定属性
|
|
404
401
|
v ? '' : item.attr.fixed = false
|
|
405
|
-
v ? insertColumn(item
|
|
402
|
+
v ? insertColumn(item) : pullAwayColumn(item)
|
|
406
403
|
}
|
|
407
404
|
})
|
|
408
405
|
updateCheckStatus()
|
|
409
406
|
}
|
|
410
407
|
|
|
411
|
-
/**
|
|
412
|
-
* 固定/取消固定
|
|
413
|
-
* @param {Boolean} v 是否取消 true:固定; false: 取消固定
|
|
414
|
-
* @param {String} prop 当前选中列目的 prop
|
|
415
|
-
*/
|
|
416
|
-
const handleFixed = (v, prop) => {
|
|
417
|
-
const columnInfo = currentTable.value.find(item => item.prop === prop)
|
|
418
|
-
if (columnInfo) {
|
|
419
|
-
columnInfo.attr.fixed = v ? 'left' : false
|
|
420
|
-
if (v) { // 固定
|
|
421
|
-
const unFixedColumnIndex = unFixedColumn.value.findIndex(unFixedColumnItem => unFixedColumnItem.prop === columnInfo.prop)
|
|
422
|
-
if (unFixedColumnIndex > -1) {
|
|
423
|
-
unFixedColumn.value.splice(unFixedColumnIndex, 1)
|
|
424
|
-
fixedColumn.value.push(columnInfo)
|
|
425
|
-
}
|
|
426
|
-
} else { // 取消固定
|
|
427
|
-
const fixedColumnIndex = fixedColumn.value.findIndex(fixedColumnItem => fixedColumnItem.prop === columnInfo.prop)
|
|
428
|
-
if (fixedColumnIndex > -1) {
|
|
429
|
-
fixedColumn.value.splice(fixedColumnIndex, 1)
|
|
430
|
-
unFixedColumn.value.push(columnInfo)
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
408
|
/**
|
|
437
409
|
* 确定
|
|
438
410
|
*/
|
|
@@ -500,4 +472,3 @@ defineExpose({
|
|
|
500
472
|
drag,
|
|
501
473
|
})
|
|
502
474
|
</script>
|
|
503
|
-
|
|
@@ -100,7 +100,7 @@ const emit = defineEmits<{
|
|
|
100
100
|
|
|
101
101
|
const inputlistens = computed(() => {
|
|
102
102
|
const list = Object.assign({},
|
|
103
|
-
instance?.$listeners
|
|
103
|
+
instance?.$listeners,
|
|
104
104
|
{
|
|
105
105
|
change: function() {
|
|
106
106
|
emit('change', [minNumber.value, maxNumber.value])
|
|
@@ -164,8 +164,4 @@ watch(() => {
|
|
|
164
164
|
emit('input', [minNumber.value, maxNumber.value])
|
|
165
165
|
})
|
|
166
166
|
|
|
167
|
-
const input = () => {
|
|
168
|
-
emit('input', [minNumber.value, maxNumber.value])
|
|
169
|
-
}
|
|
170
|
-
|
|
171
167
|
</script>
|
|
@@ -367,9 +367,6 @@ import {
|
|
|
367
367
|
resolveValue,
|
|
368
368
|
useLocale
|
|
369
369
|
} from '@94ai/common-utils'
|
|
370
|
-
import {
|
|
371
|
-
throttle
|
|
372
|
-
} from 'lodash-es'
|
|
373
370
|
import { useRoute } from 'vue-router/composables'
|
|
374
371
|
import { ELEMENT_LABEL_TYPE_DEFAULT_VALUE, EXCHANGE_KEY_TYPE } from '@94ai/common-constants'
|
|
375
372
|
import { ITabItem } from '@94ai/nf-drawer/lib/types'
|
|
@@ -718,9 +715,6 @@ const cStorageKey = computed(() => {
|
|
|
718
715
|
return key
|
|
719
716
|
})
|
|
720
717
|
|
|
721
|
-
const cStorageKeyViewIdentity = computed(() => {
|
|
722
|
-
return 'nf-search-form-view-identity'
|
|
723
|
-
})
|
|
724
718
|
|
|
725
719
|
|
|
726
720
|
const processedColumns = computed(() => {
|
|
@@ -784,11 +778,6 @@ const checkViewIdentityChange = async () => {
|
|
|
784
778
|
*/
|
|
785
779
|
const nfSearchFormModel = ref<Record<string, any>>(deepClone(props.defaultFormData))
|
|
786
780
|
|
|
787
|
-
// 获取value
|
|
788
|
-
const getValue = (item) => {
|
|
789
|
-
return mapDispose.getValue(nfSearchFormModel.value, item.prop)
|
|
790
|
-
}
|
|
791
|
-
|
|
792
781
|
// 设置值
|
|
793
782
|
const setValue = (item, val) => {
|
|
794
783
|
mapDispose.setValue(nfSearchFormModel.value, item.prop, val)
|
|
@@ -855,9 +844,7 @@ const btnItemsInit = () => {
|
|
|
855
844
|
let list = deepClone(props.btnItems)
|
|
856
845
|
// string类型
|
|
857
846
|
if (useValidate.isString(props.btnItems)) {
|
|
858
|
-
list = [
|
|
859
|
-
...(props.btnItems ? [{ btnType: props.btnItems }] : [])
|
|
860
|
-
]
|
|
847
|
+
list = [{ btnType: props.btnItems }]
|
|
861
848
|
}
|
|
862
849
|
list = list.map(item => {
|
|
863
850
|
if (useValidate.isString(item)) {
|
|
@@ -1181,10 +1168,10 @@ onBeforeMount(() => {
|
|
|
1181
1168
|
* 剔除隐藏筛选项字段 | 刷新表单数据
|
|
1182
1169
|
* @description 未勾选的筛选项,给予undefined;已勾选的若初次展示,设置默认值
|
|
1183
1170
|
*/
|
|
1184
|
-
|
|
1171
|
+
function refreshNfSearchFormModel() {
|
|
1185
1172
|
processedColumns.value.filter(item => !resolveValue(item.destory, nfSearchFormModel.value)).forEach(v => {
|
|
1186
1173
|
if (!localShowItems.value.includes(v.prop)) {
|
|
1187
|
-
mapDispose.setValue(nfSearchFormModel.value, v.
|
|
1174
|
+
mapDispose.setValue(nfSearchFormModel.value, v.prop, undefined)
|
|
1188
1175
|
} else if (nfSearchFormModel.value[v.prop] === undefined) {
|
|
1189
1176
|
setDefaultVal(v)
|
|
1190
1177
|
}
|
|
@@ -1210,7 +1197,6 @@ const isCollapseChange = async (val: boolean) => {
|
|
|
1210
1197
|
refreshLabel()
|
|
1211
1198
|
}
|
|
1212
1199
|
|
|
1213
|
-
const domWidth = ref()
|
|
1214
1200
|
const topDom = ref()
|
|
1215
1201
|
const refreshLabel = () => {
|
|
1216
1202
|
if (props.btnModel === 'inline' && !props.btnBoxLabel && props.labelPosition === 'top') {
|
|
@@ -1246,25 +1232,14 @@ const calcColumns = () => {
|
|
|
1246
1232
|
newColumns.value = count
|
|
1247
1233
|
}
|
|
1248
1234
|
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
const onResize = async (params: Record<string, any> = {}) => {
|
|
1252
|
-
const {
|
|
1253
|
-
width
|
|
1254
|
-
} = (params?.[0]?.contentRect) || {}
|
|
1255
|
-
if (width && domWidth.value && width === domWidth.value) {
|
|
1256
|
-
return
|
|
1257
|
-
}
|
|
1258
|
-
if (domWidth.value) {
|
|
1259
|
-
await nextTick()
|
|
1260
|
-
domWidth.value = topDom.value.offsetWidth
|
|
1261
|
-
}
|
|
1235
|
+
const onResize = async (_params?: Record<string, any>) => {
|
|
1262
1236
|
refreshLabel()
|
|
1263
1237
|
}
|
|
1264
1238
|
|
|
1265
1239
|
const observer = ref()
|
|
1266
1240
|
onMounted(async () => {
|
|
1267
1241
|
await nextTick()
|
|
1242
|
+
if (!topDom.value) return
|
|
1268
1243
|
observer.value = new ResizeObserver(onResize)
|
|
1269
1244
|
observer.value.observe(topDom.value, { box: 'border-box' })
|
|
1270
1245
|
})
|
|
@@ -1323,11 +1298,11 @@ const onNfSearchFormClick = (item) => {
|
|
|
1323
1298
|
}
|
|
1324
1299
|
|
|
1325
1300
|
/**
|
|
1326
|
-
* 把该item
|
|
1301
|
+
* 把该item暂时隐藏
|
|
1327
1302
|
* @param prop
|
|
1328
1303
|
*/
|
|
1329
1304
|
const hiddenNfSearchFormItemOptionField = async (prop) => {
|
|
1330
|
-
|
|
1305
|
+
props.formOptions._skip = true
|
|
1331
1306
|
processedColumns.value.every(item => {
|
|
1332
1307
|
if (item.prop === prop) {
|
|
1333
1308
|
item.initHidden = true
|
|
@@ -1346,23 +1321,10 @@ const hiddenNfSearchFormItemOptionField = async (prop) => {
|
|
|
1346
1321
|
refreshLabel()
|
|
1347
1322
|
}
|
|
1348
1323
|
|
|
1349
|
-
const columnCheckConfirmFeedback = (value: Record<string, any>) => {
|
|
1350
|
-
if (!props.columnEdit) {
|
|
1351
|
-
const itemsList: string[] = []
|
|
1352
|
-
for (const key in value) {
|
|
1353
|
-
if (value[key]) {
|
|
1354
|
-
itemsList.push(key)
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
setLocalShowItems(itemsList, true)
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
1324
|
// 抽屉确定
|
|
1362
1325
|
const columnCheckConfirm = async (cb, error) => {
|
|
1363
1326
|
try {
|
|
1364
|
-
|
|
1365
|
-
columnCheckConfirmFeedback(value)
|
|
1327
|
+
columnCheckDrawer.value.syncTableColumnsToCookies()
|
|
1366
1328
|
await syncCookiesToLocalShowColumn(true)
|
|
1367
1329
|
await syncCookiesToSearchFormItemOptions()
|
|
1368
1330
|
await nextTick()
|
|
@@ -1386,8 +1348,7 @@ async function clearColumnEditCached() {
|
|
|
1386
1348
|
/**
|
|
1387
1349
|
* 保存表单显示的字段
|
|
1388
1350
|
*/
|
|
1389
|
-
const nfSearchFormItemOptionFieldsSave = async (
|
|
1390
|
-
columnCheckConfirmFeedback(value)
|
|
1351
|
+
const nfSearchFormItemOptionFieldsSave = async () => {
|
|
1391
1352
|
await syncCookiesToLocalShowColumn(true)
|
|
1392
1353
|
await syncCookiesToSearchFormItemOptions()
|
|
1393
1354
|
await nextTick()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-search-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,28 +14,29 @@
|
|
|
14
14
|
"url": "http://gitlab.94ai.pro/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-constants": "^
|
|
18
|
-
"@94ai/common-utils": "^
|
|
19
|
-
"@94ai/nf-button": "^
|
|
20
|
-
"@94ai/nf-double-half-year": "^
|
|
21
|
-
"@94ai/nf-double-quarter": "^
|
|
22
|
-
"@94ai/nf-double-week": "^
|
|
23
|
-
"@94ai/nf-double-year": "^
|
|
24
|
-
"@94ai/nf-drawer": "^
|
|
25
|
-
"@94ai/nf-form": "^
|
|
26
|
-
"@94ai/nf-form-item": "^
|
|
27
|
-
"@94ai/nf-half-year-picker": "^
|
|
28
|
-
"@94ai/nf-lazy-select": "^
|
|
29
|
-
"@94ai/nf-message": "^
|
|
30
|
-
"@94ai/nf-quarter-picker": "^
|
|
31
|
-
"@94ai/nf-theme-chalk": "^
|
|
32
|
-
"@94ai/nf-transfer-select": "^
|
|
33
|
-
"@94ai/nf-virtual-select": "^
|
|
17
|
+
"@94ai/common-constants": "^10.0.0",
|
|
18
|
+
"@94ai/common-utils": "^10.0.0",
|
|
19
|
+
"@94ai/nf-button": "^10.0.0",
|
|
20
|
+
"@94ai/nf-double-half-year": "^10.0.0",
|
|
21
|
+
"@94ai/nf-double-quarter": "^10.0.0",
|
|
22
|
+
"@94ai/nf-double-week": "^10.0.0",
|
|
23
|
+
"@94ai/nf-double-year": "^10.0.0",
|
|
24
|
+
"@94ai/nf-drawer": "^10.0.0",
|
|
25
|
+
"@94ai/nf-form": "^10.0.0",
|
|
26
|
+
"@94ai/nf-form-item": "^10.0.0",
|
|
27
|
+
"@94ai/nf-half-year-picker": "^10.0.0",
|
|
28
|
+
"@94ai/nf-lazy-select": "^10.0.0",
|
|
29
|
+
"@94ai/nf-message": "^10.0.0",
|
|
30
|
+
"@94ai/nf-quarter-picker": "^10.0.0",
|
|
31
|
+
"@94ai/nf-theme-chalk": "^10.0.0",
|
|
32
|
+
"@94ai/nf-transfer-select": "^10.0.0",
|
|
33
|
+
"@94ai/nf-virtual-select": "^10.0.0",
|
|
34
34
|
"idb-keyval": "^6.2.1",
|
|
35
35
|
"resize-observer-polyfill": "^1.5.1",
|
|
36
36
|
"vue-demi": "^0.14.5",
|
|
37
37
|
"vue-router": "3.6.4",
|
|
38
|
-
"vuedraggable": "^2.24.3"
|
|
38
|
+
"vuedraggable": "^2.24.3",
|
|
39
|
+
"@94ai/vue2-runtime-helpers": "1.0.1"
|
|
39
40
|
},
|
|
40
41
|
"peerDependenciesMeta": {
|
|
41
42
|
"@vue/composition-api": {
|
|
@@ -44,11 +45,10 @@
|
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"@vue/composition-api": "^1.0.0-rc.1",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
48
|
+
"vue": "^2.0.0 || >=3.0.0",
|
|
49
|
+
"element-ui": ">=2.13.2"
|
|
49
50
|
},
|
|
50
51
|
"types": "lib/index.d.ts",
|
|
51
52
|
"main": "lib/nf-search-form.cjs.js",
|
|
52
|
-
"module": "lib/nf-search-form.esm-bundler.js"
|
|
53
|
-
"gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
|
|
53
|
+
"module": "lib/nf-search-form.esm-bundler.js"
|
|
54
54
|
}
|