diff --git a/src/loveflow/components/data/table.vue b/src/loveflow/components/data/table.vue index 9060f7e..4b79df4 100644 --- a/src/loveflow/components/data/table.vue +++ b/src/loveflow/components/data/table.vue @@ -7,6 +7,7 @@ :rowKey="rowKey ? rowKey : ''" @selection-change="selectionChange" v-bind="$attrs" + style="width: 100%" > -
+
@@ -16,6 +16,7 @@ export default { data() { return { option: {}, + fontSize: 10, }; }, mounted() { @@ -23,6 +24,17 @@ export default { }, methods: { setOption() { + let temp = this.getHeight(); + let height = parseInt(temp / 4); + console.log(height); + if (height > 40) { + this.fontSize = 12; + } + + if (this.fontSize > 60) { + this.fontSize = 14; + } + let dataList = this.chartObj.data; let maxArr = []; let maxValue = 0; @@ -71,7 +83,7 @@ export default { textStyle: { verticalAlign: "bottom", color: "#299CD4", - fontSize: 14, + fontSize: this.fontSize + 2, fontFamily: "Microsoft YaHei", align: "left", padding: [0, 0, 5, 7], @@ -93,12 +105,12 @@ export default { value: { padding: [4, 0, 0, 4], color: "#9CE0FF", - fontSize: 16, + fontSize: this.fontSize + 4, }, rate: { align: "right", color: "rgba(255,255,255,0.9)", - fontSize: 12, + fontSize: this.fontSize, }, }, }, @@ -169,7 +181,7 @@ export default { rich: { a: { color: "#9CE0FF", - fontSize: 16, + fontSize: this.fontSize + 4, align: "right", }, }, @@ -201,6 +213,10 @@ export default { ], }; }, + getHeight() { + let div = document.getElementById("dpieWrap"); + return div.clientHeight; + }, }, watch: { chartObj: { diff --git a/src/loveflow/components/echart/chart.vue b/src/loveflow/components/echart/chart.vue index 0fffc45..c6fb52f 100644 --- a/src/loveflow/components/echart/chart.vue +++ b/src/loveflow/components/echart/chart.vue @@ -21,7 +21,9 @@ export default { }, methods: { resize() { - this.dom.resize(); + console.log(11111); + console.log( this.dom); + this.dom && this.dom.resize(); }, }, mounted() { diff --git a/src/loveflow/components/echart/pie/dpieOne.vue b/src/loveflow/components/echart/pie/dpieOne.vue index d80089d..06fd19b 100644 --- a/src/loveflow/components/echart/pie/dpieOne.vue +++ b/src/loveflow/components/echart/pie/dpieOne.vue @@ -1,5 +1,5 @@