增加js
成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、竹山網(wǎng)絡(luò)推廣、小程序設(shè)計(jì)、竹山網(wǎng)絡(luò)營銷、竹山企業(yè)策劃、竹山品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);成都創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供竹山建站搭建服務(wù),24小時(shí)服務(wù)熱線:18982081108,官方網(wǎng)址:www.chinadenli.net
/*---------------------格式化時(shí)間開始--------------------------*/
//對(duì)Date的擴(kuò)展,將 Date 轉(zhuǎn)化為指定格式的String //月(M)、日(d)、小時(shí)(h)、分(m)、秒(s)、季度(q) 可以用 1-2 個(gè)占位符, //年(y)可以用 1-4 個(gè)占位符,毫秒(S)只能用 1 個(gè)占位符(是 1-3 位的數(shù)字) //例子: //(new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 //(new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小時(shí) "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; } var date = new Date();
/*---------------------格式化時(shí)間結(jié)束--------------------------*/
cols: [[ { type: 'numbers', title: '序號(hào)', width: 50 }, { type: 'checkbox' }, { field: 'BILL_NO', title: '單據(jù)編碼', width: 230, }, { field: 'BIZ_STATUS', title: '單據(jù)狀態(tài)', templet: function (d) { return getDictName('COM_BIZ_STATUS', d.BIZ_STATUS); }, width: 100, }, { field: 'RETURN_MSG_CODE', title: '狀態(tài)', width: 100, }, { field: 'UNIT_NAME', title: '創(chuàng)建組織', width: 100, }, { field: 'BUSIN_TYPE_ITEM_NAME', title: '業(yè)務(wù)類別', width: 230, }, { field: 'TITLE', title: '申請(qǐng)單標(biāo)題', width: 280, }, { field: 'CREATE_BY_NAME', title: '創(chuàng)建人姓名', width: 130, }, { field: 'GMT_CREATE', title: '創(chuàng)建時(shí)間', sort: false, templet: function (d) { date.setTime(d.GMT_CREATE); return date.Format("yyyy-MM-dd hh:mm:ss"); }, width: 130, }, { field: 'RETURN_MSG', title: '傳輸云超市返回信息', width: 400, }, ]],
格式化創(chuàng)建時(shí)間
格式化單據(jù)狀態(tài)直接調(diào)用function的方法返回對(duì)應(yīng)的顯示值
以上這篇layui使用templet格式化表格數(shù)據(jù)的方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持創(chuàng)新互聯(lián)。
網(wǎng)頁標(biāo)題:layui使用templet格式化表格數(shù)據(jù)的方法
本文鏈接:http://www.chinadenli.net/article14/iejide.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、虛擬主機(jī)、App開發(fā)、網(wǎng)站策劃、響應(yīng)式網(wǎng)站、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)