@94ai/nf-search-form 5.0.38 → 6.1.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/nf-search-form-item.vue.d.ts +6 -0
- package/lib/nf-search-form.cjs.js +403 -160
- package/lib/nf-search-form.esm-bundler.js +405 -162
- package/lib/style/css.d.ts +0 -1
- package/lib/style/index.d.ts +0 -1
- package/lib/types.d.ts +9 -0
- package/package/nf-column-check-dialog.vue +0 -1
- package/package/nf-search-form-item.vue +15 -4
- package/package/nf-search-form.vue +418 -155
- package/package/types.ts +9 -0
- package/package.json +20 -18
- package/lib/index.d.ts +0 -2927
- package/lib/nf-search-form.vue.d.ts +0 -666
package/lib/style/css.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/lib/style/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
interface IExchangeKey {
|
|
2
|
+
type: number;
|
|
3
|
+
value?: any;
|
|
4
|
+
}
|
|
1
5
|
export declare type NfSearchFormItemOption = {
|
|
2
6
|
key?: string;
|
|
3
7
|
_index?: number;
|
|
@@ -17,6 +21,10 @@ export declare type NfSearchFormItemOption = {
|
|
|
17
21
|
'is-range'?: boolean;
|
|
18
22
|
showMessage?: boolean;
|
|
19
23
|
inlineMessage?: boolean;
|
|
24
|
+
getOptions?: (callback: (options: any[]) => void, formData: Record<string, any>) => void;
|
|
25
|
+
changeProps?: string[];
|
|
26
|
+
show?: (formData: Record<string, any>) => boolean;
|
|
27
|
+
exchangeKey?: IExchangeKey;
|
|
20
28
|
category?: string;
|
|
21
29
|
initValue?: any;
|
|
22
30
|
slot?: string;
|
|
@@ -59,3 +67,4 @@ export declare type NfSearchFormItemOption = {
|
|
|
59
67
|
valueFormat?: string;
|
|
60
68
|
min?: 0;
|
|
61
69
|
};
|
|
70
|
+
export {};
|
|
@@ -4,19 +4,18 @@
|
|
|
4
4
|
<slot :name="slotName" />
|
|
5
5
|
</template>
|
|
6
6
|
<template v-else>
|
|
7
|
-
<
|
|
7
|
+
<nf-input
|
|
8
8
|
v-if="isInput"
|
|
9
9
|
v-model="currentVal"
|
|
10
10
|
v-bind="bindProps"
|
|
11
11
|
v-on="bindEvents"
|
|
12
12
|
@input="handleInput"
|
|
13
|
-
:placeholder="itemOptions.placeholder"
|
|
14
13
|
>
|
|
15
14
|
<slot :name="inputSlotPrepend" :slot="inputSlotPrepend"></slot>
|
|
16
15
|
<slot :name="inputSlotAppend" :slot="inputSlotAppend"></slot>
|
|
17
16
|
<slot :name="inputSlotSuffix" :slot="inputSlotSuffix"></slot>
|
|
18
17
|
<slot :name="inputSlotPrefix" :slot="inputSlotPrefix"></slot>
|
|
19
|
-
</
|
|
18
|
+
</nf-input>
|
|
20
19
|
<el-input-number
|
|
21
20
|
v-if="isInputNumber"
|
|
22
21
|
v-model="currentVal"
|
|
@@ -310,6 +309,7 @@ import { createUniqueString } from '@94ai/common-utils'
|
|
|
310
309
|
const emit = defineEmits<{
|
|
311
310
|
(e: 'input', event: any): void
|
|
312
311
|
(e: 'update:value', event: any): void
|
|
312
|
+
(e: 'handleChangeProps', event: string[]): void
|
|
313
313
|
}>()
|
|
314
314
|
|
|
315
315
|
const props = withDefaults(defineProps<{
|
|
@@ -325,10 +325,17 @@ const props = withDefaults(defineProps<{
|
|
|
325
325
|
* content宽度
|
|
326
326
|
*/
|
|
327
327
|
itemWidth?: number,
|
|
328
|
+
/**
|
|
329
|
+
* 表单当前数据
|
|
330
|
+
*/
|
|
331
|
+
nfSearchFormModel?: Record<string, any>,
|
|
328
332
|
}>(), {
|
|
329
333
|
value: undefined,
|
|
330
334
|
itemOptions: () => ({}),
|
|
331
335
|
itemWidth: 227,
|
|
336
|
+
nfSearchFormModel: () => {
|
|
337
|
+
return {}
|
|
338
|
+
}
|
|
332
339
|
})
|
|
333
340
|
|
|
334
341
|
const instance = getCurrentInstance()?.proxy
|
|
@@ -563,7 +570,11 @@ const isTransferSelect = computed(() => {
|
|
|
563
570
|
|
|
564
571
|
const handleChange = (event) => {
|
|
565
572
|
if (props.itemOptions?.events?.change) {
|
|
566
|
-
props.itemOptions.events.change(event, instance)
|
|
573
|
+
props.itemOptions.events.change(event, instance, props.nfSearchFormModel)
|
|
574
|
+
}
|
|
575
|
+
// 初始化关联属性
|
|
576
|
+
if (props.itemOptions?.changeProps) {
|
|
577
|
+
emit('handleChangeProps', props.itemOptions.changeProps)
|
|
567
578
|
}
|
|
568
579
|
}
|
|
569
580
|
const handleInput = (event) => {
|