From 99285fcc7d30e62f1e84e1c96d29d0ffcd9ccdbc Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.30> Date: 星期三, 14 十一月 2018 17:33:27 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- 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