cnhis-design-vue 3.1.49-beta.20 → 3.1.49-beta.21

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.
@@ -166,6 +166,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
166
166
  method?: import("..").FormRequestType | undefined;
167
167
  nameKey?: string | undefined;
168
168
  valueKey?: string | undefined;
169
+ showKey?: string | undefined;
169
170
  params?: import("../../../es/shared/types").AnyObject | undefined;
170
171
  dependKey?: string | Record<string, string> | (string | {
171
172
  paramName: string;
@@ -204,6 +205,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
204
205
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
205
206
  allowSlash?: boolean | undefined;
206
207
  allowModify?: "0" | "1" | undefined;
208
+ show_key?: string | undefined;
207
209
  bordered?: string | boolean | undefined;
208
210
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
209
211
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -1896,6 +1898,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1896
1898
  method?: import("..").FormRequestType | undefined;
1897
1899
  nameKey?: string | undefined;
1898
1900
  valueKey?: string | undefined;
1901
+ showKey?: string | undefined;
1899
1902
  params?: import("../../../es/shared/types").AnyObject | undefined;
1900
1903
  dependKey?: string | Record<string, string> | (string | {
1901
1904
  paramName: string;
@@ -1934,6 +1937,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1934
1937
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
1935
1938
  allowSlash?: boolean | undefined;
1936
1939
  allowModify?: "0" | "1" | undefined;
1940
+ show_key?: string | undefined;
1937
1941
  bordered?: string | boolean | undefined;
1938
1942
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1939
1943
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -3635,6 +3639,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3635
3639
  method?: import("..").FormRequestType | undefined;
3636
3640
  nameKey?: string | undefined;
3637
3641
  valueKey?: string | undefined;
3642
+ showKey?: string | undefined;
3638
3643
  params?: import("../../../es/shared/types").AnyObject | undefined;
3639
3644
  dependKey?: string | Record<string, string> | (string | {
3640
3645
  paramName: string;
@@ -3673,6 +3678,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3673
3678
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
3674
3679
  allowSlash?: boolean | undefined;
3675
3680
  allowModify?: "0" | "1" | undefined;
3681
+ show_key?: string | undefined;
3676
3682
  bordered?: string | boolean | undefined;
3677
3683
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3678
3684
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -5365,6 +5371,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
5365
5371
  method?: import("..").FormRequestType | undefined;
5366
5372
  nameKey?: string | undefined;
5367
5373
  valueKey?: string | undefined;
5374
+ showKey?: string | undefined;
5368
5375
  params?: import("../../../es/shared/types").AnyObject | undefined;
5369
5376
  dependKey?: string | Record<string, string> | (string | {
5370
5377
  paramName: string;
@@ -5403,6 +5410,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
5403
5410
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
5404
5411
  allowSlash?: boolean | undefined;
5405
5412
  allowModify?: "0" | "1" | undefined;
5413
+ show_key?: string | undefined;
5406
5414
  bordered?: string | boolean | undefined;
5407
5415
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
5408
5416
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -8087,6 +8095,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8087
8095
  method?: import("..").FormRequestType | undefined;
8088
8096
  nameKey?: string | undefined;
8089
8097
  valueKey?: string | undefined;
8098
+ showKey?: string | undefined;
8090
8099
  params?: import("../../../es/shared/types").AnyObject | undefined;
8091
8100
  dependKey?: string | Record<string, string> | (string | {
8092
8101
  paramName: string;
@@ -8125,6 +8134,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8125
8134
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
8126
8135
  allowSlash?: boolean | undefined;
8127
8136
  allowModify?: "0" | "1" | undefined;
8137
+ show_key?: string | undefined;
8128
8138
  bordered?: string | boolean | undefined;
8129
8139
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
8130
8140
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -9828,6 +9838,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
9828
9838
  method?: import("..").FormRequestType | undefined;
9829
9839
  nameKey?: string | undefined;
9830
9840
  valueKey?: string | undefined;
9841
+ showKey?: string | undefined;
9831
9842
  params?: import("../../../es/shared/types").AnyObject | undefined;
9832
9843
  dependKey?: string | Record<string, string> | (string | {
9833
9844
  paramName: string;
@@ -9866,6 +9877,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
9866
9877
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
9867
9878
  allowSlash?: boolean | undefined;
9868
9879
  allowModify?: "0" | "1" | undefined;
9880
+ show_key?: string | undefined;
9869
9881
  bordered?: string | boolean | undefined;
9870
9882
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
9871
9883
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -11542,6 +11554,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
11542
11554
  method?: import("..").FormRequestType | undefined;
11543
11555
  nameKey?: string | undefined;
11544
11556
  valueKey?: string | undefined;
11557
+ showKey?: string | undefined;
11545
11558
  params?: import("../../../es/shared/types").AnyObject | undefined;
11546
11559
  dependKey?: string | Record<string, string> | (string | {
11547
11560
  paramName: string;
@@ -11580,6 +11593,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
11580
11593
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
11581
11594
  allowSlash?: boolean | undefined;
11582
11595
  allowModify?: "0" | "1" | undefined;
11596
+ show_key?: string | undefined;
11583
11597
  bordered?: string | boolean | undefined;
11584
11598
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
11585
11599
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -168,6 +168,7 @@ declare const _default: import("vue").DefineComponent<{
168
168
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
169
169
  nameKey?: string | undefined;
170
170
  valueKey?: string | undefined;
171
+ showKey?: string | undefined;
171
172
  params?: import("../../../../es/shared/types").AnyObject | undefined;
172
173
  dependKey?: string | Record<string, string> | (string | {
173
174
  paramName: string;
@@ -206,6 +207,7 @@ declare const _default: import("vue").DefineComponent<{
206
207
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
207
208
  allowSlash?: boolean | undefined;
208
209
  allowModify?: "0" | "1" | undefined;
210
+ show_key?: string | undefined;
209
211
  bordered?: string | boolean | undefined;
210
212
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
211
213
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -1898,6 +1900,7 @@ declare const _default: import("vue").DefineComponent<{
1898
1900
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
1899
1901
  nameKey?: string | undefined;
1900
1902
  valueKey?: string | undefined;
1903
+ showKey?: string | undefined;
1901
1904
  params?: import("../../../../es/shared/types").AnyObject | undefined;
1902
1905
  dependKey?: string | Record<string, string> | (string | {
1903
1906
  paramName: string;
@@ -1936,6 +1939,7 @@ declare const _default: import("vue").DefineComponent<{
1936
1939
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
1937
1940
  allowSlash?: boolean | undefined;
1938
1941
  allowModify?: "0" | "1" | undefined;
1942
+ show_key?: string | undefined;
1939
1943
  bordered?: string | boolean | undefined;
1940
1944
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1941
1945
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -3637,6 +3641,7 @@ declare const _default: import("vue").DefineComponent<{
3637
3641
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
3638
3642
  nameKey?: string | undefined;
3639
3643
  valueKey?: string | undefined;
3644
+ showKey?: string | undefined;
3640
3645
  params?: import("../../../../es/shared/types").AnyObject | undefined;
3641
3646
  dependKey?: string | Record<string, string> | (string | {
3642
3647
  paramName: string;
@@ -3675,6 +3680,7 @@ declare const _default: import("vue").DefineComponent<{
3675
3680
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
3676
3681
  allowSlash?: boolean | undefined;
3677
3682
  allowModify?: "0" | "1" | undefined;
3683
+ show_key?: string | undefined;
3678
3684
  bordered?: string | boolean | undefined;
3679
3685
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3680
3686
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -5367,6 +5373,7 @@ declare const _default: import("vue").DefineComponent<{
5367
5373
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
5368
5374
  nameKey?: string | undefined;
5369
5375
  valueKey?: string | undefined;
5376
+ showKey?: string | undefined;
5370
5377
  params?: import("../../../../es/shared/types").AnyObject | undefined;
5371
5378
  dependKey?: string | Record<string, string> | (string | {
5372
5379
  paramName: string;
@@ -5405,6 +5412,7 @@ declare const _default: import("vue").DefineComponent<{
5405
5412
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
5406
5413
  allowSlash?: boolean | undefined;
5407
5414
  allowModify?: "0" | "1" | undefined;
5415
+ show_key?: string | undefined;
5408
5416
  bordered?: string | boolean | undefined;
5409
5417
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
5410
5418
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -8089,6 +8097,7 @@ declare const _default: import("vue").DefineComponent<{
8089
8097
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
8090
8098
  nameKey?: string | undefined;
8091
8099
  valueKey?: string | undefined;
8100
+ showKey?: string | undefined;
8092
8101
  params?: import("../../../../es/shared/types").AnyObject | undefined;
8093
8102
  dependKey?: string | Record<string, string> | (string | {
8094
8103
  paramName: string;
@@ -8127,6 +8136,7 @@ declare const _default: import("vue").DefineComponent<{
8127
8136
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
8128
8137
  allowSlash?: boolean | undefined;
8129
8138
  allowModify?: "0" | "1" | undefined;
8139
+ show_key?: string | undefined;
8130
8140
  bordered?: string | boolean | undefined;
8131
8141
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
8132
8142
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -9830,6 +9840,7 @@ declare const _default: import("vue").DefineComponent<{
9830
9840
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
9831
9841
  nameKey?: string | undefined;
9832
9842
  valueKey?: string | undefined;
9843
+ showKey?: string | undefined;
9833
9844
  params?: import("../../../../es/shared/types").AnyObject | undefined;
9834
9845
  dependKey?: string | Record<string, string> | (string | {
9835
9846
  paramName: string;
@@ -9868,6 +9879,7 @@ declare const _default: import("vue").DefineComponent<{
9868
9879
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
9869
9880
  allowSlash?: boolean | undefined;
9870
9881
  allowModify?: "0" | "1" | undefined;
9882
+ show_key?: string | undefined;
9871
9883
  bordered?: string | boolean | undefined;
9872
9884
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
9873
9885
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -11544,6 +11556,7 @@ declare const _default: import("vue").DefineComponent<{
11544
11556
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
11545
11557
  nameKey?: string | undefined;
11546
11558
  valueKey?: string | undefined;
11559
+ showKey?: string | undefined;
11547
11560
  params?: import("../../../../es/shared/types").AnyObject | undefined;
11548
11561
  dependKey?: string | Record<string, string> | (string | {
11549
11562
  paramName: string;
@@ -11582,6 +11595,7 @@ declare const _default: import("vue").DefineComponent<{
11582
11595
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
11583
11596
  allowSlash?: boolean | undefined;
11584
11597
  allowModify?: "0" | "1" | undefined;
11598
+ show_key?: string | undefined;
11585
11599
  bordered?: string | boolean | undefined;
11586
11600
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
11587
11601
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -121,6 +121,7 @@ declare const _default: import("vue").DefineComponent<{
121
121
  method?: import("../../../../../es/components/form-render").FormRequestType | undefined;
122
122
  nameKey?: string | undefined;
123
123
  valueKey?: string | undefined;
124
+ showKey?: string | undefined;
124
125
  params?: import("../../../../../es/shared/types").AnyObject | undefined;
125
126
  dependKey?: string | Record<string, string> | (string | {
126
127
  paramName: string;
@@ -159,6 +160,7 @@ declare const _default: import("vue").DefineComponent<{
159
160
  suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
160
161
  allowSlash?: boolean | undefined;
161
162
  allowModify?: "0" | "1" | undefined;
163
+ show_key?: string | undefined;
162
164
  bordered?: string | boolean | undefined;
163
165
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
164
166
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
@@ -1862,6 +1864,7 @@ declare const _default: import("vue").DefineComponent<{
1862
1864
  method?: import("../../../../../es/components/form-render").FormRequestType | undefined;
1863
1865
  nameKey?: string | undefined;
1864
1866
  valueKey?: string | undefined;
1867
+ showKey?: string | undefined;
1865
1868
  params?: import("../../../../../es/shared/types").AnyObject | undefined;
1866
1869
  dependKey?: string | Record<string, string> | (string | {
1867
1870
  paramName: string;
@@ -1900,6 +1903,7 @@ declare const _default: import("vue").DefineComponent<{
1900
1903
  suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
1901
1904
  allowSlash?: boolean | undefined;
1902
1905
  allowModify?: "0" | "1" | undefined;
1906
+ show_key?: string | undefined;
1903
1907
  bordered?: string | boolean | undefined;
1904
1908
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1905
1909
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
@@ -3576,6 +3580,7 @@ declare const _default: import("vue").DefineComponent<{
3576
3580
  method?: import("../../../../../es/components/form-render").FormRequestType | undefined;
3577
3581
  nameKey?: string | undefined;
3578
3582
  valueKey?: string | undefined;
3583
+ showKey?: string | undefined;
3579
3584
  params?: import("../../../../../es/shared/types").AnyObject | undefined;
3580
3585
  dependKey?: string | Record<string, string> | (string | {
3581
3586
  paramName: string;
@@ -3614,6 +3619,7 @@ declare const _default: import("vue").DefineComponent<{
3614
3619
  suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
3615
3620
  allowSlash?: boolean | undefined;
3616
3621
  allowModify?: "0" | "1" | undefined;
3622
+ show_key?: string | undefined;
3617
3623
  bordered?: string | boolean | undefined;
3618
3624
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3619
3625
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
@@ -28,9 +28,8 @@ export declare const SELECT: import("vue").DefineComponent<{
28
28
  type: StringConstructor;
29
29
  default: string;
30
30
  };
31
- aliasField: {
31
+ showField: {
32
32
  type: StringConstructor;
33
- default: string;
34
33
  };
35
34
  allowCreate: BooleanConstructor;
36
35
  shouldSave: BooleanConstructor;
@@ -123,9 +122,8 @@ export declare const SELECT: import("vue").DefineComponent<{
123
122
  type: StringConstructor;
124
123
  default: string;
125
124
  };
126
- aliasField: {
125
+ showField: {
127
126
  type: StringConstructor;
128
- default: string;
129
127
  };
130
128
  allowCreate: BooleanConstructor;
131
129
  shouldSave: BooleanConstructor;
@@ -210,6 +208,5 @@ export declare const SELECT: import("vue").DefineComponent<{
210
208
  recentNum: number;
211
209
  allowCreate: boolean;
212
210
  useLoading: boolean;
213
- aliasField: string;
214
211
  shouldSave: boolean;
215
212
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as l,inject as t,useAttrs as o,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{cloneDeep as m,isArray as d,isString as c,isObject as v,omit as f}from"lodash-es";import{useCommonInjection as y,useSelectOptionProps as h}from"../../hooks/useCommonInjection.js";import{useComplexOptions as j,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as b,InjectionFormUUID as S}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as C,NTooltip as k,NIcon as F,NTag as w}from"naive-ui";import"date-fns";import{assignUpdateValue as B,assignClearBindVisited as x,createVisitedSetter as O}from"../../utils/schema.js";import{useFormField as A}from"../../hooks/useFormField.js";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{connect as H,mapProps as L}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as P,useAutographOptions as E,useRecommendOptions as K,searchContentMatcher as R}from"../../hooks/useFormRenderOptions.js";const V=H(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"},aliasField:{type:String,default:"alias"},allowCreate:Boolean,shouldSave:Boolean,allowModify: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},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:B,emit:x}){const H=l({get:()=>e.value,async set(e){x("update:value",e),G(e)}}),L=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:V,valueKey:_,fetchData:I,searchContent:N,fullOptions:M,filterOptions:W,remoteOptions:q,loading:U}=e.urlConfig?P(e,H):E(e,H),{renderComplexOption:z,hasComplexOption:D}=j(e,H),{getRecommend:T,postRecommend:G,sortedOptions:J}=K(e,W,x,V,_),{field:Q,fieldKey:X}=A();t(b).setContext(X.value,(e=>({currentOption:m(function(e){const l=ue(M.value);return d(e)?function(e){const t=l.reduce(((e,l)=>(e[l[_.value]]=l,e)),{});return e.map((e=>t[e]))}(e):(t=e,l.find((e=>e[_.value]===t)));var t}(e))})));const Y=async(e="")=>(N.value=e,Promise.allSettled([I(e),T(e)])),{injectValueValidate:Z,injectValueWatchFromEmpty:$,injectValueBindKey:ee}=y();$(H,Y),Z(H);const le=ee(H),{menuProps:te,nodeProps:oe}=h();function ae(e){const l=e[V.value];if(!l||!c(l))return"";const t=N.value?R(N.value,l):null,o=t?u("section",null,[t.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[o,e.desc?u(k,null,{trigger:()=>u(F,{component:p},null),default:()=>e.desc}):null]):o}function ue(l){return e.allowCreate&&N.value&&!l.some((e=>e[V.value]===N.value))?[...l,{[V.value]:N.value,[_.value]:N.value,created:!0,shouldSave:e.shouldSave}]:l}const ne=l((()=>ue(L.value?M.value:J.value))),re=o(),se=l((()=>{if(e.allowCreate)return H.value;const l=e.multiple&&d(H.value);return M.value.find((e=>l?H.value.includes(e[_.value]):e[_.value]===H.value))?H.value:null})),ie=a(!1);async function pe(e){e&&await Y(),ie.value=e}let me=null;async function de(e,l){H.value=e,me&&v(l)&&L.value&&(me.focus(),await s(),me.value=l[V.value]||"",me.dispatchEvent(new CustomEvent("input"))),q.value&&l&&i(l).forEach((e=>{if(!v(e))return;const l=e;l.created&&l.shouldSave&&q.value.push(f(r(l),["created","shouldSave"]))}))}const ce=t(S),{getSpan:ve}=g(),fe=O(Q,(async e=>{var l,t;L.value&&(me=e.target,me&&H.value&&(await s(),me.value=null!=(t=null==(l=M.value.find((e=>e[_.value]===H.value)))?void 0:l[V.value])?t:"",me.dispatchEvent(new CustomEvent("input"))))}));function ye(e){if(!L.value)return;if(me=e.target,!me)return;if(!me.value)return H.value=null;const l=M.value.find((e=>e[V.value]===me.value));l?H.value=l[_.value]:(N.value=me.value,H.value=me.value)}function he({option:l,handleClose:t}){var o;const a=null!=(o=l[e.aliasField])?o:l[V.value];return e.multiple?u(w,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>a}):a}function je(l){return u(C,n({key:le.value,multiple:e.multiple,remote:!0,filterable:!0,loading:U.value,value:se.value,onUpdateValue:de,"menu-props":te,"node-props":oe,labelField:V.value,valueField:_.value,options:ne.value,onSearch:Y,show:ie.value,"onUpdate:show":pe,onFocus:fe,onBlur:ye,renderLabel:ae,renderTag:he},l,re),B)}return()=>{var e,l;if(!D.value)return je();const t=null!=(l=null==(e=Q.value.decoratorProps)?void 0:e.span)?l:6,o=ve(ce,Q.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":o+t}},[je({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),M.value.map((e=>z({option:e,value:H.value,valueKey:_.value,labelKey:V.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}})))])}}}),L({dataSource:"options"},B,x));export{V as SELECT};
1
+ import{defineComponent as e,computed as l,inject as o,useAttrs as t,ref as a,createVNode as u,mergeProps as n,toRaw as r,nextTick as s}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as p}from"@vicons/ionicons5";import{cloneDeep as m,isArray as c,isString as d,isObject as v,omit as f}from"lodash-es";import{useCommonInjection as y,useSelectOptionProps as h}from"../../hooks/useCommonInjection.js";import{useComplexOptions as j,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as b,InjectionFormUUID as S}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as C,NTooltip as k,NIcon as w,NTag as F}from"naive-ui";import"date-fns";import{assignUpdateValue as B,assignClearBindVisited as x,createVisitedSetter as O}from"../../utils/schema.js";import{useFormField as A}from"../../hooks/useFormField.js";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{connect as H,mapProps as K}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as L,useAutographOptions as P,useRecommendOptions as E,searchContentMatcher as R}from"../../hooks/useFormRenderOptions.js";const V=H(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"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify: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},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:B,emit:x}){const H=l({get:()=>e.value,async set(e){x("update:value",e),J(e)}}),K=l((()=>(e.multiple&&e.allowModify&&console.warn("多选模式下不支持allowModify"),!e.multiple&&e.allowModify))),{labelKey:V,valueKey:_,showKey:I,fetchData:N,searchContent:M,fullOptions:W,filterOptions:q,remoteOptions:U,loading:z}=e.urlConfig?L(e,H):P(e,H),{renderComplexOption:D,hasComplexOption:T}=j(e,H),{getRecommend:G,postRecommend:J,sortedOptions:Q}=E(e,q,x,V,_),{field:X,fieldKey:Y}=A();o(b).setContext(Y.value,(e=>({currentOption:m(function(e){const l=ne(W.value);return c(e)?function(e){const o=l.reduce(((e,l)=>(e[l[_.value]]=l,e)),{});return e.map((e=>o[e]))}(e):(o=e,l.find((e=>e[_.value]===o)));var o}(e))})));const Z=async(e="")=>(M.value=e,Promise.allSettled([N(e),G(e)])),{injectValueValidate:$,injectValueWatchFromEmpty:ee,injectValueBindKey:le}=y();ee(H,Z),$(H);const oe=le(H),{menuProps:te,nodeProps:ae}=h();function ue(e){const l=e[V.value];if(!l||!d(l))return"";const o=M.value?R(M.value,l):null,t=o?u("section",null,[o.map(((e,l)=>0!==l&&e?u("span",{style:{color:l%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[t,e.desc?u(k,null,{trigger:()=>u(w,{component:p},null),default:()=>e.desc}):null]):t}function ne(l){return e.allowCreate&&M.value&&!l.some((e=>e[V.value]===M.value))?[...l,{[V.value]:M.value,[_.value]:M.value,created:!0,shouldSave:e.shouldSave}]:l}const re=l((()=>ne(K.value?W.value:Q.value))),se=t(),ie=l((()=>{if(e.allowCreate)return H.value;const l=e.multiple&&c(H.value);return W.value.find((e=>l?H.value.includes(e[_.value]):e[_.value]===H.value))?H.value:null})),pe=a(!1);async function me(e){e&&await Z(),pe.value=e}let ce=null;async function de(e,l){H.value=e,ce&&v(l)&&K.value&&(ce.focus(),await s(),ce.value=l[V.value]||"",ce.dispatchEvent(new CustomEvent("input"))),U.value&&l&&i(l).forEach((e=>{if(!v(e))return;const l=e;l.created&&l.shouldSave&&U.value.push(f(r(l),["created","shouldSave"]))}))}const ve=o(S),{getSpan:fe}=g(),ye=O(X,(async e=>{var l,o;K.value&&(ce=e.target,ce&&H.value&&(await s(),ce.value=null!=(o=null==(l=W.value.find((e=>e[_.value]===H.value)))?void 0:l[V.value])?o:"",ce.dispatchEvent(new CustomEvent("input"))))}));function he(e){if(!K.value)return;if(ce=e.target,!ce)return;if(!ce.value)return H.value=null;const l=W.value.find((e=>e[V.value]===ce.value));l?H.value=l[_.value]:(M.value=ce.value,H.value=ce.value)}function je({option:l,handleClose:o}){var t;const a=null!=(t=I.value&&l[I.value])?t:l[V.value];return e.multiple?u(F,{closable:!0,onClose:e=>{e.stopPropagation(),o()}},{default:()=>a}):a}function ge(l){return u(C,n({key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:z.value,value:ie.value,onUpdateValue:de,"menu-props":te,"node-props":ae,labelField:V.value,valueField:_.value,options:re.value,onSearch:Z,show:pe.value,"onUpdate:show":me,onFocus:ye,onBlur:he,renderLabel:ue,renderTag:je},l,se),B)}return()=>{var e,l;if(!T.value)return ge();const o=null!=(l=null==(e=X.value.decoratorProps)?void 0:e.span)?l:6,t=fe(ve,X.value.address);return u("section",{class:"form-render__selectChildField",style:{"--column":t+o}},[ge({class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}),W.value.map((e=>D({option:e,value:H.value,valueKey:_.value,labelKey:V.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}})))])}}}),K({dataSource:"options"},B,x));export{V 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 i,formRenderLog as r}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(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),x=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"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","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},_=e=>{var o;const t=x(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:"1"===e.allowModify,allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate||"1"===e.allowModify,shouldSave:"1"===e.save_free_entry,maxTagCount:i(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"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}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n,allowSlash:i}=e;return i&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),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",_],["REMOTE_SEARCH",_],["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"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),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,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["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:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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}]]),v=e=>{if(e.suffixConfig)return C(e);return(b.get(e.html_type)||g)(e)},C=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=x(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:w,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,n)=>{var a;const p=null==(a=(o=w.call(o)).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),n),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),n):(i=null,e[s(o)]=r(v(o),n)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
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 i,formRenderLog as r}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(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"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","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},x=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const r=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:r,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowModify:"1"===e.allowModify,allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate||"1"===e.allowModify,shouldSave:"1"===e.save_free_entry,showField:e.show_key,maxTagCount:i(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),r&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=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}}),b=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=_(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=_(e),{decimal_length:t,validate:n,allowSlash:i}=e;return i&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),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",x],["REMOTE_SEARCH",x],["DATE",e=>{const o=_(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=_(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=_(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=_(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,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=_(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=_(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(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}]]),v=e=>{if(e.suffixConfig)return w(e);return(b.get(e.html_type)||g)(e)},w=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=_(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:C,FieldListNormalizeWaterfallHook:O}=s();function j(o,n={column:9999}){let i=null;return O.call(t(o),n).reduce(((e,o,n)=>{var a;const p=null==(a=(o=C.call(o)).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[s(o)]=r(y(o),n),i=e[s(o)].properties={}):i?i[s(o)]=r(v(o),n):(i=null,e[s(o)]=r(v(o),n)),e}),{});function r(e,o){return e["x-index"]=o,e}function s(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
@@ -19,6 +19,7 @@ export declare function useRecommendOptions(props: {
19
19
  export declare function useUrlConfigOptions(props: {
20
20
  labelField?: string;
21
21
  valueField?: string;
22
+ showField?: string;
22
23
  urlConfig?: UrlConfig;
23
24
  options?: AnyObject[];
24
25
  requestCache: boolean;
@@ -26,6 +27,7 @@ export declare function useUrlConfigOptions(props: {
26
27
  }, valueRef: Ref): {
27
28
  labelKey: import("vue").ComputedRef<string>;
28
29
  loading: Ref<boolean>;
30
+ showKey: import("vue").ComputedRef<string | undefined>;
29
31
  valueKey: import("vue").ComputedRef<string>;
30
32
  remoteOptions: Ref<AnyObject[] | null>;
31
33
  filterOptions: import("vue").ComputedRef<AnyObject[]>;
@@ -36,6 +38,7 @@ export declare function useUrlConfigOptions(props: {
36
38
  export declare function useAutographOptions(props: Partial<{
37
39
  labelField: string;
38
40
  valueField: string;
41
+ showField: string;
39
42
  requestCache: boolean;
40
43
  wordbook: FormWordbook;
41
44
  autograph: string;
@@ -43,6 +46,7 @@ export declare function useAutographOptions(props: Partial<{
43
46
  options: AnyObject[];
44
47
  }>, valueRef: Ref): {
45
48
  labelKey: import("vue").ComputedRef<string>;
49
+ showKey: import("vue").ComputedRef<string | undefined>;
46
50
  loading: Ref<boolean>;
47
51
  remoteOptions: Ref<AnyObject[] | null>;
48
52
  valueKey: import("vue").ComputedRef<string>;
@@ -1 +1 @@
1
- import{checkInSetupEnv as e,jsonParse as n,keywordMatcher as t}from"../../../../shared/utils/index.js";import{useForm as l}from"@formily/vue";import{useMemoize as u}from"@vueuse/core";import{identity as o,uniqBy as r,isEqual as a,isString as i,isArray as c,omit as s,isFunction as v}from"lodash-es";import{computed as m,inject as f,ref as d,watch as y,toRaw as p}from"vue";import"../../index.js";import{InjectionAsyncQueue as h,InjectionFormLifeCycleCaller as g,InjectionFormItemDepsCollector as w}from"../constants/index.js";import{useFormField as k}from"./useFormField.js";import{createUrlConfigParams as b,formRenderLog as C}from"../utils/index.js";import{useFormRequest as R}from"./useFormRequest.js";function O(e,n){const t=d();return m({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const F=(()=>{const e=u((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:o});return(n,t)=>t.match(e(n))})();function K(){const e=d();return{searchContent:e,optionSearchFilter:function(n,l,u){if(!e.value)return n;const o=c(u)?u.filter((e=>e&&i(e))):[];return n.filter((n=>function(n,l,u){if(!e.value)return!0;const o=n?n[l]:"";return!!i(o)&&(!!F(e.value,o)||!!t(e.value,n.keyword)||!!u.length&&u.some((t=>i(n[t])&&n[t].includes(e.value))))}(n,l,o)))}}}function q(e,t,l,u,o){const a=O(e,"commonList"),i=O(e,"recentList"),{searchContent:c,optionSearchFilter:d}=K();function y(e){return n(e.itemObj)}const p=m((()=>{var e,n;return null!=(n=null==(e=a.value)?void 0:e.map(y))?n:[]})),g=m((()=>{var e,n;return null!=(n=null==(e=i.value)?void 0:e.map(y))?n:[]})),w=m((()=>{if(!e.recommend||!p.value.length&&!g.value.length)return t.value;const n=r(p.value.concat(g.value),(e=>e[o.value])),l=t.value.filter((e=>n.every((function(n){return n[o.value]!==e[o.value]}))));return[...d(n,u.value),...l]})),{getRecommendRequestInfo:b,getHttpInstance:C}=R();function F(n){const{url:t,getRecommendIds:l}=b(),u=v(l)?l():{},o=v(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:q}=k(),j=f(h);return{postRecommend:async function(n){if(!e.recommend)return;const t=C();if(!t)return;const{url:u,info:r}=F("post"),a=w.value.find((e=>e[o.value]===n));a&&l("postRecommend",await t.post(u,{...r,keyword:"",itemId:o.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(c.value=n,a.value&&i.value&&e.recommendCache)return;const t=await j.addAsync(function(n,t){const{url:l,info:u}=F("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(q.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(s(n,["type"])):"recently"===n.type&&e.recently.push(s(n,["type"])),e)),{commonly:[],recently:[]});a.value=l.slice(0,e.commonNum),i.value=u.slice(0,e.recentNum)},sortedOptions:w}}function j(n,t){e();const l=f(h),u=f(g),o=m((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),r=m((()=>{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:s}=K(),v=d(null),{field:R,fieldKey:O}=k(),F=d(!1),q=async function(e){if(c.value=e||"",!n.urlConfig)return v.value=null;try{F.value=!0;const e=await l.addAsync(await b({config:n.urlConfig,cache:n.requestCache,field:R.value}));p(v.value)!==e&&(v.value=e,u("afterOptionInit",[O.value,v.value]))}catch(e){i(e)&&C(e)}finally{F.value=!1}},j=m((()=>v.value?s(v.value,o.value):Array.isArray(n.options)?s(n.options,o.value):[])),I=m((()=>v.value||n.options||[])),x=f(w);return y((()=>n.urlConfig),((e,l)=>{if(!a(e,l)){if(v.value=null,!e)return v.value=null;x.setDeps(O.value,e.dependKey||[],(async()=>{v.value=null,t.value=null,!n.lazyRequest&&await q()})),(t.value||!n.lazyRequest)&&q()}}),{immediate:!0}),{labelKey:o,loading:F,valueKey:r,remoteOptions:v,filterOptions:j,fullOptions:I,fetchData:q,searchContent:c}}function I(n,t){e();const u=f(h),o=f(g),r=l(),s=m((()=>{var e,t,l,u;const o=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0];if(i(o))return o;let r=null==(l=n.wordbook)?void 0:l.show_key;return c(r)&&(r=r[0]),i(r)?r:null!=(u=n.labelField)?u:"text"})),v=m((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),b=m((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:O,optionSearchFilter:F}=K(),q=d(null),{fieldKey:j}=k(),{getSearchRequestInfo:I}=R(),x=d(!1),A=async function(e){if(O.value=e||"",!n.autograph||!n.wordbook)return q.value=null;try{x.value=!0;const e=await u.addAsync(function(e,t,l){var u,o,a;const i={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};if(null==(u=e.queryParams)?void 0:u.length){const n=null!=(a=null==(o=r.value)?void 0:o.getFormState().values)?a:{};e.queryParams.forEach((e=>{i[e]=n[e]}))}return{...I(),params:i,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,j.value));p(q.value)!==e&&(q.value=e,o("afterOptionInit",[j.value,q.value]))}catch(e){i(e)&&C(e)}finally{x.value=!1}},S=m((()=>q.value?F(q.value,s.value,b.value):Array.isArray(n.options)?F(n.options,s.value):[])),N=m((()=>q.value||n.options||[])),_=f(w);return y((()=>n.wordbook),((e,l)=>{if(!a(e,l)){if(q.value=null,!e)return q.value=null;_.setDeps(j.value,e.queryParams||[],(async()=>{q.value=null,A()})),(t.value||!n.lazyRequest)&&A()}}),{immediate:!0}),{labelKey:s,loading:x,remoteOptions:q,valueKey:v,filterOptions:S,fullOptions:N,fetchData:A,searchContent:O}}export{F as searchContentMatcher,I as useAutographOptions,q as useRecommendOptions,j as useUrlConfigOptions};
1
+ import{checkInSetupEnv as e,arrayed as n,jsonParse as l,keywordMatcher as t}from"../../../../shared/utils/index.js";import{useForm as u}from"@formily/vue";import{useMemoize as o}from"@vueuse/core";import{identity as r,uniqBy as a,isEqual as i,isString as c,omit as s,isArray as v,isFunction as m}from"lodash-es";import{computed as d,inject as f,ref as y,watch as p,toRaw as h}from"vue";import"../../index.js";import{InjectionAsyncQueue as g,InjectionFormLifeCycleCaller as w,InjectionFormItemDepsCollector as k}from"../constants/index.js";import{useFormField as b}from"./useFormField.js";import{createUrlConfigParams as C,formRenderLog as K}from"../utils/index.js";import{useFormRequest as F}from"./useFormRequest.js";function R(e,n){const l=y();return d({get:()=>l.value?l.value:e[n],set(e){l.value=e}})}const O=(()=>{const e=o((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:r});return(n,l)=>l.match(e(n))})();function q(){const e=y();return{searchContent:e,optionSearchFilter:function(n,l,u){if(!e.value)return n;const o=v(u)?u.filter((e=>e&&c(e))):[];return n.filter((n=>function(n,l,u){if(!e.value)return!0;const o=n?n[l]:"";return!!c(o)&&(!!O(e.value,o)||!!t(e.value,n.keyword)||!!u.length&&u.some((l=>c(n[l])&&n[l].includes(e.value))))}(n,l,o)))}}}function j(e,n,t,u,o){const r=R(e,"commonList"),i=R(e,"recentList"),{searchContent:c,optionSearchFilter:v}=q();function y(e){return l(e.itemObj)}const p=d((()=>{var e,n;return null!=(n=null==(e=r.value)?void 0:e.map(y))?n:[]})),h=d((()=>{var e,n;return null!=(n=null==(e=i.value)?void 0:e.map(y))?n:[]})),w=d((()=>{if(!e.recommend||!p.value.length&&!h.value.length)return n.value;const l=a(p.value.concat(h.value),(e=>e[o.value])),t=n.value.filter((e=>l.every((function(n){return n[o.value]!==e[o.value]}))));return[...v(l,u.value),...t]})),{getRecommendRequestInfo:k,getHttpInstance:C}=F();function K(n){const{url:l,getRecommendIds:t}=k(),u=m(t)?t():{},o=m(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:l[n],info:Object.assign({},u,o)}}const{fieldKey:O}=b(),j=f(g);return{postRecommend:async function(n){if(!e.recommend)return;const l=C();if(!l)return;const{url:u,info:r}=K("post"),a=w.value.find((e=>e[o.value]===n));a&&t("postRecommend",await l.post(u,{...r,keyword:"",itemId:o.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(c.value=n,r.value&&i.value&&e.recommendCache)return;const l=await j.addAsync(function(n,l){const{url:t,info:u}=K("get");return{url:t,method:"get",key:n,cache:l,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(O.value,e.recommendCache)),{commonly:t,recently:u}=l.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(s(n,["type"])):"recently"===n.type&&e.recently.push(s(n,["type"])),e)),{commonly:[],recently:[]});r.value=t.slice(0,e.commonNum),i.value=u.slice(0,e.recentNum)},sortedOptions:w}}function I(n,l){e();const t=f(g),u=f(w),o=d((()=>{var e,l,t;return null!=(t=null!=(l=null==(e=n.urlConfig)?void 0:e.nameKey)?l:n.labelField)?t:"text"})),r=d((()=>{var e,l,t;return null!=(t=null!=(l=null==(e=n.urlConfig)?void 0:e.valueKey)?l:n.valueField)?t:"value"})),a=d((()=>{var e,l;return null!=(l=null==(e=n.urlConfig)?void 0:e.showKey)?l:n.showField})),{searchContent:s,optionSearchFilter:v}=q(),m=y(null),{field:F,fieldKey:R}=b(),O=y(!1),j=async function(e){if(s.value=e||"",!n.urlConfig)return m.value=null;try{O.value=!0;const e=await t.addAsync(await C({config:n.urlConfig,cache:n.requestCache,field:F.value}));h(m.value)!==e&&(m.value=e,u("afterOptionInit",[R.value,m.value]))}catch(e){c(e)&&K(e)}finally{O.value=!1}},I=d((()=>m.value?v(m.value,o.value):Array.isArray(n.options)?v(n.options,o.value):[])),x=d((()=>m.value||n.options||[])),A=f(k);return p((()=>n.urlConfig),((e,t)=>{if(!i(e,t)){if(m.value=null,!e)return m.value=null;A.setDeps(R.value,e.dependKey||[],(async()=>{m.value=null,l.value=null,!n.lazyRequest&&await j()})),(l.value||!n.lazyRequest)&&j()}}),{immediate:!0}),{labelKey:o,loading:O,showKey:a,valueKey:r,remoteOptions:m,filterOptions:I,fullOptions:x,fetchData:j,searchContent:s}}function x(l,t){e();const o=f(g),r=f(w),a=u(),s=d((()=>{var e;const t=n(null==(e=l.wordbook)?void 0:e.show_key)[0];return c(t)?t:null})),v=d((()=>{var e,n,t,u;const o=null==(n=null==(e=l.wordbook)?void 0:e.render_key)?void 0:n[0];return c(o)?o:null!=(u=null!=(t=s.value)?t:l.labelField)?u:"text"})),m=d((()=>{var e,n,t;return null!=(t=null!=(n=null==(e=l.wordbook)?void 0:e.value_key)?n:l.valueField)?t:"value"})),C=d((()=>{var e;return(null==(e=l.wordbook)?void 0:e.search_key)||[]})),R=d((()=>{var e;return null!=(e=s.value)?e:l.showField})),{searchContent:O,optionSearchFilter:j}=q(),I=y(null),{fieldKey:x}=b(),{getSearchRequestInfo:A}=F(),S=y(!1),N=async function(e){if(O.value=e||"",!l.autograph||!l.wordbook)return I.value=null;try{S.value=!0;const e=await o.addAsync(function(e,n,t){var u,o,r;const i={autograph:n,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};if(null==(u=e.queryParams)?void 0:u.length){const n=null!=(r=null==(o=a.value)?void 0:o.getFormState().values)?r:{};e.queryParams.forEach((e=>{i[e]=n[e]}))}return{...A(),params:i,key:t,cache:l.requestCache}}(l.wordbook,l.autograph,x.value));h(I.value)!==e&&(I.value=e,r("afterOptionInit",[x.value,I.value]))}catch(e){c(e)&&K(e)}finally{S.value=!1}},_=d((()=>I.value?j(I.value,v.value,C.value):Array.isArray(l.options)?j(l.options,v.value):[])),D=d((()=>I.value||l.options||[])),z=f(k);return p((()=>l.wordbook),((e,n)=>{if(!i(e,n)){if(I.value=null,!e)return I.value=null;z.setDeps(x.value,e.queryParams||[],(async()=>{I.value=null,N()})),(t.value||!l.lazyRequest)&&N()}}),{immediate:!0}),{labelKey:v,showKey:R,loading:S,remoteOptions:I,valueKey:m,filterOptions:_,fullOptions:D,fetchData:N,searchContent:O}}export{O as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
@@ -48,11 +48,12 @@ export interface FormRenderer {
48
48
  export declare type UrlConfig = {
49
49
  url: string;
50
50
  } & Partial<{
51
- method?: FormRequestType;
52
- nameKey?: string;
53
- valueKey?: string;
54
- params?: AnyObject;
55
- dependKey?: DependKeyType;
51
+ method: FormRequestType;
52
+ nameKey: string;
53
+ valueKey: string;
54
+ showKey: string;
55
+ params: AnyObject;
56
+ dependKey: DependKeyType;
56
57
  }>;
57
58
  interface SwitchProperty {
58
59
  value?: any;
@@ -149,6 +150,7 @@ export declare type FieldItem = {
149
150
  suffix: string | AnyObject | (() => any);
150
151
  allowSlash: boolean;
151
152
  allowModify: '0' | '1';
153
+ show_key: string;
152
154
  bordered: boolean | string;
153
155
  fieldType: SchemaTypes;
154
156
  content: string | FormRenderer | Record<string, FormRenderer>;
@@ -31,6 +31,7 @@ export declare function createUrlConfigParams({ config, field, cache }: {
31
31
  method?: import("../../../../../es/components/form-render").FormRequestType | undefined;
32
32
  nameKey?: string | undefined;
33
33
  valueKey?: string | undefined;
34
+ showKey?: string | undefined;
34
35
  dependKey?: import("../../../../../es/components/form-render").DependKeyType | undefined;
35
36
  }>;
36
37
  export declare function renderDescOption(labelNode: any, option: AnyObject): JSX.Element;
@@ -134,6 +134,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
134
134
  method?: import("..").FormRequestType | undefined;
135
135
  nameKey?: string | undefined;
136
136
  valueKey?: string | undefined;
137
+ showKey?: string | undefined;
137
138
  params?: import("../../../es/shared/types").AnyObject | undefined;
138
139
  dependKey?: string | Record<string, string> | (string | {
139
140
  paramName: string;
@@ -172,6 +173,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
172
173
  suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
173
174
  allowSlash?: boolean | undefined;
174
175
  allowModify?: "0" | "1" | undefined;
176
+ show_key?: string | undefined;
175
177
  bordered?: string | boolean | undefined;
176
178
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
177
179
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
@@ -136,6 +136,7 @@ declare const _default: import("vue").DefineComponent<{
136
136
  method?: import("../../../../es/components/form-render").FormRequestType | undefined;
137
137
  nameKey?: string | undefined;
138
138
  valueKey?: string | undefined;
139
+ showKey?: string | undefined;
139
140
  params?: import("../../../../es/shared/types").AnyObject | undefined;
140
141
  dependKey?: string | Record<string, string> | (string | {
141
142
  paramName: string;
@@ -174,6 +175,7 @@ declare const _default: import("vue").DefineComponent<{
174
175
  suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
175
176
  allowSlash?: boolean | undefined;
176
177
  allowModify?: "0" | "1" | undefined;
178
+ show_key?: string | undefined;
177
179
  bordered?: string | boolean | undefined;
178
180
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
179
181
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.49-beta.20",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.49-beta.20",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.49-beta.21",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.49-beta.21",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.49-beta.20",
3
+ "version": "3.1.49-beta.21",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "5cf149bae0baa5cc535deb0debf96d477ede8c63"
66
+ "gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
67
67
  }