调整
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</ai-card>
|
||||
<ai-card title="趋势信息">
|
||||
<template #content>
|
||||
<div id="chart"></div>
|
||||
<div id="dataChart"></div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
@@ -39,19 +39,23 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
mounted() {
|
||||
// this.info = this.params
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
this.$http.post('/api/monitorDetail/queryDetail',null,{
|
||||
init() {
|
||||
this.$http.post('/api/monitorDetail/queryProductDetail',null,{
|
||||
params: {
|
||||
goodsId: this.params.goodsId
|
||||
goodsId: this.params.goodsId,
|
||||
monitorId: this.params.monitorId
|
||||
}
|
||||
}).then(res => {
|
||||
this.info = res.data
|
||||
|
||||
const dualAxes = new DualAxes('chart', {
|
||||
|
||||
const dualAxes = new DualAxes('dataChart', {
|
||||
data: [this.info.priceAndSale, this.info.priceAndSale],
|
||||
xField: '日期',
|
||||
yField: ['价格', '销量'],
|
||||
@@ -65,14 +69,6 @@ export default {
|
||||
color: '#5AD8A6',
|
||||
}
|
||||
],
|
||||
smooth: true,
|
||||
// @TODO 后续会换一种动画方式
|
||||
animation: {
|
||||
appear: {
|
||||
animation: 'path-in',
|
||||
duration: 5000,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
dualAxes.render();
|
||||
|
||||
Reference in New Issue
Block a user