| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-17 22:02:38 |
| | | * @LastEditTime: 2024-06-17 22:37:51 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue |
| | | --> |
| | | <template> |
| | |
| | | ], |
| | | cols: [], |
| | | chartsData: [], |
| | | option2: null, |
| | | option2: {}, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | queryType: 0, |
| | | statisticalMethod: this.statisticalMethod |
| | | } |
| | | // console.log(this.option2.series, '>>>>>>>>>>???') |
| | | try { |
| | | this.option2.dataset.source = [] |
| | | this.option2.series = [] |
| | | } catch (error) { |
| | | |
| | | } |
| | | return this.$HTTP.post(this.url, dataSend, { params }).then(res => { |
| | | this.chartsData = res.data.items.records |
| | | let option2 = { |
| | | // legend: { |
| | | // type: 'plain', |
| | | // }, |
| | | title: { |
| | | text: '统计图表', |
| | | subtext: '', |
| | | }, |
| | | grid: { |
| | | top: '80px' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLabel: { |
| | | interval: 'auto', |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | formatter: (value) => { |
| | | return value + '%' |
| | | } |
| | | }, |
| | | }, |
| | | dataZoom: [ |
| | | { type: 'slider' } |
| | | ], |
| | | dataset: { |
| | | source: [] |
| | | }, |
| | | series: [], |
| | | ...this.options |
| | | } |
| | | option2.series = [] |
| | | let source1 = ['product'] |
| | | let row = res.data.items.records[0] |
| | | Object.values(row.nameData).forEach(v => { |
| | |
| | | }) |
| | | source1.push(v) |
| | | }) |
| | | |
| | | option2.dataset.source = [source1] |
| | | res.data.items.records.forEach(v => { |
| | | let current = [v.id] |