fix(qa): ISSUE-009 — 修复指标名称中单位重复显示(如'订单金额(分)(分)')
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -787,7 +787,9 @@ function renderQueryUI() {
|
|||||||
let indHtml = '';
|
let indHtml = '';
|
||||||
for (const d of f.indicators) {
|
for (const d of f.indicators) {
|
||||||
const sel = queryCtx.indicators.find(i => i.fieldCode === d.fieldCode);
|
const sel = queryCtx.indicators.find(i => i.fieldCode === d.fieldCode);
|
||||||
indHtml += '<span class="chip'+(sel?' selected':'')+'" onclick="toggleInd(\''+jsAttr(d.fieldCode)+'\', \''+jsAttr(d.defaultAggregate||'SUM')+'\', \''+jsAttr(d.fieldName||d.fieldCode)+'\')">'+esc(d.fieldName||d.fieldCode)+(d.unit?'('+d.unit+')':'')+'</span>';
|
const fn = esc(d.fieldName||d.fieldCode);
|
||||||
|
const unitSuffix = d.unit && fn.indexOf('('+d.unit+')') === -1 ? '('+d.unit+')' : '';
|
||||||
|
indHtml += '<span class="chip'+(sel?' selected':'')+'" onclick="toggleInd(\''+jsAttr(d.fieldCode)+'\', \''+jsAttr(d.defaultAggregate||'SUM')+'\', \''+jsAttr(d.fieldName||d.fieldCode)+'\')">'+fn+unitSuffix+'</span>';
|
||||||
}
|
}
|
||||||
document.getElementById('indicator-area').innerHTML = indHtml;
|
document.getElementById('indicator-area').innerHTML = indHtml;
|
||||||
renderSelectedIndicators();
|
renderSelectedIndicators();
|
||||||
|
|||||||
Reference in New Issue
Block a user