@94ai/nf-search-form 3.2.24 → 3.2.26
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 +38 -62
- package/lib/nf-search-form-item.vue.d.ts +0 -9
- package/lib/nf-search-form.cjs.js +58 -66
- package/lib/nf-search-form.esm-bundler.js +59 -67
- package/lib/nf-search-form.vue.d.ts +15 -22
- package/package/nf-search-form-item.vue +16 -20
- package/package/nf-search-form.vue +22 -11
- package/package.json +16 -16
package/lib/index.d.ts
CHANGED
|
@@ -68,14 +68,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
68
68
|
type: import("vue-demi").PropType<boolean>;
|
|
69
69
|
default: boolean;
|
|
70
70
|
};
|
|
71
|
-
itemWidth: {
|
|
72
|
-
type: import("vue-demi").PropType<number>;
|
|
73
|
-
default: number;
|
|
74
|
-
};
|
|
75
71
|
rules: {
|
|
76
72
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
77
73
|
default: undefined;
|
|
78
74
|
};
|
|
75
|
+
inline: {
|
|
76
|
+
type: import("vue-demi").PropType<boolean>;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
79
|
upIcon: {
|
|
80
80
|
type: import("vue-demi").PropType<string>;
|
|
81
81
|
default: string;
|
|
@@ -154,16 +154,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
154
154
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
155
155
|
default: string;
|
|
156
156
|
};
|
|
157
|
-
inline: {
|
|
158
|
-
type: import("vue-demi").PropType<boolean>;
|
|
159
|
-
default: boolean;
|
|
160
|
-
};
|
|
161
157
|
btnBoxLabel: {
|
|
162
158
|
type: import("vue-demi").PropType<string>;
|
|
163
159
|
default: string;
|
|
164
160
|
};
|
|
165
161
|
btnModel: {
|
|
166
|
-
type: import("vue-demi").PropType<"
|
|
162
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
167
163
|
default: string;
|
|
168
164
|
};
|
|
169
165
|
labelWidth: {
|
|
@@ -473,14 +469,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
473
469
|
type: import("vue-demi").PropType<boolean>;
|
|
474
470
|
default: boolean;
|
|
475
471
|
};
|
|
476
|
-
itemWidth: {
|
|
477
|
-
type: import("vue-demi").PropType<number>;
|
|
478
|
-
default: number;
|
|
479
|
-
};
|
|
480
472
|
rules: {
|
|
481
473
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
482
474
|
default: undefined;
|
|
483
475
|
};
|
|
476
|
+
inline: {
|
|
477
|
+
type: import("vue-demi").PropType<boolean>;
|
|
478
|
+
default: boolean;
|
|
479
|
+
};
|
|
484
480
|
upIcon: {
|
|
485
481
|
type: import("vue-demi").PropType<string>;
|
|
486
482
|
default: string;
|
|
@@ -559,16 +555,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
559
555
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
560
556
|
default: string;
|
|
561
557
|
};
|
|
562
|
-
inline: {
|
|
563
|
-
type: import("vue-demi").PropType<boolean>;
|
|
564
|
-
default: boolean;
|
|
565
|
-
};
|
|
566
558
|
btnBoxLabel: {
|
|
567
559
|
type: import("vue-demi").PropType<string>;
|
|
568
560
|
default: string;
|
|
569
561
|
};
|
|
570
562
|
btnModel: {
|
|
571
|
-
type: import("vue-demi").PropType<"
|
|
563
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
572
564
|
default: string;
|
|
573
565
|
};
|
|
574
566
|
labelWidth: {
|
|
@@ -835,8 +827,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
835
827
|
size: "medium" | "small" | "mini";
|
|
836
828
|
selectEmptyWarningTips: string;
|
|
837
829
|
disabled: boolean;
|
|
838
|
-
itemWidth: number;
|
|
839
830
|
rules: Record<string, any>;
|
|
831
|
+
inline: boolean;
|
|
840
832
|
upIcon: string;
|
|
841
833
|
downIcon: string;
|
|
842
834
|
columns: number;
|
|
@@ -855,9 +847,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
855
847
|
statusIcon: boolean;
|
|
856
848
|
validateOnRuleChange: boolean;
|
|
857
849
|
labelPosition: "right" | "left" | "top";
|
|
858
|
-
inline: boolean;
|
|
859
850
|
btnBoxLabel: string;
|
|
860
|
-
btnModel: "
|
|
851
|
+
btnModel: "inline" | "block";
|
|
861
852
|
labelWidth: number;
|
|
862
853
|
formOptions: import("./types").NfSearchFormItemOption[];
|
|
863
854
|
closable: boolean;
|
|
@@ -982,14 +973,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
982
973
|
type: import("vue-demi").PropType<boolean>;
|
|
983
974
|
default: boolean;
|
|
984
975
|
};
|
|
985
|
-
itemWidth: {
|
|
986
|
-
type: import("vue-demi").PropType<number>;
|
|
987
|
-
default: number;
|
|
988
|
-
};
|
|
989
976
|
rules: {
|
|
990
977
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
991
978
|
default: undefined;
|
|
992
979
|
};
|
|
980
|
+
inline: {
|
|
981
|
+
type: import("vue-demi").PropType<boolean>;
|
|
982
|
+
default: boolean;
|
|
983
|
+
};
|
|
993
984
|
upIcon: {
|
|
994
985
|
type: import("vue-demi").PropType<string>;
|
|
995
986
|
default: string;
|
|
@@ -1068,16 +1059,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1068
1059
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
1069
1060
|
default: string;
|
|
1070
1061
|
};
|
|
1071
|
-
inline: {
|
|
1072
|
-
type: import("vue-demi").PropType<boolean>;
|
|
1073
|
-
default: boolean;
|
|
1074
|
-
};
|
|
1075
1062
|
btnBoxLabel: {
|
|
1076
1063
|
type: import("vue-demi").PropType<string>;
|
|
1077
1064
|
default: string;
|
|
1078
1065
|
};
|
|
1079
1066
|
btnModel: {
|
|
1080
|
-
type: import("vue-demi").PropType<"
|
|
1067
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
1081
1068
|
default: string;
|
|
1082
1069
|
};
|
|
1083
1070
|
labelWidth: {
|
|
@@ -1453,14 +1440,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1453
1440
|
type: import("vue-demi").PropType<boolean>;
|
|
1454
1441
|
default: boolean;
|
|
1455
1442
|
};
|
|
1456
|
-
itemWidth: {
|
|
1457
|
-
type: import("vue-demi").PropType<number>;
|
|
1458
|
-
default: number;
|
|
1459
|
-
};
|
|
1460
1443
|
rules: {
|
|
1461
1444
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
1462
1445
|
default: undefined;
|
|
1463
1446
|
};
|
|
1447
|
+
inline: {
|
|
1448
|
+
type: import("vue-demi").PropType<boolean>;
|
|
1449
|
+
default: boolean;
|
|
1450
|
+
};
|
|
1464
1451
|
upIcon: {
|
|
1465
1452
|
type: import("vue-demi").PropType<string>;
|
|
1466
1453
|
default: string;
|
|
@@ -1539,16 +1526,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1539
1526
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
1540
1527
|
default: string;
|
|
1541
1528
|
};
|
|
1542
|
-
inline: {
|
|
1543
|
-
type: import("vue-demi").PropType<boolean>;
|
|
1544
|
-
default: boolean;
|
|
1545
|
-
};
|
|
1546
1529
|
btnBoxLabel: {
|
|
1547
1530
|
type: import("vue-demi").PropType<string>;
|
|
1548
1531
|
default: string;
|
|
1549
1532
|
};
|
|
1550
1533
|
btnModel: {
|
|
1551
|
-
type: import("vue-demi").PropType<"
|
|
1534
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
1552
1535
|
default: string;
|
|
1553
1536
|
};
|
|
1554
1537
|
labelWidth: {
|
|
@@ -1858,14 +1841,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1858
1841
|
type: import("vue-demi").PropType<boolean>;
|
|
1859
1842
|
default: boolean;
|
|
1860
1843
|
};
|
|
1861
|
-
itemWidth: {
|
|
1862
|
-
type: import("vue-demi").PropType<number>;
|
|
1863
|
-
default: number;
|
|
1864
|
-
};
|
|
1865
1844
|
rules: {
|
|
1866
1845
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
1867
1846
|
default: undefined;
|
|
1868
1847
|
};
|
|
1848
|
+
inline: {
|
|
1849
|
+
type: import("vue-demi").PropType<boolean>;
|
|
1850
|
+
default: boolean;
|
|
1851
|
+
};
|
|
1869
1852
|
upIcon: {
|
|
1870
1853
|
type: import("vue-demi").PropType<string>;
|
|
1871
1854
|
default: string;
|
|
@@ -1944,16 +1927,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1944
1927
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
1945
1928
|
default: string;
|
|
1946
1929
|
};
|
|
1947
|
-
inline: {
|
|
1948
|
-
type: import("vue-demi").PropType<boolean>;
|
|
1949
|
-
default: boolean;
|
|
1950
|
-
};
|
|
1951
1930
|
btnBoxLabel: {
|
|
1952
1931
|
type: import("vue-demi").PropType<string>;
|
|
1953
1932
|
default: string;
|
|
1954
1933
|
};
|
|
1955
1934
|
btnModel: {
|
|
1956
|
-
type: import("vue-demi").PropType<"
|
|
1935
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
1957
1936
|
default: string;
|
|
1958
1937
|
};
|
|
1959
1938
|
labelWidth: {
|
|
@@ -2286,8 +2265,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2286
2265
|
size: "medium" | "small" | "mini";
|
|
2287
2266
|
selectEmptyWarningTips: string;
|
|
2288
2267
|
disabled: boolean;
|
|
2289
|
-
itemWidth: number;
|
|
2290
2268
|
rules: Record<string, any>;
|
|
2269
|
+
inline: boolean;
|
|
2291
2270
|
upIcon: string;
|
|
2292
2271
|
downIcon: string;
|
|
2293
2272
|
columns: number;
|
|
@@ -2306,9 +2285,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2306
2285
|
statusIcon: boolean;
|
|
2307
2286
|
validateOnRuleChange: boolean;
|
|
2308
2287
|
labelPosition: "right" | "left" | "top";
|
|
2309
|
-
inline: boolean;
|
|
2310
2288
|
btnBoxLabel: string;
|
|
2311
|
-
btnModel: "
|
|
2289
|
+
btnModel: "inline" | "block";
|
|
2312
2290
|
labelWidth: number;
|
|
2313
2291
|
formOptions: import("./types").NfSearchFormItemOption[];
|
|
2314
2292
|
closable: boolean;
|
|
@@ -2434,14 +2412,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2434
2412
|
type: import("vue-demi").PropType<boolean>;
|
|
2435
2413
|
default: boolean;
|
|
2436
2414
|
};
|
|
2437
|
-
itemWidth: {
|
|
2438
|
-
type: import("vue-demi").PropType<number>;
|
|
2439
|
-
default: number;
|
|
2440
|
-
};
|
|
2441
2415
|
rules: {
|
|
2442
2416
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
2443
2417
|
default: undefined;
|
|
2444
2418
|
};
|
|
2419
|
+
inline: {
|
|
2420
|
+
type: import("vue-demi").PropType<boolean>;
|
|
2421
|
+
default: boolean;
|
|
2422
|
+
};
|
|
2445
2423
|
upIcon: {
|
|
2446
2424
|
type: import("vue-demi").PropType<string>;
|
|
2447
2425
|
default: string;
|
|
@@ -2520,16 +2498,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2520
2498
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
2521
2499
|
default: string;
|
|
2522
2500
|
};
|
|
2523
|
-
inline: {
|
|
2524
|
-
type: import("vue-demi").PropType<boolean>;
|
|
2525
|
-
default: boolean;
|
|
2526
|
-
};
|
|
2527
2501
|
btnBoxLabel: {
|
|
2528
2502
|
type: import("vue-demi").PropType<string>;
|
|
2529
2503
|
default: string;
|
|
2530
2504
|
};
|
|
2531
2505
|
btnModel: {
|
|
2532
|
-
type: import("vue-demi").PropType<"
|
|
2506
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
2533
2507
|
default: string;
|
|
2534
2508
|
};
|
|
2535
2509
|
labelWidth: {
|
|
@@ -2774,9 +2748,11 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2774
2748
|
} & (new () => {
|
|
2775
2749
|
$slots: Partial<Record<string, (_: {
|
|
2776
2750
|
slot: string;
|
|
2777
|
-
}) => any>> & Partial<Record<string, (_: {
|
|
2778
|
-
slot: string;
|
|
2779
2751
|
}) => any>> & {
|
|
2752
|
+
default?(_: {
|
|
2753
|
+
nam: string;
|
|
2754
|
+
slot: string;
|
|
2755
|
+
}): any;
|
|
2780
2756
|
btnBox?(_: {}): any;
|
|
2781
2757
|
dialogTitle?(_: {
|
|
2782
2758
|
slot: string;
|
|
@@ -8,10 +8,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
8
8
|
type: import("vue-demi").PropType<NfSearchFormItemOption>;
|
|
9
9
|
default: () => {};
|
|
10
10
|
};
|
|
11
|
-
itemWidth: {
|
|
12
|
-
type: import("vue-demi").PropType<number>;
|
|
13
|
-
default: number;
|
|
14
|
-
};
|
|
15
11
|
}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
16
12
|
input: (event: any) => void;
|
|
17
13
|
"update:value": (event: any) => void;
|
|
@@ -24,14 +20,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
24
20
|
type: import("vue-demi").PropType<NfSearchFormItemOption>;
|
|
25
21
|
default: () => {};
|
|
26
22
|
};
|
|
27
|
-
itemWidth: {
|
|
28
|
-
type: import("vue-demi").PropType<number>;
|
|
29
|
-
default: number;
|
|
30
|
-
};
|
|
31
23
|
}>>, {
|
|
32
24
|
value: any;
|
|
33
25
|
itemOptions: NfSearchFormItemOption;
|
|
34
|
-
itemWidth: number;
|
|
35
26
|
}>, Partial<Record<string, (_: {}) => any>> & Partial<Record<string, (_: {}) => any>>>;
|
|
36
27
|
export default _default;
|
|
37
28
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -334,23 +334,16 @@ __sfc_main$3.props = {
|
|
|
334
334
|
required: false,
|
|
335
335
|
type: null,
|
|
336
336
|
default: () => ({})
|
|
337
|
-
},
|
|
338
|
-
itemWidth: {
|
|
339
|
-
key: "itemWidth",
|
|
340
|
-
required: false,
|
|
341
|
-
type: Number,
|
|
342
|
-
default: 170
|
|
343
337
|
}
|
|
344
338
|
};
|
|
345
339
|
__sfc_main$3.setup = (__props, __ctx) => {
|
|
340
|
+
var _a;
|
|
346
341
|
const emit = __ctx.emit;
|
|
347
342
|
const props = __props;
|
|
343
|
+
const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
348
344
|
const slotName = vueDemi.computed(() => {
|
|
349
345
|
return props.itemOptions.slot || "";
|
|
350
346
|
});
|
|
351
|
-
const width = vueDemi.computed(() => {
|
|
352
|
-
return props.itemWidth + "px";
|
|
353
|
-
});
|
|
354
347
|
const currentVal = vueDemi.computed({
|
|
355
348
|
get() {
|
|
356
349
|
return props.value;
|
|
@@ -385,12 +378,14 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
385
378
|
return obj;
|
|
386
379
|
};
|
|
387
380
|
const bindProps = vueDemi.ref(getProps());
|
|
388
|
-
vueDemi.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
381
|
+
vueDemi.onBeforeMount(() => {
|
|
382
|
+
vueDemi.watch(() => {
|
|
383
|
+
return props.itemOptions;
|
|
384
|
+
}, () => {
|
|
385
|
+
bindProps.value = getProps();
|
|
386
|
+
}, {
|
|
387
|
+
deep: true
|
|
388
|
+
});
|
|
394
389
|
});
|
|
395
390
|
const bindEvents = vueDemi.computed(() => {
|
|
396
391
|
const events = {
|
|
@@ -405,75 +400,75 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
405
400
|
return props.itemOptions.tooltip;
|
|
406
401
|
});
|
|
407
402
|
const isInput = vueDemi.computed(() => {
|
|
408
|
-
var
|
|
409
|
-
return ((
|
|
403
|
+
var _a2;
|
|
404
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-input";
|
|
410
405
|
});
|
|
411
406
|
const isInputNumber = vueDemi.computed(() => {
|
|
412
|
-
var
|
|
413
|
-
return ((
|
|
407
|
+
var _a2;
|
|
408
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-input-number";
|
|
414
409
|
});
|
|
415
410
|
const isSelect = vueDemi.computed(() => {
|
|
416
|
-
var
|
|
417
|
-
const element = (
|
|
411
|
+
var _a2;
|
|
412
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
418
413
|
return element === "el-select" || element === "custom-select" || element === "ai-select" || element === "ai-custom-select";
|
|
419
414
|
});
|
|
420
415
|
const isDatePickerDateRange = vueDemi.computed(() => {
|
|
421
|
-
var
|
|
422
|
-
const element = (
|
|
416
|
+
var _a2, _b;
|
|
417
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
423
418
|
const type = (_b = props.itemOptions) == null ? void 0 : _b.type;
|
|
424
419
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
425
420
|
const isDateRange = type === "datetimerange" || type === "daterange";
|
|
426
421
|
return isDatePicker && isDateRange;
|
|
427
422
|
});
|
|
428
423
|
const isDatePickerMonthRange = vueDemi.computed(() => {
|
|
429
|
-
var
|
|
430
|
-
const element = (
|
|
424
|
+
var _a2, _b;
|
|
425
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
431
426
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
432
427
|
const isMonthRange = ((_b = props.itemOptions) == null ? void 0 : _b.type) === "monthrange";
|
|
433
428
|
return isDatePicker && isMonthRange;
|
|
434
429
|
});
|
|
435
430
|
const isDatePickerOthers = vueDemi.computed(() => {
|
|
436
|
-
var
|
|
437
|
-
const element = (
|
|
431
|
+
var _a2;
|
|
432
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
438
433
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
439
434
|
return isDatePicker && !isDatePickerDateRange.value && !isDatePickerMonthRange.value;
|
|
440
435
|
});
|
|
441
436
|
const isYearPickerYearRange = vueDemi.computed(() => {
|
|
442
|
-
var
|
|
443
|
-
const element = (
|
|
437
|
+
var _a2;
|
|
438
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
444
439
|
return element === "nf-double-year";
|
|
445
440
|
});
|
|
446
441
|
const isHalfYearPickerHalfYearRange = vueDemi.computed(() => {
|
|
447
|
-
var
|
|
448
|
-
const element = (
|
|
442
|
+
var _a2, _b;
|
|
443
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
449
444
|
const isHalfYearRange = element === "nf-half-year-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) === "halfyearrange";
|
|
450
445
|
return isHalfYearRange || element === "nf-double-half-year";
|
|
451
446
|
});
|
|
452
447
|
const isHalfYearPicker = vueDemi.computed(() => {
|
|
453
|
-
var
|
|
454
|
-
return ((
|
|
448
|
+
var _a2, _b;
|
|
449
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-half-year-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) !== "halfyearrange";
|
|
455
450
|
});
|
|
456
451
|
const isQuarterPickerQuarterRange = vueDemi.computed(() => {
|
|
457
|
-
var
|
|
458
|
-
const element = (
|
|
452
|
+
var _a2, _b;
|
|
453
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
459
454
|
const isHalfYearRange = element === "nf-quarter-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) === "quarterrange";
|
|
460
455
|
return isHalfYearRange || element === "nf-double-quarter";
|
|
461
456
|
});
|
|
462
457
|
const isQuarterPicker = vueDemi.computed(() => {
|
|
463
|
-
var
|
|
464
|
-
return ((
|
|
458
|
+
var _a2, _b;
|
|
459
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-quarter-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) !== "quarterrange";
|
|
465
460
|
});
|
|
466
461
|
const isDoubleWeek = vueDemi.computed(() => {
|
|
467
|
-
var
|
|
468
|
-
return ((
|
|
462
|
+
var _a2;
|
|
463
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-double-week";
|
|
469
464
|
});
|
|
470
465
|
const isCascader = vueDemi.computed(() => {
|
|
471
|
-
var
|
|
472
|
-
return ((
|
|
466
|
+
var _a2;
|
|
467
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-cascader";
|
|
473
468
|
});
|
|
474
469
|
const isTimeSelect = vueDemi.computed(() => {
|
|
475
|
-
var
|
|
476
|
-
return ((
|
|
470
|
+
var _a2;
|
|
471
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-time-select" && props.itemOptions.type !== "datetimerange";
|
|
477
472
|
});
|
|
478
473
|
const isTimeSelectRange = vueDemi.computed(() => {
|
|
479
474
|
return props.itemOptions.element === "el-time-select" && props.itemOptions.type === "datetimerange";
|
|
@@ -488,20 +483,19 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
488
483
|
return props.itemOptions.element === "nf-select-transfer";
|
|
489
484
|
});
|
|
490
485
|
const handleChange = (event) => {
|
|
491
|
-
var
|
|
492
|
-
if ((_b = (
|
|
493
|
-
props.itemOptions.events.change(event,
|
|
486
|
+
var _a2, _b;
|
|
487
|
+
if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.change) {
|
|
488
|
+
props.itemOptions.events.change(event, instance);
|
|
494
489
|
}
|
|
495
490
|
};
|
|
496
491
|
const handleInput = (event) => {
|
|
497
|
-
var
|
|
498
|
-
if ((_b = (
|
|
499
|
-
props.itemOptions.events.keyup(event,
|
|
492
|
+
var _a2, _b;
|
|
493
|
+
if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.keyup) {
|
|
494
|
+
props.itemOptions.events.keyup(event, instance);
|
|
500
495
|
}
|
|
501
496
|
};
|
|
502
497
|
return {
|
|
503
498
|
slotName,
|
|
504
|
-
width,
|
|
505
499
|
currentVal,
|
|
506
500
|
bindProps,
|
|
507
501
|
bindEvents,
|
|
@@ -536,10 +530,7 @@ var _sfc_render$3 = function render3() {
|
|
|
536
530
|
var _vm = this, _c = _vm._self._c;
|
|
537
531
|
_vm._self._setupProxy;
|
|
538
532
|
return _c("div", {
|
|
539
|
-
staticClass: "nf-search-form-item"
|
|
540
|
-
style: {
|
|
541
|
-
width: _vm.width
|
|
542
|
-
}
|
|
533
|
+
staticClass: "nf-search-form-item"
|
|
543
534
|
}, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("el-input", _vm._g(_vm._b({
|
|
544
535
|
attrs: {
|
|
545
536
|
"placeholder": _vm.itemOptions.placeholder
|
|
@@ -568,7 +559,6 @@ var _sfc_render$3 = function render3() {
|
|
|
568
559
|
}
|
|
569
560
|
}, "el-input-number", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isSelect ? _c("nf-virtual-select", _vm._g(_vm._b({
|
|
570
561
|
attrs: {
|
|
571
|
-
"width": _vm.width,
|
|
572
562
|
"item-options": _vm.itemOptions,
|
|
573
563
|
"placeholder": _vm.itemOptions.placeholder
|
|
574
564
|
},
|
|
@@ -6432,7 +6422,7 @@ var _sfc_staticRenderFns$1 = [];
|
|
|
6432
6422
|
var __component__$1 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
|
|
6433
6423
|
const ColumnCheckDrawer = __component__$1.exports;
|
|
6434
6424
|
const __sfc_main = vueDemi.defineComponent({
|
|
6435
|
-
name: "nf-search-
|
|
6425
|
+
name: "nf-search-form"
|
|
6436
6426
|
});
|
|
6437
6427
|
__sfc_main.props = {
|
|
6438
6428
|
upIcon: {
|
|
@@ -6589,12 +6579,6 @@ __sfc_main.props = {
|
|
|
6589
6579
|
type: String,
|
|
6590
6580
|
default: "block"
|
|
6591
6581
|
},
|
|
6592
|
-
itemWidth: {
|
|
6593
|
-
key: "itemWidth",
|
|
6594
|
-
required: false,
|
|
6595
|
-
type: Number,
|
|
6596
|
-
default: 190
|
|
6597
|
-
},
|
|
6598
6582
|
labelWidth: {
|
|
6599
6583
|
key: "labelWidth",
|
|
6600
6584
|
required: false,
|
|
@@ -7141,9 +7125,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7141
7125
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
7142
7126
|
var _a2;
|
|
7143
7127
|
const columns = props.formOptions.map((item, index2) => {
|
|
7128
|
+
item.key = item.key || createUniqueString();
|
|
7144
7129
|
item._index = index2;
|
|
7145
7130
|
item.__index = index2;
|
|
7146
|
-
item.key = item.key || createUniqueString();
|
|
7147
7131
|
return item;
|
|
7148
7132
|
});
|
|
7149
7133
|
if (readCached && props.columnEdit) {
|
|
@@ -7189,6 +7173,13 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7189
7173
|
immediate: true
|
|
7190
7174
|
});
|
|
7191
7175
|
vueDemi.onBeforeMount(() => {
|
|
7176
|
+
vueDemi.watch(() => {
|
|
7177
|
+
return props.formOptions;
|
|
7178
|
+
}, () => {
|
|
7179
|
+
syncCookiesToSearchFormItemOptions();
|
|
7180
|
+
}, {
|
|
7181
|
+
deep: true
|
|
7182
|
+
});
|
|
7192
7183
|
const obj = {};
|
|
7193
7184
|
props.formOptions.forEach((v) => {
|
|
7194
7185
|
if (v.initValue !== void 0) {
|
|
@@ -7479,8 +7470,8 @@ var _sfc_render = function render6() {
|
|
|
7479
7470
|
"label-width": item.labelWidth
|
|
7480
7471
|
}
|
|
7481
7472
|
}, [_c("search-form-item", {
|
|
7473
|
+
key: item.key,
|
|
7482
7474
|
attrs: {
|
|
7483
|
-
"item-width": _vm.itemWidth,
|
|
7484
7475
|
"item-options": item
|
|
7485
7476
|
},
|
|
7486
7477
|
model: {
|
|
@@ -7490,8 +7481,9 @@ var _sfc_render = function render6() {
|
|
|
7490
7481
|
},
|
|
7491
7482
|
expression: "nfSearchFormModel[item.prop]"
|
|
7492
7483
|
}
|
|
7493
|
-
}, [item.tooltip ? _vm._t(
|
|
7494
|
-
"slot": item.tooltip.slot
|
|
7484
|
+
}, [item.tooltip ? _vm._t("default", null, {
|
|
7485
|
+
"slot": item.tooltip.slot,
|
|
7486
|
+
"nam": item.tooltip.slot
|
|
7495
7487
|
}) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
|
|
7496
7488
|
"slot": item.slot
|
|
7497
7489
|
}) : _vm._e()], 2), _vm.closable ? _c("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, getCurrentInstance, computed, watch,
|
|
1
|
+
import { defineComponent, ref, getCurrentInstance, computed, watch, onBeforeMount, onMounted, nextTick, onUnmounted } from "vue-demi";
|
|
2
2
|
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
3
3
|
import NfMessage from "@94ai/nf-message";
|
|
4
4
|
const __sfc_main$5 = defineComponent({
|
|
@@ -332,23 +332,16 @@ __sfc_main$3.props = {
|
|
|
332
332
|
required: false,
|
|
333
333
|
type: null,
|
|
334
334
|
default: () => ({})
|
|
335
|
-
},
|
|
336
|
-
itemWidth: {
|
|
337
|
-
key: "itemWidth",
|
|
338
|
-
required: false,
|
|
339
|
-
type: Number,
|
|
340
|
-
default: 170
|
|
341
335
|
}
|
|
342
336
|
};
|
|
343
337
|
__sfc_main$3.setup = (__props, __ctx) => {
|
|
338
|
+
var _a;
|
|
344
339
|
const emit = __ctx.emit;
|
|
345
340
|
const props = __props;
|
|
341
|
+
const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
346
342
|
const slotName = computed(() => {
|
|
347
343
|
return props.itemOptions.slot || "";
|
|
348
344
|
});
|
|
349
|
-
const width = computed(() => {
|
|
350
|
-
return props.itemWidth + "px";
|
|
351
|
-
});
|
|
352
345
|
const currentVal = computed({
|
|
353
346
|
get() {
|
|
354
347
|
return props.value;
|
|
@@ -383,12 +376,14 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
383
376
|
return obj;
|
|
384
377
|
};
|
|
385
378
|
const bindProps = ref(getProps());
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
379
|
+
onBeforeMount(() => {
|
|
380
|
+
watch(() => {
|
|
381
|
+
return props.itemOptions;
|
|
382
|
+
}, () => {
|
|
383
|
+
bindProps.value = getProps();
|
|
384
|
+
}, {
|
|
385
|
+
deep: true
|
|
386
|
+
});
|
|
392
387
|
});
|
|
393
388
|
const bindEvents = computed(() => {
|
|
394
389
|
const events = {
|
|
@@ -403,75 +398,75 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
403
398
|
return props.itemOptions.tooltip;
|
|
404
399
|
});
|
|
405
400
|
const isInput = computed(() => {
|
|
406
|
-
var
|
|
407
|
-
return ((
|
|
401
|
+
var _a2;
|
|
402
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-input";
|
|
408
403
|
});
|
|
409
404
|
const isInputNumber = computed(() => {
|
|
410
|
-
var
|
|
411
|
-
return ((
|
|
405
|
+
var _a2;
|
|
406
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-input-number";
|
|
412
407
|
});
|
|
413
408
|
const isSelect = computed(() => {
|
|
414
|
-
var
|
|
415
|
-
const element = (
|
|
409
|
+
var _a2;
|
|
410
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
416
411
|
return element === "el-select" || element === "custom-select" || element === "ai-select" || element === "ai-custom-select";
|
|
417
412
|
});
|
|
418
413
|
const isDatePickerDateRange = computed(() => {
|
|
419
|
-
var
|
|
420
|
-
const element = (
|
|
414
|
+
var _a2, _b;
|
|
415
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
421
416
|
const type = (_b = props.itemOptions) == null ? void 0 : _b.type;
|
|
422
417
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
423
418
|
const isDateRange = type === "datetimerange" || type === "daterange";
|
|
424
419
|
return isDatePicker && isDateRange;
|
|
425
420
|
});
|
|
426
421
|
const isDatePickerMonthRange = computed(() => {
|
|
427
|
-
var
|
|
428
|
-
const element = (
|
|
422
|
+
var _a2, _b;
|
|
423
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
429
424
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
430
425
|
const isMonthRange = ((_b = props.itemOptions) == null ? void 0 : _b.type) === "monthrange";
|
|
431
426
|
return isDatePicker && isMonthRange;
|
|
432
427
|
});
|
|
433
428
|
const isDatePickerOthers = computed(() => {
|
|
434
|
-
var
|
|
435
|
-
const element = (
|
|
429
|
+
var _a2;
|
|
430
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
436
431
|
const isDatePicker = element === "el-date-picker" || element === "nf-date-picker";
|
|
437
432
|
return isDatePicker && !isDatePickerDateRange.value && !isDatePickerMonthRange.value;
|
|
438
433
|
});
|
|
439
434
|
const isYearPickerYearRange = computed(() => {
|
|
440
|
-
var
|
|
441
|
-
const element = (
|
|
435
|
+
var _a2;
|
|
436
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
442
437
|
return element === "nf-double-year";
|
|
443
438
|
});
|
|
444
439
|
const isHalfYearPickerHalfYearRange = computed(() => {
|
|
445
|
-
var
|
|
446
|
-
const element = (
|
|
440
|
+
var _a2, _b;
|
|
441
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
447
442
|
const isHalfYearRange = element === "nf-half-year-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) === "halfyearrange";
|
|
448
443
|
return isHalfYearRange || element === "nf-double-half-year";
|
|
449
444
|
});
|
|
450
445
|
const isHalfYearPicker = computed(() => {
|
|
451
|
-
var
|
|
452
|
-
return ((
|
|
446
|
+
var _a2, _b;
|
|
447
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-half-year-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) !== "halfyearrange";
|
|
453
448
|
});
|
|
454
449
|
const isQuarterPickerQuarterRange = computed(() => {
|
|
455
|
-
var
|
|
456
|
-
const element = (
|
|
450
|
+
var _a2, _b;
|
|
451
|
+
const element = (_a2 = props.itemOptions) == null ? void 0 : _a2.element;
|
|
457
452
|
const isHalfYearRange = element === "nf-quarter-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) === "quarterrange";
|
|
458
453
|
return isHalfYearRange || element === "nf-double-quarter";
|
|
459
454
|
});
|
|
460
455
|
const isQuarterPicker = computed(() => {
|
|
461
|
-
var
|
|
462
|
-
return ((
|
|
456
|
+
var _a2, _b;
|
|
457
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-quarter-picker" && ((_b = props.itemOptions) == null ? void 0 : _b.type) !== "quarterrange";
|
|
463
458
|
});
|
|
464
459
|
const isDoubleWeek = computed(() => {
|
|
465
|
-
var
|
|
466
|
-
return ((
|
|
460
|
+
var _a2;
|
|
461
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "nf-double-week";
|
|
467
462
|
});
|
|
468
463
|
const isCascader = computed(() => {
|
|
469
|
-
var
|
|
470
|
-
return ((
|
|
464
|
+
var _a2;
|
|
465
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-cascader";
|
|
471
466
|
});
|
|
472
467
|
const isTimeSelect = computed(() => {
|
|
473
|
-
var
|
|
474
|
-
return ((
|
|
468
|
+
var _a2;
|
|
469
|
+
return ((_a2 = props.itemOptions) == null ? void 0 : _a2.element) === "el-time-select" && props.itemOptions.type !== "datetimerange";
|
|
475
470
|
});
|
|
476
471
|
const isTimeSelectRange = computed(() => {
|
|
477
472
|
return props.itemOptions.element === "el-time-select" && props.itemOptions.type === "datetimerange";
|
|
@@ -486,20 +481,19 @@ __sfc_main$3.setup = (__props, __ctx) => {
|
|
|
486
481
|
return props.itemOptions.element === "nf-select-transfer";
|
|
487
482
|
});
|
|
488
483
|
const handleChange = (event) => {
|
|
489
|
-
var
|
|
490
|
-
if ((_b = (
|
|
491
|
-
props.itemOptions.events.change(event,
|
|
484
|
+
var _a2, _b;
|
|
485
|
+
if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.change) {
|
|
486
|
+
props.itemOptions.events.change(event, instance);
|
|
492
487
|
}
|
|
493
488
|
};
|
|
494
489
|
const handleInput = (event) => {
|
|
495
|
-
var
|
|
496
|
-
if ((_b = (
|
|
497
|
-
props.itemOptions.events.keyup(event,
|
|
490
|
+
var _a2, _b;
|
|
491
|
+
if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.keyup) {
|
|
492
|
+
props.itemOptions.events.keyup(event, instance);
|
|
498
493
|
}
|
|
499
494
|
};
|
|
500
495
|
return {
|
|
501
496
|
slotName,
|
|
502
|
-
width,
|
|
503
497
|
currentVal,
|
|
504
498
|
bindProps,
|
|
505
499
|
bindEvents,
|
|
@@ -534,10 +528,7 @@ var _sfc_render$3 = function render3() {
|
|
|
534
528
|
var _vm = this, _c = _vm._self._c;
|
|
535
529
|
_vm._self._setupProxy;
|
|
536
530
|
return _c("div", {
|
|
537
|
-
staticClass: "nf-search-form-item"
|
|
538
|
-
style: {
|
|
539
|
-
width: _vm.width
|
|
540
|
-
}
|
|
531
|
+
staticClass: "nf-search-form-item"
|
|
541
532
|
}, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("el-input", _vm._g(_vm._b({
|
|
542
533
|
attrs: {
|
|
543
534
|
"placeholder": _vm.itemOptions.placeholder
|
|
@@ -566,7 +557,6 @@ var _sfc_render$3 = function render3() {
|
|
|
566
557
|
}
|
|
567
558
|
}, "el-input-number", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isSelect ? _c("nf-virtual-select", _vm._g(_vm._b({
|
|
568
559
|
attrs: {
|
|
569
|
-
"width": _vm.width,
|
|
570
560
|
"item-options": _vm.itemOptions,
|
|
571
561
|
"placeholder": _vm.itemOptions.placeholder
|
|
572
562
|
},
|
|
@@ -6430,7 +6420,7 @@ var _sfc_staticRenderFns$1 = [];
|
|
|
6430
6420
|
var __component__$1 = /* @__PURE__ */ normalizeComponent(__sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
|
|
6431
6421
|
const ColumnCheckDrawer = __component__$1.exports;
|
|
6432
6422
|
const __sfc_main = defineComponent({
|
|
6433
|
-
name: "nf-search-
|
|
6423
|
+
name: "nf-search-form"
|
|
6434
6424
|
});
|
|
6435
6425
|
__sfc_main.props = {
|
|
6436
6426
|
upIcon: {
|
|
@@ -6587,12 +6577,6 @@ __sfc_main.props = {
|
|
|
6587
6577
|
type: String,
|
|
6588
6578
|
default: "block"
|
|
6589
6579
|
},
|
|
6590
|
-
itemWidth: {
|
|
6591
|
-
key: "itemWidth",
|
|
6592
|
-
required: false,
|
|
6593
|
-
type: Number,
|
|
6594
|
-
default: 190
|
|
6595
|
-
},
|
|
6596
6580
|
labelWidth: {
|
|
6597
6581
|
key: "labelWidth",
|
|
6598
6582
|
required: false,
|
|
@@ -7139,9 +7123,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7139
7123
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
7140
7124
|
var _a2;
|
|
7141
7125
|
const columns = props.formOptions.map((item, index2) => {
|
|
7126
|
+
item.key = item.key || createUniqueString();
|
|
7142
7127
|
item._index = index2;
|
|
7143
7128
|
item.__index = index2;
|
|
7144
|
-
item.key = item.key || createUniqueString();
|
|
7145
7129
|
return item;
|
|
7146
7130
|
});
|
|
7147
7131
|
if (readCached && props.columnEdit) {
|
|
@@ -7187,6 +7171,13 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7187
7171
|
immediate: true
|
|
7188
7172
|
});
|
|
7189
7173
|
onBeforeMount(() => {
|
|
7174
|
+
watch(() => {
|
|
7175
|
+
return props.formOptions;
|
|
7176
|
+
}, () => {
|
|
7177
|
+
syncCookiesToSearchFormItemOptions();
|
|
7178
|
+
}, {
|
|
7179
|
+
deep: true
|
|
7180
|
+
});
|
|
7190
7181
|
const obj = {};
|
|
7191
7182
|
props.formOptions.forEach((v) => {
|
|
7192
7183
|
if (v.initValue !== void 0) {
|
|
@@ -7477,8 +7468,8 @@ var _sfc_render = function render6() {
|
|
|
7477
7468
|
"label-width": item.labelWidth
|
|
7478
7469
|
}
|
|
7479
7470
|
}, [_c("search-form-item", {
|
|
7471
|
+
key: item.key,
|
|
7480
7472
|
attrs: {
|
|
7481
|
-
"item-width": _vm.itemWidth,
|
|
7482
7473
|
"item-options": item
|
|
7483
7474
|
},
|
|
7484
7475
|
model: {
|
|
@@ -7488,8 +7479,9 @@ var _sfc_render = function render6() {
|
|
|
7488
7479
|
},
|
|
7489
7480
|
expression: "nfSearchFormModel[item.prop]"
|
|
7490
7481
|
}
|
|
7491
|
-
}, [item.tooltip ? _vm._t(
|
|
7492
|
-
"slot": item.tooltip.slot
|
|
7482
|
+
}, [item.tooltip ? _vm._t("default", null, {
|
|
7483
|
+
"slot": item.tooltip.slot,
|
|
7484
|
+
"nam": item.tooltip.slot
|
|
7493
7485
|
}) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
|
|
7494
7486
|
"slot": item.slot
|
|
7495
7487
|
}) : _vm._e()], 2), _vm.closable ? _c("div", {
|
|
@@ -69,14 +69,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
69
69
|
type: import("vue-demi").PropType<boolean>;
|
|
70
70
|
default: boolean;
|
|
71
71
|
};
|
|
72
|
-
itemWidth: {
|
|
73
|
-
type: import("vue-demi").PropType<number>;
|
|
74
|
-
default: number;
|
|
75
|
-
};
|
|
76
72
|
rules: {
|
|
77
73
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
78
74
|
default: undefined;
|
|
79
75
|
};
|
|
76
|
+
inline: {
|
|
77
|
+
type: import("vue-demi").PropType<boolean>;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
80
80
|
upIcon: {
|
|
81
81
|
type: import("vue-demi").PropType<string>;
|
|
82
82
|
default: string;
|
|
@@ -155,16 +155,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
155
155
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
156
156
|
default: string;
|
|
157
157
|
};
|
|
158
|
-
inline: {
|
|
159
|
-
type: import("vue-demi").PropType<boolean>;
|
|
160
|
-
default: boolean;
|
|
161
|
-
};
|
|
162
158
|
btnBoxLabel: {
|
|
163
159
|
type: import("vue-demi").PropType<string>;
|
|
164
160
|
default: string;
|
|
165
161
|
};
|
|
166
162
|
btnModel: {
|
|
167
|
-
type: import("vue-demi").PropType<"
|
|
163
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
168
164
|
default: string;
|
|
169
165
|
};
|
|
170
166
|
labelWidth: {
|
|
@@ -548,14 +544,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
548
544
|
type: import("vue-demi").PropType<boolean>;
|
|
549
545
|
default: boolean;
|
|
550
546
|
};
|
|
551
|
-
itemWidth: {
|
|
552
|
-
type: import("vue-demi").PropType<number>;
|
|
553
|
-
default: number;
|
|
554
|
-
};
|
|
555
547
|
rules: {
|
|
556
548
|
type: import("vue-demi").PropType<Record<string, any>>;
|
|
557
549
|
default: undefined;
|
|
558
550
|
};
|
|
551
|
+
inline: {
|
|
552
|
+
type: import("vue-demi").PropType<boolean>;
|
|
553
|
+
default: boolean;
|
|
554
|
+
};
|
|
559
555
|
upIcon: {
|
|
560
556
|
type: import("vue-demi").PropType<string>;
|
|
561
557
|
default: string;
|
|
@@ -634,16 +630,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
634
630
|
type: import("vue-demi").PropType<"right" | "left" | "top">;
|
|
635
631
|
default: string;
|
|
636
632
|
};
|
|
637
|
-
inline: {
|
|
638
|
-
type: import("vue-demi").PropType<boolean>;
|
|
639
|
-
default: boolean;
|
|
640
|
-
};
|
|
641
633
|
btnBoxLabel: {
|
|
642
634
|
type: import("vue-demi").PropType<string>;
|
|
643
635
|
default: string;
|
|
644
636
|
};
|
|
645
637
|
btnModel: {
|
|
646
|
-
type: import("vue-demi").PropType<"
|
|
638
|
+
type: import("vue-demi").PropType<"inline" | "block">;
|
|
647
639
|
default: string;
|
|
648
640
|
};
|
|
649
641
|
labelWidth: {
|
|
@@ -902,8 +894,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
902
894
|
size: 'medium' | 'small' | 'mini';
|
|
903
895
|
selectEmptyWarningTips: string;
|
|
904
896
|
disabled: boolean;
|
|
905
|
-
itemWidth: number;
|
|
906
897
|
rules: Record<string, any>;
|
|
898
|
+
inline: boolean;
|
|
907
899
|
upIcon: string;
|
|
908
900
|
downIcon: string;
|
|
909
901
|
columns: number;
|
|
@@ -922,7 +914,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
922
914
|
statusIcon: boolean;
|
|
923
915
|
validateOnRuleChange: boolean;
|
|
924
916
|
labelPosition: 'top' | 'right' | 'left';
|
|
925
|
-
inline: boolean;
|
|
926
917
|
btnBoxLabel: string;
|
|
927
918
|
btnModel: 'inline' | 'block';
|
|
928
919
|
labelWidth: number;
|
|
@@ -982,9 +973,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
982
973
|
resetBtnClass: string;
|
|
983
974
|
}>, Partial<Record<string, (_: {
|
|
984
975
|
slot: string;
|
|
985
|
-
}) => any>> & Partial<Record<string, (_: {
|
|
986
|
-
slot: string;
|
|
987
976
|
}) => any>> & {
|
|
977
|
+
default?(_: {
|
|
978
|
+
nam: string;
|
|
979
|
+
slot: string;
|
|
980
|
+
}): any;
|
|
988
981
|
btnBox?(_: {}): any;
|
|
989
982
|
dialogTitle?(_: {
|
|
990
983
|
slot: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="nf-search-form-item"
|
|
2
|
+
<div class="nf-search-form-item">
|
|
3
3
|
<template v-if="slotName">
|
|
4
4
|
<slot :name="slotName" />
|
|
5
5
|
</template>
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
/>
|
|
23
23
|
<nf-virtual-select
|
|
24
24
|
v-if="isSelect"
|
|
25
|
-
:width="width"
|
|
26
25
|
v-model="currentVal"
|
|
27
26
|
v-bind="bindProps"
|
|
28
27
|
v-on="bindEvents"
|
|
@@ -183,7 +182,9 @@ import TimeRange from './nf-time-range.vue'
|
|
|
183
182
|
import {
|
|
184
183
|
computed,
|
|
185
184
|
ref,
|
|
186
|
-
watch
|
|
185
|
+
watch,
|
|
186
|
+
onBeforeMount,
|
|
187
|
+
getCurrentInstance
|
|
187
188
|
} from 'vue-demi'
|
|
188
189
|
import { NfSearchFormItemOption } from '@94ai/nf-search-form/lib/types'
|
|
189
190
|
import { createUniqueString } from './tools'
|
|
@@ -202,24 +203,17 @@ const props = withDefaults(defineProps<{
|
|
|
202
203
|
* 单个表单项渲染数据
|
|
203
204
|
*/
|
|
204
205
|
itemOptions?: NfSearchFormItemOption,
|
|
205
|
-
/**
|
|
206
|
-
* content宽度
|
|
207
|
-
*/
|
|
208
|
-
itemWidth?: number,
|
|
209
206
|
}>(), {
|
|
210
207
|
value: undefined,
|
|
211
208
|
itemOptions: () => ({}),
|
|
212
|
-
itemWidth: 170,
|
|
213
209
|
})
|
|
214
210
|
|
|
211
|
+
const instance = getCurrentInstance()?.proxy
|
|
212
|
+
|
|
215
213
|
const slotName = computed(() => {
|
|
216
214
|
return props.itemOptions.slot || ''
|
|
217
215
|
})
|
|
218
216
|
|
|
219
|
-
const width = computed(() => {
|
|
220
|
-
return props.itemWidth + 'px'
|
|
221
|
-
})
|
|
222
|
-
|
|
223
217
|
// 双向绑定数据值
|
|
224
218
|
const currentVal = computed({
|
|
225
219
|
get() {
|
|
@@ -260,12 +254,14 @@ const getProps = () => {
|
|
|
260
254
|
// 绑定属性
|
|
261
255
|
const bindProps = ref(getProps())
|
|
262
256
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
257
|
+
onBeforeMount(() => {
|
|
258
|
+
watch(() => {
|
|
259
|
+
return props.itemOptions
|
|
260
|
+
}, () => {
|
|
261
|
+
bindProps.value = getProps()
|
|
262
|
+
}, {
|
|
263
|
+
deep: true
|
|
264
|
+
})
|
|
269
265
|
})
|
|
270
266
|
|
|
271
267
|
// 绑定方法
|
|
@@ -380,12 +376,12 @@ const isSelectTransfer = computed(() => {
|
|
|
380
376
|
|
|
381
377
|
const handleChange = (event) => {
|
|
382
378
|
if (props.itemOptions?.events?.change) {
|
|
383
|
-
props.itemOptions.events.change(event,
|
|
379
|
+
props.itemOptions.events.change(event, instance)
|
|
384
380
|
}
|
|
385
381
|
}
|
|
386
382
|
const handleInput = (event) => {
|
|
387
383
|
if (props.itemOptions?.events?.keyup) {
|
|
388
|
-
props.itemOptions.events.keyup(event,
|
|
384
|
+
props.itemOptions.events.keyup(event, instance)
|
|
389
385
|
}
|
|
390
386
|
}
|
|
391
387
|
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
:required="item.required"
|
|
52
52
|
:label-width="item.labelWidth"
|
|
53
53
|
>
|
|
54
|
-
<search-form-item
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
<search-form-item
|
|
55
|
+
:key="item.key"
|
|
56
|
+
v-model="nfSearchFormModel[item.prop]"
|
|
57
|
+
:item-options="item">
|
|
57
58
|
<!-- 定制化SearchItem?提示-->
|
|
58
|
-
<slot :
|
|
59
|
+
<slot :nam="item.tooltip.slot" v-if="item.tooltip" :slot="item.tooltip.slot" />
|
|
59
60
|
<!-- 定制化SearchItem插槽-->
|
|
60
61
|
<slot :name="item.slot" v-if="item.slot" :slot="item.slot" />
|
|
61
62
|
</search-form-item>
|
|
@@ -262,7 +263,7 @@
|
|
|
262
263
|
import { defineComponent } from 'vue-demi'
|
|
263
264
|
|
|
264
265
|
export default defineComponent({
|
|
265
|
-
name: 'nf-search-
|
|
266
|
+
name: 'nf-search-form'
|
|
266
267
|
})
|
|
267
268
|
</script>
|
|
268
269
|
|
|
@@ -330,10 +331,6 @@ const props = withDefaults(defineProps<{
|
|
|
330
331
|
inline?: boolean
|
|
331
332
|
btnBoxLabel?: string
|
|
332
333
|
btnModel?: 'inline' | 'block'
|
|
333
|
-
/**
|
|
334
|
-
* 兼容ai-search-form控制item父dom宽度
|
|
335
|
-
*/
|
|
336
|
-
itemWidth?: number,
|
|
337
334
|
/**
|
|
338
335
|
* label宽度
|
|
339
336
|
*/
|
|
@@ -481,7 +478,6 @@ const props = withDefaults(defineProps<{
|
|
|
481
478
|
formOptions: () => [],
|
|
482
479
|
showItems: () => [],
|
|
483
480
|
closable: false,
|
|
484
|
-
itemWidth: 190,
|
|
485
481
|
btnItems: () => '',
|
|
486
482
|
columnEdit: false,
|
|
487
483
|
btnBoxLabel: '',
|
|
@@ -703,9 +699,9 @@ const isShowBtnBoxSlot = computed(() => {
|
|
|
703
699
|
const renderSearchFormItemOptions = ref<NfSearchFormItemOption[]>([])
|
|
704
700
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
705
701
|
const columns = props.formOptions!.map((item, index) => {
|
|
702
|
+
item.key = item.key || createUniqueString()
|
|
706
703
|
item._index = index
|
|
707
704
|
item.__index = index
|
|
708
|
-
item.key = item.key || createUniqueString()
|
|
709
705
|
return item
|
|
710
706
|
})
|
|
711
707
|
if (readCached && props.columnEdit) {
|
|
@@ -770,6 +766,21 @@ watch(() => {
|
|
|
770
766
|
* 初始化formData表单数据
|
|
771
767
|
*/
|
|
772
768
|
onBeforeMount(() => {
|
|
769
|
+
/**
|
|
770
|
+
* 有部分人喜欢用computed当作formOptions,
|
|
771
|
+
* 由于computed的数据子孙属性改变会引起整个formOptions引用的改动,而且旧对象引用的子属性并未变更
|
|
772
|
+
* 这里需要watch同步到renderSearchFormItemOptions(子组件借助renderSearchFormItemOptions引用watch去监听,如果是data当作formOptions可以不用这个watch)
|
|
773
|
+
*
|
|
774
|
+
* 用computed去改里面的副作用,这样会整个computed改变引起整个表单重新渲染,为此需要每个item传个key,不然就不会有局部更新的效果
|
|
775
|
+
* 用data就是data引用不动,局部动,就会直接局部更新了(不需要这里的watch,考虑到用户用computed写起来更简单,这里就做了兼容,算是优化)
|
|
776
|
+
*/
|
|
777
|
+
watch(() => {
|
|
778
|
+
return props.formOptions
|
|
779
|
+
}, () => {
|
|
780
|
+
syncCookiesToSearchFormItemOptions()
|
|
781
|
+
}, {
|
|
782
|
+
deep: true
|
|
783
|
+
})
|
|
773
784
|
const obj: Record<string, any> = {}
|
|
774
785
|
props.formOptions.forEach(v => {
|
|
775
786
|
if (v.initValue !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-search-form",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.26",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/nf-action": "^3.2.
|
|
18
|
-
"@94ai/nf-double-half-year": "^3.2.
|
|
19
|
-
"@94ai/nf-double-quarter": "^3.2.
|
|
20
|
-
"@94ai/nf-double-week": "^3.2.
|
|
21
|
-
"@94ai/nf-double-year": "^3.2.
|
|
22
|
-
"@94ai/nf-drawer": "^3.2.
|
|
23
|
-
"@94ai/nf-form": "^3.2.
|
|
24
|
-
"@94ai/nf-form-item": "^3.2.
|
|
25
|
-
"@94ai/nf-half-year-picker": "^3.2.
|
|
26
|
-
"@94ai/nf-message": "^3.2.
|
|
27
|
-
"@94ai/nf-quarter-picker": "^3.2.
|
|
28
|
-
"@94ai/nf-select-transfer": "^3.2.
|
|
29
|
-
"@94ai/nf-theme-chalk": "^3.2.
|
|
30
|
-
"@94ai/nf-virtual-select": "^3.2.
|
|
17
|
+
"@94ai/nf-action": "^3.2.26",
|
|
18
|
+
"@94ai/nf-double-half-year": "^3.2.26",
|
|
19
|
+
"@94ai/nf-double-quarter": "^3.2.26",
|
|
20
|
+
"@94ai/nf-double-week": "^3.2.26",
|
|
21
|
+
"@94ai/nf-double-year": "^3.2.26",
|
|
22
|
+
"@94ai/nf-drawer": "^3.2.26",
|
|
23
|
+
"@94ai/nf-form": "^3.2.26",
|
|
24
|
+
"@94ai/nf-form-item": "^3.2.26",
|
|
25
|
+
"@94ai/nf-half-year-picker": "^3.2.26",
|
|
26
|
+
"@94ai/nf-message": "^3.2.26",
|
|
27
|
+
"@94ai/nf-quarter-picker": "^3.2.26",
|
|
28
|
+
"@94ai/nf-select-transfer": "^3.2.26",
|
|
29
|
+
"@94ai/nf-theme-chalk": "^3.2.26",
|
|
30
|
+
"@94ai/nf-virtual-select": "^3.2.26",
|
|
31
31
|
"vue-cookies": "^1.8.3",
|
|
32
32
|
"vue-demi": "^0.14.5",
|
|
33
33
|
"vuedraggable": "^2.24.3"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"types": "lib/index.d.ts",
|
|
46
46
|
"main": "lib/nf-search-form.cjs.js",
|
|
47
47
|
"module": "lib/nf-search-form.esm-bundler.js",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3fc82ba76ea5963f800c942e7dddf4ec58d851c4"
|
|
49
49
|
}
|