cnhis-design-vue 3.1.53-hotfix.0 → 3.1.53-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/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +4 -4
- package/es/components/big-table/src/hooks/useEdit.d.ts +4 -4
- package/es/components/big-table/src/hooks/useSeparateRow.d.ts +4 -4
- package/es/components/button-print/src/utils/dialog.d.ts +2 -2
- package/es/components/button-print/src/utils/print.d.ts +14 -13
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +69 -6
- package/es/components/card-reader-sdk/src/types/index.d.ts +3 -3
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/form-config/index.d.ts +98 -26
- package/es/components/form-config/src/FormConfig.vue.d.ts +99 -27
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +30 -6
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +48 -12
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/index.d.ts +30 -6
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +31 -7
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +31 -7
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/index.js +1 -1
- package/es/components/form-render/src/components/renderer/inputNumber.d.ts +5 -5
- package/es/components/form-render/src/components/renderer/{levelSearchCascader.d.ts → levelSearchCascader/index.d.ts} +3 -5
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -0
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +4 -4
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +3 -2
- package/es/components/form-render/src/hooks/index.d.ts +0 -2
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.d.ts +3 -3
- package/es/components/form-render/src/hooks/useCommonInjection.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
- package/es/components/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +3 -3
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +9 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +5 -5
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +4 -26
- package/es/components/form-render/src/types/index.d.ts +7 -14
- package/es/components/form-render/src/utils/index.d.ts +1 -2
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/form-render/src/utils/schema.d.ts +2 -2
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/guide/src/renderer.js +1 -1
- package/es/components/iho-table/index.d.ts +39 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +40 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +4 -1
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +2 -2
- package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +552 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +4 -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/editSeparate.vue.d.ts +2 -2
- package/es/components/iho-table/src/plugins/wordbookSettingPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/wordbookSettingPlugin.js +1 -0
- package/es/components/iho-table/src/types/index.d.ts +7 -2
- package/es/components/iho-table/src/types/pluginType.d.ts +3 -3
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +97 -29
- package/es/components/info-header/src/InfoHeader.vue.d.ts +98 -30
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +9 -5
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +10 -6
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +41 -13
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +30 -6
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/search-cascader/index.d.ts +23 -3
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +24 -4
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/search-cascader/src/components/ClearIcon.vue.js +1 -0
- package/es/components/shortcut-setter/index.d.ts +33 -9
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +34 -10
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +4 -4
- package/es/shared/components/SlotRender/SlotRender.d.ts +5 -5
- package/es/shared/hooks/index.d.ts +3 -0
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/selectHooks/index.d.ts +4 -0
- package/es/shared/hooks/selectHooks/index.js +1 -0
- package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +10 -0
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -0
- package/es/shared/hooks/selectHooks/useSearchContent.d.ts +6 -0
- package/es/shared/hooks/selectHooks/useSearchContent.js +1 -0
- package/es/shared/hooks/selectHooks/useSelectAllowModify.d.ts +23 -0
- package/es/shared/hooks/selectHooks/useSelectAllowModify.js +1 -0
- package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +19 -0
- package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -0
- package/es/shared/hooks/{useAsyncQueue.d.ts → useAsyncQueue/index.d.ts} +7 -15
- package/es/shared/hooks/useAsyncQueue/index.js +1 -0
- package/es/shared/hooks/useAsyncQueue/types.d.ts +20 -0
- package/es/shared/hooks/useAsyncQueue/types.js +1 -0
- package/es/shared/hooks/useDateTime.d.ts +2 -2
- package/es/shared/hooks/useFormRequest/index.d.ts +24 -0
- package/es/shared/hooks/useFormRequest/index.js +1 -0
- package/es/shared/hooks/useFormRequest/types.d.ts +39 -0
- package/es/shared/hooks/useFormRequest/types.js +1 -0
- package/es/shared/hooks/useLevelSearchCascader.d.ts +31 -0
- package/es/shared/hooks/useLevelSearchCascader.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +24 -0
- package/es/shared/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +0 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +0 -16
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +0 -1
- package/es/components/form-render/src/hooks/useFormRequest.d.ts +0 -26
- package/es/components/form-render/src/hooks/useFormRequest.js +0 -1
- package/es/shared/hooks/useAsyncQueue.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,ref as
|
|
1
|
+
import{defineComponent as e,computed as o,ref as t,onDeactivated as a,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as h,NInput as V}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const k=i(),w=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let t=o;s(e.modelValue)&&(t={...e.modelValue,content:o}),g("update:modelValue",t)}}),x=t(!1),T=o({get:()=>x.value,async set(e){x.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=t(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),T.value&&b.value?T.value=!1:u(w)||(y=setTimeout((()=>{b.value=T.value=!0}),200))}function j(e){e.stopPropagation(),clearTimeout(y),u(w)&&(T.value=!0,b.value=!0)}function M(e){e.stopPropagation(),clearTimeout(_),u(w)&&(T.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(w)&&!b.value&&(_=setTimeout((()=>{T.value=!1}),300))}return a((()=>{T.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(w)}],style:{"--icon-right":"-5",...k.value},"annotation-hover-show":!u(w)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:T.value,"onUpdate:show":e=>T.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:R,onMouseenter:M},[l("div",null,[b.value?l(V,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:w.value,"onUpdate:value":e=>w.value=e},null):l("span",null,[u(w)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:R,onMouseenter:M,onDblclick:j,onClick:P},[l(h,{component:u(w)?d:v},null)])}})])}}});export{g as default};
|
|
@@ -60,19 +60,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
60
|
style: CSSProperties;
|
|
61
61
|
SlotRender: import("vue").DefineComponent<{
|
|
62
62
|
renderer: {
|
|
63
|
-
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").
|
|
63
|
+
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").AnyFn<any[], any>>;
|
|
64
64
|
required: true;
|
|
65
65
|
};
|
|
66
66
|
rootSlots: {
|
|
67
|
-
type: PropType<Record<string, import("../../../../../../es/shared/types").
|
|
67
|
+
type: PropType<Record<string, import("../../../../../../es/shared/types").AnyFn<any[], any>>>;
|
|
68
68
|
};
|
|
69
69
|
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
70
|
renderer: {
|
|
71
|
-
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").
|
|
71
|
+
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").AnyFn<any[], any>>;
|
|
72
72
|
required: true;
|
|
73
73
|
};
|
|
74
74
|
rootSlots: {
|
|
75
|
-
type: PropType<Record<string, import("../../../../../../es/shared/types").
|
|
75
|
+
type: PropType<Record<string, import("../../../../../../es/shared/types").AnyFn<any[], any>>>;
|
|
76
76
|
};
|
|
77
77
|
}>>, {}>;
|
|
78
78
|
NPopover: any;
|
|
@@ -252,19 +252,19 @@ export declare const comps: {
|
|
|
252
252
|
style: import("vue").CSSProperties;
|
|
253
253
|
SlotRender: import("vue").DefineComponent<{
|
|
254
254
|
renderer: {
|
|
255
|
-
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").
|
|
255
|
+
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").AnyFn<any[], any>>;
|
|
256
256
|
required: true;
|
|
257
257
|
};
|
|
258
258
|
rootSlots: {
|
|
259
|
-
type: import("vue").PropType<Record<string, import("../../..").
|
|
259
|
+
type: import("vue").PropType<Record<string, import("../../..").AnyFn<any[], any>>>;
|
|
260
260
|
};
|
|
261
261
|
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
262
262
|
renderer: {
|
|
263
|
-
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").
|
|
263
|
+
type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").AnyFn<any[], any>>;
|
|
264
264
|
required: true;
|
|
265
265
|
};
|
|
266
266
|
rootSlots: {
|
|
267
|
-
type: import("vue").PropType<Record<string, import("../../..").
|
|
267
|
+
type: import("vue").PropType<Record<string, import("../../..").AnyFn<any[], any>>>;
|
|
268
268
|
};
|
|
269
269
|
}>>, {}>;
|
|
270
270
|
NPopover: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, AnyFn } from '../../../../../es/shared/types';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
import { VxeTableEvents, VxeTableInstance } from 'vxe-table';
|
|
4
4
|
import { VxeTablePropTypes } from 'vxe-table/types/table';
|
|
5
5
|
export declare class SeparateHandle {
|
|
6
|
-
callbacks: Set<
|
|
7
|
-
add(cb:
|
|
8
|
-
remove(cb:
|
|
6
|
+
callbacks: Set<AnyFn<any[], any>>;
|
|
7
|
+
add(cb: AnyFn): void;
|
|
8
|
+
remove(cb: AnyFn): void;
|
|
9
9
|
clear(): void;
|
|
10
10
|
trigger(): void;
|
|
11
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyFn } from '../../../../../es/shared/types';
|
|
2
2
|
import { ComponentInternalInstance } from 'vue';
|
|
3
3
|
export declare class IdentityVerificationDialog {
|
|
4
4
|
rendered: boolean;
|
|
5
5
|
static createMsg(message: string): string;
|
|
6
|
-
show(instance: ComponentInternalInstance, title: string, api:
|
|
6
|
+
show(instance: ComponentInternalInstance, title: string, api: AnyFn, formatId?: string, templateId?: string): Promise<string>;
|
|
7
7
|
}
|
|
8
8
|
export declare class PreviewDialog {
|
|
9
9
|
rendered: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, AnyFn } from '../../../../../es/shared/types';
|
|
2
2
|
import { IdentityVerificationDialog, PreviewDialog } from '../../../../../es/components/button-print/src/utils/dialog';
|
|
3
3
|
export declare class Print {
|
|
4
4
|
private readonly webview;
|
|
@@ -26,15 +26,15 @@ export declare class Print {
|
|
|
26
26
|
_queryServicesPrint(params: AnyObject): Promise<any>;
|
|
27
27
|
_callPrintWithFile(queryParams: AnyObject): Promise<any>;
|
|
28
28
|
_handleMonitorNotify(message: string | unknown): void;
|
|
29
|
-
_handleResult(data: AnyObject, errorCallbackFn?:
|
|
30
|
-
_handleResultTest(result: unknown, errorCallbackFn?:
|
|
31
|
-
_handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?:
|
|
29
|
+
_handleResult(data: AnyObject, errorCallbackFn?: AnyFn): false | AnyObject;
|
|
30
|
+
_handleResultTest(result: unknown, errorCallbackFn?: AnyFn): boolean;
|
|
31
|
+
_handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?: AnyFn): Promise<false | {
|
|
32
32
|
file: any;
|
|
33
33
|
printerName: any;
|
|
34
34
|
pageCount: any;
|
|
35
35
|
formatId: string;
|
|
36
36
|
}>;
|
|
37
|
-
_handleQueryPrintDataResult(printData: AnyObject, formatId: string, errorCallbackFn?:
|
|
37
|
+
_handleQueryPrintDataResult(printData: AnyObject, formatId: string, errorCallbackFn?: AnyFn): false | {
|
|
38
38
|
file: any;
|
|
39
39
|
printerName: any;
|
|
40
40
|
pageCount: any;
|
|
@@ -45,21 +45,22 @@ export declare class Print {
|
|
|
45
45
|
_queryProxyOrigin(): Promise<void>;
|
|
46
46
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
47
47
|
_browserPrint(result: AnyObject, mode: string): Promise<string | void>;
|
|
48
|
-
preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?:
|
|
49
|
-
|
|
48
|
+
preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
|
|
49
|
+
printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
|
|
50
|
+
printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, mode?: string): Promise<any>;
|
|
50
51
|
private _downloadPDF;
|
|
51
52
|
/**
|
|
52
53
|
* 下载pdf
|
|
53
54
|
*/
|
|
54
|
-
downloadPDF(params: AnyObject, onResolve:
|
|
55
|
-
print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?:
|
|
56
|
-
queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?:
|
|
55
|
+
downloadPDF(params: AnyObject, onResolve: AnyFn, onReject: AnyFn): void;
|
|
56
|
+
print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
|
|
57
|
+
queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | {
|
|
57
58
|
file: any;
|
|
58
59
|
printerName: any;
|
|
59
60
|
pageCount: any;
|
|
60
61
|
formatId: string;
|
|
61
62
|
}>;
|
|
62
|
-
printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?:
|
|
63
|
-
editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?:
|
|
64
|
-
addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?:
|
|
63
|
+
printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | AnyObject>;
|
|
64
|
+
editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
|
|
65
|
+
addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
|
|
65
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),m=`${window.location.protocol}//${window.location.host}`,u=`${m}/fdp-api/print/assembly/printIReport`,c=`${m}/bi-api/reprot/print/open/client/getRemote`,p=`${m}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,signature:r,printdlgshow:a="0",nobillnode:o="1",btnprint:l="1",messageTimeout:h=0}){const m={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:o,printdlgshow:a,btnprint:l,messageTimeout:h,...r?{signature:r}:{}};if(n){try{n=JSON.parse(n)}catch(t){}m.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");m.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(m)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:c})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=m+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",signature:s,btnprint:n,messageTimeout:l=0},d,h){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==h?void 0:h("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==d||d({file:t}))}await this._queryProxyOrigin();const m=await this._testConnection();if(!this._handleResultTest(m,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",signature:s,btnprint:n,messageTimeout:l}),a=this._handleResult(r,h);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==d||d(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,signature:n,printdlgshow:o,nobillnode:l,isDownloadFile:d=!0,messageTimeout:h=0},m,u,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==m||m({file:t}))):null==u?void 0:u("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,signature:n,printdlgshow:o,nobillnode:l,messageTimeout:h}),a=this._handleResult(r,u);if(!a)return!1;d&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==m||m(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
|
|
1
|
+
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,u=`${c}/fdp-api/print/assembly/printIReport`,m=`${c}/bi-api/reprot/print/open/client/getRemote`,p=`${c}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,signature:r,printdlgshow:a="0",nobillnode:o="1",btnprint:l="1",messageTimeout:h=0}){const c={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:o,printdlgshow:a,btnprint:l,messageTimeout:h,...r?{signature:r}:{}};if(n){try{n=JSON.parse(n)}catch(t){}c.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");c.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(c)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:m})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",signature:s,btnprint:n,messageTimeout:l=0},d,h){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==h?void 0:h("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==d||d({file:t}))}await this._queryProxyOrigin();const c=await this._testConnection();if(!this._handleResultTest(c,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",signature:s,btnprint:n,messageTimeout:l}),a=this._handleResult(r,h);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==d||d(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const s=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=l(),n=await this.messageCollect(t,{exec:"printA",data:s});if(n&&Array.isArray(n)){n.some((t=>"success"===t.res.result))?null==e||e(n):(null==i||i(n),this._handleMonitorNotify(n))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(n||""),null==i||i({type:"printError",message:t,result:!1,errinfo:t})}}catch(t){const e={error:t,message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,signature:n,printdlgshow:o,nobillnode:l,isDownloadFile:d=!0,messageTimeout:h=0},c,u,m="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,m),void(null==c||c({file:t}))):null==u?void 0:u("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,signature:n,printdlgshow:o,nobillnode:l,messageTimeout:h}),a=this._handleResult(r,u);if(!a)return!1;d&&["downloadPDF"].includes(m)&&await this._browserPrint(a,m),null==c||c(a)}catch(t){const e="printDirect"===m?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
|
|
@@ -115,13 +115,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
115
115
|
lifeCycle: {
|
|
116
116
|
type: import("vue").PropType<Partial<{
|
|
117
117
|
onSetup(): void;
|
|
118
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
119
|
+
field: import("@formily/core").GeneralField;
|
|
120
|
+
oldValue: unknown;
|
|
121
|
+
}): any;
|
|
118
122
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
119
123
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
120
124
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
121
125
|
}>>;
|
|
122
126
|
};
|
|
123
127
|
requestInstance: {
|
|
124
|
-
type: import("vue").PropType<import("
|
|
128
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
125
129
|
};
|
|
126
130
|
enterToNextWidget: {
|
|
127
131
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -260,13 +264,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
260
264
|
lifeCycle: {
|
|
261
265
|
type: import("vue").PropType<Partial<{
|
|
262
266
|
onSetup(): void;
|
|
267
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
268
|
+
field: import("@formily/core").GeneralField;
|
|
269
|
+
oldValue: unknown;
|
|
270
|
+
}): any;
|
|
263
271
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
264
272
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
265
273
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
266
274
|
}>>;
|
|
267
275
|
};
|
|
268
276
|
requestInstance: {
|
|
269
|
-
type: import("vue").PropType<import("
|
|
277
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
270
278
|
};
|
|
271
279
|
enterToNextWidget: {
|
|
272
280
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -320,7 +328,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
320
328
|
changeContextCollector: import("../../../../../../es/components/form-render").ContextCollector;
|
|
321
329
|
formUUID: string;
|
|
322
330
|
anchorBarRef: import("vue").Ref<{
|
|
323
|
-
syncBarPosition: import("../../../..").
|
|
331
|
+
syncBarPosition: import("../../../..").AnyFn<any[], any>;
|
|
324
332
|
} | undefined>;
|
|
325
333
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
326
334
|
updateAnchorList: (field: import("@formily/core").GeneralField) => void;
|
|
@@ -329,13 +337,21 @@ export declare const CallbackMaps: Map<string, {
|
|
|
329
337
|
title: string;
|
|
330
338
|
}[]>;
|
|
331
339
|
onScroll: (scrollEvent: Event) => void;
|
|
332
|
-
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
340
|
+
callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
333
341
|
onSetup(): void;
|
|
342
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
343
|
+
field: import("@formily/core").GeneralField;
|
|
344
|
+
oldValue: unknown;
|
|
345
|
+
}): any;
|
|
334
346
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
335
347
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
336
348
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
337
349
|
}>>[T]> | undefined) => import("../../../..").UndefinedAble<ReturnType<Required<Partial<{
|
|
338
350
|
onSetup(): void;
|
|
351
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
352
|
+
field: import("@formily/core").GeneralField;
|
|
353
|
+
oldValue: unknown;
|
|
354
|
+
}): any;
|
|
339
355
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
340
356
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
341
357
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
@@ -428,12 +444,16 @@ export declare const CallbackMaps: Map<string, {
|
|
|
428
444
|
uuid: string;
|
|
429
445
|
lifeCycle: Partial<{
|
|
430
446
|
onSetup(): void;
|
|
447
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
448
|
+
field: import("@formily/core").GeneralField;
|
|
449
|
+
oldValue: unknown;
|
|
450
|
+
}): any;
|
|
431
451
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
432
452
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
433
453
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
434
454
|
}>;
|
|
435
455
|
businessFormatter: import("../../../../../../es/components/form-render").FormBusinessFormatter;
|
|
436
|
-
requestInstance: import("
|
|
456
|
+
requestInstance: import("../../../..").FormRequestDefine.RequestInstance;
|
|
437
457
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
438
458
|
lowCodeReactions: import("../../../..").FormLowCodeReactions.Config[];
|
|
439
459
|
linebarAutoHidden: boolean;
|
|
@@ -835,13 +855,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
835
855
|
lifeCycle: {
|
|
836
856
|
type: import("vue").PropType<Partial<{
|
|
837
857
|
onSetup(): void;
|
|
858
|
+
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
859
|
+
field: import("@formily/core").GeneralField;
|
|
860
|
+
oldValue: unknown;
|
|
861
|
+
}): any;
|
|
838
862
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
839
863
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
840
864
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
841
865
|
}>>;
|
|
842
866
|
};
|
|
843
867
|
requestInstance: {
|
|
844
|
-
type: import("vue").PropType<import("
|
|
868
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
845
869
|
};
|
|
846
870
|
enterToNextWidget: {
|
|
847
871
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -915,6 +939,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
915
939
|
annotation: {
|
|
916
940
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
917
941
|
};
|
|
942
|
+
requestInstance: {
|
|
943
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
944
|
+
};
|
|
945
|
+
uniqueCacheData: {
|
|
946
|
+
type: BooleanConstructor;
|
|
947
|
+
default: boolean;
|
|
948
|
+
};
|
|
949
|
+
parallelism: {
|
|
950
|
+
type: NumberConstructor;
|
|
951
|
+
default: number;
|
|
952
|
+
};
|
|
918
953
|
}, {
|
|
919
954
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
920
955
|
tableConfig: {
|
|
@@ -932,6 +967,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
932
967
|
annotation: {
|
|
933
968
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
934
969
|
};
|
|
970
|
+
requestInstance: {
|
|
971
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
972
|
+
};
|
|
973
|
+
uniqueCacheData: {
|
|
974
|
+
type: BooleanConstructor;
|
|
975
|
+
default: boolean;
|
|
976
|
+
};
|
|
977
|
+
parallelism: {
|
|
978
|
+
type: NumberConstructor;
|
|
979
|
+
default: number;
|
|
980
|
+
};
|
|
935
981
|
}>> & {
|
|
936
982
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
937
983
|
onCopy?: ((...args: any[]) => any) | undefined;
|
|
@@ -1006,6 +1052,10 @@ export declare const CallbackMaps: Map<string, {
|
|
|
1006
1052
|
}>;
|
|
1007
1053
|
eventListener: import("../../../../iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
1008
1054
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange", ...args: any[]) => void;
|
|
1055
|
+
asyncQueue: import("../../../..").AsyncQueue<import("../../../..").FormRequestDefine.AsyncQueueItem, any, {
|
|
1056
|
+
label: string;
|
|
1057
|
+
value: unknown;
|
|
1058
|
+
}[]>;
|
|
1009
1059
|
hooks: Readonly<{
|
|
1010
1060
|
configHooks: import("../../../../../../es/components/iho-table").AbstractConfigHooks;
|
|
1011
1061
|
fieldHooks: import("../../../../../../es/components/iho-table").AbstractFieldHooks;
|
|
@@ -5557,6 +5607,17 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5557
5607
|
annotation: {
|
|
5558
5608
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
5559
5609
|
};
|
|
5610
|
+
requestInstance: {
|
|
5611
|
+
type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
|
|
5612
|
+
};
|
|
5613
|
+
uniqueCacheData: {
|
|
5614
|
+
type: BooleanConstructor;
|
|
5615
|
+
default: boolean;
|
|
5616
|
+
};
|
|
5617
|
+
parallelism: {
|
|
5618
|
+
type: NumberConstructor;
|
|
5619
|
+
default: number;
|
|
5620
|
+
};
|
|
5560
5621
|
}>> & {
|
|
5561
5622
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
5562
5623
|
onCopy?: ((...args: any[]) => any) | undefined;
|
|
@@ -5625,6 +5686,8 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5625
5686
|
onRowDrag?: ((...args: any[]) => any) | undefined;
|
|
5626
5687
|
}, {
|
|
5627
5688
|
fieldList: import("../../../../../../es/components/iho-table").LowCodeTableFieldItem[];
|
|
5689
|
+
parallelism: number;
|
|
5690
|
+
uniqueCacheData: boolean;
|
|
5628
5691
|
tableConfig: import("../../../../../../es/components/iho-table").IhoTableConfig;
|
|
5629
5692
|
tableData: import("../../../..").AnyObject[];
|
|
5630
5693
|
}>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, AnyFn, NumberRange } from '../../../../../es/shared/types';
|
|
2
2
|
import { TRANS_CMD } from '../../../../../es/components/card-reader-sdk/src/constants';
|
|
3
3
|
export declare namespace InsuranceType {
|
|
4
4
|
export type ExecType = 'hisyb' | 'login';
|
|
5
5
|
export type IHOWindow = Window & {
|
|
6
6
|
chrome: {
|
|
7
7
|
webview: {
|
|
8
|
-
addEventListener: (type: string, handler:
|
|
9
|
-
removeEventListener: (type: string, handler:
|
|
8
|
+
addEventListener: (type: string, handler: AnyFn) => void;
|
|
9
|
+
removeEventListener: (type: string, handler: AnyFn) => void;
|
|
10
10
|
postMessage: (payload: any) => void;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as n,openBlock as o,createBlock as r,unref as u,isRef as i,createSlots as d,renderList as s,withCtx as p,renderSlot as m,nextTick as v}from"vue";import{NDatePicker as f}from"naive-ui";import"../../../shared/utils/index.js";import{isString as c,isArray as y}from"lodash-es";import{useDateTime as h}from"../../../shared/hooks/useDateTime.js";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{format as g}from"date-fns";var V=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String}},emits:["update:formatted-value"],setup(e,{expose:V,emit:w}){const I=e,R=t(),k=a(null),D=a(null),C=a(),M=l({get:()=>x(I.formattedValue)?null:I.formattedValue,set(e){w("update:formatted-value",e,c(e)?Date.parse(e):y(e)?[Date.parse(e[0]),Date.parse(e[1])]:null)}}),S=l((()=>{const e=Reflect.get(R,"type")||"";return["datetime","datetimerange"].includes(e)})),E=l((()=>{if(Reflect.get(R,"format"))return R.format;const e=R.type||"";return S.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),P=l((()=>S.value?E.value.split(" "):"")),{focus:U,blur:$,handleConfirm:_}=h(k,{formatRef:E,attrs:R,emit:w,allowedInvalidValue:I.allowedInvalidValue});function b(e){e&&S.value&&v((()=>{var e;D.value=null==(e=k.value)?void 0:e.panelInstRef,h(D,{formatRef:P,attrs:R,isPanel:!0})}))}async function j(...e){var t,a,l,n,o,r;const u=Reflect.get(R,"type")||"",i=null==(n=null==(l=null==(a=null==(t=k.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(u.includes("range")?null==(o=I.onConfirm)||o.call(I,...e):(await v(),i.focus(),_(i),i.blur(),null==(r=I.onConfirm)||r.call(I,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!I.updateUnchangedValue||u.includes("range"))return;const d=i.value;i.value=g(new Date,E.value),i.dispatchEvent(new InputEvent("input")),i.value=d,i.dispatchEvent(new InputEvent("input"))}function x(e){return I.allowedInvalidValue&&I.allowedInvalidValue===e}return n((()=>I.formattedValue),(e=>{C.value=x(e)?e:I.placeholder?I.placeholder:"选择日期时间"}),{immediate:!0}),V({$datePicker:k,focus:U,blur:$}),(e,t)=>(o(),r(u(f),{ref_key:"datePickerRef",ref:k,"onUpdate:show":b,onConfirm:j,placeholder:C.value,"formatted-value":u(M),"onUpdate:formatted-value":t[0]||(t[0]=e=>i(M)?M.value=e:null)},d({_:2},[s(e.$slots,((t,a)=>({name:a,fn:p((()=>[m(e.$slots,a)]))})))]),1032,["placeholder","formatted-value"]))}});export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"../useEvent.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function g(g,d,p,f,m,v,y,w,S,Y,b,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(g,p,d),{originY:V,endY:L,originX:k,endX:E,xCellWidth:M,yCellHeight:W,left:G,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:I,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P}=d;function z(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let c=H,d=k;"right"===s&&(c=E,d=E+(null!=(r=null==B?void 0:B.width)?r:0));const p=[],f=A&&"right"!==s?o.length-1:o.length,m=(d-c)/f,v=m+(d-c)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:c,showMaxMinNumber:d,style:p,title:f}=n,m=l({width:k-H,height:A,...D},{value:`${f}`,...i,...p||{}},{left:H,top:R.originY}),v=e([H,R.originY,k,R.originY],D),y=[];if(s||h){const{lineXMain:e,textLeft:i}=u(c,H,k-H),l=o.length;o.forEach(((o,u)=>{let c=R.endY-u*W*r;if(0===u&&(c=L-5),!h||(0===u||u===l-1)&&!d||y.push(a(o,n,i,c)),s&&0!==u){const[i,n]=e,o=new t.Line([i,c,n,c],{...D,...p});y.push(o)}}))}g.value.add(v,m,...y),m.sendToBack()}(o);const d=[],f=0===r?v:m,y=0===r?c:v+c+(r-1)*m,w="right"===s?0:O.originY,S="right"===s?$:O.endY,Y=r>0?e([y,w,y,S],{objectCaching:!1,...D}):null;Y&&d.push(Y);const b=y+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:X,position:N,showMaxMinNumber:T,detailedList:E=[],showdetailedScale:M,showRange:G=[]}=o;if(C||X){const[t,e]=G,{lineXMain:i,lineXSub:n,textLeft:l}=u(N,y,f),r=(x[1]-x[0])/2,s=M&&!E.length?x.reduce(((t,e,i)=>{const n=t[t.length-1];return 0===i?[e]:t.concat([n+r,n+2*r])}),[]):M&&(null==E?void 0:E.length)?E:x,c=s.length;s.forEach(((r,s)=>{if(t&&+r<t)return;if(e&&+r>e)return;const u=O.endY-s*W*(M?j/2:j);if(X&&(!(0===s||s===c-1)||T)){const t=0==s?u-5:u,e=a(r,o,l,t),i=O.originY+e.height/2;t<i&&e.set({top:i}),d.push(e)}d.push(...h(o,s,i,n,u,W,O.originY))}))}let I=o.title||"";o.unit&&(I+="\n"+o.unit);let B=O.originY+W;0!==_&&P[0]>1&&(B=V+W*P[0]/2),I&&d.push(new t.Text(String(I),{...i,left:b,top:B,textAlign:"center",...o.style}));const J=new t.Group(d,{...n,objectCaching:!1});p.push(J)}));const y=p.length>0?new t.Group([...p],{...n,objectCaching:!1}):null;y&&g.value.add(y),y&&y.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=L;const i=H-G.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:r(t.bigType),_type:t.bigType},...d.event}});var a;e-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(t){if(t.left>=k&&t.left<=E){t.setCoords();const e="pain"===t.origin.type?R:O;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(a),T(a)?f(a):m.show=!1})),a.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&T(a)){const t=X([...x],a.left,"_type").includes(a.origin._type),e=Y(a.left);if(!e||t)t&&e&&N("repeat");else{const t={data:{time:w(a.left),value:S(a.origin.type,a.top),...s(a.origin.type)?{key:a.origin.key}:{}},...a.origin};p("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(a)})),g.value.add(l,u)}))}();const F=G.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&F.push(q),_>0&&G.yScaleValue[_].show){const t=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&F.unshift(t),_==G.yScaleValue.length-1&&F.push(t)}const K=F.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),Q=F[K];return K>-1&&F.splice(K,0,{...Q,title:(null==Q?void 0:Q.doubleTitle)||(null==Q?void 0:Q.title)}),z(F),g.value.add(new t.Rect({left:H,top:0,width:J-H-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:z}}export{g as useLeft};
|