cnhis-design-vue 3.2.7-release.0 → 3.2.7-release.2
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/index.d.ts +60 -5
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +60 -5
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +60 -5
- package/es/components/classification/src/index.vue.d.ts +60 -5
- package/es/components/date-picker/index.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +11 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
- package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/form-render/src/utils/schema.d.ts +1 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/iho-chat/index.d.ts +204 -69
- package/es/components/iho-chat/src/Index.vue.d.ts +204 -69
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +34 -13
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +38 -13
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +48 -14
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +20 -3
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +3 -10
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +47 -22
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
- package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.d.ts +11 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +0 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
- package/es/components/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +47 -5
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +37 -19
- package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +47 -5
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +47 -5
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +33 -18
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +13 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +69 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +69 -4
- package/es/components/table-filter/src/tool/transformData.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +1 -0
- package/es/components/time-picker/index.d.ts +20 -2
- package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/business.js +1 -1
- package/package.json +2 -2
@@ -200,6 +200,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
200
200
|
allowedInvalidValue: {
|
201
201
|
type: StringConstructor;
|
202
202
|
};
|
203
|
+
to: {
|
204
|
+
type: PropType<string | false | HTMLElement>;
|
205
|
+
default: string;
|
206
|
+
};
|
203
207
|
}, {
|
204
208
|
attrs: {
|
205
209
|
[x: string]: unknown;
|
@@ -220,6 +224,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
220
224
|
allowedInvalidValue: {
|
221
225
|
type: StringConstructor;
|
222
226
|
};
|
227
|
+
to: {
|
228
|
+
type: PropType<string | false | HTMLElement>;
|
229
|
+
default: string;
|
230
|
+
};
|
223
231
|
}>> & {
|
224
232
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
225
233
|
}>>;
|
@@ -256,10 +264,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
256
264
|
allowedInvalidValue: {
|
257
265
|
type: StringConstructor;
|
258
266
|
};
|
267
|
+
to: {
|
268
|
+
type: PropType<string | false | HTMLElement>;
|
269
|
+
default: string;
|
270
|
+
};
|
259
271
|
}>> & {
|
260
272
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
261
273
|
}, {
|
262
274
|
updateUnchangedValue: boolean;
|
275
|
+
to: string | false | HTMLElement;
|
263
276
|
}>>;
|
264
277
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
265
278
|
data: {
|
@@ -1911,7 +1911,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
1911
1911
|
wrapperStyle?: Record<string, string> | undefined;
|
1912
1912
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1913
1913
|
childWidthMode?: "inner" | "outer" | undefined;
|
1914
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
1914
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
1915
1915
|
reactions?: {
|
1916
1916
|
[x: string]: any;
|
1917
1917
|
dependencies?: string[] | undefined;
|
@@ -2158,7 +2158,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2158
2158
|
wrapperStyle?: Record<string, string> | undefined;
|
2159
2159
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2160
2160
|
childWidthMode?: "inner" | "outer" | undefined;
|
2161
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
2161
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2162
2162
|
reactions?: {
|
2163
2163
|
[x: string]: any;
|
2164
2164
|
dependencies?: string[] | undefined;
|
@@ -2376,7 +2376,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2376
2376
|
wrapperStyle?: Record<string, string> | undefined;
|
2377
2377
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2378
2378
|
childWidthMode?: "inner" | "outer" | undefined;
|
2379
|
-
validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
|
2379
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2380
2380
|
reactions?: {
|
2381
2381
|
[x: string]: any;
|
2382
2382
|
dependencies?: string[] | undefined;
|
@@ -1914,7 +1914,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1914
1914
|
wrapperStyle?: Record<string, string> | undefined;
|
1915
1915
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1916
1916
|
childWidthMode?: "inner" | "outer" | undefined;
|
1917
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
1917
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
1918
1918
|
reactions?: {
|
1919
1919
|
[x: string]: any;
|
1920
1920
|
dependencies?: string[] | undefined;
|
@@ -2161,7 +2161,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2161
2161
|
wrapperStyle?: Record<string, string> | undefined;
|
2162
2162
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2163
2163
|
childWidthMode?: "inner" | "outer" | undefined;
|
2164
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
2164
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2165
2165
|
reactions?: {
|
2166
2166
|
[x: string]: any;
|
2167
2167
|
dependencies?: string[] | undefined;
|
@@ -2379,7 +2379,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2379
2379
|
wrapperStyle?: Record<string, string> | undefined;
|
2380
2380
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2381
2381
|
childWidthMode?: "inner" | "outer" | undefined;
|
2382
|
-
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
|
2382
|
+
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
2383
2383
|
reactions?: {
|
2384
2384
|
[x: string]: any;
|
2385
2385
|
dependencies?: string[] | undefined;
|
@@ -417,7 +417,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
417
417
|
wrapperStyle?: Record<string, string> | undefined;
|
418
418
|
childFieldStrategy?: "checked" | "all" | undefined;
|
419
419
|
childWidthMode?: "inner" | "outer" | undefined;
|
420
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
420
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
421
421
|
reactions?: {
|
422
422
|
[x: string]: any;
|
423
423
|
dependencies?: string[] | undefined;
|
@@ -664,7 +664,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
664
664
|
wrapperStyle?: Record<string, string> | undefined;
|
665
665
|
childFieldStrategy?: "checked" | "all" | undefined;
|
666
666
|
childWidthMode?: "inner" | "outer" | undefined;
|
667
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
667
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
668
668
|
reactions?: {
|
669
669
|
[x: string]: any;
|
670
670
|
dependencies?: string[] | undefined;
|
@@ -882,7 +882,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
882
882
|
wrapperStyle?: Record<string, string> | undefined;
|
883
883
|
childFieldStrategy?: "checked" | "all" | undefined;
|
884
884
|
childWidthMode?: "inner" | "outer" | undefined;
|
885
|
-
validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
|
885
|
+
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
886
886
|
reactions?: {
|
887
887
|
[x: string]: any;
|
888
888
|
dependencies?: string[] | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as
|
1
|
+
import{defineComponent as e,computed as i,ref as o,inject as l,watch as t,toRaw as a,openBlock as r,createElementBlock as n,Fragment as s,createVNode as u,unref as d,mergeProps as m,nextTick as v}from"vue";import{cloneDeep as f}from"lodash-es";import{InjectionActiveFieldItem as p}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as c}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as g}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as h}from"../hooks/useConfigurationField.js";import"../../../index.js";import y from"../../../form-render/index.js";var b=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:b}){const j=e,x=i((()=>`#${j.uuid} .form-config__config`)),F=o(),w=l(p),R=o([]),k=o({}),{generateFieldListByFormConfigItem:C}=h(),_=o(!1);async function P(){var e;w.value=L,await v(),null==(e=F.value)||e.validate()}let L=null;function O({fieldKey:e,value:i}){w.value&&(w.value[e]=i)}return t(w,(async(e,i)=>{var o,l,t;if(!e)return R.value=[];if(i&&e!==L)try{await(null==(o=F.value)?void 0:o.validate())}catch(e){return _.value=!0}L=e,k.value={editable:!0,show:!0,...f(a(e))};const r=null==(l=j.bindFormRenderRef)?void 0:l.getFieldList();R.value=C(e,c(r,e.key)),null==(t=F.value)||t.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=F.value)?void 0:e.validate()}}),(i,o)=>(r(),n(s,null,[u(d(y),m({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:F,onFormChange:O,"field-list":R.value,"initial-data":k.value}),null,16,["field-list","initial-data"]),u(d(g),{show:_.value,"onUpdate:show":o[0]||(o[0]=e=>_.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:P},null,8,["show","to"])],64))}});export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),v=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,beforeSetValue:null==_?void 0:_.beforeSetValue,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=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,g;const y=v(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["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=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(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=v(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=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!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,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",y],["CHECKBOX",y],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(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=v(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(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"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(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=v(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(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:N(n)}),i},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:'{{hasVisible($deps) && $self.selfDisplay==="visible"}}'}}})}export{_ as useFieldListAdaptor};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:(a,i,r)=>e(a,m,r)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FormRequestDefine } from '../../../../shared/hooks';
|
2
2
|
import { AnyObject, ArrayAble, LowCodeTypes } from '../../../../shared/types';
|
3
|
+
import { Field } from '@formily/core';
|
3
4
|
import { SchemaEffectTypes, SchemaTypes } from '@formily/vue';
|
4
5
|
import { VNode } from 'vue';
|
5
6
|
import { DependKeyType, FormCommonState } from '../../../../components/form-render';
|
@@ -158,7 +159,7 @@ export type FieldItem = {
|
|
158
159
|
* @param fieldItem 配置参数
|
159
160
|
* @return {void|string} 返回校验信息
|
160
161
|
*/
|
161
|
-
validator: (value: unknown, fieldItem: FieldItem) => void | string;
|
162
|
+
validator: (value: unknown, fieldItem: FieldItem, field: Field) => void | string;
|
162
163
|
reactions: ArrayAble<ReactionType>;
|
163
164
|
[key: string]: any;
|
164
165
|
}>;
|
@@ -15,7 +15,7 @@ export interface FieldVisitorContext {
|
|
15
15
|
insertAfter(f: FieldItem | FieldItem[]): void;
|
16
16
|
}
|
17
17
|
export type FieldVisitor = Record<string, (context: FieldVisitorContext) => void>;
|
18
|
-
export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours', number>;
|
18
|
+
export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours' | 'minutes', number>;
|
19
19
|
export type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
|
20
20
|
export type FormRenderExpose = {
|
21
21
|
formModel: Form;
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{format as t,differenceInDays as e,differenceInMonths as n,differenceInYears as r,differenceInHours as s,differenceInMinutes as a}from"date-fns";import{isString as u}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as d}from"../constants/index.js";function i(t){return((t,e,n)=>{const r={},s=1-t.substr(e,1)%2;r.sex=1===s?d.FEMALE:d.MALE;const a=(2==n?"19":"")+t.substr(6,n),u=t.substr(6+n,2),o=t.substr(8+n,2);r.birthday=a+"-"+u+"-"+o+" 00:00";const i=new Date,c=i.getMonth()+1<parseInt(u,10)||i.getMonth()+1==parseInt(u,10)&&i.getDate()<parseInt(o,10)?1:0;return Object.assign(r,m(r.birthday)),r.age=r.year=i.getFullYear()-parseInt(a,10)-c,r})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!u(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),r=t.includes("d"),s=t.includes("H"),a=t.includes("m"),o=t.includes("s");return e||n||r||!(s||a||o)?s||a||o?"datetime":!e||n||r?!e&&n&&r?"month":"date":"year":"time"}const l=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,f=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function g(t){return l.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let r=0;r<17;r++)n+=+t[r]*e[r];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||f.test(t)}function h(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function m(t){const u={},o=new Date,d=new Date(t),i=[["day",e],["month",n],["year",r],["hours",s],["minutes",a]];return Object.defineProperties(u,i.reduce(((t,[e,n])=>(t[e]={get:(()=>{let t=null;return()=>(null===t&&(t=n(o,d)),t)})()},t)),{})),u}function M(e,n,r="yyyy-MM-dd HH:mm"){var s;const a=new Date,u={[o.MINUTE]:()=>d(a,"Minutes",e),[o.HOUR]:()=>d(a,"Hours",e),[o.DAY]:()=>d(a,"Date",e),[o.WEEK]:()=>d(a,"Date",7*e),[o.MONTH]:()=>d(a,"Month",e),[o.YEAR]:()=>d(a,"FullYear",e)};return null==(s=u[n])||s.call(u),t(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],r=n.findIndex((t=>Reflect.has(t,e)));~r&&n.slice(r+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(a,n),r);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function D(t){const e=t.minutes<60?{ageUnit:o.MINUTE,age:t.minutes}:t.hours<24?{ageUnit:o.HOUR,age:t.hours}:t.day<30?{ageUnit:o.DAY,age:t.day}:t.day<365?{ageUnit:o.MONTH,age:t.month}:{ageUnit:o.YEAR,age:t.year};return e.age=Math.max(e.age,1),e}const y=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function E(t){if(!u(t))return;const e=t.match(y);if(!e)return;const[,n,r,s,a,o,d]=e;return new Date(`${n}-${r}-${s||"01"} ${a||"00"}:${o||"00"}:${d||"00"}`)}export{E as businessDateParser,g as isIdCard,h as isMobile,M as parseAge2Birthday,D as parseAgeFromContext,m as parseBirthday,i as parseIdCard,c as transformDateFormat};
|
@@ -3,7 +3,7 @@ import { GeneralField } from '@formily/core';
|
|
3
3
|
import { ISchema } from '@formily/json-schema/esm/types';
|
4
4
|
import { Ref } from 'vue';
|
5
5
|
import { DependKeyType, FieldItem, ObjectDependKey } from '../../../../components/form-render';
|
6
|
-
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
|
6
|
+
export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema, parent?: ISchema) => void, parent?: ISchema): void;
|
7
7
|
export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
|
8
8
|
export declare function dotEscape(id: string): string;
|
9
9
|
export declare function createFieldAddressId(id: string): string;
|
@@ -1 +1 @@
|
|
1
|
-
import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r){r(e),t(e.properties)&&Object.values(e.properties).forEach((
|
1
|
+
import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r,n){r(e,n),t(e.properties)&&Object.values(e.properties).forEach((t=>{i(t,r,e)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};
|