From 81f182e5bd559daba95ea64e971f7a11a8b2e4d5 Mon Sep 17 00:00:00 2001 From: DK Jang Date: Tue, 17 Dec 2024 13:01:24 -0500 Subject: [PATCH] Dk api test (#820) * temp save * temp save * temp save * tabs with multiple datatables implemented * multi tab data tables completed * Subsection type "api" added. * field_page_mode issue resolved. * BYOR a new option "sub to top" is added to "data convert" option * Data convert "split" updated * BYOR "data convert" option "from parameter" added. * json lines option in BYOR sections component updated --- .../researchPortal/ResearchHeatmap.vue | 1 + .../researchPortal/ResearchSection.vue | 50 +++++++------------ 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/components/researchPortal/ResearchHeatmap.vue b/src/components/researchPortal/ResearchHeatmap.vue index b278c6700..d51af40a8 100644 --- a/src/components/researchPortal/ResearchHeatmap.vue +++ b/src/components/researchPortal/ResearchHeatmap.vue @@ -42,6 +42,7 @@ :sectionId="sectionId" :utils="utils" :ref="sectionId + '_heatmap'" + @mousemove="checkPosition($event)" > diff --git a/src/components/researchPortal/ResearchSection.vue b/src/components/researchPortal/ResearchSection.vue index e6342d224..6138577d1 100644 --- a/src/components/researchPortal/ResearchSection.vue +++ b/src/components/researchPortal/ResearchSection.vue @@ -1499,9 +1499,8 @@ export default Vue.component("research-section", { } else if (!!dataWrappers){ - let tempData = [] - let headers = []; - + let tempData = {} + let headers = {}; dataWrappers.map(dataWrapper => { @@ -1511,54 +1510,41 @@ export default Vue.component("research-section", { dataEntity = dataEntity[w]; }) - headers = headers.concat(dataEntity); + //headers = headers.concat(dataEntity); + headers[dataWrapper["stamp"]] = dataEntity; + //headers[dataWrapper["stamp"]].push("stamp"); }) - let uniqHeaders = [...new Set(headers)]; - - uniqHeaders.push("stamp") - - dataWrappers.map(dataWrapper => { let dataEntity = CONTENT; - dataWrapper["headers"].map(w => { - - dataEntity = dataEntity[w]; - }) - - let tempHeaders = dataEntity; - - dataEntity = CONTENT; dataWrapper["data"].map(w => { dataEntity = dataEntity[w]; }) + tempData[dataWrapper["stamp"]] = dataEntity; + }) - dataEntity.map((item,itemIndex) => { - let tempObj = {} + let mergedData = [] - item.map((column, columnIndex) => { - tempObj[headers[columnIndex]] = column; - }) + dataWrappers.map(dataWrapper => { - tempObj["stamp"] = dataWrapper["stamp"]; + let stamp = dataWrapper["stamp"]; - tempData.push(tempObj); - }) + tempData[stamp].map(item => { + let tempObj = {}; - }) + headers[stamp].map((header, hIndex) => { - let mergedData = []; + tempObj[header] = item[hIndex]; + + }) - tempData.map(d => { - let tempObj = {} - uniqHeaders.map(header => { - tempObj[header] = (!!d[header])? d[header]:""; + tempObj["stamp"] = stamp; + mergedData.push(tempObj) }) - mergedData.push(tempObj); }) data = mergedData;