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