perf: 代码format
This commit is contained in:
@@ -21,11 +21,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { replaceUrlPlaceholder } from '@/utils/tools'
|
import { replaceUrlPlaceholder, reverseSortBy } from '@/utils/tools'
|
||||||
import { get } from '@/utils/http'
|
import { get } from '@/utils/http'
|
||||||
import chartEchartMixin from './chart-echart-mixin'
|
import chartEchartMixin from './chart-echart-mixin'
|
||||||
import { reverseSortBy } from '@/utils/tools'
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartEchartIpHostedDomain',
|
name: 'ChartEchartIpHostedDomain',
|
||||||
@@ -41,7 +39,7 @@ export default {
|
|||||||
initEcharts (id) {
|
initEcharts (id) {
|
||||||
this.initDom(id, 2)
|
this.initDom(id, 2)
|
||||||
const chartParams = this.chartInfo.params
|
const chartParams = this.chartInfo.params
|
||||||
const domains = this.chartData.map(function(item,i){
|
const domains = this.chartData.map(function (item, i) {
|
||||||
return item.domain
|
return item.domain
|
||||||
}).join(',')
|
}).join(',')
|
||||||
|
|
||||||
@@ -52,7 +50,7 @@ export default {
|
|||||||
// this.noData0 = true
|
// this.noData0 = true
|
||||||
} else {
|
} else {
|
||||||
// this.noData0 = false
|
// this.noData0 = false
|
||||||
//chartOption = this.$_.cloneDeep(this.chartOption)
|
// chartOption = this.$_.cloneDeep(this.chartOption)
|
||||||
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||||
return {
|
return {
|
||||||
data: d,
|
data: d,
|
||||||
@@ -62,10 +60,10 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.chartOption.series[0].data = data
|
this.chartOption.series[0].data = data
|
||||||
//this.myChart.setOption(this.chartOption)
|
// this.myChart.setOption(this.chartOption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const byCredit = new Promise(resolve => {
|
const byCredit = new Promise(resolve => {
|
||||||
@@ -75,7 +73,7 @@ export default {
|
|||||||
// this.noData1 = true
|
// this.noData1 = true
|
||||||
} else {
|
} else {
|
||||||
// this.noData1 = false
|
// this.noData1 = false
|
||||||
//this.chartOption2 = this.$_.cloneDeep(this.chartOption)
|
// this.chartOption2 = this.$_.cloneDeep(this.chartOption)
|
||||||
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||||
return {
|
return {
|
||||||
data: d,
|
data: d,
|
||||||
@@ -85,15 +83,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.chartOption2.series[0].data = data
|
this.chartOption2.series[0].data = data
|
||||||
// this.myChart2.setOption(this.chartOption2)
|
// this.myChart2.setOption(this.chartOption2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Promise.all([byType, byCredit]).finally(response => {
|
Promise.all([byType, byCredit]).finally(response => {
|
||||||
this.loadEchart(2)
|
this.loadEchart(2)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user