提交: 补充提交

This commit is contained in:
23688nl 2022-09-01 16:59:30 +08:00
parent 62367c5544
commit 141f553807
2 changed files with 76 additions and 1 deletions

View File

@ -11,8 +11,12 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
port= 9988
# 服务端地址
// 陈志荣 本地
target = http://192.168.18.140:8899
//target = http://192.168.18.139:8899
// target = http://192.168.18.136:8899
//target = http://192.168.10.241:30646
// 测试端
// target = http://192.168.10.241:32024
// 开发端
// target = http://192.168.10.241:30646

View File

@ -0,0 +1,71 @@
<template>
<div class="e-echarts-line">
<div :id="eId" :style="styles"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
name: "EEchartsBar",
props: {
eId: {
type: String
},
styles: {
type: String
},
colorList: {
type: [Array, String],
default: ""
},
option: {
stype: Object,
default: {}
}
},
data() {
return {
chart: null
};
},
created() {
this.chart = null;
},
mounted() {
this.drawBar();
},
methods: {
updateEchart() {
if (this.chart) {
this.chart = null;
}
this.drawBar();
},
drawBar() {
if (!this.chart) {
this.chart = echarts.init(document.getElementById(this.eId));
}
this.chart.setOption(this.option);
}
},
watch: {
option: {
handler(val) {
if (val) {
this.chart = null;
this.drawBar();
}
},
deep: true
}
}
};
</script>
<style lang="scss">
.e-echarts-line {
position: relative;
height: 100%;
top: 0px;
width: 100%;
}
</style>