cnhis-design-vue 3.1.47-beta.20 → 3.1.47-beta.23

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.
Files changed (64) hide show
  1. package/es/components/button-print/src/utils/dialog.js +1 -1
  2. package/es/components/card-reader-sdk/index.d.ts +4 -0
  3. package/es/components/card-reader-sdk/index.js +1 -0
  4. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +23 -0
  5. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -0
  6. package/es/components/card-reader-sdk/src/components/readCardDialog.vue.d.ts +23 -0
  7. package/es/components/card-reader-sdk/src/components/readCardDialog.vue.js +1 -0
  8. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -0
  9. package/es/components/card-reader-sdk/src/constants/index.d.ts +171 -0
  10. package/es/components/card-reader-sdk/src/constants/index.js +1 -0
  11. package/es/components/card-reader-sdk/src/insuranceSDK.d.ts +27 -0
  12. package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -0
  13. package/es/components/card-reader-sdk/src/types/index.d.ts +53 -0
  14. package/es/components/card-reader-sdk/src/types/index.js +1 -0
  15. package/es/components/card-reader-sdk/src/utils/index.d.ts +9 -0
  16. package/es/components/card-reader-sdk/src/utils/index.js +1 -0
  17. package/es/components/card-reader-sdk/src/utils/readHealthCard.d.ts +6 -0
  18. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -0
  19. package/es/components/fabric-chart/index.d.ts +3 -20
  20. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -20
  21. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +2 -1
  23. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +2 -18
  24. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +2 -1
  26. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +2 -18
  28. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +2 -1
  30. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +2 -4
  32. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +2 -3
  34. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +2 -18
  35. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  37. package/es/components/fabric-chart/src/interface.d.ts +12 -1
  38. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  39. package/es/components/iho-table/style/index.css +1 -1
  40. package/es/components/index.css +1 -1
  41. package/es/components/index.d.ts +2 -1
  42. package/es/components/index.js +1 -1
  43. package/es/components/scale-view/index.d.ts +1 -0
  44. package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -0
  45. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  46. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  47. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  48. package/es/components/shortcut-provider/src/types/index.d.ts +1 -0
  49. package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
  50. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +12 -0
  51. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue2.js +1 -1
  52. package/es/shared/hooks/useDateTime.js +1 -1
  53. package/es/shared/package.json.js +1 -1
  54. package/es/shared/utils/index.d.ts +2 -1
  55. package/es/shared/utils/index.js +1 -1
  56. package/package.json +2 -2
  57. package/es/components/insurance-sdk/index.d.ts +0 -1
  58. package/es/components/insurance-sdk/index.js +0 -1
  59. package/es/components/insurance-sdk/src/constants/index.d.ts +0 -161
  60. package/es/components/insurance-sdk/src/constants/index.js +0 -1
  61. package/es/components/insurance-sdk/src/utils/index.d.ts +0 -1
  62. package/es/components/insurance-sdk/src/utils/index.js +0 -1
  63. package/es/components/insurance-sdk/src/utils/insurance.d.ts +0 -260
  64. package/es/components/insurance-sdk/src/utils/insurance.js +0 -1
@@ -1 +1 @@
1
- import{ref as e,render as t,createVNode as r,withCtx as n,nextTick as o,defineComponent as i,provide as l}from"vue";import s from"../components/IdentityVerification.vue.js";import a from"../components/Preview.vue.js";class c{constructor(){this.rendered=!1}static createMsg(e){return`[IdentityVerificationDialog] ${e}`}show(i,l,a,d,m){return this.rendered?Promise.reject(c.createMsg("请勿重复打开弹窗")):new Promise(((v,f)=>{this.rendered=!0;const p=document.createElement("div"),h=e(!1),g=u(i);var y;function E(){f(c.createMsg("弹窗关闭"))}function P(e){v(e),h.value=!1}t(r(g,null,{default:n((()=>r(s,{to:p,verifyUser:a,modelValue:h.value,"onUpdate:modelValue":e=>h.value=e,identityVerificationTitle:l,onClose:E,onAfterLeave:()=>function(e){if(!e.parentElement)return;b.rendered=!1,e.parentElement.removeChild(e)}(p),onSuccess:P,formatId:d,templateId:m},null)),i)}),p),y=p,document.body.appendChild(y),o((()=>h.value=!0));const b=this}))}}class d{constructor(){this.rendered=!1}static createMsg(e){return`[PreviewDialog] ${e}`}show(i,l){return this.rendered?Promise.reject(d.createMsg("请勿重复打开弹窗")):new Promise(((s,c)=>{this.rendered=!0;const d=document.createElement("div"),m=e(!1),v=u(i);var f;t(r(v,null,{default:n((()=>r(a,{visible:m.value,"onUpdate:visible":e=>m.value=e,src:l,onAfterLeave:()=>function(e){if(!e.parentElement)return;p.rendered=!1,e.parentElement.removeChild(e)}(d)},null)),i)}),d),f=d,document.body.appendChild(f),o((()=>{m.value=!0,s("success")}));const p=this}))}}function u(e){return i({setup(t,{slots:n}){let o=(null==e?void 0:e.parent)&&Reflect.get(e.parent,"provides");const i=[];for(;o;)Object.entries(o).forEach((([e,t])=>{i.includes(e)||(i.push(e),l(e,t))})),o=Object.getPrototypeOf(o);return()=>{var e;return r("div",null,[null==(e=n.default)?void 0:e.call(n)])}}})}export{c as IdentityVerificationDialog,d as PreviewDialog};
1
+ import{ref as e,render as t,createVNode as r,withCtx as n,nextTick as i}from"vue";import{createProviderWrapper as o}from"../../../../shared/utils/index.js";import s from"../components/IdentityVerification.vue.js";import d from"../components/Preview.vue.js";class a{constructor(){this.rendered=!1}static createMsg(e){return`[IdentityVerificationDialog] ${e}`}show(d,l,c,u,m){return this.rendered?Promise.reject(a.createMsg("请勿重复打开弹窗")):new Promise(((v,f)=>{this.rendered=!0;const p=document.createElement("div"),h=e(!1),g=o(d);var w;function y(){f(a.createMsg("弹窗关闭"))}function E(e){v(e),h.value=!1}t(r(g,null,{default:n((()=>r(s,{to:p,verifyUser:c,modelValue:h.value,"onUpdate:modelValue":e=>h.value=e,identityVerificationTitle:l,onClose:y,onAfterLeave:()=>function(e){if(!e.parentElement)return;P.rendered=!1,e.parentElement.removeChild(e)}(p),onSuccess:E,formatId:u,templateId:m},null)),d)}),p),w=p,document.body.appendChild(w),i((()=>h.value=!0));const P=this}))}}class l{constructor(){this.rendered=!1}static createMsg(e){return`[PreviewDialog] ${e}`}show(s,a){return this.rendered?Promise.reject(l.createMsg("请勿重复打开弹窗")):new Promise(((l,c)=>{this.rendered=!0;const u=document.createElement("div"),m=e(!1),v=o(s);var f;t(r(v,null,{default:n((()=>r(d,{visible:m.value,"onUpdate:visible":e=>m.value=e,src:a,onAfterLeave:()=>function(e){if(!e.parentElement)return;p.rendered=!1,e.parentElement.removeChild(e)}(u)},null)),s)}),u),f=u,document.body.appendChild(f),i((()=>{m.value=!0,l("success")}));const p=this}))}}export{a as IdentityVerificationDialog,l as PreviewDialog};
@@ -0,0 +1,4 @@
1
+ import InsuranceSDK from './src/insuranceSDK';
2
+ import CardReaderSDK from './src/cardReaderSDK';
3
+ export * from './src/types';
4
+ export { InsuranceSDK as CInsuranceSDK, CardReaderSDK as CCardReaderSDK };
@@ -0,0 +1 @@
1
+ export{default as CInsuranceSDK}from"./src/insuranceSDK.js";export{default as CCardReaderSDK}from"./src/cardReaderSDK.js";
@@ -0,0 +1,23 @@
1
+ import { ComponentInternalInstance } from 'vue';
2
+ import { InsuranceType } from './types';
3
+ export default class CardReaderSDK {
4
+ private options;
5
+ private loading;
6
+ private readHealthCardDialog;
7
+ private insurance;
8
+ constructor(options: InsuranceType.CardReadOptions);
9
+ private get basicParamsRes();
10
+ static create(options?: InsuranceType.CardReadOptions): CardReaderSDK;
11
+ destroy(): void;
12
+ readHealthCard(instance?: ComponentInternalInstance): Promise<string>;
13
+ readIdCard(params?: InsuranceType.CardReadParams): Promise<InsuranceType.CardReadResult>;
14
+ readVisitCard(params?: InsuranceType.CardReadParams): Promise<InsuranceType.CardReadResult>;
15
+ readHospitalCard(params?: InsuranceType.CardReadParams & {
16
+ iai03?: string;
17
+ bdp02?: string;
18
+ vaa05?: string;
19
+ }): Promise<InsuranceType.CardReadResult>;
20
+ private createBasicParams;
21
+ private checkLoading;
22
+ private checkResCodeAndLoading;
23
+ }
@@ -0,0 +1 @@
1
+ import{isFunction as a}from"lodash-es";import e from"./insuranceSDK.js";import{CARD_TYPE as s}from"./constants/index.js";import{ReadHealthCard as t}from"./utils/readHealthCard.js";class r{constructor(a){this.options=a,this.loading=!1,this.readHealthCardDialog=new t,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new r(a)}destroy(){this.insurance.destroy()}async readHealthCard(a){return await this.checkLoading(),this.readHealthCardDialog.show(a)}async readIdCard(a={}){await this.checkLoading();const e=this.createBasicParams(s.ID_CARD,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readVisitCard(a={}){await this.checkLoading();const e=this.createBasicParams(s.VISIT_CARD,a,{transsystem:"10",transdata:{readtype:1}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readHospitalCard(a={}){await this.checkLoading();const e=this.createBasicParams(s.HOSPITAL_CARD,a,{iar1Json:{iaa01:a.interfaceid,iai03:a.iai03||"",bdp02:a.bdp02||""},personinfo:{location:0,ptname:a.vaa05||""},transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}createBasicParams(a,e,s){var t,r;const{operatorname:i,operatorcode:n,...o}=this.basicParamsRes||{};return{type:a,operatorname:null!=(t=e.operatorname)?t:i,operatorcode:null!=(r=e.operatorcode)?r:n,...o,...s}}checkLoading(){if(this.loading)return Promise.reject("请勿重复读卡")}async checkResCodeAndLoading(a){try{this.loading=!0;const e=await a;return 3===e.returncode?Promise.reject(`读卡服务提示: ${e.returnmsg||"读卡失败"}`):e}finally{this.loading=!1}}}export{r as default};
@@ -0,0 +1,23 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ show: {
3
+ type: BooleanConstructor;
4
+ required: true;
5
+ };
6
+ }, {
7
+ valueRef: import("vue").Ref<string>;
8
+ emit: (event: "close" | "update:show" | "confirm", ...args: any[]) => void;
9
+ onClose: () => void;
10
+ onConfirm: () => void;
11
+ NInput: any;
12
+ NModal: any;
13
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:show" | "confirm")[], "close" | "confirm" | "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
+ show: {
15
+ type: BooleanConstructor;
16
+ required: true;
17
+ };
18
+ }>> & {
19
+ onClose?: ((...args: any[]) => any) | undefined;
20
+ onConfirm?: ((...args: any[]) => any) | undefined;
21
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
22
+ }, {}>;
23
+ export default _default;
@@ -0,0 +1 @@
1
+ import r from"./readCardDialog.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var a=e(r,[["__file","readCardDialog.vue"]]);export{a as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as o,openBlock as t,createBlock as a,unref as s,withCtx as i,createVNode as l}from"vue";import{NModal as n,NInput as u}from"naive-ui";var r=e({__name:"readCardDialog",props:{show:{type:Boolean}},emits:["update:show","confirm","close"],setup(e,{emit:r}){const p=o("");function c(){r("update:show",!1),r("close")}function v(){r("confirm",p.value)}return(o,r)=>(t(),a(s(n),{preset:"dialog",title:"扫码电子健康卡",show:e.show,"close-on-esc":!1,"show-icon":!1,"positive-text":"确认",onClose:c,onPositiveClick:v},{default:i((()=>[l(s(u),{value:p.value,"onUpdate:value":r[0]||(r[0]=e=>p.value=e)},null,8,["value"])])),_:1},8,["show"]))}});export{r as default};
@@ -0,0 +1,171 @@
1
+ /**
2
+ * 交易命令映射
3
+ */
4
+ export declare const transcmdMapping: Readonly<{
5
+ sk: 100210;
6
+ ghdj: 100401;
7
+ ghqx: 100403;
8
+ mzjs: 100407;
9
+ beforemzjs: 100406;
10
+ mztf: 100408;
11
+ zyjs: 100613;
12
+ qxzyjs: 100614;
13
+ zydj: 100601;
14
+ qxzydj: 100603;
15
+ zydjzzf: 100605;
16
+ mzghconfirm: 100415;
17
+ ghdjcg: 100411;
18
+ ghdjsb: 100412;
19
+ mzjscg: 100409;
20
+ mzjssb: 100410;
21
+ mztfcg: 100413;
22
+ mztfsb: 100414;
23
+ newdhyk: 110021;
24
+ newdsfz: 110041;
25
+ fastReport: 100000;
26
+ pos: 100000;
27
+ yjjrefund: 100622;
28
+ ybxxcx: 100212;
29
+ ybdz: 100209;
30
+ }>;
31
+ export declare const HIS_INSURANCE_PARAMS: Readonly<{
32
+ msgindex: "";
33
+ checkoutinfo: "";
34
+ parmsJson: {
35
+ transtime: string;
36
+ transtype: string;
37
+ interfaceid: string;
38
+ serialnumber: string;
39
+ operatorcode: string;
40
+ operatorname: string;
41
+ transcmd: string;
42
+ transdata: {
43
+ iar1: {
44
+ acf01: string;
45
+ iar01: string;
46
+ vaa01: string;
47
+ vaa07: string;
48
+ iaa01: string;
49
+ iab02: string;
50
+ iak04: string;
51
+ iak05: string;
52
+ iak06: string;
53
+ iar10: string;
54
+ iar11: string;
55
+ iar12: string;
56
+ iar13: string;
57
+ iar14: string;
58
+ iar15: string;
59
+ iar16: string;
60
+ iar17: string;
61
+ iar18: string;
62
+ iar19: string;
63
+ iar20: string;
64
+ iar21: string;
65
+ iar22: string;
66
+ iai03: string;
67
+ iar24: string;
68
+ iar25: string;
69
+ iar26: string;
70
+ iar27: string;
71
+ iar28: string;
72
+ iar29: string;
73
+ iar30: string;
74
+ iar31: string;
75
+ iar32: string;
76
+ iar33: string;
77
+ iar34: string;
78
+ iar35: string;
79
+ iac02: string;
80
+ iac03: string;
81
+ iad03: string;
82
+ iad04: string;
83
+ iar40: string;
84
+ iar41: string;
85
+ iak22: string;
86
+ iar43: string;
87
+ iar44: string;
88
+ iar45: string;
89
+ cli_iai03: string;
90
+ iar46: string;
91
+ iar47: string;
92
+ iar48: string;
93
+ iar49: string;
94
+ iar50: string;
95
+ iar51: string;
96
+ iar52: string;
97
+ iar53: string;
98
+ iar54: string;
99
+ iar55: string;
100
+ iar56: string;
101
+ iar57: string;
102
+ iar58: string;
103
+ iar59: string;
104
+ iar60: string;
105
+ iar61: string;
106
+ iar62: string;
107
+ iar63: string;
108
+ iar64: string;
109
+ iar65: string;
110
+ iar66: string;
111
+ iar67: string;
112
+ iar68: string;
113
+ iar69: string;
114
+ iar70: string;
115
+ iar71: string;
116
+ iar72: string;
117
+ iar73: string;
118
+ iar74: string;
119
+ iar75: string;
120
+ };
121
+ personinfo: {
122
+ location: number;
123
+ ptname: string;
124
+ sex: string;
125
+ birthday: string;
126
+ age: string;
127
+ idnumber: string;
128
+ folk: string;
129
+ address: string;
130
+ pttype: string;
131
+ ownpay: string;
132
+ };
133
+ };
134
+ transsystem: string;
135
+ transchannel: string;
136
+ verifycode: string;
137
+ };
138
+ error: true;
139
+ catch: true;
140
+ loading: false;
141
+ }>;
142
+ export declare const CONFIG_MAP: Readonly<{
143
+ type: "sk";
144
+ location: null;
145
+ vaa01: "";
146
+ vaa07: "";
147
+ iaa01: null;
148
+ iar1Json: {};
149
+ personinfo: {};
150
+ parmsKey: "VAC01";
151
+ money: "";
152
+ interfaceid: "0";
153
+ operatorname: "";
154
+ operatorcode: "";
155
+ newhoinsurance: "";
156
+ message: "";
157
+ transdata: {};
158
+ transtype: "SYSTEM";
159
+ transchannel: "100";
160
+ transsystem: "12";
161
+ loginCode: "7777";
162
+ needLogin: false;
163
+ returncodes: string[];
164
+ }>;
165
+ export declare const INSURANCE_URL: string;
166
+ export declare enum CARD_TYPE {
167
+ ID_CARD = "newdsfz",
168
+ HOSPITAL_CARD = "sk",
169
+ HEALTH_CARD = "djkk",
170
+ VISIT_CARD = "djkk"
171
+ }
@@ -0,0 +1 @@
1
+ const a=Object.freeze({sk:100210,ghdj:100401,ghqx:100403,mzjs:100407,beforemzjs:100406,mztf:100408,zyjs:100613,qxzyjs:100614,zydj:100601,qxzydj:100603,zydjzzf:100605,mzghconfirm:100415,ghdjcg:100411,ghdjsb:100412,mzjscg:100409,mzjssb:100410,mztfcg:100413,mztfsb:100414,newdhyk:110021,newdsfz:110041,fastReport:1e5,pos:1e5,yjjrefund:100622,ybxxcx:100212,ybdz:100209}),r=Object.freeze({msgindex:"",checkoutinfo:"",parmsJson:{transtime:"",transtype:"YB0000",interfaceid:"0",serialnumber:"",operatorcode:"10086",operatorname:"赵",transcmd:"",transdata:{iar1:{acf01:"0",iar01:"",vaa01:"",vaa07:"",iaa01:"",iab02:"",iak04:"",iak05:"",iak06:"",iar10:"",iar11:"",iar12:"",iar13:"",iar14:"",iar15:"",iar16:"",iar17:"",iar18:"",iar19:"",iar20:"",iar21:"",iar22:"",iai03:"",iar24:"",iar25:"",iar26:"",iar27:"",iar28:"",iar29:"",iar30:"",iar31:"",iar32:"",iar33:"",iar34:"",iar35:"",iac02:"",iac03:"",iad03:"",iad04:"",iar40:"",iar41:"",iak22:"0",iar43:"",iar44:"",iar45:"",cli_iai03:"",iar46:"",iar47:"",iar48:"",iar49:"",iar50:"",iar51:"",iar52:"",iar53:"",iar54:"",iar55:"",iar56:"",iar57:"",iar58:"",iar59:"",iar60:"",iar61:"",iar62:"",iar63:"",iar64:"",iar65:"",iar66:"",iar67:"",iar68:"",iar69:"",iar70:"",iar71:"",iar72:"",iar73:"",iar74:"",iar75:""},personinfo:{location:0,ptname:"",sex:"",birthday:"",age:"",idnumber:"",folk:"",address:"",pttype:"",ownpay:"0"}},transsystem:"12",transchannel:"100",verifycode:""},error:!0,catch:!0,loading:!1}),i=Object.freeze({type:"sk",location:null,vaa01:"",vaa07:"",iaa01:null,iar1Json:{},personinfo:{},parmsKey:"VAC01",money:"",interfaceid:"0",operatorname:"",operatorcode:"",newhoinsurance:"",message:"",transdata:{},transtype:"SYSTEM",transchannel:"100",transsystem:"12",loginCode:"7777",needLogin:!1,returncodes:["0","1"]}),e="http://127.0.0.1:8031/HOInterfaceSvr";var n=(a=>(a.ID_CARD="newdsfz",a.HOSPITAL_CARD="sk",a.HEALTH_CARD="djkk",a.VISIT_CARD="djkk",a))(n||{});export{n as CARD_TYPE,i as CONFIG_MAP,r as HIS_INSURANCE_PARAMS,e as INSURANCE_URL,a as transcmdMapping};
@@ -0,0 +1,27 @@
1
+ import { AnyObject } from '../../../../es/shared/types';
2
+ import { InsuranceType } from './types';
3
+ export default class InsuranceSDK {
4
+ private readonly webview;
5
+ private configMap;
6
+ private initParamsMap;
7
+ private currentMessageHandler;
8
+ constructor(params?: {
9
+ selfWindow?: any;
10
+ });
11
+ private readonly messageHandlerQueue;
12
+ private messageHandler;
13
+ postMessage<T extends InsuranceType.ExecType>(data: {
14
+ exec: T;
15
+ data: string;
16
+ }): Promise<InsuranceType.PostMessageResult<T>>;
17
+ destroy(): void;
18
+ private login;
19
+ private HOInterfaceSvr;
20
+ private initConfig;
21
+ private initParams;
22
+ getInsuranceInfoPromise(config: AnyObject): Promise<InsuranceType.CardReadResult>;
23
+ getInsuranceInfo(config: AnyObject, successFn?: (payload: InsuranceType.CardReadResult) => void, failureFn?: (error: any) => void): void;
24
+ private getDhykParams;
25
+ private getSkParams;
26
+ private getHisInsuranceParams;
27
+ }
@@ -0,0 +1 @@
1
+ import{jsonParse as s}from"../../../shared/utils/index.js";import{isString as e}from"lodash-es";import{insuranceLog as t,getDataMessageByData as a,getErrorMessageByType as n,getTranstime as r,getSerialNumber as i}from"./utils/index.js";import{INSURANCE_URL as o,CONFIG_MAP as c,transcmdMapping as d,HIS_INSURANCE_PARAMS as m}from"./constants/index.js";import h from"axios";var l;class p{constructor(s){var e,t;this.webview=null==(l=window.chrome)?void 0:l.webview,this.configMap=null,this.initParamsMap=new Map([[["newdhyk","newdsfz"],s=>this.getDhykParams(s)],[["sk"],s=>this.getSkParams(s)]]),this.currentMessageHandler=null,this.messageHandlerQueue=[],(null==s?void 0:s.selfWindow)&&(this.webview=null==(t=null==(e=null==s?void 0:s.selfWindow)?void 0:e.chrome)?void 0:t.webview),this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler))}messageHandler(a){const n=e(a.data)?s(a.data)||{}:a.data;if(!n||["hisyb","login"].includes(n.exec))return t("当前回执不是hisyb消息");const r=this.messageHandlerQueue[0];if(!r)return t("当前回执",a,"没有可用的handler");const{resolve:i,reject:o,transcmd:c}=r,{transcmd:d}=n.res||{};if(c&&d&&c!==d)return t("交易命令不相等,当前transcmd",c,"返回transcmd",d);try{this.messageHandlerQueue.shift(),i(n)}catch(s){o(s)}}async postMessage(e){return this.webview&&e?new Promise(((t,a)=>{var n;this.messageHandlerQueue.push({resolve:t,reject:a,transcmd:null==(n=s(e.data))?void 0:n.transcmd}),this.webview.postMessage(e)})).then((s=>s&&s.result&&s.exec===e.exec?s:Promise.reject())):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=null)}login(){const{loginCode:s=""}=this.configMap||{};return this.postMessage({exec:"login",data:s})}async HOInterfaceSvr(s){const{type:e,needLogin:t}=this.configMap||{};try{if(this.webview){t&&await this.login();return(await this.postMessage({exec:"hisyb",data:JSON.stringify(s.parmsJson)})).res}const e=await h.post(o,JSON.stringify(s.parmsJson));return a(e.data)}catch(s){return Promise.reject(n(e))}}initConfig(s){this.configMap=Object.assign({},c,s)}initParams(){const{type:s,transtype:e,interfaceid:t}=this.configMap||{},a=this.getHisInsuranceParams();Object.assign(a.parmsJson,{transcmd:s&&d[s]||s,interfaceid:t,transtype:e});const n=[...this.initParamsMap].find((([e])=>e.includes(s)));if(n){const[,s]=n;s(a)}else Object.assign(a.parmsJson,{transdata:this.configMap&&this.configMap.transdata});return a}getInsuranceInfoPromise(s){return this.initConfig(s),this.HOInterfaceSvr(this.initParams())}getInsuranceInfo(s,e,t){this.getInsuranceInfoPromise(s).then((s=>e&&e(s)),(s=>t&&t(s)))}getDhykParams(s){const{type:e}=this.configMap||{};s.parmsJson={...s.parmsJson,transtype:"IDCARD",interfaceid:"0",transdata:{...s.parmsJson.transdata,readtype:"newdhyk"===e?"1":"2"}}}getSkParams(s){const{iar1Json:e,personinfo:t}=this.configMap||{};s.parmsJson={...s.parmsJson,transdata:{...s.parmsJson.transdata,iar1:{...s.parmsJson.transdata.iar1,...e},personinfo:{...s.parmsJson.transdata.personinfo,...t}}}}getHisInsuranceParams(){const{operatorcode:s,operatorname:e,location:t,transchannel:a,transsystem:n}=this.configMap||{};return{...m,parmsJson:{...m.parmsJson,transtime:r(),serialnumber:i(),operatorcode:s,operatorname:e,location:t,transchannel:a,transsystem:n}}}}export{p as default};
@@ -0,0 +1,53 @@
1
+ import { AnyObject, Func } from '../../../../../es/shared/types';
2
+ export declare namespace InsuranceType {
3
+ type ExecType = 'hisyb' | 'login';
4
+ type IHOWindow = Window & {
5
+ chrome: {
6
+ webview: {
7
+ addEventListener: (type: string, handler: Func) => void;
8
+ removeEventListener: (type: string, handler: Func) => void;
9
+ postMessage: (payload: any) => void;
10
+ };
11
+ };
12
+ };
13
+ type MessageDataType = {
14
+ exec: ExecType;
15
+ res: {
16
+ transcmd: string;
17
+ };
18
+ };
19
+ type MessageType = {
20
+ data: string | MessageDataType;
21
+ };
22
+ type PostMessageResult<T extends ExecType> = {
23
+ result: any;
24
+ exec: T;
25
+ res: any;
26
+ };
27
+ type CardReadParams = Partial<{
28
+ operatorname: string;
29
+ operatorcode: string;
30
+ location: number;
31
+ needLogin: boolean;
32
+ interfaceid: string;
33
+ iar1Json: AnyObject;
34
+ personinfo: AnyObject;
35
+ transdata: AnyObject;
36
+ loginCode: string;
37
+ transtype: string;
38
+ transchannel: string;
39
+ }>;
40
+ type CardReadResult = {
41
+ returncode: number;
42
+ returnmsg: string;
43
+ } & Partial<{
44
+ returndata: {
45
+ persioninfo?: AnyObject;
46
+ };
47
+ cardid: string;
48
+ cardno: string;
49
+ }>;
50
+ type CardReadOptions = Partial<{
51
+ basicParams: CardReadParams | (() => CardReadParams);
52
+ }>;
53
+ }
@@ -0,0 +1,9 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
2
+ import { CONFIG_MAP } from '../constants';
3
+ export declare function getSerialNumber(): string;
4
+ export declare function getTranstime(): string;
5
+ export declare function pad2(n: number): string | number;
6
+ export declare function generateTimeRequestNumber(): string;
7
+ export declare function insuranceLog(...messages: any[]): void;
8
+ export declare function getErrorMessageByType(type?: string): string;
9
+ export declare function getDataMessageByData(_data: string | AnyObject, configMap?: typeof CONFIG_MAP): any;
@@ -0,0 +1 @@
1
+ import{isString as e}from"lodash-es";function n(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function t(){return o()+parseInt(1e3*Math.random()+"")}function r(e){return e<10?"0"+e:e}function o(){const e=new Date;return e.getFullYear().toString()+r(e.getMonth()+1)+r(e.getDate())+r(e.getHours())+r(e.getMinutes())+r(e.getSeconds())}function a(...e){return console.log("[INSURANCE-SDK]: ",...e)}const d={fastReport:"打印服务异常",newdsfz:"身份证读卡接口服务异常",newdhyk:"会员读卡接口服务异常",pos:"pos接口服务异常"};function u(e){return e&&d[e]||"请检查医保服务是否正常"}function s(n,t){var r;e(n)&&(n=JSON.parse(n));const o=n,{type:a="",returncodes:d=[]}=t||{};if(d.includes(null!=(r=o.returncode)?r:"")){if("newdhyk"===a)return o.returndata.cardinfo&&o.returndata.cardinfo.cardno?o.returndata.cardinfo:Promise.reject("未获取到卡号");if("newdsfz"===a){let n=null,t=null;return e(o.returndata)?(n=JSON.parse(o.returndata),t=n.cardinfo):t=o.returndata.cardinfo,t={...t,Sex:t.sex,Sex_Code:t.sex_code,Name:t.name,Age:t.age,Age_Code:t.age_code,Age_Name:t.age_name,BirthDate:t.birthdate,Nation_Name:t.nation_name,Nation_Code:t.nation_code,Address:t.address,CardNo:t.cardno,HasPhoto:t.hasphoto},t}return o}return Promise.reject(a+"--"+o.returnmsg)}export{o as generateTimeRequestNumber,s as getDataMessageByData,u as getErrorMessageByType,n as getSerialNumber,t as getTranstime,a as insuranceLog,r as pad2};
@@ -0,0 +1,6 @@
1
+ import { ComponentInternalInstance } from 'vue';
2
+ export declare class ReadHealthCard {
3
+ rendered: boolean;
4
+ static createMsg(message: string): string;
5
+ show(instance?: ComponentInternalInstance): Promise<string>;
6
+ }
@@ -0,0 +1 @@
1
+ import{ref as e,render as r,createVNode as t,withCtx as n,nextTick as o}from"vue";import{createProviderWrapper as a}from"../../../../shared/utils/index.js";import s from"../components/readCardDialog.vue.js";class d{constructor(){this.rendered=!1}static createMsg(e){return`[ReadHealthCardDialog] ${e}`}show(i){return this.rendered?Promise.reject(d.createMsg("请勿重复打开弹窗")):new Promise(((l,u)=>{this.rendered=!0;const c=document.createElement("div"),m=e(!1),h=a(i);var f;function p(){u(d.createMsg("弹窗关闭"))}function v(e){l(e),m.value=!1}r(t(h,null,{default:n((()=>t(s,{show:m.value,"onUpdate:show":e=>m.value=e,onConfirm:v,onClose:p,onAfterLeave:()=>function(e){if(!e.parentElement)return;C.rendered=!1,e.parentElement.removeChild(e)}(c)},null)),i)}),c),f=c,document.body.appendChild(f),o((()=>m.value=!0));const C=this}))}}export{d as ReadHealthCard};
@@ -34,9 +34,6 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
34
34
  emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
35
35
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
36
36
  canvas: import("vue").Ref<any>;
37
- propItems: any;
38
- redrawPoints: import("vue").Ref<any>;
39
- select: import("vue").Ref<any>;
40
37
  pointTipProps: {
41
38
  show: boolean;
42
39
  point: {
@@ -54,28 +51,14 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
54
51
  list: any[];
55
52
  target: any;
56
53
  };
54
+ propItems: any;
55
+ redrawPoints: import("vue").Ref<any>;
56
+ select: import("vue").Ref<any>;
57
57
  clickMenu: import("vue").Ref<any>;
58
58
  init: () => {
59
59
  propItems: any;
60
60
  redrawPoints: import("vue").Ref<any>;
61
61
  select: import("vue").Ref<any>;
62
- pointTipProps: {
63
- show: boolean;
64
- point: {
65
- x: number;
66
- y: number;
67
- };
68
- list: string[];
69
- };
70
- pointMenuProps: {
71
- show: boolean;
72
- point: {
73
- x: number;
74
- y: number;
75
- };
76
- list: any[];
77
- target: any;
78
- };
79
62
  clickMenu: import("vue").Ref<any>;
80
63
  };
81
64
  PopupTip: import("vue").DefineComponent<{
@@ -36,9 +36,6 @@ declare const _default: import("vue").DefineComponent<{
36
36
  emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
37
37
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
38
38
  canvas: import("vue").Ref<any>;
39
- propItems: any;
40
- redrawPoints: import("vue").Ref<any>;
41
- select: import("vue").Ref<any>;
42
39
  pointTipProps: {
43
40
  show: boolean;
44
41
  point: {
@@ -56,28 +53,14 @@ declare const _default: import("vue").DefineComponent<{
56
53
  list: any[];
57
54
  target: any;
58
55
  };
56
+ propItems: any;
57
+ redrawPoints: import("vue").Ref<any>;
58
+ select: import("vue").Ref<any>;
59
59
  clickMenu: import("vue").Ref<any>;
60
60
  init: () => {
61
61
  propItems: any;
62
62
  redrawPoints: import("vue").Ref<any>;
63
63
  select: import("vue").Ref<any>;
64
- pointTipProps: {
65
- show: boolean;
66
- point: {
67
- x: number;
68
- y: number;
69
- };
70
- list: string[];
71
- };
72
- pointMenuProps: {
73
- show: boolean;
74
- point: {
75
- x: number;
76
- y: number;
77
- };
78
- list: any[];
79
- target: any;
80
- };
81
64
  clickMenu: import("vue").Ref<any>;
82
65
  };
83
66
  PopupTip: import("vue").DefineComponent<{
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,onMounted as t,onBeforeUnmount as s,openBlock as o,createElementBlock as a,Fragment as i,createElementVNode as n,createBlock as p,mergeProps as u,unref as c,createCommentVNode as l}from"vue";import{fabric as m}from"../../../shared/utils/fabricjs/index.js";import h from"./components/PopupTip.vue.js";import f from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import{useBirthProcessChart as d}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as v}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";var w=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:w,emit:g}){const C=e,j=r(null),P=r(),{propItems:y,redrawPoints:b,select:I,pointTipProps:M,pointMenuProps:T,clickMenu:x}=function(){const e=[P,C,g,j];switch(C.type){case"birthProcess":return d(...e);case"surgicalAnesthesia":return k(...e);default:return v(...e)}}();return t((()=>{P.value=new m.Canvas(j.value,{width:y.canvasWidth,height:y.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0,allowTouchScrolling:!0})})),s((()=>{P.value.off(),P.value.clear()})),w({redrawPoints:b,select:I,canvas:P}),(e,r)=>(o(),a(i,null,[n("canvas",{ref_key:"canvasRef",ref:j},null,512),P.value?(o(),p(h,u({key:0,propItems:c(y)},c(M)),null,16,["propItems"])):l("v-if",!0),P.value?(o(),p(c(f),u({key:1,propItems:c(y)},c(T),{show:c(T).show,"onUpdate:show":r[0]||(r[0]=e=>c(T).show=e),onClickMenu:c(x)}),null,16,["propItems","show","onClickMenu"])):l("v-if",!0)],64))}});export{w as default};
1
+ import{defineComponent as e,ref as t,reactive as r,onMounted as s,onBeforeUnmount as o,openBlock as a,createElementBlock as i,Fragment as n,createElementVNode as u,createBlock as p,mergeProps as l,unref as c,createCommentVNode as h}from"vue";import{fabric as m}from"../../../shared/utils/fabricjs/index.js";import f from"./components/PopupTip.vue.js";import d from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import{useBirthProcessChart as v}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as w}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";var g=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:g,emit:y}){const C=e,j=t(null),b=t(),P=r({show:!1,point:{x:0,y:0},list:[]}),I=r({show:!1,point:{x:0,y:0},list:[],target:null}),{propItems:x,redrawPoints:M,select:A,clickMenu:R}=function(){const e=[b,C,y,j,P,I];switch(C.type){case"birthProcess":return v(...e);case"surgicalAnesthesia":return k(...e);default:return w(...e)}}();return s((()=>{b.value=new m.Canvas(j.value,{width:x.canvasWidth,height:x.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0,allowTouchScrolling:!0})})),o((()=>{b.value.off(),b.value.clear()})),g({redrawPoints:M,select:A,canvas:b}),(e,t)=>(a(),i(n,null,[u("canvas",{ref_key:"canvasRef",ref:j},null,512),b.value?(a(),p(f,l({key:0,propItems:c(x)},P),null,16,["propItems"])):h("v-if",!0),b.value?(a(),p(c(d),l({key:1,propItems:c(x)},I,{show:I.show,"onUpdate:show":t[0]||(t[0]=e=>I.show=e),onClickMenu:c(R)}),null,16,["propItems","show","onClickMenu"])):h("v-if",!0)],64))}});export{g as default};
@@ -1,7 +1,8 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: AnyObject, pointMenuProps: AnyObject): {
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
+ export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
6
  clickMenu: ({ item, target }: {
6
7
  item: any;
7
8
  target: any;
@@ -1,26 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
+ export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
6
  propItems: any;
6
7
  redrawPoints: Ref<any>;
7
8
  select: Ref<any>;
8
- pointTipProps: {
9
- show: boolean;
10
- point: {
11
- x: number;
12
- y: number;
13
- };
14
- list: string[];
15
- };
16
- pointMenuProps: {
17
- show: boolean;
18
- point: {
19
- x: number;
20
- y: number;
21
- };
22
- list: any[];
23
- target: any;
24
- };
25
9
  clickMenu: Ref<any>;
26
10
  };
@@ -1 +1 @@
1
- import{ref as e,reactive as a,computed as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as n}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import{useBirthProcess as o}from"./useBirthProcess.js";function d(d,v,c,h){const p=e(),m=e(),f=e(),x=a({show:!1,point:{x:0,y:0},list:[]}),g=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=t((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=t((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=t((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),b=t((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),j=t((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=t((()=>v.data.grid.mainXCell)),C=t((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=t((()=>(j.value-b.value)/A.value)),Y=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),P=t((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),S=t((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!P.value)return P.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return H.value-l*r*Y.value})),H=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-Y.value*t})),X=t((()=>i(v.data.xAxis.time.startTime))),F=t((()=>36e5/k.value)),R=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),W=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/Y.value})),M=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),O=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),T=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:b.value,endX:j.value,originY:P.value,endY:H.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:M.value,scaleValues:v.data.scaleValues,event:O.value,originYCervix:S.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=o(d,T,c,x,g);m.value=a,f.value=e,s(h.value);const{select:t}=n(d,T,c);p.value=t}))})),{propItems:T,redrawPoints:m,select:p,pointTipProps:x,pointMenuProps:g,clickMenu:f}}export{d as useBirthProcessChart};
1
+ import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as d}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,v,c,h,m,f){const g=e(),p=e(),x=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=a((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),b=a((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),j=a((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=a((()=>v.data.grid.mainXCell)),C=a((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=a((()=>(j.value-b.value)/A.value)),Y=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),S=a((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),H=a((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!S.value)return S.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return P.value-l*r*Y.value})),P=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-Y.value*t})),X=a((()=>i(v.data.xAxis.time.startTime))),F=a((()=>36e5/k.value)),R=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||10)})),O=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),M=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:b.value,endX:j.value,originY:S.value,endY:P.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:O.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:H.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=n(o,N,c,m,f);p.value=a,x.value=e,s(h.value);const{select:t}=d(o,N,c);g.value=t}))})),{propItems:N,redrawPoints:p,select:g,clickMenu:x}}export{o as useBirthProcessChart};
@@ -1,4 +1,5 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject): void;
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): void;
@@ -1 +1 @@
1
- import{drawLine as t,drawPoint as e}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{isEffectiveNode as i,getTime as s}from"../../utils/index.js";import{cloneDeep as l}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function r(r,u){const{cumputedX:a,cumputedY:p,getXValue:f,getYValue:c}=n(u),{left:m,xCellWidth:d,yCellHeight:v,originX:h,endX:x,originY:g,endY:y,itemList:L,event:P,canvasHeight:j,scaleValues:k,xAxis:C,startTime:X}=u,Y=new Set,b=l(k);function M(t,e){if(i(t)&&function(t){const e=Date.parse(C.list.at(-1)),o=s(t);return o>=X&&o<=e}(t.time)){const o=a(t.time),n=p(e.type,e.range,t.value);return[o,n<g?g:n>y?y:n]}}o(r,u),b.forEach((o=>{o.dataList.forEach(((n,i)=>{!function(o,n,i){var s;const{type:l,dataList:a=[]}=i,p=[],f=[];function c(o,s,r,a){let c,m;const{pointAttr:d={},lineAttr:v={},title:L="",key:j,type:k="circle"}=a,C=M(a.list[r+1],i);o&&C&&!s.breakpoint&&o[0]!==C[0]&&(m=t([...o,...C],{...v}));const X=f[r-1],b={origin:{data:s,title:L,key:j||"",unit:i.unit,type:l,dataIndex:n,index:r},leftLine:X,rightLine:m,...d,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};X?c=e(k,{left:X.get("x2"),top:X.get("y2"),...b}):o&&(b.leftLine=null,c=e(k,{left:o[0],top:o[1],...b})),f.push(m),c&&(function(t){P.hovered&&(t.on("mouseover",(()=>{})),t.on("mouseout",(()=>{}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords();const e=t.prevPoint?t.prevPoint.left:h,o=t.nextPoint?t.nextPoint.left:x;t.top<g&&t.set("top",g),t.top>y&&t.set("top",y),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}(t),function(t){var e,o;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top})}(t)})),t.on("mouseup",(t=>{})))}(c),p.push(c),Y.add(c))}null==(s=o.list)||s.forEach(((t,e)=>{c(M(t,i),t,e,o)})),Promise.all(p).then((t=>{const e=f.filter((t=>t));let o=null;t=t.map((t=>(t&&o&&(o.nextPoint=t,t.prevPoint=o),o=t||o,t))),r.value.add(...e,...t)}))}(n,i,o)}))}))}export{r as useCenter};
1
+ import{drawLine as t,drawPoint as e}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as i,isEffectiveNode as l,getTime as s}from"../../utils/index.js";import{cloneDeep as r}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,u,c,d,f){const{cumputedX:p,cumputedY:v,getXValue:m,getYValue:h}=n(u),{left:g,xCellWidth:y,yCellHeight:x,originX:L,endX:k,originY:b,endY:j,itemList:P,event:w,canvasHeight:C,scaleValues:E,xAxis:X,startTime:Y}=u,$=new Set,A=r(E);function M(o,n,l){var s;const{type:r,unit:f,dataList:p=[]}=l,v=[],g=[];null==(s=o.list)||s.forEach(((s,p)=>{!function(o,s,p,y){let x,P;const{pointAttr:C={},lineAttr:E={},title:X="",key:Y,type:H="circle"}=y,I=D(y.list[p+1],l);o&&I&&!s.breakpoint&&o[0]!==I[0]&&(P=t([...o,...I],{...E}));const S=g[p-1],z={origin:{data:s,title:X,key:Y||"",unit:f,type:r,dataIndex:n,index:p},leftLine:S,rightLine:P,...C,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};S?x=e(H,{left:S.get("x2"),top:S.get("y2"),...z}):o&&(z.leftLine=null,x=e(H,{left:o[0],top:o[1],...z}));g.push(P),x&&(!function(t){w.hovered&&(t.on("mouseover",(()=>{V(t,"hover")})),t.on("mouseout",(()=>{d.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords();const e=t.prevPoint?t.prevPoint.left:L,o=t.nextPoint?t.nextPoint.left:k;t.top<b&&t.set("top",b),t.top>j&&t.set("top",j),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}(t),function(t){var e,o;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top})}(t),w.hovered&&V(t)})),t.on("mouseup",(e=>{if(d.show=!1,1===e.button){const{key:e,type:o}=t.origin,n={...t.origin,data:{...t.origin.data,time:m(t.left),value:h(o,t.top)}};a.value.discardActiveObject(),c("change",n),function(t,e="add"){const{dataIndex:o,data:n,index:l,key:s,type:r}=t,u=A.find((t=>t.type===r)),c=u.dataList.find((t=>t.key===s));switch(e){case"remove":c.list.splice(l,1);break;case"change":c.list[l]=n;break;default:{const t=i(n.time,c.data);c.list.splice(t,0,n);break}}!function(){var t;$.size&&(null==(t=a.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...$]))),$.clear(),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}()}(n,"change")}}))}(x),v.push(x),$.add(x))}(D(s,l),s,p,o)})),Promise.all(v).then((t=>{const e=g.filter((t=>t));let o=null;t=t.map((t=>(t&&o&&(o.nextPoint=t,t.prevPoint=o),o=t||o,t))),a.value.add(...e,...t)}))}function V(t,e="moving"){const{title:o,type:n,data:i,unit:l}=t.origin;d.point={x:t.left,y:t.top};const s=`${"hover"===e?i.value:h(n,t.top)}`;d.list=[`${o} ${s}${l||""}`,`时间 ${m(t.left).slice(-5)}`],d.show=!0}function D(t,e){if(l(t)&&function(t){const e=Date.parse(X.list.at(-1)),o=s(t);return o>=Y&&o<=e}(t.time)){const o=p(t.time),n=v(e.type,e.range,t.value);return[o,n<b?b:n>j?j:n]}}o(a,u),A.forEach((t=>{t.dataList.forEach(((e,o)=>{M(e,o,t)}))}))}export{a as useCenter};
@@ -1,26 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
+ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
6
  propItems: any;
6
7
  redrawPoints: Ref<any>;
7
8
  select: Ref<any>;
8
- pointTipProps: {
9
- show: boolean;
10
- point: {
11
- x: number;
12
- y: number;
13
- };
14
- list: string[];
15
- };
16
- pointMenuProps: {
17
- show: boolean;
18
- point: {
19
- x: number;
20
- y: number;
21
- };
22
- list: any[];
23
- target: any;
24
- };
25
9
  clickMenu: Ref<any>;
26
10
  };