@94ai/nf-search-form 3.2.48 → 3.2.49
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 +126 -126
- package/lib/nf-column-check-dialog.vue.d.ts +28 -28
- package/lib/nf-column-check-drawer.vue.d.ts +27 -19
- package/lib/nf-search-form.cjs.js +1112 -6399
- package/lib/nf-search-form.esm-bundler.js +1104 -6391
- package/lib/nf-search-form.vue.d.ts +43 -43
- package/package/index.ts +0 -6
- package/package/nf-column-check-dialog.vue +12 -8
- package/package/nf-column-check-drawer.vue +25 -18
- package/package/nf-search-form-item.vue +1 -1
- package/package/nf-search-form.vue +152 -106
- package/package.json +18 -17
- package/lib/tools.d.ts +0 -17
- package/package/README.md +0 -137
- package/package/tools.ts +0 -177
|
@@ -204,7 +204,6 @@
|
|
|
204
204
|
:table-columns="formOptions"
|
|
205
205
|
:title="moreDialogTitle"
|
|
206
206
|
:width="moreDialogWidth"
|
|
207
|
-
:show-columns="localShowItems"
|
|
208
207
|
:modal-append-to-body="modalAppendToBody"
|
|
209
208
|
:modal="modal"
|
|
210
209
|
:fullscreen="fullscreen"
|
|
@@ -245,6 +244,7 @@
|
|
|
245
244
|
<slot slot="title" name="columCheckTitle" />
|
|
246
245
|
<slot slot="footer" name="columCheckFooter" />
|
|
247
246
|
<column-check-drawer
|
|
247
|
+
:column-edit="columnEdit"
|
|
248
248
|
:search-placeholder="columnCheckSearchPlaceholder"
|
|
249
249
|
:fixed-left-desc="columnCheckFixedLeftDesc"
|
|
250
250
|
:clear-desc="columnCheckClearDesc"
|
|
@@ -273,12 +273,8 @@ export default defineComponent({
|
|
|
273
273
|
import SearchFormItem from './nf-search-form-item.vue'
|
|
274
274
|
import ColumnCheckDialog from './nf-column-check-dialog.vue'
|
|
275
275
|
import ColumnCheckDrawer from './nf-column-check-drawer.vue'
|
|
276
|
-
import ResizeObserver from 'resize-observer-polyfill'
|
|
277
|
-
|
|
278
|
-
import {
|
|
279
|
-
createUniqueString,
|
|
280
|
-
debounce
|
|
281
|
-
} from './tools'
|
|
276
|
+
import ResizeObserver from 'resize-observer-polyfill'
|
|
277
|
+
import { createUniqueString } from '@94ai/common-utils'
|
|
282
278
|
import { NfSearchFormItemOption } from './types'
|
|
283
279
|
import {
|
|
284
280
|
ref,
|
|
@@ -288,14 +284,16 @@ import {
|
|
|
288
284
|
onBeforeMount,
|
|
289
285
|
onMounted,
|
|
290
286
|
onBeforeUnmount,
|
|
291
|
-
onUnmounted,
|
|
292
287
|
nextTick
|
|
293
288
|
} from 'vue-demi'
|
|
294
289
|
import { ITabItem } from '@94ai/nf-drawer/lib/types'
|
|
295
290
|
import {
|
|
296
|
-
ElTableColumnAttributes,
|
|
297
291
|
NfTableColumnAttributes
|
|
298
292
|
} from '@94ai/nf-table/lib/types'
|
|
293
|
+
import { set } from 'vue'
|
|
294
|
+
import {
|
|
295
|
+
CachedManager,
|
|
296
|
+
} from '@94ai/common-utils'
|
|
299
297
|
|
|
300
298
|
|
|
301
299
|
const props = withDefaults(defineProps<{
|
|
@@ -609,15 +607,21 @@ const nfSearchFormModel = ref<Record<string, any>>({})
|
|
|
609
607
|
/**
|
|
610
608
|
* 同步用户参数
|
|
611
609
|
*/
|
|
612
|
-
const initLocalShow = () => {
|
|
613
|
-
|
|
610
|
+
const initLocalShow = (init = false) => {
|
|
611
|
+
if (!init) {
|
|
612
|
+
props.formOptions._skip = true
|
|
613
|
+
}
|
|
614
614
|
const result = props.formOptions.filter(item => {
|
|
615
615
|
if (props.showItems?.includes(item.prop!)) {
|
|
616
616
|
item.initHidden = false
|
|
617
617
|
}
|
|
618
618
|
return !item.initHidden
|
|
619
619
|
}).map(item => item.prop!)
|
|
620
|
-
|
|
620
|
+
if (!init) {
|
|
621
|
+
nextTick(() => {
|
|
622
|
+
props.formOptions._skip = false
|
|
623
|
+
})
|
|
624
|
+
}
|
|
621
625
|
if (result.length) {
|
|
622
626
|
return result
|
|
623
627
|
}
|
|
@@ -626,9 +630,12 @@ const initLocalShow = () => {
|
|
|
626
630
|
/**
|
|
627
631
|
* 表单显示的item集合
|
|
628
632
|
*/
|
|
629
|
-
const localShowItems = ref<string[]>(initLocalShow())
|
|
630
|
-
watch(() => localShowItems.value?.length, () => {
|
|
633
|
+
const localShowItems = ref<string[]>(initLocalShow(true))
|
|
634
|
+
watch(() => localShowItems.value?.length, async () => {
|
|
631
635
|
emit('update:showItems', localShowItems.value)
|
|
636
|
+
if (Object.keys(nfSearchFormModel.value).length) {
|
|
637
|
+
refreshNfSearchFormModel(false)
|
|
638
|
+
}
|
|
632
639
|
}, {
|
|
633
640
|
immediate: true
|
|
634
641
|
})
|
|
@@ -643,25 +650,31 @@ const syncLocalShowColumnToCookies = () => {
|
|
|
643
650
|
index
|
|
644
651
|
}
|
|
645
652
|
})
|
|
646
|
-
|
|
647
|
-
instance?.$cookies?.set(props.storageKey, JSON.stringify(columnState), -1, '/xxxx/xxxx/xxxx')
|
|
653
|
+
CachedManager.syncCachedSet(props.storageKey, columnState)
|
|
648
654
|
}
|
|
649
655
|
}
|
|
650
|
-
|
|
656
|
+
|
|
657
|
+
const syncCookiesToLocalShowColumn = async () => {
|
|
651
658
|
if (props.columnEdit) {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
if (
|
|
655
|
-
columnState =
|
|
659
|
+
try {
|
|
660
|
+
let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
661
|
+
if (!columnState) {
|
|
662
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey)
|
|
656
663
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
664
|
+
if (columnState) {
|
|
665
|
+
if (typeof columnState === 'string') {
|
|
666
|
+
columnState = JSON.parse(columnState)
|
|
667
|
+
}
|
|
668
|
+
const showColumnItems: string[] = []
|
|
669
|
+
for (const key in columnState as NfTableColumnAttributes) {
|
|
670
|
+
if (!columnState![key].initHidden) {
|
|
671
|
+
showColumnItems.push(columnState![key].prop)
|
|
672
|
+
}
|
|
661
673
|
}
|
|
674
|
+
setLocalShowItems(showColumnItems, true)
|
|
662
675
|
}
|
|
663
|
-
|
|
664
|
-
|
|
676
|
+
} catch (e) {
|
|
677
|
+
console.log(e)
|
|
665
678
|
}
|
|
666
679
|
}
|
|
667
680
|
}
|
|
@@ -675,19 +688,28 @@ const syncShowItemToInitHidden = () => {
|
|
|
675
688
|
item.initHidden = true
|
|
676
689
|
}
|
|
677
690
|
})
|
|
678
|
-
|
|
691
|
+
nextTick(() => {
|
|
692
|
+
props.formOptions._skip = false
|
|
693
|
+
})
|
|
679
694
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
cachedPriority
|
|
695
|
+
const initCachedData = async () => {
|
|
696
|
+
if (props.columnEdit) {
|
|
697
|
+
// 同步缓存参数
|
|
698
|
+
let cached: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
699
|
+
if (!cached) {
|
|
700
|
+
cached = await CachedManager.asyncCachedGet(props.storageKey)
|
|
701
|
+
}
|
|
702
|
+
const cachedPriority = props.priority === 'cached'
|
|
703
|
+
if (cachedPriority ? cached : localShowItems.value?.length) {
|
|
704
|
+
cachedPriority ? await syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies()
|
|
705
|
+
} else if (cachedPriority ? localShowItems.value?.length : cached) {
|
|
706
|
+
cachedPriority ? syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn()
|
|
707
|
+
}
|
|
688
708
|
}
|
|
689
709
|
}
|
|
690
710
|
|
|
711
|
+
initCachedData()
|
|
712
|
+
|
|
691
713
|
/**
|
|
692
714
|
* 超过数量显示更多
|
|
693
715
|
*/
|
|
@@ -708,36 +730,49 @@ const isShowBtnBoxSlot = computed(() => {
|
|
|
708
730
|
* 转换成最终的表单项渲染数据
|
|
709
731
|
*/
|
|
710
732
|
const renderSearchFormItemOptions = ref<NfSearchFormItemOption[]>([])
|
|
711
|
-
const syncCookiesToSearchFormItemOptions = (readCached = true) => {
|
|
733
|
+
const syncCookiesToSearchFormItemOptions = async (readCached = true) => {
|
|
712
734
|
props.formOptions._skip = true
|
|
713
735
|
const columns = props.formOptions!.map((item, index) => {
|
|
714
736
|
item.key = item.key || createUniqueString()
|
|
715
|
-
item._index = index
|
|
716
|
-
item.__index = index
|
|
737
|
+
item._index = index // 混合缓存后的数据
|
|
738
|
+
item.__index = index // 原始顺序
|
|
739
|
+
set(item, 'initHidden', !!item.initHidden)
|
|
740
|
+
set(item, 'destory', !!item.destory)
|
|
717
741
|
return item
|
|
718
742
|
})
|
|
719
743
|
if (readCached && props.columnEdit) {
|
|
720
744
|
// 读取缓存 Column 配置
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
745
|
+
try {
|
|
746
|
+
// 同步缓存参数
|
|
747
|
+
let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
748
|
+
if (!columnState) {
|
|
749
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey)
|
|
725
750
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
751
|
+
props.formOptions._skip = true
|
|
752
|
+
if (columnState) {
|
|
753
|
+
if (typeof columnState === 'string') {
|
|
754
|
+
columnState = JSON.parse(columnState)
|
|
755
|
+
}
|
|
756
|
+
for (const key in columnState as NfTableColumnAttributes) {
|
|
757
|
+
const state = columnState![key]
|
|
758
|
+
columns.every(i => {
|
|
759
|
+
if (i.prop === key) {
|
|
760
|
+
i.initHidden = state.initHidden
|
|
761
|
+
i._index = state.index
|
|
762
|
+
return false
|
|
763
|
+
}
|
|
764
|
+
return true
|
|
765
|
+
})
|
|
766
|
+
}
|
|
736
767
|
}
|
|
768
|
+
} catch (e) {
|
|
769
|
+
console.log(e)
|
|
737
770
|
}
|
|
738
771
|
}
|
|
739
|
-
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index
|
|
740
|
-
|
|
772
|
+
renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
|
|
773
|
+
nextTick(() => {
|
|
774
|
+
props.formOptions._skip = false;
|
|
775
|
+
})
|
|
741
776
|
}
|
|
742
777
|
syncCookiesToSearchFormItemOptions()
|
|
743
778
|
|
|
@@ -746,10 +781,7 @@ syncCookiesToSearchFormItemOptions()
|
|
|
746
781
|
* @param prop
|
|
747
782
|
*/
|
|
748
783
|
const itemIsShow = (item: NfSearchFormItemOption) => {
|
|
749
|
-
|
|
750
|
-
return !item.initHidden && !item.destory
|
|
751
|
-
}
|
|
752
|
-
return localShowItems.value.includes(item.prop!) && !item.initHidden && !item.destory
|
|
784
|
+
return !item.initHidden && !item.destory
|
|
753
785
|
}
|
|
754
786
|
|
|
755
787
|
|
|
@@ -774,6 +806,14 @@ watch(() => {
|
|
|
774
806
|
immediate: true
|
|
775
807
|
})
|
|
776
808
|
|
|
809
|
+
const setLocalShowItems = (list, syncToInitHidden = false) => {
|
|
810
|
+
if (JSON.stringify(list.sort()) !== JSON.stringify(localShowItems.value.sort())) {
|
|
811
|
+
localShowItems.value = list
|
|
812
|
+
if (syncToInitHidden) {
|
|
813
|
+
syncShowItemToInitHidden()
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
777
817
|
|
|
778
818
|
/**
|
|
779
819
|
* 初始化formData表单数据
|
|
@@ -789,29 +829,44 @@ onBeforeMount(() => {
|
|
|
789
829
|
*/
|
|
790
830
|
watch(() => {
|
|
791
831
|
return props.formOptions
|
|
792
|
-
}, () => {
|
|
832
|
+
}, async () => {
|
|
793
833
|
if (props.formOptions._skip) {
|
|
794
834
|
return
|
|
795
835
|
}
|
|
796
|
-
|
|
836
|
+
setLocalShowItems(initLocalShow())
|
|
837
|
+
await syncCookiesToSearchFormItemOptions()
|
|
797
838
|
}, {
|
|
798
839
|
deep: true
|
|
799
840
|
})
|
|
841
|
+
refreshNfSearchFormModel(false, true)
|
|
842
|
+
})
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
const refreshNfSearchFormModel = (outEmit = true, init = false) => {
|
|
800
846
|
const obj: Record<string, any> = {}
|
|
801
|
-
props.formOptions.forEach(v => {
|
|
802
|
-
if (v.
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
847
|
+
props.formOptions.filter(item => !item.destory).forEach(v => {
|
|
848
|
+
if (localShowItems.value.includes(v.prop)) {
|
|
849
|
+
if (init) {
|
|
850
|
+
if (v.initValue !== undefined) {
|
|
851
|
+
obj[v.prop!] = v.initValue
|
|
852
|
+
} else {
|
|
853
|
+
obj[v.prop!] = undefined
|
|
854
|
+
}
|
|
855
|
+
} else {
|
|
856
|
+
obj[v.prop!] = nfSearchFormModel.value[v.prop]
|
|
857
|
+
}
|
|
806
858
|
}
|
|
807
859
|
})
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
860
|
+
if (JSON.stringify(nfSearchFormModel.value) !== JSON.stringify(obj)) {
|
|
861
|
+
nfSearchFormModel.value = obj
|
|
862
|
+
if (outEmit) {
|
|
863
|
+
emit('onChange', nfSearchFormModel.value)
|
|
864
|
+
nextTick(() => {
|
|
865
|
+
emit('itemsChange', localShowItems.value)
|
|
866
|
+
})
|
|
811
867
|
}
|
|
812
868
|
}
|
|
813
|
-
|
|
814
|
-
})
|
|
869
|
+
}
|
|
815
870
|
|
|
816
871
|
const isCollapseChange = async (val: boolean) => {
|
|
817
872
|
emit('isCollapseChange', val)
|
|
@@ -833,15 +888,15 @@ const refreshLabel = () => {
|
|
|
833
888
|
const onResize = async (params: Record<string, any> = {}) => {
|
|
834
889
|
const {
|
|
835
890
|
width
|
|
836
|
-
} = (params?.[0]?.contentRect) || {}
|
|
891
|
+
} = (params?.[0]?.contentRect) || {}
|
|
837
892
|
if (width && domWidth.value && width === domWidth.value) {
|
|
838
|
-
return
|
|
893
|
+
return
|
|
839
894
|
}
|
|
840
895
|
if (domWidth.value) {
|
|
841
|
-
await nextTick()
|
|
842
|
-
domWidth.value = topDom.value.offsetWidth
|
|
896
|
+
await nextTick()
|
|
897
|
+
domWidth.value = topDom.value.offsetWidth
|
|
843
898
|
}
|
|
844
|
-
refreshLabel()
|
|
899
|
+
refreshLabel()
|
|
845
900
|
}
|
|
846
901
|
|
|
847
902
|
const calcColumns = () => {
|
|
@@ -868,7 +923,7 @@ onMounted(async () => {
|
|
|
868
923
|
calcColumns()
|
|
869
924
|
await nextTick()
|
|
870
925
|
observer.value = new ResizeObserver(onResize)
|
|
871
|
-
observer.value.observe(topDom.value, { box:
|
|
926
|
+
observer.value.observe(topDom.value, { box: 'border-box' })
|
|
872
927
|
})
|
|
873
928
|
|
|
874
929
|
onBeforeUnmount(() => {
|
|
@@ -916,31 +971,23 @@ const onNfSearchFormExport = () => {
|
|
|
916
971
|
* @param prop
|
|
917
972
|
*/
|
|
918
973
|
const hiddenNfSearchFormItemOptionField = async (prop) => {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
syncCookiesToSearchFormItemOptions()
|
|
925
|
-
refreshNfSearchFormModel()
|
|
926
|
-
await nextTick()
|
|
927
|
-
refreshLabel()
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
/**
|
|
932
|
-
* 更新item对应的formData
|
|
933
|
-
* @param prop
|
|
934
|
-
*/
|
|
935
|
-
const refreshNfSearchFormModel = async () => {
|
|
936
|
-
for (const key in nfSearchFormModel.value) {
|
|
937
|
-
if (!localShowItems.value.includes(key)) {
|
|
938
|
-
delete nfSearchFormModel.value[key]
|
|
974
|
+
prop.formOptions._skip = true
|
|
975
|
+
prop.formOptions.every(item => {
|
|
976
|
+
if (item.prop === prop) {
|
|
977
|
+
item.initHidden = true
|
|
978
|
+
return false
|
|
939
979
|
}
|
|
940
|
-
|
|
941
|
-
|
|
980
|
+
return true
|
|
981
|
+
})
|
|
982
|
+
nextTick(() => {
|
|
983
|
+
props.formOptions._skip = false
|
|
984
|
+
})
|
|
985
|
+
localShowItems.value = prop.formOptions.filter(item => !item.initHidden).map(item => item.prop)
|
|
986
|
+
await syncLocalShowColumnToCookies()
|
|
987
|
+
await syncCookiesToSearchFormItemOptions()
|
|
988
|
+
refreshNfSearchFormModel()
|
|
942
989
|
await nextTick()
|
|
943
|
-
|
|
990
|
+
refreshLabel()
|
|
944
991
|
}
|
|
945
992
|
|
|
946
993
|
const columnCheckConfirmFeedback = (value: Record<string, any>) => {
|
|
@@ -951,8 +998,7 @@ const columnCheckConfirmFeedback = (value: Record<string, any>) => {
|
|
|
951
998
|
itemsList.push(key)
|
|
952
999
|
}
|
|
953
1000
|
}
|
|
954
|
-
|
|
955
|
-
syncShowItemToInitHidden()
|
|
1001
|
+
setLocalShowItems(itemsList, true)
|
|
956
1002
|
}
|
|
957
1003
|
}
|
|
958
1004
|
|
|
@@ -961,8 +1007,8 @@ const columnCheckConfirm = async (cb, error) => {
|
|
|
961
1007
|
try {
|
|
962
1008
|
const value = columnCheckDrawer.value.syncTableColumnsToCookies()
|
|
963
1009
|
columnCheckConfirmFeedback(value)
|
|
964
|
-
syncCookiesToLocalShowColumn()
|
|
965
|
-
syncCookiesToSearchFormItemOptions()
|
|
1010
|
+
await syncCookiesToLocalShowColumn()
|
|
1011
|
+
await syncCookiesToSearchFormItemOptions()
|
|
966
1012
|
refreshNfSearchFormModel()
|
|
967
1013
|
await nextTick()
|
|
968
1014
|
refreshLabel()
|
|
@@ -978,8 +1024,8 @@ const columnCheckConfirm = async (cb, error) => {
|
|
|
978
1024
|
*/
|
|
979
1025
|
const nfSearchFormItemOptionFieldsSave = async (value) => {
|
|
980
1026
|
columnCheckConfirmFeedback(value)
|
|
981
|
-
syncCookiesToLocalShowColumn()
|
|
982
|
-
syncCookiesToSearchFormItemOptions()
|
|
1027
|
+
await syncCookiesToLocalShowColumn()
|
|
1028
|
+
await syncCookiesToSearchFormItemOptions()
|
|
983
1029
|
refreshNfSearchFormModel()
|
|
984
1030
|
await nextTick()
|
|
985
1031
|
refreshLabel()
|
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.49",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,22 +14,23 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/
|
|
18
|
-
"@94ai/nf-
|
|
19
|
-
"@94ai/nf-double-
|
|
20
|
-
"@94ai/nf-double-
|
|
21
|
-
"@94ai/nf-double-
|
|
22
|
-
"@94ai/nf-
|
|
23
|
-
"@94ai/nf-
|
|
24
|
-
"@94ai/nf-form
|
|
25
|
-
"@94ai/nf-
|
|
26
|
-
"@94ai/nf-
|
|
27
|
-
"@94ai/nf-
|
|
28
|
-
"@94ai/nf-
|
|
29
|
-
"@94ai/nf-
|
|
30
|
-
"@94ai/nf-
|
|
17
|
+
"@94ai/common-utils": "^3.2.49",
|
|
18
|
+
"@94ai/nf-action": "^3.2.49",
|
|
19
|
+
"@94ai/nf-double-half-year": "^3.2.49",
|
|
20
|
+
"@94ai/nf-double-quarter": "^3.2.49",
|
|
21
|
+
"@94ai/nf-double-week": "^3.2.49",
|
|
22
|
+
"@94ai/nf-double-year": "^3.2.49",
|
|
23
|
+
"@94ai/nf-drawer": "^3.2.49",
|
|
24
|
+
"@94ai/nf-form": "^3.2.49",
|
|
25
|
+
"@94ai/nf-form-item": "^3.2.49",
|
|
26
|
+
"@94ai/nf-half-year-picker": "^3.2.49",
|
|
27
|
+
"@94ai/nf-message": "^3.2.49",
|
|
28
|
+
"@94ai/nf-quarter-picker": "^3.2.49",
|
|
29
|
+
"@94ai/nf-select-transfer": "^3.2.49",
|
|
30
|
+
"@94ai/nf-theme-chalk": "^3.2.49",
|
|
31
|
+
"@94ai/nf-virtual-select": "^3.2.49",
|
|
32
|
+
"idb-keyval": "^6.2.1",
|
|
31
33
|
"resize-observer-polyfill": "^1.5.1",
|
|
32
|
-
"vue-cookies": "^1.8.3",
|
|
33
34
|
"vue-demi": "^0.14.5",
|
|
34
35
|
"vuedraggable": "^2.24.3"
|
|
35
36
|
},
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"types": "lib/index.d.ts",
|
|
47
48
|
"main": "lib/nf-search-form.cjs.js",
|
|
48
49
|
"module": "lib/nf-search-form.esm-bundler.js",
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "8cbd9254da4ec43f46b29198c0839bf2ba19132d"
|
|
50
51
|
}
|
package/lib/tools.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function createUniqueString(randomLength?: number): string;
|
|
2
|
-
export declare function debounce(func: any, wait: any, immediate: any): (...args: any[]) => any;
|
|
3
|
-
export declare const on: (event: any, handler: any, element?: Window & typeof globalThis) => void;
|
|
4
|
-
export declare function deepClone(source: any): Record<string, any> | Record<string, any>[];
|
|
5
|
-
export declare const off: (event: any, handler: any, element?: Window & typeof globalThis) => void;
|
|
6
|
-
export declare const pickerOptionsRange: {
|
|
7
|
-
shortcuts: {
|
|
8
|
-
text: string;
|
|
9
|
-
onClick(picker: any): void;
|
|
10
|
-
}[];
|
|
11
|
-
};
|
|
12
|
-
export declare const pickerOptionsRangeMonth: {
|
|
13
|
-
shortcuts: {
|
|
14
|
-
text: string;
|
|
15
|
-
onClick(picker: any): void;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
package/package/README.md
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
## 搜索栏组件
|
|
3
|
-
|
|
4
|
-
### 示例
|
|
5
|
-
<ai-search-form :formOptions="searchOption" @onSearch="search">
|
|
6
|
-
<template slot="btnBox">
|
|
7
|
-
<el-button>新增按钮</el-button>
|
|
8
|
-
</template>
|
|
9
|
-
</ai-search-form>
|
|
10
|
-
|
|
11
|
-
<!-- searchOption: [
|
|
12
|
-
{
|
|
13
|
-
label: '意见内容',
|
|
14
|
-
prop: 'content',
|
|
15
|
-
element: 'el-input',
|
|
16
|
-
width: '200px'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: '数字',
|
|
20
|
-
prop: 'content2',
|
|
21
|
-
element: 'el-input-number',
|
|
22
|
-
width: '200px'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: '状态',
|
|
26
|
-
prop: 'status',
|
|
27
|
-
element: 'el-select',
|
|
28
|
-
options: [
|
|
29
|
-
{ label: '给点意见', value: '1' },
|
|
30
|
-
{ label: '售后问题', value: '2' }
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: '提交时间',
|
|
35
|
-
prop: 'timeRange',
|
|
36
|
-
element: 'el-date-picker'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: '固定时间',
|
|
40
|
-
prop: 'guding',
|
|
41
|
-
element: 'el-time-select',
|
|
42
|
-
'picker-options': {
|
|
43
|
-
start: '08:30',
|
|
44
|
-
step: '00:10',
|
|
45
|
-
end: '18:30'
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: '时间区间',
|
|
50
|
-
prop: 'time',
|
|
51
|
-
element: 'el-time-select',
|
|
52
|
-
type: 'timeRange',
|
|
53
|
-
'picker-options': {
|
|
54
|
-
start: '08:30',
|
|
55
|
-
step: '00:10',
|
|
56
|
-
end: '18:30'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: '数字区间',
|
|
61
|
-
prop: 'number',
|
|
62
|
-
element: 'number-range',
|
|
63
|
-
initValue: [],
|
|
64
|
-
min: 0,
|
|
65
|
-
events: {
|
|
66
|
-
change(val) {
|
|
67
|
-
console.log(val)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
] -->
|
|
72
|
-
|
|
73
|
-
### 字段说明
|
|
74
|
-
|
|
75
|
-
## formOptions 表单配置项
|
|
76
|
-
/**
|
|
77
|
-
* 表单配置
|
|
78
|
-
* 示例:
|
|
79
|
-
* [{
|
|
80
|
-
* label: '用户名', // label文字
|
|
81
|
-
* prop: 'username', // 字段名
|
|
82
|
-
* element: 'el-input', // 指定elementui组件
|
|
83
|
-
* initValue: '阿黄', // 字段初始值
|
|
84
|
-
* placeholder: '请输入用户名', // elementui组件属性
|
|
85
|
-
* rules: [{ required: true, message: '必填项', trigger: 'blur' }], // elementui组件属性
|
|
86
|
-
* hidden:false, // 显示隐藏
|
|
87
|
-
* events: { // elementui组件方法
|
|
88
|
-
* input (val) {
|
|
89
|
-
* console.log(val)
|
|
90
|
-
* },
|
|
91
|
-
* ...... // 可添加任意elementui组件支持的方法
|
|
92
|
-
* }
|
|
93
|
-
* ...... // 可添加任意elementui组件支持的属性
|
|
94
|
-
* }]
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
element 支持组件类型:
|
|
98
|
-
1.el-input
|
|
99
|
-
2.el-input-number
|
|
100
|
-
3.el-select
|
|
101
|
-
4.el-date-picker
|
|
102
|
-
5.el-cascader
|
|
103
|
-
6.el-time-select
|
|
104
|
-
7.el-time-select(固定时间范围,需要type:timeRange)
|
|
105
|
-
8.el-time-picker
|
|
106
|
-
自定义组件
|
|
107
|
-
1.number-range(继承el-number-input属性)
|
|
108
|
-
|
|
109
|
-
## btnItems 提交按钮
|
|
110
|
-
多个用逗号分隔(search, export, reset)
|
|
111
|
-
|
|
112
|
-
## labelWidth 标题宽度
|
|
113
|
-
|
|
114
|
-
## itemWidth 内容宽度
|
|
115
|
-
|
|
116
|
-
## btnModel 搜索按钮模式
|
|
117
|
-
flex 左右分布
|
|
118
|
-
inline 行内模式
|
|
119
|
-
|
|
120
|
-
### 方法说明
|
|
121
|
-
1.onSearch 点击搜索按钮
|
|
122
|
-
2.onExport 点击导出按钮
|
|
123
|
-
3.onChange 值变化
|
|
124
|
-
|
|
125
|
-
### slot
|
|
126
|
-
slot="btnBox" 按钮扩展
|
|
127
|
-
|
|
128
|
-
### 建议说明
|
|
129
|
-
## 组件使用建议
|
|
130
|
-
1.文本输入框 使用el-input
|
|
131
|
-
2.数字输入框 使用el-input-number
|
|
132
|
-
3.单选选择、多项选择、radio选择、checkbox选择、开关切换 使用el-select
|
|
133
|
-
4.日期选择 使用el-date-picker
|
|
134
|
-
5.数字范围选择 使用number-range
|
|
135
|
-
6.级联选择器(如二三级联动) 使用el-cascader
|
|
136
|
-
7.时间选择 使用el-time-select
|
|
137
|
-
8.时间范围选择 使用el-time-select(固定时间范围,需要type:timeRange)
|