cnhis-design-vue 3.1.42-release.3 → 3.1.42-release.5
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/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/hooks/useEvent.js +1 -1
- package/es/components/big-table/src/hooks/useFormat.js +1 -1
- package/es/components/big-table/src/hooks/useNestTable.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- package/es/components/big-table/src/utils.d.ts +11 -1
- package/es/components/big-table/src/utils.js +1 -1
- package/es/components/button-print/index.d.ts +32 -7
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +32 -8
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/EditFormat.vue.d.ts +4 -4
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +4 -4
- package/es/components/classification/index.d.ts +1 -1
- package/es/components/classification/src/index.vue.d.ts +2 -2
- package/es/components/classification/style/index.css +1 -1
- package/es/components/date-picker/src/DatePicker.vue.js +1 -1
- package/es/components/fabric-chart/index.d.ts +2 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/useCenter.js +1 -1
- package/es/components/field-set/index.d.ts +26 -81
- package/es/components/field-set/src/FieldSet.vue.d.ts +28 -32
- package/es/components/field-set/src/FieldSet.vue.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +45 -14
- package/es/components/form-config/src/FormConfig.vue.d.ts +45 -14
- package/es/components/form-config/src/FormConfig.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +15 -2
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +24 -8
- package/es/components/form-render/index.d.ts +15 -2
- package/es/components/form-render/src/FormRender.vue.d.ts +15 -2
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +15 -2
- package/es/components/form-render/src/components/renderer/date.d.ts +4 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +36 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +32 -5
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +13 -8
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +6 -4
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +17 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +17 -3
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +3 -2
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +19 -19
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +60 -237
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +1 -4
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -16
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +25 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +22 -5
- package/es/components/iho-table/src/types/pluginType.d.ts +11 -29
- package/es/components/iho-table/src/utils/index.d.ts +5 -3
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/iconfont.ttf +0 -0
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/info-header/index.d.ts +31 -4
- package/es/components/info-header/src/InfoHeader.vue.d.ts +31 -4
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +15 -2
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +16 -2
- package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/keyboard/src/Keyboard.vue.js +1 -1
- package/es/components/map/index.d.ts +2 -14
- package/es/components/map/src/Map.vue.d.ts +1 -14
- package/es/components/map/src/types/index.d.ts +19 -0
- package/es/components/map/src/types/index.js +1 -0
- package/es/components/recommend-search/index.d.ts +13 -128
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +15 -130
- package/es/components/recommend-search/src/RecommendSearch.vue.js +1 -1
- package/es/components/recommend-search/src/components/BaseSearch.d.ts +84 -0
- package/es/components/recommend-search/src/components/BaseSearch.js +1 -0
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -63
- package/es/components/recommend-search/src/components/RecommendInput.vue.js +1 -1
- package/es/components/recommend-search/src/components/RecommendMenu.vue.d.ts +1 -3
- package/es/components/recommend-search/src/components/RecommendMenu.vue.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -62
- package/es/components/recommend-search/src/components/RecommendSelect.vue.js +1 -1
- package/es/components/recommend-search/src/constant/index.d.ts +3 -0
- package/es/components/recommend-search/src/constant/index.js +1 -1
- package/es/components/scale-view/index.d.ts +13 -158
- package/es/components/scale-view/index.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +12 -158
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +1 -43
- package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -42
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +7 -7
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +5 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +73 -3
- package/es/components/scale-view/src/hooks/use-evaluate.js +1 -1
- package/es/components/scale-view/src/hooks/use-event.js +1 -1
- package/es/components/scale-view/src/types/index.d.ts +7 -0
- package/es/components/scale-view/src/types/index.js +1 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/scale-view/style/scale-view-iconfont.ttf +0 -0
- package/es/components/search-cascader/index.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +8 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/search-cascader/src/constants/index.d.ts +1 -0
- package/es/components/search-cascader/src/constants/index.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/style/index.css +1 -1
- package/es/components/select-person/index.d.ts +15 -7
- package/es/components/select-person/src/SelectPerson.vue.d.ts +9 -5
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +18 -4
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -4
- package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +9 -0
- package/es/components/time-picker/src/TimePicker.vue.js +1 -1
- package/es/components/vod-chunk-upload/index.d.ts +73 -3
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +73 -3
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
- package/es/env.d.ts +1 -0
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
- package/es/shared/hooks/useDateTime.d.ts +1 -1
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/utils/anime.d.ts +1 -1
- package/es/shared/utils/anime.js +1 -1
- package/es/shared/utils/index.d.ts +3 -14
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/vexutils.d.ts +2 -2
- package/es/shared/utils/vexutils.js +1 -1
- package/es/shared/utils/vexutilsExpand.d.ts +254 -0
- package/es/shared/utils/vexutilsExpand.js +1 -0
- package/package.json +2 -2
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +0 -143
- package/es/components/recommend-search/src/components/BaseSearch.vue.js +0 -1
- /package/es/components/base-search/style/{iconfont.ttf → base-search-iconfont.ttf} +0 -0
- /package/es/components/classification/style/{iconfont.ttf → classification-iconfont.ttf} +0 -0
- /package/es/components/info-header/style/{iconfont.ttf → info-header-font.ttf} +0 -0
- /package/es/components/select-label/style/{iconfont.ttf → select-label-iconfont.ttf} +0 -0
|
@@ -11,6 +11,8 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
11
11
|
vali_obj: string;
|
|
12
12
|
max_value: string | number;
|
|
13
13
|
min_value: string | number;
|
|
14
|
+
min_date: string;
|
|
15
|
+
max_date: string;
|
|
14
16
|
min_length: string | number;
|
|
15
17
|
max_length: string | number;
|
|
16
18
|
decimal_length: string | number;
|
|
@@ -35,6 +37,8 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
35
37
|
vali_obj: string;
|
|
36
38
|
max_value: string | number;
|
|
37
39
|
min_value: string | number;
|
|
40
|
+
min_date: string;
|
|
41
|
+
max_date: string;
|
|
38
42
|
min_length: string | number;
|
|
39
43
|
max_length: string | number;
|
|
40
44
|
decimal_length: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as a,createVNode as r,mergeProps as n}from"vue";import{generateTimeFormat as o}from"../../../../../shared/utils/index.js";import{connect as u,mapProps as i}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as l}from"date-fns";import m from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"../../utils/index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const f=u(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:u}){const{injectValueValidate:i,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function f(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function p(e){return c()&&e<Date.now()-864e5||f()&&e>Date.now()}function D(e){const t=new Date(e),a=new Date,r=new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0);const n=new Date(t);n.setHours(23),n.setMinutes(59),n.setSeconds(59);const o=r>a,u=n<a,i=t.getHours(),s=a.getHours(),l=a.getMinutes();return{isHourDisabled:function(e){return c()&&!o&&e<s||f()&&!u&&e>s},isMinuteDisabled:function(e){if(i===s)return c()&&!o&&e<l||f()&&!u&&e>l;return c()&&!o&&i<s||f()&&!u&&i>s}}}i((()=>e.value));const y=t((()=>{const t={};if(s(e.validate)){const{min_date:a,max_date:r}=e.validate;(a||r)&&(t.isDateDisabled=p,t.isTimeDisabled=D)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:o(e.valueFormat)}})));function g(t){return t?l(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&g(e)!==e&&u("update:value",g(e))}));const w=t({get:()=>g(e.value),set:e=>{u("update:value",e)}}),x=v(w);return()=>r(m,n({key:x.value},y.value,j.value,{"formatted-value":w.value,"onUpdate:formatted-value":e=>w.value=e}),null)}}),i(v,c));export{f as DATE};
|
|
@@ -6,6 +6,14 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
6
6
|
type: PropType<AnyObject[]>;
|
|
7
7
|
default: () => never[];
|
|
8
8
|
};
|
|
9
|
+
labelField: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
valueField: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
9
17
|
autograph: {
|
|
10
18
|
type: StringConstructor;
|
|
11
19
|
required: true;
|
|
@@ -46,6 +54,14 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
46
54
|
type: PropType<AnyObject[]>;
|
|
47
55
|
default: () => never[];
|
|
48
56
|
};
|
|
57
|
+
labelField: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
valueField: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
49
65
|
autograph: {
|
|
50
66
|
type: StringConstructor;
|
|
51
67
|
required: true;
|
|
@@ -85,6 +101,8 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
85
101
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
86
102
|
}, {
|
|
87
103
|
options: AnyObject[];
|
|
104
|
+
labelField: string;
|
|
105
|
+
valueField: string;
|
|
88
106
|
lazyRequest: boolean;
|
|
89
107
|
requestCache: boolean;
|
|
90
108
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,computed as
|
|
1
|
+
import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as f}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as y,mapProps as v}from"@formily/vue";import h from"../../../../search-cascader/index.js";import k from"../../../../../shared/components/no-data/NoData.vue.js";import{createVisitedSetter as j,assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as w}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const g=y(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:y}){const v=u(e,"value",y),_=r(!1),g=r([]),{field:F,fieldKey:K}=w(),O=t((()=>{var r,t,o,a;return null!=(a=null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0])?o:e.labelField)?a:"text"})),q=t((()=>{var r,t,o;return null!=(o=null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField)?o:"value"})),S=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),x=o(p),{getSearchRequestInfo:C}=b();async function L(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!l(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e)),o=await async function(r){if(!C().primaryKeyUrl)return[];try{return await x.addAsync(t(e.wordbook,e.autograph,r,K.value))}catch(e){l(e)&&m(e)}function t(r,t,o,a){const n=C();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=S.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[q.value]===r))}}(o,t);return await L(a),s(a.children)?(v.value=function(e,r){return r.map((r=>e.find((e=>e[q.value]===r))))}(o,t),_.value=!1,Promise.reject()):(g.value=n,a)}{const n=await x.addAsync(function(r,o,a,n,u){const i={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[q.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(i).reduce(((e,[t,o])=>(e[t]=l(o)?r[o]:c(o)?o():void 0,e)),{});return{...C(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,K.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,S.value)))}else g.value=n.map((e=>function(e,r){return e.__keyword=!!r,e.isLeaf=!!r,e}(e,t)))}}catch(e){l(e)&&m(e)}function o(e){return v.value=function(e){const r=[];let t=e;for(;t;)r.unshift(d(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{i(r,t)||(g.value=[],r&&(v.value||!e.lazyRequest)&&L())}),{immediate:!0});const{injectValueValidate:V,injectValueWatchFromEmpty:A,injectValueBindKey:I}=f();A(v,L),V(v);const P=I(v);return()=>n(h,{value:v.value,"onUpdate:value":e=>v.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:g.value,key:P.value,labelKey:O.value,valueKey:q.value,search:L,onFocus:j(F)},{empty:()=>n(k,null,null)})}}),v({dataSource:"options"},_));export{g as LEVEL_SEARCH_CASCADER};
|
|
@@ -19,6 +19,14 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
19
19
|
type: BooleanConstructor;
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
+
labelField: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
valueField: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
22
30
|
wordbook: {
|
|
23
31
|
type: PropType<Partial<{
|
|
24
32
|
level_num: number;
|
|
@@ -61,6 +69,14 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
61
69
|
type: BooleanConstructor;
|
|
62
70
|
default: boolean;
|
|
63
71
|
};
|
|
72
|
+
labelField: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
76
|
+
valueField: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
64
80
|
wordbook: {
|
|
65
81
|
type: PropType<Partial<{
|
|
66
82
|
level_num: number;
|
|
@@ -88,6 +104,8 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
88
104
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
89
105
|
}, {
|
|
90
106
|
options: AnyObject[];
|
|
107
|
+
labelField: string;
|
|
108
|
+
valueField: string;
|
|
91
109
|
lazyRequest: boolean;
|
|
92
110
|
requestCache: boolean;
|
|
93
111
|
vertical: boolean;
|
|
@@ -111,6 +129,14 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
111
129
|
type: BooleanConstructor;
|
|
112
130
|
default: boolean;
|
|
113
131
|
};
|
|
132
|
+
labelField: {
|
|
133
|
+
type: StringConstructor;
|
|
134
|
+
default: string;
|
|
135
|
+
};
|
|
136
|
+
valueField: {
|
|
137
|
+
type: StringConstructor;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
114
140
|
wordbook: {
|
|
115
141
|
type: PropType<Partial<{
|
|
116
142
|
level_num: number;
|
|
@@ -153,6 +179,14 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
153
179
|
type: BooleanConstructor;
|
|
154
180
|
default: boolean;
|
|
155
181
|
};
|
|
182
|
+
labelField: {
|
|
183
|
+
type: StringConstructor;
|
|
184
|
+
default: string;
|
|
185
|
+
};
|
|
186
|
+
valueField: {
|
|
187
|
+
type: StringConstructor;
|
|
188
|
+
default: string;
|
|
189
|
+
};
|
|
156
190
|
wordbook: {
|
|
157
191
|
type: PropType<Partial<{
|
|
158
192
|
level_num: number;
|
|
@@ -180,6 +214,8 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
180
214
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
181
215
|
}, {
|
|
182
216
|
options: AnyObject[];
|
|
217
|
+
labelField: string;
|
|
218
|
+
valueField: string;
|
|
183
219
|
lazyRequest: boolean;
|
|
184
220
|
requestCache: boolean;
|
|
185
221
|
vertical: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as
|
|
1
|
+
import{defineComponent as e,createVNode as t,isVNode as o}from"vue";import{connect as a,mapProps as l}from"@formily/vue";import{NSpace as r,NRadio as u,NRadioGroup as i,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as s}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as m}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as d,createVisitedSetter as c}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";function y(a,l,u){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:i}=f(),{renderComplexOption:n,valueRef:p}=s(e,a),{labelKey:d,valueKey:y,fullOptions:j}=m(e,p),{injectValueBindKey:b,injectValueValidate:h}=v();h(p);const k=b(p);return()=>t(l,{key:k.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:c(i)},{default:()=>[t(r,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var e;return[null==(e=j.value)?void 0:e.map((e=>{let a;return t(u,{key:e[y.value],value:e[y.value],disabled:e.disabled},"function"==typeof(l=a=n({value:p.value,option:e,valueKey:y.value,labelKey:d.value}))||"[object Object]"===Object.prototype.toString.call(l)&&!o(l)?a:{default:()=>[a]});var l}))]}})]})}})}const j=a(y("FormRadio",i,u),l({dataSource:"options"},d)),b=a(y("FormCheckbox",p,n),l({dataSource:"options"},d));export{b as CHECKBOX,j as RADIO};
|
|
@@ -13,6 +13,14 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
13
13
|
type: PropType<AnyObject[]>;
|
|
14
14
|
default: () => never[];
|
|
15
15
|
};
|
|
16
|
+
labelField: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
valueField: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
16
24
|
urlConfig: {
|
|
17
25
|
type: PropType<UrlConfig>;
|
|
18
26
|
};
|
|
@@ -29,6 +37,14 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
29
37
|
type: PropType<AnyObject[]>;
|
|
30
38
|
default: () => never[];
|
|
31
39
|
};
|
|
40
|
+
labelField: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
valueField: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
32
48
|
urlConfig: {
|
|
33
49
|
type: PropType<UrlConfig>;
|
|
34
50
|
};
|
|
@@ -37,5 +53,7 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
37
53
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
38
54
|
}, {
|
|
39
55
|
options: AnyObject[];
|
|
56
|
+
labelField: string;
|
|
57
|
+
valueField: string;
|
|
40
58
|
requestCache: boolean;
|
|
41
59
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as u,inject as a,watch as o,createVNode as t}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as s}from"@vueuse/core";import{isString as v,isArray as m,cloneDeep as p,isEqual as d}from"lodash-es";import{NSelect as f}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as c,InjectionChangeContextCollector as y,InjectionFormItemDepsCollector as g}from"../../constants/index.js";import{createUrlConfigParams as h,formRenderLog as C}from"../../utils/index.js";import{useCommonInjection as j,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{useFormField as x}from"../../hooks/useFormField.js";import{createVisitedSetter as b,assignUpdateValue as K,assignClearBindVisited as S}from"../../utils/schema.js";const k=n(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{}},emits:["update:value"],setup(e,{slots:n,emit:r}){const K=i(e,"value",r),{field:S,fieldKey:k}=x(),w=l(null),V=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.nameKey)?u:e.labelField)?a:"text"})),q=u((()=>{var l,u,a;return null!=(a=null!=(u=null==(l=e.urlConfig)?void 0:l.valueKey)?u:e.valueField)?a:"value"})),A=a(c),B=s((async(l="",u="label")=>{if(!e.urlConfig)return w.value=null;try{w.value=await A.addAsync(await h({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===u?q.value:"keyword"]:l}},cache:e.requestCache,field:S.value}))}catch(e){v(e)&&C(e)}})),O=u((()=>m(w.value)?w.value:m(e.options)?e.options:[])),{injectValueValidate:P,injectValueBindKey:U}=j();P(K);const D=U(K);o(K,(e=>{if(e&&!O.value.find((l=>l[q.value]===e)))return B(e,"value")}));a(y).setContext(k.value,(e=>{return{currentOption:p((l=e,O.value.find((e=>e[q.value]===l))))};var l}));const I=a(g);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(w.value=null,e&&(I.setDeps(k.value,e.dependKey||[],(async()=>{w.value=null,K.value=null})),K.value&&B(K.value,"value")))}),{immediate:!0});const{menuProps:R,nodeProps:z}=F();return()=>t(f,{remote:!0,filterable:!0,key:D.value,value:K.value,"onUpdate:value":e=>K.value=e,labelField:V.value,valueField:q.value,"menu-props":R,"node-props":z,onSearch:B,"onUpdate:show":e=>e&&B(),options:O.value,onFocus:b(S)},n)}}),r(K,S));export{k as REMOTE_SEARCH};
|
|
@@ -23,6 +23,14 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
23
23
|
type: BooleanConstructor;
|
|
24
24
|
default: boolean;
|
|
25
25
|
};
|
|
26
|
+
labelField: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
valueField: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
26
34
|
onChange: {};
|
|
27
35
|
value: {};
|
|
28
36
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -47,12 +55,22 @@ export declare const SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
47
55
|
type: BooleanConstructor;
|
|
48
56
|
default: boolean;
|
|
49
57
|
};
|
|
58
|
+
labelField: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
valueField: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
50
66
|
onChange: {};
|
|
51
67
|
value: {};
|
|
52
68
|
}>> & {
|
|
53
69
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
54
70
|
}, {
|
|
55
71
|
options: AnyObject[];
|
|
72
|
+
labelField: string;
|
|
73
|
+
valueField: string;
|
|
56
74
|
requestCache: boolean;
|
|
57
75
|
filterable: boolean;
|
|
58
76
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as i,isArray as u,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.js";import{NCascader as v}from"naive-ui";import"@vueuse/core";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as f,mapProps as y}from"@formily/vue";import"@vue/shared";import"./index.js";import"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as h,assignUpdateValue as j,traverseDependKey as k}from"../../utils/schema.js";const b=f(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:f,emit:y}){const j=t(),{field:b,title:C}=m(),g=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),S=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");return Array.isArray(t)&&t.length?t.map((e=>e[F.value])).slice(-1).join(""):null}catch(e){return null}}));function w(e,t,a){y("update:value",u(a)?a.map((function(e){return{...e,label:e[g.value],children:void 0,parent:void 0}})):null)}const A=l(p);async function H(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await A.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache});function a(e,t){const l={[g.value]:e[g.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword};return u(e.children)&&(l.children=e.children.map((e=>a(e,t+1))),l.isLeaf=!e.children.length),l}j.value=t.map((e=>a(e,0)))}():await async function(t){if(r(e,t))return;const a=await A.addAsync(o(s(t),u(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,w(0,0,n(t)),void(E.value=!1);const l=a.map((e=>i(e,s(t))));function r(e,t){return!u(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&k(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function i(a,l){return{[g.value]:a[g.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function u(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await L()}const x=`form-render__cascade--menu-${l(d)}`;async function L(){await n();const e=document.querySelector(`.${x} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function q(e,t){if(!e||!t)return!1;const{keyword:a,[g.value]:l}=t,r=!!s(a)&&a.split(",").some((t=>t.includes(e))),o=!!s(l)&&l.includes(e);return r||o}const{injectValueValidate:B,injectValueWatchFromEmpty:K,injectValueBindKey:V}=c();K((()=>e.value),H),B((()=>e.value)),r((()=>e.urlConfig),(async(e,t)=>{i(e,t)||(j.value=null,await H())}));const E=t(!1);function O(e){E.value=!!e,e&&H()}const W=a((()=>j.value||e.options||[])),N=a((()=>!e.filterable)),P=V(S);return()=>o(v,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:x,onClick:L},checkStrategy:"child",show:!!E.value,"onUpdate:show":O,value:S.value,filter:q,"onUpdate:value":w,labelField:g.value,valueField:F.value,options:W.value,onLoad:H,onFocus:h(b)},f)}}),y({dataSource:"options"},j));export{b as SEARCH_CASCADER};
|
|
@@ -5,7 +5,7 @@ import { UrlConfig } from '../../types';
|
|
|
5
5
|
import { PropType } from 'vue';
|
|
6
6
|
export declare const SELECT: import("vue").DefineComponent<{
|
|
7
7
|
value: {
|
|
8
|
-
type: PropType<ArrayAble<string> | null>;
|
|
8
|
+
type: PropType<ArrayAble<string | number> | null>;
|
|
9
9
|
};
|
|
10
10
|
lazyRequest: {
|
|
11
11
|
type: BooleanConstructor;
|
|
@@ -20,6 +20,14 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
20
20
|
default: () => never[];
|
|
21
21
|
};
|
|
22
22
|
onChange: {};
|
|
23
|
+
labelField: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
valueField: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
23
31
|
allowCreate: BooleanConstructor;
|
|
24
32
|
urlConfig: {
|
|
25
33
|
type: PropType<UrlConfig>;
|
|
@@ -58,7 +66,11 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
58
66
|
getRecommendInfo: {
|
|
59
67
|
type: PropType<() => RecommendIds>;
|
|
60
68
|
};
|
|
61
|
-
|
|
69
|
+
commonNum: {
|
|
70
|
+
type: NumberConstructor;
|
|
71
|
+
default: number;
|
|
72
|
+
};
|
|
73
|
+
recentNum: {
|
|
62
74
|
type: NumberConstructor;
|
|
63
75
|
default: number;
|
|
64
76
|
};
|
|
@@ -68,7 +80,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
68
80
|
};
|
|
69
81
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
82
|
value: {
|
|
71
|
-
type: PropType<ArrayAble<string> | null>;
|
|
83
|
+
type: PropType<ArrayAble<string | number> | null>;
|
|
72
84
|
};
|
|
73
85
|
lazyRequest: {
|
|
74
86
|
type: BooleanConstructor;
|
|
@@ -83,6 +95,14 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
83
95
|
default: () => never[];
|
|
84
96
|
};
|
|
85
97
|
onChange: {};
|
|
98
|
+
labelField: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
default: string;
|
|
101
|
+
};
|
|
102
|
+
valueField: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
86
106
|
allowCreate: BooleanConstructor;
|
|
87
107
|
urlConfig: {
|
|
88
108
|
type: PropType<UrlConfig>;
|
|
@@ -121,7 +141,11 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
121
141
|
getRecommendInfo: {
|
|
122
142
|
type: PropType<() => RecommendIds>;
|
|
123
143
|
};
|
|
124
|
-
|
|
144
|
+
commonNum: {
|
|
145
|
+
type: NumberConstructor;
|
|
146
|
+
default: number;
|
|
147
|
+
};
|
|
148
|
+
recentNum: {
|
|
125
149
|
type: NumberConstructor;
|
|
126
150
|
default: number;
|
|
127
151
|
};
|
|
@@ -134,10 +158,13 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
134
158
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
|
135
159
|
}, {
|
|
136
160
|
options: AnyObject[];
|
|
161
|
+
labelField: string;
|
|
162
|
+
valueField: string;
|
|
137
163
|
lazyRequest: boolean;
|
|
138
164
|
requestCache: boolean;
|
|
139
165
|
recommend: boolean;
|
|
140
166
|
recommendCache: boolean;
|
|
141
|
-
|
|
167
|
+
commonNum: number;
|
|
168
|
+
recentNum: number;
|
|
142
169
|
allowCreate: boolean;
|
|
143
170
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isArray as i,isString as n}from"lodash-es";import{useCommonInjection as u,useSelectOptionProps as p}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as m}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as c}from"../../hooks/useFormField.js";import{NSelect as d}from"naive-ui";import"date-fns";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import"@formily/core";import"@formily/reactive";import{connect as y,mapProps as v}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as f,useAutographOptions as h,useRecommendOptions as j,searchContentMatcher as b}from"../../hooks/useFormRenderOptions.js";import{createVisitedSetter as k,assignUpdateValue as S,assignClearBindVisited as g}from"../../utils/schema.js";const F=y(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:y,emit:v}){const S=o({get:()=>e.value,async set(e){v("update:value",e),C(e)}}),{labelKey:g,valueKey:F,fetchData:A,fullOptions:H,filterOptions:x}=e.urlConfig?f(e,S):h(e,S),{getRecommend:B,postRecommend:C,sortedOptions:O}=j(e,x,v,g,F),{field:R,fieldKey:L}=c();t(m).setContext(L.value,(e=>{return{currentOption:s((o=e,i(o)?function(e){const o=H.value.reduce(((e,o)=>(e[o[F.value]]=o,e)),{});return e.map((e=>o[e]))}(o):(t=o,H.value.find((e=>e[F.value]===t)))))};var o,t}));const N=a(""),V=l((async(e="")=>{N.value=e,A(e),B(e)}),300),{injectValueValidate:w,injectValueWatchFromEmpty:K,injectValueBindKey:P}=u();K(S,V),w(S);const W=P(S),{menuProps:q,nodeProps:I}=p();function U(e){const o=e[g.value];if(!o||!n(o))return"";const t=b(N.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const z=o((()=>O.value.length||!e.allowCreate?O.value:N.value?[{[g.value]:N.value,[F.value]:N.value},...O.value]:O.value));return()=>r(d,{key:W.value,remote:!0,filterable:!0,value:S.value,"onUpdate:value":e=>S.value=e,"menu-props":q,"node-props":I,labelField:g.value,valueField:F.value,options:z.value,onSearch:V,"onUpdate:show":e=>e&&V(),onFocus:k(R),renderLabel:U},y)}}),v({dataSource:"options"},S,g));export{F as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i
|
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(d){const{createValidatorSchema:u}=l(),x=e=>{var t;const n={name:e.val_key,type:null!=(t=e.fieldType)?t:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable"};e.reactions&&(n["x-reactions"]=e.reactions),e.noDecorator||Object.assign(n,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:o(e,["reactions"]),span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const r=u(e);return r&&(n["x-validator"]=r),"0"===e.is_null&&(n.required=!0),n},f=e=>{var o;const t=x(e);e.urlConfig?function(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig"])})}(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},_=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,vertical:e.__vertical}),m(o,e),o},h=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},g=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",g],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,getProperties:()=>e.children||[]}),o}],["RADIO",_],["CHECKBOX",_],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?O(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),b=e=>{if(e.suffixConfig)return v(e);return(y.get(e.html_type)||h)(e)},v=o=>{if(!o.suffixConfig)return b(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:O(n)}),r},{FieldNormalizeWaterfallHook:C}=s();function O(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=C.call(t(o))).validate)?void 0:a.obj_type;return p&&d&&d.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(g(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(b(o),s):(n=null,e[i(o)]=r(b(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:O}}export{d as useFieldListAdaptor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as
|
|
1
|
+
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];return a.tap("__normalize",(t=>(s.some((([e,l])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=l))),t))),{FieldNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"naive-ui";import{unref as t}from"vue";import"@vueuse/core";import{AsyncQueue as o}from"../../../../shared/hooks/useAsyncQueue.js";import"../../index.js";import{useCommonLog as s}from"./useCommonLog.js";import{useFormRequest as n}from"./useFormRequest.js";function
|
|
1
|
+
import{uuidGenerator as e}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"naive-ui";import{unref as t}from"vue";import"@vueuse/core";import"date-fns";import{AsyncQueue as o}from"../../../../shared/hooks/useAsyncQueue.js";import"../../index.js";import{useCommonLog as s}from"./useCommonLog.js";import{useFormRequest as n}from"./useFormRequest.js";function a(a){const{getHttpInstance:i}=n();return{create:function(n=3,u){return new o({name:"FormRenderAsyncQueue",parallelism:n,async processor({key:e,method:o="post",cache:n,params:m,url:p},c,f){var l,d;const h=null!=(l=t(a))?l:i();if(!h)return s().invalidHttpInstanceLog(),c(),void f();try{u&&r(u.beforeRequest)&&(m=null!=(d=u.beforeRequest(e,m))?d:{});let t=await h[o](p,m);u&&r(u.afterRequest)&&(t=u.afterRequest(e,t)),c(void 0,Array.isArray(t)?t:[]),!n&&f()}catch(e){c(new Error(`Request error => ${e}`)),f()}},getKey:({url:r,method:t="post",cache:o,params:s})=>o?r+t+JSON.stringify(s||{}):e()})}}}export{a as useFormAsyncQueue};
|
|
@@ -9,13 +9,16 @@ export declare function useRecommendOptions(props: {
|
|
|
9
9
|
recentList?: RecommendItem[];
|
|
10
10
|
getRecommendInfo?: () => RecommendIds;
|
|
11
11
|
recommendCache: boolean;
|
|
12
|
-
|
|
12
|
+
commonNum: number;
|
|
13
|
+
recentNum: number;
|
|
13
14
|
}, options: Ref<AnyObject[]>, emit: Func, labelKey: Ref<string>, valueKey: Ref<string>): {
|
|
14
15
|
postRecommend: (value: unknown) => Promise<void>;
|
|
15
16
|
getRecommend: (content?: string) => Promise<void>;
|
|
16
17
|
sortedOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
17
18
|
};
|
|
18
19
|
export declare function useUrlConfigOptions(props: {
|
|
20
|
+
labelField?: string;
|
|
21
|
+
valueField?: string;
|
|
19
22
|
urlConfig?: UrlConfig;
|
|
20
23
|
options?: AnyObject[];
|
|
21
24
|
requestCache: boolean;
|
|
@@ -27,13 +30,15 @@ export declare function useUrlConfigOptions(props: {
|
|
|
27
30
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
28
31
|
fetchData: (content?: string) => Promise<null | undefined>;
|
|
29
32
|
};
|
|
30
|
-
export declare function useAutographOptions(props: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
export declare function useAutographOptions(props: Partial<{
|
|
34
|
+
labelField: string;
|
|
35
|
+
valueField: string;
|
|
36
|
+
requestCache: boolean;
|
|
37
|
+
wordbook: FormWordbook;
|
|
38
|
+
autograph: string;
|
|
39
|
+
lazyRequest: boolean;
|
|
40
|
+
options: AnyObject[];
|
|
41
|
+
}>, valueRef: Ref): {
|
|
37
42
|
labelKey: import("vue").ComputedRef<string>;
|
|
38
43
|
valueKey: import("vue").ComputedRef<string>;
|
|
39
44
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as
|
|
1
|
+
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useMemoize as t,useDebounceFn as l}from"@vueuse/core";import{identity as u,uniqBy as o,isString as r,isEqual as a,omit as i,isFunction as c}from"lodash-es";import{computed as s,inject as m,ref as v,watch as d}from"vue";import"../../index.js";import{InjectionAsyncQueue as f,InjectionFormItemDepsCollector as y}from"../constants/index.js";import{createUrlConfigParams as p,formRenderLog as h,keywordMatcher as g}from"../utils/index.js";import{useFormField as w}from"./useFormField.js";import{useFormRequest as k}from"./useFormRequest.js";function R(e,n){const t=v();return s({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const b=(()=>{const e=new Map,n=t((e=>new RegExp(`(.*)${e.split("").map((e=>`(${e})`)).join("(.*)")}(.*)`)),{getKey:u});return(t,l)=>{const u=e.get(t)||{};return e.set(t,u),Reflect.has(u,l)?u[l]:u[l]=l.match(n(t))}})();function C(){const e=v();return{searchContent:e,optionSearchFilter:function(n,t){return e.value?n.filter((n=>function(n,t){if(!e.value)return!0;const l=n?n[t]:"";return!!r(l)&&(!!b(e.value,l)||g(e.value,n.keyword))}(n,t))):n}}}function K(e,t,l,u,r){const a=R(e,"commonList"),v=R(e,"recentList"),{searchContent:d,optionSearchFilter:y}=C();function p(e){return n(e.itemObj)}const h=s((()=>{var e,n;return null!=(n=null==(e=a.value)?void 0:e.map(p))?n:[]})),g=s((()=>{var e,n;return null!=(n=null==(e=v.value)?void 0:e.map(p))?n:[]})),b=s((()=>{if(!e.recommend||!h.value.length&&!g.value.length)return t.value;const n=o(h.value.concat(g.value),(e=>e[r.value])),l=t.value.filter((e=>n.every((function(n){return n[r.value]!==e[r.value]}))));return[...y(n,u.value),...l]})),{getRecommendRequestInfo:K,getHttpInstance:F}=k();function j(n){const{url:t,getRecommendIds:l}=K(),u=c(l)?l():{},o=c(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:x}=w(),O=m(f);return{postRecommend:async function(n){if(!e.recommend)return;const t=F();if(!t)return;const{url:u,info:o}=j("post"),a=b.value.find((e=>e[r.value]===n));a&&l("postRecommend",await t.post(u,{...o,keyword:"",itemId:r.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(d.value=n,a.value&&v.value&&e.recommendCache)return;const t=await O.addAsync(function(n,t){const{url:l,info:u}=j("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(x.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(i(n,["type"])):"recently"===n.type&&e.recently.push(i(n,["type"])),e)),{commonly:[],recently:[]});a.value=l.slice(0,e.commonNum),v.value=u.slice(0,e.recentNum)},sortedOptions:b}}function F(n,t){e();const u=m(f),o=s((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),i=s((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:c,optionSearchFilter:g}=C(),k=v(null),{field:R,fieldKey:b}=w(),K=l((async function(e){if(c.value=e||"",!n.urlConfig)return k.value=null;try{k.value=await u.addAsync(await p({config:n.urlConfig,cache:n.requestCache,field:R.value}))}catch(e){r(e)&&h(e)}}),300),F=s((()=>k.value?g(k.value,o.value):Array.isArray(n.options)?g(n.options,o.value):[])),j=s((()=>k.value||n.options||[])),x=m(y);return d((()=>n.urlConfig),((e,l)=>{a(e,l)||(k.value=null,e&&(x.setDeps(b.value,e.dependKey||[],(async()=>{k.value=null,t.value=null,!n.lazyRequest&&await K()})),(t.value||!n.lazyRequest)&&K()))}),{immediate:!0}),{labelKey:o,valueKey:i,filterOptions:F,fullOptions:j,fetchData:K}}function j(n,t){e();const u=m(f),o=s((()=>{var e,t,l,u;return null!=(u=null!=(l=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0])?l:n.labelField)?u:"text"})),i=s((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),{searchContent:c,optionSearchFilter:y}=C(),p=v(null),{fieldKey:g}=w(),{getSearchRequestInfo:R}=k(),b=l((async function(e){if(c.value=e||"",!n.autograph||!n.wordbook)return p.value=null;try{p.value=await u.addAsync(function(e,t,l){const u={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};return{...R(),params:u,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,g.value))}catch(e){r(e)&&h(e)}}),300),K=s((()=>p.value?y(p.value,o.value):Array.isArray(n.options)?y(n.options,o.value):[])),F=s((()=>p.value||n.options||[]));return d((()=>n.wordbook),((e,l)=>{a(e,l)||(p.value=null,e&&(t.value||!n.lazyRequest)&&b())}),{immediate:!0}),{labelKey:o,valueKey:i,filterOptions:K,fullOptions:F,fetchData:b}}export{b as searchContentMatcher,j as useAutographOptions,K as useRecommendOptions,F as useUrlConfigOptions};
|
|
@@ -17,6 +17,8 @@ export declare type ValidateItem = Partial<{
|
|
|
17
17
|
vali_obj: ValidateType;
|
|
18
18
|
max_value: string | number;
|
|
19
19
|
min_value: string | number;
|
|
20
|
+
min_date: string;
|
|
21
|
+
max_date: string;
|
|
20
22
|
min_length: string | number;
|
|
21
23
|
max_length: string | number;
|
|
22
24
|
decimal_length: string | number;
|
|
@@ -25,14 +27,13 @@ export declare type ValidateItem = Partial<{
|
|
|
25
27
|
message: string;
|
|
26
28
|
[key: string]: any;
|
|
27
29
|
}>;
|
|
28
|
-
export
|
|
29
|
-
text: string;
|
|
30
|
-
value: any;
|
|
30
|
+
export declare type FormOptionItem = {
|
|
31
31
|
keyword?: string;
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
children?: FormOptionItem[];
|
|
34
34
|
childrenFields?: FieldItem[];
|
|
35
|
-
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
36
37
|
interface FormRendererPayload {
|
|
37
38
|
clearable: boolean;
|
|
38
39
|
disabled: boolean;
|
|
@@ -146,6 +147,7 @@ export declare type FieldItem = {
|
|
|
146
147
|
option: FormOptionItem[];
|
|
147
148
|
/**
|
|
148
149
|
* 是否开启多选('0'表示开启, 值是反的)
|
|
150
|
+
* 仅在html_type为SELECT时生效
|
|
149
151
|
*/
|
|
150
152
|
multi_select: FormCommonState;
|
|
151
153
|
/**
|
|
@@ -89,7 +89,7 @@ export declare type FormBusinessFormatter = (payload: {
|
|
|
89
89
|
}) => unknown;
|
|
90
90
|
export declare namespace FormLowCodeReactions {
|
|
91
91
|
type ConObj = {
|
|
92
|
-
con: LOW_CODE_VALUE_RELATION
|
|
92
|
+
con: LOW_CODE_VALUE_RELATION;
|
|
93
93
|
field_key: string;
|
|
94
94
|
value: unknown;
|
|
95
95
|
};
|