cnhis-design-vue 3.1.48-beta.3 → 3.1.48-beta.31

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 (153) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +13 -0
  3. package/es/components/base-search/src/index.vue.d.ts +13 -0
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/base-search/style/index.css +1 -1
  6. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  7. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  8. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  9. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  10. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +37 -8
  11. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  12. package/es/components/card-reader-sdk/src/components/readCardDialog.vue.d.ts +19 -0
  13. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
  14. package/es/components/card-reader-sdk/src/constants/index.d.ts +60 -168
  15. package/es/components/card-reader-sdk/src/constants/index.js +1 -1
  16. package/es/components/card-reader-sdk/src/insuranceSDK.d.ts +1 -6
  17. package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
  18. package/es/components/card-reader-sdk/src/types/index.d.ts +27 -21
  19. package/es/components/card-reader-sdk/src/utils/index.d.ts +1 -1
  20. package/es/components/card-reader-sdk/src/utils/index.js +1 -1
  21. package/es/components/card-reader-sdk/src/utils/readHealthCard.d.ts +6 -1
  22. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
  23. package/es/components/classification/index.d.ts +3 -0
  24. package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -0
  25. package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -0
  26. package/es/components/classification/src/index.vue.d.ts +3 -0
  27. package/es/components/fabric-chart/src/constants/index.d.ts +4 -0
  28. package/es/components/fabric-chart/src/constants/index.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +7 -1
  31. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +7 -1
  33. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +2 -1
  36. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +2 -2
  38. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
  41. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  43. package/es/components/fabric-chart/src/utils/index.d.ts +6 -0
  44. package/es/components/fabric-chart/src/utils/index.js +1 -1
  45. package/es/components/field-set/index.d.ts +21 -1
  46. package/es/components/field-set/src/FieldSet.vue.d.ts +22 -2
  47. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  48. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  49. package/es/components/field-set/src/types/index.d.ts +8 -0
  50. package/es/components/field-set/src/utils/index.js +1 -1
  51. package/es/components/form-config/index.d.ts +28 -0
  52. package/es/components/form-config/src/FormConfig.vue.d.ts +28 -0
  53. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -0
  54. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +13 -0
  55. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  56. package/es/components/form-render/src/components/renderer/select.d.ts +12 -0
  57. package/es/components/form-render/src/components/renderer/select.js +1 -1
  58. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
  59. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  60. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +9 -6
  61. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  62. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  63. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  64. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +6 -0
  65. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  66. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  67. package/es/components/form-render/src/types/fieldItem.d.ts +5 -0
  68. package/es/components/form-render/src/types/index.d.ts +1 -0
  69. package/es/components/form-render/src/utils/index.js +1 -1
  70. package/es/components/form-render/style/index.css +1 -1
  71. package/es/components/iho-table/index.d.ts +8 -3
  72. package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -3
  73. package/es/components/iho-table/src/constants/index.d.ts +6 -6
  74. package/es/components/iho-table/src/constants/index.js +1 -1
  75. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -0
  76. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -1
  77. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
  78. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  79. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.d.ts +1 -0
  80. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -0
  81. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +4 -1
  82. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  83. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  84. package/es/components/iho-table/src/plugins/index.js +1 -1
  85. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  86. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.d.ts +1 -0
  87. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.js +1 -0
  88. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +18 -0
  89. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  90. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +2 -1
  91. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -1
  92. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +1 -1
  93. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  94. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
  95. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -1
  96. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
  97. package/es/components/iho-table/src/types/index.d.ts +4 -1
  98. package/es/components/iho-table/src/types/pluginType.d.ts +5 -3
  99. package/es/components/iho-table/src/utils/index.d.ts +2 -2
  100. package/es/components/iho-table/src/utils/index.js +1 -1
  101. package/es/components/iho-table/style/index.css +1 -1
  102. package/es/components/index.css +1 -1
  103. package/es/components/info-header/index.d.ts +13 -0
  104. package/es/components/info-header/src/InfoHeader.vue.d.ts +13 -0
  105. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  106. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  107. package/es/components/info-header/style/index.css +1 -1
  108. package/es/components/quick-search/style/index.css +1 -1
  109. package/es/components/scale-view/index.d.ts +26 -1
  110. package/es/components/scale-view/src/ScaleView.vue.d.ts +26 -1
  111. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  112. package/es/components/scale-view/src/components/DescribeContent.vue.d.ts +21 -0
  113. package/es/components/scale-view/src/components/DescribeContent.vue.js +1 -0
  114. package/es/components/scale-view/src/components/DescribeContent.vue2.js +1 -0
  115. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +2 -0
  116. package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
  117. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  118. package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +6 -2
  119. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  120. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  121. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  122. package/es/components/scale-view/src/utils/judge-types.d.ts +9 -1
  123. package/es/components/scale-view/src/utils/judge-types.js +1 -1
  124. package/es/components/scale-view/style/index.css +1 -1
  125. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  126. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  127. package/es/components/shortcut-setter/index.d.ts +4 -0
  128. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -0
  129. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  130. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +3 -0
  131. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  132. package/es/env.d.ts +25 -25
  133. package/es/shared/assets/img/failure.png.js +1 -1
  134. package/es/shared/assets/img/no-permission.png.js +1 -1
  135. package/es/shared/assets/img/nodata.png.js +1 -1
  136. package/es/shared/assets/img/notfound.png.js +1 -1
  137. package/es/shared/assets/img/qr.png.js +1 -1
  138. package/es/shared/assets/img/success.png.js +1 -1
  139. package/es/shared/assets/img/video.png.js +1 -1
  140. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  141. package/es/shared/assets/img/xb_big.png.js +1 -1
  142. package/es/shared/assets/img/xb_small.png.js +1 -1
  143. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  144. package/es/shared/package.json.js +1 -1
  145. package/es/shared/types/index.d.ts +1 -0
  146. package/es/shared/utils/business.js +1 -1
  147. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  148. package/es/shared/utils/tapable/index.d.ts +139 -0
  149. package/es/shared/utils/tapableLess.d.ts +28 -0
  150. package/es/shared/utils/tapableLess.js +1 -0
  151. package/package.json +2 -2
  152. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.d.ts +0 -1
  153. package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +0 -1
@@ -1,171 +1,63 @@
1
+ import { InsuranceType } from '../../../../../es/components/card-reader-sdk';
1
2
  /**
2
- * 交易命令映射
3
+ * 交易命令枚举
3
4
  */
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 = "newdhyk"
5
+ export declare enum TRANS_CMD {
6
+ NS_OUT_CHECKOUT_MODE = 100003,
7
+ NS_TEST_TIME = 100005,
8
+ NS_DOWNLOAD_CATELOG = 100203,
9
+ NS_UPLOAD_MATCH_INFO = 100204,
10
+ NS_UPLOAD_MATCH_INFO_UNDO = 100205,
11
+ NS_DOWNLOAD_MATCH_INFO = 100206,
12
+ NS_DOWNLOAD_DIS = 100207,
13
+ NS_DOWNLOAD_DICT = 100208,
14
+ NS_VERIFICATION_OF_ACCOUNT = 100209,
15
+ NS_UPLOAD_HOSITEM = 100201,
16
+ NS_UPLOAD_HOSITEM_UNDO = 100202,
17
+ NS_GETPERSONALINFO = 100210,
18
+ NS_CUSTOMSEARCH_CENTERINFO = 100211,
19
+ NS_YBINFOQIERUMGR = 100212,
20
+ NS_OUTPT_REGISTER = 100401,
21
+ NS_OUTPT_REGISTER_UNDO = 100403,
22
+ NS_OUTPT_REGISTER_SUCCESS = 100411,
23
+ NS_OUTPT_REGISTER_ERROR = 100412,
24
+ NS_OUTPT_CHECKOUT_BEFORE = 100406,
25
+ NS_OUTPT_CHECKOUT = 100407,
26
+ NS_OUTPT_REFUND = 100408,
27
+ NS_OUTPT_CHECKOUT_SUCCESS = 100409,
28
+ NS_OUTPT_CHECKOUT_ERROR = 100410,
29
+ NS_OUTPT_REFUND_SUCCESS = 100413,
30
+ NS_OUTPT_REFUND_ERROR = 100414,
31
+ NS_OUTPT_CHECKOUT_PAY_CONFIRM = 100415,
32
+ NS_OUT_UNPOST_CHECKOUT_REC_HANDLE = 100416,
33
+ NS_INPT_REGISTER = 100601,
34
+ NS_INPT_REGISTER_UNDO = 100603,
35
+ NS_INPT_UPLOAD_FEEITEM = 100604,
36
+ NS_INPT_TO_OWNPAY = 100605,
37
+ NS_INPT_PRECHECKOUT = 100606,
38
+ NS_INPT_REUPLOAD_FEEITEM = 100607,
39
+ NS_INPT_DOWNLOAD_FEEITEM = 100608,
40
+ NS_INPT_DELETE_FEEITEM = 100609,
41
+ NS_INPT_CLEAR_FEEITEM = 100610,
42
+ NS_INPT_CHECKOUT = 100613,
43
+ NS_INPT_CHECKOUT_CANCEL = 100614,
44
+ NS_INPT_UPLOAD_ORDERS = 100611,
45
+ NS_INPT_UPLOAD_FRONTSHEET_OF_MEDICALRECORD = 100612,
46
+ NS_GET_INPT_MANAGE_EXTEND_METHOD_LIST = 100616,
47
+ NS_INPT_MANAGE_EXTEND_METHOD = 100617,
48
+ NS_INPT_UPLOAD_MEDICALRECORD_UNDO = 100618,
49
+ NS_INPT_PREPAYMEN = 100619,
50
+ NS_INPT_PREPAYMEN_SUCCESS = 100620,
51
+ NS_INPT_PREPAYMEN_ERROR = 100621,
52
+ NS_INPT_PREPAYMEN_REFUND = 100622,
53
+ NS_INPT_PREPAYMEN_REFUND_SUCCESS = 100623,
54
+ NS_INPT_PREPAYMEN_REFUND_ERROR = 100624,
55
+ MEMBER_CARD_READ = 110021,
56
+ MEMBER_CARD_WRITE = 110022,
57
+ MEMBER_CARD_READER_RESET = 110023,
58
+ ID_CARD_READ = 110041,
59
+ ID_CARD_READER_RESET = 110042,
60
+ FAST_REPORT_OR_POS = 100000
171
61
  }
62
+ export declare const CONFIG_MAP: InsuranceType.CardReadParams;
63
+ export declare const INSURANCE_URL: string;
@@ -1 +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="newdhyk",a))(n||{});export{n as CARD_TYPE,i as CONFIG_MAP,r as HIS_INSURANCE_PARAMS,e as INSURANCE_URL,a as transcmdMapping};
1
+ var _=(_=>(_[_.NS_OUT_CHECKOUT_MODE=100003]="NS_OUT_CHECKOUT_MODE",_[_.NS_TEST_TIME=100005]="NS_TEST_TIME",_[_.NS_DOWNLOAD_CATELOG=100203]="NS_DOWNLOAD_CATELOG",_[_.NS_UPLOAD_MATCH_INFO=100204]="NS_UPLOAD_MATCH_INFO",_[_.NS_UPLOAD_MATCH_INFO_UNDO=100205]="NS_UPLOAD_MATCH_INFO_UNDO",_[_.NS_DOWNLOAD_MATCH_INFO=100206]="NS_DOWNLOAD_MATCH_INFO",_[_.NS_DOWNLOAD_DIS=100207]="NS_DOWNLOAD_DIS",_[_.NS_DOWNLOAD_DICT=100208]="NS_DOWNLOAD_DICT",_[_.NS_VERIFICATION_OF_ACCOUNT=100209]="NS_VERIFICATION_OF_ACCOUNT",_[_.NS_UPLOAD_HOSITEM=100201]="NS_UPLOAD_HOSITEM",_[_.NS_UPLOAD_HOSITEM_UNDO=100202]="NS_UPLOAD_HOSITEM_UNDO",_[_.NS_GETPERSONALINFO=100210]="NS_GETPERSONALINFO",_[_.NS_CUSTOMSEARCH_CENTERINFO=100211]="NS_CUSTOMSEARCH_CENTERINFO",_[_.NS_YBINFOQIERUMGR=100212]="NS_YBINFOQIERUMGR",_[_.NS_OUTPT_REGISTER=100401]="NS_OUTPT_REGISTER",_[_.NS_OUTPT_REGISTER_UNDO=100403]="NS_OUTPT_REGISTER_UNDO",_[_.NS_OUTPT_REGISTER_SUCCESS=100411]="NS_OUTPT_REGISTER_SUCCESS",_[_.NS_OUTPT_REGISTER_ERROR=100412]="NS_OUTPT_REGISTER_ERROR",_[_.NS_OUTPT_CHECKOUT_BEFORE=100406]="NS_OUTPT_CHECKOUT_BEFORE",_[_.NS_OUTPT_CHECKOUT=100407]="NS_OUTPT_CHECKOUT",_[_.NS_OUTPT_REFUND=100408]="NS_OUTPT_REFUND",_[_.NS_OUTPT_CHECKOUT_SUCCESS=100409]="NS_OUTPT_CHECKOUT_SUCCESS",_[_.NS_OUTPT_CHECKOUT_ERROR=100410]="NS_OUTPT_CHECKOUT_ERROR",_[_.NS_OUTPT_REFUND_SUCCESS=100413]="NS_OUTPT_REFUND_SUCCESS",_[_.NS_OUTPT_REFUND_ERROR=100414]="NS_OUTPT_REFUND_ERROR",_[_.NS_OUTPT_CHECKOUT_PAY_CONFIRM=100415]="NS_OUTPT_CHECKOUT_PAY_CONFIRM",_[_.NS_OUT_UNPOST_CHECKOUT_REC_HANDLE=100416]="NS_OUT_UNPOST_CHECKOUT_REC_HANDLE",_[_.NS_INPT_REGISTER=100601]="NS_INPT_REGISTER",_[_.NS_INPT_REGISTER_UNDO=100603]="NS_INPT_REGISTER_UNDO",_[_.NS_INPT_UPLOAD_FEEITEM=100604]="NS_INPT_UPLOAD_FEEITEM",_[_.NS_INPT_TO_OWNPAY=100605]="NS_INPT_TO_OWNPAY",_[_.NS_INPT_PRECHECKOUT=100606]="NS_INPT_PRECHECKOUT",_[_.NS_INPT_REUPLOAD_FEEITEM=100607]="NS_INPT_REUPLOAD_FEEITEM",_[_.NS_INPT_DOWNLOAD_FEEITEM=100608]="NS_INPT_DOWNLOAD_FEEITEM",_[_.NS_INPT_DELETE_FEEITEM=100609]="NS_INPT_DELETE_FEEITEM",_[_.NS_INPT_CLEAR_FEEITEM=100610]="NS_INPT_CLEAR_FEEITEM",_[_.NS_INPT_CHECKOUT=100613]="NS_INPT_CHECKOUT",_[_.NS_INPT_CHECKOUT_CANCEL=100614]="NS_INPT_CHECKOUT_CANCEL",_[_.NS_INPT_UPLOAD_ORDERS=100611]="NS_INPT_UPLOAD_ORDERS",_[_.NS_INPT_UPLOAD_FRONTSHEET_OF_MEDICALRECORD=100612]="NS_INPT_UPLOAD_FRONTSHEET_OF_MEDICALRECORD",_[_.NS_GET_INPT_MANAGE_EXTEND_METHOD_LIST=100616]="NS_GET_INPT_MANAGE_EXTEND_METHOD_LIST",_[_.NS_INPT_MANAGE_EXTEND_METHOD=100617]="NS_INPT_MANAGE_EXTEND_METHOD",_[_.NS_INPT_UPLOAD_MEDICALRECORD_UNDO=100618]="NS_INPT_UPLOAD_MEDICALRECORD_UNDO",_[_.NS_INPT_PREPAYMEN=100619]="NS_INPT_PREPAYMEN",_[_.NS_INPT_PREPAYMEN_SUCCESS=100620]="NS_INPT_PREPAYMEN_SUCCESS",_[_.NS_INPT_PREPAYMEN_ERROR=100621]="NS_INPT_PREPAYMEN_ERROR",_[_.NS_INPT_PREPAYMEN_REFUND=100622]="NS_INPT_PREPAYMEN_REFUND",_[_.NS_INPT_PREPAYMEN_REFUND_SUCCESS=100623]="NS_INPT_PREPAYMEN_REFUND_SUCCESS",_[_.NS_INPT_PREPAYMEN_REFUND_ERROR=100624]="NS_INPT_PREPAYMEN_REFUND_ERROR",_[_.MEMBER_CARD_READ=110021]="MEMBER_CARD_READ",_[_.MEMBER_CARD_WRITE=110022]="MEMBER_CARD_WRITE",_[_.MEMBER_CARD_READER_RESET=110023]="MEMBER_CARD_READER_RESET",_[_.ID_CARD_READ=110041]="ID_CARD_READ",_[_.ID_CARD_READER_RESET=110042]="ID_CARD_READER_RESET",_[_.FAST_REPORT_OR_POS=1e5]="FAST_REPORT_OR_POS",_))(_||{});const E=Object.freeze({interfaceid:"0",transcmd:100210,transtype:"YB0000",transchannel:"101",transsystem:"10"}),N="http://127.0.0.1:8031/HOInterfaceSvr";export{E as CONFIG_MAP,N as INSURANCE_URL,_ as TRANS_CMD};
@@ -2,8 +2,7 @@ import { AnyObject } from '../../../../es/shared/types';
2
2
  import { InsuranceType } from './types';
3
3
  export default class InsuranceSDK {
4
4
  private readonly webview;
5
- private configMap;
6
- private initParamsMap;
5
+ private requestParams;
7
6
  private currentMessageHandler;
8
7
  constructor(params?: {
9
8
  selfWindow?: any;
@@ -20,8 +19,4 @@ export default class InsuranceSDK {
20
19
  private initConfig;
21
20
  private initParams;
22
21
  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
22
  }
@@ -1 +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=this.messageHandlerQueue[0];if(!n)return Promise.reject(t("当前回执",a,"没有可用的handler"));const{resolve:r,reject:i,transcmd:o}=n,c=e(a.data)?s(a.data)||{}:a.data;if(!c||!["hisyb","login"].includes(c.exec))return i(t("当前回执不是hisyb消息"));const{transcmd:d}=c.res||{};if(o&&d&&`${o}`!=`${d}`)return i(t("交易命令不相等,当前transcmd",o,"返回transcmd",d));this.messageHandlerQueue.shift(),r(c)}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};
1
+ import{jsonParse as e}from"../../../shared/utils/index.js";import s from"axios";import{isString as t,omit as r}from"lodash-es";import{INSURANCE_URL as i,CONFIG_MAP as n,TRANS_CMD as a}from"./constants/index.js";import{insuranceLog as o,getDataMessageByData as l,getErrorMessageByType as d,getTranstime as u,getSerialNumber as c}from"./utils/index.js";var m;class h{constructor(e){var s,t;this.webview=null==(m=window.chrome)?void 0:m.webview,this.requestParams=null,this.currentMessageHandler=null,this.messageHandlerQueue=[],(null==e?void 0:e.selfWindow)&&(this.webview=null==(t=null==(s=null==e?void 0:e.selfWindow)?void 0:s.chrome)?void 0:t.webview),this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler))}messageHandler(s){const r=this.messageHandlerQueue.shift();if(!r)return Promise.reject(o("当前回执",s,"没有可用的handler"));const{resolve:i,reject:n,transcmd:a}=r,l=t(s.data)?e(s.data)||{}:s.data;if(!l||!["hisyb","login"].includes(l.exec))return n(o("当前回执不是hisyb消息"));const{transcmd:d}=l.res||{};if(a&&d&&`${a}`!=`${d}`)return n(o("交易命令不相等,当前transcmd",a,"返回transcmd",d));i(l)}async postMessage(s){return this.webview&&s?new Promise(((t,r)=>{var i;this.messageHandlerQueue.push({resolve:t,reject:r,transcmd:null==(i=e(s.data))?void 0:i.transcmd}),this.webview.postMessage(s)})).then((e=>e&&e.result&&e.exec===s.exec?e:Promise.reject())):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=null)}login(){var e,s;return this.postMessage({exec:"login",data:null!=(s=null==(e=this.requestParams)?void 0:e.loginCode)?s:"7777"})}async HOInterfaceSvr(e){const{transcmd:t,needLogin:n}=this.requestParams||{};try{if(this.webview){n&&await this.login();return(await this.postMessage({exec:"hisyb",data:JSON.stringify(r(e,["needLogin"]))})).res}const t=await s.post(i,JSON.stringify(r(e,["needLogin"])));return l(t.data)}catch(e){return Promise.reject(d(t))}}initConfig(e){this.requestParams=Object.assign({},n,e)}initParams(){var e,s;return{...this.requestParams,transcmd:null!=(s=null==(e=this.requestParams)?void 0:e.transcmd)?s:a.NS_GETPERSONALINFO,transtime:u(),serialnumber:c()}}getInsuranceInfoPromise(e){return this.initConfig(e),this.HOInterfaceSvr(this.initParams())}}export{h as default};
@@ -1,7 +1,8 @@
1
- import { AnyObject, Func } from '../../../../../es/shared/types';
1
+ import { AnyObject, Func, NumberRange } from '../../../../../es/shared/types';
2
+ import { TRANS_CMD } from '../../../../../es/components/card-reader-sdk/src/constants';
2
3
  export declare namespace InsuranceType {
3
- type ExecType = 'hisyb' | 'login';
4
- type IHOWindow = Window & {
4
+ export type ExecType = 'hisyb' | 'login';
5
+ export type IHOWindow = Window & {
5
6
  chrome: {
6
7
  webview: {
7
8
  addEventListener: (type: string, handler: Func) => void;
@@ -10,44 +11,49 @@ export declare namespace InsuranceType {
10
11
  };
11
12
  };
12
13
  };
13
- type MessageDataType = {
14
+ export type MessageDataType = {
14
15
  exec: ExecType;
15
16
  res: {
16
17
  transcmd: string;
17
18
  };
18
19
  };
19
- type MessageType = {
20
+ export type MessageType = {
20
21
  data: string | MessageDataType;
21
22
  };
22
- type PostMessageResult<T extends ExecType> = {
23
+ export type PostMessageResult<T extends ExecType> = {
23
24
  result: any;
24
25
  exec: T;
25
26
  res: any;
26
27
  };
27
- type CardReadParams = Partial<{
28
+ export type CardReadParams = Partial<{
28
29
  operatorname: string;
29
30
  operatorcode: string;
30
- location: number;
31
+ location: '0' | '1' | '2' | '';
31
32
  needLogin: boolean;
32
- interfaceid: string;
33
- iar1Json: AnyObject;
34
- personinfo: AnyObject;
33
+ interfaceid: number | string;
34
+ transtime: string;
35
+ serialnumber: string;
36
+ transcmd: TRANS_CMD;
35
37
  transdata: AnyObject;
36
38
  loginCode: string;
37
- transtype: string;
38
- transchannel: string;
39
+ transtype: 'YB0000' | 'IDCARD' | '';
40
+ transsystem: '10' | '11' | '99' | '';
41
+ transchannel: '101' | '102' | '103' | '104' | '999' | '';
39
42
  }>;
40
- type CardReadResult = {
41
- returncode: number;
43
+ type MapperIar<T extends any[], Res extends any[] = []> = T extends [infer F, ...infer Rest] ? MapperIar<Rest, [...Res, `iar${F extends number ? F : never}`]> : Res;
44
+ export type CardReadResult = {
45
+ returncode: number | string;
42
46
  returnmsg: string;
43
47
  } & Partial<{
44
- returndata: {
45
- persioninfo?: AnyObject;
46
- };
47
- cardid: string;
48
- cardno: string;
48
+ returndata: Partial<{
49
+ personinfo: Record<'address' | 'age' | 'birthday' | 'cardnum' | 'cardpwd' | 'folk' | 'idnumber' | 'location' | 'ownpay' | 'ptname' | 'pttype' | 'recordid' | 'sex' | 'updateflag', string>;
50
+ cardinfo: Partial<Record<'cardno' | 'cardid' | 'name' | 'sex' | 'sex_code' | 'birthday' | 'nation_name' | 'nation_code' | 'address' | 'idnumber' | 'idtype' | 'issuer' | 'issuedate' | 'expirydate' | 'hasphoto' | 'telphone' | 'companyname' | 'age' | 'age_code' | 'age_name' | 'ages', string>>;
51
+ iar1: Record<'acf01' | 'iaa01' | 'iab02' | 'iac03' | 'iad04' | 'iai03' | 'iak04' | 'iak05' | 'iak06' | 'iak22' | 'iar01' | 'iar10' | MapperIar<NumberRange<10, 75>>[number], string>;
52
+ }>;
53
+ transcmd: string;
49
54
  }>;
50
- type CardReadOptions = Partial<{
55
+ export type CardReadOptions = Partial<{
51
56
  basicParams: CardReadParams | (() => CardReadParams);
52
57
  }>;
58
+ export {};
53
59
  }
@@ -5,5 +5,5 @@ export declare function getTranstime(): string;
5
5
  export declare function pad2(n: number): string | number;
6
6
  export declare function generateTimeRequestNumber(): string;
7
7
  export declare function insuranceLog(...messages: any[]): any;
8
- export declare function getErrorMessageByType(type?: string): string;
8
+ export declare function getErrorMessageByType(code?: number): string;
9
9
  export declare function getDataMessageByData(_data: string | AnyObject, configMap?: typeof CONFIG_MAP): any;
@@ -1 +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),e.reduce(((e,n)=>e+n))}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};
1
+ import{jsonParse as e}from"../../../../shared/utils/index.js";import{isString as t}from"lodash-es";import{TRANS_CMD as n}from"../constants/index.js";function r(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function o(){return d()+parseInt(1e3*Math.random()+"")}function a(e){return e<10?"0"+e:e}function d(){const e=new Date;return e.getFullYear().toString()+a(e.getMonth()+1)+a(e.getDate())+a(e.getHours())+a(e.getMinutes())+a(e.getSeconds())}function i(...e){return console.log("[INSURANCE-SDK]: ",...e),e.reduce(((e,t)=>e+t))}const s={[n.ID_CARD_READ]:"身份证读卡接口服务异常",[n.MEMBER_CARD_READ]:"会员读卡接口服务异常",[n.FAST_REPORT_OR_POS]:"打印或pos接口服务异常"};function u(e){return e&&s[e]||"请检查医保服务是否正常"}function c(r,o){var a;t(r)&&(r=JSON.parse(r));const d=r,{transcmd:i=n.NS_GETPERSONALINFO}=o||{};if(["0","1"].includes(null!=(a=d.returncode)?a:"")){if(i===n.NS_GETPERSONALINFO)return d.returndata.cardinfo&&d.returndata.cardinfo.cardno?d.returndata.cardinfo:Promise.reject("未获取到卡号");if(i===n.ID_CARD_READ){const n=t(d.returndata)?e(d.returndata).cardinfo:d.returndata.cardinfo;return Object.assign(n,{Sex:n.sex,Sex_Code:n.sex_code,Name:n.name,Age:n.age,Age_Code:n.age_code,Age_Name:n.age_name,BirthDate:n.birthdate,Nation_Name:n.nation_name,Nation_Code:n.nation_code,Address:n.address,CardNo:n.cardno,HasPhoto:n.hasphoto}),n}return d}return Promise.reject(d.returnmsg)}export{d as generateTimeRequestNumber,c as getDataMessageByData,u as getErrorMessageByType,r as getSerialNumber,o as getTranstime,i as insuranceLog,a as pad2};
@@ -1,6 +1,11 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
1
2
  import { ComponentInternalInstance } from 'vue';
2
3
  export declare class ReadHealthCard {
3
4
  rendered: boolean;
4
5
  static createMsg(message: string): string;
5
- show(instance?: ComponentInternalInstance): Promise<string>;
6
+ show({ instance, inputProps, modalProps }?: {
7
+ instance?: ComponentInternalInstance;
8
+ inputProps?: AnyObject;
9
+ modalProps?: AnyObject;
10
+ }): Promise<string>;
6
11
  }
@@ -1 +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};
1
+ import{ref as e,render as r,createVNode as t,withCtx as n,mergeProps as o,nextTick as s}from"vue";import{createProviderWrapper as a}from"../../../../shared/utils/index.js";import d from"../components/readCardDialog.vue.js";class i{constructor(){this.rendered=!1}static createMsg(e){return`[ReadHealthCardDialog] ${e}`}show({instance:l,inputProps:u,modalProps:c}={}){return this.rendered?Promise.reject(i.createMsg("请勿重复打开弹窗")):new Promise(((m,p)=>{this.rendered=!0;const h=document.createElement("div"),f=e(!1),v=a(l);var C;function P(){p(i.createMsg("弹窗关闭"))}function g(e){m(e),f.value=!1}r(t(v,null,{default:n((()=>t(d,o({show:f.value,"onUpdate:show":e=>f.value=e,onConfirm:g,onClose:P,onAfterLeave:()=>function(e){if(!e.parentElement)return;w.rendered=!1,e.parentElement.removeChild(e)}(h)},{inputProps:u,modalProps:c}),null)),l)}),h),C=h,document.body.appendChild(C),s((()=>f.value=!0));const w=this}))}}export{i as ReadHealthCard};
@@ -607,6 +607,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
607
607
  };
608
608
  }, {
609
609
  $message: import("naive-ui").MessageApi;
610
+ menuProps: {
611
+ class: string;
612
+ };
610
613
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
611
614
  actionList_prop: {
612
615
  type: import("vue").PropType<import("..").IClassifyListType>;
@@ -84,6 +84,9 @@ declare const _default: import("vue").DefineComponent<{
84
84
  };
85
85
  }, {
86
86
  $message: import("naive-ui").MessageApi;
87
+ menuProps: {
88
+ class: string;
89
+ };
87
90
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
88
91
  actionList_prop: {
89
92
  type: import("vue").PropType<import("../../../..").IClassifyListType>;
@@ -394,6 +394,9 @@ declare const _default: import("vue").DefineComponent<{
394
394
  };
395
395
  }, {
396
396
  $message: import("naive-ui").MessageApi;
397
+ menuProps: {
398
+ class: string;
399
+ };
397
400
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
398
401
  actionList_prop: {
399
402
  type: import("vue").PropType<IClassifyListType>;
@@ -608,6 +608,9 @@ declare const _default: import("vue").DefineComponent<{
608
608
  };
609
609
  }, {
610
610
  $message: import("naive-ui").MessageApi;
611
+ menuProps: {
612
+ class: string;
613
+ };
611
614
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
612
615
  actionList_prop: {
613
616
  type: PropType<IClassifyListType>;
@@ -12,6 +12,10 @@ export declare const PAIN_MENU: {
12
12
  value: undefined;
13
13
  type: string;
14
14
  }[];
15
+ export declare const OTHER_MENU: {
16
+ label: string;
17
+ type: string;
18
+ }[];
15
19
  export declare const OVERLAP: {
16
20
  yemai: {
17
21
  stroke: string;
@@ -1 +1 @@
1
- const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l="#2563F4",r="#FF1818",a={yemai:{stroke:r,strokeX:l,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:r,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:l},gangmai:{radius:6,radiusCircle:3,stroke:l,fillCircle:r},xinmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:r},humai:{radius:6,fill:"green"},ermai:{stroke:r,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:l}};export{a as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
1
+ const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};export{l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:O,endY:W,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+O/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+O/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>W&&e.set("top",W),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>W?W:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:W-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=W-o*$*k,a=0===o?W-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:W,left:P,top:W/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+O/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:W+y;g.push(n([m+e*O,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*O,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(W-i-t)/e,W-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=W}function h([e,t]){return[I+e,W-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,W-G(o,a,l.value)],[p,h]=[S(c.time)-I,W-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=W&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],x.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y(o,"key",O).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y(u.left,"key",O).includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(W-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:W,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+W/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+W/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>O?O:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=O-o*$*k,a=0===o?O-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+W/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:O+y;g.push(n([m+e*W,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*W,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(O-i-t)/e,O-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=O}function h([e,t]){return[I+e,O-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,O-G(o,a,l.value)],[p,h]=[S(c.time)-I,O-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...ee].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y([...ee],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y([...ee],u.left,"key").includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
@@ -2,4 +2,10 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
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;
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ redrawPoints: (ItemObj?: AnyObject) => void;
7
+ clickMenu: ({ item, target }: {
8
+ item: any;
9
+ target: any;
10
+ }) => void;
11
+ };
@@ -1 +1 @@
1
- import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as i,isEffectiveNode as l,getTime as r}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,f,u,p,c){const{cumputedX:d,cumputedY:v,getXValue:m,getYValue:h}=o(f),{xCellWidth:g,yCellHeight:L,originX:y,endX:x,originY:k,endY:P,event:A,scaleValues:b,xAxis:j,startTime:w,timeXCell:C}=f,X=new Set,E=new Set,Y=s(b);let M=[];function S(n,o,i){var l;const{type:r,unit:s,dataList:c=[]}=i,d=[],v=[];null==(l=n.list)||l.forEach(((l,c)=>{!function(n,l,c,L){let b,j;const{pointAttr:w={},lineAttr:Y={},title:S="",key:O,type:D="circle"}=L,I=z(L.list[c+1],i);n&&I&&!l.breakpoint&&n[0]!==I[0]&&(j=e([...n,...I],Y));const J=v[c-1],N={origin:{data:l,title:S,key:O||"",unit:s,type:r,dataIndex:o,index:c,lineAttr:Y},leftLine:J,rightLine:j,...w,...f.event.hovered?f.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:f.event};J?b=t(D,{left:J.get("x2"),top:J.get("y2"),...N}):n&&(N.leftLine=null,b=t(D,{left:n[0],top:n[1],...N}));v.push(j),b&&(b.originLeft=b.left,b.originTop=b.top,function(e){A.hovered&&(e.on("mouseover",(()=>{V(e,"hover")})),e.on("mouseout",(()=>{p.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/C,n=e.prevPoint?e.prevPoint.left+t:y,o=e.nextPoint?e.nextPoint.left-t:x;e.top<k&&e.set("top",k),e.top>P&&e.set("top",P),e.left<n&&e.set("left",n),e.left>o&&e.set("left",o)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),A.hovered&&V(e),function(e){const{originLeft:t,originTop:n,left:o,top:i,origin:l}=e,r=~~((o-t)/g);if(o>t+g&&!e.nextPoint){if(0===M.length){$(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const o=t+g*r;if(M.every((e=>e.left!==o))){const t=m(o),n=h(l.type,i);M.push({data:{time:t,value:n},left:o,top:i}),$(e,[...e.prevPointer,o,i])}M.length<r&&function(e,t){const{originLeft:n,originTop:o,origin:i}=e;let l=1;for(;l<=t;){const t=n+g*l,r=M.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=M.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=M[l-1]||{left:n,top:o},f=~~((r.left-(t-g))/g),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:m(t),value:h(i.type,s.top)},M.splice(l,0,s),$(e,[a.left,a.top,s.left,s.top])}}l++}}(e,r)}if(M.length>0&&o<M[M.length-1].left){for(const e of E)e.left>o&&(e.leftLine&&a.value.remove(e.leftLine),a.value.remove(e));if(M=M.filter((e=>e.left<=o)),0===M.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of E)e.leftLine&&a.value.remove(e.leftLine),a.value.remove(e)}if(M.length>0){const t=M.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(p.show=!1,1===t.button){const{key:t,type:n}=e.origin,o={...e.origin,data:{...e.origin.data,time:m(e.left),value:h(n,e.top)}};a.value.discardActiveObject(),M.length>0?(o.data=M.map((e=>e.data)),u("add",o),T(o,"add")):(u("change",o),T(o,"change"))}}))}(b),d.push(b),X.add(b))}(z(l,i),l,c,n)})),Promise.all(d).then((e=>{const t=v.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),a.value.add(...t,...e)}))}function $(t,n){const[o,i,l,r]=n;t.clone((o=>{o.set({left:l,top:r}),t.prevPointer=[l,r];const i=e(n,t.origin.lineAttr);o.leftLine=i,E.add(o),a.value.add(i,o)}))}function T(e,t="add"){const{dataIndex:n,data:o,index:l,key:r,type:s}=e,f=Y.find((e=>e.type===s)).dataList.find((e=>e.key===r));switch(t){case"remove":f.list.splice(l,1);break;case"change":f.list[l]=o;break;default:{const e=Array.isArray(o)?o[0].time:o.time,t=i(e,f.list),n=Array.isArray(o)?o:[o];f.list.splice(t,0,...n);break}}var u,p;X.size&&(null==(u=a.value)||u.remove(...O([...X]))),E.size&&(null==(p=a.value)||p.remove(...O([...E]))),X.clear(),E.clear(),M=[],Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))}))}function O(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function V(e,t="moving"){const{title:n,type:o,data:i,unit:l}=e.origin;p.point={x:e.left,y:e.top};const r=`${"hover"===t?i.value:h(o,e.top)}`;p.list=[`${n} ${r}${l||""}`,`时间 ${m(e.left).slice(-5)}`],p.show=!0}function z(e,t){if(l(e)&&function(e){const t=Date.parse(j.list.at(-1)),n=r(e);return n>=w&&n<=t}(e.time)){const n=d(e.time),o=v(t.type,t.range,e.value);return[n,o<k?k:o>P?P:o]}}n(a,f),Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))}))}export{a as useCenter};
1
+ import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as o}from"../useCommon.js";import"vue";import{getPointRange as l,getIndex as r,isEffectiveNode as a,getTime as s}from"../../utils/index.js";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function u(u,p,c,d,m){const{cumputedX:v,cumputedY:g,getXValue:h,getYValue:y}=i(p),{xCellWidth:L,yCellHeight:x,originX:k,endX:P,originY:b,endY:A,event:w,scaleValues:j,xAxis:C,startTime:I,timeXCell:T,itemList:X}=p,E=new Map,M=new Set,Y=f(j);let _=[];n(u,p);const{getEqualXTypes:V,handleAddPrevent:$}=o(u,c,p);function O(){Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))})),function(){if(!w.evented)return;u.value.on("mouse:up",(e=>{if(3===e.button){const{x:t=0,y:n=0}=e.pointer||{};if(t>=k&&t<=P&&n>=b&&n<=A)if(m.point={x:t,y:n},m.show=!0,e.target){if("main"!==e.target.__type)return;m.target=e.target,m.list=["删除节点"];const{minLeft:t,maxLeft:n,minTop:i,maxTop:o}=l(e.target);H().forEach((l=>{"main"===l.__type&&l.left>t&&l.left<n&&l.top>i&&l.top<o&&m.list.push({renderItem:()=>l.origin.title,origin:{...l.origin},mode:"remove",pointer:e.pointer})})),1===m.list.length&&(m.show=!1,console.log("当前时间段内无可删除节点"))}else m.target=null,m.list=["新增节点"],X.forEach((n=>{V(H(),t,"key").includes(n.key)||m.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key},pointer:e.pointer})})),1===m.list.length&&(m.show=!1,$("repeat"),console.log("当前时间段内无可新增节点"))}}))}()}function S(n,i,o){var l;const{type:r,unit:a,dataList:s=[]}=o,f=[];E.set(n.key,[]),null==(l=n.list)||l.forEach(((l,s)=>{!function(n,l,s,m){var v;let g,x;const{pointAttr:j={},lineAttr:C={},title:I="",key:X,type:Y="circle"}=m,V=G(m.list[s+1],o);n&&V&&!l.breakpoint&&n[0]!==V[0]&&(x=e([...n,...V],C));const $=f[s-1],O={origin:{data:l,title:I,key:X||"",unit:a,type:r,dataIndex:i,index:s,lineAttr:C},__type:"main",leftLine:$,rightLine:x,...j,...p.event.hovered?p.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:p.event};$?g=t(Y,{left:$.get("x2"),top:$.get("y2"),...O}):n&&(O.leftLine=null,g=t(Y,{left:n[0],top:n[1],...O}));f.push(x),g&&(g.originLeft=g.left,g.originTop=g.top,function(e){w.hovered&&(e.on("mouseover",(()=>{q(e,"hover")})),e.on("mouseout",(()=>{d.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/T,n=e.prevPoint?e.prevPoint.left+t:k,i=e.nextPoint?e.nextPoint.left-t:P;e.top<b&&e.set("top",b),e.top>A&&e.set("top",A),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),w.hovered&&q(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/L);if(i>t+L&&!e.nextPoint){if(0===_.length){z(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+L*r;if(_.every((e=>e.left!==i))){const t=h(i),n=y(l.type,o);_.push({data:{time:t,value:n},left:i,top:o}),z(e,[...e.prevPointer,i,o])}_.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+L*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-L))/L),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:h(t),value:y(o.type,a.top)},_.splice(l,0,a),z(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(_.length>0&&i<_[_.length-1].left){for(const e of M)e.left>i&&(e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of M)e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(d.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:h(e.left),value:y(n,e.top)}};if(u.value.discardActiveObject(),_.length>0){const e=_.map((e=>e.data));c("add",{...i,data:e}),D({...i,data:e})}else c("change",i),D(i,"change")}}))}(g),null==(v=E.get(X))||v.push(g))}(G(l,o),l,s,n)})),Promise.all(E.get(n.key)).then((e=>{const t=f.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),u.value.add(...t,...e)}))}function z(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,M.add(i),u.value.add(o,i)}))}function D(e,t="add"){const{dataIndex:n,data:i,index:o,key:l,type:a}=e,s=Y.find((e=>e.type===a)),f=s.dataList.find((e=>e.key===l));switch(t){case"remove":f.list.splice(o,1);break;case"change":f.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=r(e,f.list),n=Array.isArray(i)?i:[i];f.list.splice(t,0,...n);break}}J({dataIndex:n,scaleValue:s})}function J(e){var t,n,i;if(M.size&&(null==(t=u.value)||t.remove(...N([...M]))),M.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=u.value)||n.remove(...N(E.get(o.key))),E.delete(o.key),S(o,t,i)}else E.size&&(null==(i=u.value)||i.remove(...N(H()))),E.clear(),O()}function N(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function q(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;d.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:y(i,e.top)}`;d.list=[`${n} ${r}${l||""}`,`时间 ${h(e.left).slice(-5)}`],d.show=!0}function G(e,t){if(a(e)&&function(e){const t=Date.parse(C.list.at(-1)),n=s(e);return n>=I&&n<=t}(e.time)){const n=v(e.time),i=g(t.type,t.range,e.value);return[n,i<b?b:i>A?A:i]}}function H(){return Array.from(E.values()).flat()}return O(),{redrawPoints:J,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(c("remove",n),D(n,"remove")):(Object.assign(n,{data:{time:h(e.pointer.x),value:y(e.origin.type,e.pointer.y)}}),c("add",n),D(n))}}}export{u as useCenter};
@@ -1,4 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
3
4
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function): void;
5
+ export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ clickMenu: ({ item, target }: {
7
+ item: AnyObject;
8
+ target: any;
9
+ }) => void;
10
+ };