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
package/src/util/export.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function pulsation2csv(data: { [key: string]: number[] }): void {
|
|
2
2
|
const keys = Object.keys(data);
|
|
3
3
|
|
|
4
|
-
const maxLength = Math.max(...keys.map((key) => data[key]
|
|
4
|
+
const maxLength = Math.max(...keys.map((key) => data[key].length));
|
|
5
5
|
|
|
6
6
|
// 填充所有数组到最大长度,可以填充空字符串或其他默认值
|
|
7
7
|
keys.forEach((key) => {
|
|
8
|
-
while (data[key]
|
|
9
|
-
data[key]
|
|
8
|
+
while (data[key].length < maxLength) {
|
|
9
|
+
data[key].push(0); // 或者填入其他默认值
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ function pulsation2csv(data: { [key: string]: number[] }): void {
|
|
|
19
19
|
for (let i = 0; i < maxLength; i++) {
|
|
20
20
|
let row = '';
|
|
21
21
|
keys.forEach((key) => {
|
|
22
|
-
row += `"${data[key]
|
|
22
|
+
row += `"${data[key][i]}"`;
|
|
23
23
|
row += ',';
|
|
24
24
|
});
|
|
25
25
|
csvContent += row.slice(0, -1) + '\n'; // 去掉最后一个逗号
|
package/src/util/helper.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const tokenHelper = {
|
|
|
13
13
|
set: (val: string): StorageResult => {
|
|
14
14
|
try {
|
|
15
15
|
if (getPlatform() === 'electron') {
|
|
16
|
-
window.electronAPI
|
|
16
|
+
window.electronAPI.setStoreItem('token', val);
|
|
17
17
|
} else {
|
|
18
18
|
window.localStorage.setItem('token', val);
|
|
19
19
|
}
|
|
@@ -28,7 +28,7 @@ export const tokenHelper = {
|
|
|
28
28
|
get: (): string | null => {
|
|
29
29
|
try {
|
|
30
30
|
if (getPlatform() === 'electron') {
|
|
31
|
-
return window.electronAPI
|
|
31
|
+
return window.electronAPI.getStoreItem('token');
|
|
32
32
|
} else {
|
|
33
33
|
return window.localStorage.getItem('token');
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ export const tokenHelper = {
|
|
|
42
42
|
remove: (): StorageResult => {
|
|
43
43
|
try {
|
|
44
44
|
if (getPlatform() === 'electron') {
|
|
45
|
-
window.electronAPI
|
|
45
|
+
window.electronAPI.setStoreItem('token', '');
|
|
46
46
|
} else {
|
|
47
47
|
window.localStorage.removeItem('token');
|
|
48
48
|
}
|
|
@@ -66,7 +66,7 @@ export const storageHelper = {
|
|
|
66
66
|
setItem: (key: string, val: string): StorageResult => {
|
|
67
67
|
try {
|
|
68
68
|
if (getPlatform() === 'electron') {
|
|
69
|
-
window.electronAPI
|
|
69
|
+
window.electronAPI.setStoreItem(key, val);
|
|
70
70
|
} else {
|
|
71
71
|
window.localStorage.setItem(key, val);
|
|
72
72
|
}
|
|
@@ -81,7 +81,7 @@ export const storageHelper = {
|
|
|
81
81
|
getItem: (key: string): string | null => {
|
|
82
82
|
try {
|
|
83
83
|
if (getPlatform() === 'electron') {
|
|
84
|
-
return window.electronAPI
|
|
84
|
+
return window.electronAPI.getStoreItem(key);
|
|
85
85
|
} else {
|
|
86
86
|
return window.localStorage.getItem(key);
|
|
87
87
|
}
|
|
@@ -95,7 +95,7 @@ export const storageHelper = {
|
|
|
95
95
|
removeItem: (key: string): StorageResult => {
|
|
96
96
|
try {
|
|
97
97
|
if (getPlatform() === 'electron') {
|
|
98
|
-
window.electronAPI
|
|
98
|
+
window.electronAPI.removeStoreItem(key);
|
|
99
99
|
} else {
|
|
100
100
|
window.localStorage.removeItem(key);
|
|
101
101
|
}
|
package/src/util/image.ts
CHANGED
|
@@ -3,7 +3,7 @@ export function arrayBufferToImageBase64(bytes: Uint8Array) {
|
|
|
3
3
|
let binary = '';
|
|
4
4
|
const len = bytes.byteLength;
|
|
5
5
|
for (let i = 0; i < len; i++) {
|
|
6
|
-
binary += String.fromCharCode(bytes[i]
|
|
6
|
+
binary += String.fromCharCode(bytes[i]);
|
|
7
7
|
}
|
|
8
8
|
return 'data:image/png;base64,' + window.btoa(binary);
|
|
9
9
|
}
|
package/src/util/number.ts
CHANGED
|
@@ -89,14 +89,14 @@ function numberToChinese(num: number | null): string {
|
|
|
89
89
|
// 处理每一组
|
|
90
90
|
for (let i = 0; i < groups.length; i++) {
|
|
91
91
|
let groupStr = '';
|
|
92
|
-
const groupNum = groups[i]
|
|
92
|
+
const groupNum = groups[i];
|
|
93
93
|
|
|
94
94
|
for (let j = 0; j < groupNum.length; j++) {
|
|
95
|
-
const digit = parseInt(groupNum[j]
|
|
95
|
+
const digit = parseInt(groupNum[j]);
|
|
96
96
|
const pos = groupNum.length - 1 - j;
|
|
97
97
|
|
|
98
98
|
if (digit !== 0) {
|
|
99
|
-
groupStr += chineseNums[digit]
|
|
99
|
+
groupStr += chineseNums[digit] + chineseUnits[pos];
|
|
100
100
|
} else {
|
|
101
101
|
// 处理连续的零
|
|
102
102
|
if (j < groupNum.length - 1 && groupNum[j + 1] !== '0') {
|
|
@@ -132,7 +132,7 @@ function numberToChinese(num: number | null): string {
|
|
|
132
132
|
decimalStr = decimalStr.substring(0, 10);
|
|
133
133
|
|
|
134
134
|
for (let i = 0; i < decimalStr.length; i++) {
|
|
135
|
-
const digit = parseInt(decimalStr[i]
|
|
135
|
+
const digit = parseInt(decimalStr[i]);
|
|
136
136
|
chineseDecimal += chineseNums[digit];
|
|
137
137
|
}
|
|
138
138
|
}
|
package/src/util/s256.js
CHANGED
|
@@ -21,10 +21,7 @@ export function generateCodeChallenge(codeVerifier) {
|
|
|
21
21
|
|
|
22
22
|
// 2. 转换为 Base64 URL 安全编码
|
|
23
23
|
const base64 = hash.toString(CryptoJS.enc.Base64);
|
|
24
|
-
const base64Url = base64
|
|
25
|
-
.replace(/=/g, '')
|
|
26
|
-
.replace(/\+/g, '-')
|
|
27
|
-
.replace(/\//g, '_');
|
|
24
|
+
const base64Url = base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
28
25
|
|
|
29
26
|
return base64Url;
|
|
30
27
|
}
|
package/src/util/secret.ts
CHANGED
package/src/util/string.ts
CHANGED
|
@@ -17,15 +17,12 @@ export function getName(name: string): string {
|
|
|
17
17
|
* @param options 选项数组
|
|
18
18
|
* @returns 筛选后的选项数组
|
|
19
19
|
*/
|
|
20
|
-
export function pinyinFilter(
|
|
21
|
-
val: string,
|
|
22
|
-
options: string[]
|
|
23
|
-
): string[] {
|
|
20
|
+
export function pinyinFilter(val: string, options: string[]): string[] {
|
|
24
21
|
if (!val) return [];
|
|
25
22
|
|
|
26
23
|
const lowerVal = val.toLowerCase();
|
|
27
24
|
|
|
28
|
-
return options.filter(option => {
|
|
25
|
+
return options.filter((option) => {
|
|
29
26
|
const targetStr = option;
|
|
30
27
|
if (!targetStr) return false;
|
|
31
28
|
|
|
@@ -34,7 +31,8 @@ export function pinyinFilter(
|
|
|
34
31
|
|
|
35
32
|
// 2. 拼音全拼包含搜索词
|
|
36
33
|
const fullPinyin = pinyin(targetStr, { style: pinyin.STYLE_NORMAL })
|
|
37
|
-
.map(word => word[0])
|
|
34
|
+
.map((word) => word[0])
|
|
35
|
+
.join('');
|
|
38
36
|
if (fullPinyin.includes(lowerVal)) return true;
|
|
39
37
|
|
|
40
38
|
// 3. 拼音首字母缩写包含搜索词
|
|
@@ -49,10 +47,7 @@ export function pinyinFilter(
|
|
|
49
47
|
* @param options 选项数组
|
|
50
48
|
* @returns 匹配项的索引数组
|
|
51
49
|
*/
|
|
52
|
-
export function pinyinFilterIndex(
|
|
53
|
-
val: string,
|
|
54
|
-
options: string[]
|
|
55
|
-
): number[] {
|
|
50
|
+
export function pinyinFilterIndex(val: string, options: string[]): number[] {
|
|
56
51
|
if (!val) return [];
|
|
57
52
|
|
|
58
53
|
const lowerVal = val.toLowerCase();
|
|
@@ -68,7 +63,8 @@ export function pinyinFilterIndex(
|
|
|
68
63
|
|
|
69
64
|
// 2. 拼音全拼包含搜索词
|
|
70
65
|
const fullPinyin = pinyin(targetStr, { style: pinyin.STYLE_NORMAL })
|
|
71
|
-
.map(word => word[0])
|
|
66
|
+
.map((word) => word[0])
|
|
67
|
+
.join('');
|
|
72
68
|
if (fullPinyin.includes(lowerVal)) return true;
|
|
73
69
|
|
|
74
70
|
// 3. 拼音首字母缩写包含搜索词
|
|
@@ -82,9 +78,9 @@ function getPinyinAbbr(chinese: string): string {
|
|
|
82
78
|
if (!chinese) return '';
|
|
83
79
|
const pinyinArray = pinyin(chinese, {
|
|
84
80
|
style: pinyin.STYLE_NORMAL,
|
|
85
|
-
heteronym: false
|
|
81
|
+
heteronym: false,
|
|
86
82
|
});
|
|
87
|
-
return pinyinArray.map(word => word[0]
|
|
83
|
+
return pinyinArray.map((word) => word[0].charAt(0)).join('');
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
export function parseIdNumber(idNumber: string) {
|
|
@@ -102,18 +98,22 @@ export function parseIdNumber(idNumber: string) {
|
|
|
102
98
|
const birthDay = parseInt(birthDateStr.substring(6, 8), 10);
|
|
103
99
|
|
|
104
100
|
const today = new Date();
|
|
105
|
-
const age =
|
|
101
|
+
const age =
|
|
102
|
+
today.getFullYear() -
|
|
103
|
+
birthYear -
|
|
106
104
|
(today.getMonth() < birthMonth ||
|
|
107
|
-
(today.getMonth() === birthMonth && today.getDate() < birthDay)
|
|
105
|
+
(today.getMonth() === birthMonth && today.getDate() < birthDay)
|
|
106
|
+
? 1
|
|
107
|
+
: 0);
|
|
108
108
|
|
|
109
109
|
// 提取性别(第17位)
|
|
110
110
|
const genderDigit = parseInt(idNumber.substring(16, 17), 10);
|
|
111
111
|
const gender = genderDigit % 2 === 1 ? '男' : '女';
|
|
112
112
|
|
|
113
113
|
return {
|
|
114
|
-
birthDate,
|
|
115
|
-
gender,
|
|
116
|
-
age
|
|
114
|
+
birthDate, // 格式:YYYY-MM-DD
|
|
115
|
+
gender, // '男' 或 '女'
|
|
116
|
+
age, // 周岁年龄
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
export function isNumber(value: string) {
|