web-core-tcm 0.0.23 → 0.0.25
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/package.json +38 -21
- package/quasar.config.ts +28 -15
- package/src/api/algorithm/comprehensiveAlgorithm.ts +1 -1
- package/src/api/algorithm/index.ts +7 -7
- package/src/api/algorithm/inquiriesAlgorithm.ts +4 -7
- package/src/api/algorithm/inspectionsAlgorithm.ts +1 -1
- package/src/api/algorithm/lisemsAlgorithm.ts +3 -3
- package/src/api/algorithm/pulsationsAlgorithm.ts +2 -3
- package/src/api/authorization/alova/apiDefinitions.ts +2 -2
- package/src/api/authorization/alova/createApis.ts +22 -7
- package/src/api/authorization/alova/globals.d.ts +35 -14
- package/src/api/authorization/alova/implement/authorization.ts +11 -9
- package/src/api/authorization/alova/implement/index.ts +1 -1
- package/src/api/authorization/alova/index.ts +4 -5
- package/src/api/authorization/authorization.ts +6 -6
- package/src/api/authorization/index.ts +1 -1
- package/src/api/check/alova/apiDefinitions.ts +2 -2
- package/src/api/check/alova/createApis.ts +22 -7
- package/src/api/check/alova/globals.d.ts +29 -20
- package/src/api/check/alova/implement/check.ts +145 -99
- package/src/api/check/alova/implement/index.ts +1 -1
- package/src/api/check/alova/index.ts +4 -5
- package/src/api/check/check.ts +116 -63
- package/src/api/check/index.ts +1 -1
- package/src/api/config/alova/index.ts +26 -27
- package/src/api/config/index.ts +59 -57
- package/src/api/doctor/alova/apiDefinitions.ts +2 -2
- package/src/api/doctor/alova/createApis.ts +22 -7
- package/src/api/doctor/alova/globals.d.ts +27 -18
- package/src/api/doctor/alova/implement/doctor.ts +38 -24
- package/src/api/doctor/alova/implement/index.ts +1 -1
- package/src/api/doctor/alova/index.ts +4 -4
- package/src/api/doctor/doctor.ts +18 -18
- package/src/api/doctor/index.ts +1 -1
- package/src/api/index.ts +12 -15
- package/src/api/metric/implement/index.ts +1 -1
- package/src/api/metric/implement/metric.ts +44 -34
- package/src/api/metric/index.ts +1 -1
- package/src/api/metric/metric.ts +36 -36
- package/src/api/oauth/alova/apiDefinitions.ts +2 -2
- package/src/api/oauth/alova/createApis.ts +22 -7
- package/src/api/oauth/alova/globals.d.ts +25 -16
- package/src/api/oauth/alova/implement/index.ts +1 -1
- package/src/api/oauth/alova/implement/oauth.ts +20 -15
- package/src/api/oauth/alova/index.ts +4 -5
- package/src/api/oauth/index.ts +1 -1
- package/src/api/oauth/oauth.ts +9 -5
- package/src/api/outpatient/alova/apiDefinitions.ts +2 -2
- package/src/api/outpatient/alova/createApis.ts +22 -7
- package/src/api/outpatient/alova/globals.d.ts +25 -16
- package/src/api/outpatient/alova/implement/index.ts +1 -1
- package/src/api/outpatient/alova/implement/outpatient.ts +76 -51
- package/src/api/outpatient/alova/index.ts +4 -5
- package/src/api/outpatient/index.ts +1 -1
- package/src/api/outpatient/outpatient.ts +29 -24
- package/src/api/patient/alova/apiDefinitions.ts +2 -2
- package/src/api/patient/alova/createApis.ts +22 -7
- package/src/api/patient/alova/globals.d.ts +56 -43
- package/src/api/patient/alova/implement/index.ts +1 -1
- package/src/api/patient/alova/implement/meta.ts +253 -224
- package/src/api/patient/alova/implement/patient.ts +79 -57
- package/src/api/patient/alova/index.ts +3 -5
- package/src/api/patient/core.ts +51 -49
- package/src/api/patient/index.ts +1 -1
- package/src/api/patient/meta.ts +244 -140
- package/src/api/patient/patient.ts +25 -25
- package/src/api/prescription/alova/apiDefinitions.ts +2 -2
- package/src/api/prescription/alova/createApis.ts +22 -7
- package/src/api/prescription/alova/globals.d.ts +32 -23
- package/src/api/prescription/alova/implement/herbal.ts +59 -39
- package/src/api/prescription/alova/implement/index.ts +1 -1
- package/src/api/prescription/alova/implement/prescription.ts +50 -33
- package/src/api/prescription/alova/index.ts +4 -5
- package/src/api/prescription/herbal.ts +17 -10
- package/src/api/prescription/index.ts +1 -1
- package/src/api/prescription/prescription.ts +35 -27
- package/src/api/scientist/alova/apiDefinitions.ts +2 -2
- package/src/api/scientist/alova/createApis.ts +22 -7
- package/src/api/scientist/alova/globals.d.ts +25 -16
- package/src/api/scientist/alova/implement/index.ts +1 -1
- package/src/api/scientist/alova/implement/scientist.ts +31 -20
- package/src/api/scientist/alova/index.ts +5 -4
- package/src/api/scientist/index.ts +1 -1
- package/src/api/scientist/scientist.ts +20 -20
- package/src/index.ts +3 -4
- package/src/layouts/UserLayout.vue +9 -7
- package/src/pages/LoginPage.vue +2 -5
- package/src/proto/types/Images_pb.ts +13 -13
- package/src/proto/types/WaveMap_pb.ts +13 -13
- package/src/router/routes.ts +2 -2
- package/src/util/export.ts +4 -4
- package/src/util/helper.ts +6 -6
- package/src/util/image.ts +1 -1
- package/src/util/number.ts +4 -4
- package/src/util/s256.js +1 -4
- package/src/util/secret.ts +1 -1
- package/src/util/string.ts +18 -18
- package/tsconfig.json +5 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Herbal } from '
|
|
2
|
-
import type { PrescriptionState } from '
|
|
3
|
-
import type { Page } from '
|
|
4
|
-
import { NetworkObject } from '
|
|
1
|
+
import { Herbal } from 'src/api/prescription/herbal';
|
|
2
|
+
import type { PrescriptionState } from 'src/api/prescription/alova/globals';
|
|
3
|
+
import type { Page } from 'src/api/patient/core';
|
|
4
|
+
import { NetworkObject } from 'src/api/patient/core';
|
|
5
5
|
import type { IBuilder } from 'builder-pattern';
|
|
6
6
|
import { Builder } from 'builder-pattern';
|
|
7
|
-
import { Doctor } from '
|
|
7
|
+
import { Doctor } from 'src/api/doctor/doctor';
|
|
8
8
|
|
|
9
|
-
export abstract class Prescription extends NetworkObject{
|
|
10
|
-
static override builder(): IBuilder<Prescription>{
|
|
9
|
+
export abstract class Prescription extends NetworkObject {
|
|
10
|
+
static override builder(): IBuilder<Prescription> {
|
|
11
11
|
return Builder(this._default) as unknown as IBuilder<Prescription>;
|
|
12
12
|
}
|
|
13
13
|
static override default(): typeof Prescription {
|
|
@@ -22,21 +22,24 @@ export abstract class Prescription extends NetworkObject{
|
|
|
22
22
|
useAmount: number = 0;
|
|
23
23
|
craftType: string = '自煎';
|
|
24
24
|
useWay: string[] = ['煎服'];
|
|
25
|
-
useTime: string[] = ['早上','晚上'];
|
|
25
|
+
useTime: string[] = ['早上', '晚上'];
|
|
26
26
|
herbals: Herbal[] = [];
|
|
27
27
|
override async of(json: PrescriptionState) {
|
|
28
|
-
if(json.id != undefined)this.id = json.id;
|
|
29
|
-
if(json.createdTimestamp != undefined)this.createdTimestamp = json.createdTimestamp;
|
|
30
|
-
if(json.updatedTimestamp != undefined)this.updatedTimestamp = json.updatedTimestamp;
|
|
31
|
-
if(json.name != undefined)this.name = json.name;
|
|
32
|
-
if(json.ownerState != undefined)
|
|
33
|
-
|
|
34
|
-
if(json.
|
|
35
|
-
if(json.
|
|
36
|
-
if(json.
|
|
37
|
-
if(json.
|
|
38
|
-
if (json.
|
|
39
|
-
|
|
28
|
+
if (json.id != undefined) this.id = json.id;
|
|
29
|
+
if (json.createdTimestamp != undefined) this.createdTimestamp = json.createdTimestamp;
|
|
30
|
+
if (json.updatedTimestamp != undefined) this.updatedTimestamp = json.updatedTimestamp;
|
|
31
|
+
if (json.name != undefined) this.name = json.name;
|
|
32
|
+
if (json.ownerState != undefined)
|
|
33
|
+
this.owner = await Doctor.builder().build().of(json.ownerState);
|
|
34
|
+
if (json.totalAmount != undefined) this.totalAmount = json.totalAmount;
|
|
35
|
+
if (json.useAmount != undefined) this.useAmount = json.useAmount;
|
|
36
|
+
if (json.craftType != undefined) this.craftType = json.craftType;
|
|
37
|
+
if (json.useWay != undefined) this.useWay = json.useWay;
|
|
38
|
+
if (json.useTime != undefined) this.useTime = json.useTime;
|
|
39
|
+
if (json.herbalsState != undefined) {
|
|
40
|
+
this.herbals = await Promise.all(
|
|
41
|
+
json.herbalsState.map((item) => Herbal.builder().build().of(item)),
|
|
42
|
+
);
|
|
40
43
|
}
|
|
41
44
|
return Promise.resolve(this);
|
|
42
45
|
}
|
|
@@ -52,17 +55,22 @@ export abstract class Prescription extends NetworkObject{
|
|
|
52
55
|
craftType: this.craftType,
|
|
53
56
|
useWay: this.useWay,
|
|
54
57
|
useTime: this.useTime,
|
|
55
|
-
herbalsState: this.herbals.map(herbal => herbal.state())
|
|
56
|
-
} as PrescriptionState
|
|
58
|
+
herbalsState: this.herbals.map((herbal) => herbal.state()),
|
|
59
|
+
} as PrescriptionState;
|
|
57
60
|
}
|
|
58
|
-
static query(
|
|
59
|
-
|
|
61
|
+
static query(
|
|
62
|
+
page: number = 0,
|
|
63
|
+
pageSize: number = 9999999,
|
|
64
|
+
owner?: Doctor,
|
|
65
|
+
name?: string,
|
|
66
|
+
): Promise<Page<Prescription>> {
|
|
67
|
+
return Prescription.default().query(page, pageSize, owner, name);
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
//put
|
|
63
|
-
abstract put(): Promise<this
|
|
71
|
+
abstract put(): Promise<this>;
|
|
64
72
|
//post
|
|
65
|
-
abstract post(): Promise<this
|
|
73
|
+
abstract post(): Promise<this>;
|
|
66
74
|
//delete
|
|
67
|
-
abstract delete(): Promise<this
|
|
75
|
+
abstract delete(): Promise<this>;
|
|
68
76
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types='./globals.d.ts' />
|
|
2
2
|
/* tslint:disable */
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* OpenAPI definition - version v0
|
|
6
6
|
*
|
|
@@ -23,5 +23,5 @@ export default {
|
|
|
23
23
|
'scientistStateRestful.postScientistState': ['POST', '/科研/服务'],
|
|
24
24
|
'scientistStateRestful.datesOfScientist': ['GET', '/科研/服务/统计/科研/日期'],
|
|
25
25
|
'scientistStateRestful.totalOfScientist': ['GET', '/科研/服务/统计/科研/总数'],
|
|
26
|
-
'scientistStateRestful.todayOfScientistByToday': ['GET', '/科研/服务/统计/科研/今日']
|
|
26
|
+
'scientistStateRestful.todayOfScientistByToday': ['GET', '/科研/服务/统计/科研/今日'],
|
|
27
27
|
};
|
|
@@ -19,7 +19,11 @@ import { Method } from 'alova';
|
|
|
19
19
|
import apiDefinitions from './apiDefinitions';
|
|
20
20
|
|
|
21
21
|
const cache = Object.create(null);
|
|
22
|
-
const createFunctionalProxy = (
|
|
22
|
+
const createFunctionalProxy = (
|
|
23
|
+
array: (string | symbol)[],
|
|
24
|
+
alovaInstance: Alova<AlovaGenerics>,
|
|
25
|
+
configMap: any,
|
|
26
|
+
) => {
|
|
23
27
|
const apiPathKey = array.join('.') as keyof typeof apiDefinitions;
|
|
24
28
|
if (cache[apiPathKey]) {
|
|
25
29
|
return cache[apiPathKey];
|
|
@@ -39,7 +43,7 @@ const createFunctionalProxy = (array: (string | symbol)[], alovaInstance: Alova<
|
|
|
39
43
|
}
|
|
40
44
|
const mergedConfig = {
|
|
41
45
|
...configMap[apiPathKey],
|
|
42
|
-
...config
|
|
46
|
+
...config,
|
|
43
47
|
};
|
|
44
48
|
const [method, url] = apiItem;
|
|
45
49
|
const pathParams = mergedConfig.pathParams;
|
|
@@ -49,7 +53,10 @@ const createFunctionalProxy = (array: (string | symbol)[], alovaInstance: Alova<
|
|
|
49
53
|
});
|
|
50
54
|
delete mergedConfig.pathParams;
|
|
51
55
|
let data = mergedConfig.data;
|
|
52
|
-
if (
|
|
56
|
+
if (
|
|
57
|
+
Object.prototype.toString.call(data) === '[object Object]' &&
|
|
58
|
+
typeof FormData !== 'undefined'
|
|
59
|
+
) {
|
|
53
60
|
let hasBlobData = false;
|
|
54
61
|
const formData = new FormData();
|
|
55
62
|
for (const key in data) {
|
|
@@ -60,8 +67,14 @@ const createFunctionalProxy = (array: (string | symbol)[], alovaInstance: Alova<
|
|
|
60
67
|
}
|
|
61
68
|
data = hasBlobData ? formData : data;
|
|
62
69
|
}
|
|
63
|
-
return new Method(
|
|
64
|
-
|
|
70
|
+
return new Method(
|
|
71
|
+
method!.toUpperCase() as MethodType,
|
|
72
|
+
alovaInstance,
|
|
73
|
+
urlReplaced,
|
|
74
|
+
mergedConfig,
|
|
75
|
+
data,
|
|
76
|
+
);
|
|
77
|
+
},
|
|
65
78
|
});
|
|
66
79
|
cache[apiPathKey] = proxy;
|
|
67
80
|
return proxy;
|
|
@@ -71,7 +84,7 @@ export const createApis = (alovaInstance: Alova<AlovaGenerics>, configMap: any)
|
|
|
71
84
|
const Apis = new Proxy({} as scientistApi, {
|
|
72
85
|
get(_, property) {
|
|
73
86
|
return createFunctionalProxy([property], alovaInstance, configMap);
|
|
74
|
-
}
|
|
87
|
+
},
|
|
75
88
|
});
|
|
76
89
|
return Apis;
|
|
77
90
|
};
|
|
@@ -93,7 +106,9 @@ type APISofParameters<Tag extends string, Url extends string> = Tag extends keyo
|
|
|
93
106
|
: any;
|
|
94
107
|
type MethodsConfigMap = {
|
|
95
108
|
[P in keyof typeof import('./apiDefinitions').default]?: MethodConfig<
|
|
96
|
-
P extends `${infer Tag}.${infer Url}`
|
|
109
|
+
P extends `${infer Tag}.${infer Url}`
|
|
110
|
+
? Parameters<NonNullable<APISofParameters<Tag, Url>[0]>['transform']>[0]
|
|
111
|
+
: any
|
|
97
112
|
>;
|
|
98
113
|
};
|
|
99
114
|
export const withConfigType = <Config extends MethodsConfigMap>(config: Config) => config;
|
|
@@ -36,7 +36,16 @@ type Alova2MethodConfig<Responded> =
|
|
|
36
36
|
>
|
|
37
37
|
? Omit<
|
|
38
38
|
AlovaMethodCreateConfig<
|
|
39
|
-
AlovaGenerics<
|
|
39
|
+
AlovaGenerics<
|
|
40
|
+
Responded,
|
|
41
|
+
any,
|
|
42
|
+
RequestConfig,
|
|
43
|
+
Response,
|
|
44
|
+
ResponseHeader,
|
|
45
|
+
L1Cache,
|
|
46
|
+
L2Cache,
|
|
47
|
+
SE
|
|
48
|
+
>,
|
|
40
49
|
any,
|
|
41
50
|
Responded
|
|
42
51
|
>,
|
|
@@ -47,7 +56,7 @@ type Alova2MethodConfig<Responded> =
|
|
|
47
56
|
// Extract the return type of transform function that define in $$userConfigMap, if it not exists, use the default type.
|
|
48
57
|
type ExtractUserDefinedTransformed<
|
|
49
58
|
DefinitionKey extends keyof typeof apiDefinitions,
|
|
50
|
-
Default
|
|
59
|
+
Default,
|
|
51
60
|
> = DefinitionKey extends keyof UserMethodConfigMap
|
|
52
61
|
? UserMethodConfigMap[DefinitionKey]['transform'] extends (...args: any[]) => any
|
|
53
62
|
? Awaited<ReturnType<UserMethodConfigMap[DefinitionKey]['transform']>>
|
|
@@ -56,7 +65,7 @@ type ExtractUserDefinedTransformed<
|
|
|
56
65
|
type Alova2Method<
|
|
57
66
|
Responded,
|
|
58
67
|
DefinitionKey extends keyof typeof apiDefinitions,
|
|
59
|
-
CurrentConfig extends Alova2MethodConfig<any
|
|
68
|
+
CurrentConfig extends Alova2MethodConfig<any>,
|
|
60
69
|
> =
|
|
61
70
|
CollapsedAlova extends Alova<
|
|
62
71
|
AlovaGenerics<
|
|
@@ -164,9 +173,9 @@ declare global {
|
|
|
164
173
|
pathParams: {
|
|
165
174
|
id: string;
|
|
166
175
|
};
|
|
167
|
-
}
|
|
176
|
+
},
|
|
168
177
|
>(
|
|
169
|
-
config: Config
|
|
178
|
+
config: Config,
|
|
170
179
|
): Alova2Method<ScientistState, 'scientistStateRestful.getScientistState', Config>;
|
|
171
180
|
/**
|
|
172
181
|
* ---
|
|
@@ -222,9 +231,9 @@ declare global {
|
|
|
222
231
|
id: string;
|
|
223
232
|
};
|
|
224
233
|
data: ScientistState;
|
|
225
|
-
}
|
|
234
|
+
},
|
|
226
235
|
>(
|
|
227
|
-
config: Config
|
|
236
|
+
config: Config,
|
|
228
237
|
): Alova2Method<ScientistState, 'scientistStateRestful.putScientistState', Config>;
|
|
229
238
|
/**
|
|
230
239
|
* ---
|
|
@@ -254,9 +263,9 @@ declare global {
|
|
|
254
263
|
pathParams: {
|
|
255
264
|
id: string;
|
|
256
265
|
};
|
|
257
|
-
}
|
|
266
|
+
},
|
|
258
267
|
>(
|
|
259
|
-
config: Config
|
|
268
|
+
config: Config,
|
|
260
269
|
): Alova2Method<null, 'scientistStateRestful.deleteScientistState', Config>;
|
|
261
270
|
/**
|
|
262
271
|
* ---
|
|
@@ -330,9 +339,9 @@ declare global {
|
|
|
330
339
|
pageSize: number;
|
|
331
340
|
page: number;
|
|
332
341
|
};
|
|
333
|
-
}
|
|
342
|
+
},
|
|
334
343
|
>(
|
|
335
|
-
config: Config
|
|
344
|
+
config: Config,
|
|
336
345
|
): Alova2Method<PageScientistState, 'scientistStateRestful.queryScientistState', Config>;
|
|
337
346
|
/**
|
|
338
347
|
* ---
|
|
@@ -376,9 +385,9 @@ declare global {
|
|
|
376
385
|
postScientistState<
|
|
377
386
|
Config extends Alova2MethodConfig<ScientistState> & {
|
|
378
387
|
data: ScientistState;
|
|
379
|
-
}
|
|
388
|
+
},
|
|
380
389
|
>(
|
|
381
|
-
config: Config
|
|
390
|
+
config: Config,
|
|
382
391
|
): Alova2Method<ScientistState, 'scientistStateRestful.postScientistState', Config>;
|
|
383
392
|
/**
|
|
384
393
|
* ---
|
|
@@ -395,7 +404,7 @@ declare global {
|
|
|
395
404
|
* ```
|
|
396
405
|
*/
|
|
397
406
|
datesOfScientist<Config extends Alova2MethodConfig<null[][]>>(
|
|
398
|
-
config?: Config
|
|
407
|
+
config?: Config,
|
|
399
408
|
): Alova2Method<null[][], 'scientistStateRestful.datesOfScientist', Config>;
|
|
400
409
|
/**
|
|
401
410
|
* ---
|
|
@@ -412,7 +421,7 @@ declare global {
|
|
|
412
421
|
* ```
|
|
413
422
|
*/
|
|
414
423
|
totalOfScientist<Config extends Alova2MethodConfig<number>>(
|
|
415
|
-
config?: Config
|
|
424
|
+
config?: Config,
|
|
416
425
|
): Alova2Method<number, 'scientistStateRestful.totalOfScientist', Config>;
|
|
417
426
|
/**
|
|
418
427
|
* ---
|
|
@@ -429,7 +438,7 @@ declare global {
|
|
|
429
438
|
* ```
|
|
430
439
|
*/
|
|
431
440
|
todayOfScientistByToday<Config extends Alova2MethodConfig<number>>(
|
|
432
|
-
config?: Config
|
|
441
|
+
config?: Config,
|
|
433
442
|
): Alova2Method<number, 'scientistStateRestful.todayOfScientistByToday', Config>;
|
|
434
443
|
};
|
|
435
444
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './scientist';
|
|
1
|
+
export * from './scientist';
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
import { Scientist } from '
|
|
2
|
-
|
|
3
|
-
export class AlovaScientist extends Scientist{
|
|
1
|
+
import { Scientist } from 'src/api/scientist/scientist';
|
|
4
2
|
|
|
3
|
+
export class AlovaScientist extends Scientist {
|
|
5
4
|
override async get() {
|
|
6
|
-
return this.of(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
return this.of(
|
|
6
|
+
await scientistApi.scientistStateRestful
|
|
7
|
+
.getScientistState({
|
|
8
|
+
pathParams: {
|
|
9
|
+
id: this.id,
|
|
10
|
+
},
|
|
11
|
+
async transform(res) {
|
|
12
|
+
return new AlovaScientist().of(res);
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
.send(),
|
|
16
|
+
);
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
override async put() {
|
|
17
|
-
return this.of(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
return this.of(
|
|
21
|
+
await scientistApi.scientistStateRestful
|
|
22
|
+
.putScientistState({
|
|
23
|
+
pathParams: {
|
|
24
|
+
id: this.id,
|
|
25
|
+
},
|
|
26
|
+
data: this.state(),
|
|
27
|
+
})
|
|
28
|
+
.send(true),
|
|
29
|
+
);
|
|
23
30
|
}
|
|
24
31
|
async post() {
|
|
25
|
-
return this.of(
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
return this.of(
|
|
33
|
+
await scientistApi.scientistStateRestful
|
|
34
|
+
.postScientistState({
|
|
35
|
+
data: this.state(),
|
|
36
|
+
})
|
|
37
|
+
.send(true),
|
|
38
|
+
);
|
|
28
39
|
}
|
|
29
40
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createAlova } from 'alova';
|
|
2
2
|
import fetchAdapter from 'alova/fetch';
|
|
3
3
|
import { createApis, withConfigType, mountApis } from './createApis';
|
|
4
|
-
import { onAuthRequired, responded } from '
|
|
5
|
-
import { getServiceEndpoint, ServiceType } from '
|
|
4
|
+
import { onAuthRequired, responded } from 'src/api/config/alova';
|
|
5
|
+
import { getServiceEndpoint, ServiceType } from 'src/api/config';
|
|
6
6
|
|
|
7
7
|
export const alovaInstance = createAlova({
|
|
8
8
|
baseURL: getServiceEndpoint(ServiceType.Scientist),
|
|
9
9
|
requestAdapter: fetchAdapter(),
|
|
10
10
|
beforeRequest: onAuthRequired(() => {}),
|
|
11
11
|
cacheFor: null,
|
|
12
|
-
responded: responded
|
|
12
|
+
responded: responded,
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
export const $$userConfigMap = withConfigType({});
|
|
@@ -18,6 +18,7 @@ const Apis = createApis(alovaInstance, $$userConfigMap);
|
|
|
18
18
|
|
|
19
19
|
mountApis(Apis);
|
|
20
20
|
|
|
21
|
+
export * from './implement'
|
|
21
22
|
export default Apis;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
export * from './implement';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './scientist';
|
|
2
|
-
export * from './alova
|
|
2
|
+
export * from './alova';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { NetworkObject } from '
|
|
1
|
+
import { NetworkObject } from 'src/api/patient/core';
|
|
2
2
|
import type { IBuilder } from 'builder-pattern';
|
|
3
3
|
import { Builder } from 'builder-pattern';
|
|
4
|
-
import type { ScientistState } from '
|
|
5
|
-
import { getName } from '
|
|
4
|
+
import type { ScientistState } from 'src/api/scientist/alova/globals';
|
|
5
|
+
import { getName } from 'src/util/string';
|
|
6
6
|
|
|
7
|
-
export abstract class Scientist extends NetworkObject{
|
|
8
|
-
static override builder(): IBuilder<Scientist>{
|
|
7
|
+
export abstract class Scientist extends NetworkObject {
|
|
8
|
+
static override builder(): IBuilder<Scientist> {
|
|
9
9
|
return Builder(this._default) as unknown as IBuilder<Scientist>;
|
|
10
10
|
}
|
|
11
11
|
static override default(): typeof Scientist {
|
|
12
12
|
return this._default as unknown as typeof Scientist;
|
|
13
13
|
}
|
|
14
|
-
id: string =
|
|
15
|
-
name: string =
|
|
14
|
+
id: string = '';
|
|
15
|
+
name: string = '';
|
|
16
16
|
createdTimestamp: string = '';
|
|
17
17
|
updatedTimestamp: string = '';
|
|
18
18
|
gender: string = '';
|
|
@@ -20,18 +20,18 @@ export abstract class Scientist extends NetworkObject{
|
|
|
20
20
|
phoneNumber: string = '';
|
|
21
21
|
birthdate: string = '';
|
|
22
22
|
|
|
23
|
-
override of(json: ScientistState){
|
|
24
|
-
if(json.id != undefined)this.id = json.id;
|
|
25
|
-
if(json.name != undefined)this.name = getName(json.name);
|
|
26
|
-
if(json.gender != undefined)this.gender = json.gender;
|
|
27
|
-
if(json.identityNumber != undefined)this.identityNumber = json.identityNumber;
|
|
28
|
-
if(json.phoneNumber != undefined)this.phoneNumber = json.phoneNumber;
|
|
29
|
-
if(json.birthdate != undefined)this.birthdate = json.birthdate;
|
|
30
|
-
if(json.createdTimestamp != undefined)this.createdTimestamp = json.createdTimestamp;
|
|
31
|
-
if(json.updatedTimestamp != undefined)this.updatedTimestamp = json.updatedTimestamp;
|
|
23
|
+
override of(json: ScientistState) {
|
|
24
|
+
if (json.id != undefined) this.id = json.id;
|
|
25
|
+
if (json.name != undefined) this.name = getName(json.name);
|
|
26
|
+
if (json.gender != undefined) this.gender = json.gender;
|
|
27
|
+
if (json.identityNumber != undefined) this.identityNumber = json.identityNumber;
|
|
28
|
+
if (json.phoneNumber != undefined) this.phoneNumber = json.phoneNumber;
|
|
29
|
+
if (json.birthdate != undefined) this.birthdate = json.birthdate;
|
|
30
|
+
if (json.createdTimestamp != undefined) this.createdTimestamp = json.createdTimestamp;
|
|
31
|
+
if (json.updatedTimestamp != undefined) this.updatedTimestamp = json.updatedTimestamp;
|
|
32
32
|
return Promise.resolve(this);
|
|
33
33
|
}
|
|
34
|
-
override state(){
|
|
34
|
+
override state() {
|
|
35
35
|
return {
|
|
36
36
|
id: this.id,
|
|
37
37
|
name: this.name,
|
|
@@ -41,9 +41,9 @@ export abstract class Scientist extends NetworkObject{
|
|
|
41
41
|
identityNumber: this.identityNumber,
|
|
42
42
|
phoneNumber: this.phoneNumber,
|
|
43
43
|
birthdate: this.birthdate,
|
|
44
|
-
} as ScientistState
|
|
44
|
+
} as ScientistState;
|
|
45
45
|
}
|
|
46
|
-
abstract get(): Promise<this
|
|
47
|
-
abstract put(): Promise<this
|
|
46
|
+
abstract get(): Promise<this>;
|
|
47
|
+
abstract put(): Promise<this>;
|
|
48
48
|
abstract post(): Promise<this>;
|
|
49
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './
|
|
3
|
-
export
|
|
4
|
-
export {Patient} from './api/patient'
|
|
1
|
+
export * from './api/index';
|
|
2
|
+
export * from './proto/index';
|
|
3
|
+
export { Patient } from './api/patient';
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
<q-item-section>个人资料</q-item-section>
|
|
36
36
|
</q-item>
|
|
37
37
|
|
|
38
|
-
|
|
39
38
|
<q-separator />
|
|
40
39
|
|
|
41
40
|
<q-item clickable v-close-popup @click="logout">
|
|
@@ -57,24 +56,27 @@
|
|
|
57
56
|
</template>
|
|
58
57
|
|
|
59
58
|
<script setup lang="ts">
|
|
60
|
-
import {computed,ref } from 'vue';
|
|
59
|
+
import { computed, ref } from 'vue';
|
|
61
60
|
import { useRouter, useRoute } from 'vue-router';
|
|
62
61
|
|
|
63
62
|
const router = useRouter();
|
|
64
63
|
const route = useRoute();
|
|
65
64
|
|
|
66
|
-
|
|
67
65
|
const currentTab = computed(() => route.path);
|
|
68
66
|
setInterval(() => {
|
|
69
|
-
username.value = localStorage.getItem('user')
|
|
67
|
+
username.value = localStorage.getItem('user')
|
|
68
|
+
? JSON.parse(localStorage.getItem('user') || '{}').username
|
|
69
|
+
: '用户';
|
|
70
70
|
}, 100);
|
|
71
|
-
const username = ref(
|
|
71
|
+
const username = ref(
|
|
72
|
+
localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user') || '{}').username : '用户',
|
|
73
|
+
);
|
|
72
74
|
const userTabs = [
|
|
73
75
|
{
|
|
74
76
|
label: '首页',
|
|
75
77
|
icon: 'home',
|
|
76
|
-
path: '/user/home'
|
|
77
|
-
}
|
|
78
|
+
path: '/user/home',
|
|
79
|
+
},
|
|
78
80
|
];
|
|
79
81
|
|
|
80
82
|
async function navigateTo(path: string) {
|
package/src/pages/LoginPage.vue
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
// @generated by protoc-gen-es v2.9.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file Images.proto (syntax proto3)
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
|
-
import type { GenFile, GenMessage } from
|
|
6
|
-
import { fileDesc, messageDesc } from
|
|
7
|
-
import type { Message } from
|
|
5
|
+
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2';
|
|
6
|
+
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2';
|
|
7
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Describes the file Images.proto.
|
|
11
11
|
*/
|
|
12
|
-
export const file_Images: GenFile =
|
|
13
|
-
|
|
12
|
+
export const file_Images: GenFile =
|
|
13
|
+
/*@__PURE__*/
|
|
14
|
+
fileDesc(
|
|
15
|
+
'CgxJbWFnZXMucHJvdG8iFgoFSW1hZ2USDQoFYnl0ZXMYASABKAwiIAoGSW1hZ2VzEhYKBmltYWdlcxgBIAMoCzIGLkltYWdlYgZwcm90bzM',
|
|
16
|
+
);
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @generated from message Image
|
|
17
20
|
*/
|
|
18
|
-
export type Image = Message<
|
|
21
|
+
export type Image = Message<'Image'> & {
|
|
19
22
|
/**
|
|
20
23
|
* @generated from field: bytes bytes = 1;
|
|
21
24
|
*/
|
|
@@ -26,13 +29,12 @@ export type Image = Message<"Image"> & {
|
|
|
26
29
|
* Describes the message Image.
|
|
27
30
|
* Use `create(ImageSchema)` to create a new message.
|
|
28
31
|
*/
|
|
29
|
-
export const ImageSchema: GenMessage<Image> = /*@__PURE__*/
|
|
30
|
-
messageDesc(file_Images, 0);
|
|
32
|
+
export const ImageSchema: GenMessage<Image> = /*@__PURE__*/ messageDesc(file_Images, 0);
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
35
|
* @generated from message Images
|
|
34
36
|
*/
|
|
35
|
-
export type Images = Message<
|
|
37
|
+
export type Images = Message<'Images'> & {
|
|
36
38
|
/**
|
|
37
39
|
* @generated from field: repeated Image images = 1;
|
|
38
40
|
*/
|
|
@@ -43,6 +45,4 @@ export type Images = Message<"Images"> & {
|
|
|
43
45
|
* Describes the message Images.
|
|
44
46
|
* Use `create(ImagesSchema)` to create a new message.
|
|
45
47
|
*/
|
|
46
|
-
export const ImagesSchema: GenMessage<Images> = /*@__PURE__*/
|
|
47
|
-
messageDesc(file_Images, 1);
|
|
48
|
-
|
|
48
|
+
export const ImagesSchema: GenMessage<Images> = /*@__PURE__*/ messageDesc(file_Images, 1);
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
// @generated by protoc-gen-es v2.9.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file WaveMap.proto (syntax proto3)
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
|
-
import type { GenFile, GenMessage } from
|
|
6
|
-
import { fileDesc, messageDesc } from
|
|
7
|
-
import type { Message } from
|
|
5
|
+
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2';
|
|
6
|
+
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2';
|
|
7
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Describes the file WaveMap.proto.
|
|
11
11
|
*/
|
|
12
|
-
export const file_WaveMap: GenFile =
|
|
13
|
-
|
|
12
|
+
export const file_WaveMap: GenFile =
|
|
13
|
+
/*@__PURE__*/
|
|
14
|
+
fileDesc(
|
|
15
|
+
'Cg1XYXZlTWFwLnByb3RvIhYKBFdhdmUSDgoGdmFsdWVzGAEgAygBIsEBCgdXYXZlTWFwEiQKBm9yaWdpbhgBIAMoCzIULldhdmVNYXAuT3JpZ2luRW50cnkSJAoGc21vb3RoGAIgAygLMhQuV2F2ZU1hcC5TbW9vdGhFbnRyeRo0CgtPcmlnaW5FbnRyeRILCgNrZXkYASABKAkSFAoFdmFsdWUYAiABKAsyBS5XYXZlOgI4ARo0CgtTbW9vdGhFbnRyeRILCgNrZXkYASABKAkSFAoFdmFsdWUYAiABKAsyBS5XYXZlOgI4AWIGcHJvdG8z',
|
|
16
|
+
);
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @generated from message Wave
|
|
17
20
|
*/
|
|
18
|
-
export type Wave = Message<
|
|
21
|
+
export type Wave = Message<'Wave'> & {
|
|
19
22
|
/**
|
|
20
23
|
* 单个数组(对应 number[])
|
|
21
24
|
*
|
|
@@ -28,13 +31,12 @@ export type Wave = Message<"Wave"> & {
|
|
|
28
31
|
* Describes the message Wave.
|
|
29
32
|
* Use `create(WaveSchema)` to create a new message.
|
|
30
33
|
*/
|
|
31
|
-
export const WaveSchema: GenMessage<Wave> = /*@__PURE__*/
|
|
32
|
-
messageDesc(file_WaveMap, 0);
|
|
34
|
+
export const WaveSchema: GenMessage<Wave> = /*@__PURE__*/ messageDesc(file_WaveMap, 0);
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* @generated from message WaveMap
|
|
36
38
|
*/
|
|
37
|
-
export type WaveMap = Message<
|
|
39
|
+
export type WaveMap = Message<'WaveMap'> & {
|
|
38
40
|
/**
|
|
39
41
|
* 对应 origin: {[key: string]: number[]}
|
|
40
42
|
*
|
|
@@ -54,6 +56,4 @@ export type WaveMap = Message<"WaveMap"> & {
|
|
|
54
56
|
* Describes the message WaveMap.
|
|
55
57
|
* Use `create(WaveMapSchema)` to create a new message.
|
|
56
58
|
*/
|
|
57
|
-
export const WaveMapSchema: GenMessage<WaveMap> = /*@__PURE__*/
|
|
58
|
-
messageDesc(file_WaveMap, 1);
|
|
59
|
-
|
|
59
|
+
export const WaveMapSchema: GenMessage<WaveMap> = /*@__PURE__*/ messageDesc(file_WaveMap, 1);
|
package/src/router/routes.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type { RouteRecordRaw } from 'vue-router';
|
|
|
3
3
|
const routes: RouteRecordRaw[] = [
|
|
4
4
|
{
|
|
5
5
|
path: '/',
|
|
6
|
-
redirect: '/login'
|
|
6
|
+
redirect: '/login',
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
path: '/login',
|
|
10
|
-
component: () => import('pages/LoginPage.vue')
|
|
10
|
+
component: () => import('pages/LoginPage.vue'),
|
|
11
11
|
},
|
|
12
12
|
];
|
|
13
13
|
|