rangepicker等时间控件报错(vue3.4以上版本有问题)

pull/1164/head
JEECG 2024-03-28 22:05:49 +08:00
parent 94b38f7689
commit 6f060e456a
1 changed files with 19 additions and 29 deletions

View File

@ -140,39 +140,29 @@
} }
//update-end---author:wangshuai ---date:20230410 forissues/435------------ //update-end---author:wangshuai ---date:20230410 forissues/435------------
if (!Array.isArray(defaultValue)) { if (!Array.isArray(defaultValue)) {
// update-begin--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4
if (Object.prototype.toString.call(defaultValue) === '[object Date]') {
//update-begin---author:wangshuai ---date:20221124 for[issues/215]------------ //update-begin---author:wangshuai ---date:20221124 for[issues/215]------------
if (valueFormat) { if(valueFormat){
schema.defaultValue = dateUtil(defaultValue).format(valueFormat); schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
} else { }else{
schema.defaultValue = dateUtil(defaultValue); schema.defaultValue = dateUtil(defaultValue);
} }
//update-end---author:wangshuai ---date:20221124 for[issues/215]------------ //update-end---author:wangshuai ---date:20221124 for[issues/215]------------
}
// update-end--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4
} else { } else {
// update-begin--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4
let isAssignment = false;
defaultValue.forEach((item) => {
if (Object.prototype.toString.call(item) === '[object Date]') {
isAssignment = true;
}
});
if (isAssignment) {
const def: dayjs.Dayjs[] = []; const def: dayjs.Dayjs[] = [];
defaultValue.forEach((item) => { defaultValue.forEach((item) => {
//update-begin---author:wangshuai ---date:20221124 for[issues/215]------------ //update-begin---author:wangshuai ---date:20221124 for[issues/215]------------
if (valueFormat) { if(valueFormat){
def.push(dateUtil(item).format(valueFormat)); def.push(dateUtil(item).format(valueFormat));
} else { }else{
def.push(dateUtil(item)); def.push(dateUtil(item));
} }
//update-end---author:wangshuai ---date:20221124 for[issues/215]------------ //update-end---author:wangshuai ---date:20221124 for[issues/215]------------
}); });
schema.defaultValue = def; // update-begin--author:liaozhiyang---date:20240328---forissues/1114rangepickervue3.4
} def.forEach((item, index) => {
// update-end--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4 defaultValue[index] = item;
});
// update-end--author:liaozhiyang---date:20240328---forissues/1114rangepickervue3.4
} }
} }
} }