Permalink
Browse files

fix: pro-IUAPDESIGN-66:数字营销:getSimpleData方法会自动将date字符串转换为毫秒数

  • Loading branch information...
whizbz11 committed Oct 27, 2016
1 parent 97b9544 commit bf80d3d0aec9537fc0c6b3df1af099504cbac8c8
Showing with 5 additions and 3 deletions.
  1. +2 −0 js/dataTable/indexDataTable.js
  2. +3 −3 js/dataTable/row-getSimpleData.js
@@ -204,6 +204,8 @@ class DataTable{
this.params = options['params'] || {};
this.master = options['master'] || '';
this.allSelected = ko.observable(false);
//dateNoconvert:true时,时间不转化,按真实走,false是,时间转换成long型
this.dateNoConvert = options['dateNoConvert'];
if (options['root']){
this.root = options['root']
}else{
@@ -29,7 +29,7 @@ const _getSimpleData = function(rowObj, data){
data: data,
key: key
}
_data[key] = rowObj.formatValueFun(obj);
_data[key] = rowObj.formatValueFun(obj,rowObj.parent.dateNoConvert);
}
}
@@ -41,9 +41,9 @@ const _getSimpleData = function(rowObj, data){
}
const formatValueFun = function(obj){
const formatValueFun = function(obj,isDateNoConvert){
var meta = obj.meta,data = obj.data, key = obj.key;
if (meta[key].type == 'date' || meta[key].type == 'datetime') {
if (!isDateNoConvert &&(meta[key].type == 'date' || meta[key].type == 'datetime')) {
return _dateToUTCString(data[key].value)
}
return data[key].value;

0 comments on commit bf80d3d

Please sign in to comment.