cnhis-design-vue 3.1.53-beta.3 → 3.1.53-release.0
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 +13 -14
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +6 -69
- 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 +26 -98
- package/es/components/form-config/src/FormConfig.vue.d.ts +27 -99
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -30
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -48
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/index.d.ts +6 -30
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +7 -31
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -31
- 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/index.d.ts → levelSearchCascader.d.ts} +5 -3
- package/es/components/form-render/src/components/renderer/levelSearchCascader.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 +2 -3
- package/es/components/form-render/src/hooks/index.d.ts +2 -0
- 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 +2 -10
- package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +16 -0
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -0
- 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 +1 -9
- 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/hooks/useFormRequest.d.ts +26 -0
- package/es/components/form-render/src/hooks/useFormRequest.js +1 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +26 -4
- package/es/components/form-render/src/types/index.d.ts +14 -7
- package/es/components/form-render/src/utils/index.d.ts +2 -1
- 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 +0 -39
- package/es/components/iho-table/src/IhoTable.vue.d.ts +0 -40
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +1 -4
- 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/selectRendererPlugin/editSelect.d.ts +1 -4
- 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/types/index.d.ts +2 -7
- 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 +0 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +29 -97
- package/es/components/info-header/src/InfoHeader.vue.d.ts +30 -98
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -9
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +6 -10
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +13 -41
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -30
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/search-cascader/index.d.ts +3 -23
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +4 -24
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +9 -33
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +10 -34
- 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 +0 -3
- package/es/shared/hooks/index.js +1 -1
- package/es/shared/hooks/{useAsyncQueue/index.d.ts → useAsyncQueue.d.ts} +15 -7
- package/es/shared/hooks/useAsyncQueue.js +1 -0
- package/es/shared/hooks/useDateTime.d.ts +2 -2
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +0 -24
- package/es/shared/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +0 -552
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.js +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +0 -1
- package/es/components/iho-table/src/plugins/wordbookSettingPlugin.d.ts +0 -1
- package/es/components/iho-table/src/plugins/wordbookSettingPlugin.js +0 -1
- package/es/components/search-cascader/src/components/ClearIcon.vue.js +0 -1
- package/es/shared/hooks/selectHooks/index.d.ts +0 -4
- package/es/shared/hooks/selectHooks/index.js +0 -1
- package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +0 -10
- package/es/shared/hooks/selectHooks/useOptionFiltered.js +0 -1
- package/es/shared/hooks/selectHooks/useSearchContent.d.ts +0 -6
- package/es/shared/hooks/selectHooks/useSearchContent.js +0 -1
- package/es/shared/hooks/selectHooks/useSelectAllowModify.d.ts +0 -23
- package/es/shared/hooks/selectHooks/useSelectAllowModify.js +0 -1
- package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +0 -19
- package/es/shared/hooks/selectHooks/useSelectRenders.js +0 -1
- package/es/shared/hooks/useAsyncQueue/index.js +0 -1
- package/es/shared/hooks/useAsyncQueue/types.d.ts +0 -20
- package/es/shared/hooks/useAsyncQueue/types.js +0 -1
- package/es/shared/hooks/useFormRequest/index.d.ts +0 -24
- package/es/shared/hooks/useFormRequest/index.js +0 -1
- package/es/shared/hooks/useFormRequest/types.d.ts +0 -39
- package/es/shared/hooks/useFormRequest/types.js +0 -1
- package/es/shared/hooks/useLevelSearchCascader.d.ts +0 -31
- package/es/shared/hooks/useLevelSearchCascader.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 a,onDeactivated as t,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{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),k=o({get:()=>T.value,async set(e){T.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=a(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),k.value&&b.value?k.value=!1:u(x)||(y=setTimeout((()=>{b.value=k.value=!0}),200))}function M(e){e.stopPropagation(),clearTimeout(y),u(x)&&(k.value=!0,b.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(x)&&(k.value=!0)}function j(e){e.stopPropagation(),clearTimeout(_),u(x)&&!b.value&&(_=setTimeout((()=>{k.value=!1}),300))}return t((()=>{k.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(x)}],style:{"--icon-right":"-5",...w.value},"annotation-hover-show":!u(x)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:k.value,"onUpdate:show":e=>k.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:j,onMouseenter:R},[l("div",null,[b.value?l(h,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:x.value,"onUpdate:value":e=>x.value=e},null):l("span",null,[u(x)])]),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:j,onMouseenter:R,onDblclick:M,onClick:P},[l(V,{component:u(x)?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").Func<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").Func<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").Func<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").Func<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("../../..").Func<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("../../..").Func<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("../../..").Func<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("../../..").Func<any[], any>>>;
|
|
268
268
|
};
|
|
269
269
|
}>>, {}>;
|
|
270
270
|
NPopover: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, Func } 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<Func<any[], any>>;
|
|
7
|
+
add(cb: Func): void;
|
|
8
|
+
remove(cb: Func): void;
|
|
9
9
|
clear(): void;
|
|
10
10
|
trigger(): void;
|
|
11
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Func } 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: Func, 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, Func } 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?: Func): false | AnyObject;
|
|
30
|
+
_handleResultTest(result: unknown, errorCallbackFn?: Func): boolean;
|
|
31
|
+
_handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?: Func): 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?: Func): false | {
|
|
38
38
|
file: any;
|
|
39
39
|
printerName: any;
|
|
40
40
|
pageCount: any;
|
|
@@ -45,22 +45,21 @@ 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
|
-
|
|
50
|
-
printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, mode?: string): Promise<any>;
|
|
48
|
+
preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
49
|
+
printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
51
50
|
private _downloadPDF;
|
|
52
51
|
/**
|
|
53
52
|
* 下载pdf
|
|
54
53
|
*/
|
|
55
|
-
downloadPDF(params: AnyObject, onResolve:
|
|
56
|
-
print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?:
|
|
57
|
-
queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?:
|
|
54
|
+
downloadPDF(params: AnyObject, onResolve: Func, onReject: Func): void;
|
|
55
|
+
print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
56
|
+
queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | {
|
|
58
57
|
file: any;
|
|
59
58
|
printerName: any;
|
|
60
59
|
pageCount: any;
|
|
61
60
|
formatId: string;
|
|
62
61
|
}>;
|
|
63
|
-
printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?:
|
|
64
|
-
editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?:
|
|
65
|
-
addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?:
|
|
62
|
+
printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | AnyObject>;
|
|
63
|
+
editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
64
|
+
addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
66
65
|
}
|
|
@@ -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}),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};
|
|
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};
|
|
@@ -115,17 +115,13 @@ 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;
|
|
122
118
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
123
119
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
124
120
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
125
121
|
}>>;
|
|
126
122
|
};
|
|
127
123
|
requestInstance: {
|
|
128
|
-
type: import("vue").PropType<import("
|
|
124
|
+
type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
|
|
129
125
|
};
|
|
130
126
|
enterToNextWidget: {
|
|
131
127
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -264,17 +260,13 @@ export declare const CallbackMaps: Map<string, {
|
|
|
264
260
|
lifeCycle: {
|
|
265
261
|
type: import("vue").PropType<Partial<{
|
|
266
262
|
onSetup(): void;
|
|
267
|
-
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
268
|
-
field: import("@formily/core").GeneralField;
|
|
269
|
-
oldValue: unknown;
|
|
270
|
-
}): any;
|
|
271
263
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
272
264
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
273
265
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
274
266
|
}>>;
|
|
275
267
|
};
|
|
276
268
|
requestInstance: {
|
|
277
|
-
type: import("vue").PropType<import("
|
|
269
|
+
type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
|
|
278
270
|
};
|
|
279
271
|
enterToNextWidget: {
|
|
280
272
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -328,7 +320,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
328
320
|
changeContextCollector: import("../../../../../../es/components/form-render").ContextCollector;
|
|
329
321
|
formUUID: string;
|
|
330
322
|
anchorBarRef: import("vue").Ref<{
|
|
331
|
-
syncBarPosition: import("../../../..").
|
|
323
|
+
syncBarPosition: import("../../../..").Func<any[], any>;
|
|
332
324
|
} | undefined>;
|
|
333
325
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
334
326
|
updateAnchorList: (field: import("@formily/core").GeneralField) => void;
|
|
@@ -337,21 +329,13 @@ export declare const CallbackMaps: Map<string, {
|
|
|
337
329
|
title: string;
|
|
338
330
|
}[]>;
|
|
339
331
|
onScroll: (scrollEvent: Event) => void;
|
|
340
|
-
callLifeCycle: <T extends "onSetup" | "
|
|
332
|
+
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
341
333
|
onSetup(): void;
|
|
342
|
-
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
343
|
-
field: import("@formily/core").GeneralField;
|
|
344
|
-
oldValue: unknown;
|
|
345
|
-
}): any;
|
|
346
334
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
347
335
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
348
336
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
349
337
|
}>>[T]> | undefined) => import("../../../..").UndefinedAble<ReturnType<Required<Partial<{
|
|
350
338
|
onSetup(): void;
|
|
351
|
-
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
352
|
-
field: import("@formily/core").GeneralField;
|
|
353
|
-
oldValue: unknown;
|
|
354
|
-
}): any;
|
|
355
339
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
356
340
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
357
341
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
@@ -444,16 +428,12 @@ export declare const CallbackMaps: Map<string, {
|
|
|
444
428
|
uuid: string;
|
|
445
429
|
lifeCycle: Partial<{
|
|
446
430
|
onSetup(): void;
|
|
447
|
-
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
448
|
-
field: import("@formily/core").GeneralField;
|
|
449
|
-
oldValue: unknown;
|
|
450
|
-
}): any;
|
|
451
431
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
452
432
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
453
433
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
454
434
|
}>;
|
|
455
435
|
businessFormatter: import("../../../../../../es/components/form-render").FormBusinessFormatter;
|
|
456
|
-
requestInstance: import("
|
|
436
|
+
requestInstance: import("../../../../../../es/components/form-render").RequestInstance;
|
|
457
437
|
enterToNextWidget: boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void);
|
|
458
438
|
lowCodeReactions: import("../../../..").FormLowCodeReactions.Config[];
|
|
459
439
|
linebarAutoHidden: boolean;
|
|
@@ -855,17 +835,13 @@ export declare const CallbackMaps: Map<string, {
|
|
|
855
835
|
lifeCycle: {
|
|
856
836
|
type: import("vue").PropType<Partial<{
|
|
857
837
|
onSetup(): void;
|
|
858
|
-
beforeSetValue(fieldKey: string, value: unknown, payload: {
|
|
859
|
-
field: import("@formily/core").GeneralField;
|
|
860
|
-
oldValue: unknown;
|
|
861
|
-
}): any;
|
|
862
838
|
beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
|
|
863
839
|
afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
|
|
864
840
|
afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
|
|
865
841
|
}>>;
|
|
866
842
|
};
|
|
867
843
|
requestInstance: {
|
|
868
|
-
type: import("vue").PropType<import("
|
|
844
|
+
type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
|
|
869
845
|
};
|
|
870
846
|
enterToNextWidget: {
|
|
871
847
|
type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
|
|
@@ -939,17 +915,6 @@ export declare const CallbackMaps: Map<string, {
|
|
|
939
915
|
annotation: {
|
|
940
916
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
941
917
|
};
|
|
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
|
-
};
|
|
953
918
|
}, {
|
|
954
919
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
955
920
|
tableConfig: {
|
|
@@ -967,17 +932,6 @@ export declare const CallbackMaps: Map<string, {
|
|
|
967
932
|
annotation: {
|
|
968
933
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
969
934
|
};
|
|
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
|
-
};
|
|
981
935
|
}>> & {
|
|
982
936
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
983
937
|
onCopy?: ((...args: any[]) => any) | undefined;
|
|
@@ -1052,10 +1006,6 @@ export declare const CallbackMaps: Map<string, {
|
|
|
1052
1006
|
}>;
|
|
1053
1007
|
eventListener: import("../../../../iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
1054
1008
|
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
|
-
}[]>;
|
|
1059
1009
|
hooks: Readonly<{
|
|
1060
1010
|
configHooks: import("../../../../../../es/components/iho-table").AbstractConfigHooks;
|
|
1061
1011
|
fieldHooks: import("../../../../../../es/components/iho-table").AbstractFieldHooks;
|
|
@@ -5607,17 +5557,6 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5607
5557
|
annotation: {
|
|
5608
5558
|
type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
|
|
5609
5559
|
};
|
|
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
|
-
};
|
|
5621
5560
|
}>> & {
|
|
5622
5561
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
5623
5562
|
onCopy?: ((...args: any[]) => any) | undefined;
|
|
@@ -5686,8 +5625,6 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5686
5625
|
onRowDrag?: ((...args: any[]) => any) | undefined;
|
|
5687
5626
|
}, {
|
|
5688
5627
|
fieldList: import("../../../../../../es/components/iho-table").LowCodeTableFieldItem[];
|
|
5689
|
-
parallelism: number;
|
|
5690
|
-
uniqueCacheData: boolean;
|
|
5691
5628
|
tableConfig: import("../../../../../../es/components/iho-table").IhoTableConfig;
|
|
5692
5629
|
tableData: import("../../../..").AnyObject[];
|
|
5693
5630
|
}>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AnyObject,
|
|
1
|
+
import { AnyObject, Func, 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: Func) => void;
|
|
9
|
+
removeEventListener: (type: string, handler: Func) => 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 a,ref as t,computed as l,watch as n,openBlock as u,createBlock as r,unref as o,isRef as d,createSlots as i,renderList as s,withCtx as f,renderSlot as p,nextTick as m}from"vue";import{NDatePicker as v}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{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=a(),D=t(null),M=t(null),k=t(),C=l({get:()=>j(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)}}),E=l((()=>{const e=Reflect.get(R,"type")||"";return["datetime","datetimerange"].includes(e)})),P=l((()=>{if(Reflect.get(R,"format"))return R.format;const e=R.type||"";return E.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),S=l((()=>E.value?P.value.split(" "):"")),{focus:U,blur:$,handleConfirm:_}=h(D,{formatRef:P,attrs:R,emit:w,allowedInvalidValue:I.allowedInvalidValue});function b(e){e&&E.value&&m((()=>{var e;M.value=null==(e=D.value)?void 0:e.panelInstRef,h(M,{formatRef:S,attrs:R,isPanel:!0})}))}async function x(...e){var a,t,l,n,u,r;const o=Reflect.get(R,"type")||"",d=null==(n=null==(l=null==(t=null==(a=D.value)?void 0:a.inputInstRef)?void 0:t.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(o.includes("range")?null==(u=I.onConfirm)||u.call(I,...e):(await m(),d.focus(),_(d),d.blur(),null==(r=I.onConfirm)||r.call(I,Date.parse(d.value),d.value)),!(null==d?void 0:d.value)||!I.updateUnchangedValue||o.includes("range"))return;const i=d.value;d.value=g(new Date,P.value),d.dispatchEvent(new InputEvent("input")),d.value=i,d.dispatchEvent(new InputEvent("input"))}function j(e){return I.allowedInvalidValue&&I.allowedInvalidValue===e}return n((()=>I.formattedValue),(e=>{k.value=j(e)?e:I.placeholder?I.placeholder:"选择日期时间"}),{immediate:!0}),V({$datePicker:D,focus:U,blur:$}),(e,a)=>(u(),r(o(v),{ref_key:"datePickerRef",ref:D,"onUpdate:show":b,onConfirm:x,placeholder:k.value,"formatted-value":o(C),"onUpdate:formatted-value":a[0]||(a[0]=e=>d(C)?C.value=e:null)},i({_:2},[s(e.$slots,((a,t)=>({name:t,fn:f((()=>[p(e.$slots,t)]))})))]),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 s,isOneLine as r}from"../../utils/index.js";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as u,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 d(d,g,p,f,m,v,y,w,S,Y,b,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(d,p,g),{originY:V,endY:L,originX:k,endX:E,xCellWidth:M,yCellHeight:W,left:G,vitalSignsOriginY:O,painOriginY:A,painHeight:H,iconsWidth:I,itemList:R,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P}=g;function z(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=I,g=k;"right"===r&&(c=E,g=E+(null!=(s=null==B?void 0:B.width)?s:0));const p=[],f=H&&"right"!==r?o.length-1:o.length,m=(g-c)/f,v=m+(g-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:g,style:p,title:f}=n,m=l({width:k-I,height:H,...D},{value:`${f}`,...i,...p||{}},{left:I,top:A.originY}),v=e([I,A.originY,k,A.originY],D),y=[];if(r||h){const{lineXMain:e,textLeft:i}=a(c,I,k-I),l=o.length;o.forEach(((o,a)=>{let c=A.endY-a*W*s;if(0===a&&(c=L-5),!h||(0===a||a===l-1)&&!g||y.push(u(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...D,...p});y.push(o)}}))}d.value.add(v,m,...y),m.sendToBack()}(o);const g=[],f=0===s?v:m,y=0===s?c:v+c+(s-1)*m,w="right"===r?0:O.originY,S="right"===r?$:O.endY,Y=s>0?e([y,w,y,S],{objectCaching:!1,...D}):null;Y&&g.push(Y);const b=y+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:X,position:N,showMaxMinNumber:T,detailedList:E=[],showdetailedScale:M}=o;if(C||X){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,y,f),n=(x[1]-x[0])/2,l=M&&!E.length?x.reduce(((t,e,i)=>{const o=t[t.length-1];return 0===i?[e]:t.concat([o+n,o+2*n])}),[]):M&&(null==E?void 0:E.length)?E:x,s=l.length;l.forEach(((n,l)=>{const r=O.endY-l*W*(M?j/2:j);if(X&&(!(0===l||l===s-1)||T)){const t=0==l?r-5:r,e=u(n,o,i,t),s=O.originY+e.height/2;t<s&&e.set({top:s}),g.push(e)}g.push(...h(o,l,t,e,r,W,O.originY))}))}let G=o.title||"";o.unit&&(G+="\n"+o.unit);let R=O.originY+W;0!==_&&P[0]>1&&(R=V+W*P[0]/2),G&&g.push(new t.Text(String(G),{...i,left:b,top:R,textAlign:"center",...o.style}));const B=new t.Group(g,{...n,objectCaching:!1});p.push(B)}));const y=p.length>0?new t.Group([...p],{...n,objectCaching:!1}):null;y&&d.value.add(y),y&&y.sendToBack()}I&&function(){const t=JSON.parse(JSON.stringify(R));let e=L;const i=I-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:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...g.event}});var u;e-=l.height||30,(u=a).on("moving",(()=>{u.set("originX","center"),function(t){if(t.left>=k&&t.left<=E){t.setCoords();const e="pain"===t.origin.type?A:O;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(u),T(u)?f(u):m.show=!1})),u.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&T(u)){const t=X([...x],u.left,"_type").includes(u.origin._type),e=Y(u.left);if(!e||t)t&&e&&N("repeat");else{const t={data:{time:w(u.left),value:S(u.origin.type,u.top),...r(u.origin.type)?{key:u.origin.key}:{}},...u.origin};p("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(l,a)}))}();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),d.value.add(new t.Rect({left:I,top:0,width:J-I-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:z}}export{d as useLeft};
|