web-core-tcm 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/package.json +41 -21
  2. package/.editorconfig +0 -7
  3. package/.github/workflows/test.yml +0 -29
  4. package/.prettierrc.json +0 -5
  5. package/.vscode/extensions.json +0 -15
  6. package/.vscode/settings.json +0 -9
  7. package/eslint.config.js +0 -83
  8. package/index.html +0 -24
  9. package/postcss.config.js +0 -29
  10. package/public/favicon.ico +0 -0
  11. package/public/icons/favicon-128x128.png +0 -0
  12. package/public/icons/favicon-16x16.png +0 -0
  13. package/public/icons/favicon-32x32.png +0 -0
  14. package/public/icons/favicon-96x96.png +0 -0
  15. package/quasar.config.ts +0 -220
  16. package/src/App.vue +0 -7
  17. package/src/api/algorithm/comprehensiveAlgorithm.ts +0 -20
  18. package/src/api/algorithm/index.ts +0 -50
  19. package/src/api/algorithm/inquiriesAlgorithm.ts +0 -19
  20. package/src/api/algorithm/inspectionsAlgorithm.ts +0 -11
  21. package/src/api/algorithm/lisemsAlgorithm.ts +0 -16
  22. package/src/api/algorithm/pulsationsAlgorithm.ts +0 -9
  23. package/src/api/authorization/alova/apiDefinitions.ts +0 -23
  24. package/src/api/authorization/alova/createApis.ts +0 -99
  25. package/src/api/authorization/alova/globals.d.ts +0 -373
  26. package/src/api/authorization/alova/implement/authorization.ts +0 -12
  27. package/src/api/authorization/alova/implement/index.ts +0 -1
  28. package/src/api/authorization/alova/index.ts +0 -23
  29. package/src/api/authorization/authorization.ts +0 -16
  30. package/src/api/authorization/index.ts +0 -2
  31. package/src/api/check/alova/apiDefinitions.ts +0 -30
  32. package/src/api/check/alova/createApis.ts +0 -99
  33. package/src/api/check/alova/globals.d.ts +0 -1248
  34. package/src/api/check/alova/implement/check.ts +0 -119
  35. package/src/api/check/alova/implement/index.ts +0 -1
  36. package/src/api/check/alova/index.ts +0 -23
  37. package/src/api/check/check.ts +0 -164
  38. package/src/api/check/index.ts +0 -2
  39. package/src/api/config/alova/index.ts +0 -72
  40. package/src/api/config/index.ts +0 -130
  41. package/src/api/device/device.js +0 -58
  42. package/src/api/doctor/alova/apiDefinitions.ts +0 -28
  43. package/src/api/doctor/alova/createApis.ts +0 -99
  44. package/src/api/doctor/alova/globals.d.ts +0 -550
  45. package/src/api/doctor/alova/implement/doctor.ts +0 -37
  46. package/src/api/doctor/alova/implement/index.ts +0 -1
  47. package/src/api/doctor/alova/index.ts +0 -23
  48. package/src/api/doctor/doctor.ts +0 -53
  49. package/src/api/doctor/index.ts +0 -2
  50. package/src/api/index.ts +0 -15
  51. package/src/api/metric/implement/index.ts +0 -1
  52. package/src/api/metric/implement/metric.ts +0 -98
  53. package/src/api/metric/index.ts +0 -2
  54. package/src/api/metric/metric.ts +0 -114
  55. package/src/api/oauth/alova/apiDefinitions.ts +0 -26
  56. package/src/api/oauth/alova/createApis.ts +0 -99
  57. package/src/api/oauth/alova/globals.d.ts +0 -451
  58. package/src/api/oauth/alova/implement/index.ts +0 -1
  59. package/src/api/oauth/alova/implement/oauth.ts +0 -19
  60. package/src/api/oauth/alova/index.ts +0 -22
  61. package/src/api/oauth/index.ts +0 -2
  62. package/src/api/oauth/oauth.ts +0 -15
  63. package/src/api/outpatient/alova/apiDefinitions.ts +0 -27
  64. package/src/api/outpatient/alova/createApis.ts +0 -99
  65. package/src/api/outpatient/alova/globals.d.ts +0 -676
  66. package/src/api/outpatient/alova/implement/index.ts +0 -1
  67. package/src/api/outpatient/alova/implement/outpatient.ts +0 -66
  68. package/src/api/outpatient/alova/index.ts +0 -23
  69. package/src/api/outpatient/index.ts +0 -2
  70. package/src/api/outpatient/outpatient.ts +0 -62
  71. package/src/api/patient/alova/apiDefinitions.ts +0 -41
  72. package/src/api/patient/alova/createApis.ts +0 -99
  73. package/src/api/patient/alova/globals.d.ts +0 -1677
  74. package/src/api/patient/alova/implement/index.ts +0 -2
  75. package/src/api/patient/alova/implement/meta.ts +0 -488
  76. package/src/api/patient/alova/implement/patient.ts +0 -77
  77. package/src/api/patient/alova/index.ts +0 -24
  78. package/src/api/patient/core.ts +0 -131
  79. package/src/api/patient/index.ts +0 -4
  80. package/src/api/patient/meta.ts +0 -466
  81. package/src/api/patient/patient.ts +0 -98
  82. package/src/api/prescription/alova/apiDefinitions.ts +0 -29
  83. package/src/api/prescription/alova/createApis.ts +0 -99
  84. package/src/api/prescription/alova/globals.d.ts +0 -959
  85. package/src/api/prescription/alova/implement/herbal.ts +0 -48
  86. package/src/api/prescription/alova/implement/index.ts +0 -2
  87. package/src/api/prescription/alova/implement/prescription.ts +0 -45
  88. package/src/api/prescription/alova/index.ts +0 -23
  89. package/src/api/prescription/herbal.ts +0 -44
  90. package/src/api/prescription/index.ts +0 -3
  91. package/src/api/prescription/prescription.ts +0 -68
  92. package/src/api/scientist/alova/apiDefinitions.ts +0 -27
  93. package/src/api/scientist/alova/createApis.ts +0 -99
  94. package/src/api/scientist/alova/globals.d.ts +0 -438
  95. package/src/api/scientist/alova/implement/index.ts +0 -1
  96. package/src/api/scientist/alova/implement/scientist.ts +0 -29
  97. package/src/api/scientist/alova/index.ts +0 -23
  98. package/src/api/scientist/index.ts +0 -2
  99. package/src/api/scientist/scientist.ts +0 -49
  100. package/src/assets/quasar-logo-vertical.svg +0 -15
  101. package/src/boot/.gitkeep +0 -0
  102. package/src/components/ExampleComponent.vue +0 -37
  103. package/src/components/models.ts +0 -8
  104. package/src/css/app.scss +0 -1
  105. package/src/css/quasar.variables.scss +0 -25
  106. package/src/env.d.ts +0 -7
  107. package/src/index.ts +0 -4
  108. package/src/layouts/UserLayout.vue +0 -106
  109. package/src/pages/LoginPage.vue +0 -32
  110. package/src/proto/Images.proto +0 -7
  111. package/src/proto/WaveMap.proto +0 -10
  112. package/src/proto/index.ts +0 -2
  113. package/src/proto/types/Images_pb.ts +0 -48
  114. package/src/proto/types/WaveMap_pb.ts +0 -59
  115. package/src/router/index.ts +0 -37
  116. package/src/router/routes.ts +0 -14
  117. package/src/util/RichTextUtil.ts +0 -5
  118. package/src/util/datetime.ts +0 -43
  119. package/src/util/export.ts +0 -46
  120. package/src/util/helper.ts +0 -159
  121. package/src/util/image.ts +0 -28
  122. package/src/util/number.ts +0 -146
  123. package/src/util/s256.js +0 -30
  124. package/src/util/secret.ts +0 -60
  125. package/src/util/string.ts +0 -121
  126. package/tsconfig.json +0 -3
@@ -1,119 +0,0 @@
1
- import { Check, Payment } from '@core/api/check/check';
2
-
3
- export class AlovaCheck extends Check {
4
- override async get() {
5
- return this.of(await checkApi.checkStateRestful.getCheckState({
6
- pathParams: {
7
- id: this.id,
8
- },
9
- async transform(res) {
10
- return new AlovaCheck().of(res);
11
- },
12
- }).send());
13
- }
14
-
15
- override async put() {
16
- return this.of(await checkApi.checkStateRestful.putCheckState({
17
- pathParams: {
18
- id: this.id,
19
- },
20
- data: this.state()
21
- }).send(true));
22
- }
23
-
24
- override async post() {
25
- return this.of(await checkApi.checkStateRestful.postCheckState({
26
- data: this.state(),
27
- }).send(true));
28
- }
29
- override delete() {
30
- void checkApi.checkStateRestful.deleteCheckState({
31
- pathParams: {
32
- id: this.id,
33
- },
34
- }).send();
35
- return Promise.resolve();
36
- }
37
- static override query(page: number, pageSize: number, sort: string, patientId?: string, doctorId?: string, startTime?: string, endTime?: string, patientName?: string, patientGender?: string, patientPhoneNumber?: string) {
38
- return checkApi.checkStateRestful.queryCheckState({
39
- params: {
40
- ... {... patientId && {patientId}},
41
- ... {... doctorId && {doctorId}},
42
- ... {... startTime && {startTime}},
43
- ... {... endTime && {endTime}},
44
- ... {... patientName && {patientName}},
45
- ... {... patientGender && {patientGender}},
46
- ... {... patientPhoneNumber && {patientPhoneNumber}},
47
- pageSize,
48
- page,
49
- sort,
50
- },
51
- async transform(res) {
52
- const data = await Promise.all(res.content!.map((item) => {
53
- return new AlovaCheck().of(item);
54
- }))
55
- return {
56
- data: data,
57
- total: res.totalElements!,
58
- page: res.number!,
59
- pageSize: res.size!,
60
- pageCount: res.totalPages!,
61
- isLastPage: res.last!
62
- };
63
- },
64
- }).send();
65
- }
66
- static override queryPayment(page: number, pageSize: number, doctorId?: string, patientId?: string, patientName?: string, patientPhone?: string, prescriptionPaymentStatus?: number, outboundStatus?: number) {
67
- return checkApi.checkStateRestful.queryPaymentState({
68
- params: {
69
- ... {... doctorId && {doctorId}},
70
- ... {... patientId && {patientId}},
71
- ... {... patientName && {patientName}},
72
- ... {... patientPhone && {patientPhone}},
73
- ... {... prescriptionPaymentStatus && {prescriptionPaymentStatus}},
74
- ... {... outboundStatus && {outboundStatus}},
75
- pageSize: pageSize,
76
- page: page,
77
- },
78
- async transform(res) {
79
- const data = await Promise.all(res.content!.map((item) => {
80
- return new AlovaPayment().of(item);
81
- }))
82
- return {
83
- data: data,
84
- total: res.totalElements!,
85
- page: res.number!,
86
- pageSize: res.size!,
87
- pageCount: res.totalPages!,
88
- isLastPage: res.last!
89
- }
90
- },
91
- }).send();
92
- }
93
- }
94
- export class AlovaPayment extends Payment {
95
- override async putOutboundStatus(status: number){
96
- this.outboundStatus = status
97
- await checkApi.checkStateRestful.putCheckState({
98
- pathParams: {
99
- id: this.id,
100
- },
101
- data: {
102
- outboundStatus: status,
103
- }
104
- }).send(true)
105
- return Promise.resolve(this)
106
- }
107
- override async putPrescriptionPaymentStatus(status: number){
108
- this.prescriptionPaymentStatus = status
109
- await checkApi.checkStateRestful.putCheckState({
110
- pathParams: {
111
- id: this.id,
112
- },
113
- data: {
114
- prescriptionPaymentStatus: status,
115
- }
116
- }).send(true)
117
- return Promise.resolve(this)
118
- }
119
- }
@@ -1 +0,0 @@
1
- export * from './check';
@@ -1,23 +0,0 @@
1
- import { createAlova } from 'alova';
2
- import fetchAdapter from 'alova/fetch';
3
- import { createApis, withConfigType, mountApis } from './createApis';
4
- import { onAuthRequired, responded } from '@core/api/config/alova';
5
- import { getServiceEndpoint, ServiceType } from '@core/api/config';
6
-
7
- export const alovaInstance = createAlova({
8
- baseURL: getServiceEndpoint(ServiceType.Check),
9
- requestAdapter: fetchAdapter(),
10
- beforeRequest: onAuthRequired(),
11
- cacheFor: null,
12
- responded: responded
13
- });
14
-
15
- export const $$userConfigMap = withConfigType({});
16
-
17
- const Apis = createApis(alovaInstance, $$userConfigMap);
18
-
19
- mountApis(Apis);
20
-
21
- export default Apis;
22
-
23
-
@@ -1,164 +0,0 @@
1
- import { Patient } from '@core/api/patient/patient';
2
- import type { Page} from '@core/api/patient/core';
3
- import { Tag } from '@core/api/patient/core';
4
- import { NetworkObject, Sequence } from '@core/api/patient/core';
5
- import type { CheckState, PaymentState } from '@core/api/check/alova/globals';
6
- import { Metas } from '@core/api/patient/meta';
7
- import { Prescription } from '@core/api/prescription/prescription';
8
- import { AlovaPrescription } from '@core/api/prescription/alova/implement/prescription';
9
- import type { PrescriptionState } from '@core/api/prescription/alova/globals';
10
- import { extractPlainText } from '@core/util/RichTextUtil';
11
- import { Doctor } from '@core/api/doctor/doctor';
12
- import { Herbal } from '@core/api/prescription';
13
- import type { IBuilder } from 'builder-pattern';
14
- import { Builder } from 'builder-pattern';
15
-
16
- export abstract class Check extends NetworkObject {
17
- static override builder(): IBuilder<Check>{
18
- return Builder(this._default) as unknown as IBuilder<Check>;
19
- }
20
- static override default(): typeof Check {
21
- return this._default as unknown as typeof Check;
22
- }
23
- id: string = '';
24
- doctor: Doctor = Doctor.builder().build();
25
- patient: Patient = Patient.builder().build();
26
- diagnosis: string = '';
27
- tags: Tag[] = [] as Tag[];
28
- prescriptions: Sequence<Prescription> = new Sequence<Prescription>();
29
- createdTimestamp: string = Date.now().toString();
30
- updatedTimestamp: string = Date.now().toString();
31
- prescriptionPaymentStatus: number = 0;
32
- outboundStatus: number = 0;
33
- //购买类型
34
- paymentType: string = '医保';
35
- //就诊方式
36
- outpatientType: string = '预约';
37
- draft: boolean = false;
38
- isEditing: boolean = false;
39
- metas: Metas = Metas.builder().build();
40
- constructor(){
41
- super()
42
- const prescription = Prescription.builder().build()
43
- prescription.herbals.push(Herbal.builder().build());
44
- this.prescriptions.data.push(prescription)
45
- }
46
- async of(json: CheckState) {
47
- if(json.tagsState != undefined)this.tags = await Promise.all(json.tagsState.map(item => {
48
- const clTag = new Tag()
49
- return clTag.of(item)
50
- }));
51
- if(json.id != undefined)this.id = json.id;
52
- if (json.prescriptionsState != undefined) {
53
- this.prescriptions = new Sequence<AlovaPrescription>();
54
- const prescriptionStates = JSON.parse(json.prescriptionsState) as PrescriptionState[]
55
- const prescription = await Promise.all(prescriptionStates.map(async item => {return new AlovaPrescription().of(item)}))
56
- this.prescriptions.data.push(...prescription);
57
- }
58
- if(this.prescriptions.data.length === 0)this.prescriptions.data.push(Prescription.builder().build())
59
- if(json.diagnosis != undefined){
60
- if(json.diagnosis.indexOf('脉证') !== 0 && json.diagnosis.indexOf('\n脉证') === -1){
61
- json.diagnosis = json.diagnosis.replaceAll('脉证','\n脉证')
62
- }
63
- if(json.diagnosis.indexOf('\n方证') === -1){
64
- json.diagnosis = json.diagnosis.replaceAll('方证','\n方证')
65
- }
66
- this.diagnosis = extractPlainText(json.diagnosis);
67
- }
68
- if(json.doctorState != undefined)this.doctor = await this.doctor.of(json.doctorState)
69
- if(json.patientState != undefined)this.patient = await this.patient.of(json.patientState)
70
- if(json.createdTimestamp != undefined)this.createdTimestamp = json.createdTimestamp!;
71
- if(json.updatedTimestamp != undefined)this.updatedTimestamp = json.updatedTimestamp!;
72
- if(json.prescriptionPaymentStatus != undefined)this.prescriptionPaymentStatus = json.prescriptionPaymentStatus!;
73
- if(json.outboundStatus != undefined)this.outboundStatus = json.outboundStatus!;
74
- if(json.paymentType != undefined)this.paymentType = json.paymentType!;
75
- if(json.outpatientType != undefined)this.outpatientType = json.outpatientType!;
76
- if(json.metasState != undefined){
77
- this.metas.addMetas(await Promise.all(json.metasState.map(item => Metas.map(item))))
78
- }
79
- return this;
80
- }
81
-
82
- state(){
83
- console.log(this)
84
- const state = { } as CheckState;
85
- state.id = this.id;
86
- state.doctorState = this.doctor.state();
87
- state.patientState = this.patient.state();
88
- state.outpatientType = this.outpatientType;
89
- state.paymentType = this.paymentType;
90
- // Note: We can't populate metaIds here as it would create a circular dependency
91
- // The metaIds should be populated by the caller if needed
92
- state.diagnosis = extractPlainText(this.diagnosis.replace('</div>','\n<div>'))
93
- state.createdTimestamp = this.createdTimestamp;
94
- // Note: We'll leave prescriptions handling for the caller due to complexity
95
- state.diagnosis = this.diagnosis;
96
- state.tagsState = this.tags.map(item => item.state());
97
- state.createdTimestamp = this.createdTimestamp;
98
- state.updatedTimestamp = this.updatedTimestamp;
99
- state.prescriptionsState = JSON.stringify(this.prescriptions.data.map(item => item.state()))
100
- state.metasState = Metas.standards().flatMap(type => this.metas[type].data.map(item => item.state()))
101
- return state;
102
- }
103
- abstract get(): Promise<this>;
104
- abstract put(): Promise<this>;
105
- abstract post(): Promise<this>;
106
- abstract delete(): Promise<void>;
107
-
108
- static query(page: number, pageSize: number, sort: string, patientId?: string, doctorId?: string, startTime?: string, endTime?: string, patientName?: string, patientGender?: string, patientPhoneNumber?: string): Promise<Page<Check>> {
109
- return Check.default().query(page, pageSize, sort, patientId, doctorId, startTime, endTime, patientName, patientGender, patientPhoneNumber)
110
- }
111
- static queryPayment(page: number, pageSize: number, doctorId?: string, patientId?: string, patientName?: string, patientPhone?: string, prescriptionPaymentStatus?: number, outboundStatus?: number):Promise<Page<Payment>>{
112
- return Check.default().queryPayment(page, pageSize, doctorId, patientId, patientName, patientPhone, prescriptionPaymentStatus, outboundStatus)
113
- }
114
- }
115
- export abstract class Payment extends NetworkObject{
116
- static override builder(): IBuilder<Payment>{
117
- return Builder(this._default) as unknown as IBuilder<Payment>;
118
- }
119
- static override default(): typeof Payment {
120
- return this._default as unknown as typeof Payment;
121
- }
122
- id: string = '';
123
- prescription: string = '';
124
- doctorId: string = '';
125
- patientId: string = '';
126
- patientName: string = '';
127
- patientPhone: string = '';
128
- patientGender: string = '';
129
- createdTimestamp: number = 0;
130
- updatedTimestamp: number = 0;
131
- prescriptionPaymentStatus: number = 0;
132
- outboundStatus: number = 0;
133
- async of(json: PaymentState) {
134
- this.id = json.id!;
135
- this.prescription = json.prescription?json.prescription:'';
136
- this.doctorId = json.doctorId!;
137
- this.patientId = json.patientId!;
138
- this.patientName = json.patientName?json.patientName:'';
139
- this.patientPhone = json.patientPhone?json.patientPhone:'';
140
- this.patientGender = json.patientGender?json.patientGender:'';
141
- this.createdTimestamp = json.createdTimestamp?json.createdTimestamp:0;
142
- this.updatedTimestamp = json.updatedTimestamp?json.updatedTimestamp:0;
143
- this.prescriptionPaymentStatus = json.prescriptionPaymentStatus?json.prescriptionPaymentStatus:0;
144
- this.outboundStatus = json.outboundStatus?json.outboundStatus:0;
145
- return Promise.resolve(this);
146
- }
147
- state(): PaymentState {
148
- return {
149
- id: this.id,
150
- prescription: this.prescription,
151
- doctorId: this.doctorId,
152
- patientId: this.patientId,
153
- patientName: this.patientName,
154
- patientPhone: this.patientPhone,
155
- patientGender: this.patientGender,
156
- createdTimestamp: this.createdTimestamp,
157
- updatedTimestamp: this.updatedTimestamp,
158
- prescriptionPaymentStatus: this.prescriptionPaymentStatus,
159
- outboundStatus: this.outboundStatus,
160
- };
161
- }
162
- abstract putOutboundStatus(status: number): Promise<this>
163
- abstract putPrescriptionPaymentStatus(status: number): Promise<this>
164
- }
@@ -1,2 +0,0 @@
1
- export * from './check';
2
- export * from './alova/index';
@@ -1,72 +0,0 @@
1
- import { createClientTokenAuthentication } from 'alova/client';
2
- import { storageHelper } from '@core/util/helper';
3
- import { jwtDecode } from 'jwt-decode';
4
- import type { Method } from 'alova';
5
-
6
- export const { onAuthRequired } = createClientTokenAuthentication({
7
- assignToken: method => {
8
- if (!storageHelper.getItem('token')) {
9
- return;
10
- }
11
- method.config.headers.Authorization = 'Bearer ' + storageHelper.getItem('token');
12
- },
13
- visitorMeta: {
14
- isVisitor: true
15
- },
16
- login: {
17
- metaMatches:{
18
- login: true
19
- },
20
- handler: async (response: Response) => {
21
- if(response.status != 200)throw new Error('登录失败'+await response.text())
22
- await response.json().then(data => {
23
- storageHelper.setItem('token', data.token);
24
- });
25
- }
26
- },
27
- refreshToken: {
28
- // 在请求前触发,将接收到method参数,并返回boolean表示token是否过期
29
- isExpired: () => {
30
- if(!storageHelper.getItem('token'))return false
31
- const decoded = jwtDecode(storageHelper.getItem('token'))
32
- // 如果没有 exp 声明,默认永不过期
33
- if (decoded.exp === undefined) return false;
34
-
35
- // 获取当前时间(秒)
36
- const currentTime = Date.now() / 1000;
37
-
38
- // 检查是否过期
39
- return decoded.exp < currentTime;
40
- },
41
-
42
- // 当token过期时触发,在此函数中触发刷新token
43
- handler: async () => {
44
- // token刷新失败,跳转回登录页
45
- storageHelper.removeItem('token')
46
- window.location.href = "登录"
47
- return await Promise.resolve();
48
- }
49
- },
50
- });
51
- export const responded = {
52
- onSuccess: async (response: Response,method: Method) => {
53
- if(response.status == 401){
54
- if(method.meta['Login']){
55
- throw new Error(response.status.toString())
56
- }
57
- console.log('未登录')
58
- storageHelper.removeItem('token')
59
- window.location.href = process.env.APP_URL!
60
- }
61
- if("application/octet-stream" == response.headers.get('Content-Type'))return response
62
- if(response.status == 200 || response.status == 201 || response.status == 204){
63
- const raw = await response.text()
64
- try {
65
- return JSON.parse(raw)
66
- }
67
- catch {
68
- return raw;
69
- }
70
- }
71
- },
72
- }
@@ -1,130 +0,0 @@
1
- import punycode from 'punycode';
2
- //设置服务类型有哪些
3
- export enum ServiceType {
4
- OAuth = 'OAuth',
5
- OAuthRedirect = 'OAuthRedirect',
6
- Doctor = 'Doctor',
7
- Patient = 'Patient',
8
- Scientist = 'Scientist',
9
- Outpatient = 'Outpatient',
10
- Check = 'Check',
11
- Prescription = 'Prescription',
12
- Authorization = 'Authorization',
13
- InspectionsAlgorithm = 'InspectionsAlgorithm',
14
- PulsationsAlgorithm = 'PulsationsAlgorithm',
15
- InquiriesAlgorithm = 'InquiriesAlgorithm',
16
- LisemsAlgorithm = 'LisemsAlgorithm',
17
- ComprehensiveAlgorithm = 'ComprehensiveAlgorithm'
18
- }
19
- //设置服务类型有哪些
20
- export enum EnvironmentType {
21
- Dev = 'Dev',
22
- Prod = 'Prod',
23
- Local = 'Local'
24
- }
25
- export const getServiceEndpoint = (serviceType: ServiceType,env?: EnvironmentType) => {
26
- if(env == undefined){
27
- if (punycode.toUnicode(window.location.hostname).includes('测试'))env = EnvironmentType.Dev
28
- else if(window.location.hostname.includes("localhost") || window.location.hostname.includes("127.0.0.1")) env = EnvironmentType.Prod
29
- else env = EnvironmentType.Prod
30
- }
31
- if(env == EnvironmentType.Prod){
32
- switch (serviceType) {
33
- case ServiceType.OAuth:
34
- return 'https://用户.仪联中.中国'
35
- case ServiceType.OAuthRedirect:
36
- return 'https://用户.仪联中.中国/互联/服务/互联/授权?response_type=code&state=1223&client_id=tcm&scope=profile'
37
- case ServiceType.Doctor:
38
- return 'https://中医.仪联中.中国'
39
- case ServiceType.Patient:
40
- return 'https://中医.仪联中.中国'
41
- case ServiceType.Scientist:
42
- return 'https://中医.仪联中.中国'
43
- case ServiceType.Outpatient:
44
- return 'https://中医.仪联中.中国'
45
- case ServiceType.Check:
46
- return 'https://中医.仪联中.中国'
47
- case ServiceType.Prescription:
48
- return 'https://中医.仪联中.中国'
49
- case ServiceType.Authorization:
50
- return 'https://中医.仪联中.中国'
51
- case ServiceType.InspectionsAlgorithm:
52
- return 'https://中医.仪联中.中国/望诊/算法'
53
- case ServiceType.PulsationsAlgorithm:
54
- return 'https://中医.仪联中.中国/切诊/算法'
55
- case ServiceType.InquiriesAlgorithm:
56
- return 'https://中医.仪联中.中国/问诊/算法'
57
- case ServiceType.LisemsAlgorithm:
58
- return 'https://中医.仪联中.中国/闻诊/算法'
59
- case ServiceType.ComprehensiveAlgorithm:
60
- return 'https://中医.仪联中.中国/四诊合参/算法'
61
- }
62
- }
63
- else if(env == EnvironmentType.Dev){
64
- switch (serviceType) {
65
- case ServiceType.OAuth:
66
- return 'https://用户测试.仪联中.中国'
67
- case ServiceType.OAuthRedirect:
68
- return 'https://用户测试.仪联中.中国/互联/服务/互联/授权?response_type=code&state=1223&client_id=tcm&scope=profile'
69
- case ServiceType.Doctor:
70
- return 'https://中医测试.仪联中.中国'
71
- case ServiceType.Patient:
72
- return 'https://中医测试.仪联中.中国'
73
- case ServiceType.Scientist:
74
- return 'https://中医测试.仪联中.中国'
75
- case ServiceType.Outpatient:
76
- return 'https://中医测试.仪联中.中国'
77
- case ServiceType.Check:
78
- return 'https://中医测试.仪联中.中国'
79
- case ServiceType.Prescription:
80
- return 'https://中医测试.仪联中.中国'
81
- case ServiceType.Authorization:
82
- return 'https://中医测试.仪联中.中国'
83
- case ServiceType.InspectionsAlgorithm:
84
- return 'https://中医测试.仪联中.中国/望诊/算法'
85
- case ServiceType.PulsationsAlgorithm:
86
- return 'https://中医测试.仪联中.中国/切诊/算法'
87
- case ServiceType.InquiriesAlgorithm:
88
- return 'https://中医测试.仪联中.中国/问诊/算法'
89
- case ServiceType.LisemsAlgorithm:
90
- return 'https://中医测试.仪联中.中国/闻诊/算法'
91
- case ServiceType.ComprehensiveAlgorithm:
92
- return 'https://中医测试.仪联中.中国/四诊合参/算法'
93
- }
94
- }
95
- else if(env == EnvironmentType.Local){
96
- switch (serviceType) {
97
- case ServiceType.OAuth:
98
- return 'http://localhost:8080'
99
- case ServiceType.OAuthRedirect:
100
- return 'https://用户.仪联中.中国/互联/服务/互联/授权?response_type=code&state=1223&client_id=tcm&scope=profile'
101
- case ServiceType.Doctor:
102
- return 'http://localhost:8080'
103
- case ServiceType.Patient:
104
- return 'http://localhost:8080'
105
- case ServiceType.Scientist:
106
- return 'http://localhost:8080'
107
- case ServiceType.Outpatient:
108
- return 'http://localhost:8080'
109
- case ServiceType.Check:
110
- return 'http://localhost:8080'
111
- case ServiceType.Prescription:
112
- return 'http://localhost:8080'
113
- case ServiceType.Authorization:
114
- return 'http://localhost:8080'
115
- case ServiceType.InspectionsAlgorithm:
116
- return 'http://localhost:8080'
117
- case ServiceType.PulsationsAlgorithm:
118
- return 'http://localhost:8080'
119
- case ServiceType.InquiriesAlgorithm:
120
- return 'http://localhost:8080'
121
- case ServiceType.LisemsAlgorithm:
122
- return 'http://localhost:8080'
123
- case ServiceType.ComprehensiveAlgorithm:
124
- return 'http://localhost:8080'
125
- }
126
- }
127
- throw new Error('环境错误')
128
- }
129
-
130
- export * from './alova/index';
@@ -1,58 +0,0 @@
1
- import { ref } from 'vue';
2
- import { useQuasar } from 'quasar';
3
-
4
- const $q = useQuasar();
5
- export const port = ref();
6
-
7
- export async function connectToSerialPort() {
8
- try {
9
- const SerialOptions = {
10
- baudRate: 115200,
11
- dataBits: 8,
12
- stopBits: 1,
13
- bufferSize: 1024,
14
- };
15
- port.value = await navigator.serial.requestPort();
16
- if (!port.value) {
17
- $q.dialog({
18
- title: '错误',
19
- message: '未选择串口',
20
- });
21
- return false;
22
- }
23
- await port.value.open(SerialOptions);
24
- console.log('port', port.value.getInfo());
25
- return true;
26
- } catch (error) {
27
- console.error('Error connecting to serial port:', error);
28
- $q.dialog({
29
- title: '错误',
30
- message: '连接串口失败',
31
- });
32
- return false;
33
- }
34
- }
35
- export function getPortInfo() {
36
- return port.value?.getInfo();
37
- }
38
- export async function disconnectToSerialPort() {
39
- if (!port.value) {
40
- console.error('Serial port not available');
41
- return;
42
- }
43
- await port.value.close();
44
- port.value = null;
45
- console.log('Serial port disconnected');
46
- }
47
-
48
- export async function sendText(text) {
49
- if (port.value) {
50
- const writer = port.value.writable.getWriter();
51
- console.log('text', text);
52
-
53
- await writer.write(new TextEncoder().encode(text));
54
- await writer.close();
55
- } else {
56
- console.error('Serial port not available');
57
- }
58
- }
@@ -1,28 +0,0 @@
1
- /// <reference types='./globals.d.ts' />
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * OpenAPI definition - version v0
6
- *
7
- *
8
- *
9
- * OpenAPI version: 3.1.0
10
- *
11
- *
12
- * NOTE: This file is auto generated by the alova's vscode plugin.
13
- *
14
- * https://alova.js.org/devtools/vscode
15
- *
16
- * **Do not edit the file manually.**
17
- */
18
- export default {
19
- 'doctorStateRestful.getDoctorState': ['GET', '/医生/服务/{id}'],
20
- 'doctorStateRestful.putDoctorState': ['PUT', '/医生/服务/{id}'],
21
- 'doctorStateRestful.deleteDoctorState': ['DELETE', '/医生/服务/{id}'],
22
- 'doctorStateRestful.queryDoctorState': ['GET', '/医生/服务'],
23
- 'doctorStateRestful.postDoctorState': ['POST', '/医生/服务'],
24
- 'doctorStateRestful.queryDoctorStateByExactMatch': ['POST', '/医生/服务/精确匹配'],
25
- 'doctorStateRestful.datesOfDoctor': ['GET', '/医生/服务/统计/医生/日期'],
26
- 'doctorStateRestful.totalOfDoctor': ['GET', '/医生/服务/统计/医生/总数'],
27
- 'doctorStateRestful.totalOfDoctorByToday': ['GET', '/医生/服务/统计/医生/今日']
28
- };