From 0d930238dd7e5812c087f6da8ab0ea1c778b3b18 Mon Sep 17 00:00:00 2001 From: chiayin Date: Thu, 21 Sep 2023 12:04:58 +0800 Subject: [PATCH] Issue #97: Done. --- src/components/Discover/Conformance/MoreModal.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Discover/Conformance/MoreModal.vue b/src/components/Discover/Conformance/MoreModal.vue index f193c54..218bb5b 100644 --- a/src/components/Discover/Conformance/MoreModal.vue +++ b/src/components/Discover/Conformance/MoreModal.vue @@ -116,11 +116,13 @@ export default { }, columnData: function() { const data = JSON.parse(JSON.stringify(this.cases)); // 深拷貝原始 cases 的內容 + const facetName = facName => facName.trim().replace(/^(.)(.*)$/, (match, firstChar, restOfString) => firstChar.toUpperCase() + restOfString.toLowerCase()); + const result = [ { field: 'id', header: 'Case Id' }, { field: 'started_at', header: 'Start Date' }, { field: 'completed_at', header: 'End Date' }, - ...data[0].facets.map((fac, index) => ({ field: `fac_${index}`, header: fac.name })), + ...data[0].facets.map((fac, index) => ({ field: `fac_${index}`, header: facetName(fac.name) })), ...data[0].attributes.map((att, index) => ({ field: `att_${index}`, header: att.key })), ]; return result