使用范围:UI2
component Sn ($UI/comp/sn/components/sn/sn) extends ViewComponent
Constructor Top
Sn () | |||
Sn ( options) |
Methods Top
Promise | next (String key, String format, String num) | |
Promise | nextByDate (String key) | |
String | nextByDateSync (String key) | |
String | nextSync (String key, String format, String num) | |
Promise | snowId () | |
Number | snowIdSync () |
Operations Top
next (String 标识, String 格式, Integer 序号增量) | ||
nextByDate (String 标识) |
Events Top
void | onNextByDateSnSuccess (NextByDateSnSuccessEvent event) | |
void | onSnowIdSuccess ($UI/comp/sn/components/sn/sn#snowIdSuccessEvent event) |
Constructor details
Top
public
Sn
()
使用场景:产生一个唯一的序号。
使用方法:在操作中提供了函数,同时提供了api接口供js中调用。
public
Sn
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
public
Sn
()
public
Sn
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
Methods Detail Top
public
Promise
next
(String key, String format, String num)
public
Promise
nextByDate
(String key)
public
String
nextByDateSync
(String key)
根据当前时间获取下个序号
public
String
nextSync
(String key, String format, String num)
获取下个序号
public
Promise
snowId
()
public
Number
snowIdSync
()
获取下个雪花算法序号
Operations Detail Top
public
next
(String 标识, String 格式, Integer 序号增量)
日期序号
public
nextByDate
(String 标识)
日期序号
Events Detail Top
根据日期获取序号成功
public
void
onSnowIdSuccess
($UI/comp/sn/components/sn/sn#snowIdSuccessEvent event)
获取下个雪花算法序号成功