ebuilds-shared 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/chunk-6DZX6EAA.mjs +37 -0
- package/dist/chunk-G4JQ2UQV.mjs +2878 -0
- package/dist/chunk-LATZ6U6A.js +2878 -0
- package/dist/chunk-MXO66M74.js +36 -0
- package/dist/chunk-OW2EL2VY.mjs +36 -0
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/chunk-QQPGJGSU.js +6916 -0
- package/dist/chunk-RRULL645.mjs +6916 -0
- package/dist/functionalComponent/index.d.mts +16 -0
- package/dist/functionalComponent/index.d.ts +16 -0
- package/dist/functionalComponent/index.js +25 -0
- package/dist/functionalComponent/index.mjs +25 -0
- package/dist/index-CVmrbYyU.d.mts +34 -0
- package/dist/index-CVmrbYyU.d.ts +34 -0
- package/dist/index.css +69 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +65 -0
- package/dist/index.mjs +65 -0
- package/dist/stores/index.d.mts +294 -0
- package/dist/stores/index.d.ts +294 -0
- package/dist/stores/index.js +13 -0
- package/dist/stores/index.mjs +13 -0
- package/dist/styles/index.css +69 -0
- package/dist/styles/index.d.mts +2 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/uno-config/index.d.mts +8 -0
- package/dist/uno-config/index.d.ts +8 -0
- package/dist/uno-config/index.js +9 -0
- package/dist/uno-config/index.mjs +9 -0
- package/dist/utils/index.d.mts +157 -0
- package/dist/utils/index.d.ts +157 -0
- package/dist/utils/index.js +49 -0
- package/dist/utils/index.mjs +49 -0
- package/dist/vite-config/index.d.mts +31 -0
- package/dist/vite-config/index.d.ts +31 -0
- package/dist/vite-config/index.js +7 -0
- package/dist/vite-config/index.mjs +7 -0
- package/package.json +79 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import * as pinia from 'pinia';
|
|
3
|
+
import { Router } from 'vue-router';
|
|
4
|
+
import { M as MenuItem } from '../index-CVmrbYyU.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 分页用的消息
|
|
8
|
+
*/
|
|
9
|
+
interface IDbPager {
|
|
10
|
+
/**
|
|
11
|
+
* 开始的序号,从 0 开始
|
|
12
|
+
*/
|
|
13
|
+
start: number;
|
|
14
|
+
/**
|
|
15
|
+
* 提取的数量
|
|
16
|
+
*/
|
|
17
|
+
count: number;
|
|
18
|
+
/**
|
|
19
|
+
* 排序方向
|
|
20
|
+
*/
|
|
21
|
+
description: 'next';
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
indexValue: number;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
betweenInfo: {
|
|
30
|
+
v1: number;
|
|
31
|
+
v2: number;
|
|
32
|
+
v1isClose: boolean;
|
|
33
|
+
v2isClose: boolean;
|
|
34
|
+
};
|
|
35
|
+
where: (object: any) => boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 分页后返回的对象列表
|
|
39
|
+
*/
|
|
40
|
+
interface IDbPagerDataList<T> {
|
|
41
|
+
/**
|
|
42
|
+
* 记录集
|
|
43
|
+
*/
|
|
44
|
+
dataList: T[];
|
|
45
|
+
/**
|
|
46
|
+
* 复合条件的总数
|
|
47
|
+
*/
|
|
48
|
+
allCount: number;
|
|
49
|
+
}
|
|
50
|
+
type queryT = string | number | boolean | any;
|
|
51
|
+
/**
|
|
52
|
+
* 查询方式的枚举
|
|
53
|
+
*/
|
|
54
|
+
declare const enum EFindKind {
|
|
55
|
+
strEqual = 21,// '{col} = ?'
|
|
56
|
+
strNotEqual = 22,// '{col} <> ?'
|
|
57
|
+
strInclude = 23,// '{col} like "%?%"'
|
|
58
|
+
strNotInclude = 24,// '{col} not like "%?%"'
|
|
59
|
+
strStart = 25,// '{col} like "?%"'
|
|
60
|
+
strEnd = 26,// '{col} like "%?"'
|
|
61
|
+
strNotStart = 27,// '{col} not like "?%"'
|
|
62
|
+
strNotEnd = 28,// '{col} not like "%?"'
|
|
63
|
+
numEqual = 11,// '{col} = ?'
|
|
64
|
+
numNotEqual = 12,// '{col} <> ?'
|
|
65
|
+
numInclude = 13,// '{col} > ?'
|
|
66
|
+
numNotInclude = 14,// '{col} >= ?'
|
|
67
|
+
numStart = 15,// '{col} < ?'
|
|
68
|
+
numEnd = 16,// '{col} <= ?'
|
|
69
|
+
numBetween = 17,// '{col} between ? and ?'
|
|
70
|
+
numBetweenEnd = 18,// '{col} > ? and {col} <= ?'
|
|
71
|
+
numBetweenStart = 19,// '{col} >= ? and {col} < ?'
|
|
72
|
+
rangeInclude = 40,// '( {col} like %?% or {col} like %?% ... ) '
|
|
73
|
+
rangeIn = 41,// '{col} in (?)'
|
|
74
|
+
rangeNotIn = 42
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 查询条件,字段名作为key,后面是数组(元祖)
|
|
78
|
+
*/
|
|
79
|
+
interface DbQuery {
|
|
80
|
+
[colName: idType]: [
|
|
81
|
+
EFindKind,
|
|
82
|
+
queryT | Array<queryT> | [
|
|
83
|
+
queryT,
|
|
84
|
+
queryT
|
|
85
|
+
]
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type obj = {
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
92
|
+
type myStore = {
|
|
93
|
+
[storeName: string]: any;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* indexedDB 的 help,基础功能的封装
|
|
97
|
+
* * 打开数据库,建立对象仓库,获取连接对象,实现增删改查
|
|
98
|
+
* * info 的结构:
|
|
99
|
+
* * * dbFlag: '' // 数据库标识,区别不同的数据库
|
|
100
|
+
* * * dbConfig: { // 连接数据库
|
|
101
|
+
* * * * dbName: '数据库名称',
|
|
102
|
+
* * * * ver: '数据库版本',
|
|
103
|
+
* * * },
|
|
104
|
+
* * * stores: {
|
|
105
|
+
* * * * storeName: { // 对象仓库名称
|
|
106
|
+
* * * * * id: 'id', // 主键名称
|
|
107
|
+
* * * * * autoIncrement?: true, // 主键值要自增
|
|
108
|
+
* * * * * index?: { // 可以不设置索引
|
|
109
|
+
* * * * * * name: ture, // key:索引名称;value:是否唯一
|
|
110
|
+
* * * * * }
|
|
111
|
+
* * * * }
|
|
112
|
+
* * * },
|
|
113
|
+
* * * init: (help) => {} // 完全准备好之后的回调函数
|
|
114
|
+
*/
|
|
115
|
+
declare class IndexedDBHelp {
|
|
116
|
+
myIndexedDB: IDBFactory;
|
|
117
|
+
dbName: string;
|
|
118
|
+
dbVer: number;
|
|
119
|
+
_db: IDBDatabase | undefined;
|
|
120
|
+
_storeState: string;
|
|
121
|
+
_storeInfo: any;
|
|
122
|
+
_regCallback: Array<() => void>;
|
|
123
|
+
_stores: myStore;
|
|
124
|
+
constructor(info: any);
|
|
125
|
+
close(): void;
|
|
126
|
+
beginInit(storeName: string[]): Promise<IDBObjectStore>;
|
|
127
|
+
beginWrite(storeName: string[]): Promise<IDBTransaction>;
|
|
128
|
+
beginReadonly(storeName: string[]): Promise<IDBTransaction>;
|
|
129
|
+
/**
|
|
130
|
+
* 删掉整个库
|
|
131
|
+
*/
|
|
132
|
+
deleteDB(): Promise<any>;
|
|
133
|
+
/**
|
|
134
|
+
* 清空一个对象仓库的全部对象
|
|
135
|
+
* @param storeName 对象仓库名称
|
|
136
|
+
* @param tran 事务,可以为 null
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
clearStore(storeName: string, tran?: IDBTransaction): Promise<0>;
|
|
140
|
+
/**
|
|
141
|
+
* 添加一个对象
|
|
142
|
+
* @param storeName 对象仓库名称
|
|
143
|
+
* @param model 要添加的对象
|
|
144
|
+
* @param tran 事务,可以为 null
|
|
145
|
+
* @returns
|
|
146
|
+
*/
|
|
147
|
+
addModel<T>(storeName: string, model: T, tran?: IDBTransaction): Promise<string | number>;
|
|
148
|
+
/**
|
|
149
|
+
* 修改一个对象
|
|
150
|
+
* @param storeName 对象仓库名称
|
|
151
|
+
* @param model 要修改的对象
|
|
152
|
+
* @param idValue 对象主键的值,如果主键是id,可以传入null
|
|
153
|
+
* @param tran 事务,可以为 null
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
putModel<T extends obj>(storeName: string, model: T, tran?: IDBTransaction): Promise<T>;
|
|
157
|
+
/**
|
|
158
|
+
* 添加或者替换一个对象
|
|
159
|
+
* @param storeName 对象仓库名称
|
|
160
|
+
* @param model 要添加或者修改的对象
|
|
161
|
+
* @param tran 事务,可以为 null
|
|
162
|
+
* @returns
|
|
163
|
+
*/
|
|
164
|
+
setModel<T extends obj>(storeName: string, model: T, tran?: IDBTransaction): Promise<T>;
|
|
165
|
+
/**
|
|
166
|
+
* 删除一个对象
|
|
167
|
+
* @param storeName 对象仓库名称
|
|
168
|
+
* @param idValue id 或者 model 要删除的对象
|
|
169
|
+
* @param tran 事务,可以为 null
|
|
170
|
+
* @returns
|
|
171
|
+
*/
|
|
172
|
+
delModel(storeName: string, idValue: any, tran?: IDBTransaction): Promise<number>;
|
|
173
|
+
/**
|
|
174
|
+
* 获取一个对象,或者仓库的全部对象
|
|
175
|
+
* @param storeName 对象仓库名称
|
|
176
|
+
* @param idValue null:获取仓库的全部对象;其他:对象ID值
|
|
177
|
+
* @param tran 事务,可以为 null
|
|
178
|
+
* @returns
|
|
179
|
+
*/
|
|
180
|
+
getModel<T>(storeName: string, idValue?: IDBValidKey | IDBKeyRange | null, tran?: IDBTransaction): Promise<T | T[]>;
|
|
181
|
+
/**
|
|
182
|
+
* 获取对象仓库里全部对象的数量
|
|
183
|
+
* @param storeName 对象仓库名称
|
|
184
|
+
* @param tran 事务,可以为 null
|
|
185
|
+
* @returns
|
|
186
|
+
*/
|
|
187
|
+
getCount(storeName: string, tran?: IDBTransaction): Promise<number>;
|
|
188
|
+
/**
|
|
189
|
+
* 获取一个仓库的全部对象
|
|
190
|
+
* @param storeName 对象仓库名称
|
|
191
|
+
* @param query 查询条件
|
|
192
|
+
* @param description
|
|
193
|
+
* @param tran 事务,可以为 null
|
|
194
|
+
* @returns
|
|
195
|
+
*/
|
|
196
|
+
getList<T>(storeName: string, query: DbQuery, description?: IDBCursorDirection, tran?: IDBTransaction): Promise<Array<T>>;
|
|
197
|
+
/**
|
|
198
|
+
* 获取一个仓库的全部对象
|
|
199
|
+
* @param storeName 对象仓库名称
|
|
200
|
+
* @param query 查询条件
|
|
201
|
+
* @param pager 分页信息
|
|
202
|
+
* @param tran 事务,可以为 null
|
|
203
|
+
* @returns
|
|
204
|
+
*/
|
|
205
|
+
listPager<T>(storeName: string, query: DbQuery, pager: IDbPager, tran?: IDBTransaction): Promise<IDbPagerDataList<T>>;
|
|
206
|
+
/**
|
|
207
|
+
* 创建对象仓库的增删改查的函数
|
|
208
|
+
* @returns
|
|
209
|
+
*/
|
|
210
|
+
stores(): myStore;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare const useDbStore: pinia.StoreDefinition<"db", Pick<{
|
|
214
|
+
db: IndexedDBHelp;
|
|
215
|
+
getDb: () => IndexedDBHelp;
|
|
216
|
+
}, "db">, Pick<{
|
|
217
|
+
db: IndexedDBHelp;
|
|
218
|
+
getDb: () => IndexedDBHelp;
|
|
219
|
+
}, never>, Pick<{
|
|
220
|
+
db: IndexedDBHelp;
|
|
221
|
+
getDb: () => IndexedDBHelp;
|
|
222
|
+
}, "getDb">>;
|
|
223
|
+
|
|
224
|
+
interface CommonState {
|
|
225
|
+
[key: string]: any;
|
|
226
|
+
curlBaseUrl: string;
|
|
227
|
+
version: string;
|
|
228
|
+
readonly currentEnv: 'development' | 'test' | 'production';
|
|
229
|
+
routeWhitelist: string[];
|
|
230
|
+
websiteTitle: string;
|
|
231
|
+
systemTitle: string;
|
|
232
|
+
updateLog: {
|
|
233
|
+
version: string;
|
|
234
|
+
time: string;
|
|
235
|
+
content: {
|
|
236
|
+
title: string;
|
|
237
|
+
content: string[];
|
|
238
|
+
};
|
|
239
|
+
}[];
|
|
240
|
+
themeColor: string;
|
|
241
|
+
}
|
|
242
|
+
declare const useCommonStore: pinia.StoreDefinition<"common", CommonState, {
|
|
243
|
+
getCurlBaseUrl(): CommonState["curlBaseUrl"];
|
|
244
|
+
getVersion(): CommonState["version"];
|
|
245
|
+
getCurrentEnv(): CommonState["currentEnv"];
|
|
246
|
+
getRouteWhitelist(): CommonState["routeWhitelist"];
|
|
247
|
+
getWebsiteTitle(): CommonState["websiteTitle"];
|
|
248
|
+
getUpdateLog(): CommonState["updateLog"];
|
|
249
|
+
getSystemTitle(): CommonState["systemTitle"];
|
|
250
|
+
getPublicUrl(): string;
|
|
251
|
+
getThemeColor(): CommonState["themeColor"];
|
|
252
|
+
}, {
|
|
253
|
+
/**
|
|
254
|
+
* 加载配置
|
|
255
|
+
*/
|
|
256
|
+
loadConfig(): Promise<void>;
|
|
257
|
+
/**
|
|
258
|
+
* 加载更新日志
|
|
259
|
+
*/
|
|
260
|
+
loadUpdateLog(): Promise<void>;
|
|
261
|
+
/**
|
|
262
|
+
* 判断当前环境
|
|
263
|
+
* @returns {{isDev: () => boolean, isTest: () => boolean, isProd: () => boolean}}
|
|
264
|
+
*/
|
|
265
|
+
isCurrentEnv(): {
|
|
266
|
+
isDev: () => boolean;
|
|
267
|
+
isTest: () => boolean;
|
|
268
|
+
isProd: () => boolean;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* 设置主题色
|
|
272
|
+
*/
|
|
273
|
+
changeThemeColor(color: string): void;
|
|
274
|
+
}>;
|
|
275
|
+
|
|
276
|
+
interface MenuState {
|
|
277
|
+
collapsed: boolean;
|
|
278
|
+
accordionEffect: boolean;
|
|
279
|
+
menuList: MenuItem[];
|
|
280
|
+
hasGetMenuList: boolean;
|
|
281
|
+
}
|
|
282
|
+
declare const useMenuStore: pinia.StoreDefinition<"menu", MenuState, {
|
|
283
|
+
getMenuList(): MenuItem[];
|
|
284
|
+
getHasGetMenuList(): boolean;
|
|
285
|
+
}, {
|
|
286
|
+
toggleCollapsed(collapsed?: MenuState["collapsed"]): void;
|
|
287
|
+
queryMenuList(router: Router, pages: any): Promise<void>;
|
|
288
|
+
}>;
|
|
289
|
+
|
|
290
|
+
declare function store(app: App, option?: {
|
|
291
|
+
prefix?: string;
|
|
292
|
+
}): void;
|
|
293
|
+
|
|
294
|
+
export { type MenuState, store, useCommonStore, useDbStore, useMenuStore };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkQQPGJGSUjs = require('../chunk-QQPGJGSU.js');
|
|
7
|
+
require('../chunk-QGM4M3NI.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.store = _chunkQQPGJGSUjs.store; exports.useCommonStore = _chunkQQPGJGSUjs.useCommonStore; exports.useDbStore = _chunkQQPGJGSUjs.useDbStore; exports.useMenuStore = _chunkQQPGJGSUjs.useMenuStore;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* src/styles/index.css */
|
|
2
|
+
html,
|
|
3
|
+
body {
|
|
4
|
+
height: 100%;
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
min-width: 100px;
|
|
9
|
+
min-height: 100%;
|
|
10
|
+
font-family:
|
|
11
|
+
"Roboto",
|
|
12
|
+
"-apple-system",
|
|
13
|
+
"Helvetica Neue",
|
|
14
|
+
Helvetica,
|
|
15
|
+
Arial,
|
|
16
|
+
sans-serif;
|
|
17
|
+
-ms-text-size-adjust: 100%;
|
|
18
|
+
-webkit-text-size-adjust: 100%;
|
|
19
|
+
-webkit-font-smoothing: antialiased;
|
|
20
|
+
-moz-osx-font-smoothing: grayscale;
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
*,
|
|
27
|
+
*:before,
|
|
28
|
+
*:after {
|
|
29
|
+
box-sizing: inherit;
|
|
30
|
+
-webkit-tap-highlight-color: transparent;
|
|
31
|
+
}
|
|
32
|
+
:root {
|
|
33
|
+
--el-color-primary: var(--eb-color-primary) !important;
|
|
34
|
+
--el-color-primary-light-1: var(--eb-color-primary-light-1) !important;
|
|
35
|
+
--el-color-primary-light-2: var(--eb-color-primary-light-2) !important;
|
|
36
|
+
--el-color-primary-light-3: var(--eb-color-primary-light-3) !important;
|
|
37
|
+
--el-color-primary-light-4: var(--eb-color-primary-light-4) !important;
|
|
38
|
+
--el-color-primary-light-5: var(--eb-color-primary-light-5) !important;
|
|
39
|
+
--el-color-primary-light-6: var(--eb-color-primary-light-6) !important;
|
|
40
|
+
--el-color-primary-light-7: var(--eb-color-primary-light-7) !important;
|
|
41
|
+
--el-color-primary-light-8: var(--eb-color-primary-light-8) !important;
|
|
42
|
+
--el-color-primary-light-9: var(--eb-color-primary-light-9) !important;
|
|
43
|
+
--el-color-primary-dark-1: var(--eb-color-primary-dark-1) !important;
|
|
44
|
+
--el-color-primary-dark-2: var(--eb-color-primary-dark-2) !important;
|
|
45
|
+
--el-color-primary-dark-3: var(--eb-color-primary-dark-3) !important;
|
|
46
|
+
--el-color-primary-dark-4: var(--eb-color-primary-dark-4) !important;
|
|
47
|
+
--el-color-primary-dark-5: var(--eb-color-primary-dark-5) !important;
|
|
48
|
+
--el-color-primary-dark-6: var(--eb-color-primary-dark-6) !important;
|
|
49
|
+
--el-color-primary-dark-7: var(--eb-color-primary-dark-7) !important;
|
|
50
|
+
--el-color-primary-dark-8: var(--eb-color-primary-dark-8) !important;
|
|
51
|
+
--el-color-primary-dark-9: var(--eb-color-primary-dark-9) !important;
|
|
52
|
+
}
|
|
53
|
+
.hover-unline::after {
|
|
54
|
+
content: "";
|
|
55
|
+
position: absolute;
|
|
56
|
+
left: 50%;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
display: block;
|
|
59
|
+
width: 0%;
|
|
60
|
+
height: 0.005208rem;
|
|
61
|
+
transition: all 0.3s ease-in-out;
|
|
62
|
+
background-color: currentColor;
|
|
63
|
+
transform: translateX(-50%);
|
|
64
|
+
}
|
|
65
|
+
.hover-unline:hover {
|
|
66
|
+
&::after {
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkMXO66M74js = require('../chunk-MXO66M74.js');
|
|
5
|
+
require('../chunk-QGM4M3NI.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.createUnoConfig = _chunkMXO66M74js.createUnoConfig; exports.default = _chunkMXO66M74js.uno_config_default;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
export { AxiosResponse } from 'axios';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
export { M as MenuItem, f as filterMenu, u as updateDocumentTitle } from '../index-CVmrbYyU.mjs';
|
|
5
|
+
import { Router } from 'vue-router';
|
|
6
|
+
|
|
7
|
+
interface curlParams {
|
|
8
|
+
url: string;
|
|
9
|
+
method?: AxiosRequestConfig['method'];
|
|
10
|
+
headers?: AxiosRequestConfig['headers'];
|
|
11
|
+
query?: AxiosRequestConfig['params'];
|
|
12
|
+
data?: AxiosRequestConfig['data'];
|
|
13
|
+
responseType?: AxiosRequestConfig['responseType'];
|
|
14
|
+
timeout?: AxiosRequestConfig['timeout'];
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
showErrorMessage?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const request: <T = any>(params: curlParams, token: string, serverBaseUrl?: string) => Promise<AxiosResponse<T>>;
|
|
20
|
+
|
|
21
|
+
interface FormState {
|
|
22
|
+
username: string;
|
|
23
|
+
password: string;
|
|
24
|
+
captcha: string;
|
|
25
|
+
checkKey: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 登录页面方法
|
|
29
|
+
* @param curl 请求方法
|
|
30
|
+
* @param params 请求参数
|
|
31
|
+
*/
|
|
32
|
+
declare const useLoginHook: (curl: Function, params: {
|
|
33
|
+
queryCodeUrl: string;
|
|
34
|
+
}) => {
|
|
35
|
+
codeLoading: Ref<boolean>;
|
|
36
|
+
randCodeImage: Ref<string>;
|
|
37
|
+
submitLoading: Ref<boolean>;
|
|
38
|
+
formState: FormState;
|
|
39
|
+
rules: Record<string, any[]>;
|
|
40
|
+
handleChangeCheckCode: () => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 路由权限
|
|
45
|
+
* @param router
|
|
46
|
+
* @param useMenuStore
|
|
47
|
+
*/
|
|
48
|
+
declare function setupPermission(router: Router, useMenuStore: any, pages: any, useUserStore: any): void;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 清单排序函数,支持按指定字段进行自然排序
|
|
52
|
+
* @param arr 需要排序的数组
|
|
53
|
+
* @param key 排序依据的字段名,默认为'no'
|
|
54
|
+
* @param callback 排序前对每个元素执行的回调函数
|
|
55
|
+
* @returns 排序后的数组
|
|
56
|
+
*/
|
|
57
|
+
declare function listSort<T extends Record<string, any>>(arr: T[], key?: string, callback?: (item: T) => void): T[];
|
|
58
|
+
/**
|
|
59
|
+
* 月份去重、补齐、排序
|
|
60
|
+
* @param months - 包含月份信息的数组,每个元素应包含key属性,格式为'YYYY-MM'
|
|
61
|
+
* @returns 返回一个完整的、排序后的月份数组,每个元素包含key、label和align属性
|
|
62
|
+
*/
|
|
63
|
+
declare function duplicateRemovalCompleteSort(months: Array<{
|
|
64
|
+
key: string;
|
|
65
|
+
}>): Array<{
|
|
66
|
+
key: string;
|
|
67
|
+
label: string;
|
|
68
|
+
align: string;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 截断或四舍五入数字到指定小数位数
|
|
73
|
+
* @param num 要处理的数字
|
|
74
|
+
* @param fixed 保留的小数位数,默认为2位
|
|
75
|
+
* @param round 是否四舍五入,默认为false(截断)
|
|
76
|
+
* @returns 处理后的数字
|
|
77
|
+
*/
|
|
78
|
+
declare const roundOrTruncate: (num: number, fixed?: number, round?: boolean) => number;
|
|
79
|
+
/**
|
|
80
|
+
* 格式化数字为千分位格式
|
|
81
|
+
* @param num 要格式化的数字
|
|
82
|
+
* @param fixed 保留的小数位数,默认为2位
|
|
83
|
+
* @returns 格式化后的字符串
|
|
84
|
+
*/
|
|
85
|
+
declare const formatNumber: (num: number, fixed?: number) => string;
|
|
86
|
+
/**
|
|
87
|
+
* 将千分位格式的字符串转换为数字
|
|
88
|
+
* @param str 千分位格式的字符串
|
|
89
|
+
* @returns 转换后的数字
|
|
90
|
+
*/
|
|
91
|
+
declare const parseFormattedNumber: (str: string) => number;
|
|
92
|
+
/**
|
|
93
|
+
* 数字补零
|
|
94
|
+
* @param num 要补零的数字
|
|
95
|
+
* @param width 总宽度
|
|
96
|
+
* @returns 补零后的字符串
|
|
97
|
+
*/
|
|
98
|
+
declare const padZero: (num: number, width: number) => string;
|
|
99
|
+
/**
|
|
100
|
+
* 获取数字的整数部分
|
|
101
|
+
* @param num 数字
|
|
102
|
+
* @returns 整数部分
|
|
103
|
+
*/
|
|
104
|
+
declare const getIntegerPart: (num: number) => number;
|
|
105
|
+
/**
|
|
106
|
+
* 获取数字的小数部分
|
|
107
|
+
* @param num 数字
|
|
108
|
+
* @returns 小数部分
|
|
109
|
+
*/
|
|
110
|
+
declare const getDecimalPart: (num: number) => number;
|
|
111
|
+
/**
|
|
112
|
+
* 数字转中文大写
|
|
113
|
+
* @param num 要转换的数字
|
|
114
|
+
* @returns 中文大写字符串
|
|
115
|
+
*/
|
|
116
|
+
declare const numberToChinese: (num: number) => string;
|
|
117
|
+
/**
|
|
118
|
+
* 限制数字在指定范围内
|
|
119
|
+
* @param num 要限制的数字
|
|
120
|
+
* @param min 最小值
|
|
121
|
+
* @param max 最大值
|
|
122
|
+
* @returns 限制后的数字
|
|
123
|
+
*/
|
|
124
|
+
declare const clamp: (num: number, min: number, max: number) => number;
|
|
125
|
+
/**
|
|
126
|
+
* 判断是否为整数
|
|
127
|
+
* @param num 要判断的数字
|
|
128
|
+
* @returns 是否为整数
|
|
129
|
+
*/
|
|
130
|
+
declare const isInteger: (num: number) => boolean;
|
|
131
|
+
/**
|
|
132
|
+
* 判断是否为有效数字
|
|
133
|
+
* @param num 要判断的值
|
|
134
|
+
* @returns 是否为有效数字
|
|
135
|
+
*/
|
|
136
|
+
declare const isNumber: (num: unknown) => boolean;
|
|
137
|
+
|
|
138
|
+
declare const prototypeInterceptor: {
|
|
139
|
+
install(): void;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare function timeFix(): "早上好" | "上午好" | "中午好" | "下午好" | "晚上好";
|
|
143
|
+
declare function welcome(): string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 对密码加密处理
|
|
147
|
+
* @param pwd 密码
|
|
148
|
+
* @returns 加密后的密码
|
|
149
|
+
*/
|
|
150
|
+
declare function encryptPwd(pwd: string): string | false;
|
|
151
|
+
|
|
152
|
+
declare const jsonp: <T = any>(url: string, params?: Record<string, any>, options?: {
|
|
153
|
+
callbackParam?: string;
|
|
154
|
+
timeout?: number;
|
|
155
|
+
}) => Promise<T>;
|
|
156
|
+
|
|
157
|
+
export { type FormState, clamp, type curlParams, duplicateRemovalCompleteSort, encryptPwd, formatNumber, getDecimalPart, getIntegerPart, isInteger, isNumber, jsonp, listSort, numberToChinese, padZero, parseFormattedNumber, prototypeInterceptor, request, roundOrTruncate, setupPermission, timeFix, useLoginHook, welcome };
|