From 8168c98ba8a67eace38374ad8c5b83f1df06de55 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 24 Apr 2024 14:13:53 +0800 Subject: [PATCH] * Fix bug #48262. --- module/program/config/dtable.php | 2 ++ module/program/js/browse.ui.js | 39 ++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/module/program/config/dtable.php b/module/program/config/dtable.php index 0f0c7669b8..1de53ba177 100644 --- a/module/program/config/dtable.php +++ b/module/program/config/dtable.php @@ -236,6 +236,7 @@ $config->program->browse->dtable->fieldList['budget']['name'] = 'budget'; $config->program->browse->dtable->fieldList['budget']['title'] = $lang->program->budget; $config->program->browse->dtable->fieldList['budget']['width'] = 90; $config->program->browse->dtable->fieldList['budget']['type'] = 'format'; +$config->program->browse->dtable->fieldList['budget']['align'] = 'right'; $config->program->browse->dtable->fieldList['budget']['sortType'] = true; $config->program->browse->dtable->fieldList['budget']['show'] = true; $config->program->browse->dtable->fieldList['budget']['group'] = 3; @@ -245,6 +246,7 @@ $config->program->browse->dtable->fieldList['invested']['title'] = $lang->pro $config->program->browse->dtable->fieldList['invested']['minWidth'] = 70; $config->program->browse->dtable->fieldList['invested']['width'] = 70; $config->program->browse->dtable->fieldList['invested']['type'] = 'format'; +$config->program->browse->dtable->fieldList['invested']['align'] = 'right'; $config->program->browse->dtable->fieldList['invested']['sortType'] = false; $config->program->browse->dtable->fieldList['invested']['show'] = true; $config->program->browse->dtable->fieldList['invested']['group'] = 3; diff --git a/module/program/js/browse.ui.js b/module/program/js/browse.ui.js index f900da44bb..0f428693e3 100644 --- a/module/program/js/browse.ui.js +++ b/module/program/js/browse.ui.js @@ -7,31 +7,36 @@ window.renderCell = function(result, {col, row}) return result; } - if(col.name === 'budget' && typeof(row.data.exceedBudget) != 'undefined') + if(col.name === 'budget') { - let iconSign = ' '; - let menu = ''; - let dropMenu = menu; - dropMenu += '
' + projectBudgetLang + ': ' + row.data.rawBudget + '
'; - dropMenu += '
' + remainingBudgetLang + ': ' + row.data.remainingBudget + '
'; - dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; - - if(row.data.type == 'program') + let budgetHtml = `
${row.data.budget}
`; + if(typeof(row.data.exceedBudget) != 'undefined') { - if(row.data.parent == 0) iconSign = ' '; - dropMenu = menu; - dropMenu += '
' + programBudgetLang + ': ' + row.data.rawBudget + '
'; - dropMenu += '
' + sumSubBudgetLang + ': ' + row.data.subBudget + '
'; - dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; + let iconSign = ' '; + let menu = ''; + let dropMenu = menu; + dropMenu += '
' + projectBudgetLang + ': ' + row.data.rawBudget + '
'; + dropMenu += '
' + remainingBudgetLang + ': ' + row.data.remainingBudget + '
'; + dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; + + if(row.data.type == 'program') + { + if(row.data.parent == 0) iconSign = ' '; + dropMenu = menu; + dropMenu += '
' + programBudgetLang + ': ' + row.data.rawBudget + '
'; + dropMenu += '
' + sumSubBudgetLang + ': ' + row.data.subBudget + '
'; + dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; + } + iconSign = '' + iconSign + ''; + budgetHtml = `
${row.data.budget}${iconSign}${dropMenu}
` } - iconSign = '' + iconSign + ''; - result[0] = {html: '
' + row.data.budget + iconSign + dropMenu + '
', className:'flex items-end w-full items-end', style:{flexDirection:"column"}}; + result[0] = {html: budgetHtml, className:'flex w-full items-end mr-1', style:{flexDirection:"column"}}; return result; } if(col.name === 'invested') { - result[0] = {html: '
' + row.data.invested + ' ' + langManDay + '
', className:'flex items-end w-full items-end', style:{flexDirection:"column"}}; + result[0] = {html: '
' + row.data.invested + ' ' + langManDay + '
', className:'flex w-full items-end', style:{flexDirection:"column"}}; return result; }