yuan
3 天以前 7726b6cdab80596d2e2f7dd3fe1ec3dfbdeee155
src/views/reportAnalysis/productionAnalysis/components/right-top.vue
@@ -22,13 +22,13 @@
</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%',
@@ -43,7 +43,6 @@
  data: ['开工', '完成', '良品率'],
}
// 柱状图:开工、完成;折线图:良品率(颜色 rgba(90, 216, 166, 1))
const chartSeries = ref([
  {
    name: '开工',
@@ -117,6 +116,7 @@
const xAxis1 = ref([
  { type: 'category', axisTick: { show: false }, axisLabel: { color: '#B8C8E0' }, data: [] },
])
const yAxis1 = [
  { type: 'value', name: '件', axisLabel: { color: '#B8C8E0' }, nameTextStyle: { color: '#B8C8E0' } },
  {
@@ -135,7 +135,7 @@
}
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
@@ -152,6 +152,13 @@
    })
}
const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
if (dataDashboardRefreshTick) {
  watch(dataDashboardRefreshTick, () => {
    fetchData()
  })
}
onMounted(() => {
  fetchData()
})