From abd6a7aa0129bb54a1f13e31ff59cc2e99b2bc90 Mon Sep 17 00:00:00 2001 From: qianming Date: Fri, 20 Aug 2021 14:00:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=A0=86=E5=8F=A0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/report/bigscreen/designer/tools.js | 663 ++++++++++++++++++ .../widget/bar/widgetBarStackChart.vue | 116 +-- .../widget/line/widgetLineStackChart.vue | 443 ++++++++++++ .../report/bigscreen/designer/widget/temp.vue | 5 +- .../bigscreen/designer/widget/widget.vue | 4 +- 5 files changed, 1171 insertions(+), 60 deletions(-) diff --git a/report-ui/src/views/report/bigscreen/designer/tools.js b/report-ui/src/views/report/bigscreen/designer/tools.js index 890c2fb1..35442d37 100644 --- a/report-ui/src/views/report/bigscreen/designer/tools.js +++ b/report-ui/src/views/report/bigscreen/designer/tools.js @@ -6246,6 +6246,669 @@ const widgetTools = [ ], ], // 数据 + data: [ + { + type: 'el-radio-group', + label: '数据类型', + name: 'dataType', + require: false, + placeholder: '', + selectValue: true, + selectOptions: [ + { + code: 'staticData', + name: '静态数据', + }, + { + code: 'dynamicData', + name: '动态数据', + }, + ], + value: 'staticData', + }, + { + type: 'el-input-number', + label: '刷新时间(毫秒)', + name: 'refreshTime', + relactiveDom: 'dataType', + relactiveDomValue: 'dynamicData', + value: 5000 + }, + { + type: 'el-button', + label: '静态数据', + name: 'staticData', + required: false, + placeholder: 'px', + relactiveDom: 'dataType', + relactiveDomValue: 'staticData', + value: [ + {"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"} + ], + }, + { + type: 'dycustComponents', + label: '', + name: 'dynamicData', + required: false, + placeholder: 'px', + relactiveDom: 'dataType', + relactiveDomValue: 'dynamicData', + chartType: 'widget-stackchart', + value: '', + }, + ], + // 坐标 + position: [ + { + type: 'el-input-number', + label: '左边距', + name: 'left', + required: false, + placeholder: 'px', + value: 0, + }, + { + type: 'el-input-number', + label: '上边距', + name: 'top', + required: false, + placeholder: 'px', + value: 0, + }, + { + type: 'el-input-number', + label: '宽度', + name: 'width', + required: false, + placeholder: '该容器在1920px大屏中的宽度', + value: 400, + }, + { + type: 'el-input-number', + label: '高度', + name: 'height', + required: false, + placeholder: '该容器在1080px大屏中的高度', + value: 200, + }, + ], + }, + }, + { + code: 'widgetLineStackChart', + type: 'chart', + label: '折线堆叠图', + icon: 'iconduidietu', + options: { + // 配置 + setup: [ + { + type: 'el-input-text', + label: '图层名称', + name: 'layerName', + required: false, + placeholder: '', + value: '折线堆叠图', + }, + { + type: 'el-switch', + label: '竖展示', + name: 'verticalShow', + required: false, + placeholder: '', + value: false, + }, + { + type: 'vue-color', + label: '背景颜色', + name: 'background', + required: false, + placeholder: '', + value: '' + }, + [ + { + name: '折线设置', + list: [ + { + type: 'el-switch', + label: '标记点', + name: 'markPoint', + required: false, + placeholder: '', + value: true, + }, + { + type: 'el-slider', + label: '点大小', + name: 'pointSize', + required: false, + placeholder: '', + value: 10, + }, + { + type: 'el-switch', + label: '平滑曲线', + name: 'smoothCurve', + required: false, + placeholder: '', + value: true, + }, + { + type: 'el-switch', + label: '面积堆积', + name: 'area', + required: false, + placeholder: '', + value: true, + }, + { + type: 'el-slider', + label: '面积厚度', + name: 'areaThickness', + required: false, + placeholder: '', + value: 5, + }, + { + type: 'el-slider', + label: '线条宽度', + name: 'lineWidth', + required: false, + placeholder: '', + value: 4, + }, + ], + }, + { + name: '标题设置', + list: [ + { + type: 'el-switch', + label: '标题', + name: 'isNoTitle', + required: false, + placeholder: '', + value: true, + }, + { + type: 'el-input-text', + label: '标题', + name: 'titleText', + required: false, + placeholder: '', + value: '', + }, + { + type: 'vue-color', + label: '字体颜色', + name: 'textColor', + required: false, + placeholder: '', + value: '#FFD700' + }, + { + type: 'el-select', + label: '字体粗细', + name: 'textFontWeight', + required: false, + placeholder: '', + selectOptions: [ + {code: 'normal', name: '正常'}, + {code: 'bold', name: '粗体'}, + {code: 'bolder', name: '特粗体'}, + {code: 'lighter', name: '细体'} + ], + value: 'normal' + }, + { + type: 'el-input-number', + label: '字体大小', + name: 'textFontSize', + required: false, + placeholder: '', + value: 20 + }, + { + type: 'el-select', + label: '字体位置', + name: 'textAlign', + required: false, + placeholder: '', + selectOptions: [ + {code: 'center', name: '居中'}, + {code: 'left', name: '左对齐'}, + {code: 'right', name: '右对齐'}, + ], + value: 'center' + }, + { + type: 'el-input-text', + label: '副标题', + name: 'subText', + required: false, + placeholder: '', + value: '' + }, + { + type: 'vue-color', + label: '字体颜色', + name: 'subTextColor', + required: false, + placeholder: '', + value: 'rgba(30, 144, 255, 1)' + }, + { + type: 'el-select', + label: '字体粗细', + name: 'subTextFontWeight', + required: false, + placeholder: '', + selectOptions: [ + {code: 'normal', name: '正常'}, + {code: 'bold', name: '粗体'}, + {code: 'bolder', name: '特粗体'}, + {code: 'lighter', name: '细体'} + ], + value: 'normal' + }, + { + type: 'el-input-number', + label: '字体大小', + name: 'subTextFontSize', + required: false, + placeholder: '', + value: 20 + }, + ], + }, + { + name: 'X轴设置', + list: [ + { + type: 'el-switch', + label: '显示', + name: 'hideX', + required: false, + placeholder: '', + value: true, + }, + { + type: 'el-input-text', + label: 'X轴别名', + name: 'xName', + required: false, + placeholder: '', + value: '' + }, + { + type: 'vue-color', + label: '别名颜色', + name: 'xNameColor', + required: false, + placeholder: '', + value: '#fff' + }, + { + type: 'el-input-number', + label: '别名字号', + name: 'xNameFontSize', + required: false, + placeholder: '', + value: 14 + }, + { + type: 'el-switch', + label: '轴反转', + name: 'reversalX', + required: false, + placeholder: '', + value: false + }, + { + type: 'el-slider', + label: '文字角度', + name: 'textAngleX', + required: false, + placeholder: '', + value: 0 + }, + { + type: 'el-input-number', + label: '文字间隔', + name: 'textInterval', + required: false, + placeholder: '', + value: '' + }, + { + type: 'vue-color', + label: '文字颜色', + name: 'Xcolor', + required: false, + placeholder: '', + value: '#fff', + }, + { + type: 'el-input-number', + label: '文字字号', + name: 'fontSizeX', + required: false, + placeholder: '', + value: 14, + }, + { + type: 'vue-color', + label: '轴颜色', + name: 'lineColorX', + required: false, + placeholder: '', + value: '#fff', + }, + { + type: 'el-switch', + label: '分割线显示', + name: 'isShowSplitLineX', + require: false, + placeholder: '', + value: false, + }, + { + type: 'vue-color', + label: '分割线颜色', + name: 'splitLineColorX', + required: false, + placeholder: '', + value: '#fff', + + } + ], + }, + { + name: 'Y轴设置', + list: [ + { + type: 'el-switch', + label: '显示', + name: 'isShowY', + require: false, + placeholder: '', + value: true, + }, + { + type: 'el-input-text', + label: 'Y轴别名', + name: 'textNameY', + require: false, + placeholder: '', + value: '' + }, + { + type: 'vue-color', + label: '别名颜色', + name: 'NameColorY', + required: false, + placeholder: '', + value: '#fff', + }, + { + type: 'el-input-number', + label: '别名字号', + name: 'NameFontSizeY', + required: false, + placeholder: '', + value: 14, + }, + { + type: 'el-switch', + label: '轴反转', + name: 'reversalY', + required: false, + placeholder: '', + value: false + }, + { + type: 'el-slider', + label: '文字角度', + name: 'textAngleY', + required: false, + placeholder: '', + value: 0 + }, + { + type: 'vue-color', + label: '文字颜色', + name: 'colorY', + required: false, + placeholder: '', + value: '#fff', + }, + { + type: 'el-input-number', + label: '文字字号', + name: 'fontSizeY', + required: false, + placeholder: '', + value: 14, + }, + { + type: 'vue-color', + label: '轴颜色', + name: 'lineColorY', + required: false, + placeholder: '', + value: '#fff', + }, { + type: 'el-switch', + label: '分割线显示', + name: 'isShowSplitLineY', + require: false, + placeholder: '', + value: false, + }, { + type: 'vue-color', + label: '分割线颜色', + name: 'splitLineColorY', + required: false, + placeholder: '', + value: '#fff', + + } + ], + }, + { + name: '数值设定', + list: [ + { + type: 'el-switch', + label: '显示', + name: 'isShow', + required: false, + placeholder: '', + value: false + }, + { + type: 'el-input-number', + label: '字体大小', + name: 'fontSize', + required: false, + placeholder: '', + value: 14 + }, + { + type: 'vue-color', + label: '字体颜色', + name: 'subTextColor', + required: false, + placeholder: '', + value: '#fff' + }, + { + type: 'el-select', + label: '字体粗细', + name: 'fontWeight', + required: false, + placeholder: '', + selectOptions: [ + {code: 'normal', name: '正常'}, + {code: 'bold', name: '粗体'}, + {code: 'bolder', name: '特粗体'}, + {code: 'lighter', name: '细体'} + ], + value: 'normal' + }, + ], + }, + { + name: '提示语设置', + list: [ + { + type: 'el-input-number', + label: '字体大小', + name: 'tipsFontSize', + required: false, + placeholder: '', + value: 16 + }, + { + type: 'vue-color', + label: '字体颜色', + name: 'lineColor', + required: false, + placeholder: '', + }, + ], + }, + { + name: '坐标轴边距设置', + list: [ + { + type: 'el-slider', + label: '左边距(像素)', + name: 'marginLeft', + required: false, + placeholder: '', + value: 10, + }, { + type: 'el-slider', + label: '顶边距(像素)', + name: 'marginTop', + required: false, + placeholder: '', + value: 50, + }, { + type: 'el-slider', + label: '右边距(像素)', + name: 'marginRight', + required: false, + placeholder: '', + value: 40, + }, { + type: 'el-slider', + label: '底边距(像素)', + name: 'marginBottom', + required: false, + placeholder: '', + value: 10, + }, + ], + }, + { + name: '图例操作', + list: [ + { + type: 'el-switch', + label: '显示', + name: 'isShowLegend', + required: false, + placeholder: '', + value: true, + }, + { + type: 'vue-color', + label: '字体颜色', + name: 'lengedColor', + required: false, + placeholder: '', + value: '#fff', + }, + { + type: 'el-input-number', + label: '字体大小', + name: 'lengedFontSize', + required: false, + placeholder: '', + value: 16, + }, + { + type: 'el-input-number', + label: '图例宽度', + name: 'lengedWidth', + required: false, + placeholder: '', + value: 15, + }, + { + type: 'el-select', + label: '横向位置', + name: 'lateralPosition', + required: false, + placeholder: '', + selectOptions: [ + {code: 'center', name: '居中'}, + {code: 'left', name: '左对齐'}, + {code: 'right', name: '右对齐'}, + ], + value: 'center' + }, + { + type: 'el-select', + label: '纵向位置', + name: 'longitudinalPosition', + required: false, + placeholder: '', + selectOptions: [ + {code: 'top', name: '顶部'}, + {code: 'bottom', name: '底部'}, + ], + value: 'top' + }, + { + type: 'el-select', + label: '布局前置', + name: 'layoutFront', + required: false, + placeholder: '', + selectOptions: [ + {code: 'vertical', name: '竖排'}, + {code: 'horizontal', name: '横排'}, + ], + value: 'horizontal' + }, + ], + }, + { + name: '自定义配色', + list: [ + { + type: 'customColor', + label: '', + name: 'customColor', + required: false, + value: [{color: '#ff7f50'}, {color: '#87cefa'}, {color: '#da70d6'}, {color: '#32cd32'}, {color: '#6495ed'}], + }, + ], + }, + ], + ], + // 数据 data: [ { type: 'el-radio-group', diff --git a/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue b/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue index 2be42d57..86423522 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue @@ -103,56 +103,56 @@ export default { }, // 标题修改 setOptionsTitle() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const title = {}; - title.text = optionsCollapse.titleText; - title.show = optionsCollapse.isNoTitle; - title.left = optionsCollapse.textAlign; + title.text = optionsSetup.titleText; + title.show = optionsSetup.isNoTitle; + title.left = optionsSetup.textAlign; title.textStyle = { - color: optionsCollapse.textColor, - fontSize: optionsCollapse.textFontSize, - fontWeight: optionsCollapse.textFontWeight + color: optionsSetup.textColor, + fontSize: optionsSetup.textFontSize, + fontWeight: optionsSetup.textFontWeight }; - title.subtext = optionsCollapse.subText; + title.subtext = optionsSetup.subText; title.subtextStyle = { - color: optionsCollapse.subTextColor, - fontWeight: optionsCollapse.subTextFontWeight, - fontSize: optionsCollapse.subTextFontSize + color: optionsSetup.subTextColor, + fontWeight: optionsSetup.subTextFontWeight, + fontSize: optionsSetup.subTextFontSize }; this.options.title = title; }, // X轴设置 setOptionsX() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const xAxis = { type: "category", - show: optionsCollapse.hideX, // 坐标轴是否显示 - name: optionsCollapse.xName, // 坐标轴名称 + show: optionsSetup.hideX, // 坐标轴是否显示 + name: optionsSetup.xName, // 坐标轴名称 nameTextStyle: { - color: optionsCollapse.xNameColor, - fontSize: optionsCollapse.xNameFontSize + color: optionsSetup.xNameColor, + fontSize: optionsSetup.xNameFontSize }, - nameRotate: optionsCollapse.textAngleX, // 文字角度 - inverse: optionsCollapse.reversalX, // 轴反转 + nameRotate: optionsSetup.textAngleX, // 文字角度 + inverse: optionsSetup.reversalX, // 轴反转 axisLabel: { show: true, - interval: optionsCollapse.textInterval, // 文字角度 - rotate: optionsCollapse.textAngle, // 文字角度 + interval: optionsSetup.textInterval, // 文字角度 + rotate: optionsSetup.textAngle, // 文字角度 textStyle: { - color: optionsCollapse.Xcolor, // x轴 坐标文字颜色 - fontSize: optionsCollapse.fontSizeX + color: optionsSetup.Xcolor, // x轴 坐标文字颜色 + fontSize: optionsSetup.fontSizeX } }, axisLine: { show: true, lineStyle: { - color: optionsCollapse.lineColorX + color: optionsSetup.lineColorX } }, splitLine: { - show: optionsCollapse.isShowSplitLineX, + show: optionsSetup.isShowSplitLineX, lineStyle: { - color: optionsCollapse.splitLineColorX + color: optionsSetup.splitLineColorX } } }; @@ -160,34 +160,34 @@ export default { }, // Y轴设置 setOptionsY() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const yAxis = { type: "value", - show: optionsCollapse.isShowY, // 坐标轴是否显示 - name: optionsCollapse.textNameY, // 坐标轴名称 + show: optionsSetup.isShowY, // 坐标轴是否显示 + name: optionsSetup.textNameY, // 坐标轴名称 nameTextStyle: { - color: optionsCollapse.NameColorY, - fontSize: optionsCollapse.NameFontSizeY + color: optionsSetup.NameColorY, + fontSize: optionsSetup.NameFontSizeY }, - inverse: optionsCollapse.reversalY, // y轴反转 + inverse: optionsSetup.reversalY, // y轴反转 axisLabel: { show: true, - rotate: optionsCollapse.textAngleY,// 文字角度 + rotate: optionsSetup.textAngleY,// 文字角度 textStyle: { - color: optionsCollapse.colorY, // y轴 坐标文字颜色 - fontSize: optionsCollapse.fontSizeY + color: optionsSetup.colorY, // y轴 坐标文字颜色 + fontSize: optionsSetup.fontSizeY } }, axisLine: { show: true, lineStyle: { - color: optionsCollapse.lineColorY + color: optionsSetup.lineColorY } }, splitLine: { - show: optionsCollapse.isShowSplitLineY, + show: optionsSetup.isShowSplitLineY, lineStyle: { - color: optionsCollapse.splitLineColorY + color: optionsSetup.splitLineColorY } } }; @@ -195,44 +195,44 @@ export default { }, // tooltip 提示语设置,鼠标放置显示 setOptionsTooltip() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const tooltip = { trigger: "item", show: true, textStyle: { - color: optionsCollapse.lineColor, - fontSize: optionsCollapse.tipsFontSize + color: optionsSetup.lineColor, + fontSize: optionsSetup.tipsFontSize } }; this.options.tooltip = tooltip; }, // 边距设置 setOptionsMargin() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const grid = { - left: optionsCollapse.marginLeft, - right: optionsCollapse.marginRight, - bottom: optionsCollapse.marginBottom, - top: optionsCollapse.marginTop, + left: optionsSetup.marginLeft, + right: optionsSetup.marginRight, + bottom: optionsSetup.marginBottom, + top: optionsSetup.marginTop, containLabel: true }; this.options.grid = grid; }, // 图例操作 legend setOptionsLegend() { - const optionsCollapse = this.optionsSetup; + const optionsSetup = this.optionsSetup; const legend = this.options.legend; - legend.show = optionsCollapse.isShowLegend; - legend.left = optionsCollapse.lateralPosition; - legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto"; + legend.show = optionsSetup.isShowLegend; + legend.left = optionsSetup.lateralPosition; + legend.top = optionsSetup.longitudinalPosition == "top" ? 0 : "auto"; legend.bottom = - optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto"; - legend.orient = optionsCollapse.layoutFront; + optionsSetup.longitudinalPosition == "bottom" ? 0 : "auto"; + legend.orient = optionsSetup.layoutFront; legend.textStyle = { - color: optionsCollapse.lengedColor, - fontSize: optionsCollapse.lengedFontSize + color: optionsSetup.lengedColor, + fontSize: optionsSetup.lengedFontSize }; - legend.itemWidth = optionsCollapse.lengedWidth; + legend.itemWidth = optionsSetup.lengedWidth; }, // 数据解析 setOptionsData() { @@ -310,9 +310,9 @@ export default { }, //颜色,圆角属性 itemStyle: { - normal : { + normal: { color: arrColor[i], - barBorderRadius : optionsSetup.radius, + barBorderRadius: optionsSetup.radius, } } }) @@ -387,9 +387,9 @@ export default { }, //颜色,圆角属性 itemStyle: { - normal : { + normal: { color: arrColor[i], - barBorderRadius : optionsSetup.radius, + barBorderRadius: optionsSetup.radius, } } }) diff --git a/report-ui/src/views/report/bigscreen/designer/widget/line/widgetLineStackChart.vue b/report-ui/src/views/report/bigscreen/designer/widget/line/widgetLineStackChart.vue index e69de29b..aa8f15fb 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/line/widgetLineStackChart.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/line/widgetLineStackChart.vue @@ -0,0 +1,443 @@ + + + + + diff --git a/report-ui/src/views/report/bigscreen/designer/widget/temp.vue b/report-ui/src/views/report/bigscreen/designer/widget/temp.vue index cd5b12ed..2b1e121a 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/temp.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/temp.vue @@ -32,6 +32,8 @@ import widgetMap from "./widgetMap.vue"; import widgetPiePercentageChart from "./pie/widgetPiePercentageChart"; import widgetAirBubbleMap from "./map/widgetAirBubbleMap"; import widgetBarStackChart from "./bar/widgetBarStackChart"; +import widgetLineStackChart from "./line/widgetLineStackChart"; + export default { name: "WidgetTemp", components: { @@ -55,7 +57,8 @@ export default { widgetMap, widgetPiePercentageChart, widgetAirBubbleMap, - widgetBarStackChart + widgetBarStackChart, + widgetLineStackChart }, model: { prop: "value", diff --git a/report-ui/src/views/report/bigscreen/designer/widget/widget.vue b/report-ui/src/views/report/bigscreen/designer/widget/widget.vue index ef15fc23..2096bac2 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/widget.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/widget.vue @@ -42,6 +42,7 @@ import widgetMap from "./widgetMap.vue"; import widgetPiePercentageChart from "./pie/widgetPiePercentageChart"; import widgetAirBubbleMap from "./map/widgetAirBubbleMap"; import widgetBarStackChart from "./bar/widgetBarStackChart"; +import widgetLineStackChart from "./line/widgetLineStackChart"; export default { name: "Widget", @@ -66,7 +67,8 @@ export default { widgetMap, widgetPiePercentageChart, widgetAirBubbleMap, - widgetBarStackChart + widgetBarStackChart, + widgetLineStackChart }, model: { prop: "value",