cnhis-design-vue 3.1.55-release.0 → 3.1.55-release.1
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/audio-sdk/src/audioSDK.d.ts +28 -0
- package/es/components/audio-sdk/src/audioSDK.js +1 -0
- package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +27 -0
- package/es/components/audio-sdk/src/components/recordingDialog.vue.js +1 -0
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -0
- package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +8 -0
- package/es/components/audio-sdk/src/utils/recordingDialog.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/body-select/src/hooks/renderCanvas.js +1 -1
- package/es/components/body-select/src/index.vue2.js +1 -1
- package/es/components/button-print/index.d.ts +13 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +26 -6
- package/es/components/classification/index.d.ts +486 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +473 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +473 -1
- package/es/components/classification/src/index.vue.d.ts +486 -1
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/classification/style/index.css +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +1 -0
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +4 -0
- 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/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +6 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +3 -3
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/form-config/index.d.ts +104 -57
- package/es/components/form-config/src/FormConfig.vue.d.ts +104 -57
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -6
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +44 -21
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +5 -5
- package/es/components/form-render/index.d.ts +26 -6
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +26 -6
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -6
- 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/formItem.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/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/index.d.ts +20 -9
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +14 -3
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +4 -4
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +11 -10
- 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/useOperationalForm.d.ts +3 -2
- package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +13 -4
- package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/types/index.d.ts +10 -5
- package/es/components/form-render/src/utils/index.d.ts +3 -16
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/colorAndIconPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/colorAndIconPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +7 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -2
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +52 -12
- package/es/components/info-header/src/InfoHeader.vue.d.ts +52 -12
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +26 -6
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -6
- package/es/components/quick-search/style/index.css +1 -1
- 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 +32 -11
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +32 -11
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +320 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +127 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.d.ts +41 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +51 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue2.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +244 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +14 -0
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.d.ts +13 -0
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +474 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.js +1 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -0
- package/es/components/table-filter/src/constants/index.d.ts +1 -0
- package/es/components/table-filter/src/constants/index.js +1 -1
- 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/hooks/selectHooks/useSearchContent.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/business.d.ts +1 -0
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +3 -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/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/{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,19 +1,30 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
2
|
import { Field, Form, IFieldState } from '@formily/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
import { FieldItem, FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
-
|
|
4
|
+
import { BusinessCollector, FieldItem, FormItemDepsCollector, FormRenderProps, useOperationalForm } from '../../../../../es/components/form-render';
|
|
5
|
+
import { wordbookSettingHandler } from '../../../../../es/components/form-render/src/hooks';
|
|
6
|
+
export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID, getFieldList, formItemDepsCollector, businessCollector, wordbookSettingHandler, operationalFormHandler }: {
|
|
6
7
|
formModel: Form;
|
|
7
8
|
formRenderRef: Ref<HTMLElement | undefined>;
|
|
8
9
|
formUUID: string;
|
|
9
10
|
getFieldList: () => FieldItem[];
|
|
10
11
|
formItemDepsCollector: FormItemDepsCollector;
|
|
12
|
+
businessCollector: BusinessCollector;
|
|
13
|
+
wordbookSettingHandler: wordbookSettingHandler;
|
|
14
|
+
operationalFormHandler: ReturnType<typeof useOperationalForm>;
|
|
11
15
|
}): {
|
|
12
16
|
validate(path?: string | ((field: Field) => boolean), { force }?: {
|
|
13
17
|
force?: boolean | undefined;
|
|
14
18
|
}): Promise<void>;
|
|
15
19
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
16
|
-
setFormValues(values: AnyObject,
|
|
20
|
+
setFormValues(values: AnyObject, options?: boolean | {
|
|
21
|
+
needSplitExtendKey?: boolean | undefined;
|
|
22
|
+
avoidBusinessConnection?: string | boolean | undefined;
|
|
23
|
+
avoidDependKeyConnection?: string | boolean | undefined;
|
|
24
|
+
avoidWordbookSettingConnection?: string | boolean | undefined;
|
|
25
|
+
avoidOperationalFormConnection?: string | boolean | undefined;
|
|
26
|
+
overwrite?: boolean | undefined;
|
|
27
|
+
}, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
|
|
17
28
|
setFieldState(path: string, setter: (field: IFieldState) => void): void;
|
|
18
29
|
resetFields(path?: string): Promise<void>;
|
|
19
30
|
queryWidget(key: string): Promise<{
|
|
@@ -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
|
|
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
|
-
triggerDisabled: boolean;
|
|
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{
|
|
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};
|
|
@@ -25,21 +25,22 @@ export declare function useUrlConfigOptions(props: Partial<{
|
|
|
25
25
|
labelField: string;
|
|
26
26
|
valueField: string;
|
|
27
27
|
showField: string;
|
|
28
|
+
searchField: string[];
|
|
28
29
|
urlConfig: UrlConfig;
|
|
29
30
|
options: AnyObject[];
|
|
30
31
|
requestCache: boolean;
|
|
31
32
|
lazyRequest: boolean;
|
|
32
33
|
searchByValue: boolean;
|
|
33
34
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
34
|
-
labelKey:
|
|
35
|
+
labelKey: Ref<string>;
|
|
35
36
|
loading: Ref<boolean>;
|
|
36
|
-
showKey:
|
|
37
|
-
valueKey:
|
|
37
|
+
showKey: Ref<string | undefined>;
|
|
38
|
+
valueKey: Ref<string>;
|
|
38
39
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
39
40
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
40
41
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
41
|
-
fetchData: (content?: string, otherParams?: AnyObject, options?: {
|
|
42
|
-
avoidSearchContent?: boolean;
|
|
42
|
+
fetchData: (content?: string | undefined, otherParams?: AnyObject | undefined, options?: {
|
|
43
|
+
avoidSearchContent?: boolean | undefined;
|
|
43
44
|
}) => Promise<null | undefined>;
|
|
44
45
|
searchContent: Ref<string | undefined>;
|
|
45
46
|
};
|
|
@@ -53,15 +54,15 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
53
54
|
lazyRequest: boolean;
|
|
54
55
|
options: AnyObject[];
|
|
55
56
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
56
|
-
labelKey:
|
|
57
|
-
showKey: import("vue").ComputedRef<string | undefined>;
|
|
57
|
+
labelKey: Ref<string>;
|
|
58
58
|
loading: Ref<boolean>;
|
|
59
|
+
showKey: Ref<string | undefined>;
|
|
60
|
+
valueKey: Ref<string>;
|
|
59
61
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
60
|
-
valueKey: import("vue").ComputedRef<string>;
|
|
61
62
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
62
63
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
63
|
-
fetchData: (content?: string, otherParams?: AnyObject, options?: {
|
|
64
|
-
avoidSearchContent?: boolean;
|
|
64
|
+
fetchData: (content?: string | undefined, otherParams?: AnyObject | undefined, options?: {
|
|
65
|
+
avoidSearchContent?: boolean | undefined;
|
|
65
66
|
}) => Promise<null | undefined>;
|
|
66
67
|
searchContent: Ref<string | undefined>;
|
|
67
68
|
};
|
|
@@ -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};
|
|
@@ -4,6 +4,7 @@ export declare function useOperationalForm(props: {
|
|
|
4
4
|
operationalForm?: LowCodeTypes.operationalConfig[];
|
|
5
5
|
dateOperationalForm?: LowCodeTypes.dateOperationalConfig[];
|
|
6
6
|
}, formModel: Form): {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
trigger(fieldKey: string): void;
|
|
8
|
+
triggerAll(): void;
|
|
9
|
+
triggerDisabled: string | boolean;
|
|
9
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as e}from"@formily/path";import{format as t}from"date-fns";import{isNumber as o,isDate as a,isString as n}from"lodash-es";import{computed as i}from"vue";import{getOperationalFormHandler as l,getDateOperationalFormHandler as s}from"../../../../shared/utils/business.js";function m(m,d){const p=r=>d.getValuesIn(r);let u=!1;function f(r){return!0===u||u&&n(u)&&e.parse(u).match(r)}const{triggerAllOperationalFormHandler:c,operationalFormHandler:g}=l(i((()=>m.operationalForm)),p,((r,e)=>{f(r)||d.setValuesIn(r,e)})),{triggerAllDateOperationalFormHandler:y,dateOperationalFormHandler:F}=s(i((()=>m.dateOperationalForm)),p,((e,n)=>{var i,l,s;if(f(e))return;const m=d.query(e).take();if(!r(m))return;const[p]=m.component||[];if(["DATE","TIME"].includes(p)){const r=null!=(s=null==(l=null==(i=m.decoratorProps)?void 0:i.fieldItem)?void 0:l.date_format)?s:"yyyy-MM-dd";n=o(n)||a(n)?t(new Date(n),r):n}m.setValue(n)}));return{trigger(r){g(r),F(r)},triggerAll(){c(),y()},set triggerDisabled(r){u=r}}}export{m as useOperationalForm};
|
|
@@ -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,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LowCodeTypes } from '../../../../../es/shared/types';
|
|
2
|
+
import { Field, Form } from '@formily/core';
|
|
2
3
|
import { ContextCollector } from '../../../../../es/components/form-render';
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export declare class wordbookSettingHandler {
|
|
5
|
+
private formModel;
|
|
6
|
+
private changeContextCollector;
|
|
7
|
+
triggerDisabled: string | boolean;
|
|
8
|
+
constructor(formModel: Form, changeContextCollector: ContextCollector);
|
|
9
|
+
getWordbook(field: Field): LowCodeTypes.wordbook | undefined;
|
|
10
|
+
findFieldByLabel(formModel: Form, label: string): import("@formily/core").GeneralField | undefined;
|
|
11
|
+
trigger(fieldKey: string, value: unknown): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useWordbookSetting(): {
|
|
14
|
+
create: (formModel: Form, changeContextCollector: ContextCollector) => wordbookSettingHandler;
|
|
6
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as t}from"@formily/core";
|
|
1
|
+
import{isField as t}from"@formily/core";import{Path as r}from"@formily/path";import{isString as e}from"lodash-es";class i{constructor(t,r){this.formModel=t,this.changeContextCollector=r,this.triggerDisabled=!1}getWordbook(t){var r,e;return null==(e=null==(r=t.decoratorProps)?void 0:r.fieldItem)?void 0:e.wordbook}findFieldByLabel(t,r){return Object.values(t.fields).find((t=>t.title===r))}trigger(i,o){var n,l;if(!0===this.triggerDisabled)return;const s=this.formModel.query(i).take();if(!t(s))return;const a=this.getWordbook(s);(null==(l=null==(n=null==a?void 0:a.setting)?void 0:n.cascading)?void 0:l.length)&&a.setting.cascading.forEach((n=>{var l;const s=this.findFieldByLabel(this.formModel,n["form.name"]);if(!s||!t(s))return;if(this.triggerDisabled&&e(this.triggerDisabled)&&r.parse(this.triggerDisabled).match(s.path))return;const a=null==(l=this.changeContextCollector.getContext(i,o))?void 0:l.currentOption;a&&s.setValue(a[n.value])}))}}function o(){return{create:function(t,r){return new i(t,r)}}}export{o as useWordbookSetting,i as wordbookSettingHandler};
|
|
@@ -38,8 +38,10 @@ export declare type FormRenderExpose = {
|
|
|
38
38
|
* @param {object} values 值对象
|
|
39
39
|
* @param {{
|
|
40
40
|
* needSplitExtendKey?: boolean;
|
|
41
|
-
* avoidBusinessConnection?: boolean;
|
|
42
|
-
* avoidDependKeyConnection?: boolean;
|
|
41
|
+
* avoidBusinessConnection?: boolean|string;
|
|
42
|
+
* avoidDependKeyConnection?: boolean|string;
|
|
43
|
+
* avoidWordbookSettingConnection?: boolean|string;
|
|
44
|
+
* avoidOperationalFormConnection?: boolean|string;
|
|
43
45
|
* overwrite?: boolean;
|
|
44
46
|
* } | boolean} options 为了兼容旧的用法, 也可以直接传boolean值, 但是此用法即将移除
|
|
45
47
|
* ⭐️ 当值为对象时(推荐)
|
|
@@ -47,6 +49,8 @@ export declare type FormRenderExpose = {
|
|
|
47
49
|
* needSplitExtendKey, //是否将extendKey展开, 默认为true
|
|
48
50
|
* avoidBusinessConnection, // 赋值时是否规避业务联动, 默认为false
|
|
49
51
|
* avoidDependKeyConnection, // 赋值时是否规避依赖联动, 默认为true
|
|
52
|
+
* avoidWordbookSettingConnection, // 赋值时是否规避字典联动, 默认为true
|
|
53
|
+
* avoidOperationalFormConnection, // 赋值时是否规避操作联动, 默认为true
|
|
50
54
|
* overwrite // 是否对表单值进行全量覆盖, 默认为true
|
|
51
55
|
* }
|
|
52
56
|
* 🗑 当值为boolean时(即将移除此用法)
|
|
@@ -56,9 +60,10 @@ export declare type FormRenderExpose = {
|
|
|
56
60
|
*/
|
|
57
61
|
setFormValues(values: AnyObject, options?: Partial<{
|
|
58
62
|
needSplitExtendKey: boolean;
|
|
59
|
-
avoidBusinessConnection: boolean;
|
|
60
|
-
avoidDependKeyConnection: boolean;
|
|
61
|
-
avoidWordbookSettingConnection: boolean;
|
|
63
|
+
avoidBusinessConnection: boolean | string;
|
|
64
|
+
avoidDependKeyConnection: boolean | string;
|
|
65
|
+
avoidWordbookSettingConnection: boolean | string;
|
|
66
|
+
avoidOperationalFormConnection: boolean | string;
|
|
62
67
|
overwrite: boolean;
|
|
63
68
|
}> | boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): any;
|
|
64
69
|
/**
|
|
@@ -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,19 +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
|
-
dependKey?: import("../../../../../es/components/form-render").DependKeyType | undefined;
|
|
35
|
-
}>;
|
|
36
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{
|
|
1
|
+
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{getBindEventSettingTrigger as t}from"../../../../../shared/utils/business.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function e(){const e="bindEventSettingPlugin";return o({name:e,apply(o){o.configHooks.config.tap(e,(o=>{const e=o.onFormChange;return o.onFormChange=function(o){var i;const{column:r,row:s}=o,u=null==(i=r.editRender)?void 0:i.props;if(u&&(null==u?void 0:u.bindEventSetting)){u.bindEventSetting.forEach((n=>{t(n.event_type)(n,{getter:n=>s[n],setter:(n,t)=>s[n]=t})}))}n(e)&&e(o)},o}))}})}export{e as bindEventSettingPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function colorAndIconPlugin(): import("../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isFunction as o,isObject as n,isEmpty as r}from"lodash-es";import"../../index.js";import{getLowCodeFieldFromField as i}from"../utils/index.js";import{isMatchLowCodeCondition as t,isConditionsMatchSqlExpression as e}from"../../../../shared/utils/business.js";import{defineTablePlugin as l}from"../hooks/useTablePlugin.js";function s(){const s="colorAndIconPlugin";return l({name:s,apply(l){l.configHooks.config.tap(s,(l=>{const s=l.cellStyle;return l.cellStyle=l=>{var c,u;const{row:d,column:p}=l,a=o(s)?s(l)||{}:n(s)?s:{},f=i(p);if(!f)return a;const m=null!=(u=f.colorAndIcon)?u:null==(c=f.settingObj)?void 0:c.colorAndIcon;if(r(m))return a;const g=m.find((o=>{if(!o.condition)return!0;const n=o.condition.map((o=>t(d[o.field_key||p.field],o)));return e(n,o.sqlExpression)}));return g?Object.assign(a,{[`--color-and-icon-${"background"===g.colorType?"background-color":"color"}-type`]:g.color}):a},l}))}})}export{s as colorAndIconPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin/index.js";import*as t from"./defaultValuePlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as l from"./filterRenderPlugin/index.js";import*as g from"./filterVisibleEventPlugin.js";import*as o from"./forceArrowKeyPlugin.js";import*as u from"./headerPlugin.js";import*as a from"./highLightSetPlugin.js";import*as P from"./keyboardEventPlugin/index.js";import*as m from"./lowCodeFieldAdaptorPlugin/index.js";import*as x from"./maxCheckSizePlugin.js";import*as f from"./operationalFormPlugin/index.js";import*as p from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as j from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as R from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as c from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as w from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as W from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as v from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as S from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as k from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as C from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as y from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as A from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as E from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as D from"./rowClickPlugin/index.js";import*as F from"./rowDragPlugin/index.js";import*as V from"./rowGroupSettingPlugin/index.js";import*as q from"./varialbleHeightPlugin/index.js";import*as z from"./virtualTreePlugin/index.js";import*as G from"./wordbookSettingPlugin.js";import{separateMetaModule as H}from"../../../../shared/utils/index.js";var I=H(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./defaultConfigPlugin/index.ts":s,"./defaultValuePlugin.ts":t,"./filterDaterangeRenderPlugin/index.tsx":d,"./filterRenderPlugin/index.tsx":l,"./filterVisibleEventPlugin.ts":g,"./forceArrowKeyPlugin.ts":o,"./headerPlugin.tsx":u,"./highLightSetPlugin.tsx":a,"./keyboardEventPlugin/index.ts":P,"./lowCodeFieldAdaptorPlugin/index.tsx":m,"./maxCheckSizePlugin.ts":x,"./operationalFormPlugin/index.ts":f,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":p,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":j,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":R,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":b,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":c,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":w,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":h,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":W,"./rendererPlugins/widgets/checkRendererPlugin.tsx":v,"./rendererPlugins/widgets/colorRendererPlugin.tsx":S,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":k,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":C,"./rendererPlugins/widgets/labelRendererPlugin.tsx":y,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":A,"./rendererPlugins/widgets/seqRendererPlugin.tsx":E,"./rowClickPlugin/index.ts":D,"./rowDragPlugin/index.ts":F,"./rowGroupSettingPlugin/index.ts":V,"./varialbleHeightPlugin/index.tsx":q,"./virtualTreePlugin/index.ts":z,"./wordbookSettingPlugin.ts":G}));export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../../utils/index.js";import{
|
|
1
|
+
import"../../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../../utils/index.js";import{getOperationalFormHandler as a,getDateOperationalFormHandler as m}from"../../../../../shared/utils/business.js";import{defineTablePlugin as l}from"../../hooks/useTablePlugin.js";function u(){const u="operationalFormPlugin";return l({name:u,apply(l){l.configHooks.config.tap(u,(l=>{const u=l.onFormChange;return l.onFormChange=function(d){const{column:p,row:f,$table:c}=d;!function(n,u){const{operationalFormHandler:d}=a(l.operationalForm||l.operationForm,(o=>n[o]),((o,t)=>{u.getColumns().some((n=>n.field===o))&&(n[o]=t)})),{dateOperationalFormHandler:p}=m(l.dateOperationalForm,(o=>n[o]),((a,m)=>{const l=u.getColumns().find((o=>o.field===a));if(!l)return;const d=i(l);d&&[r.DATE,r.TIME].includes(s.getCellType(d))&&(m=t(m)||e(m)?o(new Date(m),d.valueFormat||"yyyy-MM-dd HH:mm:ss"):null),n[a]=m}));return function(o){d(o),p(o)}}(f,c)(p.field),n(u)&&u(d)},l}))}})}export{u as operationalFormPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createVNode as o,computed as e,mergeProps as r}from"vue";import{isString as n,isArray as t}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as d,IhoTableRenderHelper as a,createIhoTableClearActivedInterceptor as s}from"../../../../utils/index.js";import u from"./levelSearchCascade.vue.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function m(){const m="levelSearchCascadePlugin";return c({name:m,vxe(i){i.renderer.add(l.LEVEL_SEARCH_CASCADE,{renderCell:(e,{column:r,row:l})=>{const i=l[r.field];return n(i)?a(i):t(i)?a(function(o){var e,n,t;const l=d(r);if(!l)return"";const i=(null==(n=null==(e=l.wordbook)?void 0:e.show_key)?void 0:n[0])||(null==(t=l.componentProps)?void 0:t.labelField)||"text";return o.reduce(((o,e,r)=>0===r?e[i]:o+" / "+e[i]),"")}(i)):"";function a(e){return o("span",{title:e,class:"iho-table__colorAndIcon"},[e])}},renderEdit:a.createRenderEdit((({fieldItem:n,row:t,column:l,emitFormClick:i,emitFormChangeWithParams:d,rowIndex:a,columnIndex:s})=>{const c=e({get:()=>t[l.field],set(o){const e=t[l.field];t[l.field]=o,d({oldValue:e})}});return[o(u,r({value:c.value,"onUpdate:value":o=>c.value=o,options:n.options,wordbook:n.wordbook,autograph:n.autograph,onClick:i},n.componentProps,{fieldKey:l.field,payload:{row:t,column:l,rowIndex:a,columnIndex:s}}),null)]}))}),i.interceptor.add("event.clearActived",s(l.LEVEL_SEARCH_CASCADE,(o=>o.classList.contains("search-cascader__menuWrapper"))))},apply(o){i(o).bindAutoFocusConfig(m,l.LEVEL_SEARCH_CASCADE,"input")}})}export{m as levelSearchCascadePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as a,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isEmpty as d,isArray as c,isObject as p,omit as v,cloneDeep as f,xor as m}from"lodash-es";import{NSelect as y}from"naive-ui";import{useVModel as h,useDebounceFn as b}from"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as w}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as S}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as g}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{InjectionIhoTableUUID as F}from"../../../../constants/index.js";import{useIhoTableFormEvent as O}from"../../../../utils/index.js";import{getSelectOptions as k,selectOptionsMap as B}from"../hooks/useSelectOption.js";var j=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:j}){const x=l("$xetable"),$=h(e,"value",j),q=o(null),{emitFormChangeWithParams:C}=O({...e,$table:x}),K=t((()=>e.labelField)),
|
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as a,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isEmpty as d,isArray as c,isObject as p,omit as v,cloneDeep as f,xor as m}from"lodash-es";import{NSelect as y}from"naive-ui";import{useVModel as h,useDebounceFn as b}from"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as w}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as S}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as g}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{InjectionIhoTableUUID as F}from"../../../../constants/index.js";import{useIhoTableFormEvent as O}from"../../../../utils/index.js";import{getSelectOptions as k,selectOptionsMap as B}from"../hooks/useSelectOption.js";var j=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:j}){const x=l("$xetable"),$=h(e,"value",j),q=o(null),{emitFormChangeWithParams:C}=O({...e,$table:x}),K=t((()=>e.labelField)),A=t((()=>e.valueField)),R=t((()=>e.aliasField)),{fullOptions:M,filterOptions:P,searchContent:_,remoteOptions:D}=S(e,{labelKey:K,valueKey:A}),{modifyEvent:E,modifyAbleRef:H,getOptionsWithCreated:T}=w(e,{searchContent:_,labelKey:K,valueKey:A,valueRef:$,fullOptions:M}),V=t((()=>T(H.value?M.value:P.value))),W=o(!1),I=b((async function(l=""){_.value=l;try{if(W.value=!0,!s(e.queryOptions)||!d(e.options))return;D.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{W.value=!1}}),400),L=l(F);n((()=>z(!0)));const N=o(!1);function U(e){N.value=e,z(),I()}async function z(l=!1){var o,t,n;if(!e.multiple)return;await a();const{refTableLeftBody:r,refTableBody:u}=x.getRefMaps(),i=null==(o=null==r?void 0:r.value)?void 0:o.$el;if(!i)return;const s=null==(t=null==u?void 0:u.value)?void 0:t.$el,d=x.getRowid(e.row),c=null==(n=s.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:n.clientHeight;i.querySelector(`.vxe-body--row[rowid="${d}"]`).style.height=l?"unset":c+"px"}async function G(l,o){var t,n;const a=e.value;await E.updateValue(l,o);const r=k(L,e.column.field,e.row,x);L&&c(r)&&i(o).forEach((e=>{if(!p(e))return;const l=e;l.created&&l.shouldSave&&r.push(v(u(l),["created","shouldSave"]))}));const s=null==(t=e.column.editRender)?void 0:t.props;if(L&&(null==s?void 0:s.connectField)){const o=null==(n=s.connectField)?void 0:n.split(","),t=B.get(L);o.forEach((async o=>{var n;const{tableColumn:a}=x.reactData,r=a.find((e=>e.field===o)),u=null==(n=null==r?void 0:r.editRender)?void 0:n.props;if(null==u?void 0:u.queryOptions){const n=l?`${o}__${e.column.field}-${l}`:o;if(t[n])return;t[n]=await u.queryOptions({row:e.row,column:r,isFullData:!0,connectColumn:e.column})}}))}return C({oldValue:a,option:f(o)}),z()}function J(e){var l,o;"Tab"===e.key&&q.value&&(N.value?null==(o=(l=q.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}):x.internalData.isActivated=!0)}const{renderTag:Q,renderLabel:X,renderSelectAll:Y}=g(e,{labelKey:K,valueKey:A,valueRef:$,showKey:R,searchContent:_});function Z(l){if(!e.multiple)return;const o=l?V.value.map((e=>e[A.value])):[];if(!m(o,$.value).length)return;const t=$.value;$.value=o,C({oldValue:t,option:l?V.value:[]})}const ee=()=>({class:"iho-table__selectOption"}),le=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=()=>Y(Z)),r(y,{ref:q,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:W.value,options:V.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:I,clearable:!0,filterable:!0,nodeProps:ee,menuProps:le.value,renderTag:Q,renderLabel:X,show:N.value,onUpdateShow:U,onUpdateValue:G,onKeydown:J,onFocus:E.focus,onBlur:E.blur},l)}}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as l,onBeforeUnmount as n}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as C,selectOptionsMap as E}from"../hooks/useSelectOption.js";import{cloneDeep as g,isEqual as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as l,onBeforeUnmount as n}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as C,selectOptionsMap as E}from"../hooks/useSelectOption.js";import{cloneDeep as g,isEqual as h}from"lodash-es";import{defineTablePlugin as y}from"../../../../hooks/useTablePlugin.js";function b(){const b="selectRendererPlugin",x=e(new Map);function k(e){return!0===e||"1"===e}return y({name:b,vxe(e){e.interceptor.add("event.clearActived",u(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:l,column:n,$table:r}){var d;const u=o(s),c=C(u,n.field,l,r),p=m(l,e,c),f=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(d=e.componentProps)?void 0:d.indexedText));return[t("span",{title:a(n,f),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",t("br",null,null)]),e)),[]):f])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:n,row:i,column:r,$rowIndex:d,$table:u})=>{var a,c,p,m;const v=o(s),w=C(v,r.field,i,u),E=k(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),g=k(null!=(m=null==(p=e.componentProps)?void 0:p.allowCreate)?m:e.allowCreate)||E;return[t(f,l({queryOptions:e.queryOptions},e.componentProps,{options:w,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:E,allowCreate:g,onClick:n}),null)]}))})},apply(e){async function o(e,o={}){var t,l,n;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=w(i.options)||w(null==(l=i.componentProps)?void 0:l.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(n=i.queryOptions)?void 0:n.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(b,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(b,((e,{uuid:t})=>{if(t){E.get(t)||E.set(t,{}),x.set(t,g(e));const l=E.get(t);e.forEach((async t=>{var n;const i=null==(n=t.editRender)?void 0:n.props;t.field&&i&&"SELECT"===p.getCellType(i)&&(l[t.field]||v(e,t.field)||(l[t.field]=[],l[t.field]=await o(t)))}))}return e})),e.dataHooks.data.tap(b,((e,{uuid:t},l)=>{if(!t)return;const n=x.get(t);if(!n||!n.length)return;const i=E.get(t);n.forEach((async t=>{var l;const r=null==(l=t.editRender)?void 0:l.props;if(t.field&&r&&"SELECT"===p.getCellType(r)&&(null==r?void 0:r.connectField)){const l=r.connectField.split(","),s=e[r.columnName];l.forEach((async l=>{const d=null==n?void 0:n.find((e=>e.field===l));if(!d)return;const u=s?`${l}__${r.columnName}-${s}`:l;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(b,(e=>{n((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(E.delete(t),x.delete(t))}))})),e.eventHooks.onCellDblclick.tap(b,(({$table:e},o,{emits:t})=>{var l;const{column:n,row:i}=e.reactData.editStore.actived;if(!n||!i)return;const s=null==(l=n.editRender)?void 0:l.props,{cellDblclickSelectable:d=!1,multiple:u=!1,valueField:a="value"}=s.componentProps||{};if(!d||!function(e){return e&&p.getCellType(e)===r.SELECT}(s))return;const c=o.uuid&&C(o.uuid,n.field,i,e);if(1!==(null==c?void 0:c.length))return;const f=u?[c[0][a]]:c[0][a],m=i[n.field];e.clearEdit(),h(f,m)||(i[n.field]=f,t("formChange",{column:n,row:i,oldValue:m,value:f,index:e.getRowIndex(i),$table:e,option:c[0]}))}))}})}export{b as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as c,uniq as f,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as A,InjectionIhoTableHandler as h}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as R,getLowCodeFieldFromField as g,IhoTableRenderHelper as T,getRowHeight as D,getColumnRenderWidth as w,parseMergeField as b}from"../../../../utils/index.js";import P from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as x,getColumnInfoMaxLength as C,generateSeparateRowData as S,isSeparateColumn as k}from"./separateUtils.js";import{getSeparateInfo as H,setSeparateInfo as j,deleteSeparateInfo as M}from"../../../../utils/separateMap.js";import{defineTablePlugin as O}from"../../../../hooks/useTablePlugin.js";function F(){const F="separateRendererPlugins",I=e(new Map);return O({name:F,vxe(e){e.interceptor.add("event.clearActived",R(E.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(A),l=null!=(i=null==(n=H(u,r))?void 0:n.separateData)?i:{},s=g(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:d},[d])},renderEdit:T.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const c=t(A),f=H(c,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){if(!f)return[];if(f.ihoTableHandler=t(h),f.separateData["__"+n.field]=f.separateData["__"+n.field]||f.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}return a(m,{value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}():function(){var t;const o=null==(t=null==f?void 0:f.separateData)?void 0:t[n.field],r=l(e.separateFormatter)?e.separateFormatter(o):o;return[a(P,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==f?void 0:f.index,height:_,column:n,row:i,"display-content":r,onClick:u},E)]}()}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(F,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(F,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=g(t);if(!n||!n.separateRowEdit)return;const i=H(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:c}=t;if(u["__"+c]&&u["__"+c]!==u[c]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+c])?t:e[c]})),o=l[c];l[c]=d(l[c])?e:e.join(""),r("formChange",{value:l[c],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(F,((e,{uuid:t})=>(t&&I.set(t,e.reduce(((e,t)=>(i(t,(t=>{k(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(F,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=I.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await w(t,e,o,r),i={field:t.field,column:t,data:$(b(e,t),t,a,null==(n=g(t))?void 0:n.separateDeep)};l.push(i)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=g(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));c(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===f(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...x(o,r)):a[e]=c(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),c(C(l)).forEach(((r,n,i)=>{var u;const s=S(l,n),d={index:o,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void j(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=o,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(F,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(F,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return c();const r=I.get(t.uuid);if(!r||!r.length)return c();const{row:n,column:i}=e[0],u=H(t.uuid,n);if(!u)return c();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return c();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&c();function c(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(F,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(F,(e=>{n((()=>{e.value.uuid&&(I.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{F as separateRendererPlugins};
|
|
@@ -54,13 +54,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
isShow: import("vue").Ref<boolean>;
|
|
55
55
|
timePickerRef: import("vue").Ref<any>;
|
|
56
56
|
inputValue: import("vue").Ref<any>;
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
inputProps: import("vue").ComputedRef<{
|
|
58
|
+
style: string;
|
|
59
|
+
} | {
|
|
60
|
+
style?: undefined;
|
|
61
|
+
}>;
|
|
62
|
+
__formattedValue: import("vue").WritableComputedRef<any>;
|
|
59
63
|
placeholder: any;
|
|
60
64
|
valueFormat: any;
|
|
61
65
|
timeConfig: AnyObject;
|
|
62
66
|
clickShortcutOption: (item: string) => void;
|
|
63
|
-
onUpdateFormattedValue: (value: string) => void;
|
|
67
|
+
onUpdateFormattedValue: (value: string | null) => void;
|
|
64
68
|
isDisabled: (value: string) => boolean;
|
|
65
69
|
onChange: () => void;
|
|
66
70
|
onKeydown: (event: KeyboardEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,inject as t,ref as a,
|
|
1
|
+
import{defineComponent as e,useAttrs as l,inject as t,ref as a,computed as r,reactive as u,watch as o,nextTick as i,openBlock as n,createBlock as d,unref as c,withCtx as v,createVNode as m,mergeProps as s,isRef as f,createElementBlock as p,Fragment as h,renderList as y,createTextVNode as k,toDisplayString as b,createCommentVNode as w}from"vue";import{NPopover as _,NInput as g,NSpace as V,NScrollbar as C,NButton as F}from"naive-ui";import{useIhoTableFormEvent as x}from"../../../../utils/index.js";import D from"../../../../../../time-picker/index.js";import{parse as q,isValid as O,getHours as j,getMinutes as S,getSeconds as $,format as A}from"date-fns";var H=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:H}){const I=e,P=l(),R=t("$xetable"),{emitFormChangeWithParams:E}=x({...I,$table:R}),M=a(null),U=a(!1),z=a(),K=a(),N=r((()=>K.value&&L(K.value)?{style:"text-decoration: line-through"}:{})),T=r({get(){if(!K.value)return null;const e=q(K.value,G.valueFormat,new Date);return O(e)?K.value:I.formattedValue?I.formattedValue:null},set(e){J(e)}}),{placeholder:W="请选择",valueFormat:B="HH:mm"}=P,G=u({...P,placeholder:W,valueFormat:B,format:B});function J(e){if(K.value=e||"",e&&L(e))return;const l=I.formattedValue;l!==e&&(H("update:formattedValue",e),E({oldValue:l}))}function L(e){var l,t,a;const r=q(e,G.format,new Date),u=j(r),o=S(r),i=$(r),n=null==(l=G.isHourDisabled)?void 0:l.call(G,u),d=null==(t=G.isMinuteDisabled)?void 0:t.call(G,o,u),c=null==(a=G.isSecondDisabled)?void 0:a.call(G,i,o,u);return!!n||(!!d||!!c)}function Q(){[G.valueFormat.replace(/[^\w]/g,""),G.valueFormat].some((e=>{const l=q(K.value,e,new Date);if(!K.value||O(l)){return J(K.value?A(l,G.valueFormat):null),!0}return!1}))}function X(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=M.value)||l.blur(),U.value=!1)}return o((()=>I.formattedValue),(e=>{if(!e)return"";K.value=e}),{immediate:!0}),o((()=>U.value),(async e=>{var l,t,a,r,u;e&&(await i(),null==(u=null==(r=null==(a=null==(t=null==(l=z.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(l,t)=>(n(),d(c(_),{show:U.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[4]||(t[4]=()=>U.value=!1)},{trigger:v((()=>[m(c(g),{ref_key:"formRef",ref:M,clearable:"",placeholder:c(W),value:K.value,"onUpdate:value":t[0]||(t[0]=e=>K.value=e),valueModifiers:{trim:!0},"input-props":c(N),onClick:t[1]||(t[1]=()=>U.value=!0),onChange:Q,onKeydown:X},null,8,["placeholder","value","input-props"])])),default:v((()=>[m(c(V),null,{default:v((()=>[m(c(D),s({ref_key:"timePickerRef",ref:z,show:""},c(G),{class:"iho-table__time-picker",to:!1,"formatted-value":c(T),"onUpdate:formatted-value":t[2]||(t[2]=e=>f(T)?T.value=e:null),onConfirm:t[3]||(t[3]=()=>U.value=!1)}),null,16,["formatted-value"]),m(c(C),{class:"iho-table__scrollbar"},{default:v((()=>[e.shortcutOptions.length?(n(),d(c(V),{key:0,vertical:"",wrap:!1},{default:v((()=>[(n(!0),p(h,null,y(e.shortcutOptions,(e=>(n(),d(c(F),{size:"tiny",key:e,disabled:L(e),onClick:l=>function(e){J(e),U.value=!1}(e)},{default:v((()=>[k(b(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):w("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{H as default};
|