diff --git a/packages/bigscreen/designer/config.js b/packages/bigscreen/designer/config.js index 207ef80f..51fe8d55 100644 --- a/packages/bigscreen/designer/config.js +++ b/packages/bigscreen/designer/config.js @@ -313,104 +313,117 @@ export const chartTpl = [{ sourceDataId: '', dynamicData: [] }] -}, { - label: '饼图', type: 'pie', list: [{ - code: 'widget-linechart', - type: 'pieChart2', - config: 'pieChart2', - label: '饼图', - title: '饼图', - icon: 'icontext_box', - value: '', - border: 'border6', - width: 500, - height: 300, - zIndex: 1, - top: 0, - left: 0, - thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', - dataX: '', - dataY: [], - api: '', - apiData: [], - dataType: 'staticData', - staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { - name: '凡哥', - v1: 67, - v2: 25 - }, {name: '党费', v1: 98, v2: 85}], - sourceDataId: '', - dynamicData: [] +}, + { + label: '饼图', type: 'pie', list: [{ + code: 'widget-linechart', + type: 'pieChart2', + config: 'pieChart2', + label: '饼图', + title: '饼图', + icon: 'icontext_box', + value: '', + border: 'border6', + width: 500, + height: 300, + zIndex: 1, + top: 0, + left: 0, + thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', + dataX: '', + dataY: [], + api: '', + apiData: [], + dataType: 'staticData', + staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { + name: '凡哥', + v1: 67, + v2: 25 + }, {name: '党费', v1: 98, v2: 85}], + sourceDataId: '', + dynamicData: [] + }, { + code: 'widget-linechart', + type: 'pieChart1', + label: '饼图', + title: '饼图', + icon: 'icontext_box', + value: '', + border: 'border6', + width: 500, + height: 300, + zIndex: 1, + top: 0, + left: 0, + thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', + dataX: '', + dataY: [], + api: '', + apiData: [], + dataType: 'staticData', + staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { + name: '凡哥', + v1: 67, + v2: 25 + }, {name: '党费', v1: 98, v2: 85}], + config: 'pieChart1', + sourceDataId: '', + dynamicData: [] + }, { + code: 'widget-linechart', + type: 'pieChart3', + label: '饼图', + title: '饼图', + icon: 'icontext_box', + value: '', + border: 'border6', + width: 500, + height: 300, + zIndex: 1, + top: 0, + left: 0, + thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', + dataX: '', + dataY: [], + api: '', + apiData: [], + dataType: 'staticData', + staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { + name: '凡哥', + v1: 67, + v2: 25 + }, {name: '党费', v1: 98, v2: 85}], + config: 'pieChart3', + sourceDataId: '', + dynamicData: [] + }, { + type: 'summary', + label: '进度饼图', + title: '进度饼图', + border: 'border15', + display: 'processPie', + width: 500, + height: 300, + zIndex: 1, + top: 0, + left: 0, + thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/processPieChart.png', + dataType: 'staticData', + staticData: {name: '综合调处率', label: "累计调解成功", v1: 23, totalLabel: "累计排查受理", total: 33}, + },] }, { - code: 'widget-linechart', - type: 'pieChart1', - label: '饼图', - title: '饼图', - icon: 'icontext_box', - value: '', - border: 'border6', - width: 500, - height: 300, - zIndex: 1, - top: 0, - left: 0, - thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', - dataX: '', - dataY: [], - api: '', - apiData: [], - dataType: 'staticData', - staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { - name: '凡哥', - v1: 67, - v2: 25 - }, {name: '党费', v1: 98, v2: 85}], - config: 'pieChart1', - sourceDataId: '', - dynamicData: [] - }, { - code: 'widget-linechart', - type: 'pieChart3', - label: '饼图', - title: '饼图', - icon: 'icontext_box', - value: '', - border: 'border6', - width: 500, - height: 300, - zIndex: 1, - top: 0, - left: 0, - thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/pie.png', - dataX: '', - dataY: [], - api: '', - apiData: [], - dataType: 'staticData', - staticData: [{name: '阿斯达', v1: 23, v2: 33}, {name: '水电费', v1: 12, v2: 34}, { - name: '凡哥', - v1: 67, - v2: 25 - }, {name: '党费', v1: 98, v2: 85}], - config: 'pieChart3', - sourceDataId: '', - dynamicData: [] - }, { - type: 'summary', - label: '进度饼图', - title: '进度饼图', - border: 'border15', - display: 'processPie', - width: 500, - height: 300, - zIndex: 1, - top: 0, - left: 0, - thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/processPieChart.png', - dataType: 'staticData', - staticData: {name: '综合调处率', label: "累计调解成功", v1: 23, totalLabel: "累计排查受理", total: 33}, - },] -}] + label: '关系图', type: 'graph', list: [{ + type: "graphChart1", + label: "气泡图", title: "气泡图", border: 'border15', + width: 500, + height: 300, + top: 0, + left: 0, + dataType: 'staticData', + staticData: [], + thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/graphChart1.png', + }] + }] const maps = [{ type: 'map', label: '地图', diff --git a/ui/dv/AiEchart/echartTpls.js b/ui/dv/AiEchart/echartTpls.js index 30f78cd4..8e91e53d 100644 --- a/ui/dv/AiEchart/echartTpls.js +++ b/ui/dv/AiEchart/echartTpls.js @@ -1,7 +1,9 @@ import pie from "./template/pie" import line from "./template/line"; import bar from "./template/bar"; +import graph from "./template/graph"; export default { - ...bar, ...line, ...pie + ...bar, ...line, ...pie, ...graph } + diff --git a/ui/dv/AiEchart/template/graph.js b/ui/dv/AiEchart/template/graph.js new file mode 100644 index 00000000..e7db5d3a --- /dev/null +++ b/ui/dv/AiEchart/template/graph.js @@ -0,0 +1,31 @@ +import tools from "./tools"; + +const color = ["#18FEFE", "#1890FF"] +export const graphChart1 = { + grid: { + left: 50, right: 0 + }, + xAxis: {show: false}, + yAxis: {show: false}, + tooltip: {}, + color, + daemon: { + type: 'graph', + layout: 'force', + label: { + show: true, position: 'inside', + }, symbol: 'circle', dataRender: (row, i) => ({ + ...row, + symbolSize: Math.max(4, 256 * parseFloat(row.纠纷占比) / 100), + value: row.纠纷占比, + itemStyle: { + borderColor: color[i % 2], + borderWidth: 1, + color: tools.$colorUtils.Hex2RGBA(color[i % 2], .5), + } + }), + } +} +export default { + graphChart1 +} diff --git a/ui/dv/AiEchart/template/line.js b/ui/dv/AiEchart/template/line.js index b653fb7e..e1690c5d 100644 --- a/ui/dv/AiEchart/template/line.js +++ b/ui/dv/AiEchart/template/line.js @@ -1,7 +1,7 @@ import tools from "./tools"; export const lineChart1 = { - legend: { show: false }, + legend: {show: false}, grid: { left: 50, right: 0 @@ -10,17 +10,18 @@ export const lineChart1 = { trigger: 'axis', backgroundColor: 'rgba(14, 51, 111, 0.9)', borderColor: '#1A6ABC', - textStyle: { color: '#fff' }, - axisPointer: { type: 'cross' } + textStyle: {color: '#fff'}, + axisPointer: {type: 'cross'} }, yAxis: { nameGap: 23, minInterval: 1, - splitLine: { lineStyle: { color: 'rgba(255,255,255,.2)', type: 'dashed' } }, - axisLabel: { color: '#fff' }, - axisPointer: { snap: true } + splitLine: {lineStyle: {color: 'rgba(255,255,255,.2)', type: 'dashed'}}, + axisLabel: {color: '#fff'}, + axisPointer: {snap: true} }, daemon: (color) => ({ + type: "line", showSymbol: false, smooth: true, lineStyle: { @@ -36,8 +37,8 @@ export const lineChart1 = { y: 0, y2: 1, colorStops: [ - { offset: 0, color: tools.$colorUtils.Hex2RGBA(color, 0.3) }, - { offset: 1, color: tools.$colorUtils.Hex2RGBA(color, 0.1) } + {offset: 0, color: tools.$colorUtils.Hex2RGBA(color, 0.3)}, + {offset: 1, color: tools.$colorUtils.Hex2RGBA(color, 0.1)} ] } } @@ -56,6 +57,7 @@ export const lineChart2 = { textStyle: {color: '#fff'} }, daemon: color => ({ + type: "line", showSymbol: false, lineStyle: {shadowBlur: 4, shadowOffsetY: 2}, areaStyle: { @@ -81,6 +83,7 @@ export const lineChart3 = { textStyle: {color: '#fff'} }, daemon: { + type: "line", smooth: true, lineStyle: { shadowBlur: 1, @@ -102,13 +105,14 @@ export const lineChart4 = { textStyle: {color: '#fff'} }, daemon: { + type: "line", lineStyle: {shadowBlur: 4, shadowOffsetY: 2}, emphasis: { focus: 'self' } } }; -export const lineChart5 = { +export const lineChart5 = { legend: {show: false}, grid: { left: 50, right: 0, top: 10, bottom: 30 @@ -125,6 +129,7 @@ export const lineChart5 = { axisPointer: {snap: true} }, daemon: color => ({ + type: "line", showSymbol: false, smooth: true, lineStyle: {shadowBlur: 4, shadowOffsetY: 2}, areaStyle: { @@ -145,4 +150,4 @@ export default { lineChart3, lineChart4, lineChart5, -} \ No newline at end of file +} diff --git a/ui/dv/AiLinkageMap.vue b/ui/dv/AiLinkageMap.vue index e375fd7a..8904ce9d 100644 --- a/ui/dv/AiLinkageMap.vue +++ b/ui/dv/AiLinkageMap.vue @@ -63,7 +63,7 @@ export default { const json = JSON.parse(res.param) if (type == "530300000000") { this.geoData = json.map - this.$refs.map.chart?.setOption({series: {data: this.mapData}}) + this.$refs.map?.chart?.setOption({series: {data: this.mapData}}) } this.config.summaryConfigs = json.sta?.map((e, i) => ({pos: ["rt", "lb", 'lt', 'rb'][i % 4], display: "summary20", ...e})) || [] }) diff --git a/ui/packages/tools/AiEchartV2.vue b/ui/packages/tools/AiEchartV2.vue index 2d3419c3..6583502a 100644 --- a/ui/packages/tools/AiEchartV2.vue +++ b/ui/packages/tools/AiEchartV2.vue @@ -1,6 +1,6 @@