cnhis-design-vue 3.1.55-beta.1 → 3.1.55-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/audio-sdk/index.d.ts +2 -0
- package/es/components/audio-sdk/index.js +1 -0
- package/es/components/{chat-sdk/src/chatSDK.d.ts → audio-sdk/src/audioSDK.d.ts} +8 -4
- package/es/components/audio-sdk/src/audioSDK.js +1 -0
- package/es/components/{chat-sdk → audio-sdk}/src/components/recordingDialog.vue.d.ts +1 -0
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -0
- package/es/components/audio-sdk/style/index.css +1 -0
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/{multi-chat → biunique-chat}/index.d.ts +2 -2
- package/es/components/biunique-chat/index.js +1 -0
- package/es/components/biunique-chat/src/BiuniqueChat.vue.js +1 -0
- package/es/components/biunique-chat/src/BiuniqueChat.vue2.js +1 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +13 -0
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/form-config/index.d.ts +26 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +26 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +13 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +13 -0
- package/es/components/form-render/index.d.ts +13 -0
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +13 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +13 -0
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +0 -1
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +3 -3
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +12 -8
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +3 -17
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -3
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +26 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +26 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +13 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +13 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +13 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +13 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/chat-sdk/index.d.ts +0 -2
- package/es/components/chat-sdk/index.js +0 -1
- package/es/components/chat-sdk/src/chatSDK.js +0 -1
- package/es/components/chat-sdk/src/components/recordingDialog.vue2.js +0 -1
- package/es/components/chat-sdk/style/index.css +0 -1
- package/es/components/multi-chat/index.js +0 -1
- package/es/components/multi-chat/src/MultiChat.vue.js +0 -1
- package/es/components/multi-chat/src/MultiChat.vue2.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
- /package/es/components/{chat-sdk → audio-sdk}/src/components/recordingDialog.vue.js +0 -0
- /package/es/components/{chat-sdk → audio-sdk}/src/utils/recordingDialog.d.ts +0 -0
- /package/es/components/{chat-sdk → audio-sdk}/src/utils/recordingDialog.js +0 -0
- /package/es/components/{multi-chat/src/MultiChat.vue.d.ts → biunique-chat/src/BiuniqueChat.vue.d.ts} +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/api/index.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/api/index.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatFooter.vue.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatFooter.vue.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatFooter.vue2.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatHeader.vue.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatHeader.vue.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatHeader.vue2.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatMain.vue.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatMain.vue.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/ChatMain.vue2.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/SiderList.vue.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/SiderList.vue.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/components/SiderList.vue2.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/utils/chatSock.d.ts +0 -0
- /package/es/components/{multi-chat → biunique-chat}/src/utils/chatSock.js +0 -0
- /package/es/components/{multi-chat → biunique-chat}/style/index.css +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as
|
|
1
|
+
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{Path as o}from"@formily/path";import{useDebounceFn as t,watchOnce as r}from"@vueuse/core";import{ref as n,computed as l,nextTick as i}from"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"date-fns";import{createLinebarId as a}from"../utils/schema.js";function s(s,u,c,m){const v=n(),p=n(""),f=n([]),d=async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var t,r;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(r=null==(t=o.componentProps)?void 0:t.title)?r:o.title,name:o.address.toString()}),e}),[]),await i(),null==(o=v.value)||o.syncBarPosition()};let h=!1;async function y(t){h=!0;try{if(!c.value)return;m.trigger(o.parse(t),!0),await i();const r=c.value.querySelector(`#${a(t)}`);if(!r)return;await new Promise((o=>{e(c.value.scrollTop,r.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=t((function(e){var o;if(h||!c.value)return;const{scrollTop:t,clientHeight:r}=c.value,n=f.value.find(((e,o,n)=>{const l=n[o+1];if(!l)return!0;const i=c.value.querySelector(`#${a(l.name)}`);return i?i.offsetTop>t+r/2:void 0}))||f.value[f.value.length-1];p.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);r(f,(e=>{var o,t;p.value=null!=(t=null==(o=e[0])?void 0:o.name)?t:""}));return{currentAnchor:l({get:()=>p.value,async set(e){p.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:v}}export{s as useAnchor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as a}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import
|
|
1
|
+
import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as a}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import{isIdCard as l,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class c{constructor(e){this.businessFormatter=e,this.triggerDisabled=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return r(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,i,r,a){const n=this.getField(i);n&&e.setFieldState(n.val_key,(e=>{e.value!==r&&(!this.typeLockMap.get(i)&&this.typeLockMap.set(i,1),this.triggerDisabled&&s(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(n.val_key)||(e.value=this.formatter({value:r,type:i,fieldKey:n.val_key,from:a})))}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(!0===this.triggerDisabled)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r))return this.typeLockMap.set(r,0);const a="change"===s?this.changeHandlerMap:null;a&&(null==(i=a.get(r))||i.call(this,e))}}function g(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function t(t){const r=this.getValueByType(t,n.ID_CARD);if(!r||!s(r)||!l(r))return;const a=o(r),{age:h,ageUnit:y}=u(a);this.setValueByType(t,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(t,n.AGE,h,n.ID_CARD),this.setValueByType(t,n.SEX,a.sex,n.ID_CARD),this.setValueByType(t,n.BIRTHDAY,i(new Date(a.birthday),e.call(this)),n.ID_CARD)}function r(e){const t=this.getValueByType(e,n.BIRTHDAY);if(!s(t))return;const{age:i,ageUnit:r}=u(h(t));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function g(t){return function(i){const r=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(s(r)||a(r))&&""!==r&&s(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,y(+r,l,e.call(this)),t)}}return{create:function(e){return new c(e).registerChangeBusiness(n.ID_CARD,t).registerChangeBusiness(n.AGE_UNIT,g(n.AGE_UNIT)).registerChangeBusiness(n.AGE,g(n.AGE)).registerChangeBusiness(n.BIRTHDAY,r)}}}export{c as BusinessCollector,g as useBusinessBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as l,isBoolean as d}from"lodash-es";import{nextTick as u}from"vue";import"../../index.js";import{
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as l,isBoolean as d}from"lodash-es";import{nextTick as u}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as m}from"../constants/index.js";import{queryDecoratorByAddress as f,queryInput as c,queryDecoratorByFieldKey as g,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as v,combineExtendKey as y,splitExtendKey as h}from"../utils/index.js";import{getParentLinebar as b}from"../utils/schema.js";function x({formModel:t,formRenderRef:n,formUUID:m,getFieldList:p,formItemDepsCollector:x,businessCollector:D,wordbookSettingHandler:F,operationalFormHandler:I}){return{validate(o="*",{force:d}={}){if(a(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const u=[];d&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(u.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const g=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(p,[]):e)));return d&&u.forEach((({pattern:e,state:t})=>t.pattern=e)),g;function p(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(y)),o=!0)})),!o&&t.push(y(r)),t}function y(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),a=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return v(r&&l(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),s=f(e.address,n.value,m);return{...e,messages:a,title:o,decoratorElement:s,...c(s)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=y(p(),r)),r},async setFormValues(e,n={},a=!1,s=!0){var l,m,f,c,g,v;let y=!0,b=!0,j=!0,w=!0;i(n)?(b=null==(l=n.needSplitExtendKey)||l,y=null==(m=n.avoidDependKeyConnection)||m,a=null!=(f=n.avoidBusinessConnection)&&f,j=null==(c=n.avoidWordbookSettingConnection)||c,w=null==(g=n.avoidOperationalFormConnection)||g,s=null==(v=n.overwrite)||v):d(n)&&(b=n),D.triggerDisabled=a,x.triggerDisabled=y,F.triggerDisabled=j,I.triggerDisabled=w,b&&(e=h(p(),e)),t.setFieldState("*",(t=>{r(t)&&(s||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))})),await u(),D.triggerDisabled=!1,x.triggerDisabled=!1,F.triggerDisabled=!1,I.triggerDisabled=!1},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const i=g(e,t,m);if(i)return s(i);const a=b(e,r);return a?(x.trigger(o.parse(a),!0),await u(),s(g(e,t,m))):s();function s(e){return{decoratorElement:e,...c(e)}}}(e,n.value,p()):null}}function D({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(s){var l;if(e.enterToNextWidget&&s.target){if("TEXTAREA"===s.target.tagName&&!s.ctrlKey)return;s.preventDefault()}if(await n(0),Reflect.get(s,"stopCapture")||!e.enterToNextWidget||!r.value)return;const d=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!d)return;const u=`.form-render__formItem${m.map((e=>`:not([widget-type=${e}])`)).join("")}`,f=Array.from(r.value.querySelectorAll(u)),c=f.findIndex((e=>e.id===d.id));if(!~c)return;const{widget:g,field:v}=p(f,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(l=t.decoratorProps)?void 0:l.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{D as useFormDomEvent,x as useFormExposeEvent};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnyFn } from '../../../../../es/shared/types';
|
|
2
|
+
import { Path } from '@formily/path';
|
|
2
3
|
import { DependKeyType } from '../../../../../es/components/form-render';
|
|
3
4
|
export declare class FormItemDepsCollector {
|
|
4
5
|
triggerDisabled: string | boolean;
|
|
5
6
|
private readonly collector;
|
|
6
|
-
setDeps(
|
|
7
|
-
|
|
8
|
-
trigger(dependKey: string, payload?: unknown): void;
|
|
7
|
+
setDeps(fieldPath: Path, dependKeys: DependKeyType, callback: AnyFn): void;
|
|
8
|
+
trigger(dependPath: Path, payload?: unknown): void;
|
|
9
9
|
}
|
|
10
10
|
export declare function useFormItemDeps(): {
|
|
11
11
|
create: () => FormItemDepsCollector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Path as t}from"@formily/path";import{isFunction as
|
|
1
|
+
import{Path as t}from"@formily/path";import{isFunction as r,isString as e}from"lodash-es";import"../../index.js";import{getAbsoluteKey as i}from"../utils/index.js";import{traverseDependKey as s}from"../utils/schema.js";class o{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,e){s(r,(r=>{const s=i(r,t),o=this.collector.get(s)||new Map;o.set(t,e),this.collector.set(s,o)}))}trigger(i,s){if(!0===this.triggerDisabled)return;const o=this.collector.get(i.toString());o&&[...o.entries()].forEach((([i,o])=>{!r(o)||this.triggerDisabled&&e(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(i)||o(s)}))}}function c(){return{create:function(){return new o}}}export{o as FormItemDepsCollector,c as useFormItemDeps};
|
|
@@ -32,14 +32,16 @@ export declare function useUrlConfigOptions(props: Partial<{
|
|
|
32
32
|
lazyRequest: boolean;
|
|
33
33
|
searchByValue: boolean;
|
|
34
34
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
35
|
-
labelKey:
|
|
35
|
+
labelKey: Ref<string>;
|
|
36
36
|
loading: Ref<boolean>;
|
|
37
|
-
showKey:
|
|
38
|
-
valueKey:
|
|
37
|
+
showKey: Ref<string | undefined>;
|
|
38
|
+
valueKey: Ref<string>;
|
|
39
39
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
40
40
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
41
41
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
42
|
-
fetchData: (content?: string, otherParams?: AnyObject
|
|
42
|
+
fetchData: (content?: string | undefined, otherParams?: AnyObject | undefined, options?: {
|
|
43
|
+
avoidSearchContent?: boolean | undefined;
|
|
44
|
+
}) => Promise<null | undefined>;
|
|
43
45
|
searchContent: Ref<string | undefined>;
|
|
44
46
|
};
|
|
45
47
|
export declare function useAutographOptions(props: Partial<{
|
|
@@ -52,14 +54,16 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
52
54
|
lazyRequest: boolean;
|
|
53
55
|
options: AnyObject[];
|
|
54
56
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
55
|
-
labelKey:
|
|
56
|
-
showKey: import("vue").ComputedRef<string | undefined>;
|
|
57
|
+
labelKey: Ref<string>;
|
|
57
58
|
loading: Ref<boolean>;
|
|
59
|
+
showKey: Ref<string | undefined>;
|
|
60
|
+
valueKey: Ref<string>;
|
|
58
61
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
59
|
-
valueKey: import("vue").ComputedRef<string>;
|
|
60
62
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
61
63
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
62
|
-
fetchData: (content?: string, otherParams?: AnyObject
|
|
64
|
+
fetchData: (content?: string | undefined, otherParams?: AnyObject | undefined, options?: {
|
|
65
|
+
avoidSearchContent?: boolean | undefined;
|
|
66
|
+
}) => Promise<null | undefined>;
|
|
63
67
|
searchContent: Ref<string | undefined>;
|
|
64
68
|
};
|
|
65
69
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{arrayed as e,checkInSetupEnv as l,jsonParse as n}from"../../../../shared/utils/index.js";import{uniqBy as o,isString as r,isEqual as t,omit as u,isFunction as a}from"lodash-es";import"naive-ui";import{computed as s,inject as i,ref as c,watch as v,toRaw as m}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as d}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import{useOptionFiltered as f}from"../../../../shared/hooks/selectHooks/useOptionFiltered.js";import{useSearchContent as y}from"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../index.js";import{InjectionAsyncQueue as p,InjectionFormLifeCycleCaller as h,InjectionFormItemDepsCollector as g}from"../constants/index.js";import{useFormField as K}from"./useFormField.js";import{traverseDependKey as k}from"../utils/schema.js";import{getAbsoluteKey as w,formRenderLog as C}from"../utils/index.js";function b(e,l){const n=c();return s({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}function R(e,l,r,t,c){const v=b(e,"commonList"),m=b(e,"recentList"),{searchContent:f,optionSearchFilter:h}=y();function g(e){return n(e.itemObj)}const k=s((()=>{var e,l;return null!=(l=null==(e=v.value)?void 0:e.map(g))?l:[]})),w=s((()=>{var e,l;return null!=(l=null==(e=m.value)?void 0:e.map(g))?l:[]})),C=s((()=>{if(!e.recommend||!k.value.length&&!w.value.length)return l.value;const n=o(k.value.concat(w.value),(e=>e[c.value])),r=l.value.filter((e=>n.every((function(l){return l[c.value]!==e[c.value]}))));return[...h(n,t.value),...r]})),{getRecommendRequestInfo:R,getHttpInstance:O}=d();function j(l){const{url:n,getRecommendIds:o}=R(),r=a(o)?o():{},t=a(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},r,t)}}const{fieldKey:F,field:I}=K(),q=i(p);return{postRecommend:async function(l){if(!e.recommend)return;const n=O();if(!n)return;const{url:o,info:t}=j("post"),u=C.value.find((e=>e[c.value]===l));u&&r("postRecommend",await n.post(o,{...t,keyword:"",itemId:c.value,itemObj:JSON.stringify(u)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,v.value&&m.value&&e.recommendCache)return;const n=await q.addAsync(function(l,n){const{url:o,info:r}=j("get");return{url:o,method:"get",key:l,cache:n,params:{...r,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:I.value,labelKey:t.value,valueKey:c.value}}}(F.value,e.recommendCache)),{commonly:o,recently:r}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(u(l,["type"])):"recently"===l.type&&e.recently.push(u(l,["type"])),e)),{commonly:[],recently:[]});v.value=o.slice(0,e.commonNum),m.value=r.slice(0,e.recentNum)},sortedOptions:C}}function O(e,l,n){const o=s((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.nameKey)?n:e.labelField)?o:"text"})),r=s((()=>{var l,n,o;return null!=(o=null!=(n=null==(l=e.urlConfig)?void 0:l.valueKey)?n:e.valueField)?o:"value"})),t=s((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.showKey)?n:e.showField})),u=s((()=>{var l,n;return null!=(n=null==(l=e.urlConfig)?void 0:l.searchKey)?n:e.searchField})),{field:a}=K();return I({props:e,labelKey:o,valueKey:r,searchKey:u,showKey:t,hooks:n,valueRef:l,getConfig:()=>e.urlConfig,getParams:()=>{var l,n;const o=F(a.value,null==(l=e.urlConfig)?void 0:l.params,null==(n=e.urlConfig)?void 0:n.dependKey);return{...e.urlConfig,params:o}},getDependKeys:()=>{var l;return null==(l=e.urlConfig)?void 0:l.dependKey}})}function j(l,n,o){const t=s((()=>{var n;const o=e(null==(n=l.wordbook)?void 0:n.show_key)[0];return r(o)?o:null})),u=s((()=>{var e,n,o,u;const a=null==(n=null==(e=l.wordbook)?void 0:e.render_key)?void 0:n[0];return r(a)?a:null!=(u=null!=(o=t.value)?o:l.labelField)?u:"text"})),a=s((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.wordbook)?void 0:e.value_key)?n:l.valueField)?o:"value"})),i=s((()=>{var e;return(null==(e=l.wordbook)?void 0:e.search_key)||[]})),c=s((()=>{var e;return null!=(e=t.value)?e:l.showField})),{field:v}=K(),{getSearchRequestInfo:m}=d();return I({props:l,labelKey:u,valueKey:a,searchKey:i,showKey:c,hooks:o,valueRef:n,getConfig:()=>l.wordbook,getParams:()=>{const{wordbook:e,autograph:n}=l,o=F(v.value,{autograph:n,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1},e.queryParams);return{...m(),params:o}},getDependKeys:()=>{var e;return null==(e=l.wordbook)?void 0:e.queryParams}})}function F(e,l,n){const o={...l};return n&&k(n,((l,n,r)=>{const t=w(l,e.path),u=e.form.getValuesIn(t);if(r&&null==u)throw`缺少必须的参数=>${t}`;o[n]=u})),o}function I({labelKey:e,valueKey:n,searchKey:o,showKey:u,props:a,getConfig:s,getParams:d,getDependKeys:y,hooks:k,valueRef:w}){l();const b=i(p),R=i(h),{remoteOptions:O,filterOptions:j,fullOptions:F,searchContent:I}=f(a,{labelKey:e,valueKey:n,searchKey:o}),{field:q,fieldKey:x}=K(),D=c(!1),N=async function(l,o,t={avoidSearchContent:!0}){if(I.value=l,!s())return O.value=null;if(!t.avoidSearchContent||null==I.value)try{D.value=!0;const l={field:q.value,labelKey:e.value,valueKey:n.value},r={params:{...d().params,...o},key:x.value,cache:a.requestCache,payload:l},t=await b.addAsync(Object.assign({},d(),r));m(O.value)!==t&&(O.value=t,R("afterOptionInit",[x.value,O.value,l]))}catch(e){r(e)&&C(e)}finally{D.value=!1}},S=i(g);return v(s,((l,o)=>{if(t(l,o))return;if(O.value=null,!l)return O.value=null;const r={fetchData:N,labelKey:e.value,valueKey:n.value},{onRequestConfigChange:u,onDepsChange:s}=k||{};S.setDeps(q.value.path,y()||[],(async()=>{O.value=null,w.value=null,a.lazyRequest||(s?s(r):N())})),!w.value&&a.lazyRequest||(u?u(r):N())}),{immediate:!0}),{labelKey:e,loading:D,showKey:u,valueKey:n,remoteOptions:O,filterOptions:j,fullOptions:F,fetchData:N,searchContent:I}}export{j as useAutographOptions,R as useRecommendOptions,O as useUrlConfigOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as
|
|
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 +1 @@
|
|
|
1
|
-
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import
|
|
1
|
+
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as o,isMobile as r}from"../utils/business.js";function s(){return{isIdCard:r=>i(r)&&o(r),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o)}}export{s as usePresetScope};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AnyObject, ArrayAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { GeneralField } from '@formily/core';
|
|
3
|
+
import { Pattern } from '@formily/path';
|
|
3
4
|
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
4
|
-
import { FieldItem
|
|
5
|
+
import { FieldItem } from '../types';
|
|
5
6
|
export * from './business';
|
|
6
7
|
export * from './dom';
|
|
7
8
|
export * from './schema';
|
|
@@ -18,20 +19,5 @@ export declare function combineExtendKey(fieldList: FieldItem[], values: AnyObje
|
|
|
18
19
|
export declare function splitExtendKey(fieldList: FieldItem[], values: AnyObject): AnyObject;
|
|
19
20
|
export declare function isNestedType(type?: string): boolean | "" | undefined;
|
|
20
21
|
export declare function isNestedFieldType(field: FieldItem | GeneralField): boolean | "" | undefined;
|
|
21
|
-
export declare function createUrlConfigParams({ config, field, cache }: {
|
|
22
|
-
config: UrlConfig;
|
|
23
|
-
field: GeneralField;
|
|
24
|
-
cache?: boolean;
|
|
25
|
-
}): Promise<{
|
|
26
|
-
params: AnyObject;
|
|
27
|
-
key: string;
|
|
28
|
-
cache: boolean | undefined;
|
|
29
|
-
url: string;
|
|
30
|
-
method?: import("../../..").FormRequestDefine.RequestType | undefined;
|
|
31
|
-
nameKey?: string | undefined;
|
|
32
|
-
valueKey?: string | undefined;
|
|
33
|
-
showKey?: string | undefined;
|
|
34
|
-
searchKey?: string[] | undefined;
|
|
35
|
-
dependKey?: import("../../../../../es/components/form-render").DependKeyType | undefined;
|
|
36
|
-
}>;
|
|
37
22
|
export declare function renderDescOption(labelNode: any, option: AnyObject): JSX.Element;
|
|
23
|
+
export declare function getAbsoluteKey(fieldKey: string, field: Pattern): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as
|
|
1
|
+
import{inject as n,provide as t,computed as e,createVNode as r,Fragment as o}from"vue";import{arrayed as i}from"../../../../shared/utils/index.js";import{isGeneralField as u}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as c}from"@vicons/ionicons5";import{isObject as s}from"@vue/shared";import{useMemoize as l}from"@vueuse/core";import{isString as a,isFunction as p,omit as m}from"lodash-es";import{NTooltip as d,NIcon as h}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as x}from"../constants/index.js";import"date-fns";function y(n){console.warn(`[FormRender]: ${n}`)}function g(n,t,e=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function n(t,r){r.forEach((r=>{s(r)&&(null!=c(r)&&null==t[u(r)]&&f.setIn(t,u(r),c(r)),e.forEach((e=>{r[e]&&(t[u(r)]||(t[u(r)]={}),n(t[u(r)],i(r[e])))})))}))}(n,t),n;function u(n){return n[r]}function c(n){return n[o]}}function v(e,r){let o=n(e,null);return o||(o=r(),t(e,o)),o}function E(n){return n&&a(n)?+n:n}function _(n,t,e){if(s(n)&&!p(n)){const e={};return Object.entries(n).forEach((([n,r])=>{p(r)&&(e[n]=()=>r(t))})),e}return{default:()=>p(n)?n(t):e?e(n):[n]}}function K(n,t){return e((()=>{const e={};return n.prefix&&(e.prefix=()=>r(o,null,[_(n.prefix,n,t).default()])),n.suffix&&(e.suffix=()=>r(o,null,[_(n.suffix,n,t).default()])),e}))}function j(n,t){return a(n)&&n?n.replace(/\$\{([^}]*)}/g,(function(n,e){const r=e.split("||");for(const n of r){const e=t[n.trim()];if(e)return e}return""})):""}function k(n){return n.reduce(((n,t)=>(a(t.extendKey)&&t.extendKey&&n.push(t),b(t)&&n.push(...k(t.children||[])),n)),[])}function O(n,t){const e=k(n);if(!e.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([n,i])=>{const u=e.find((t=>t.val_key===n));if(!u)return r[n]=i;const{val_key:f,extendKey:c}=u,s=o.get(c)||{};o.set(c,s),s[f]=t[f]})),[...o.entries()].forEach((([n,t])=>{r[n]=JSON.stringify(t)})),r}function S(n,t){const e=k(n);if(!e.length)return t;const r=l((n=>{try{return s(t[n])?t[n]:JSON.parse(t[n])||{}}catch(n){return{}}})),o=m(t,e.map((n=>n.extendKey)));return e.forEach((({val_key:n,extendKey:t})=>{Reflect.has(o,n)||(o[n]=r(t)[n])})),o}function $(n){return n&&x.includes(n)}function b(n){return $(u(n)?n.componentType:n.html_type)}function w(n,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[n,t.desc?r(d,null,{trigger:()=>r(h,{component:c},null),default:()=>t.desc}):null])}function I(n,t){return f.parse(n.startsWith(".")?n:`.${n}`,t).toString()}export{O as combineExtendKey,K as createInputSlot,_ as createSlot,y as formRenderLog,I as getAbsoluteKey,v as injectOrProvide,b as isNestedFieldType,$ as isNestedType,g as mergeDeepProperties,E as parseNumberFromMaybeString,w as renderDescOption,S as splitExtendKey,j as validateMessageParser};
|