From 695631044293071b8933ed37203c8a719833ca81 Mon Sep 17 00:00:00 2001 From: isqianming Date: Sat, 4 Sep 2021 12:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A0=86=E5=8F=A0=E5=9B=BE=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report-ui/src/mixins/queryform.js | 44 +------------------ .../tools/componentsJSON/widget-bar-stack.js | 2 - .../tools/componentsJSON/widget-line-stack.js | 2 - 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/report-ui/src/mixins/queryform.js b/report-ui/src/mixins/queryform.js index 404b5a67..4107c1f8 100644 --- a/report-ui/src/mixins/queryform.js +++ b/report-ui/src/mixins/queryform.js @@ -106,7 +106,6 @@ export default { analysisChartsData(params, data) { // widget-barchart 柱线图、widget-linechart 折线图、 widget-barlinechart 柱线图 // widget-piechart 饼图、widget-funnel 漏斗图 - // widget-gauge 仪表盘 // widget-text 文本框 // widge-table 表格(数据不要转) // widget-stackchart 堆叠图 @@ -170,28 +169,8 @@ export default { const dataField = Object.keys(chartProperties)[types.indexOf('bar')] //x轴数值去重,y轴去重 const xAxisList = this.setUnique(data.map(item => item[xAxisField])) - console.log(xAxisList) const yAxisList = this.setUnique(data.map(item => item[yAxisField])) - console.log(yAxisList) - for (const i in yAxisList) { - const dataArray = new Array(yAxisList.length).fill(0) - for (const j in xAxisList) { - for (const k in data) { - if (data[k][xAxisField] == yAxisList[i] ) { - if (data[k][xAxisField] == xAxisList[j]) { - dataArray[j] = data[k][dataField] - } - } - } - } - series.push({ - name: yAxisList[i], - type: "bar", - data: dataArray, - }) - } - console.log(series) -/* const dataGroup = this.setGroupBy(data, yAxisField) + const dataGroup = this.setGroupBy(data, yAxisField) for (const key in chartProperties) { if (chartProperties[key] !== 'yAxis' && !chartProperties[key].startsWith('xAxis')) { Object.keys(dataGroup).forEach(item => { @@ -206,7 +185,7 @@ export default { }) }) } - }*/ + } ananysicData["xAxis"] = xAxisList; ananysicData["series"] = series; return ananysicData; @@ -228,25 +207,6 @@ export default { } return ananysicData; }, - /*gaugeFn(chartProperties, data) { - const ananysicData = []; - for (let i = 0; i < data.length; i++) { - const obj = {}; - for (const key in chartProperties) { - const value = chartProperties[key]; - if (value === "name") { - obj["name"] = data[i][key]; - } else { - obj["value"] = data[i][key]; - } - } - if (!obj["unit"]) { - obj["unit"] = "%"; - } - ananysicData.push(obj); - } - return ananysicData[0]; - },*/ widgettext(chartProperties, data) { const ananysicData = []; for (let i = 0; i < data.length; i++) { diff --git a/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-bar-stack.js b/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-bar-stack.js index 0f123c57..489108be 100644 --- a/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-bar-stack.js +++ b/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-bar-stack.js @@ -594,10 +594,8 @@ export const widgetBarStack = { {"axis":"2021-07-25","name":"A","data":"12"}, {"axis":"2021-07-25","name":"B","data":"20"}, {"axis":"2021-07-26","name":"B","data":"5"}, - {"axis":"2021-07-26","name":"C","data":"20"}, {"axis":"2021-07-27","name":"A","data":"15"}, {"axis":"2021-07-27","name":"B","data":"30"}, - {"axis":"2021-07-27","name":"C","data":"5"} ], }, { diff --git a/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-line-stack.js b/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-line-stack.js index d6b01a7c..932f30aa 100644 --- a/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-line-stack.js +++ b/report-ui/src/views/report/bigscreen/designer/tools/componentsJSON/widget-line-stack.js @@ -614,10 +614,8 @@ export const widgetLineStack = { {"axis":"2021-07-25","name":"A","data":"12"}, {"axis":"2021-07-25","name":"B","data":"20"}, {"axis":"2021-07-26","name":"B","data":"5"}, - {"axis":"2021-07-26","name":"C","data":"20"}, {"axis":"2021-07-27","name":"A","data":"15"}, {"axis":"2021-07-27","name":"B","data":"30"}, - {"axis":"2021-07-27","name":"C","data":"5"} ], }, {