Modules

Cipher
Datetime
Form
Interact
Network
Uitls

Cipher

Cipher.useSm2()

国密 sm2

Kind: static method of Cipher

Cipher.useSm3(msg, [options]) ⇒ *

国密 sm3 加密

Kind: static method of Cipher

ParamTypeDefaultDescription
msgstring密码信息
[options]Object{}

Cipher.useSm4Encrypt(msg, key, [options]) ⇒ Uint8Array

国密 sm4 加密

Kind: static method of Cipher

ParamTypeDefaultDescription
msgstring密码信息
keystring秘钥
[options]Object{}

Cipher.useSm4Decrypt(encryptData, key, [options]) ⇒ Uint8Array

国密 sm4 解密

Kind: static method of Cipher

ParamTypeDefaultDescription
encryptDatastring加密信息
keystring秘钥
[options]Object{}

Datetime

Datetime.useDayjs(date, [format]) ⇒ dayjs.Dayjs

根据格式创建 Dayjs 对象

Kind: static method of Datetime

ParamTypeDefaultDescription
datestring | number日期字符
[format]stringnull日期格式

Datetime.useDateFormat(date, [format]) ⇒ string

格式化日期

Kind: static method of Datetime

ParamTypeDefaultDescription
datedayjs.Dayjs | Date日期对象
[format]string"YYYY-MM-DD HH:mm"日期格式

Datetime.useDateUnix(date) ⇒ number | string

获取日期的 Unix 时间戳

Kind: static method of Datetime

ParamTypeDescription
datedayjs.Dayjs | Date日期对象

Form

Form.formLabel

表单布局

Kind: static constant of Form
Properties

NameTypeDescription
formLabel.commonLabelColObject{ span: 8, xxl: 6 }
formLabel.commonWrapperColObject{ span: 12, xxl: 14 }
formLabel.commonWrapperOffsetObject{ xs: { offset: 8, span: 12 }, xxl: { offset: 6, span: 14 } }
formLabel.commonLabelFullColObject{ span: 8, xxl: 6 }
formLabel.commonWrapperFullColObject{ span: 16, xxl: 18 }
formLabel.commonWrapperFullOffsetObject{ xs: { offset: 8, span: 16 }, xxl: { offset: 6, span: 18 } }
formLabel.commonLabelPartColObject{ span: 4, xxl: 3 }
formLabel.commonWrapperPartColObject{ span: 20, xxl: 21 }
formLabel.commonWrapperPartOffsetObject{ xs: { offset: 4, span: 20 }, xxl: { offset: 3, span: 21 } }

Form.useHiddenForm(options) ⇒ HTMLFormElement

创建一个隐藏的表单

Kind: static method of Form

ParamTypeDefaultDescription
optionsObject
options.urlstring请求地址
options.dataObject发送的数据
[options.method]string"post"请求方法
[options.csrfToken]stringnullCSRF Token

Form.useProcessStatus(res, ops)

处理请求结果

Kind: static method of Form

ParamTypeDescription
resobject请求结果
res.statusstring请求结果状态
res.result*请求结果信息
opsObject.<string, (string|function())>状态的处理对象

Form.useProcessStatusSuccess(res, success)

处理正确请求结果

Kind: static method of Form

ParamTypeDescription
resobject请求结果
res.statusstring请求结果状态
res.result*请求结果信息
successstring | function状态的处理对象

Form.useFormFail(e)

处理表单提交失败

Kind: static method of Form

ParamType
e*

Form.useFormFormat(form, [format]) ⇒ Object

处理表单数据

Kind: static method of Form

ParamTypeDescription
formObject
[format]Object需要处理的类型
[format.date]boolean | string | functiontrue: 转成时间戳,string: 为 Format 格式, 如 "YYYY-MM-DD", function: 自定义处理函数, 参数为 dayjs 对象
[format.boolean]boolean布尔值处理, 如果开启则 true 转成 1, false 转成 0
[format.attachment]string | functionstring: 附件字段名, function: 自定义处理函数, 参数为附件对象

Interact

Interact.useModalConfirm(msg, [onOk], [loading], [onCancel]) ⇒ *

确认弹窗

Kind: static method of Interact

ParamTypeDefaultDescription
msgstring提示信息
[onOk]function确认回调
[loading]booleanfalse是否异步加载
[onCancel]function取消回调

Network

Network.STATUS

请求返回状态码

Kind: static constant of Network
Properties

NameTypeDescription
STATUS.STATE_CODE_SUCCESSstringSUCCESS 成功
STATUS.STATE_CODE_FAILstringFAIL 失败
STATUS.STATE_CODE_NOT_FOUNDstringNOT_FOUND 找不到资源
STATUS.STATE_CODE_INFO_NOT_COMPLETEstringINCOMPLETE 信息不完整
STATUS.STATE_CODE_NOT_ALLOWEDstringNOT_ALLOWED 无权限

Network.useFetch([fetcher]) ⇒ Object

通用 AJAX 请求

Kind: static method of Network

ParamTypeDescription
[fetcher]Object用于存储请求状态的对象

Network.usePage(pagination, refresh, [process]) ⇒ object

分页请求

Kind: static method of Network
Returns: object - pagination 分页对象

ParamTypeDescription
paginationobject分页对象
pagination.uristring请求地址
[pagination.params]object请求参数
[pagination.page]number当前页码
pagination.finishedTextstring加载完毕文本
pagination.loadingboolean加载状态
pagination.finishedboolean加载完毕
pagination.errorboolean是否错误
pagination.errorTextstring错误文本
pagination.emptyboolean是否无内容
pagination.itemsarray分页数据
refreshboolean是否刷新
[process]function数据处理函数

Network~get(url, [config]) ⇒ Promise

get请求

Kind: inner method of Network

ParamTypeDescription
url
[config]Objectaxios config

Network~post(url, data, [config]) ⇒ Promise

post请求

Kind: inner method of Network

ParamTypeDescription
urlstring
dataObject
[config]Objectaxios config

Uitls

Uitls.useLabelFromOptionsValue(value, options) ⇒ string

从 options 中根据 value 获取 label

Kind: static method of Uitls

ParamTypeDescription
valuestring | number
optionsArray选项

Uitls.useFindLabelsInValues(options, values, [adapter]) ⇒

从嵌套的 options 中根据 value 获取 label, 如 [1, 3] => ["东", "南"]

Kind: static method of Uitls
Returns: Array

ParamTypeDefaultDescription
optionsArray嵌套的选项
valuesArray需要查找的值
[adapter]Object{value: "value",label: "label",children: "children"}选项适配器

Uitls.useFindLabelsFromPath(options, path, [adapter]) ⇒

从嵌套的 options 中根据 value 获取 label 路径, 如地区路径: [440000, 440100, 440113] => ["广东省", "广州市", " 番禺区"]

Kind: static method of Uitls
Returns: Array

ParamTypeDefaultDescription
optionsArray嵌套的选项
pathArray需要查找的值的路径数组
[adapter]Object{value: "value",label: "label",children: "children"}选项适配器

Uitls.useFindParentLabels(options, value, adapter) ⇒ *

从嵌套的 options 中根据 value 获取 label 路径, 如地区路径: 440113 => ["广东省", "广州市", " 番禺区"]

Kind: static method of Uitls

Param
options
value
adapter

Uitls.useFindParentValues(options, value, adapter) ⇒ *

从嵌套的 options 中根据 value 获取整个 values 路径, 如地区路径: 440113 => [440000, 440100, 440113]

Kind: static method of Uitls

Param
options
value
adapter
Last Updated:
Contributors: sinceow