cnhis-design-vue 3.1.48-release.2 → 3.1.48-release.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/base-search/index.d.ts +13 -0
- package/es/components/base-search/src/index.vue.d.ts +13 -0
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +29 -21
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue.d.ts +19 -0
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
- package/es/components/card-reader-sdk/src/constants/index.d.ts +60 -168
- package/es/components/card-reader-sdk/src/constants/index.js +1 -1
- package/es/components/card-reader-sdk/src/insuranceSDK.d.ts +1 -6
- package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
- package/es/components/card-reader-sdk/src/types/index.d.ts +11 -11
- package/es/components/card-reader-sdk/src/utils/index.d.ts +1 -1
- package/es/components/card-reader-sdk/src/utils/index.js +1 -1
- package/es/components/card-reader-sdk/src/utils/readHealthCard.d.ts +6 -1
- package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +4 -0
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +7 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +7 -2
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +6 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +28 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +28 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +12 -0
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +13 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +9 -6
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +4 -0
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +5 -0
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +8 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -3
- package/es/components/iho-table/src/constants/index.d.ts +4 -5
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +9 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +3 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +5 -3
- package/es/components/index.css +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/scale-view/index.d.ts +24 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +24 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/DescribeContent.vue.d.ts +21 -0
- package/es/components/scale-view/src/components/DescribeContent.vue.js +1 -0
- package/es/components/scale-view/src/components/DescribeContent.vue2.js +1 -0
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +6 -2
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/shortcut-setter/index.d.ts +4 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/es/shared/utils/tapableLess.d.ts +28 -0
- package/es/shared/utils/tapableLess.js +1 -0
- package/package.json +2 -2
|
@@ -1,171 +1,63 @@
|
|
|
1
|
+
import { InsuranceType } from '../../../../../es/components/card-reader-sdk';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* 交易命令枚举
|
|
3
4
|
*/
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
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",loginCode:"7777"}),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
|
|
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
|
|
1
|
+
import{jsonParse as e}from"../../../shared/utils/index.js";import s from"axios";import{isString as t}from"lodash-es";import{INSURANCE_URL as r,CONFIG_MAP as i,TRANS_CMD as a}from"./constants/index.js";import{insuranceLog as n,getDataMessageByData as o,getErrorMessageByType as l,getTranstime as d,getSerialNumber as u}from"./utils/index.js";var c;class m{constructor(e){var s,t;this.webview=null==(c=window.chrome)?void 0:c.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[0];if(!r)return Promise.reject(n("当前回执",s,"没有可用的handler"));const{resolve:i,reject:a,transcmd:o}=r,l=t(s.data)?e(s.data)||{}:s.data;if(!l||!["hisyb","login"].includes(l.exec))return a(n("当前回执不是hisyb消息"));const{transcmd:d}=l.res||{};if(o&&d&&`${o}`!=`${d}`)return a(n("交易命令不相等,当前transcmd",o,"返回transcmd",d));this.messageHandlerQueue.shift(),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:""})}async HOInterfaceSvr(e){const{transcmd:t,needLogin:i}=this.requestParams||{};try{if(this.webview){i&&await this.login();return(await this.postMessage({exec:"hisyb",data:JSON.stringify(e)})).res}const t=await s.post(r,JSON.stringify(e));return o(t.data)}catch(e){return Promise.reject(l(t))}}initConfig(e){this.requestParams=Object.assign({},i,e)}initParams(){var e,s;return{...this.requestParams,transcmd:null!=(s=null==(e=this.requestParams)?void 0:e.transcmd)?s:a.NS_GETPERSONALINFO,transtime:d(),serialnumber:u()}}getInsuranceInfoPromise(e){return this.initConfig(e),this.HOInterfaceSvr(this.initParams())}}export{m as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
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
4
|
export type ExecType = 'hisyb' | 'login';
|
|
4
5
|
export type IHOWindow = Window & {
|
|
@@ -27,27 +28,26 @@ export declare namespace InsuranceType {
|
|
|
27
28
|
export type CardReadParams = Partial<{
|
|
28
29
|
operatorname: string;
|
|
29
30
|
operatorcode: string;
|
|
30
|
-
location:
|
|
31
|
+
location: '0' | '1' | '2' | '';
|
|
31
32
|
needLogin: boolean;
|
|
32
|
-
interfaceid: number;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
interfaceid: number | string;
|
|
34
|
+
transtime: string;
|
|
35
|
+
serialnumber: string;
|
|
36
|
+
transcmd: TRANS_CMD;
|
|
35
37
|
transdata: AnyObject;
|
|
36
38
|
loginCode: string;
|
|
37
|
-
transtype:
|
|
38
|
-
|
|
39
|
+
transtype: 'YB0000' | 'IDCARD' | '';
|
|
40
|
+
transsystem: '10' | '11' | '99' | '';
|
|
41
|
+
transchannel: '101' | '102' | '103' | '104' | '999' | '';
|
|
39
42
|
}>;
|
|
40
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;
|
|
41
44
|
export type CardReadResult = {
|
|
42
|
-
returncode: number;
|
|
45
|
+
returncode: number | string;
|
|
43
46
|
returnmsg: string;
|
|
44
47
|
} & Partial<{
|
|
45
48
|
returndata: Partial<{
|
|
46
49
|
personinfo: Record<'address' | 'age' | 'birthday' | 'cardnum' | 'cardpwd' | 'folk' | 'idnumber' | 'location' | 'ownpay' | 'ptname' | 'pttype' | 'recordid' | 'sex' | 'updateflag', string>;
|
|
47
|
-
cardinfo:
|
|
48
|
-
cardid: string;
|
|
49
|
-
cardno: string;
|
|
50
|
-
};
|
|
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
51
|
iar1: Record<'acf01' | 'iaa01' | 'iab02' | 'iac03' | 'iad04' | 'iai03' | 'iak04' | 'iak05' | 'iak06' | 'iak22' | 'iar01' | 'iar10' | MapperIar<NumberRange<10, 75>>[number], string>;
|
|
52
52
|
}>;
|
|
53
53
|
transcmd: string;
|
|
@@ -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(
|
|
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{
|
|
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?:
|
|
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
|
|
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};
|
|
@@ -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",
|
|
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";
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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};
|
|
@@ -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):
|
|
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 i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as
|
|
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 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as a}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as s}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";function u(u,d,h){const{originY:c,endY:p,borderStyle:f,left:m,itemList:g,scaleValues:v,originX:w,endX:j,yCellHeight:y,markHeight:S,canvasWidth:W,canvasHeight:b}=d;!function(){if(!m)return;const{title:t,titleWidth:i,titleStyle:o}=m,l=e({width:i,height:p-c+S,...f},{value:t.split("").join("\n"),...o||{}},{left:0,top:c},!0);u.value.add(l)}(),v.forEach(((e,i)=>{var o,d;const h="left"===e.layout?w-5:j+5,{range:c,spaceValue:f,title:g,unit:v,titleStyle:S,spaceGridNumber:b=1,showNumber:x,showMaxMinNumber:N}=e,k=[],X=a(c,f),Y=X.length;X.forEach(((t,i)=>{const o=0===i?p-5:p-i*y*b;!x||(0===i||i===Y-1)&&!N||k.push(s(String(t),{...e,position:e.layout},h,o))}));const C=g&&l(["left"===e.layout?m.width/2:j+(W-j)/2,(null!=(d=null==(o=k.at(-1))?void 0:o.top)?d:330)-y],{value:`${g}${v?"\n"+v:""}`,...n,...S}),E=new t.Group([...k,...C?[C]:[]],{objectCaching:!1,...r});u.value.add(E),E.sendToBack()})),function(){const e=new t.Rect({width:w-m.titleWidth,height:p-c+S,left:m.titleWidth,top:c,...i,originX:"left",originY:"top",...f});u.value.add(e);const l=JSON.parse(JSON.stringify(g));let n=p;const r=m.titleWidth+15;l.reverse().forEach((t=>{n-=10;const e=t.title,{text:i,icon:l}=o(e,t,{text:{left:r,top:n},icon:{leftX:r,topY:n}});n-=i.height||30,u.value.add(i,l)}))}(),u.value.add(new t.Rect({left:0,top:0,width:W-f.strokeWidth,height:b-f.strokeWidth,fill:"transparent",...f}))}export{u as useLeft};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
3
|
-
import { IPointTipProps } from '../../../../../../es/components/fabric-chart/src/interface';
|
|
3
|
+
import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
|
|
4
4
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
5
|
-
export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps):
|
|
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
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as n}from"../../constants/index.js";function r(r,l,a,s,u){const{cumputedX:c,getXValue:f}=i(l),{other:d,yCellHeight:m,endX:h,originX:p,originY:v,endY:g,markHeight:x,event:y,topGridYCellHeight:X}=l;function k(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1}))),y.evented&&t.on("mouseup",(e=>{s.show=!1,3===e.button&&(u.point={x:t.left,y:t.top},u.show=!0,u.target=t,u.list=n.map((t=>({...t,renderItem:()=>t.label}))))}))}function _(t){s.point={x:t.left,y:"mark"===t.__type?t.top:t.top+X/2},s.list=[`时间 ${f(t.left).slice(-5)}`],"mark"===t.__type&&s.list.unshift(t.origin.name+" "),s.show=!0}function S(t){return t>=p&&t<=h}return function(){if(!(null==d?void 0:d.horizontal))return;const{horizontal:i}=d,n=p-5;let l=v+m/2;i.forEach(((i,a)=>{const{title:s,titleStyle:u={},type:f,pointAttr:d={},textStyle:h={},data:p}=i,v=s&&e(s,{...u,originX:"right",left:n,top:l});r.value.add(v),p.forEach(((i,n)=>{const{time:u,value:m}=i,p=c(u);if(!S(p))return;const v=e(f,{...d,left:p,top:l}),g=p+v.width/2+2,x=o([g,l],{value:m,...h,originX:"left"}),y=new t.Group([v,x],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});y.__type="other",y.origin={__type:"other",key:"horizontal",dataIndex:a,index:n,data:i,title:s},k(y),r.value.add(y)})),l+=m}))}(),function(){if(!(null==d?void 0:d.vertical))return;const{vertical:t}=d;t.forEach(((t,o)=>{const{textStyle:i={},data:n,time:l}=t,a=c(l);if(!S(a))return;let s=v+m/2;n.forEach(((t,n)=>{const u=e(String(t),{...i,lockMovementX:!0,lockMovementY:!0,left:a,originX:"left",top:s,__type:"other",origin:{key:"vertical",dataIndex:o,index:n,data:{time:l,value:t}}});s+=m,k(u),r.value.add(u)}))}))}(),function(){if(!(null==d?void 0:d.mark)||!x)return;const{title:t,titleStyle:i,pointAttr:n,dataList:l}=d.mark,u=o([p-5,g+x/2],{value:t,...i,originX:"right"});r.value.add(u);const m=g+x,X=[];l.forEach((t=>{const{time:o,list:i=[]}=t,l=c(o);if(!S(l))return;let u=g;i.forEach((t=>{let o=!1;const i=e("circleAndText",{...n,text:t.text,left:l,top:u,origin:t,__type:"mark"}),c=i.height;u+c<=m&&u>=g?(i.set("top",u+c/2),u+=c):(o||(u=g,o=!0),i.set("top",u-c/2),u-=c),X.push(i),function(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<v&&t.set("top",v);const e=g+x-t.height/2;t.top>e&&t.set("top",e)}(t),y.hovered&&_(t)})),t.on("mouseup",(e=>{if(s.show=!1,1===e.button){!function(t){var e;if((null==(e=t.origin)?void 0:e.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left));console.log(e);const o=Math.min(...e);console.log(o,t.startPoint),t.startPoint.limitX.x2=o}}(t);const e={type:"mark",time:f(t.left),data:t.origin};r.value.discardActiveObject(),a("change",e)}}))}(i),r.value.add(i)}))})),function(t){const e=t.find((t=>{var e;return null==(e=t.origin)?void 0:e.isStart})),o=t.find((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)&&t.left>e.left})),i=t.filter((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)}));t.forEach((t=>{var n;const r={x1:p,x2:h};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=o.left,t.otherPoints=i):(r.x1=e.left,t.startPoint=e),t.limitX=r}))}(X)}(),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o}=t;a(o,{...e.origin,type:"other"})}}}export{r as useOther};
|