| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-20 20:26:30 |
| | | * @LastEditTime: 2024-04-27 23:30:06 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue |
| | | --> |
| | | <template> |
| | | <el-row> |
| | | <el-col> |
| | | <el-button-group> |
| | | <el-button @click="statisticalMethod = item.value" |
| | | <el-button size="small" @click="statisticalMethod = item.value" |
| | | :type="statisticalMethod == item.value ? 'primary' : ''" v-for="item in btnList" |
| | | :key="item.value">{{ |
| | | item.label }}</el-button> |
| | |
| | | <script> |
| | | import scEcharts from '@/components/scEcharts'; |
| | | export default { |
| | | props: { |
| | | url: { |
| | | default: '/api/blade-mdc/efficiency-analysis', |
| | | type: String, |
| | | } |
| | | }, |
| | | components: { |
| | | scEcharts |
| | | }, |
| | |
| | | queryType: 0, |
| | | statisticalMethod: this.statisticalMethod |
| | | } |
| | | return this.$HTTP.post('/api/blade-mdc/efficiency-analysis', dataSend, { params }).then(res => { |
| | | return this.$HTTP.post(this.url, dataSend, { params }).then(res => { |
| | | this.chartsData = res.data.items.records |
| | | let option2 = { |
| | | // legend: { |
| | |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLabel: { |
| | | interval: 'auto', |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | type: 'value', |
| | | axisLabel: { |
| | | formatter: (value) => { |
| | | return value + '%' |
| | | } |
| | | }, |
| | | }, |
| | | dataZoom: [ |
| | | { type: 'slider' } |
| | |
| | | res.data.items.records.forEach(v => { |
| | | let current = [v.id] |
| | | Object.keys(v.nameData).forEach(key => { |
| | | current.push(row.data[key] || 0) |
| | | current.push((v.data[key] - 0) * 100) |
| | | }) |
| | | option2.dataset.source.push(current) |
| | | }); |
| | |
| | | delete dataSend.size |
| | | delete dataSend.order |
| | | delete dataSend.prop |
| | | return await this.$HTTP.post('/api/blade-mdc/efficiency-analysis', dataSend, { params }).then(res => { |
| | | return await this.$HTTP.post(this.url, dataSend, { params }).then(res => { |
| | | let row = res.data.items?.records[0]?.data || {} |
| | | this.cols = Object.keys(row) |
| | | console.log(this.cols) |