From 1ccbb80c201e4ddc43fc55f3e8dd8eb4ec7c4967 Mon Sep 17 00:00:00 2001 From: didiyu <1293722656@qq.com> Date: 星期四, 29 十一月 2018 11:29:04 +0800 Subject: [PATCH] 加 --- gx_tieta/WebRoot/pages/js/mylayui.js | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gx_tieta/WebRoot/pages/js/mylayui.js b/gx_tieta/WebRoot/pages/js/mylayui.js index de98aef..5aa35d8 100644 --- a/gx_tieta/WebRoot/pages/js/mylayui.js +++ b/gx_tieta/WebRoot/pages/js/mylayui.js @@ -9,6 +9,7 @@ // 璁剧疆option鐨勬枃鏈�/灞炴�у��/data鍊� option.text(_list.txt); option.val(_list.val); + option.attr('selected', _list.selected); option.data('data', _list.data); Object.keys(_list.attr).forEach(function(key){ var val = _list.attr[key]; @@ -19,7 +20,7 @@ } // 鏋勯�犵敓鎴恠elect鍒楄〃鐨勫璞℃暟缁� -function getLayuiSelect(txt, val, attr, data) { +function getLayuiSelect(txt, val, attr, data, isSelected) { var obj = { val: '', txt: '', @@ -32,7 +33,29 @@ obj.txt = txt; // option鐨勬枃鏈�� obj.attr = attr; // option鐨勮嚜瀹氫箟鐨勫睘鎬� obj.data = data; // option鐨刣ata鍊� + obj.selected = isSelected?true:false; // 杩斿洖鏋勯�犵殑瀵硅薄 return obj; -} \ No newline at end of file +} + +//鏍煎紡鍖栨椂闂� +Date.prototype.format =function(format) +{ + var o = { + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "h+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(format)) format=format.replace(RegExp.$1, + (this.getFullYear()+"").substr(4- RegExp.$1.length)); + for(var k in o)if(new RegExp("("+ k +")").test(format)) + format = format.replace(RegExp.$1, + RegExp.$1.length==1? o[k] : + ("00"+ o[k]).substr((""+ o[k]).length)); + return format; +}; \ No newline at end of file -- Gitblit v1.9.1