-
Notifications
You must be signed in to change notification settings - Fork 0
utils_util.js
xinwu-yang edited this page Mar 1, 2023
·
1 revision
封装的工具函数
toLineMode(str: string, separate: string) => string
timeFix() => string
triggerWindowResizeEvent() => void
filterObj(obj: object) => object
formatDate(time: string, formatter: string) => string
cloneObject(obj) => object
randomNumber() => number
示例:生成长度为 12 的随机数:randomNumber(12) 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
randomString(length: number, chats: string | array) => string
length字符串长度,chats字符区间
randomUUID() => string
underLine2CamelCase(str: string) => string
validateDuplicateValue(tableName: string, fieldName: string, fieldVal: string, dataId: string, callback: function, message: string) => void
tableName 被验证的表名
fieldName 被验证的字段名
fieldVal 被验证的值
dataId 数据ID,可空
callback 回调函数
message 提示
validateCheckRule(ruleCode: string, value: string, callback: function) => void
ruleCode 编码校验规则 code
value 被验证的值
callback 回调函数
pushIfNotExist(arr: array, value: any, key: number) => boolean
hasPermissionAction(action: string) => boolean