fix number

This commit is contained in:
Theluyuan 2023-11-03 15:15:50 +08:00
parent 38fb21a80f
commit a4291f1361
4 changed files with 45 additions and 33 deletions

View File

@ -1207,7 +1207,11 @@ const _sfc_main = defineComponent({
tableBodyColumns.value.forEach((tableColumn, columnIndex) => { tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
Object.keys(item).forEach((name) => { Object.keys(item).forEach((name) => {
if (tableColumn.key === name) { if (tableColumn.key === name) {
if (tableColumn.valueType == "str") {
info[name] = item[name]; info[name] = item[name];
} else {
info[name] = isNaN(Number(item[name])) ? item[name] : Number(item[name]);
}
} }
}); });
if (tableColumn.type == "number") { if (tableColumn.type == "number") {

View File

@ -40034,7 +40034,11 @@ const _sfc_main$D = defineComponent({
tableBodyColumns.value.forEach((tableColumn, columnIndex) => { tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
Object.keys(item).forEach((name) => { Object.keys(item).forEach((name) => {
if (tableColumn.key === name) { if (tableColumn.key === name) {
if (tableColumn.valueType == "str") {
info[name] = item[name]; info[name] = item[name];
} else {
info[name] = isNaN(Number(item[name])) ? item[name] : Number(item[name]);
}
} }
}); });
if (tableColumn.type == "number") { if (tableColumn.type == "number") {

View File

@ -453,7 +453,11 @@ const exportData = () => {
// if (rowspan != 0 && colspan != 0) { // if (rowspan != 0 && colspan != 0) {
// tableStr += `<td colspan=${colspan} rowspan=${rowspan}${tableColumn.valueType == 'str' ? ' x:str' : ''}>${item[name] || ''}</td>`; // tableStr += `<td colspan=${colspan} rowspan=${rowspan}${tableColumn.valueType == 'str' ? ' x:str' : ''}>${item[name] || ''}</td>`;
// } // }
if(tableColumn.valueType == "str"){
info[name] = item[name] info[name] = item[name]
}else{
info[name] = isNaN(Number(item[name])) ? item[name] : Number(item[name])
}
} }
}); });

File diff suppressed because one or more lines are too long