Zhiqim UI是一套集成Javascript库、Css库、Font库、常用ico图标等,并在其上开发的大量UI组件组成的前端开发套件。

森中灵 最后提交于3月前 整理V8.0.6
util.htm29KB
<#def title = "工具对象"/>
<#def keyword = "ZhiqimUI"/>
<#def desc = "工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、"/>
<#def prevUrl = "static.htm"/>
<#def nextUrl = "query.htm"/>
${zhiqim_com_head()}
${zhiqim_com_head_main()}
${zhiqim_com_head_end()}

${zhiqim_com_mobileUI_scrollJs()}
${zhiqim_com_body()}
${zhiqim_com_topnav("ui")}

<!--容器开始 -->
<div id="container" class="container">

${zhiqim_com_container_ui("ZmUI", "js", "util")}

<!--主体-->
<div id="mainbody" class="mainbody">

${zhiqim_com_breadcrumb("UI", "ZmUI", "全局JS定义", "工具对象")}

<!-- content开始 -->
<div id="mobileUI_content" class="content">

<!-- 左侧详情 -->
<div class="mobileUI-left">

<#-- 标题 -->
<div class="z-relative-left z-w100p z-pd16 z-bg-blue z-px18 z-lh200p z-bold" style="border-left:5px solid #4bacc6">
    <p class="z-text-blue">工具对象:</p>
    <p class="z-color-333" style="text-indent:38px;">
        工具对象也是静态对象的一种,把一系列常用的静态属性和函数归类到一个工具对象中。目前包括断言工具(Z.A/Z.Asserts)、对象工具(Z.O/Z.Objects)、类型工具(Z.T/Z.Types)、
        验证工具(Z.V/Z.Validates)、表单工具(Z.FM/Z.Forms)、JSON工具(Z.J/Z.Jsons)、日期工具(Z.DT/Z.DateTimes)、数组工具(Z.AR/Z.Arrays)、字符串工具(Z.S/Z.Strings)、算术工具(Z.Maths)、
        金额工具(Z.AM/Z.Amounts)和颜色工具(Z.Colors)。
    </p>
</div>

<#-- 断言工具(Z.A) -->
<div class="tutorial title">断言工具(Z.A/Z.Asserts)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.A.assertNotEmpty(value, message)</td>
    <td rowspan="2">断言不为空</td>
    <td class="z-samp">value</td>
    <td>断言的值</td>
</tr>
<tr>
    <td class="z-samp">message</td>
    <td>断言失败时告警信息</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.A.assertNotEmptyBlank(value, message)</td>
    <td rowspan="2">断言不为空白</td>
    <td class="z-samp">value</td>
    <td>断言的值</td>
</tr>
<tr>
    <td class="z-samp">message</td>
    <td>断言失败时告警信息</td>
</tr>
</table>

<#-- 对象工具(Z.O) -->
<div class="tutorial title">对象工具(Z.O/Z.Objects)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.O.isOwn(obj, prop)</td>
    <td rowspan="2">是否自己的属性<br>Object.prototype.hasOwnProperty</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">prop</td>
    <td>指定的属性名</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.O.isCommon(obj, prop)</td>
    <td rowspan="2">是否普通属性<br>属性名是数字或字符串,属性值非函数的属性</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">prop</td>
    <td>指定的属性名</td>
</tr>
<tr>
    <td class="z-samp">Z.O.toString(obj)</td>
    <td>对象字符串并去掉“[object ”和“]”前后缀<br>Object.prototype.toString</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.O.toStyleString(obj)</td>
    <td>转化为样式风格字符串,分号分隔<br>如:width:100px;height:100px;</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.O.toJSONString(obj)</td>
    <td>转化为JSON字符串<br>如:{width:"100px",height:"100px"}</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
</table>

<#-- ID工具(Z.Ids) -->
<div class="tutorial title">ID工具(Z.Ids)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="*">备注</td>
</tr>
<tr>
    <td class="z-samp">Z.Ids.uuid()</td>
    <td>生成ID</td>
    <td>通过随机数和当前时间生成唯一编号,格式:<br>
      XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX<br>
      1、1-8位随机数<br>
      2、3段4长度的随机数<br>
      3、8位长度时间+4位随机数</td>
</tr>
</table>

<#-- 类型工具(Z.T) -->
<div class="tutorial title">对象工具(Z.T/Z.Types)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isBoolean(obj)</td>
    <td>是否布尔值</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isNumber(obj)</td>
    <td>是否数值类型</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isString(obj)</td>
    <td>是否字符串</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isPrimitive(obj)</td>
    <td>是否基本类型(布尔值或数值类型或字符串)</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isFunction(obj)</td>
    <td>是否函数</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isArray(obj)</td>
    <td>是否数组</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isDate(obj)</td>
    <td>是否日期</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isRegExp(obj)</td>
    <td>是否正则表达式</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isObject(obj)</td>
    <td>是否对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isPlainObject(obj)</td>
    <td>纯对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isLikeArray(obj)</td>
    <td>是否类似数组</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isNull(obj)</td>
    <td>是否为null</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isUndefined(obj)</td>
    <td>是否未定义</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isNaN(obj))</td>   
    <td>是否非数值</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isInfinity(obj)</td>
    <td>是否无限数</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isNonInfinity(obj)</td>
    <td>是否负无限数</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isNil(obj)</td>
    <td>是否无效数(未定义、null、非数值、无限数、负无限数)</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isWindow(obj)</td>
    <td>是否window对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isDocument(obj)</td>
    <td>是否文档对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isElement(obj)</td>
    <td>是否元素对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.T.isArguments(obj)</td>
    <td>是否参数对象</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
</table>

<#-- 验证工具(Z.V) -->
<div class="tutorial title">对象工具(Z.V/Z.Validates)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td colspan="4" class="z-bg-cyan">单字符验证,支持是否是数字、小数、字母、大写字母、小写字母、字母和数字</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDigit(c)</td>
    <td>是否是数字</td>
    <td class="z-samp">c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDot(c)</td>
    <td>单字字符</td>
    <td class="z-samp">c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isColon(c)</td>
    <td>是否是冒号</td>
    <td class="z-samp">c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDigitOrDot(c)</td>
    <td>是否是数字或小数点</td>
    <td class="z-samp">c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDigitOrColon(c)</td>
    <td>是否是数字或冒号<br>如时间表示</td>
    <td class="z-samp">c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isLetter(c)</td>
    <td>是否是字母大小写</td>
    <td>c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isLetterLowercase(c)</td>
    <td>是否是小写字母</td>
    <td>c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isLetterUppercase(c)</td>
    <td>是否是大写字母</td>
    <td>c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isLetterOrDigit(c)</td>
    <td>是否是字母或者数字</td>
    <td>c</td>
    <td>指定的字符</td>
</tr>
<tr>
    <td colspan="4" class="z-bg-cyan">字符串验证,支持是否符合正则表达式、为空、非空、空白、非空白、数值型等</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.V.isRegexp(regexp, s)</td>
    <td rowspan="2">是否是正则表达式</td>
    <td>regexp</td>
    <td>检查是否符合正则表达式规范</td>
</tr>
<tr>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isEmpty(s)</td>
    <td>检查是否为空</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isNotEmpty(s)</td>
    <td>检查是否不为空</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isEmptyBlank(s)</td>
    <td>检查是否为空白(空或长度为0或由空白符构成)</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isNotEmptyBlank(s)</td>
    <td>检查不为空白</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isNumeric(s)</td>
    <td>检查是否为数值字符串</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="3" class="z-samp">Z.V.isNumericLen(s, min, max)</td>
    <td rowspan="3">检查是否为数值字符串且符合长度要求</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">min</td>
    <td>指定的最小长度</td>
</tr>
<tr>
    <td class="z-samp">max</td>
    <td>指定的最大长度</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isInteger(s)</td>
    <td>检查是否为整数</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="3" class="z-samp">Z.V.isIntegerValue(s, min, max)</td>
    <td rowspan="3">检查是否为整数且符合值范围</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">min</td>
    <td>指定的最小值</td>
</tr>
<tr>
    <td class="z-samp">max</td>
    <td>指定的最大值</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isIntegerPositive(s)</td>
    <td>检查是否为正整数</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isFloat(s)</td>
    <td>检查是否为浮点型</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isAmount2R(s)</td>
    <td>检查是否为金额值</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDate(s)</td>
    <td>检查是否为日期</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isTime(s)</td>
    <td>检查是否为时间</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isDateTime(s)</td>
    <td>检查是否为时间,格式为日期+时间</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isEmail(s)</td>
    <td>检查是否为邮件</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isMobile(s)</td>
    <td>检查是否为手机号</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isMobile11(s)</td>
    <td>检查是否为11位手机号</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.V.isContain(strs, separator, s)</td>
    <td rowspan="2">检查是否包含字符串</td>
    <td class="z-samp">strs</td>
    <td>包含的字符串</td>
</tr>
<tr>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td colspan="4" class="z-bg-cyan">其他验证</td>
</tr>
<tr>
    <td class="z-samp">Z.V.isLeapYear(year)</td>
    <td>检查是否闰年</td>
    <td class="z-samp">year</td>
    <td>输入的年份</td>
</tr>
</table>

<#-- 表单工具(Z.FM) -->
<div class="tutorial title">表单工具(Z.FM/Z.Forms)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.FM.clearForm(form)</td>
    <td>清空表单</td>
    <td class="z-samp">form</td>
    <td>指定的表单</td>
</tr>
<tr>
    <td class="z-samp">Z.FM.clearSelect(elem)</td>
    <td>清空选择框的数据</td>
    <td class="z-samp">elem</td>
    <td>指定的选择框</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.FM.isChecked(name, form)</td>
    <td rowspan="2">判断是否选中单选框或多选框</td>
    <td class="z-samp">name</td>
    <td>名称</td>
</tr>
<tr>
    <td class="z-samp">form</td>
    <td>指定的表单,未传入查全部names</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.FM.getChecked(name, form)</td>
    <td rowspan="2">获取被选中单选框和多选框的值</td>
    <td class="z-samp">name</td>
    <td>名称</td>
</tr>
<tr>
    <td class="z-samp">form</td>
    <td>指定的表单,未传入查全部names</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.FM.getCheckBoxValue(name, form)</td>
    <td rowspan="2">获取多选框的值,多个用逗号隔开</td>
    <td class="z-samp">name</td>
    <td>名称</td>
</tr>
<tr>
    <td class="z-samp">form</td>
    <td>指定的表单,未传入查全部names</td>
</tr>
<tr>
    <td rowspan="3" class="z-samp">Z.FM.doSelectCheckBox(name, policy, form)</td>
    <td rowspan="3">全选,反选和取消,三个参数都可以不传入</td>
    <td class="z-samp">name</td>
    <td>名称</td>
</tr>
<tr>
    <td class="z-samp">policy</td>
    <td>指定策略,1表示全选,2表示全取消,0表示反选,未传值默认0</td>
</tr>
<tr>
    <td class="z-samp">form</td>
    <td>指定的表单,未传入查全部names</td>
</tr>
<tr>
    <td rowspan="4" class="z-samp">Z.FM.doSelectCheckBoxTree(name, checked, value, form)</td>
    <td rowspan="4">选择树,选中自己时同时选中所有子节点,和父继承节点</td>
    <td class="z-samp">name</td>
    <td>名称</td>
</tr>
<tr>
    <td class="z-samp">checked</td>
    <td>是否选中,true|false</td>
</tr>
<tr>
    <td class="z-samp">value</td>
    <td>当前选择多选框的值,用于子节点和父节点判断是否对应</td>
</tr>
<tr>
    <td class="z-samp">form</td>
    <td>指定的表单,未传入查全部names</td>
</tr>
</table>

<#-- JSON工具(Z.Jsons) -->
<div class="tutorial title">JSON工具(Z.J/Z.Jsons)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.J.toObject(str)</td>
    <td>返回JSON对象</td>
    <td class="z-samp">str</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.J.toString(obj)</td>
    <td>转化为字符串</td>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.J.toKey(key)</td>
    <td>转为带双引号的KEY字符串</td>
    <td class="z-samp">str</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.J.addEscapeChar(str, quotation)</td>
    <td rowspan="2" >添加转义符</td>
    <td class="z-samp">str</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">quotation</td>
    <td>引号字符,单引号或双引号</td>
</tr>
</table>

<#-- 日期工具(Z.DT) -->
<div class="tutorial title">日期工具(Z.DT/Z.DateTimes)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getDateTimeString()</td>
    <td colspan="3">取得当前的日期时间字符串,格式:yyyy-MM-dd HH:mm:ss</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getDateString()</td>
    <td colspan="3">取得当前的日期时间字符串,格式:yyyy-MM-dd</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getCurrentYear()</td>
    <td colspan="3">获取当前年份</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getCurrentMonth()</td>
    <td colspan="3">获取当前月份</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getCurrentMonthDays()</td>
    <td colspan="3">获取当前月天数</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.getCurrentDay()</td>
    <td colspan="3">获取当前日期</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.DT.getMonthDays(year, month)</td>
    <td rowspan="2">获取指定月天数</td>
    <td class="z-samp">year</td>
    <td>指定的年份(yyyy)</td>
</tr>
<tr>
    <td class="z-samp">month</td>
    <td>指定的月份(1-12)</td>
</tr>
<tr>
    <td rowspan="3" class="z-samp">Z.DT.getDateWeek(year, month, day)</td>
    <td rowspan="3">求星期取值,获取指定时间的星期数:星期一=1;星期二=2;星期三=3;星期四=4;星期五=5;星期六=6;星期日=7</td>
    <td class="z-samp">year</td>
    <td>指定的年份(yyyy)</td>
</tr>
<tr>
    <td class="z-samp">month</td>
    <td>指定的月份(1-12)</td>
</tr>
<tr>
    <td class="z-samp">day</td>
    <td>指定的日期(1-31))</td>
</tr>
<tr>
    <td class="z-samp" class="z-samp">Z.DT.toDateString(date)</td>
    <td>Date对象转换为String<br>格式:“yyyy-MM-dd”<br>
    <td class="z-samp">date</td>
    <td>指定的Date对象</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.toTimeString(date)</td>
    <td>Date对象转换为String<br>格式:“HH:mm:ss”</td>
    <td class="z-samp">date</td>
    <td>指定的Date对象</td>
</tr>
<tr>
    <td class="z-samp">Z.DT.toDateTimeString(date)</td>
    <td>Date对象转换为String<br>格式为:"yyyy-MM-dd HH:mm:ss"</td>
    <td class="z-samp">date</td>
    <td>指定的Date对象</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.DT.toDate (date, time)</td>
    <td rowspan="2">String转为Date对象<br>标准日期格式:"yyyy-MM-dd"<br>标准时间格式:"HH:mm:ss"</td>
    <td class="z-samp">date</td>
    <td>字符串,格式:“yyyy-MM-dd”</td>
</tr>
<tr>
    <td class="z-samp">time</td>
    <td>字符串,格式:“HH:mm:ss”</td>
</tr>
</table>

<#-- 数组工具(Z.AR) -->
<div class="tutorial title">数组工具(Z.AR/Z.Arrays)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.first(objs)</td>
    <td>获取数组中第一个</td>
    <td class="z-samp">objs</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.last(objs)</td>
    <td>获取数组中最后一个</td>
    <td class="z-samp">objs</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.AR.indexOf(objs, obj)</td>
    <td rowspan="2">获取对象在数组中的索引号<br>
    <td class="z-samp">objs</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.AR.contains(objs, obj)</td>
    <td rowspan="2">判断对象是否在数组中<br>
    <td class="z-samp">objs</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.AR.remove(objs, obj)</td>
    <td rowspan="2">从数组中删除指定的对象<br>
    <td class="z-samp">objs</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td class="z-samp">obj</td>
    <td>指定的对象</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.toArray(strs, separator)</td>
    <td>字符串按分隔符转为数组</td>
    <td class="z-samp">strs</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.toObject(strs, separator)</td>
    <td>字符串按分隔符转成对象<br>如:width:100px;max-height:100px;<br>转:{width:"100px",maxHeight:"100px"}<br>注:中杠会去掉并下一字符大写</td>
    <td class="z-samp">strs</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.toString(values, separator)</td>
    <td>数组按分隔符转换成字符串</td>
    <td class="z-samp">values</td>
    <td>指定的数组</td>
</tr>
<tr>
    <td class="z-samp">Z.AR.toJSONString(values)</td>
    <td>转换成JSON字符串</td>
    <td class="z-samp">values</td>
    <td>指定的数组</td>
</tr>
</table>

<#-- 字符串工具(Z.S) -->
<div class="tutorial title"> 字符串工具(Z.S/Z.Strings)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.S.trim(s)</td>
    <td>去掉字符串左边及右边的空格</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.trimLeft(s)</td>
    <td>去掉字符串左边的空格</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.trimRight(s)</td>
    <td>去掉字符串右边的空格</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.S.startWith(str, s)</td>
    <td rowspan="2">字符串str是否以s开始</td>
    <td class="z-samp">str</td>
    <td>原字符串</td>
</tr>
<tr>
    <td class="z-samp">s</td>
    <td>比较字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.S.endWith(str, s)</td>
    <td rowspan="2">字符串str是否以s结尾</td>
    <td class="z-samp">str</td>
    <td>指定的原字符串</td>
</tr>
<tr>
    <td class="z-samp">s</td>
    <td>比较字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.S.equalsIgnoreCase(s1, s2)</td>
    <td rowspan="2">忽略大小写两字符串是否相等</td>
    <td class="z-samp">s1</td>
    <td>指定的字符串1</td>
</tr>
<tr>
    <td class="z-samp">s2</td>
    <td>指定的字符串2</td>
</tr>
<tr>
    <td rowspan="4" class="z-samp">Z.S.replaceAll(s, src, dest, ignoreCase)</td>
    <td rowspan="4">替换字符串,执行全部匹配</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">src</td>
    <td>被替换的字符串</td>
</tr>
<tr>
    <td class="z-samp">dest</td>
    <td>替换后的字符串</td>
</tr>
<tr>
    <td class="z-samp">ignoreCase</td>
    <td>是否忽略大小写,未传入值为false</td>
</tr>
<tr>
    <td class="z-samp">Z.S.lengthUnicode(s)</td>
    <td>转换为Unicode编码长度</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.lengthUnicode35(s)</td>
    <td>转换为Unicode35位编码长度</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.toUTF8(s)</td>
    <td>转换为UTF8编码</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.toHexString(b)</td>
    <td>转换成ASCII字符</td>
    <td class="z-samp">s</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.S.prefixZero(str, len)</td>
    <td rowspan="2">前缀补零,得到给定长度的值,补足0</td>
    <td class="z-samp">str</td>
    <td>初始str</td>
</tr>
<tr>
    <td class="z-samp">len</td>
    <td>指定的长度</td>
</tr>
<tr>
    <td rowspan="3" class="z-samp">Z.S.prefixLen(str, len, prefix)</td>
    <td rowspan="3">前缀补齐,通过给定初始str,和前置char,得到给定长度的值, 通常用于前补0等</td>
    <td class="z-samp">str</td>
    <td>初始str</td>
</tr>
<tr>
    <td class="z-samp">len</td>
    <td>指定的长度</td>
</tr>
<tr>
    <td class="z-samp">prefix</td>
    <td>前置char</td>
</tr>
<tr>
    <td class="z-samp">Z.S.prefixNum(text)</td>
    <td>取前缀数字</td>
    <td class="z-samp">text</td>
    <td>指定的字符串</td>
</tr>
<tr>
    <td class="z-samp">Z.S.prefixZeroRemove(value)</td>
    <td>删除整型的前缀0</td>
    <td class="z-samp">value</td>
    <td>指定的需要删除前缀的数据</td>
</tr>
<tr>
    <td class="z-samp">Z.S.removeSecondDot(value)</td>
    <td>删除小数第二个小数点后面的数据</td>
    <td class="z-samp">value</td>
    <td>指定的数据</td>
</tr>
<tr>
    <td class="z-samp">Z.S.removeAmountZero(value)</td>
    <td>金额抹零</td>
    <td class="z-samp">value</td>
    <td>指定的金额值</td>
</tr>
</table>

<#-- 算术工具(Z.Maths) -->
<div class="tutorial title"> 算术工具(Z.Maths)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.Maths.multiply(m, m2)</td>
    <td rowspan="2">数字相乘</td>
    <td class="z-samp">m</td>
    <td>数字1</td>
</tr>
<tr>
    <td class="z-samp">m2</td>
    <td>数字2</td>
</tr>
</table>

<#-- 金额工具(Z.Amounts) -->
<div class="tutorial title">金额工具(Z.AM/Z.Amounts)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.Amounts.toYuan(amount)</td>
    <td>金额分,转为字符串元,转化后最大2位小数点,没有的不保留小数点</td>
    <td class="z-samp">amount</td>
    <td>金额分值</td>
</tr>
<tr>
    <td class="z-samp">Z.Amounts.toYuanMustRadix(amount)</td>
    <td>金额分,转为字符串元,转化后强制为2位小数点,没有的为.00</td>
    <td class="z-samp">amount</td>
    <td>金额分值</td>
</tr>
<tr>
    <td rowspan="2" class="z-samp">Z.Amounts.toFen(str, defaultValue)</td>
    <td rowspan="2">金额元字符串转int金额分,支持整数、1位小数和2位小数点的金额字符串</td>
    <td class="z-samp">str</td>
    <td>金额元的字符串</td>
</tr>
<tr>
    <td class="z-samp">defaultValue</td>
    <td>缺省值</td>
</tr>
</table>

<#-- 颜色工具(Z.Colors) -->
<div class="tutorial title">颜色工具(Z.Colors)</div>

<table class="z-table z-bordered z-pd10 z-lh200p">
<tr bgcolor="#f5f5f5">
    <td width="30%">函数</td>
    <td width="30%">说明</td>
    <td width="10%">参数</td>
    <td width="*">参数说明</td>
</tr>
<tr>
    <td class="z-samp">Z.Colors.toString(iColor) </td>
    <td>数字的颜色转为字符串十六进制格式(#750848)</td>
    <td class="z-samp">iColor</td>
    <td>指定的颜色</td>
</tr>
<tr>
    <td class="z-samp">Z.Colors.toInt(sColor)</td>
    <td>字符串十六进制(#750848)格式转为数字的颜色</td>
    <td class="z-samp">sColor</td>
    <td>指定的颜色</td>
</tr>
<tr>
    <td class="z-samp">Z.Colors.toArray(color)</td>
    <td>颜色(数字型或字符串#750848)转为红绿蓝数组</td>
    <td class="z-samp">color</td>
    <td>指定的颜色</td>
</tr>
</table>
</div>

<!-- 右侧demo ZmUI代码 -->
${zhiqim_turorial_ZmUI_demo_start()}
<div class="z-bar-top">
    <a href="#" class="z-left"><i class="z-font z-rem18 z-arrowhead-left"></i></a>
    <div class="z-title">ZhiqimUI.mobile</div>
</div>
<div class="z-bar-bottom">
    <a href="#" class="z-direction-column z-active"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a>
    <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a>
    <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a>
    <a href="#" class="z-direction-column"><i class="z-font z-apps"></i><span class="z-mg-t3">文案</span></a>
</div>
<div class="z-container">
    <div class="z-flexBox-list z-h100p"><div class="z-rem30 z-text-center">这里是内容</div></div>
</div>
${zhiqim_turorial_ZmUI_demo_end()}

<!-- content结束 -->
</div>

${zhiqim_com_chapter()}
<!-- 主体结束  -->
</div>

<!-- 容器结束  -->
</div>

${zhiqim_com_footer()}