bugfix-装饰饼图,其他优化

qianming 1 year ago
parent c02137718d
commit 9f1c2fcf66

@ -65,7 +65,7 @@
:style="{ width: widthLeftForToolsHideButton + 'px' }" :style="{ width: widthLeftForToolsHideButton + 'px' }"
@click="toolIsShow = !toolIsShow" @click="toolIsShow = !toolIsShow"
> >
<i class="el-icon-arrow-right" /> <i class="el-icon-arrow-right"/>
</div> </div>
<div <div
@ -130,7 +130,7 @@
content="缩小" content="缩小"
placement="bottom" placement="bottom"
> >
<i class="el-icon-minus" style="font-size: 16px" /> <i class="el-icon-minus" style="font-size: 16px"/>
</el-tooltip> </el-tooltip>
</span> </span>
<span <span
@ -165,7 +165,7 @@
content="放大" content="放大"
placement="bottom" placement="bottom"
> >
<i class="el-icon-plus" style="font-size: 16px" /> <i class="el-icon-plus" style="font-size: 16px"/>
</el-tooltip> </el-tooltip>
</span> </span>
@ -349,7 +349,7 @@
</template> </template>
<script> <script>
import { widgetTools, getToolByCode } from "./tools/index"; import {widgetTools, getToolByCode} from "./tools/index";
import mixin from "@/utils/screenMixins"; import mixin from "@/utils/screenMixins";
import widget from "./widget/widget.vue"; import widget from "./widget/widget.vue";
import dynamicForm from "./components/dynamicForm.vue"; import dynamicForm from "./components/dynamicForm.vue";
@ -598,18 +598,21 @@ export default {
return widgetJson; return widgetJson;
}, },
setWidgetConfigValue(config, configValue) { setWidgetConfigValue(config, configValue) {
config.forEach((item) => { //
if (this.isObjectFn(item)) { if (config) {
configValue[item.name] = item.value; config.forEach((item) => {
} if (this.isObjectFn(item)) {
if (this.isArrayFn(item)) { configValue[item.name] = item.value;
item.forEach((itemChild) => { }
itemChild.list.forEach((ev) => { if (this.isArrayFn(item)) {
configValue[ev.name] = ev.value; item.forEach((itemChild) => {
itemChild.list.forEach((ev) => {
configValue[ev.name] = ev.value;
});
}); });
}); }
} });
}); }
}, },
layerClick(index) { layerClick(index) {
this.widgetIndex = index; this.widgetIndex = index;

@ -21,7 +21,7 @@ export const widgetBorder = {
name: 'layerName', name: 'layerName',
required: false, required: false,
placeholder: '', placeholder: '',
value: '边框', value: '边框',
}, },
{ {
type: 'el-select', type: 'el-select',

@ -8,8 +8,8 @@
*/ */
export const widgetDecoratePie = { export const widgetDecoratePie = {
code: 'widgetDecoratePieChart', code: 'widgetDecoratePieChart',
type: 'decorate', type: 'border',
tabName: '装饰图', tabName: '样式组件',
label: '装饰饼图', label: '装饰饼图',
icon: 'iconicon_tubiao_bingtu', icon: 'iconicon_tubiao_bingtu',
options: { options: {
@ -407,6 +407,7 @@ export const widgetDecoratePie = {
}, },
], ],
], ],
data: [],
// 坐标 // 坐标
position: [ position: [
{ {

@ -21,7 +21,7 @@ export const widgetDecoration = {
name: 'layerName', name: 'layerName',
required: false, required: false,
placeholder: '', placeholder: '',
value: '装饰', value: '装饰',
}, },
{ {
type: 'el-select', type: 'el-select',

@ -73,7 +73,7 @@ export const widgetTime = {
name: 'background', name: 'background',
required: false, required: false,
placeholder: '', placeholder: '',
value: 'rgba(115,170,229,.5)' value: ''
}, },
{ {
type: 'el-select', type: 'el-select',

@ -32,7 +32,7 @@ import { widgetBarStack } from "./configure/barCharts/widget-bar-stack"
import { widgetLineStack } from "./configure/lineCharts/widget-line-stack" import { widgetLineStack } from "./configure/lineCharts/widget-line-stack"
import { widgetBarCompare } from "./configure/barCharts/widget-bar-compare" import { widgetBarCompare } from "./configure/barCharts/widget-bar-compare"
import { widgetLineCompare } from "./configure/lineCharts/widget-line-compare" import { widgetLineCompare } from "./configure/lineCharts/widget-line-compare"
import { widgetDecoratePie } from "./configure/decorateCharts/widget-decorate-pie"; import { widgetDecoratePie } from "./configure/styleWidget/widget-decorate-pie";
import { widgetMoreBarLine } from "./configure/barlineCharts/widget-more-bar-line"; import { widgetMoreBarLine } from "./configure/barlineCharts/widget-more-bar-line";
import { widgetWordCloud } from "./configure/wordcloudCharts/widget-word-cloud"; import { widgetWordCloud } from "./configure/wordcloudCharts/widget-word-cloud";
import { widgetHeatmap } from "./configure/heatmap/widget-heatmap"; import { widgetHeatmap } from "./configure/heatmap/widget-heatmap";

@ -1,45 +1,47 @@
<template> <template>
<div :style="styleObj" > <div :style="styleObj">
<component :is="value.setup.showtype" :value="value" /> <component :is="value.setup.showtype" :value="value"/>
</div> </div>
</template> </template>
<script> <script>
export default ({ export default ({
data() { name: "widgetBorder",
return { components: {},
optionsStyle: {}, // data() {
} return {
}, optionsStyle: {}, //
props: { }
value: Object, },
ispreview: Boolean, props: {
widgetIndex: { value: Object,
type: Number, ispreview: Boolean,
default: 0, widgetIndex: {
}, // widgetInWorkbench type: Number,
default: 0,
}, // widgetInWorkbench
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
this.optionsData = val.data;
this.optionsCollapse = val.collapse;
this.optionsSetup = val.setup;
},
deep: true,
}, },
watch: { },
value: { computed: {
handler(val) { styleObj() {
this.optionsStyle = val.position; return {
this.optionsData = val.data; position: this.ispreview ? "absolute" : "static",
this.optionsCollapse = val.collapse; width: this.optionsStyle.width + "px",
this.optionsSetup = val.setup; height: this.optionsStyle.height + "px",
}, left: this.optionsStyle.left + "px",
deep: true, top: this.optionsStyle.top + "px",
}, };
}, },
computed: { }
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
};
},
}
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -1,6 +1,6 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" autoresize /> <v-chart ref="myVChart" :options="options" autoresize />
</div> </div>
</template> </template>

@ -1,45 +1,47 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<component :is="value.setup.showtype" :value="value" :style="styleObj"/> <component :is="value.setup.showtype" :value="value" :style="styleObj"/>
</div> </div>
</template> </template>
<script> <script>
export default ({ export default ({
data() { name: "widgetDecoration",
return { components: {},
optionsStyle: {}, // data() {
} return {
}, optionsStyle: {}, //
props: { }
value: Object, },
ispreview: Boolean, props: {
widgetIndex: { value: Object,
type: Number, ispreview: Boolean,
default: 0, widgetIndex: {
}, // widgetInWorkbench type: Number,
default: 0,
}, // widgetInWorkbench
},
watch: {
value: {
handler(val) {
this.optionsStyle = val.position;
this.optionsData = val.data;
this.optionsCollapse = val.collapse;
this.optionsSetup = val.setup;
},
deep: true,
}, },
watch: { },
value: { computed: {
handler(val) { styleObj() {
this.optionsStyle = val.position; return {
this.optionsData = val.data; position: this.ispreview ? "absolute" : "static",
this.optionsCollapse = val.collapse; width: this.optionsStyle.width + "px",
this.optionsSetup = val.setup; height: this.optionsStyle.height + "px",
}, left: this.optionsStyle.left + "px",
deep: true, top: this.optionsStyle.top + "px",
}, };
}, },
computed: { }
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
};
},
}
}) })
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

@ -34,7 +34,7 @@ import widgetBarStackChart from "./bar/widgetBarStackChart";
import widgetLineStackChart from "./line/widgetLineStackChart"; import widgetLineStackChart from "./line/widgetLineStackChart";
import widgetBarCompareChart from "./bar/widgetBarCompareChart"; import widgetBarCompareChart from "./bar/widgetBarCompareChart";
import widgetLineCompareChart from "./line/widgetLineCompareChart"; import widgetLineCompareChart from "./line/widgetLineCompareChart";
import widgetDecoratePieChart from "./decorate/widgetDecoratePieChart"; import widgetDecoratePieChart from "./styleWidget/widgetDecoratePieChart.vue";
import widgetMoreBarLineChart from "./barline/widgetMoreBarLineChart"; import widgetMoreBarLineChart from "./barline/widgetMoreBarLineChart";
import widgetWordCloud from "./wordcloud/widgetWordCloud"; import widgetWordCloud from "./wordcloud/widgetWordCloud";
import widgetHeatmap from "./heatmap/widgetHeatmap"; import widgetHeatmap from "./heatmap/widgetHeatmap";
@ -46,12 +46,16 @@ import widgetFormTime from "./form/widgetFormTime.vue";
import widgetScaleVertical from "./scale/widgetScaleVertical.vue"; import widgetScaleVertical from "./scale/widgetScaleVertical.vue";
import widgetScaleHorizontal from "./scale/widgetScaleHorizontal.vue"; import widgetScaleHorizontal from "./scale/widgetScaleHorizontal.vue";
import widgetBarDoubleYaxisChart from "./bar/widgetBarDoubleYaxisChart.vue"; import widgetBarDoubleYaxisChart from "./bar/widgetBarDoubleYaxisChart.vue";
import widgetBorder from "./styleWidget/widgetBorder.vue";
import widgetDecoration from "./styleWidget/widgetDecoration.vue";
export default { export default {
name: "WidgetTemp", name: "WidgetTemp",
components: { components: {
widgetHref, widgetHref,
widgetText, widgetText,
widgetBorder,
widgetDecoration,
WidgetMarquee, WidgetMarquee,
widgetTime, widgetTime,
widgetImage, widgetImage,

@ -41,7 +41,7 @@ import widgetBarStackChart from "./bar/widgetBarStackChart";
import widgetLineStackChart from "./line/widgetLineStackChart"; import widgetLineStackChart from "./line/widgetLineStackChart";
import widgetBarCompareChart from "./bar/widgetBarCompareChart"; import widgetBarCompareChart from "./bar/widgetBarCompareChart";
import widgetLineCompareChart from "./line/widgetLineCompareChart"; import widgetLineCompareChart from "./line/widgetLineCompareChart";
import widgetDecoratePieChart from "./decorate/widgetDecoratePieChart"; import widgetDecoratePieChart from "./styleWidget/widgetDecoratePieChart.vue";
import widgetMoreBarLineChart from "./barline/widgetMoreBarLineChart"; import widgetMoreBarLineChart from "./barline/widgetMoreBarLineChart";
import widgetWordCloud from "./wordcloud/widgetWordCloud"; import widgetWordCloud from "./wordcloud/widgetWordCloud";
import widgetHeatmap from "./heatmap/widgetHeatmap"; import widgetHeatmap from "./heatmap/widgetHeatmap";

Loading…
Cancel
Save