Commit b8080b2b by 傅凯

修复处理函数日期判断不对缺陷

parent 2f40df9c
...@@ -31,6 +31,8 @@ export default class Utils{ ...@@ -31,6 +31,8 @@ export default class Utils{
target[nkey] = obj[key]; target[nkey] = obj[key];
else if(obj[key] instanceof Array) else if(obj[key] instanceof Array)
target[nkey] = obj[key]; target[nkey] = obj[key];
else if(obj[key] instanceof Date)
target[nkey] = obj[key];
else if(typeof obj[key] == "object") else if(typeof obj[key] == "object")
Utils.flatObject(obj[key],target,nkey); //递归赋值 Utils.flatObject(obj[key],target,nkey); //递归赋值
else else
...@@ -60,7 +62,7 @@ export default class Utils{ ...@@ -60,7 +62,7 @@ export default class Utils{
{ {
let leafProp = keyArr[keyArr.length - 1]; let leafProp = keyArr[keyArr.length - 1];
if(tempobj.hasOwnProperty(leafProp)) if(tempobj.hasOwnProperty(leafProp))
tempobj[leafProp]=obj[key]; tempobj[leafProp]=vo[key];
} }
} }
return target; return target;
......
...@@ -10,6 +10,11 @@ export function findCodeLabel(codes,val) ...@@ -10,6 +10,11 @@ export function findCodeLabel(codes,val)
} }
export function dateFormat (date, format) { export function dateFormat (date, format) {
if(!date)
return date
if(typeof date == 'string')
date = new Date(date)
let _format = format || 'yyyy-MM-dd'; let _format = format || 'yyyy-MM-dd';
const d = date; const d = date;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment