| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue' |
| | | import { ref, onMounted, inject, watch } from 'vue' |
| | | import { workOrderEfficiencyAnalysis } from '@/api/viewIndex.js' |
| | | import PanelHeader from './PanelHeader.vue' |
| | | import Echarts from '@/components/Echarts/echarts.vue' |
| | | import DateTypeSwitch from './DateTypeSwitch.vue' |
| | | |
| | | const dateType = ref(1) // 1=周 2=月 3=季度 |
| | | const dateType = ref(3) // 1=周 2=月 3=季度 |
| | | |
| | | const chartStyle = { |
| | | width: '100%', |
| | |
| | | } |
| | | |
| | | const fetchData = () => { |
| | | workOrderEfficiencyAnalysis({ dateType: dateType.value }) |
| | | workOrderEfficiencyAnalysis({ type: dateType.value }) |
| | | .then((res) => { |
| | | if (res.code !== 200 || !Array.isArray(res.data)) return |
| | | const items = res.data |
| | |
| | | }) |
| | | } |
| | | |
| | | const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null) |
| | | if (dataDashboardRefreshTick) { |
| | | watch(dataDashboardRefreshTick, () => { |
| | | fetchData() |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchData() |
| | | }) |