gongchunyi
2026-08-12 0e6db4c630d8db3eacb4aef7abd142be78f9028a
src/views/reportAnalysis/PSIDataAnalysis/components/center-center.vue
@@ -27,9 +27,11 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, inject, watch } from 'vue'
import Echarts from '@/components/Echarts/echarts.vue'
import { productTurnoverDays } from '@/api/viewIndex.js'
const dateRange = inject('psiDateRange', null)
const chartStyle = { width: '100%', height: '100%' }
const grid = { left: '3%', right: '4%', bottom: '3%', top: '4%', containLabel: true }
@@ -69,7 +71,7 @@
const yAxis1 = [{ type: 'value', axisLabel: { color: '#B8C8E0' } }]
const fetchData = () => {
  productTurnoverDays()
  productTurnoverDays(dateRange?.value || undefined)
    .then((res) => {
      if (res.code === 200 && Array.isArray(res.data)) {
        const list = res.data
@@ -82,6 +84,13 @@
    })
}
const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
if (dataDashboardRefreshTick) {
  watch(dataDashboardRefreshTick, () => {
    fetchData()
  })
}
onMounted(() => {
  fetchData()
})