@94ai/nf-search-form 3.2.26 → 3.2.29
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 +18 -14
- package/lib/nf-search-form.cjs.js +20 -5
- package/lib/nf-search-form.esm-bundler.js +20 -5
- package/lib/nf-search-form.vue.d.ts +7 -5
- package/package/nf-search-form.vue +20 -6
- package/package.json +16 -16
package/lib/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
86
86
|
};
|
|
87
87
|
columns: {
|
|
88
88
|
type: import("vue-demi").PropType<number>;
|
|
89
|
-
default:
|
|
89
|
+
default: undefined;
|
|
90
90
|
};
|
|
91
91
|
showBtn: {
|
|
92
92
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -167,7 +167,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
167
167
|
default: number;
|
|
168
168
|
};
|
|
169
169
|
formOptions: {
|
|
170
|
-
type: import("vue-demi").PropType<
|
|
170
|
+
type: import("vue-demi").PropType<any>;
|
|
171
171
|
default: () => never[];
|
|
172
172
|
};
|
|
173
173
|
closable: {
|
|
@@ -487,7 +487,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
487
487
|
};
|
|
488
488
|
columns: {
|
|
489
489
|
type: import("vue-demi").PropType<number>;
|
|
490
|
-
default:
|
|
490
|
+
default: undefined;
|
|
491
491
|
};
|
|
492
492
|
showBtn: {
|
|
493
493
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -568,7 +568,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
568
568
|
default: number;
|
|
569
569
|
};
|
|
570
570
|
formOptions: {
|
|
571
|
-
type: import("vue-demi").PropType<
|
|
571
|
+
type: import("vue-demi").PropType<any>;
|
|
572
572
|
default: () => never[];
|
|
573
573
|
};
|
|
574
574
|
closable: {
|
|
@@ -850,7 +850,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
850
850
|
btnBoxLabel: string;
|
|
851
851
|
btnModel: "inline" | "block";
|
|
852
852
|
labelWidth: number;
|
|
853
|
-
formOptions:
|
|
853
|
+
formOptions: any;
|
|
854
854
|
closable: boolean;
|
|
855
855
|
columnEdit: boolean;
|
|
856
856
|
showItems: string[];
|
|
@@ -991,7 +991,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
991
991
|
};
|
|
992
992
|
columns: {
|
|
993
993
|
type: import("vue-demi").PropType<number>;
|
|
994
|
-
default:
|
|
994
|
+
default: undefined;
|
|
995
995
|
};
|
|
996
996
|
showBtn: {
|
|
997
997
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -1072,7 +1072,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1072
1072
|
default: number;
|
|
1073
1073
|
};
|
|
1074
1074
|
formOptions: {
|
|
1075
|
-
type: import("vue-demi").PropType<
|
|
1075
|
+
type: import("vue-demi").PropType<any>;
|
|
1076
1076
|
default: () => never[];
|
|
1077
1077
|
};
|
|
1078
1078
|
closable: {
|
|
@@ -1371,6 +1371,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1371
1371
|
columnCheckDrawer: import("vue-demi").Ref<any>;
|
|
1372
1372
|
configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
|
|
1373
1373
|
syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
|
|
1374
|
+
onResize: () => void;
|
|
1375
|
+
visibleChange: () => void;
|
|
1374
1376
|
}> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
|
|
1375
1377
|
storageKey: {
|
|
1376
1378
|
type: import("vue-demi").PropType<string>;
|
|
@@ -1458,7 +1460,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1458
1460
|
};
|
|
1459
1461
|
columns: {
|
|
1460
1462
|
type: import("vue-demi").PropType<number>;
|
|
1461
|
-
default:
|
|
1463
|
+
default: undefined;
|
|
1462
1464
|
};
|
|
1463
1465
|
showBtn: {
|
|
1464
1466
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -1539,7 +1541,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1539
1541
|
default: number;
|
|
1540
1542
|
};
|
|
1541
1543
|
formOptions: {
|
|
1542
|
-
type: import("vue-demi").PropType<
|
|
1544
|
+
type: import("vue-demi").PropType<any>;
|
|
1543
1545
|
default: () => never[];
|
|
1544
1546
|
};
|
|
1545
1547
|
closable: {
|
|
@@ -1859,7 +1861,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1859
1861
|
};
|
|
1860
1862
|
columns: {
|
|
1861
1863
|
type: import("vue-demi").PropType<number>;
|
|
1862
|
-
default:
|
|
1864
|
+
default: undefined;
|
|
1863
1865
|
};
|
|
1864
1866
|
showBtn: {
|
|
1865
1867
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -1940,7 +1942,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1940
1942
|
default: number;
|
|
1941
1943
|
};
|
|
1942
1944
|
formOptions: {
|
|
1943
|
-
type: import("vue-demi").PropType<
|
|
1945
|
+
type: import("vue-demi").PropType<any>;
|
|
1944
1946
|
default: () => never[];
|
|
1945
1947
|
};
|
|
1946
1948
|
closable: {
|
|
@@ -2239,6 +2241,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2239
2241
|
columnCheckDrawer: import("vue-demi").Ref<any>;
|
|
2240
2242
|
configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
|
|
2241
2243
|
syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
|
|
2244
|
+
onResize: () => void;
|
|
2245
|
+
visibleChange: () => void;
|
|
2242
2246
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
2243
2247
|
onChange: (event: Record<string, any>) => void;
|
|
2244
2248
|
itemsChange: (event: string[]) => void;
|
|
@@ -2288,7 +2292,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2288
2292
|
btnBoxLabel: string;
|
|
2289
2293
|
btnModel: "inline" | "block";
|
|
2290
2294
|
labelWidth: number;
|
|
2291
|
-
formOptions:
|
|
2295
|
+
formOptions: any;
|
|
2292
2296
|
closable: boolean;
|
|
2293
2297
|
columnEdit: boolean;
|
|
2294
2298
|
showItems: string[];
|
|
@@ -2430,7 +2434,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2430
2434
|
};
|
|
2431
2435
|
columns: {
|
|
2432
2436
|
type: import("vue-demi").PropType<number>;
|
|
2433
|
-
default:
|
|
2437
|
+
default: undefined;
|
|
2434
2438
|
};
|
|
2435
2439
|
showBtn: {
|
|
2436
2440
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -2511,7 +2515,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
2511
2515
|
default: number;
|
|
2512
2516
|
};
|
|
2513
2517
|
formOptions: {
|
|
2514
|
-
type: import("vue-demi").PropType<
|
|
2518
|
+
type: import("vue-demi").PropType<any>;
|
|
2515
2519
|
default: () => never[];
|
|
2516
2520
|
};
|
|
2517
2521
|
closable: {
|
|
@@ -6441,7 +6441,7 @@ __sfc_main.props = {
|
|
|
6441
6441
|
key: "columns",
|
|
6442
6442
|
required: false,
|
|
6443
6443
|
type: Number,
|
|
6444
|
-
default:
|
|
6444
|
+
default: void 0
|
|
6445
6445
|
},
|
|
6446
6446
|
showBtn: {
|
|
6447
6447
|
key: "showBtn",
|
|
@@ -6588,7 +6588,7 @@ __sfc_main.props = {
|
|
|
6588
6588
|
formOptions: {
|
|
6589
6589
|
key: "formOptions",
|
|
6590
6590
|
required: false,
|
|
6591
|
-
type: Array,
|
|
6591
|
+
type: [Array, null],
|
|
6592
6592
|
default: () => []
|
|
6593
6593
|
},
|
|
6594
6594
|
closable: {
|
|
@@ -7042,13 +7042,15 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7042
7042
|
const columnCheckDialog = vueDemi.ref();
|
|
7043
7043
|
const nfSearchFormModel = vueDemi.ref({});
|
|
7044
7044
|
const initLocalShow = () => {
|
|
7045
|
+
props.formOptions._skip = true;
|
|
7045
7046
|
const result = props.formOptions.filter((item) => {
|
|
7046
7047
|
var _a2;
|
|
7047
7048
|
if ((_a2 = props.showItems) == null ? void 0 : _a2.includes(item.prop)) {
|
|
7048
|
-
item.initHidden =
|
|
7049
|
+
item.initHidden = false;
|
|
7049
7050
|
}
|
|
7050
|
-
return item.initHidden;
|
|
7051
|
+
return !item.initHidden;
|
|
7051
7052
|
}).map((item) => item.prop);
|
|
7053
|
+
props.formOptions._skip = false;
|
|
7052
7054
|
if (result.length) {
|
|
7053
7055
|
return result;
|
|
7054
7056
|
}
|
|
@@ -7098,6 +7100,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7098
7100
|
}
|
|
7099
7101
|
};
|
|
7100
7102
|
const syncShowItemToInitHidden = () => {
|
|
7103
|
+
props.formOptions._skip = true;
|
|
7101
7104
|
props.formOptions.forEach((item) => {
|
|
7102
7105
|
var _a2;
|
|
7103
7106
|
if ((_a2 = localShowItems.value) == null ? void 0 : _a2.includes(item.prop)) {
|
|
@@ -7106,6 +7109,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7106
7109
|
item.initHidden = true;
|
|
7107
7110
|
}
|
|
7108
7111
|
});
|
|
7112
|
+
props.formOptions._skip = false;
|
|
7109
7113
|
};
|
|
7110
7114
|
if (props.columnEdit) {
|
|
7111
7115
|
const cached = (_b = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b.get(props.storageKey);
|
|
@@ -7124,6 +7128,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7124
7128
|
const renderSearchFormItemOptions = vueDemi.ref([]);
|
|
7125
7129
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
7126
7130
|
var _a2;
|
|
7131
|
+
props.formOptions._skip = true;
|
|
7127
7132
|
const columns = props.formOptions.map((item, index2) => {
|
|
7128
7133
|
item.key = item.key || createUniqueString();
|
|
7129
7134
|
item._index = index2;
|
|
@@ -7150,6 +7155,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7150
7155
|
}
|
|
7151
7156
|
}
|
|
7152
7157
|
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
|
|
7158
|
+
props.formOptions._skip = false;
|
|
7153
7159
|
};
|
|
7154
7160
|
syncCookiesToSearchFormItemOptions();
|
|
7155
7161
|
const itemIsShow = (item) => {
|
|
@@ -7176,6 +7182,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7176
7182
|
vueDemi.watch(() => {
|
|
7177
7183
|
return props.formOptions;
|
|
7178
7184
|
}, () => {
|
|
7185
|
+
if (props.formOptions._skip) {
|
|
7186
|
+
return;
|
|
7187
|
+
}
|
|
7179
7188
|
syncCookiesToSearchFormItemOptions();
|
|
7180
7189
|
}, {
|
|
7181
7190
|
deep: true
|
|
@@ -7210,6 +7219,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7210
7219
|
}
|
|
7211
7220
|
};
|
|
7212
7221
|
const calcColumns = () => {
|
|
7222
|
+
if (props.columns) {
|
|
7223
|
+
newColumns.value = props.columns;
|
|
7224
|
+
return;
|
|
7225
|
+
}
|
|
7213
7226
|
if (!nfSearchFormRef.value)
|
|
7214
7227
|
return;
|
|
7215
7228
|
let count = 0;
|
|
@@ -7408,7 +7421,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7408
7421
|
/**
|
|
7409
7422
|
* 列编辑同步cookies到组件渲染数据
|
|
7410
7423
|
*/
|
|
7411
|
-
syncCookiesToSearchFormItemOptions
|
|
7424
|
+
syncCookiesToSearchFormItemOptions,
|
|
7425
|
+
onResize,
|
|
7426
|
+
visibleChange: onResize
|
|
7412
7427
|
});
|
|
7413
7428
|
};
|
|
7414
7429
|
__sfc_main.components = Object.assign({
|
|
@@ -6439,7 +6439,7 @@ __sfc_main.props = {
|
|
|
6439
6439
|
key: "columns",
|
|
6440
6440
|
required: false,
|
|
6441
6441
|
type: Number,
|
|
6442
|
-
default:
|
|
6442
|
+
default: void 0
|
|
6443
6443
|
},
|
|
6444
6444
|
showBtn: {
|
|
6445
6445
|
key: "showBtn",
|
|
@@ -6586,7 +6586,7 @@ __sfc_main.props = {
|
|
|
6586
6586
|
formOptions: {
|
|
6587
6587
|
key: "formOptions",
|
|
6588
6588
|
required: false,
|
|
6589
|
-
type: Array,
|
|
6589
|
+
type: [Array, null],
|
|
6590
6590
|
default: () => []
|
|
6591
6591
|
},
|
|
6592
6592
|
closable: {
|
|
@@ -7040,13 +7040,15 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7040
7040
|
const columnCheckDialog = ref();
|
|
7041
7041
|
const nfSearchFormModel = ref({});
|
|
7042
7042
|
const initLocalShow = () => {
|
|
7043
|
+
props.formOptions._skip = true;
|
|
7043
7044
|
const result = props.formOptions.filter((item) => {
|
|
7044
7045
|
var _a2;
|
|
7045
7046
|
if ((_a2 = props.showItems) == null ? void 0 : _a2.includes(item.prop)) {
|
|
7046
|
-
item.initHidden =
|
|
7047
|
+
item.initHidden = false;
|
|
7047
7048
|
}
|
|
7048
|
-
return item.initHidden;
|
|
7049
|
+
return !item.initHidden;
|
|
7049
7050
|
}).map((item) => item.prop);
|
|
7051
|
+
props.formOptions._skip = false;
|
|
7050
7052
|
if (result.length) {
|
|
7051
7053
|
return result;
|
|
7052
7054
|
}
|
|
@@ -7096,6 +7098,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7096
7098
|
}
|
|
7097
7099
|
};
|
|
7098
7100
|
const syncShowItemToInitHidden = () => {
|
|
7101
|
+
props.formOptions._skip = true;
|
|
7099
7102
|
props.formOptions.forEach((item) => {
|
|
7100
7103
|
var _a2;
|
|
7101
7104
|
if ((_a2 = localShowItems.value) == null ? void 0 : _a2.includes(item.prop)) {
|
|
@@ -7104,6 +7107,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7104
7107
|
item.initHidden = true;
|
|
7105
7108
|
}
|
|
7106
7109
|
});
|
|
7110
|
+
props.formOptions._skip = false;
|
|
7107
7111
|
};
|
|
7108
7112
|
if (props.columnEdit) {
|
|
7109
7113
|
const cached = (_b = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b.get(props.storageKey);
|
|
@@ -7122,6 +7126,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7122
7126
|
const renderSearchFormItemOptions = ref([]);
|
|
7123
7127
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
7124
7128
|
var _a2;
|
|
7129
|
+
props.formOptions._skip = true;
|
|
7125
7130
|
const columns = props.formOptions.map((item, index2) => {
|
|
7126
7131
|
item.key = item.key || createUniqueString();
|
|
7127
7132
|
item._index = index2;
|
|
@@ -7148,6 +7153,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7148
7153
|
}
|
|
7149
7154
|
}
|
|
7150
7155
|
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
|
|
7156
|
+
props.formOptions._skip = false;
|
|
7151
7157
|
};
|
|
7152
7158
|
syncCookiesToSearchFormItemOptions();
|
|
7153
7159
|
const itemIsShow = (item) => {
|
|
@@ -7174,6 +7180,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7174
7180
|
watch(() => {
|
|
7175
7181
|
return props.formOptions;
|
|
7176
7182
|
}, () => {
|
|
7183
|
+
if (props.formOptions._skip) {
|
|
7184
|
+
return;
|
|
7185
|
+
}
|
|
7177
7186
|
syncCookiesToSearchFormItemOptions();
|
|
7178
7187
|
}, {
|
|
7179
7188
|
deep: true
|
|
@@ -7208,6 +7217,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7208
7217
|
}
|
|
7209
7218
|
};
|
|
7210
7219
|
const calcColumns = () => {
|
|
7220
|
+
if (props.columns) {
|
|
7221
|
+
newColumns.value = props.columns;
|
|
7222
|
+
return;
|
|
7223
|
+
}
|
|
7211
7224
|
if (!nfSearchFormRef.value)
|
|
7212
7225
|
return;
|
|
7213
7226
|
let count = 0;
|
|
@@ -7406,7 +7419,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
7406
7419
|
/**
|
|
7407
7420
|
* 列编辑同步cookies到组件渲染数据
|
|
7408
7421
|
*/
|
|
7409
|
-
syncCookiesToSearchFormItemOptions
|
|
7422
|
+
syncCookiesToSearchFormItemOptions,
|
|
7423
|
+
onResize,
|
|
7424
|
+
visibleChange: onResize
|
|
7410
7425
|
});
|
|
7411
7426
|
};
|
|
7412
7427
|
__sfc_main.components = Object.assign({
|
|
@@ -87,7 +87,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
87
87
|
};
|
|
88
88
|
columns: {
|
|
89
89
|
type: import("vue-demi").PropType<number>;
|
|
90
|
-
default:
|
|
90
|
+
default: undefined;
|
|
91
91
|
};
|
|
92
92
|
showBtn: {
|
|
93
93
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -168,7 +168,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
168
168
|
default: number;
|
|
169
169
|
};
|
|
170
170
|
formOptions: {
|
|
171
|
-
type: import("vue-demi").PropType<
|
|
171
|
+
type: import("vue-demi").PropType<any>;
|
|
172
172
|
default: () => never[];
|
|
173
173
|
};
|
|
174
174
|
closable: {
|
|
@@ -467,6 +467,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
467
467
|
columnCheckDrawer: import("vue-demi").Ref<any>;
|
|
468
468
|
configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
|
|
469
469
|
syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
|
|
470
|
+
onResize: () => void;
|
|
471
|
+
visibleChange: () => void;
|
|
470
472
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
471
473
|
onChange: (event: Record<string, any>) => void;
|
|
472
474
|
itemsChange: (event: string[]) => void;
|
|
@@ -562,7 +564,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
562
564
|
};
|
|
563
565
|
columns: {
|
|
564
566
|
type: import("vue-demi").PropType<number>;
|
|
565
|
-
default:
|
|
567
|
+
default: undefined;
|
|
566
568
|
};
|
|
567
569
|
showBtn: {
|
|
568
570
|
type: import("vue-demi").PropType<boolean>;
|
|
@@ -643,7 +645,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
643
645
|
default: number;
|
|
644
646
|
};
|
|
645
647
|
formOptions: {
|
|
646
|
-
type: import("vue-demi").PropType<
|
|
648
|
+
type: import("vue-demi").PropType<any>;
|
|
647
649
|
default: () => never[];
|
|
648
650
|
};
|
|
649
651
|
closable: {
|
|
@@ -917,7 +919,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
917
919
|
btnBoxLabel: string;
|
|
918
920
|
btnModel: 'inline' | 'block';
|
|
919
921
|
labelWidth: number;
|
|
920
|
-
formOptions: NfSearchFormItemOption[];
|
|
922
|
+
formOptions: NfSearchFormItemOption[] | any;
|
|
921
923
|
closable: boolean;
|
|
922
924
|
columnEdit: boolean;
|
|
923
925
|
showItems: string[];
|
|
@@ -338,7 +338,7 @@ const props = withDefaults(defineProps<{
|
|
|
338
338
|
/**
|
|
339
339
|
* 所有的表单项
|
|
340
340
|
*/
|
|
341
|
-
formOptions?: NfSearchFormItemOption[],
|
|
341
|
+
formOptions?: NfSearchFormItemOption[] | any,
|
|
342
342
|
/**
|
|
343
343
|
* 列编辑,是否显示关闭选项功能
|
|
344
344
|
*/
|
|
@@ -462,7 +462,7 @@ const props = withDefaults(defineProps<{
|
|
|
462
462
|
expandBtnCircle: false,
|
|
463
463
|
expandBtnLoading: false,
|
|
464
464
|
expandBtnDisabled: false,
|
|
465
|
-
columns:
|
|
465
|
+
columns: undefined,
|
|
466
466
|
labelPosition: 'top',
|
|
467
467
|
inline: true,
|
|
468
468
|
rules: undefined,
|
|
@@ -602,12 +602,14 @@ const nfSearchFormModel = ref<Record<string, any>>({})
|
|
|
602
602
|
* 同步用户参数
|
|
603
603
|
*/
|
|
604
604
|
const initLocalShow = () => {
|
|
605
|
+
props.formOptions._skip = true
|
|
605
606
|
const result = props.formOptions.filter(item => {
|
|
606
607
|
if (props.showItems?.includes(item.prop!)) {
|
|
607
|
-
item.initHidden =
|
|
608
|
+
item.initHidden = false
|
|
608
609
|
}
|
|
609
|
-
return item.initHidden
|
|
610
|
+
return !item.initHidden
|
|
610
611
|
}).map(item => item.prop!)
|
|
612
|
+
props.formOptions._skip = false
|
|
611
613
|
if (result.length) {
|
|
612
614
|
return result
|
|
613
615
|
}
|
|
@@ -657,6 +659,7 @@ const syncCookiesToLocalShowColumn = () => {
|
|
|
657
659
|
}
|
|
658
660
|
|
|
659
661
|
const syncShowItemToInitHidden = () => {
|
|
662
|
+
props.formOptions._skip = true
|
|
660
663
|
props.formOptions.forEach(item => {
|
|
661
664
|
if (localShowItems.value?.includes(item.prop!)) {
|
|
662
665
|
item.initHidden = false
|
|
@@ -664,12 +667,12 @@ const syncShowItemToInitHidden = () => {
|
|
|
664
667
|
item.initHidden = true
|
|
665
668
|
}
|
|
666
669
|
})
|
|
670
|
+
props.formOptions._skip = false
|
|
667
671
|
}
|
|
668
672
|
if (props.columnEdit) {
|
|
669
673
|
// 同步缓存参数
|
|
670
674
|
const cached = instance?.$cookies?.get(props.storageKey)
|
|
671
675
|
const cachedPriority = props.priority === 'cached'
|
|
672
|
-
|
|
673
676
|
if (cachedPriority ? cached : localShowItems.value?.length) {
|
|
674
677
|
cachedPriority ? syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies()
|
|
675
678
|
} else if (cachedPriority ? localShowItems.value?.length : cached) {
|
|
@@ -698,6 +701,7 @@ const isShowBtnBoxSlot = computed(() => {
|
|
|
698
701
|
*/
|
|
699
702
|
const renderSearchFormItemOptions = ref<NfSearchFormItemOption[]>([])
|
|
700
703
|
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
704
|
+
props.formOptions._skip = true
|
|
701
705
|
const columns = props.formOptions!.map((item, index) => {
|
|
702
706
|
item.key = item.key || createUniqueString()
|
|
703
707
|
item._index = index
|
|
@@ -725,6 +729,7 @@ const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
|
725
729
|
}
|
|
726
730
|
}
|
|
727
731
|
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index! - b._index! < 0 ? -1 : a._index! - b._index! > 0 ? 1 : 0)
|
|
732
|
+
props.formOptions._skip = false
|
|
728
733
|
}
|
|
729
734
|
syncCookiesToSearchFormItemOptions()
|
|
730
735
|
|
|
@@ -777,6 +782,9 @@ onBeforeMount(() => {
|
|
|
777
782
|
watch(() => {
|
|
778
783
|
return props.formOptions
|
|
779
784
|
}, () => {
|
|
785
|
+
if (props.formOptions._skip) {
|
|
786
|
+
return
|
|
787
|
+
}
|
|
780
788
|
syncCookiesToSearchFormItemOptions()
|
|
781
789
|
}, {
|
|
782
790
|
deep: true
|
|
@@ -815,6 +823,10 @@ const onResize = () => {
|
|
|
815
823
|
}
|
|
816
824
|
|
|
817
825
|
const calcColumns = () => {
|
|
826
|
+
if (props.columns) {
|
|
827
|
+
newColumns.value = props.columns
|
|
828
|
+
return
|
|
829
|
+
}
|
|
818
830
|
if (!nfSearchFormRef.value) return
|
|
819
831
|
let count = 0
|
|
820
832
|
const formWidth = nfSearchFormRef.value.$el.offsetWidth
|
|
@@ -1026,7 +1038,9 @@ defineExpose({
|
|
|
1026
1038
|
/**
|
|
1027
1039
|
* 列编辑同步cookies到组件渲染数据
|
|
1028
1040
|
*/
|
|
1029
|
-
syncCookiesToSearchFormItemOptions
|
|
1041
|
+
syncCookiesToSearchFormItemOptions,
|
|
1042
|
+
onResize,
|
|
1043
|
+
visibleChange: onResize
|
|
1030
1044
|
})
|
|
1031
1045
|
|
|
1032
1046
|
</script>
|
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.29",
|
|
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.29",
|
|
18
|
+
"@94ai/nf-double-half-year": "^3.2.29",
|
|
19
|
+
"@94ai/nf-double-quarter": "^3.2.29",
|
|
20
|
+
"@94ai/nf-double-week": "^3.2.29",
|
|
21
|
+
"@94ai/nf-double-year": "^3.2.29",
|
|
22
|
+
"@94ai/nf-drawer": "^3.2.29",
|
|
23
|
+
"@94ai/nf-form": "^3.2.29",
|
|
24
|
+
"@94ai/nf-form-item": "^3.2.29",
|
|
25
|
+
"@94ai/nf-half-year-picker": "^3.2.29",
|
|
26
|
+
"@94ai/nf-message": "^3.2.29",
|
|
27
|
+
"@94ai/nf-quarter-picker": "^3.2.29",
|
|
28
|
+
"@94ai/nf-select-transfer": "^3.2.29",
|
|
29
|
+
"@94ai/nf-theme-chalk": "^3.2.29",
|
|
30
|
+
"@94ai/nf-virtual-select": "^3.2.29",
|
|
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": "d50a6e5d90176f48f79efc659a7f66bbc31721e2"
|
|
49
49
|
}
|