| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, computed } from 'vue' |
| | | import { ref, onMounted, computed, inject, watch } from 'vue' |
| | | import Echarts from '@/components/Echarts/echarts.vue' |
| | | import PanelHeader from '../PanelHeader.vue' |
| | | import DateTypeSwitch from '../DateTypeSwitch.vue' |
| | | import { supplierPurchaseRanking } from '@/api/viewIndex.js' |
| | | |
| | | const dateRange = inject('psiDateRange', null) |
| | | |
| | | const chartStyle = { |
| | | width: '100%', |
| | |
| | | textStyle: { fontSize: '100%' }, |
| | | formatter: function (params) { |
| | | let result = params[0].axisValueLabel + '<br/>' |
| | | result += `<div>${params[0].marker}${params[0].value}</div>` |
| | | result += `<div>${params[0].marker}${params[0].value}元</div>` |
| | | return result |
| | | }, |
| | | } |
| | |
| | | |
| | | // 供应商采购排名 |
| | | const fetchSupplierRanking = () => { |
| | | supplierPurchaseRanking({ type: radio1.value }) |
| | | supplierPurchaseRanking({ type: radio1.value, ...(dateRange?.value || {}) }) |
| | | .then((res) => { |
| | | if (res.code === 200 && Array.isArray(res.data)) { |
| | | dataArr.value = res.data.map(item => ({ |
| | |
| | | fetchSupplierRanking() |
| | | } |
| | | |
| | | const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null) |
| | | if (dataDashboardRefreshTick) { |
| | | watch(dataDashboardRefreshTick, () => { |
| | | fetchSupplierRanking() |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchSupplierRanking() |
| | | }) |