@cloudbase/cals 0.5.13-alpha.0 → 0.5.13-alpha.10
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.
|
@@ -21,21 +21,28 @@ exports.wedaDTS = `declare class UserWidget {
|
|
|
21
21
|
// ========== 快捷访问方式 ========== //
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* 组件
|
|
24
|
+
* 组件 ID,微搭中一般由编辑器生成
|
|
25
25
|
*/
|
|
26
26
|
readonly id: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* 组件库名
|
|
29
29
|
*/
|
|
30
30
|
readonly module: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 组件名
|
|
33
33
|
*/
|
|
34
34
|
readonly component: string;
|
|
35
|
-
// FIXME: 暂时不对外暴露
|
|
36
|
-
// readonly parent: UserWidget;
|
|
37
|
-
// readonly children: UserWidget[];
|
|
38
35
|
|
|
36
|
+
/**
|
|
37
|
+
* 父组件引用
|
|
38
|
+
*/
|
|
39
|
+
readonly parent: UserWidget;
|
|
40
|
+
/**
|
|
41
|
+
* 子组件集合
|
|
42
|
+
*/
|
|
43
|
+
readonly children: UserWidget[];
|
|
44
|
+
|
|
45
|
+
// FIXME: 暂时不对外暴露
|
|
39
46
|
// closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;
|
|
40
47
|
}
|
|
41
48
|
|
|
@@ -43,8 +50,19 @@ exports.wedaDTS = `declare class UserWidget {
|
|
|
43
50
|
// Used Components - Don't touch me
|
|
44
51
|
// Used Components Inner End
|
|
45
52
|
|
|
53
|
+
// Redefine Any Type Inner Begin
|
|
54
|
+
// Redefine Any Type - Don't touch me
|
|
55
|
+
// Redefine Any Type Inner End
|
|
56
|
+
|
|
46
57
|
declare namespace $app {
|
|
47
|
-
|
|
58
|
+
/**
|
|
59
|
+
* 全局数据对象
|
|
60
|
+
*/
|
|
61
|
+
namespace dataset {
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 全局变量对象
|
|
65
|
+
*/
|
|
48
66
|
const state: {
|
|
49
67
|
// Global State Inner Begin
|
|
50
68
|
// Global State 全局变量 - Don't touch me
|
|
@@ -52,12 +70,18 @@ declare namespace $app {
|
|
|
52
70
|
};
|
|
53
71
|
}
|
|
54
72
|
|
|
73
|
+
/**
|
|
74
|
+
* 全局 common 方法
|
|
75
|
+
*/
|
|
55
76
|
namespace common {
|
|
56
77
|
// Global Common Inner Begin
|
|
57
78
|
// Global Common 全局方法 - Don't touch me
|
|
58
79
|
// Global Common Inner End
|
|
59
80
|
}
|
|
60
81
|
|
|
82
|
+
/**
|
|
83
|
+
* 设置页面变量
|
|
84
|
+
*/
|
|
61
85
|
function setState(data: Object): void;
|
|
62
86
|
|
|
63
87
|
}
|
|
@@ -65,73 +89,267 @@ function setState(data: Object): void;
|
|
|
65
89
|
declare const app = $app;
|
|
66
90
|
|
|
67
91
|
declare namespace $w {
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 当前应用实例
|
|
95
|
+
*/
|
|
68
96
|
const app = $app;
|
|
69
97
|
|
|
98
|
+
/**
|
|
99
|
+
* 当前页面实例
|
|
100
|
+
*/
|
|
70
101
|
const page = $page;
|
|
71
102
|
|
|
103
|
+
/**
|
|
104
|
+
* 用户权限相关方法和属性
|
|
105
|
+
*/
|
|
72
106
|
namespace auth {
|
|
73
|
-
|
|
107
|
+
|
|
108
|
+
interface CurrentUserInfo {
|
|
109
|
+
/**
|
|
110
|
+
* 用户 ID
|
|
111
|
+
*
|
|
112
|
+
* @privateForWeDa
|
|
113
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "用户 ID"}
|
|
114
|
+
*/
|
|
74
115
|
userId?: string;
|
|
116
|
+
/**
|
|
117
|
+
* 手机
|
|
118
|
+
*
|
|
119
|
+
* @privateForWeDa
|
|
120
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "手机"}
|
|
121
|
+
*/
|
|
75
122
|
phone?: string;
|
|
123
|
+
/**
|
|
124
|
+
* 用户类型
|
|
125
|
+
*
|
|
126
|
+
* @privateForWeDa
|
|
127
|
+
* {"group": "globalVar", "displayType": "number", "displayName": "用户类型"}
|
|
128
|
+
*/
|
|
76
129
|
type?: number;
|
|
130
|
+
/**
|
|
131
|
+
* 用户关联角色
|
|
132
|
+
*
|
|
133
|
+
* @privateForWeDa
|
|
134
|
+
* {"group": "globalVar", "displayType": "array", "displayName": "用户关联角色"}
|
|
135
|
+
*/
|
|
77
136
|
relatedRoles?: {
|
|
137
|
+
/**
|
|
138
|
+
* 角色 ID
|
|
139
|
+
*
|
|
140
|
+
* @privateForWeDa
|
|
141
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "角色 ID"}
|
|
142
|
+
*/
|
|
78
143
|
id?: string;
|
|
144
|
+
/**
|
|
145
|
+
* 环境 ID
|
|
146
|
+
*
|
|
147
|
+
* @privateForWeDa
|
|
148
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "环境 ID"}
|
|
149
|
+
*/
|
|
79
150
|
envId?: string;
|
|
151
|
+
/**
|
|
152
|
+
* 角色名称
|
|
153
|
+
*
|
|
154
|
+
* @privateForWeDa
|
|
155
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "角色名称"}
|
|
156
|
+
*/
|
|
80
157
|
name?: string;
|
|
158
|
+
/**
|
|
159
|
+
* 角色标识
|
|
160
|
+
*
|
|
161
|
+
* @privateForWeDa
|
|
162
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "角色标识"}
|
|
163
|
+
*/
|
|
81
164
|
roleIdentity?: string;
|
|
82
165
|
}[];
|
|
166
|
+
/**
|
|
167
|
+
* 微信/企微 openId
|
|
168
|
+
*
|
|
169
|
+
* @privateForWeDa
|
|
170
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "微信/企微 openId"}
|
|
171
|
+
*/
|
|
83
172
|
openId?: string;
|
|
173
|
+
/**
|
|
174
|
+
* 用户名称
|
|
175
|
+
*
|
|
176
|
+
* @privateForWeDa
|
|
177
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "用户名称"}
|
|
178
|
+
*/
|
|
84
179
|
name?: string;
|
|
180
|
+
/**
|
|
181
|
+
* 用户昵称
|
|
182
|
+
*
|
|
183
|
+
* @privateForWeDa
|
|
184
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "用户昵称"}
|
|
185
|
+
*/
|
|
85
186
|
nickName?: string;
|
|
187
|
+
/**
|
|
188
|
+
* 邮箱
|
|
189
|
+
*
|
|
190
|
+
* @privateForWeDa
|
|
191
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "邮箱"}
|
|
192
|
+
*/
|
|
86
193
|
email?: string;
|
|
194
|
+
/**
|
|
195
|
+
* 主岗部门
|
|
196
|
+
*
|
|
197
|
+
* @privateForWeDa
|
|
198
|
+
* {"group": "globalVar", "displayType": "object", "displayName": "主岗部门"}
|
|
199
|
+
*/
|
|
87
200
|
mainOrg?: {
|
|
201
|
+
/**
|
|
202
|
+
* 主岗部门 ID
|
|
203
|
+
*
|
|
204
|
+
* @privateForWeDa
|
|
205
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "主岗部门 ID"}
|
|
206
|
+
*/
|
|
88
207
|
id?: string;
|
|
208
|
+
/**
|
|
209
|
+
* 主岗部门名称
|
|
210
|
+
*
|
|
211
|
+
* @privateForWeDa
|
|
212
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "主岗部门名称"}
|
|
213
|
+
*/
|
|
89
214
|
name?: string;
|
|
90
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* 兼岗部门
|
|
218
|
+
*
|
|
219
|
+
* @privateForWeDa
|
|
220
|
+
* {"group": "globalVar", "displayType": "object", "displayName": "兼岗部门"}
|
|
221
|
+
*/
|
|
91
222
|
orgs?: {
|
|
223
|
+
/**
|
|
224
|
+
* 兼岗部门 ID
|
|
225
|
+
*
|
|
226
|
+
* @privateForWeDa
|
|
227
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "兼岗部门 ID"}
|
|
228
|
+
*/
|
|
92
229
|
id?: string;
|
|
230
|
+
/**
|
|
231
|
+
* 兼岗部门名称
|
|
232
|
+
*
|
|
233
|
+
* @privateForWeDa
|
|
234
|
+
* {"group": "globalVar", "displayType": "string", "displayName": "兼岗部门名称"}
|
|
235
|
+
*/
|
|
93
236
|
name?: string;
|
|
94
237
|
}[];
|
|
95
238
|
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* 获取用户信息
|
|
242
|
+
*/
|
|
96
243
|
function getUserInfo(): CurrentUserInfo;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* 登录用户信息
|
|
248
|
+
*
|
|
249
|
+
* @privateForWeDa
|
|
250
|
+
* {"group": "globalVar", "displayType": "object", "displayName": "登录用户信息", "schema": {"type":"object","properties":{"userId":{"type":"string","title":"用户 ID"},"phone":{"type":"string","title":"手机"},"type":{"type":"number","title":"用户类型"},"relatedRoles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","title":"角色 ID"},"envId":{"type":"string","title":"环境 ID"},"name":{"type":"string","title":"角色名称"},"roleIdentity":{"type":"string","title":"角色标识"}}},"title":"用户关联角色"},"openId":{"type":"string","title":"微信/企微 openId"},"name":{"type":"string","title":"用户名称"},"nickName":{"type":"string","title":"用户昵称"},"email":{"type":"string","title":"邮箱"},"mainOrg":{"type":"object","properties":{"id":{"type":"string","title":"主岗部门 ID"},"name":{"type":"string","title":"主岗部门名称"}},"title":"主岗部门"},"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","title":"兼岗部门 ID"},"name":{"type":"string","title":"兼岗部门名称"}}},"title":"兼岗部门"}}}}
|
|
251
|
+
*/
|
|
97
252
|
const currentUser: CurrentUserInfo;
|
|
98
253
|
|
|
99
254
|
}
|
|
100
255
|
|
|
256
|
+
/**
|
|
257
|
+
* 数据源等云端能力集合
|
|
258
|
+
*/
|
|
101
259
|
namespace cloud {
|
|
102
260
|
interface ICallDataSourceParams {
|
|
261
|
+
/**
|
|
262
|
+
* 数据源标志
|
|
263
|
+
*/
|
|
103
264
|
dataSourceName: string;
|
|
265
|
+
/**
|
|
266
|
+
* 数据源方法名
|
|
267
|
+
*/
|
|
104
268
|
methodName: string;
|
|
269
|
+
/**
|
|
270
|
+
* 方法参数,根据方法实际入参填写
|
|
271
|
+
*/
|
|
105
272
|
params: Object;
|
|
106
273
|
}
|
|
107
274
|
interface ICallFunctionParams {
|
|
275
|
+
/**
|
|
276
|
+
* TCB云函数名称
|
|
277
|
+
*/
|
|
108
278
|
name: string;
|
|
279
|
+
/**
|
|
280
|
+
* 云函数接收的参数,根据自己创建的云函数入参而定
|
|
281
|
+
*/
|
|
109
282
|
data?: any;
|
|
110
283
|
}
|
|
111
284
|
interface IParseOptions {
|
|
285
|
+
/**
|
|
286
|
+
* 解析 云开发云函数的通用response 包装。为true, 则返回 res.result, 此时会丢失 res.requestId 信息
|
|
287
|
+
*/
|
|
112
288
|
unwrapResult?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* 解析业务信息,需配合 unwrapResult 使用。为 true 时, res.result.code 非 0 抛出错误, 为 0 则返回 res.result.data
|
|
291
|
+
*/
|
|
113
292
|
parseBusinessInfo?: boolean;
|
|
114
293
|
}
|
|
115
294
|
interface ICallWorkflowParams {
|
|
295
|
+
/**
|
|
296
|
+
* 方法名称
|
|
297
|
+
*/
|
|
116
298
|
action: string;
|
|
299
|
+
/**
|
|
300
|
+
* 方法的自定义参数,其中 envType, envId, uid, source 均无需填写
|
|
301
|
+
*/
|
|
117
302
|
data?: Record<string, any>;
|
|
303
|
+
/**
|
|
304
|
+
* 是否自动将 data 的key 改为大写驼峰。默认为 true, 即使用时 data 可以采用小驼峰的 key
|
|
305
|
+
*/
|
|
118
306
|
capitalizeDataKey?: boolean;
|
|
119
307
|
}
|
|
120
308
|
|
|
309
|
+
/**
|
|
310
|
+
* 调用数据源
|
|
311
|
+
*/
|
|
121
312
|
function callDataSource(params: ICallDataSourceParams): any;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* 通过 cloudid 获取静态文件的 http 访问地址
|
|
316
|
+
*/
|
|
122
317
|
function getTempFileURL(params: string | string[]): Promise<string | string[]>;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* 调用流程
|
|
321
|
+
*/
|
|
123
322
|
function callWorkflow(action: ICallWorkflowParams): Promise<any>;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* 调用云开发的云函数, 与 $w.cloud.getCloudInstance 示例中的效果大体一致
|
|
326
|
+
*/
|
|
124
327
|
function callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* 返回云开发web-sdk初始化后的实例(无需关心tcb环境信息及认证登录的处理), 即 tcb.init 后返回的对象, 可用该对象直接调用tcb的各种能力
|
|
331
|
+
*/
|
|
125
332
|
function getCloudInstance(): Promise<CloudInstance>;
|
|
126
333
|
|
|
127
334
|
}
|
|
128
335
|
|
|
129
|
-
|
|
336
|
+
/**
|
|
337
|
+
* 平台工具方法集合
|
|
338
|
+
*/
|
|
130
339
|
namespace utils {
|
|
131
340
|
interface navigatorOptions {
|
|
341
|
+
/**
|
|
342
|
+
* 子应用包地址,例如 packages/subapp
|
|
343
|
+
*/
|
|
132
344
|
packageName: string;
|
|
345
|
+
/**
|
|
346
|
+
* 页面 ID
|
|
347
|
+
*/
|
|
133
348
|
pageId: string;
|
|
134
349
|
data?: Record<string, any>;
|
|
350
|
+
/**
|
|
351
|
+
* query object 对象
|
|
352
|
+
*/
|
|
135
353
|
params?: Record<string, any>;
|
|
136
354
|
events?: Record<string, (data: any) => void>;
|
|
137
355
|
success(res: any);
|
|
@@ -140,43 +358,87 @@ function getCloudInstance(): Promise<CloudInstance>;
|
|
|
140
358
|
}
|
|
141
359
|
|
|
142
360
|
interface navigateBackOptions {
|
|
361
|
+
/**
|
|
362
|
+
* 返回的页面数,如果 delta 大于现有页面数,则返回到首页。
|
|
363
|
+
*/
|
|
143
364
|
delta: number;
|
|
144
365
|
}
|
|
145
366
|
|
|
146
|
-
|
|
367
|
+
/**
|
|
368
|
+
* 显示提示框
|
|
369
|
+
*/
|
|
147
370
|
function showToast(options);
|
|
148
371
|
|
|
149
|
-
|
|
372
|
+
/**
|
|
373
|
+
* 显示全局加载中提示
|
|
374
|
+
*/
|
|
150
375
|
function showLoading(options);
|
|
151
376
|
|
|
152
|
-
|
|
377
|
+
/**
|
|
378
|
+
* 隐藏全局加载中提示
|
|
379
|
+
*/
|
|
153
380
|
function hideLoading(options);
|
|
154
381
|
|
|
155
|
-
|
|
382
|
+
/**
|
|
383
|
+
* 显示模态弹框
|
|
384
|
+
*/
|
|
156
385
|
function showModal(options);
|
|
157
386
|
|
|
158
|
-
|
|
387
|
+
/**
|
|
388
|
+
* 拨打电话
|
|
389
|
+
*/
|
|
159
390
|
function callPhone(options);
|
|
160
391
|
|
|
161
|
-
|
|
392
|
+
/**
|
|
393
|
+
* 扫描二维码
|
|
394
|
+
*/
|
|
162
395
|
function scanCode(options: {
|
|
396
|
+
/**
|
|
397
|
+
* 是否只能从相机扫码,不允许从相册选择图片
|
|
398
|
+
*/
|
|
163
399
|
onlyFromCamera?: boolean;
|
|
164
400
|
enableDefaultBehavior?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* 扫码类型
|
|
403
|
+
*/
|
|
165
404
|
scanType?: ('barCode' | 'qrCode')[];
|
|
405
|
+
/**
|
|
406
|
+
* 接口调用成功的回调函数
|
|
407
|
+
*/
|
|
166
408
|
success?: (res: { result: string; scanType: string }) => void;
|
|
409
|
+
/**
|
|
410
|
+
* 接口调用失败的回调函数
|
|
411
|
+
*/
|
|
167
412
|
fail?: (err: Error) => void;
|
|
413
|
+
/**
|
|
414
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
415
|
+
*/
|
|
168
416
|
complete?: () => void;
|
|
169
417
|
}): Promise<ScanCodeResult> | ScanCodeResult;
|
|
170
418
|
|
|
171
|
-
|
|
419
|
+
/**
|
|
420
|
+
* 跳转到应用某个页面
|
|
421
|
+
*/
|
|
172
422
|
function navigateTo(options: navigatorOptions);
|
|
173
423
|
|
|
424
|
+
/**
|
|
425
|
+
* 关闭当前页面,跳转到应用内的某个页面
|
|
426
|
+
*/
|
|
174
427
|
function redirectTo(options: navigatorOptions);
|
|
175
428
|
|
|
429
|
+
/**
|
|
430
|
+
* 关闭所有页面,打开到应用内的某个页面
|
|
431
|
+
*/
|
|
176
432
|
function reLaunch(options: navigatorOptions);
|
|
177
433
|
|
|
434
|
+
/**
|
|
435
|
+
* 返回首页
|
|
436
|
+
*/
|
|
178
437
|
function relaunchHome();
|
|
179
438
|
|
|
439
|
+
/**
|
|
440
|
+
* 关闭当前页面,返回上一页面或多级页面
|
|
441
|
+
*/
|
|
180
442
|
function navigateBack(options: navigateBackOptions);
|
|
181
443
|
|
|
182
444
|
}
|
|
@@ -186,6 +448,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
186
448
|
*
|
|
187
449
|
* @remarks
|
|
188
450
|
* 计算传入数字的绝对值
|
|
451
|
+
*
|
|
452
|
+
* @privateForWeDa
|
|
453
|
+
* {"group": "formula", "displayType": "function", "displayName": "绝对值", "insertText": "ABS(1)", "subGroup": "calculation"}
|
|
189
454
|
*/
|
|
190
455
|
function ABS(num: number): number;
|
|
191
456
|
/**
|
|
@@ -193,6 +458,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
193
458
|
*
|
|
194
459
|
* @remarks
|
|
195
460
|
* 返回一组数字中的最小值
|
|
461
|
+
*
|
|
462
|
+
* @privateForWeDa
|
|
463
|
+
* {"group": "formula", "displayType": "function", "displayName": "最小值", "insertText": "Min(1, 2)", "subGroup": "calculation"}
|
|
196
464
|
*/
|
|
197
465
|
function Min(...args: number[]): number;
|
|
198
466
|
/**
|
|
@@ -200,6 +468,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
200
468
|
*
|
|
201
469
|
* @remarks
|
|
202
470
|
* 返回一组数字中的最大值
|
|
471
|
+
*
|
|
472
|
+
* @privateForWeDa
|
|
473
|
+
* {"group": "formula", "displayType": "function", "displayName": "最大值", "insertText": "Max(1, 2)", "subGroup": "calculation"}
|
|
203
474
|
*/
|
|
204
475
|
function Max(...args: number[]): number;
|
|
205
476
|
/**
|
|
@@ -207,6 +478,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
207
478
|
*
|
|
208
479
|
* @remarks
|
|
209
480
|
* 返回一组数字中的平均值
|
|
481
|
+
*
|
|
482
|
+
* @privateForWeDa
|
|
483
|
+
* {"group": "formula", "displayType": "function", "displayName": "平均值", "insertText": "Average(1, 2)", "subGroup": "calculation"}
|
|
210
484
|
*/
|
|
211
485
|
function Average(...args: number[]): number;
|
|
212
486
|
/**
|
|
@@ -214,6 +488,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
214
488
|
*
|
|
215
489
|
* @remarks
|
|
216
490
|
* 返回传入数字向下取整的结果
|
|
491
|
+
*
|
|
492
|
+
* @privateForWeDa
|
|
493
|
+
* {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation"}
|
|
217
494
|
*/
|
|
218
495
|
function Floor(num: number): number;
|
|
219
496
|
/**
|
|
@@ -221,6 +498,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
221
498
|
*
|
|
222
499
|
* @remarks
|
|
223
500
|
* 返回传入数字向上取整的结果
|
|
501
|
+
*
|
|
502
|
+
* @privateForWeDa
|
|
503
|
+
* {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation"}
|
|
224
504
|
*/
|
|
225
505
|
function Ceiling(num: number): number;
|
|
226
506
|
/**
|
|
@@ -228,6 +508,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
228
508
|
*
|
|
229
509
|
* @remarks
|
|
230
510
|
* 返回传入数字四舍五入后的结果
|
|
511
|
+
*
|
|
512
|
+
* @privateForWeDa
|
|
513
|
+
* {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation"}
|
|
231
514
|
*/
|
|
232
515
|
function Round(num: number): number;
|
|
233
516
|
/**
|
|
@@ -235,6 +518,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
235
518
|
*
|
|
236
519
|
* @remarks
|
|
237
520
|
* 返回一组数字中的和
|
|
521
|
+
*
|
|
522
|
+
* @privateForWeDa
|
|
523
|
+
* {"group": "formula", "displayType": "function", "displayName": "求和", "insertText": "Sum(1, 2)", "subGroup": "calculation"}
|
|
238
524
|
*/
|
|
239
525
|
function Sum(...args: number[]): number;
|
|
240
526
|
/**
|
|
@@ -242,6 +528,9 @@ function navigateBack(options: navigateBackOptions);
|
|
|
242
528
|
*
|
|
243
529
|
* @remarks
|
|
244
530
|
* 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
|
|
531
|
+
*
|
|
532
|
+
* @privateForWeDa
|
|
533
|
+
* {"group": "formula", "displayType": "function", "displayName": "随机数", "insertText": "Rand(1)", "subGroup": "calculation"}
|
|
245
534
|
*/
|
|
246
535
|
function Rand(num: number): number;
|
|
247
536
|
|
|
@@ -255,6 +544,9 @@ alternate?: any;
|
|
|
255
544
|
*
|
|
256
545
|
* @remarks
|
|
257
546
|
* 按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。
|
|
547
|
+
*
|
|
548
|
+
* @privateForWeDa
|
|
549
|
+
* {"group": "formula", "displayType": "function", "displayName": "条件分支", "insertText": "If(true, '您好', 'hello')", "subGroup": "logic"}
|
|
258
550
|
*/
|
|
259
551
|
function If(data: IIfObjectParam): any;
|
|
260
552
|
function If(condition: boolean, consequent?: any, alternate?: any): any;
|
|
@@ -263,6 +555,9 @@ alternate?: any;
|
|
|
263
555
|
*
|
|
264
556
|
* @remarks
|
|
265
557
|
* 判断传入的文本是否为空
|
|
558
|
+
*
|
|
559
|
+
* @privateForWeDa
|
|
560
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为空", "insertText": "IsEmpty('hello')", "subGroup": "logic"}
|
|
266
561
|
*/
|
|
267
562
|
function IsEmpty(text: string | string[]): boolean;
|
|
268
563
|
/**
|
|
@@ -270,6 +565,9 @@ alternate?: any;
|
|
|
270
565
|
*
|
|
271
566
|
* @remarks
|
|
272
567
|
* 判断传入的字段值是否包含数据,即不为 NULL
|
|
568
|
+
*
|
|
569
|
+
* @privateForWeDa
|
|
570
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic"}
|
|
273
571
|
*/
|
|
274
572
|
function NotNull(val: any): boolean;
|
|
275
573
|
/**
|
|
@@ -277,6 +575,9 @@ alternate?: any;
|
|
|
277
575
|
*
|
|
278
576
|
* @remarks
|
|
279
577
|
* 用于确定所有判断条件是否为真
|
|
578
|
+
*
|
|
579
|
+
* @privateForWeDa
|
|
580
|
+
* {"group": "formula", "displayType": "function", "displayName": "与", "insertText": "And(true, false)", "subGroup": "logic"}
|
|
280
581
|
*/
|
|
281
582
|
function And(...args: boolean[]): boolean;
|
|
282
583
|
/**
|
|
@@ -284,6 +585,9 @@ alternate?: any;
|
|
|
284
585
|
*
|
|
285
586
|
* @remarks
|
|
286
587
|
* 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
|
|
588
|
+
*
|
|
589
|
+
* @privateForWeDa
|
|
590
|
+
* {"group": "formula", "displayType": "function", "displayName": "或", "insertText": "Or(true, false)", "subGroup": "logic"}
|
|
287
591
|
*/
|
|
288
592
|
function Or(...args: boolean[]): boolean;
|
|
289
593
|
|
|
@@ -292,6 +596,9 @@ alternate?: any;
|
|
|
292
596
|
*
|
|
293
597
|
* @remarks
|
|
294
598
|
* 获取传入文本的字符数
|
|
599
|
+
*
|
|
600
|
+
* @privateForWeDa
|
|
601
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text"}
|
|
295
602
|
*/
|
|
296
603
|
function Len(text: string): number;
|
|
297
604
|
/**
|
|
@@ -299,6 +606,9 @@ alternate?: any;
|
|
|
299
606
|
*
|
|
300
607
|
* @remarks
|
|
301
608
|
* 判断文本 1 是否包含文本 2
|
|
609
|
+
*
|
|
610
|
+
* @privateForWeDa
|
|
611
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否包含指定文本", "insertText": "Contains('文本1', '文本2')", "subGroup": "text"}
|
|
302
612
|
*/
|
|
303
613
|
function Contains(text1: string, text2: string): boolean;
|
|
304
614
|
/**
|
|
@@ -306,6 +616,9 @@ alternate?: any;
|
|
|
306
616
|
*
|
|
307
617
|
* @remarks
|
|
308
618
|
* 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
|
|
619
|
+
*
|
|
620
|
+
* @privateForWeDa
|
|
621
|
+
* {"group": "formula", "displayType": "function", "displayName": "拆分文本", "insertText": "Split('文本1', '文本2')", "subGroup": "text"}
|
|
309
622
|
*/
|
|
310
623
|
function Split(text1: string, text2: string): string[];
|
|
311
624
|
/**
|
|
@@ -313,6 +626,9 @@ alternate?: any;
|
|
|
313
626
|
*
|
|
314
627
|
* @remarks
|
|
315
628
|
* 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
|
|
629
|
+
*
|
|
630
|
+
* @privateForWeDa
|
|
631
|
+
* {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text"}
|
|
316
632
|
*/
|
|
317
633
|
function Trim(text: string): string;
|
|
318
634
|
/**
|
|
@@ -320,6 +636,9 @@ alternate?: any;
|
|
|
320
636
|
*
|
|
321
637
|
* @remarks
|
|
322
638
|
* 将传入的文本转为全大写文本
|
|
639
|
+
*
|
|
640
|
+
* @privateForWeDa
|
|
641
|
+
* {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text"}
|
|
323
642
|
*/
|
|
324
643
|
function Upper(text: string): string;
|
|
325
644
|
/**
|
|
@@ -327,19 +646,19 @@ alternate?: any;
|
|
|
327
646
|
*
|
|
328
647
|
* @remarks
|
|
329
648
|
* 将传入的文本转为全小写文本
|
|
330
|
-
*/
|
|
331
|
-
function Lower(text: string): string;
|
|
332
|
-
/**
|
|
333
|
-
* 转换为文本
|
|
334
649
|
*
|
|
335
|
-
* @
|
|
336
|
-
*
|
|
650
|
+
* @privateForWeDa
|
|
651
|
+
* {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text"}
|
|
337
652
|
*/
|
|
653
|
+
function Lower(text: string): string;
|
|
338
654
|
/**
|
|
339
655
|
* 文本拼接
|
|
340
656
|
*
|
|
341
657
|
* @remarks
|
|
342
658
|
* 返回多个文本拼接后的新文本
|
|
659
|
+
*
|
|
660
|
+
* @privateForWeDa
|
|
661
|
+
* {"group": "formula", "displayType": "function", "displayName": "文本拼接", "insertText": "Concat('文本1', '文本2')", "subGroup": "text"}
|
|
343
662
|
*/
|
|
344
663
|
function Concat(...text: string[]): string;
|
|
345
664
|
|
|
@@ -348,6 +667,9 @@ alternate?: any;
|
|
|
348
667
|
*
|
|
349
668
|
* @remarks
|
|
350
669
|
* 返回当前系统时间,通常与其他日期时间函数搭配使用
|
|
670
|
+
*
|
|
671
|
+
* @privateForWeDa
|
|
672
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time"}
|
|
351
673
|
*/
|
|
352
674
|
function Now(): number;
|
|
353
675
|
/**
|
|
@@ -355,6 +677,9 @@ alternate?: any;
|
|
|
355
677
|
*
|
|
356
678
|
* @remarks
|
|
357
679
|
* 根据输入的日期时间返回时间戳
|
|
680
|
+
*
|
|
681
|
+
* @privateForWeDa
|
|
682
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time"}
|
|
358
683
|
*/
|
|
359
684
|
function Timestamp(arg: number | string | Date): number;
|
|
360
685
|
/**
|
|
@@ -362,6 +687,9 @@ alternate?: any;
|
|
|
362
687
|
*
|
|
363
688
|
* @remarks
|
|
364
689
|
* 根据输入的日期时间返回该时间的秒数
|
|
690
|
+
*
|
|
691
|
+
* @privateForWeDa
|
|
692
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time"}
|
|
365
693
|
*/
|
|
366
694
|
function Second(arg: number | string | Date): number;
|
|
367
695
|
/**
|
|
@@ -369,6 +697,9 @@ alternate?: any;
|
|
|
369
697
|
*
|
|
370
698
|
* @remarks
|
|
371
699
|
* 根据输入的日期时间返回该时间的分钟部分
|
|
700
|
+
*
|
|
701
|
+
* @privateForWeDa
|
|
702
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time"}
|
|
372
703
|
*/
|
|
373
704
|
function Minute(arg: number | string | Date): number;
|
|
374
705
|
/**
|
|
@@ -376,6 +707,9 @@ alternate?: any;
|
|
|
376
707
|
*
|
|
377
708
|
* @remarks
|
|
378
709
|
* 根据输入的日期时间返回该时间的小时部分,24小时制
|
|
710
|
+
*
|
|
711
|
+
* @privateForWeDa
|
|
712
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time"}
|
|
379
713
|
*/
|
|
380
714
|
function Hour(arg: number | string | Date): number;
|
|
381
715
|
/**
|
|
@@ -383,6 +717,9 @@ alternate?: any;
|
|
|
383
717
|
*
|
|
384
718
|
* @remarks
|
|
385
719
|
* 根据输入的日期时间返回该时间的日部分,范围为 1-31
|
|
720
|
+
*
|
|
721
|
+
* @privateForWeDa
|
|
722
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time"}
|
|
386
723
|
*/
|
|
387
724
|
function Day(arg: number | string | Date): number;
|
|
388
725
|
/**
|
|
@@ -390,6 +727,9 @@ alternate?: any;
|
|
|
390
727
|
*
|
|
391
728
|
* @remarks
|
|
392
729
|
* 根据输入的日期时间返回该时间的星期数
|
|
730
|
+
*
|
|
731
|
+
* @privateForWeDa
|
|
732
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time"}
|
|
393
733
|
*/
|
|
394
734
|
function DayOfWeek(arg: number | string | Date): number;
|
|
395
735
|
/**
|
|
@@ -397,6 +737,9 @@ alternate?: any;
|
|
|
397
737
|
*
|
|
398
738
|
* @remarks
|
|
399
739
|
* 根据输入的日期时间返回该时间的月份
|
|
740
|
+
*
|
|
741
|
+
* @privateForWeDa
|
|
742
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time"}
|
|
400
743
|
*/
|
|
401
744
|
function Month(arg: number | string | Date): number;
|
|
402
745
|
/**
|
|
@@ -404,6 +747,9 @@ alternate?: any;
|
|
|
404
747
|
*
|
|
405
748
|
* @remarks
|
|
406
749
|
* 根据输入的日期时间返回该时间的年份
|
|
750
|
+
*
|
|
751
|
+
* @privateForWeDa
|
|
752
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time"}
|
|
407
753
|
*/
|
|
408
754
|
function Year(arg: number | string | Date): number;
|
|
409
755
|
/**
|
|
@@ -411,19 +757,19 @@ alternate?: any;
|
|
|
411
757
|
*
|
|
412
758
|
* @remarks
|
|
413
759
|
* 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
|
|
414
|
-
*/
|
|
415
|
-
function GetDate(year: number, month: number, day: number): number;
|
|
416
|
-
/**
|
|
417
|
-
* 使用时间戳创建日期时间
|
|
418
760
|
*
|
|
419
|
-
* @
|
|
420
|
-
*
|
|
761
|
+
* @privateForWeDa
|
|
762
|
+
* {"group": "formula", "displayType": "function", "displayName": "使用年月日创建日期时间", "insertText": "GetDate(2011, 7, 2)", "subGroup": "time"}
|
|
421
763
|
*/
|
|
764
|
+
function GetDate(year: number, month: number, day: number): number;
|
|
422
765
|
/**
|
|
423
766
|
* 使用时间日期文本创建日期时间
|
|
424
767
|
*
|
|
425
768
|
* @remarks
|
|
426
769
|
* 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
|
|
770
|
+
*
|
|
771
|
+
* @privateForWeDa
|
|
772
|
+
* {"group": "formula", "displayType": "function", "displayName": "使用时间日期文本创建日期时间", "insertText": "DateTimeValue('2011-07-02', 'YYYY:MM:DD')", "subGroup": "time"}
|
|
427
773
|
*/
|
|
428
774
|
function DateTimeValue(arg: string, val: string): number;
|
|
429
775
|
/**
|
|
@@ -431,6 +777,9 @@ alternate?: any;
|
|
|
431
777
|
*
|
|
432
778
|
* @remarks
|
|
433
779
|
* 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
|
|
780
|
+
*
|
|
781
|
+
* @privateForWeDa
|
|
782
|
+
* {"group": "formula", "displayType": "function", "displayName": "计算年龄", "insertText": "Age(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
434
783
|
*/
|
|
435
784
|
function Age(arg: number | string | Date, val: number | string | Date): number;
|
|
436
785
|
/**
|
|
@@ -438,6 +787,9 @@ alternate?: any;
|
|
|
438
787
|
*
|
|
439
788
|
* @remarks
|
|
440
789
|
* 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
|
|
790
|
+
*
|
|
791
|
+
* @privateForWeDa
|
|
792
|
+
* {"group": "formula", "displayType": "function", "displayName": "计算当前年龄", "insertText": "AgeOfNow(1661334203345)", "subGroup": "time"}
|
|
441
793
|
*/
|
|
442
794
|
function AgeOfNow(arg: number | string | Date): number;
|
|
443
795
|
/**
|
|
@@ -445,6 +797,9 @@ alternate?: any;
|
|
|
445
797
|
*
|
|
446
798
|
* @remarks
|
|
447
799
|
* 在传入的日期时间上增加 X 天,支持负数
|
|
800
|
+
*
|
|
801
|
+
* @privateForWeDa
|
|
802
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 天", "insertText": "DateAdd(1661334203345, 1)", "subGroup": "time"}
|
|
448
803
|
*/
|
|
449
804
|
function DateAdd(arg: number | string | Date, day: number): number;
|
|
450
805
|
/**
|
|
@@ -452,6 +807,9 @@ alternate?: any;
|
|
|
452
807
|
*
|
|
453
808
|
* @remarks
|
|
454
809
|
* 在传入的日期和时间上增加 X 月,支持负数
|
|
810
|
+
*
|
|
811
|
+
* @privateForWeDa
|
|
812
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 月", "insertText": "MonthAdd(1661334203345, 1)", "subGroup": "time"}
|
|
455
813
|
*/
|
|
456
814
|
function MonthAdd(arg: number | string | Date, month: number): number;
|
|
457
815
|
/**
|
|
@@ -459,6 +817,9 @@ alternate?: any;
|
|
|
459
817
|
*
|
|
460
818
|
* @remarks
|
|
461
819
|
* 在传入的日期和时间上增加 X 年,支持负数
|
|
820
|
+
*
|
|
821
|
+
* @privateForWeDa
|
|
822
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 年", "insertText": "YearAdd(1661334203345, 1)", "subGroup": "time"}
|
|
462
823
|
*/
|
|
463
824
|
function YearAdd(arg: number | string | Date, year: number): number;
|
|
464
825
|
/**
|
|
@@ -466,6 +827,9 @@ alternate?: any;
|
|
|
466
827
|
*
|
|
467
828
|
* @remarks
|
|
468
829
|
* 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
|
|
830
|
+
*
|
|
831
|
+
* @privateForWeDa
|
|
832
|
+
* {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
469
833
|
*/
|
|
470
834
|
function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
471
835
|
/**
|
|
@@ -473,6 +837,9 @@ alternate?: any;
|
|
|
473
837
|
*
|
|
474
838
|
* @remarks
|
|
475
839
|
* 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
|
|
840
|
+
*
|
|
841
|
+
* @privateForWeDa
|
|
842
|
+
* {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
476
843
|
*/
|
|
477
844
|
function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
478
845
|
/**
|
|
@@ -480,6 +847,9 @@ alternate?: any;
|
|
|
480
847
|
*
|
|
481
848
|
* @remarks
|
|
482
849
|
* 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
|
|
850
|
+
*
|
|
851
|
+
* @privateForWeDa
|
|
852
|
+
* {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
483
853
|
*/
|
|
484
854
|
function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
485
855
|
/**
|
|
@@ -487,6 +857,9 @@ alternate?: any;
|
|
|
487
857
|
*
|
|
488
858
|
* @remarks
|
|
489
859
|
* 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
|
|
860
|
+
*
|
|
861
|
+
* @privateForWeDa
|
|
862
|
+
* {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
490
863
|
*/
|
|
491
864
|
function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
492
865
|
/**
|
|
@@ -494,6 +867,9 @@ alternate?: any;
|
|
|
494
867
|
*
|
|
495
868
|
* @remarks
|
|
496
869
|
* 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
|
|
870
|
+
*
|
|
871
|
+
* @privateForWeDa
|
|
872
|
+
* {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
497
873
|
*/
|
|
498
874
|
function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
499
875
|
/**
|
|
@@ -501,6 +877,9 @@ alternate?: any;
|
|
|
501
877
|
*
|
|
502
878
|
* @remarks
|
|
503
879
|
* 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
|
|
880
|
+
*
|
|
881
|
+
* @privateForWeDa
|
|
882
|
+
* {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
504
883
|
*/
|
|
505
884
|
function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
506
885
|
/**
|
|
@@ -508,6 +887,9 @@ alternate?: any;
|
|
|
508
887
|
*
|
|
509
888
|
* @remarks
|
|
510
889
|
* 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
|
|
890
|
+
*
|
|
891
|
+
* @privateForWeDa
|
|
892
|
+
* {"group": "formula", "displayType": "function", "displayName": "日期时间格式化", "insertText": "DateText(1661334203345, 'YYYY-MM-DD HH:mm:ss')", "subGroup": "time"}
|
|
511
893
|
*/
|
|
512
894
|
function DateText(createdTime: number | string | Date, text: string): string;
|
|
513
895
|
/**
|
|
@@ -515,6 +897,9 @@ alternate?: any;
|
|
|
515
897
|
*
|
|
516
898
|
* @remarks
|
|
517
899
|
* 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
|
|
900
|
+
*
|
|
901
|
+
* @privateForWeDa
|
|
902
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为今天", "insertText": "IsToday(1661334203345)", "subGroup": "time"}
|
|
518
903
|
*/
|
|
519
904
|
function IsToday(date: number | string | Date): boolean;
|
|
520
905
|
|
|
@@ -539,26 +924,45 @@ declare const forItems = $for
|
|
|
539
924
|
|
|
540
925
|
// $page Begin
|
|
541
926
|
declare namespace $page {
|
|
542
|
-
|
|
927
|
+
/**
|
|
928
|
+
* 当前页面的 id
|
|
929
|
+
*/
|
|
930
|
+
const id: string;
|
|
543
931
|
|
|
932
|
+
/**
|
|
933
|
+
* 页面数据对象
|
|
934
|
+
*/
|
|
544
935
|
namespace dataset {
|
|
936
|
+
/**
|
|
937
|
+
* 页面变量
|
|
938
|
+
*/
|
|
545
939
|
const state: {
|
|
546
940
|
// Page State Inner Begin
|
|
547
941
|
// Page State 页面变量 - Don't touch me
|
|
548
942
|
// Page State Inner End
|
|
549
943
|
};
|
|
944
|
+
/**
|
|
945
|
+
* 页面参数
|
|
946
|
+
*/
|
|
550
947
|
const params: {
|
|
551
948
|
// Page Param Inner Begin
|
|
552
949
|
// Page Param 页面参数 - Don't touch me
|
|
553
950
|
// Page Param Inner End
|
|
554
951
|
};
|
|
555
952
|
}
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* 页面定义 handler 方法
|
|
956
|
+
*/
|
|
556
957
|
namespace handler {
|
|
557
958
|
// Page Handler Inner Begin
|
|
558
959
|
// Page Handler 页面方法 - Don't touch me
|
|
559
960
|
// Page Handler Inner End
|
|
560
961
|
}
|
|
561
962
|
|
|
963
|
+
/**
|
|
964
|
+
* 设置页面变量
|
|
965
|
+
*/
|
|
562
966
|
function setState(userSetState: Record<string, any>): void;
|
|
563
967
|
|
|
564
968
|
}
|
|
@@ -609,6 +1013,9 @@ declare namespace $comp {
|
|
|
609
1013
|
*
|
|
610
1014
|
* @remarks
|
|
611
1015
|
* 计算传入数字的绝对值
|
|
1016
|
+
*
|
|
1017
|
+
* @privateForWeDa
|
|
1018
|
+
* {"group": "formula", "displayType": "function", "displayName": "绝对值", "insertText": "ABS(1)", "subGroup": "calculation"}
|
|
612
1019
|
*/
|
|
613
1020
|
declare function ABS(num: number): number;
|
|
614
1021
|
/**
|
|
@@ -616,6 +1023,9 @@ declare function ABS(num: number): number;
|
|
|
616
1023
|
*
|
|
617
1024
|
* @remarks
|
|
618
1025
|
* 返回一组数字中的最小值
|
|
1026
|
+
*
|
|
1027
|
+
* @privateForWeDa
|
|
1028
|
+
* {"group": "formula", "displayType": "function", "displayName": "最小值", "insertText": "Min(1, 2)", "subGroup": "calculation"}
|
|
619
1029
|
*/
|
|
620
1030
|
declare function Min(...args: number[]): number;
|
|
621
1031
|
/**
|
|
@@ -623,6 +1033,9 @@ declare function Min(...args: number[]): number;
|
|
|
623
1033
|
*
|
|
624
1034
|
* @remarks
|
|
625
1035
|
* 返回一组数字中的最大值
|
|
1036
|
+
*
|
|
1037
|
+
* @privateForWeDa
|
|
1038
|
+
* {"group": "formula", "displayType": "function", "displayName": "最大值", "insertText": "Max(1, 2)", "subGroup": "calculation"}
|
|
626
1039
|
*/
|
|
627
1040
|
declare function Max(...args: number[]): number;
|
|
628
1041
|
/**
|
|
@@ -630,6 +1043,9 @@ declare function Max(...args: number[]): number;
|
|
|
630
1043
|
*
|
|
631
1044
|
* @remarks
|
|
632
1045
|
* 返回一组数字中的平均值
|
|
1046
|
+
*
|
|
1047
|
+
* @privateForWeDa
|
|
1048
|
+
* {"group": "formula", "displayType": "function", "displayName": "平均值", "insertText": "Average(1, 2)", "subGroup": "calculation"}
|
|
633
1049
|
*/
|
|
634
1050
|
declare function Average(...args: number[]): number;
|
|
635
1051
|
/**
|
|
@@ -637,6 +1053,9 @@ declare function Average(...args: number[]): number;
|
|
|
637
1053
|
*
|
|
638
1054
|
* @remarks
|
|
639
1055
|
* 返回传入数字向下取整的结果
|
|
1056
|
+
*
|
|
1057
|
+
* @privateForWeDa
|
|
1058
|
+
* {"group": "formula", "displayType": "function", "displayName": "向下取整", "insertText": "Floor(1)", "subGroup": "calculation"}
|
|
640
1059
|
*/
|
|
641
1060
|
declare function Floor(num: number): number;
|
|
642
1061
|
/**
|
|
@@ -644,6 +1063,9 @@ declare function Floor(num: number): number;
|
|
|
644
1063
|
*
|
|
645
1064
|
* @remarks
|
|
646
1065
|
* 返回传入数字向上取整的结果
|
|
1066
|
+
*
|
|
1067
|
+
* @privateForWeDa
|
|
1068
|
+
* {"group": "formula", "displayType": "function", "displayName": "向上取整", "insertText": "Ceiling(1)", "subGroup": "calculation"}
|
|
647
1069
|
*/
|
|
648
1070
|
declare function Ceiling(num: number): number;
|
|
649
1071
|
/**
|
|
@@ -651,6 +1073,9 @@ declare function Ceiling(num: number): number;
|
|
|
651
1073
|
*
|
|
652
1074
|
* @remarks
|
|
653
1075
|
* 返回传入数字四舍五入后的结果
|
|
1076
|
+
*
|
|
1077
|
+
* @privateForWeDa
|
|
1078
|
+
* {"group": "formula", "displayType": "function", "displayName": "四舍五入", "insertText": "Round(1)", "subGroup": "calculation"}
|
|
654
1079
|
*/
|
|
655
1080
|
declare function Round(num: number): number;
|
|
656
1081
|
/**
|
|
@@ -658,6 +1083,9 @@ declare function Round(num: number): number;
|
|
|
658
1083
|
*
|
|
659
1084
|
* @remarks
|
|
660
1085
|
* 返回一组数字中的和
|
|
1086
|
+
*
|
|
1087
|
+
* @privateForWeDa
|
|
1088
|
+
* {"group": "formula", "displayType": "function", "displayName": "求和", "insertText": "Sum(1, 2)", "subGroup": "calculation"}
|
|
661
1089
|
*/
|
|
662
1090
|
declare function Sum(...args: number[]): number;
|
|
663
1091
|
/**
|
|
@@ -665,6 +1093,9 @@ declare function Sum(...args: number[]): number;
|
|
|
665
1093
|
*
|
|
666
1094
|
* @remarks
|
|
667
1095
|
* 返回一个指定范围的伪随机数,例如 Rand(10),返回一个范围在 10 以内的随机数
|
|
1096
|
+
*
|
|
1097
|
+
* @privateForWeDa
|
|
1098
|
+
* {"group": "formula", "displayType": "function", "displayName": "随机数", "insertText": "Rand(1)", "subGroup": "calculation"}
|
|
668
1099
|
*/
|
|
669
1100
|
declare function Rand(num: number): number;
|
|
670
1101
|
|
|
@@ -678,6 +1109,9 @@ alternate?: any;
|
|
|
678
1109
|
*
|
|
679
1110
|
* @remarks
|
|
680
1111
|
* 按判断条件进行逻辑比较,满足时返回一个值,不满足时返回另一个值。
|
|
1112
|
+
*
|
|
1113
|
+
* @privateForWeDa
|
|
1114
|
+
* {"group": "formula", "displayType": "function", "displayName": "条件分支", "insertText": "If(true, '您好', 'hello')", "subGroup": "logic"}
|
|
681
1115
|
*/
|
|
682
1116
|
declare function If(data: IIfObjectParam): any;
|
|
683
1117
|
declare function If(condition: boolean, consequent?: any, alternate?: any): any;
|
|
@@ -686,6 +1120,9 @@ declare function If(condition: boolean, consequent?: any, alternate?: any): any;
|
|
|
686
1120
|
*
|
|
687
1121
|
* @remarks
|
|
688
1122
|
* 判断传入的文本是否为空
|
|
1123
|
+
*
|
|
1124
|
+
* @privateForWeDa
|
|
1125
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为空", "insertText": "IsEmpty('hello')", "subGroup": "logic"}
|
|
689
1126
|
*/
|
|
690
1127
|
declare function IsEmpty(text: string | string[]): boolean;
|
|
691
1128
|
/**
|
|
@@ -693,6 +1130,9 @@ declare function IsEmpty(text: string | string[]): boolean;
|
|
|
693
1130
|
*
|
|
694
1131
|
* @remarks
|
|
695
1132
|
* 判断传入的字段值是否包含数据,即不为 NULL
|
|
1133
|
+
*
|
|
1134
|
+
* @privateForWeDa
|
|
1135
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为null", "insertText": "NotNull(null)", "subGroup": "logic"}
|
|
696
1136
|
*/
|
|
697
1137
|
declare function NotNull(val: any): boolean;
|
|
698
1138
|
/**
|
|
@@ -700,6 +1140,9 @@ declare function NotNull(val: any): boolean;
|
|
|
700
1140
|
*
|
|
701
1141
|
* @remarks
|
|
702
1142
|
* 用于确定所有判断条件是否为真
|
|
1143
|
+
*
|
|
1144
|
+
* @privateForWeDa
|
|
1145
|
+
* {"group": "formula", "displayType": "function", "displayName": "与", "insertText": "And(true, false)", "subGroup": "logic"}
|
|
703
1146
|
*/
|
|
704
1147
|
declare function And(...args: boolean[]): boolean;
|
|
705
1148
|
/**
|
|
@@ -707,6 +1150,9 @@ declare function And(...args: boolean[]): boolean;
|
|
|
707
1150
|
*
|
|
708
1151
|
* @remarks
|
|
709
1152
|
* 任意一个判断条件为真,则结果为真;所有条件为否,结果才为否
|
|
1153
|
+
*
|
|
1154
|
+
* @privateForWeDa
|
|
1155
|
+
* {"group": "formula", "displayType": "function", "displayName": "或", "insertText": "Or(true, false)", "subGroup": "logic"}
|
|
710
1156
|
*/
|
|
711
1157
|
declare function Or(...args: boolean[]): boolean;
|
|
712
1158
|
|
|
@@ -715,6 +1161,9 @@ declare function Or(...args: boolean[]): boolean;
|
|
|
715
1161
|
*
|
|
716
1162
|
* @remarks
|
|
717
1163
|
* 获取传入文本的字符数
|
|
1164
|
+
*
|
|
1165
|
+
* @privateForWeDa
|
|
1166
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取文本长度", "insertText": "Len('文本')", "subGroup": "text"}
|
|
718
1167
|
*/
|
|
719
1168
|
declare function Len(text: string): number;
|
|
720
1169
|
/**
|
|
@@ -722,6 +1171,9 @@ declare function Len(text: string): number;
|
|
|
722
1171
|
*
|
|
723
1172
|
* @remarks
|
|
724
1173
|
* 判断文本 1 是否包含文本 2
|
|
1174
|
+
*
|
|
1175
|
+
* @privateForWeDa
|
|
1176
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否包含指定文本", "insertText": "Contains('文本1', '文本2')", "subGroup": "text"}
|
|
725
1177
|
*/
|
|
726
1178
|
declare function Contains(text1: string, text2: string): boolean;
|
|
727
1179
|
/**
|
|
@@ -729,6 +1181,9 @@ declare function Contains(text1: string, text2: string): boolean;
|
|
|
729
1181
|
*
|
|
730
1182
|
* @remarks
|
|
731
1183
|
* 根据传入的文本 2,将文本 1 拆分成文本数组,例如 Split("张三,李四,王五", ",")
|
|
1184
|
+
*
|
|
1185
|
+
* @privateForWeDa
|
|
1186
|
+
* {"group": "formula", "displayType": "function", "displayName": "拆分文本", "insertText": "Split('文本1', '文本2')", "subGroup": "text"}
|
|
732
1187
|
*/
|
|
733
1188
|
declare function Split(text1: string, text2: string): string[];
|
|
734
1189
|
/**
|
|
@@ -736,6 +1191,9 @@ declare function Split(text1: string, text2: string): string[];
|
|
|
736
1191
|
*
|
|
737
1192
|
* @remarks
|
|
738
1193
|
* 删除文本开头和结尾的所有空格和制表符,文本中间的空格和制表符不会删除
|
|
1194
|
+
*
|
|
1195
|
+
* @privateForWeDa
|
|
1196
|
+
* {"group": "formula", "displayType": "function", "displayName": "删除开头/结尾空格和制表符", "insertText": "Trim('文本')", "subGroup": "text"}
|
|
739
1197
|
*/
|
|
740
1198
|
declare function Trim(text: string): string;
|
|
741
1199
|
/**
|
|
@@ -743,6 +1201,9 @@ declare function Trim(text: string): string;
|
|
|
743
1201
|
*
|
|
744
1202
|
* @remarks
|
|
745
1203
|
* 将传入的文本转为全大写文本
|
|
1204
|
+
*
|
|
1205
|
+
* @privateForWeDa
|
|
1206
|
+
* {"group": "formula", "displayType": "function", "displayName": "转换为大写", "insertText": "Upper('文本')", "subGroup": "text"}
|
|
746
1207
|
*/
|
|
747
1208
|
declare function Upper(text: string): string;
|
|
748
1209
|
/**
|
|
@@ -750,19 +1211,19 @@ declare function Upper(text: string): string;
|
|
|
750
1211
|
*
|
|
751
1212
|
* @remarks
|
|
752
1213
|
* 将传入的文本转为全小写文本
|
|
753
|
-
*/
|
|
754
|
-
declare function Lower(text: string): string;
|
|
755
|
-
/**
|
|
756
|
-
* 转换为文本
|
|
757
1214
|
*
|
|
758
|
-
* @
|
|
759
|
-
*
|
|
1215
|
+
* @privateForWeDa
|
|
1216
|
+
* {"group": "formula", "displayType": "function", "displayName": "转换为小写", "insertText": "Lower('文本')", "subGroup": "text"}
|
|
760
1217
|
*/
|
|
1218
|
+
declare function Lower(text: string): string;
|
|
761
1219
|
/**
|
|
762
1220
|
* 文本拼接
|
|
763
1221
|
*
|
|
764
1222
|
* @remarks
|
|
765
1223
|
* 返回多个文本拼接后的新文本
|
|
1224
|
+
*
|
|
1225
|
+
* @privateForWeDa
|
|
1226
|
+
* {"group": "formula", "displayType": "function", "displayName": "文本拼接", "insertText": "Concat('文本1', '文本2')", "subGroup": "text"}
|
|
766
1227
|
*/
|
|
767
1228
|
declare function Concat(...text: string[]): string;
|
|
768
1229
|
|
|
@@ -771,6 +1232,9 @@ declare function Concat(...text: string[]): string;
|
|
|
771
1232
|
*
|
|
772
1233
|
* @remarks
|
|
773
1234
|
* 返回当前系统时间,通常与其他日期时间函数搭配使用
|
|
1235
|
+
*
|
|
1236
|
+
* @privateForWeDa
|
|
1237
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取现在时间", "insertText": "Now()", "subGroup": "time"}
|
|
774
1238
|
*/
|
|
775
1239
|
declare function Now(): number;
|
|
776
1240
|
/**
|
|
@@ -778,6 +1242,9 @@ declare function Now(): number;
|
|
|
778
1242
|
*
|
|
779
1243
|
* @remarks
|
|
780
1244
|
* 根据输入的日期时间返回时间戳
|
|
1245
|
+
*
|
|
1246
|
+
* @privateForWeDa
|
|
1247
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取时间戳", "insertText": "Timestamp(1661334203345)", "subGroup": "time"}
|
|
781
1248
|
*/
|
|
782
1249
|
declare function Timestamp(arg: number | string | Date): number;
|
|
783
1250
|
/**
|
|
@@ -785,6 +1252,9 @@ declare function Timestamp(arg: number | string | Date): number;
|
|
|
785
1252
|
*
|
|
786
1253
|
* @remarks
|
|
787
1254
|
* 根据输入的日期时间返回该时间的秒数
|
|
1255
|
+
*
|
|
1256
|
+
* @privateForWeDa
|
|
1257
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取秒数", "insertText": "Second(1661334203345)", "subGroup": "time"}
|
|
788
1258
|
*/
|
|
789
1259
|
declare function Second(arg: number | string | Date): number;
|
|
790
1260
|
/**
|
|
@@ -792,6 +1262,9 @@ declare function Second(arg: number | string | Date): number;
|
|
|
792
1262
|
*
|
|
793
1263
|
* @remarks
|
|
794
1264
|
* 根据输入的日期时间返回该时间的分钟部分
|
|
1265
|
+
*
|
|
1266
|
+
* @privateForWeDa
|
|
1267
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取分钟数", "insertText": "Minute(1661334203345)", "subGroup": "time"}
|
|
795
1268
|
*/
|
|
796
1269
|
declare function Minute(arg: number | string | Date): number;
|
|
797
1270
|
/**
|
|
@@ -799,6 +1272,9 @@ declare function Minute(arg: number | string | Date): number;
|
|
|
799
1272
|
*
|
|
800
1273
|
* @remarks
|
|
801
1274
|
* 根据输入的日期时间返回该时间的小时部分,24小时制
|
|
1275
|
+
*
|
|
1276
|
+
* @privateForWeDa
|
|
1277
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取小时数", "insertText": "Hour(1661334203345)", "subGroup": "time"}
|
|
802
1278
|
*/
|
|
803
1279
|
declare function Hour(arg: number | string | Date): number;
|
|
804
1280
|
/**
|
|
@@ -806,6 +1282,9 @@ declare function Hour(arg: number | string | Date): number;
|
|
|
806
1282
|
*
|
|
807
1283
|
* @remarks
|
|
808
1284
|
* 根据输入的日期时间返回该时间的日部分,范围为 1-31
|
|
1285
|
+
*
|
|
1286
|
+
* @privateForWeDa
|
|
1287
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取天数", "insertText": "Day(1661334203345)", "subGroup": "time"}
|
|
809
1288
|
*/
|
|
810
1289
|
declare function Day(arg: number | string | Date): number;
|
|
811
1290
|
/**
|
|
@@ -813,6 +1292,9 @@ declare function Day(arg: number | string | Date): number;
|
|
|
813
1292
|
*
|
|
814
1293
|
* @remarks
|
|
815
1294
|
* 根据输入的日期时间返回该时间的星期数
|
|
1295
|
+
*
|
|
1296
|
+
* @privateForWeDa
|
|
1297
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取星期数", "insertText": "DayOfWeek(1661334203345)", "subGroup": "time"}
|
|
816
1298
|
*/
|
|
817
1299
|
declare function DayOfWeek(arg: number | string | Date): number;
|
|
818
1300
|
/**
|
|
@@ -820,6 +1302,9 @@ declare function DayOfWeek(arg: number | string | Date): number;
|
|
|
820
1302
|
*
|
|
821
1303
|
* @remarks
|
|
822
1304
|
* 根据输入的日期时间返回该时间的月份
|
|
1305
|
+
*
|
|
1306
|
+
* @privateForWeDa
|
|
1307
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取月数", "insertText": "Month(1661334203345)", "subGroup": "time"}
|
|
823
1308
|
*/
|
|
824
1309
|
declare function Month(arg: number | string | Date): number;
|
|
825
1310
|
/**
|
|
@@ -827,6 +1312,9 @@ declare function Month(arg: number | string | Date): number;
|
|
|
827
1312
|
*
|
|
828
1313
|
* @remarks
|
|
829
1314
|
* 根据输入的日期时间返回该时间的年份
|
|
1315
|
+
*
|
|
1316
|
+
* @privateForWeDa
|
|
1317
|
+
* {"group": "formula", "displayType": "function", "displayName": "获取年份", "insertText": "Year(1661334203345)", "subGroup": "time"}
|
|
830
1318
|
*/
|
|
831
1319
|
declare function Year(arg: number | string | Date): number;
|
|
832
1320
|
/**
|
|
@@ -834,19 +1322,19 @@ declare function Year(arg: number | string | Date): number;
|
|
|
834
1322
|
*
|
|
835
1323
|
* @remarks
|
|
836
1324
|
* 根据输入的年月日数值返回一个日期类型的数据,例如 GetDate(2017,3,24)
|
|
837
|
-
*/
|
|
838
|
-
declare function GetDate(year: number, month: number, day: number): number;
|
|
839
|
-
/**
|
|
840
|
-
* 使用时间戳创建日期时间
|
|
841
1325
|
*
|
|
842
|
-
* @
|
|
843
|
-
*
|
|
1326
|
+
* @privateForWeDa
|
|
1327
|
+
* {"group": "formula", "displayType": "function", "displayName": "使用年月日创建日期时间", "insertText": "GetDate(2011, 7, 2)", "subGroup": "time"}
|
|
844
1328
|
*/
|
|
1329
|
+
declare function GetDate(year: number, month: number, day: number): number;
|
|
845
1330
|
/**
|
|
846
1331
|
* 使用时间日期文本创建日期时间
|
|
847
1332
|
*
|
|
848
1333
|
* @remarks
|
|
849
1334
|
* 将日期时间文本根据指定格式转化为日期时间,例如 DateTimeValue("2021-12-11 01:19:12", "yyyy-MM-dd HH:mm:ss")
|
|
1335
|
+
*
|
|
1336
|
+
* @privateForWeDa
|
|
1337
|
+
* {"group": "formula", "displayType": "function", "displayName": "使用时间日期文本创建日期时间", "insertText": "DateTimeValue('2011-07-02', 'YYYY:MM:DD')", "subGroup": "time"}
|
|
850
1338
|
*/
|
|
851
1339
|
declare function DateTimeValue(arg: string, val: string): number;
|
|
852
1340
|
/**
|
|
@@ -854,6 +1342,9 @@ declare function DateTimeValue(arg: string, val: string): number;
|
|
|
854
1342
|
*
|
|
855
1343
|
* @remarks
|
|
856
1344
|
* 根据输入的两个日期时间计算出年龄,例如 Age(Date(2017,3,24), Date(2021,3,24))
|
|
1345
|
+
*
|
|
1346
|
+
* @privateForWeDa
|
|
1347
|
+
* {"group": "formula", "displayType": "function", "displayName": "计算年龄", "insertText": "Age(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
857
1348
|
*/
|
|
858
1349
|
declare function Age(arg: number | string | Date, val: number | string | Date): number;
|
|
859
1350
|
/**
|
|
@@ -861,6 +1352,9 @@ declare function Age(arg: number | string | Date, val: number | string | Date):
|
|
|
861
1352
|
*
|
|
862
1353
|
* @remarks
|
|
863
1354
|
* 计算当前年龄,例如 AgeOfNow(Date(2017,3,24))
|
|
1355
|
+
*
|
|
1356
|
+
* @privateForWeDa
|
|
1357
|
+
* {"group": "formula", "displayType": "function", "displayName": "计算当前年龄", "insertText": "AgeOfNow(1661334203345)", "subGroup": "time"}
|
|
864
1358
|
*/
|
|
865
1359
|
declare function AgeOfNow(arg: number | string | Date): number;
|
|
866
1360
|
/**
|
|
@@ -868,6 +1362,9 @@ declare function AgeOfNow(arg: number | string | Date): number;
|
|
|
868
1362
|
*
|
|
869
1363
|
* @remarks
|
|
870
1364
|
* 在传入的日期时间上增加 X 天,支持负数
|
|
1365
|
+
*
|
|
1366
|
+
* @privateForWeDa
|
|
1367
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 天", "insertText": "DateAdd(1661334203345, 1)", "subGroup": "time"}
|
|
871
1368
|
*/
|
|
872
1369
|
declare function DateAdd(arg: number | string | Date, day: number): number;
|
|
873
1370
|
/**
|
|
@@ -875,6 +1372,9 @@ declare function DateAdd(arg: number | string | Date, day: number): number;
|
|
|
875
1372
|
*
|
|
876
1373
|
* @remarks
|
|
877
1374
|
* 在传入的日期和时间上增加 X 月,支持负数
|
|
1375
|
+
*
|
|
1376
|
+
* @privateForWeDa
|
|
1377
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 月", "insertText": "MonthAdd(1661334203345, 1)", "subGroup": "time"}
|
|
878
1378
|
*/
|
|
879
1379
|
declare function MonthAdd(arg: number | string | Date, month: number): number;
|
|
880
1380
|
/**
|
|
@@ -882,6 +1382,9 @@ declare function MonthAdd(arg: number | string | Date, month: number): number;
|
|
|
882
1382
|
*
|
|
883
1383
|
* @remarks
|
|
884
1384
|
* 在传入的日期和时间上增加 X 年,支持负数
|
|
1385
|
+
*
|
|
1386
|
+
* @privateForWeDa
|
|
1387
|
+
* {"group": "formula", "displayType": "function", "displayName": "增加 X 年", "insertText": "YearAdd(1661334203345, 1)", "subGroup": "time"}
|
|
885
1388
|
*/
|
|
886
1389
|
declare function YearAdd(arg: number | string | Date, year: number): number;
|
|
887
1390
|
/**
|
|
@@ -889,6 +1392,9 @@ declare function YearAdd(arg: number | string | Date, year: number): number;
|
|
|
889
1392
|
*
|
|
890
1393
|
* @remarks
|
|
891
1394
|
* 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
|
|
1395
|
+
*
|
|
1396
|
+
* @privateForWeDa
|
|
1397
|
+
* {"group": "formula", "displayType": "function", "displayName": "天数差", "insertText": "DateDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
892
1398
|
*/
|
|
893
1399
|
declare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
894
1400
|
/**
|
|
@@ -896,6 +1402,9 @@ declare function DateDiff(startDay: number | string | Date, endDay: number | str
|
|
|
896
1402
|
*
|
|
897
1403
|
* @remarks
|
|
898
1404
|
* 返回两个日期时间字段之间的小时差,如果为同一小时,差数为零
|
|
1405
|
+
*
|
|
1406
|
+
* @privateForWeDa
|
|
1407
|
+
* {"group": "formula", "displayType": "function", "displayName": "小时差", "insertText": "HourDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
899
1408
|
*/
|
|
900
1409
|
declare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
901
1410
|
/**
|
|
@@ -903,6 +1412,9 @@ declare function HourDiff(startDay: number | string | Date, endDay: number | str
|
|
|
903
1412
|
*
|
|
904
1413
|
* @remarks
|
|
905
1414
|
* 返回两个日期时间字段之间的分钟差,如果为同一分钟,差数为零
|
|
1415
|
+
*
|
|
1416
|
+
* @privateForWeDa
|
|
1417
|
+
* {"group": "formula", "displayType": "function", "displayName": "分钟差", "insertText": "MinuteDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
906
1418
|
*/
|
|
907
1419
|
declare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
908
1420
|
/**
|
|
@@ -910,6 +1422,9 @@ declare function MinuteDiff(startDay: number | string | Date, endDay: number | s
|
|
|
910
1422
|
*
|
|
911
1423
|
* @remarks
|
|
912
1424
|
* 返回两个日期时间字段之间的天数差,如果为同一天,差数为零
|
|
1425
|
+
*
|
|
1426
|
+
* @privateForWeDa
|
|
1427
|
+
* {"group": "formula", "displayType": "function", "displayName": "秒数差", "insertText": "SecondDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
913
1428
|
*/
|
|
914
1429
|
declare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
915
1430
|
/**
|
|
@@ -917,6 +1432,9 @@ declare function SecondDiff(startDay: number | string | Date, endDay: number | s
|
|
|
917
1432
|
*
|
|
918
1433
|
* @remarks
|
|
919
1434
|
* 返回两个日期时间字段之间的月数差,如果为同一月,差数为零
|
|
1435
|
+
*
|
|
1436
|
+
* @privateForWeDa
|
|
1437
|
+
* {"group": "formula", "displayType": "function", "displayName": "月数差", "insertText": "MonthDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
920
1438
|
*/
|
|
921
1439
|
declare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
922
1440
|
/**
|
|
@@ -924,6 +1442,9 @@ declare function MonthDiff(startDay: number | string | Date, endDay: number | st
|
|
|
924
1442
|
*
|
|
925
1443
|
* @remarks
|
|
926
1444
|
* 返回两个日期时间字段之间的年数差,如果为同一年,差数为零
|
|
1445
|
+
*
|
|
1446
|
+
* @privateForWeDa
|
|
1447
|
+
* {"group": "formula", "displayType": "function", "displayName": "年数差", "insertText": "YearDiff(1661334203345, 1661334203345)", "subGroup": "time"}
|
|
927
1448
|
*/
|
|
928
1449
|
declare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
929
1450
|
/**
|
|
@@ -931,6 +1452,9 @@ declare function YearDiff(startDay: number | string | Date, endDay: number | str
|
|
|
931
1452
|
*
|
|
932
1453
|
* @remarks
|
|
933
1454
|
* 格式化日期时间为指定格式的文本,例如 DateText(Date(2017,3,24), "yyyy-MM-dd HH:mm:ss")
|
|
1455
|
+
*
|
|
1456
|
+
* @privateForWeDa
|
|
1457
|
+
* {"group": "formula", "displayType": "function", "displayName": "日期时间格式化", "insertText": "DateText(1661334203345, 'YYYY-MM-DD HH:mm:ss')", "subGroup": "time"}
|
|
934
1458
|
*/
|
|
935
1459
|
declare function DateText(createdTime: number | string | Date, text: string): string;
|
|
936
1460
|
/**
|
|
@@ -938,6 +1462,9 @@ declare function DateText(createdTime: number | string | Date, text: string): st
|
|
|
938
1462
|
*
|
|
939
1463
|
* @remarks
|
|
940
1464
|
* 判断传入的日期时间是否为今天,例如 IsToday(Date(2022,4,8))
|
|
1465
|
+
*
|
|
1466
|
+
* @privateForWeDa
|
|
1467
|
+
* {"group": "formula", "displayType": "function", "displayName": "是否为今天", "insertText": "IsToday(1661334203345)", "subGroup": "time"}
|
|
941
1468
|
*/
|
|
942
1469
|
declare function IsToday(date: number | string | Date): boolean;
|
|
943
1470
|
|