Commit ff05061e by 匡雅琴

优化

1 parent d830f275
......@@ -67,45 +67,86 @@ export default {
},
methods: {
// selectVal(val) {
// console.log(val)
// // this.tabShow = false
// switch (val.val) {
// case 'registerNum':
// this.chartShow = true
// this.valueName = 'registerNum'
// this.$refs.trendChartRef.drawBar(this.marketingTrendList)
// break
// case 'activeNum':
// this.chartShow = true
// this.valueName = 'activeNum'
// this.$nextTick(() => {
// this.$refs.trendChartRef.drawBar(this.marketingTrendList)
// })
// break
// case 'output':
// this.valName = 'output'
// this.chartShow = false
// this.tabShow = true
// this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
// break
// case 'activityNum':
// this.chartShow = true
// this.valueName = 'activityNum'
// this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
// break
// case 'orderNum':
// this.chartShow = true
// // this.valueName = 'orderNum'
// this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
// break
// case 'avgPrice':
// this.chartShow = true
// this.valueName = 'avgPrice'
// this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
// // this.tabShow = true
// break
// }
// },
selectVal(val) {
console.log(val)
// this.tabShow = false
switch (val.val) {
case 'registerNum':
const actions = {
registerNum: () => {
this.chartShow = true
this.valueName = 'registerNum'
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
break
case 'activeNum':
},
activeNum: () => {
this.chartShow = true
this.valueName = 'activeNum'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
})
break
case 'output':
},
output: () => {
this.valName = 'output'
this.chartShow = false
this.tabShow = true
this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
break
case 'activityNum':
},
activityNum: () => {
this.chartShow = true
this.valueName = 'activityNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break
case 'orderNum':
},
orderNum: () => {
this.chartShow = true
// this.valueName = 'orderNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break
case 'avgPrice':
},
avgPrice: () => {
this.chartShow = true
this.valueName = 'avgPrice'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
// this.tabShow = true
break
}
}
const action = actions[val.val]
if (action) {
action()
}
},
changeTab(val) {
......
......@@ -53,17 +53,22 @@ export default {
},
methods: {
// changeTab(val) {
// switch (val) {
// case 0:
// this.queryItem = 'brandnum'
// this.getManageESalesAmountRationality('brandnum')
// break
// case 1:
// this.queryItem = 'output'
// this.getManageESalesAmountRationality('output')
// break
// }
// },
changeTab(val) {
switch (val) {
case 0:
this.queryItem = 'brandnum'
this.getManageESalesAmountRationality('brandnum')
break
case 1:
this.queryItem = 'output'
this.getManageESalesAmountRationality('output')
break
}
const queryItems = ['brandnum', 'output']
this.queryItem = queryItems[val]
this.getManageESalesAmountRationality(this.queryItem)
},
selectPrice(val) {
console.log(val)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!