Commit aa47f1aa1aedccba271285ed4ed8ef23d2d41088

Authored by qianbao
1 parent 02379a24

1、添加锥形柱图

src/views/bigscreenDesigner/designer/tools/configure/funnelCharts/widget-conical-column-chart.js 0 → 100644
  1 +/*
  2 + * @Descripttion: 锥形柱图
  3 + */
  4 +export const widgetConicalColumnChart = {
  5 + code: 'widget-conical-column-chart',
  6 + type: 'funnel',
  7 + tabName: '漏斗图',
  8 + label: '锥形柱图',
  9 + icon: 'iconloudoutu',
  10 + options: {
  11 + // 配置
  12 + setup: [
  13 + {
  14 + type: 'el-input-text',
  15 + label: '图层名称',
  16 + name: 'layerName',
  17 + required: false,
  18 + placeholder: '',
  19 + value: '漏斗图',
  20 + },
  21 + {
  22 + type: 'vue-color',
  23 + label: '背景颜色',
  24 + name: 'background',
  25 + required: false,
  26 + placeholder: '',
  27 + value: ''
  28 + },
  29 + {
  30 + type: 'el-switch',
  31 + label: '显示数值',
  32 + name: 'showValue',
  33 + require: false,
  34 + placeholder: '',
  35 + value: false,
  36 + },
  37 + {
  38 + type: 'el-input-number',
  39 + label: '字体字号',
  40 + name: 'fontSize',
  41 + required: false,
  42 + placeholder: '',
  43 + value: 20
  44 + },
  45 + {
  46 + type: 'el-switch',
  47 + label: '图片显示',
  48 + name: 'showImg',
  49 + require: false,
  50 + placeholder: '',
  51 + value: true,
  52 + },
  53 + {
  54 + type: 'el-input-number',
  55 + label: '图片边长',
  56 + name: 'imgSideLength',
  57 + required: false,
  58 + placeholder: '',
  59 + value: 30
  60 + },
  61 + {
  62 + type: 'vue-color',
  63 + label: '柱颜色',
  64 + name: 'columnColor',
  65 + required: false,
  66 + placeholder: '',
  67 + value: 'rgba(0, 194, 255, 0.4)'
  68 + },
  69 + {
  70 + type: 'vue-color',
  71 + label: '文字颜色',
  72 + name: 'textColor',
  73 + required: false,
  74 + placeholder: '',
  75 + value: '#fff'
  76 + }
  77 + ],
  78 + // 数据
  79 + data: [
  80 + {
  81 + type: 'el-radio-group',
  82 + label: '数据类型',
  83 + name: 'dataType',
  84 + require: false,
  85 + placeholder: '',
  86 + selectValue: true,
  87 + selectOptions: [
  88 + {
  89 + code: 'staticData',
  90 + name: '静态数据',
  91 + },
  92 + {
  93 + code: 'dynamicData',
  94 + name: '动态数据',
  95 + },
  96 + ],
  97 + value: 'staticData',
  98 + },
  99 + {
  100 + type: 'el-input-number',
  101 + label: '刷新时间(毫秒)',
  102 + name: 'refreshTime',
  103 + relactiveDom: 'dataType',
  104 + relactiveDomValue: 'dynamicData',
  105 + value: 5000
  106 + },
  107 + {
  108 + type: 'el-button',
  109 + label: '静态数据',
  110 + name: 'staticData',
  111 + required: false,
  112 + placeholder: '',
  113 + relactiveDom: 'dataType',
  114 + relactiveDomValue: 'staticData',
  115 + value: [
  116 + {
  117 + name: '周口',
  118 + value: 55,
  119 + // img:'/static/images/conicalColumnChart/1st.png'
  120 + },
  121 + {
  122 + name: '南阳',
  123 + value: 120,
  124 + // img:'/static/images/conicalColumnChart/2st.png'
  125 + },
  126 + {
  127 + name: '西峡',
  128 + value: 71,
  129 + // img:'/static/images/conicalColumnChart/3st.png'
  130 + },
  131 + {
  132 + name: '驻马店',
  133 + value: 66,
  134 + // img:'/static/images/conicalColumnChart/4st.png'
  135 + },
  136 + {
  137 + name: '新乡',
  138 + value: 80,
  139 + // img:'/static/images/conicalColumnChart/5st.png'
  140 + },
  141 + {
  142 + name: '信阳',
  143 + value: 35,
  144 + // img:'/static/images/conicalColumnChart/6st.png'
  145 + },
  146 + {
  147 + name: '漯河',
  148 + value: 15,
  149 + // img:'/static/images/conicalColumnChart/7st.png'
  150 + }
  151 + ],
  152 + },
  153 + {
  154 + type: 'dycustComponents',
  155 + label: '',
  156 + name: 'dynamicData',
  157 + required: false,
  158 + placeholder: '',
  159 + relactiveDom: 'dataType',
  160 + chartType: 'widget-funnel',
  161 + relactiveDomValue: 'dynamicData',
  162 + dictKey: 'PIE_PROPERTIES',
  163 + value: '',
  164 + },
  165 + ],
  166 + // 坐标
  167 + position: [
  168 + {
  169 + type: 'el-input-number',
  170 + label: '左边距',
  171 + name: 'left',
  172 + required: false,
  173 + placeholder: '',
  174 + value: 0,
  175 + },
  176 + {
  177 + type: 'el-input-number',
  178 + label: '上边距',
  179 + name: 'top',
  180 + required: false,
  181 + placeholder: '',
  182 + value: 0,
  183 + },
  184 + {
  185 + type: 'el-input-number',
  186 + label: '宽度',
  187 + name: 'width',
  188 + required: false,
  189 + placeholder: '该容器在1920px大屏中的宽度',
  190 + value: 500,
  191 + },
  192 + {
  193 + type: 'el-input-number',
  194 + label: '高度',
  195 + name: 'height',
  196 + required: false,
  197 + placeholder: '该容器在1080px大屏中的高度',
  198 + value: 250,
  199 + },
  200 + ],
  201 + }
  202 +}
src/views/bigscreenDesigner/designer/tools/main.js
@@ -39,6 +39,7 @@ import {widgetWaterLevelPond} from "./configure/texts/widget-water-level-pond"; @@ -39,6 +39,7 @@ import {widgetWaterLevelPond} from "./configure/texts/widget-water-level-pond";
39 import {widgetDigitalFlop} from "./configure/texts/widget-digital-flop"; 39 import {widgetDigitalFlop} from "./configure/texts/widget-digital-flop";
40 import {widgetScrollRankingBoard} from "./configure/texts/widget-scroll-ranking-board"; 40 import {widgetScrollRankingBoard} from "./configure/texts/widget-scroll-ranking-board";
41 import {widgetActiveRingChart} from "./configure/pieCharts/widget-active-ring-chart"; 41 import {widgetActiveRingChart} from "./configure/pieCharts/widget-active-ring-chart";
  42 +import {widgetConicalColumnChart} from "./configure/funnelCharts/widget-conical-column-chart";
42 43
43 44
44 export const widgetTool = [ 45 export const widgetTool = [
@@ -85,5 +86,6 @@ export const widgetTool = [ @@ -85,5 +86,6 @@ export const widgetTool = [
85 widgetRadar, 86 widgetRadar,
86 widgetBarLineStack, 87 widgetBarLineStack,
87 widgetProgress, 88 widgetProgress,
88 - widgetActiveRingChart 89 + widgetActiveRingChart,
  90 + widgetConicalColumnChart
89 ] 91 ]
src/views/bigscreenDesigner/designer/widget/funnel/widgetConicalColumnChart.vue 0 → 100644
  1 +<!--
  2 +锥形柱图
  3 +-->
  4 +<template>
  5 +<!-- <div id="widget-scroll-ranking-board" :style="styleObj">-->
  6 + <dv-conical-column-chart :config="options" :style="styleObj"/>
  7 +<!-- </div>-->
  8 +</template>
  9 +<script>
  10 +import Vue from "vue";
  11 +import conicalColumnChart from "@jiaminghi/data-view/lib/components/conicalColumnChart";
  12 +Vue.use(conicalColumnChart)
  13 +export default {
  14 + name: "WidgetScrollRankingBoard",
  15 + props: {
  16 + value: Object,
  17 + ispreview: Boolean,
  18 + },
  19 + data() {
  20 + return {
  21 + //返回图标数据
  22 + options: {
  23 + data:[],//柱数据
  24 + img:[],//柱顶图片url
  25 + fontSize: 12,//文字大小
  26 + imgSideLength: 30,//图片边长
  27 + columnColor: 'rgba(0, 194, 255, 0.4)',//柱颜色
  28 + textColor: '#fff',//文字颜色
  29 + showValue: false//显示数值
  30 + },
  31 + optionsStyle: {}, // 样式
  32 + optionsData: {}, // 数据
  33 + optionsCollapse: {}, // 图标属性
  34 + optionsSetup: {},
  35 + defImgArray:[
  36 + '/static/images/conicalColumnChart/1st.png',
  37 + '/static/images/conicalColumnChart/2st.png',
  38 + '/static/images/conicalColumnChart/3st.png',
  39 + '/static/images/conicalColumnChart/4st.png',
  40 + '/static/images/conicalColumnChart/5st.png',
  41 + '/static/images/conicalColumnChart/6st.png',
  42 + '/static/images/conicalColumnChart/7st.png'
  43 + ],
  44 + };
  45 + },
  46 + computed: {
  47 + styleObj() {
  48 + return {
  49 + position: this.ispreview ? "absolute" : "static",
  50 + width: this.optionsStyle.width + "px",
  51 + height: this.optionsStyle.height + "px",
  52 + left: this.optionsStyle.left + "px",
  53 + top: this.optionsStyle.top + "px",
  54 + background: this.optionsSetup.background
  55 + };
  56 + },
  57 + },
  58 + watch: {
  59 + value: {
  60 + handler(val) {
  61 + this.optionsStyle = val.position;
  62 + this.optionsData = val.data;
  63 + this.optionsSetup = val.setup;
  64 + this.editorOptions();
  65 + },
  66 + deep: true
  67 + }
  68 + },
  69 + created() {
  70 + this.optionsStyle = this.value.position;
  71 + this.optionsData = this.value.data;
  72 + this.optionsSetup = this.value.setup;
  73 + this.editorOptions();
  74 + },
  75 + methods: {
  76 + // 修改图标options属性
  77 + editorOptions() {
  78 + //数据修改
  79 + this.setOptionsData();
  80 + //配置修改
  81 + this.setOptionsConfig();
  82 + },
  83 + // 配置修改
  84 + setOptionsConfig() {
  85 + const optionsSetup = this.optionsSetup;
  86 + this.options.fontSize =optionsSetup.fontSize;
  87 + this.options.imgSideLength =optionsSetup.imgSideLength;
  88 + this.options.columnColor =optionsSetup.columnColor;
  89 + this.options.textColor =optionsSetup.textColor;
  90 + this.options.showValue =optionsSetup.showValue;
  91 + this.options.showImg =optionsSetup.showImg;
  92 + this.options={...this.options};
  93 + },
  94 + //数据类型
  95 + setOptionsData() {
  96 + const optionsData = this.optionsData; // 数据类型 静态 or 动态
  97 + optionsData.dataType == "staticData"
  98 + ? this.staticDataFn(optionsData.staticData)
  99 + : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
  100 + },
  101 + getImgs(data){
  102 + const imgArray =[];
  103 + const key="img";
  104 + for (let i = 0; i < data.length; i++) {
  105 + const cloneVal= data[i];
  106 + if (Object.hasOwn(cloneVal, key) && cloneVal[key]) {
  107 + imgArray.push(cloneVal[key]);
  108 + }
  109 + }
  110 + const showImg = this.isBlank(this.optionsSetup.showImg)?true:this.optionsSetup.showImg;
  111 + if(showImg){
  112 + return imgArray.length>0?imgArray:this.defImgArray;
  113 + }else{
  114 + return [];
  115 + }
  116 + },
  117 + staticDataFn(val) {
  118 + // console.log("设置静态数据",this.options)
  119 + const staticData = typeof val == "string" ? JSON.parse(val) : val;
  120 + const staticImg = this.getImgs(staticData);
  121 + this.options.data=staticData;
  122 + this.options.img=staticImg;
  123 + },
  124 + dynamicDataFn(val, refreshTime) {
  125 + if (!val) return;
  126 + if (this.ispreview) {
  127 + this.getEchartData(val);
  128 + this.flagInter = setInterval(() => {
  129 + this.getEchartData(val);
  130 + }, refreshTime);
  131 + } else {
  132 + this.getEchartData(val);
  133 + }
  134 + },
  135 + getEchartData(val) {
  136 + const data = this.queryEchartsData(val);
  137 + data.then(res => {
  138 + this.renderingFn(res);
  139 + });
  140 + },
  141 + renderingFn(val) {
  142 + const staticImg = this.getImgs(val);
  143 + this.options.data = val;
  144 + this.options.img = staticImg;
  145 + },
  146 + }
  147 +};
  148 +
  149 +</script>
  150 +<style scoped lang="scss">
  151 +.echarts {
  152 + width: 100%;
  153 + height: 100%;
  154 + overflow: hidden;
  155 +}
  156 +</style>
src/views/bigscreenDesigner/designer/widget/temp.vue
@@ -45,7 +45,7 @@ import widgetWaterLevelPond from &quot;./text/widgetWaterLevelPond&quot;; @@ -45,7 +45,7 @@ import widgetWaterLevelPond from &quot;./text/widgetWaterLevelPond&quot;;
45 import widgetDigitalFlop from "./text/widgetDigitalFlop"; 45 import widgetDigitalFlop from "./text/widgetDigitalFlop";
46 import widgetScrollRankingBoard from "./text/widgetScrollRankingBoard"; 46 import widgetScrollRankingBoard from "./text/widgetScrollRankingBoard";
47 import widgetActiveRingChart from "./pie/widgetActiveRingChart"; 47 import widgetActiveRingChart from "./pie/widgetActiveRingChart";
48 - 48 +import widgetConicalColumnChart from "./funnel/widgetConicalColumnChart";
49 49
50 export default { 50 export default {
51 name: "WidgetTemp", 51 name: "WidgetTemp",
@@ -89,7 +89,8 @@ export default { @@ -89,7 +89,8 @@ export default {
89 widgetWaterLevelPond, 89 widgetWaterLevelPond,
90 widgetDigitalFlop, 90 widgetDigitalFlop,
91 widgetScrollRankingBoard, 91 widgetScrollRankingBoard,
92 - widgetActiveRingChart 92 + widgetActiveRingChart,
  93 + widgetConicalColumnChart
93 }, 94 },
94 model: { 95 model: {
95 prop: "value", 96 prop: "value",
src/views/bigscreenDesigner/designer/widget/text/widgetWaterLevelPond.vue
@@ -111,10 +111,10 @@ export default { @@ -111,10 +111,10 @@ export default {
111 }; 111 };
112 112
113 </script> 113 </script>
114 -<!--<style scoped lang="scss">-->  
115 -<!--.echarts {-->  
116 -<!-- width: 100%;-->  
117 -<!-- height: 100%;-->  
118 -<!-- overflow: hidden;-->  
119 -<!--}-->  
120 -<!--</style>--> 114 +<style scoped lang="scss">
  115 +.echarts {
  116 + width: 100%;
  117 + height: 100%;
  118 + overflow: hidden;
  119 +}
  120 +</style>
src/views/bigscreenDesigner/designer/widget/widget.vue
@@ -56,6 +56,7 @@ import widgetWaterLevelPond from &quot;./text/widgetWaterLevelPond&quot;; @@ -56,6 +56,7 @@ import widgetWaterLevelPond from &quot;./text/widgetWaterLevelPond&quot;;
56 import widgetDigitalFlop from "./text/widgetDigitalFlop"; 56 import widgetDigitalFlop from "./text/widgetDigitalFlop";
57 import widgetScrollRankingBoard from "./text/widgetScrollRankingBoard"; 57 import widgetScrollRankingBoard from "./text/widgetScrollRankingBoard";
58 import widgetActiveRingChart from "./pie/widgetActiveRingChart"; 58 import widgetActiveRingChart from "./pie/widgetActiveRingChart";
  59 +import widgetConicalColumnChart from "./funnel/widgetConicalColumnChart";
59 export default { 60 export default {
60 name: "Widget", 61 name: "Widget",
61 components: { 62 components: {
@@ -98,8 +99,8 @@ export default { @@ -98,8 +99,8 @@ export default {
98 widgetWaterLevelPond, 99 widgetWaterLevelPond,
99 widgetDigitalFlop, 100 widgetDigitalFlop,
100 widgetScrollRankingBoard, 101 widgetScrollRankingBoard,
101 - widgetActiveRingChart  
102 - 102 + widgetActiveRingChart,
  103 + widgetConicalColumnChart
103 }, 104 },
104 model: { 105 model: {
105 prop: "value", 106 prop: "value",
static/images/conicalColumnChart/1st.png 0 → 100644

1.25 KB

static/images/conicalColumnChart/2st.png 0 → 100644

1009 Bytes

static/images/conicalColumnChart/3st.png 0 → 100644

820 Bytes

static/images/conicalColumnChart/4st.png 0 → 100644

1014 Bytes

static/images/conicalColumnChart/5st.png 0 → 100644

1.26 KB

static/images/conicalColumnChart/6st.png 0 → 100644

1.28 KB

static/images/conicalColumnChart/7st.png 0 → 100644

1.19 KB