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

pull/1164/head
JEECG 2024-03-26 22:16:38 +08:00
parent 8540e8d2ae
commit 9eb7031685
1 changed files with 29 additions and 15 deletions

View File

@ -140,25 +140,39 @@
}
//update-end---author:wangshuai ---date:20230410 forissues/435------------
if (!Array.isArray(defaultValue)) {
//update-begin---author:wangshuai ---date:20221124 for[issues/215]------------
if(valueFormat){
schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
}else{
schema.defaultValue = dateUtil(defaultValue);
}
//update-end---author:wangshuai ---date:20221124 for[issues/215]------------
} else {
const def: dayjs.Dayjs[] = [];
defaultValue.forEach((item) => {
// 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]------------
if(valueFormat){
def.push(dateUtil(item).format(valueFormat));
}else{
def.push(dateUtil(item));
if (valueFormat) {
schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
} else {
schema.defaultValue = dateUtil(defaultValue);
}
//update-end---author:wangshuai ---date:20221124 for[issues/215]------------
}
// update-end--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4
} 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;
}
});
schema.defaultValue = def;
if (isAssignment) {
const def: dayjs.Dayjs[] = [];
defaultValue.forEach((item) => {
//update-begin---author:wangshuai ---date:20221124 for[issues/215]------------
if (valueFormat) {
def.push(dateUtil(item).format(valueFormat));
} else {
def.push(dateUtil(item));
}
//update-end---author:wangshuai ---date:20221124 for[issues/215]------------
});
schema.defaultValue = def;
}
// update-end--author:liaozhiyang---date:20240326---forQQYUN-8696rangepickervue3.4
}
}
}