Commit ff05061e by 匡雅琴

优化

1 parent d830f275
...@@ -67,45 +67,86 @@ export default { ...@@ -67,45 +67,86 @@ export default {
}, },
methods: { 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) { selectVal(val) {
console.log(val) const actions = {
// this.tabShow = false registerNum: () => {
switch (val.val) {
case 'registerNum':
this.chartShow = true this.chartShow = true
this.valueName = 'registerNum' this.valueName = 'registerNum'
this.$refs.trendChartRef.drawBar(this.marketingTrendList) this.$refs.trendChartRef.drawBar(this.marketingTrendList)
break },
case 'activeNum': activeNum: () => {
this.chartShow = true this.chartShow = true
this.valueName = 'activeNum' this.valueName = 'activeNum'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingTrendList) this.$refs.trendChartRef.drawBar(this.marketingTrendList)
}) })
},
break output: () => {
case 'output':
this.valName = 'output' this.valName = 'output'
this.chartShow = false this.chartShow = false
this.tabShow = true this.tabShow = true
this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList) this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
break },
case 'activityNum': activityNum: () => {
this.chartShow = true this.chartShow = true
this.valueName = 'activityNum' this.valueName = 'activityNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList) this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break },
case 'orderNum': orderNum: () => {
this.chartShow = true this.chartShow = true
// this.valueName = 'orderNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList) this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break },
case 'avgPrice': avgPrice: () => {
this.chartShow = true this.chartShow = true
this.valueName = 'avgPrice' this.valueName = 'avgPrice'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList) this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
// this.tabShow = true }
break }
const action = actions[val.val]
if (action) {
action()
} }
}, },
changeTab(val) { changeTab(val) {
......
...@@ -53,17 +53,22 @@ export default { ...@@ -53,17 +53,22 @@ export default {
}, },
methods: { 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) { changeTab(val) {
switch (val) { const queryItems = ['brandnum', 'output']
case 0: this.queryItem = queryItems[val]
this.queryItem = 'brandnum' this.getManageESalesAmountRationality(this.queryItem)
this.getManageESalesAmountRationality('brandnum')
break
case 1:
this.queryItem = 'output'
this.getManageESalesAmountRationality('output')
break
}
}, },
selectPrice(val) { selectPrice(val) {
console.log(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!