Commit dd250df7 by zhaochengxiang

bug fix

parent 1a21dbce
......@@ -395,14 +395,13 @@ const ModelTable = (props) => {
if (sortRule) {
if (sortRule.order === 'ascend') {
newData.sort((item1, item2) => {
if (sortRule.field === 'state') {
return (item1[sortRule.field]?.cnName||'').localeCompare(item2[sortRule.field]?.cnName||'');
} else if (sortRule.field === 'modifiedTs') {
return formatDate(item1[sortRule.field]).localeCompare(formatDate(item2[sortRule.field]));
} else if (sortRule.field === 'dataModelUploadDDLResult') {
return (item1[sortRule.field]?.resultType?.name||'').localeCompare(item2[sortRule.field]?.resultType?.name||'');
}
return item1[sortRule.field].localeCompare(item2[sortRule.field]);
})
} else if (sortRule.order === 'descend') {
newData.sort((item1, item2) => {
......@@ -410,6 +409,8 @@ const ModelTable = (props) => {
return (item2[sortRule.field]?.cnName||'').localeCompare(item1[sortRule.field]?.cnName||'');
} else if (sortRule.field === 'modifiedTs') {
return formatDate(item2[sortRule.field]).localeCompare(formatDate(item1[sortRule.field]));
} else if (sortRule.field === 'dataModelUploadDDLResult') {
return (item2[sortRule.field]?.resultType?.name||'').localeCompare(item1[sortRule.field]?.resultType?.name||'');
}
return item2[sortRule.field].localeCompare(item1[sortRule.field]);
......
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