提交: 补充提交
This commit is contained in:
parent
62367c5544
commit
141f553807
|
@ -11,8 +11,12 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
port= 9988
|
port= 9988
|
||||||
|
|
||||||
# 服务端地址
|
# 服务端地址
|
||||||
|
// 陈志荣 本地
|
||||||
target = http://192.168.18.140:8899
|
target = http://192.168.18.140:8899
|
||||||
//target = http://192.168.18.139:8899
|
//target = http://192.168.18.139:8899
|
||||||
// target = http://192.168.18.136: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
|
// target = http://192.168.10.241:30646
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue