cnhis-design-vue 3.1.32 → 3.1.33-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.js +1 -0
- package/es/components/form-render/src/components/renderer/checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/index.js +0 -6
- package/es/components/form-render/src/components/renderer/radio.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +3 -2
- package/es/components/form-render/src/components/renderer/select.d.ts +97 -7
- package/es/components/form-render/src/components/renderer/select.js +64 -61
- package/es/components/form-render/src/hooks/index.d.ts +1 -1
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +3 -3
- package/es/components/form-render/src/hooks/useBusinessBinding.js +15 -15
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +2 -10
- package/es/components/form-render/src/hooks/useFieldNormalize.js +2 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +41 -0
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +230 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +2 -1
- package/es/components/insurance-sdk/index.d.ts +1 -0
- package/es/components/insurance-sdk/index.js +1 -0
- package/es/components/insurance-sdk/src/constants/index.d.ts +161 -0
- package/es/components/insurance-sdk/src/constants/index.js +160 -0
- package/es/components/insurance-sdk/src/utils/index.d.ts +1 -0
- package/es/components/insurance-sdk/src/utils/index.js +1 -0
- package/es/components/insurance-sdk/src/utils/insurance.d.ts +260 -0
- package/es/components/insurance-sdk/src/utils/insurance.js +268 -0
- package/es/components/recommend-search/index.d.ts +1 -1
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +1 -1
- package/es/components/recommend-search/src/components/BaseSearch.vue.js +5 -5
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -0
- package/es/components/recommend-search/src/components/RecommendInput.vue.js +6 -0
- package/es/components/recommend-search/src/components/RecommendMenu.vue.js +12 -12
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +0 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue.js +2 -11
- package/es/shared/utils/index.d.ts +1 -0
- package/es/shared/utils/index.js +11 -1
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/labelSelect.d.ts +0 -1
- package/es/components/form-render/src/components/renderer/labelSelect.js +0 -18
- package/es/components/form-render/src/components/renderer/recommendSelect.d.ts +0 -131
- package/es/components/form-render/src/components/renderer/recommendSelect.js +0 -213
- package/es/components/form-render/src/components/renderer/search.d.ts +0 -86
- package/es/components/form-render/src/components/renderer/search.js +0 -112
- package/es/components/form-render/src/hooks/useAutographOptions.d.ts +0 -17
- package/es/components/form-render/src/hooks/useAutographOptions.js +0 -68
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { AnyObject, Func } from '../../../../../es/shared/types';
|
|
2
|
+
interface WebviewEvent extends Event {
|
|
3
|
+
data: string;
|
|
4
|
+
}
|
|
5
|
+
declare type IWindow = Window & {
|
|
6
|
+
chrome: AnyObject;
|
|
7
|
+
};
|
|
8
|
+
export declare class Insurance {
|
|
9
|
+
private readonly webview;
|
|
10
|
+
private currentMessageHandler?;
|
|
11
|
+
constructor(params?: {
|
|
12
|
+
selfWindow: IWindow;
|
|
13
|
+
});
|
|
14
|
+
private readonly messageHandlerQueue;
|
|
15
|
+
messageHandler(e: WebviewEvent): false | void;
|
|
16
|
+
postMessage(data: AnyObject): Promise<unknown>;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
_configMap: AnyObject;
|
|
19
|
+
_loading: boolean;
|
|
20
|
+
initParamsMap: Map<string[], (params: AnyObject) => void>;
|
|
21
|
+
onLogin(): Promise<unknown>;
|
|
22
|
+
_HOInterfaceSvr(insuranceParams: AnyObject): Promise<any>;
|
|
23
|
+
_errorMSg(type: string): "打印服务异常" | "身份证读卡接口服务异常" | "会员读卡接口服务异常" | "pos接口服务异常" | "请检查医保服务是否正常";
|
|
24
|
+
_dataMsg(data: AnyObject): any;
|
|
25
|
+
_initConfig(config: AnyObject): void;
|
|
26
|
+
_initParams(): {
|
|
27
|
+
parmsJson: {
|
|
28
|
+
transtime: string;
|
|
29
|
+
serialnumber: string;
|
|
30
|
+
operatorcode: any;
|
|
31
|
+
operatorname: any;
|
|
32
|
+
location: any;
|
|
33
|
+
transchannel: any;
|
|
34
|
+
transsystem: any;
|
|
35
|
+
transtype: "YB0000";
|
|
36
|
+
interfaceid: "0";
|
|
37
|
+
transcmd: "";
|
|
38
|
+
transdata: {
|
|
39
|
+
readonly iar1: {
|
|
40
|
+
readonly acf01: "0";
|
|
41
|
+
readonly iar01: "";
|
|
42
|
+
readonly vaa01: "";
|
|
43
|
+
readonly vaa07: "";
|
|
44
|
+
readonly iaa01: "";
|
|
45
|
+
readonly iab02: "";
|
|
46
|
+
readonly iak04: "";
|
|
47
|
+
readonly iak05: "";
|
|
48
|
+
readonly iak06: "";
|
|
49
|
+
readonly iar10: "";
|
|
50
|
+
readonly iar11: "";
|
|
51
|
+
readonly iar12: "";
|
|
52
|
+
readonly iar13: "";
|
|
53
|
+
readonly iar14: "";
|
|
54
|
+
readonly iar15: "";
|
|
55
|
+
readonly iar16: "";
|
|
56
|
+
readonly iar17: "";
|
|
57
|
+
readonly iar18: "";
|
|
58
|
+
readonly iar19: "";
|
|
59
|
+
readonly iar20: "";
|
|
60
|
+
readonly iar21: "";
|
|
61
|
+
readonly iar22: "";
|
|
62
|
+
readonly iai03: "";
|
|
63
|
+
readonly iar24: "";
|
|
64
|
+
readonly iar25: "";
|
|
65
|
+
readonly iar26: "";
|
|
66
|
+
readonly iar27: "";
|
|
67
|
+
readonly iar28: "";
|
|
68
|
+
readonly iar29: "";
|
|
69
|
+
readonly iar30: "";
|
|
70
|
+
readonly iar31: "";
|
|
71
|
+
readonly iar32: "";
|
|
72
|
+
readonly iar33: "";
|
|
73
|
+
readonly iar34: "";
|
|
74
|
+
readonly iar35: "";
|
|
75
|
+
readonly iac02: "";
|
|
76
|
+
readonly iac03: "";
|
|
77
|
+
readonly iad03: "";
|
|
78
|
+
readonly iad04: "";
|
|
79
|
+
readonly iar40: "";
|
|
80
|
+
readonly iar41: "";
|
|
81
|
+
readonly iak22: "0";
|
|
82
|
+
readonly iar43: "";
|
|
83
|
+
readonly iar44: "";
|
|
84
|
+
readonly iar45: "";
|
|
85
|
+
readonly cli_iai03: "";
|
|
86
|
+
readonly iar46: "";
|
|
87
|
+
readonly iar47: "";
|
|
88
|
+
readonly iar48: "";
|
|
89
|
+
readonly iar49: "";
|
|
90
|
+
readonly iar50: "";
|
|
91
|
+
readonly iar51: "";
|
|
92
|
+
readonly iar52: "";
|
|
93
|
+
readonly iar53: "";
|
|
94
|
+
readonly iar54: "";
|
|
95
|
+
readonly iar55: "";
|
|
96
|
+
readonly iar56: "";
|
|
97
|
+
readonly iar57: "";
|
|
98
|
+
readonly iar58: "";
|
|
99
|
+
readonly iar59: "";
|
|
100
|
+
readonly iar60: "";
|
|
101
|
+
readonly iar61: "";
|
|
102
|
+
readonly iar62: "";
|
|
103
|
+
readonly iar63: "";
|
|
104
|
+
readonly iar64: "";
|
|
105
|
+
readonly iar65: "";
|
|
106
|
+
readonly iar66: "";
|
|
107
|
+
readonly iar67: "";
|
|
108
|
+
readonly iar68: "";
|
|
109
|
+
readonly iar69: "";
|
|
110
|
+
readonly iar70: "";
|
|
111
|
+
readonly iar71: "";
|
|
112
|
+
readonly iar72: "";
|
|
113
|
+
readonly iar73: "";
|
|
114
|
+
readonly iar74: "";
|
|
115
|
+
readonly iar75: "";
|
|
116
|
+
};
|
|
117
|
+
readonly personinfo: {
|
|
118
|
+
readonly location: 0;
|
|
119
|
+
readonly ptname: "";
|
|
120
|
+
readonly sex: "";
|
|
121
|
+
readonly birthday: "";
|
|
122
|
+
readonly age: "";
|
|
123
|
+
readonly idnumber: "";
|
|
124
|
+
readonly folk: "";
|
|
125
|
+
readonly address: "";
|
|
126
|
+
readonly pttype: "";
|
|
127
|
+
readonly ownpay: "0";
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
verifycode: "";
|
|
131
|
+
};
|
|
132
|
+
msgindex: "";
|
|
133
|
+
checkoutinfo: "";
|
|
134
|
+
error: true;
|
|
135
|
+
catch: true;
|
|
136
|
+
loading: false;
|
|
137
|
+
};
|
|
138
|
+
getInsuranceInfo(config: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
139
|
+
_getDhykParams(insuranceParams: AnyObject): void;
|
|
140
|
+
_getSkParams(insuranceParams: AnyObject): void;
|
|
141
|
+
_getSerialnumber(): string;
|
|
142
|
+
_getOperatorcode(): any;
|
|
143
|
+
_getOperatorname(): any;
|
|
144
|
+
_getTranstime(): string;
|
|
145
|
+
_pad2(n: number): string | number;
|
|
146
|
+
_generateTimeReqestNumber(): string;
|
|
147
|
+
_getHisInsuranceParams(): {
|
|
148
|
+
parmsJson: {
|
|
149
|
+
transtime: string;
|
|
150
|
+
serialnumber: string;
|
|
151
|
+
operatorcode: any;
|
|
152
|
+
operatorname: any;
|
|
153
|
+
location: any;
|
|
154
|
+
transchannel: any;
|
|
155
|
+
transsystem: any;
|
|
156
|
+
transtype: "YB0000";
|
|
157
|
+
interfaceid: "0";
|
|
158
|
+
transcmd: "";
|
|
159
|
+
transdata: {
|
|
160
|
+
readonly iar1: {
|
|
161
|
+
readonly acf01: "0";
|
|
162
|
+
readonly iar01: "";
|
|
163
|
+
readonly vaa01: "";
|
|
164
|
+
readonly vaa07: "";
|
|
165
|
+
readonly iaa01: "";
|
|
166
|
+
readonly iab02: "";
|
|
167
|
+
readonly iak04: "";
|
|
168
|
+
readonly iak05: "";
|
|
169
|
+
readonly iak06: "";
|
|
170
|
+
readonly iar10: "";
|
|
171
|
+
readonly iar11: "";
|
|
172
|
+
readonly iar12: "";
|
|
173
|
+
readonly iar13: "";
|
|
174
|
+
readonly iar14: "";
|
|
175
|
+
readonly iar15: "";
|
|
176
|
+
readonly iar16: "";
|
|
177
|
+
readonly iar17: "";
|
|
178
|
+
readonly iar18: "";
|
|
179
|
+
readonly iar19: "";
|
|
180
|
+
readonly iar20: "";
|
|
181
|
+
readonly iar21: "";
|
|
182
|
+
readonly iar22: "";
|
|
183
|
+
readonly iai03: "";
|
|
184
|
+
readonly iar24: "";
|
|
185
|
+
readonly iar25: "";
|
|
186
|
+
readonly iar26: "";
|
|
187
|
+
readonly iar27: "";
|
|
188
|
+
readonly iar28: "";
|
|
189
|
+
readonly iar29: "";
|
|
190
|
+
readonly iar30: "";
|
|
191
|
+
readonly iar31: "";
|
|
192
|
+
readonly iar32: "";
|
|
193
|
+
readonly iar33: "";
|
|
194
|
+
readonly iar34: "";
|
|
195
|
+
readonly iar35: "";
|
|
196
|
+
readonly iac02: "";
|
|
197
|
+
readonly iac03: "";
|
|
198
|
+
readonly iad03: "";
|
|
199
|
+
readonly iad04: "";
|
|
200
|
+
readonly iar40: "";
|
|
201
|
+
readonly iar41: "";
|
|
202
|
+
readonly iak22: "0";
|
|
203
|
+
readonly iar43: "";
|
|
204
|
+
readonly iar44: "";
|
|
205
|
+
readonly iar45: "";
|
|
206
|
+
readonly cli_iai03: "";
|
|
207
|
+
readonly iar46: "";
|
|
208
|
+
readonly iar47: "";
|
|
209
|
+
readonly iar48: "";
|
|
210
|
+
readonly iar49: "";
|
|
211
|
+
readonly iar50: "";
|
|
212
|
+
readonly iar51: "";
|
|
213
|
+
readonly iar52: "";
|
|
214
|
+
readonly iar53: "";
|
|
215
|
+
readonly iar54: "";
|
|
216
|
+
readonly iar55: "";
|
|
217
|
+
readonly iar56: "";
|
|
218
|
+
readonly iar57: "";
|
|
219
|
+
readonly iar58: "";
|
|
220
|
+
readonly iar59: "";
|
|
221
|
+
readonly iar60: "";
|
|
222
|
+
readonly iar61: "";
|
|
223
|
+
readonly iar62: "";
|
|
224
|
+
readonly iar63: "";
|
|
225
|
+
readonly iar64: "";
|
|
226
|
+
readonly iar65: "";
|
|
227
|
+
readonly iar66: "";
|
|
228
|
+
readonly iar67: "";
|
|
229
|
+
readonly iar68: "";
|
|
230
|
+
readonly iar69: "";
|
|
231
|
+
readonly iar70: "";
|
|
232
|
+
readonly iar71: "";
|
|
233
|
+
readonly iar72: "";
|
|
234
|
+
readonly iar73: "";
|
|
235
|
+
readonly iar74: "";
|
|
236
|
+
readonly iar75: "";
|
|
237
|
+
};
|
|
238
|
+
readonly personinfo: {
|
|
239
|
+
readonly location: 0;
|
|
240
|
+
readonly ptname: "";
|
|
241
|
+
readonly sex: "";
|
|
242
|
+
readonly birthday: "";
|
|
243
|
+
readonly age: "";
|
|
244
|
+
readonly idnumber: "";
|
|
245
|
+
readonly folk: "";
|
|
246
|
+
readonly address: "";
|
|
247
|
+
readonly pttype: "";
|
|
248
|
+
readonly ownpay: "0";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
verifycode: "";
|
|
252
|
+
};
|
|
253
|
+
msgindex: "";
|
|
254
|
+
checkoutinfo: "";
|
|
255
|
+
error: true;
|
|
256
|
+
catch: true;
|
|
257
|
+
loading: false;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
export {};
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { CONFIG_MAP, transcmdMapping, HIS_INSURANCE_PARAMS } from '../constants/index.js';
|
|
2
|
+
import axios from 'axios/dist/axios.min.js';
|
|
3
|
+
|
|
4
|
+
const INSURANCE_ORIGIN = "http://127.0.0.1:8031";
|
|
5
|
+
const INSURANCE_URL = `${INSURANCE_ORIGIN}/HOInterfaceSvr`;
|
|
6
|
+
class Insurance {
|
|
7
|
+
constructor(params) {
|
|
8
|
+
this.messageHandlerQueue = [];
|
|
9
|
+
this._configMap = {};
|
|
10
|
+
this._loading = false;
|
|
11
|
+
this.initParamsMap = /* @__PURE__ */ new Map([
|
|
12
|
+
[["newdhyk", "newdsfz"], (params) => this._getDhykParams(params)],
|
|
13
|
+
[["sk"], (params) => this._getSkParams(params)]
|
|
14
|
+
]);
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
const _window = window;
|
|
17
|
+
this.webview = (_a = _window.chrome) == null ? void 0 : _a.webview;
|
|
18
|
+
if (params == null ? void 0 : params.selfWindow) {
|
|
19
|
+
this.webview = (_c = (_b = params == null ? void 0 : params.selfWindow) == null ? void 0 : _b.chrome) == null ? void 0 : _c.webview;
|
|
20
|
+
}
|
|
21
|
+
if (!this.webview)
|
|
22
|
+
return;
|
|
23
|
+
this.currentMessageHandler = this.messageHandler.bind(this);
|
|
24
|
+
this.webview.addEventListener("message", this.currentMessageHandler);
|
|
25
|
+
}
|
|
26
|
+
messageHandler(e) {
|
|
27
|
+
const handler = this.messageHandlerQueue.pop();
|
|
28
|
+
if (!handler)
|
|
29
|
+
return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
|
|
30
|
+
const { resolve, reject } = handler;
|
|
31
|
+
try {
|
|
32
|
+
console.log("e------------------", e);
|
|
33
|
+
if (e == null ? void 0 : e.data) {
|
|
34
|
+
if (typeof e.data == "string") {
|
|
35
|
+
resolve(JSON.parse(e.data));
|
|
36
|
+
} else {
|
|
37
|
+
resolve(e.data);
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
resolve(true);
|
|
42
|
+
} catch (e2) {
|
|
43
|
+
reject(e2);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async postMessage(data) {
|
|
47
|
+
if (!this.webview)
|
|
48
|
+
return Promise.reject();
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
this.messageHandlerQueue.push({ resolve, reject });
|
|
51
|
+
this.webview.postMessage(data);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
destroy() {
|
|
55
|
+
if (this.webview && this.currentMessageHandler) {
|
|
56
|
+
this.webview.removeEventListener("message", this.currentMessageHandler);
|
|
57
|
+
this.currentMessageHandler = void 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
onLogin() {
|
|
61
|
+
const { loginCode } = this._configMap;
|
|
62
|
+
const data = {
|
|
63
|
+
exec: "login",
|
|
64
|
+
data: loginCode
|
|
65
|
+
};
|
|
66
|
+
return this.postMessage(data);
|
|
67
|
+
}
|
|
68
|
+
async _HOInterfaceSvr(insuranceParams) {
|
|
69
|
+
const { type, needLogin } = this._configMap;
|
|
70
|
+
const parmsJson = JSON.stringify(insuranceParams.parmsJson);
|
|
71
|
+
if (this.webview) {
|
|
72
|
+
try {
|
|
73
|
+
if (needLogin) {
|
|
74
|
+
const loginRes = await this.onLogin();
|
|
75
|
+
if ((loginRes == null ? void 0 : loginRes.result) && (loginRes == null ? void 0 : loginRes.exec) == "login") {
|
|
76
|
+
const res = await this.postMessage({ exec: "hisyb", data: parmsJson });
|
|
77
|
+
if ((res == null ? void 0 : res.result) && (res == null ? void 0 : res.exec) == "hisyb") {
|
|
78
|
+
return res.res;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
const res = await this.postMessage({ exec: "hisyb", data: parmsJson });
|
|
83
|
+
console.log("hisyb---------------", res, needLogin);
|
|
84
|
+
if ((res == null ? void 0 : res.result) && (res == null ? void 0 : res.exec) == "hisyb") {
|
|
85
|
+
return this._dataMsg(res.res);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} catch (error) {
|
|
89
|
+
this._loading = false;
|
|
90
|
+
const msg = this._errorMSg(type);
|
|
91
|
+
return Promise.reject(msg);
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const res = await axios.post(INSURANCE_URL, parmsJson);
|
|
97
|
+
this._loading = false;
|
|
98
|
+
return this._dataMsg(res.data);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
this._loading = false;
|
|
101
|
+
const msg = this._errorMSg(type);
|
|
102
|
+
return Promise.reject(msg);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_errorMSg(type) {
|
|
106
|
+
return type == "fastReport" ? "\u6253\u5370\u670D\u52A1\u5F02\u5E38" : type == "newdsfz" ? "\u8EAB\u4EFD\u8BC1\u8BFB\u5361\u63A5\u53E3\u670D\u52A1\u5F02\u5E38" : type == "newdhyk" ? "\u4F1A\u5458\u8BFB\u5361\u63A5\u53E3\u670D\u52A1\u5F02\u5E38" : type == "pos" ? "pos\u63A5\u53E3\u670D\u52A1\u5F02\u5E38" : "\u8BF7\u68C0\u67E5\u533B\u4FDD\u670D\u52A1\u662F\u5426\u6B63\u5E38";
|
|
107
|
+
}
|
|
108
|
+
_dataMsg(data) {
|
|
109
|
+
const { type } = this._configMap;
|
|
110
|
+
if (typeof data == "string") {
|
|
111
|
+
data = JSON.parse(data);
|
|
112
|
+
}
|
|
113
|
+
if (data.returncode == "0" || data.returncode == "1") {
|
|
114
|
+
if (type == "newdhyk") {
|
|
115
|
+
if (data.returndata.cardinfo && data.returndata.cardinfo.cardno) {
|
|
116
|
+
return data.returndata.cardinfo;
|
|
117
|
+
} else {
|
|
118
|
+
const msg = "\u672A\u83B7\u53D6\u5230\u5361\u53F7";
|
|
119
|
+
return Promise.reject(msg);
|
|
120
|
+
}
|
|
121
|
+
} else if (type == "newdsfz") {
|
|
122
|
+
let returnData = null;
|
|
123
|
+
let cardinfoJson = null;
|
|
124
|
+
if (typeof data.returndata == "string") {
|
|
125
|
+
returnData = JSON.parse(data.returndata);
|
|
126
|
+
cardinfoJson = returnData.cardinfo;
|
|
127
|
+
} else {
|
|
128
|
+
cardinfoJson = data.returndata.cardinfo;
|
|
129
|
+
}
|
|
130
|
+
cardinfoJson = {
|
|
131
|
+
...cardinfoJson,
|
|
132
|
+
Sex: cardinfoJson.sex,
|
|
133
|
+
Sex_Code: cardinfoJson.sex_code,
|
|
134
|
+
Name: cardinfoJson.name,
|
|
135
|
+
Age: cardinfoJson.age,
|
|
136
|
+
Age_Code: cardinfoJson.age_code,
|
|
137
|
+
Age_Name: cardinfoJson.age_name,
|
|
138
|
+
BirthDate: cardinfoJson.birthdate,
|
|
139
|
+
Nation_Name: cardinfoJson.nation_name,
|
|
140
|
+
Nation_Code: cardinfoJson.nation_code,
|
|
141
|
+
Address: cardinfoJson.address,
|
|
142
|
+
CardNo: cardinfoJson.cardno,
|
|
143
|
+
HasPhoto: cardinfoJson.hasphoto
|
|
144
|
+
};
|
|
145
|
+
return cardinfoJson;
|
|
146
|
+
} else {
|
|
147
|
+
return data;
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
let msg = type + "--" + data.returnmsg;
|
|
151
|
+
if (!msg) {
|
|
152
|
+
msg = this._errorMSg(type);
|
|
153
|
+
}
|
|
154
|
+
return Promise.reject(msg);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
_initConfig(config) {
|
|
158
|
+
Object.assign(this._configMap, CONFIG_MAP, config);
|
|
159
|
+
}
|
|
160
|
+
_initParams() {
|
|
161
|
+
const { type, transtype, interfaceid, iaa01 } = this._configMap;
|
|
162
|
+
const insuranceParams = this._getHisInsuranceParams();
|
|
163
|
+
Object.assign(insuranceParams.parmsJson, {
|
|
164
|
+
transcmd: transcmdMapping[type] || type,
|
|
165
|
+
interfaceid: interfaceid || iaa01,
|
|
166
|
+
transtype: transtype ? transtype : "SYSTEM"
|
|
167
|
+
});
|
|
168
|
+
const info = [...this.initParamsMap].find(([key, value]) => key.includes(type));
|
|
169
|
+
if (info) {
|
|
170
|
+
const [key, value] = info;
|
|
171
|
+
value(insuranceParams);
|
|
172
|
+
} else {
|
|
173
|
+
Object.assign(insuranceParams.parmsJson, {
|
|
174
|
+
transdata: this._configMap.data
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return insuranceParams;
|
|
178
|
+
}
|
|
179
|
+
async getInsuranceInfo(config, successCallbackFn, errorCallbackFn) {
|
|
180
|
+
if (this._loading)
|
|
181
|
+
return false;
|
|
182
|
+
this._loading = true;
|
|
183
|
+
this._configMap = {};
|
|
184
|
+
this._initConfig(config);
|
|
185
|
+
const insuranceParams = this._initParams();
|
|
186
|
+
try {
|
|
187
|
+
const res = await this._HOInterfaceSvr(insuranceParams);
|
|
188
|
+
successCallbackFn && successCallbackFn(res);
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.log("error", error);
|
|
191
|
+
errorCallbackFn && errorCallbackFn(error);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
_getDhykParams(insuranceParams) {
|
|
195
|
+
const { type } = this._configMap;
|
|
196
|
+
insuranceParams.parmsJson = {
|
|
197
|
+
...insuranceParams.parmsJson,
|
|
198
|
+
transtype: "IDCARD",
|
|
199
|
+
interfaceid: "0",
|
|
200
|
+
transdata: {
|
|
201
|
+
...insuranceParams.parmsJson.transdata,
|
|
202
|
+
readtype: type == "newdhyk" ? "1" : "2"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
_getSkParams(insuranceParams) {
|
|
207
|
+
const { iar1Json, personinfo, data } = this._configMap;
|
|
208
|
+
insuranceParams.parmsJson = {
|
|
209
|
+
...insuranceParams.parmsJson,
|
|
210
|
+
transdata: {
|
|
211
|
+
...insuranceParams.parmsJson.transdata,
|
|
212
|
+
iar1: {
|
|
213
|
+
...insuranceParams.parmsJson.transdata.iar1,
|
|
214
|
+
...iar1Json
|
|
215
|
+
},
|
|
216
|
+
personinfo: {
|
|
217
|
+
...insuranceParams.parmsJson.transdata.personinfo,
|
|
218
|
+
...personinfo
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
_getSerialnumber() {
|
|
224
|
+
function S4() {
|
|
225
|
+
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
226
|
+
}
|
|
227
|
+
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
|
|
228
|
+
}
|
|
229
|
+
_getOperatorcode() {
|
|
230
|
+
return this._configMap.operatorcode;
|
|
231
|
+
}
|
|
232
|
+
_getOperatorname() {
|
|
233
|
+
return this._configMap.operatorname;
|
|
234
|
+
}
|
|
235
|
+
_getTranstime() {
|
|
236
|
+
return this._generateTimeReqestNumber() + parseInt((Math.random() * 1e3).toString());
|
|
237
|
+
}
|
|
238
|
+
_pad2(n) {
|
|
239
|
+
return n < 10 ? "0" + n : n;
|
|
240
|
+
}
|
|
241
|
+
_generateTimeReqestNumber() {
|
|
242
|
+
const date = new Date();
|
|
243
|
+
return date.getFullYear().toString() + this._pad2(date.getMonth() + 1) + this._pad2(date.getDate()) + this._pad2(date.getHours()) + this._pad2(date.getMinutes()) + this._pad2(date.getSeconds());
|
|
244
|
+
}
|
|
245
|
+
_getHisInsuranceParams() {
|
|
246
|
+
const { operatorcode, operatorname, location, transchannel, transsystem } = this._configMap;
|
|
247
|
+
const transtime = this._getTranstime();
|
|
248
|
+
const serialnumber = this._getSerialnumber();
|
|
249
|
+
return Object.assign(
|
|
250
|
+
{},
|
|
251
|
+
{
|
|
252
|
+
...HIS_INSURANCE_PARAMS,
|
|
253
|
+
parmsJson: {
|
|
254
|
+
...HIS_INSURANCE_PARAMS.parmsJson,
|
|
255
|
+
transtime,
|
|
256
|
+
serialnumber,
|
|
257
|
+
operatorcode,
|
|
258
|
+
operatorname,
|
|
259
|
+
location,
|
|
260
|
+
transchannel: transchannel ? transchannel : HIS_INSURANCE_PARAMS.parmsJson.transchannel,
|
|
261
|
+
transsystem: transsystem || "12"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export { Insurance };
|
|
@@ -201,6 +201,7 @@ declare const RecommendSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
201
201
|
onScroll: () => void;
|
|
202
202
|
style: Partial<CSSStyleDeclaration>;
|
|
203
203
|
};
|
|
204
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
204
205
|
RecommendMenu: import("vue").DefineComponent<{
|
|
205
206
|
getDisplayValue: {
|
|
206
207
|
type: FunctionConstructor;
|
|
@@ -523,7 +524,6 @@ declare const RecommendSearch: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
523
524
|
showRef: import("vue").Ref<boolean>;
|
|
524
525
|
displayPlaceholder: import("vue").ComputedRef<string>;
|
|
525
526
|
currentOption: import("vue").Ref<import("../../../es/shared/types").AnyObject | undefined>;
|
|
526
|
-
jsonParse: import("@vueuse/core").UseMemoizedFn<any, [value: string]>;
|
|
527
527
|
getRecommendOption: (item: import("./src/types").RecommendItem) => any;
|
|
528
528
|
commonOptions: import("vue").ComputedRef<any[]>;
|
|
529
529
|
recentOptions: import("vue").ComputedRef<any[]>;
|
|
@@ -203,6 +203,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
203
203
|
onScroll: () => void;
|
|
204
204
|
style: Partial<CSSStyleDeclaration>;
|
|
205
205
|
};
|
|
206
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
206
207
|
RecommendMenu: import("vue").DefineComponent<{
|
|
207
208
|
getDisplayValue: {
|
|
208
209
|
type: FunctionConstructor;
|
|
@@ -525,7 +526,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
525
526
|
showRef: import("vue").Ref<boolean>;
|
|
526
527
|
displayPlaceholder: import("vue").ComputedRef<string>;
|
|
527
528
|
currentOption: import("vue").Ref<AnyObject | undefined>;
|
|
528
|
-
jsonParse: import("@vueuse/core").UseMemoizedFn<any, [value: string]>;
|
|
529
529
|
getRecommendOption: (item: RecommendItem) => any;
|
|
530
530
|
commonOptions: import("vue").ComputedRef<any[]>;
|
|
531
531
|
recentOptions: import("vue").ComputedRef<any[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, isRef, withCtx, createVNode,
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, isRef, withCtx, createVNode, createElementVNode, renderSlot } from 'vue';
|
|
2
2
|
import { uuidGenerator } from '../../../../shared/utils/index.js';
|
|
3
3
|
import { useDebounceFn, onClickOutside } from '@vueuse/core';
|
|
4
4
|
import { NPopover, NInput, NSpin } from 'naive-ui';
|
|
@@ -113,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
class: "recommend-search",
|
|
114
114
|
placement: "bottom-start",
|
|
115
115
|
show: unref(show),
|
|
116
|
-
"onUpdate:show": _cache[
|
|
116
|
+
"onUpdate:show": _cache[2] || (_cache[2] = ($event) => isRef(show) ? show.value = $event : null),
|
|
117
117
|
"show-arrow": false,
|
|
118
118
|
ref_key: "popoverRef",
|
|
119
119
|
ref: popoverRef,
|
|
@@ -126,12 +126,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
126
|
onClear,
|
|
127
127
|
onFocus: openMenuAtInput,
|
|
128
128
|
onClick: openMenuAtInput,
|
|
129
|
-
onKeydown:
|
|
129
|
+
onKeydown: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("keydown", $event)),
|
|
130
130
|
ref_key: "inputRef",
|
|
131
131
|
ref: inputRef,
|
|
132
132
|
value: unref(displayValueRef),
|
|
133
|
-
"onUpdate:value": _cache[
|
|
134
|
-
}), null, 16, ["placeholder", "clearable", "
|
|
133
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => isRef(displayValueRef) ? displayValueRef.value = $event : null)
|
|
134
|
+
}), null, 16, ["placeholder", "clearable", "value"])
|
|
135
135
|
]),
|
|
136
136
|
default: withCtx(() => [
|
|
137
137
|
createVNode(unref(NSpin), { show: __props.loading }, {
|
|
@@ -93,6 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
93
93
|
onScroll: () => void;
|
|
94
94
|
style: Partial<CSSStyleDeclaration>;
|
|
95
95
|
};
|
|
96
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
96
97
|
RecommendMenu: import("vue").DefineComponent<{
|
|
97
98
|
getDisplayValue: {
|
|
98
99
|
type: FunctionConstructor;
|
|
@@ -59,6 +59,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
59
59
|
emits("choose", { type, value: value.itemObj });
|
|
60
60
|
}
|
|
61
61
|
const { list, wrapperProps, containerProps } = useVirtualList(parsedOptions, { itemHeight: 32, overscan: 3 });
|
|
62
|
+
function onKeydown(event) {
|
|
63
|
+
if (!["ArrowUp", "ArrowDown", "Enter"].includes(event.key))
|
|
64
|
+
return;
|
|
65
|
+
console.log(event);
|
|
66
|
+
}
|
|
62
67
|
return (_ctx, _cache) => {
|
|
63
68
|
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
64
69
|
createVNode(BaseSearch, mergeProps({
|
|
@@ -68,6 +73,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
73
|
"clear-pattern-on-open-menu": false,
|
|
69
74
|
placeholder: __props.placeholder,
|
|
70
75
|
clearable: __props.clearable,
|
|
76
|
+
onKeydown,
|
|
71
77
|
onSearch: search,
|
|
72
78
|
onOpenMenu,
|
|
73
79
|
onCloseMenu
|