diff --git a/components/AiEchart/template/pie/pieChart2.js b/components/AiEchart/template/pie/pieChart2.js index 767eb932..fcbf9823 100644 --- a/components/AiEchart/template/pie/pieChart2.js +++ b/components/AiEchart/template/pie/pieChart2.js @@ -39,10 +39,11 @@ export default { }, labelLine: {}, labelLayout: function (params) { - let points = params.labelLinePoints, - isLeft = points[2][0] < points[1][0] - points[2][0] = - points[2][0] + (params.labelRect.width + 4) * (isLeft ? -1 : 1) + let points = params.labelLinePoints + if (points) { + const isLeft = points[2][0] < points[1][0] + points[2][0] += (params.labelRect.width + 4) * (isLeft ? -1 : 1) + } return { labelLinePoints: points } @@ -65,32 +66,32 @@ export default { return t + Number(Object.values(e)?.[1] || 0) }, 0) return h( - "div", - { - style: { - height: "162px", - width: "162px", - color: "#8BCCFF", - left: "50%", - top: "50%", - display: "flex", - alignItems: "center", - justifyContent: "center", - flexDirection: "column", - position: "absolute", - transform: "translate(-50%,-50%)", - backgroundImage: `url('https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie2Circle.png')`, - backgroundPosition: "center" - } - }, - [ - h( - "span", - {style: {fontSize: "28px", color: "#fff", fontFamily: "DIN"}}, - formatNum(total) - ), - h("span", null, "总量") - ] + "div", + { + style: { + height: "162px", + width: "162px", + color: "#8BCCFF", + left: "50%", + top: "50%", + display: "flex", + alignItems: "center", + justifyContent: "center", + flexDirection: "column", + position: "absolute", + transform: "translate(-50%,-50%)", + backgroundImage: `url('https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie2Circle.png')`, + backgroundPosition: "center" + } + }, + [ + h( + "span", + {style: {fontSize: "28px", color: "#fff", fontFamily: "DIN"}}, + formatNum(total) + ), + h("span", null, "总量") + ] ) } } diff --git a/components/layout/AiDvPlot/AiDvPlot.vue b/components/layout/AiDvPlot/AiDvPlot.vue index ef04d936..04229680 100644 --- a/components/layout/AiDvPlot/AiDvPlot.vue +++ b/components/layout/AiDvPlot/AiDvPlot.vue @@ -31,7 +31,7 @@ export default { this.handleChangeChart() }, handleChangeChart() { - const series = Array(this.plot.dimensions.length - 1).fill(this.tpl.daemon) + const series = this.tpl.series || Array(this.plot.dimensions.length - 1).fill(this.tpl.daemon) this.chart.setOption({ tooltip: {}, xAxis: { @@ -73,11 +73,20 @@ export default { }, getChartData() { return new DvCompData(this.plot.dataType, this.plot, this.instance).getData().then(source => { - const dataset = { - source, - dimensions: this.plot.dimensions.filter(Boolean) || [] + if (this.tpl.series?.type == 'pie') { + let data + if (source?.length == 1) { + data = this.plot.dimensions.filter(Boolean).map(name => ({name, value: source[0][name]})) + } else { + const ds = this.plot.dimensions.filter(Boolean) + data = source.map(e => ({name: e[ds[0]], value: e[ds[1]]})) + } + this.chart.setOption({series: {data}}) + } else { + const dataset = {source} + dataset.dimensions = this.plot.dimensions.filter(Boolean) || [] + this.chart.setOption({dataset}) } - this.chart.setOption({dataset}) }) } }, diff --git a/components/layout/AiDvSummary/components/Summary5.vue b/components/layout/AiDvSummary/components/Summary5.vue index b52050f4..bb8297d3 100644 --- a/components/layout/AiDvSummary/components/Summary5.vue +++ b/components/layout/AiDvSummary/components/Summary5.vue @@ -76,7 +76,7 @@ export default { display: flex; position: relative; align-items: center; - backdrop-filter: blur(1px); + backdrop-filter: blur(5px); .right { min-width: 90px; diff --git a/packages/bigscreen/designer/components/DataConfig.vue b/packages/bigscreen/designer/components/DataConfig.vue index 6da43b4f..58c27eeb 100644 --- a/packages/bigscreen/designer/components/DataConfig.vue +++ b/packages/bigscreen/designer/components/DataConfig.vue @@ -24,7 +24,7 @@ -