yanghao 23 時間 前
コミット
b7d7271a5f

+ 118 - 28
src/views/pms/iotrddailyreport/components/NonProductionEfficiency.vue

@@ -204,10 +204,22 @@ const getPieData = () => {
     .filter((item) => item.value > 0)
 }
 
-const resizeChart = () => {
-  chart?.resize()
+const getNptFieldPieData = () => {
+  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+
+  return nonProductionTimeFields
+    .filter(([field]) => !excludedFields.includes(field))
+    .map(([field, label]) => ({
+      name: label,
+      value: getFieldTotal(field)
+    }))
+    .filter((item) => item.value > 0)
 }
 
+const resizeChart = useDebounceFn(() => {
+  renderChart()
+}, 150)
+
 const renderChart = () => {
   if (!chartRef.value) return
 
@@ -217,39 +229,117 @@ const renderChart = () => {
   window.removeEventListener('resize', resizeChart)
   window.addEventListener('resize', resizeChart)
 
-  const pieData = getPieData()
+  const projectPieData = getPieData()
+  const nptFieldPieData = getNptFieldPieData()
+  const chartWidth = chart.getWidth()
+  const chartHeight = chart.getHeight()
+  const projectCenter = chartWidth * 0.25
+  const nptFieldCenter = chartWidth * 0.73
+  const pieCenterY = chartHeight * 0.55
+  const graphic: any[] = [
+    {
+      type: 'text',
+      x: projectCenter,
+      y: 32,
+      style: {
+        text: '项目NPT占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    },
+    {
+      type: 'text',
+      x: nptFieldCenter,
+      y: 32,
+      style: {
+        text: 'NPT各项时间占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    }
+  ]
+
+  if (projectPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: projectCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无项目NPT数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
+
+  if (nptFieldPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: nptFieldCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无NPT项数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
 
   chart.setOption({
     tooltip: {
       trigger: 'item',
-      formatter: '{b}<br/>NPT合计: {c} H<br/>占比: {d}%'
-    },
-    legend: {
-      type: 'scroll',
-      orient: 'vertical',
-      right: 24,
-      top: 32,
-      bottom: 24
+      formatter: (params: any) =>
+        `${params.seriesName}<br/>${params.name}: ${formatNumber(params.value)} H<br/>占比: ${params.percent}%`
     },
-    graphic:
-      pieData.length === 0
-        ? {
-            type: 'text',
-            left: 'center',
-            top: 'middle',
-            style: {
-              text: '暂无NPT数据',
-              fill: '#909399',
-              fontSize: 14
-            }
-          }
-        : undefined,
+    legend: [
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        left: 16,
+        top: 64,
+        bottom: 24,
+        data: projectPieData.map((item) => item.name)
+      },
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        right: 16,
+        top: 64,
+        bottom: 24,
+        data: nptFieldPieData.map((item) => item.name)
+      }
+    ],
+    graphic,
     series: [
       {
-        name: 'NPT合计',
+        name: '项目NPT占比',
+        type: 'pie',
+        radius: ['34%', '56%'],
+        center: ['25%', '55%'],
+        avoidLabelOverlap: true,
+        itemStyle: {
+          borderRadius: 4,
+          borderColor: '#fff',
+          borderWidth: 2
+        },
+        label: {
+          formatter: '{b}: {d}%'
+        },
+        data: projectPieData
+      },
+      {
+        name: 'NPT各项时间占比',
         type: 'pie',
-        radius: ['42%', '68%'],
-        center: ['50%', '50%'],
+        radius: ['34%', '56%'],
+        center: ['73%', '55%'],
         avoidLabelOverlap: true,
         itemStyle: {
           borderRadius: 4,
@@ -259,7 +349,7 @@ const renderChart = () => {
         label: {
           formatter: '{b}: {d}%'
         },
-        data: pieData
+        data: nptFieldPieData
       }
     ]
   })

+ 14 - 20
src/views/pms/iotrddailyreport/summary.vue

@@ -5,6 +5,10 @@ import { useUserStore } from '@/store/modules/user'
 import DailyStatistics from './components/DailyStatistics.vue'
 import NonProductionEfficiency from './components/NonProductionEfficiency.vue'
 
+defineOptions({
+  name: 'RdSummary'
+})
+
 const deptId = useUserStore().getUser.deptId
 
 interface Query {
@@ -53,19 +57,16 @@ const resetQuery = () => {
 
 <template>
   <div
-    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
-  >
+    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
     <DeptTreeSelect
       :deptId="id"
       :top-id="163"
       v-model="query.deptId"
       @node-click="handleDeptNodeClick"
-      class="row-span-3"
-    />
+      class="row-span-3" />
     <el-form
       size="default"
-      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
-    >
+      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between">
       <div class="flex items-center gap-8">
         <el-form-item label="项目">
           <el-input
@@ -73,8 +74,7 @@ const resetQuery = () => {
             placeholder="请输入项目"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="任务">
           <el-input
@@ -82,8 +82,7 @@ const resetQuery = () => {
             placeholder="请输入任务"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="创建时间">
           <el-date-picker
@@ -94,8 +93,7 @@ const resetQuery = () => {
             end-placeholder="结束日期"
             :shortcuts="rangeShortcuts"
             :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-            class="!w-220px"
-          />
+            class="!w-220px" />
         </el-form-item>
       </div>
       <el-form-item>
@@ -110,15 +108,13 @@ const resetQuery = () => {
       <el-button
         size="default"
         :type="activeTab === '日报统计' ? 'primary' : 'default'"
-        @click="activeTab = '日报统计'"
-      >
+        @click="activeTab = '日报统计'">
         日报统计
       </el-button>
       <el-button
         size="default"
         :type="activeTab === '非生产时效' ? 'primary' : 'default'"
-        @click="activeTab = '非生产时效'"
-      >
+        @click="activeTab = '非生产时效'">
         非生产时效
       </el-button>
     </el-button-group>
@@ -127,14 +123,12 @@ const resetQuery = () => {
       v-if="activeTab === '日报统计'"
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
     <NonProductionEfficiency
       v-else
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
   </div>
 </template>
 

+ 118 - 28
src/views/pms/iotrhdailyreport/components/NonProductionEfficiency.vue

@@ -199,10 +199,22 @@ const getPieData = () => {
     .filter((item) => item.value > 0)
 }
 
-const resizeChart = () => {
-  chart?.resize()
+const getNptFieldPieData = () => {
+  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+
+  return nonProductionTimeFields
+    .filter(([field]) => !excludedFields.includes(field))
+    .map(([field, label]) => ({
+      name: label,
+      value: getFieldTotal(field)
+    }))
+    .filter((item) => item.value > 0)
 }
 
+const resizeChart = useDebounceFn(() => {
+  renderChart()
+}, 150)
+
 const renderChart = () => {
   if (!chartRef.value) return
 
@@ -212,39 +224,117 @@ const renderChart = () => {
   window.removeEventListener('resize', resizeChart)
   window.addEventListener('resize', resizeChart)
 
-  const pieData = getPieData()
+  const projectPieData = getPieData()
+  const nptFieldPieData = getNptFieldPieData()
+  const chartWidth = chart.getWidth()
+  const chartHeight = chart.getHeight()
+  const projectCenter = chartWidth * 0.25
+  const nptFieldCenter = chartWidth * 0.73
+  const pieCenterY = chartHeight * 0.55
+  const graphic: any[] = [
+    {
+      type: 'text',
+      x: projectCenter,
+      y: 32,
+      style: {
+        text: '项目NPT占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    },
+    {
+      type: 'text',
+      x: nptFieldCenter,
+      y: 32,
+      style: {
+        text: 'NPT各项时间占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    }
+  ]
+
+  if (projectPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: projectCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无项目NPT数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
+
+  if (nptFieldPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: nptFieldCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无NPT项数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
 
   chart.setOption({
     tooltip: {
       trigger: 'item',
-      formatter: '{b}<br/>NPT合计: {c} H<br/>占比: {d}%'
-    },
-    legend: {
-      type: 'scroll',
-      orient: 'vertical',
-      right: 24,
-      top: 32,
-      bottom: 24
+      formatter: (params: any) =>
+        `${params.seriesName}<br/>${params.name}: ${formatNumber(params.value)} H<br/>占比: ${params.percent}%`
     },
-    graphic:
-      pieData.length === 0
-        ? {
-            type: 'text',
-            left: 'center',
-            top: 'middle',
-            style: {
-              text: '暂无NPT数据',
-              fill: '#909399',
-              fontSize: 14
-            }
-          }
-        : undefined,
+    legend: [
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        left: 16,
+        top: 64,
+        bottom: 24,
+        data: projectPieData.map((item) => item.name)
+      },
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        right: 16,
+        top: 64,
+        bottom: 24,
+        data: nptFieldPieData.map((item) => item.name)
+      }
+    ],
+    graphic,
     series: [
       {
-        name: 'NPT合计',
+        name: '项目NPT占比',
+        type: 'pie',
+        radius: ['34%', '56%'],
+        center: ['25%', '55%'],
+        avoidLabelOverlap: true,
+        itemStyle: {
+          borderRadius: 4,
+          borderColor: '#fff',
+          borderWidth: 2
+        },
+        label: {
+          formatter: '{b}: {d}%'
+        },
+        data: projectPieData
+      },
+      {
+        name: 'NPT各项时间占比',
         type: 'pie',
-        radius: ['42%', '68%'],
-        center: ['50%', '50%'],
+        radius: ['34%', '56%'],
+        center: ['73%', '55%'],
         avoidLabelOverlap: true,
         itemStyle: {
           borderRadius: 4,
@@ -254,7 +344,7 @@ const renderChart = () => {
         label: {
           formatter: '{b}: {d}%'
         },
-        data: pieData
+        data: nptFieldPieData
       }
     ]
   })

+ 14 - 20
src/views/pms/iotrhdailyreport/summary.vue

@@ -5,6 +5,10 @@ import { useUserStore } from '@/store/modules/user'
 import DailyStatistics from './components/DailyStatistics.vue'
 import NonProductionEfficiency from './components/NonProductionEfficiency.vue'
 
+defineOptions({
+  name: 'IotRhDailyReportSummary'
+})
+
 const deptId = useUserStore().getUser.deptId
 
 interface Query {
@@ -53,19 +57,16 @@ const resetQuery = () => {
 
 <template>
   <div
-    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
-  >
+    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
     <DeptTreeSelect
       :deptId="id"
       :top-id="157"
       v-model="query.deptId"
       @node-click="handleDeptNodeClick"
-      class="row-span-3"
-    />
+      class="row-span-3" />
     <el-form
       size="default"
-      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
-    >
+      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between">
       <div class="flex items-center gap-8">
         <el-form-item label="项目">
           <el-input
@@ -73,8 +74,7 @@ const resetQuery = () => {
             placeholder="请输入项目"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="任务">
           <el-input
@@ -82,8 +82,7 @@ const resetQuery = () => {
             placeholder="请输入任务"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="创建时间">
           <el-date-picker
@@ -94,8 +93,7 @@ const resetQuery = () => {
             end-placeholder="结束日期"
             :shortcuts="rangeShortcuts"
             :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-            class="!w-220px"
-          />
+            class="!w-220px" />
         </el-form-item>
       </div>
       <el-form-item>
@@ -110,15 +108,13 @@ const resetQuery = () => {
       <el-button
         size="default"
         :type="activeTab === '日报统计' ? 'primary' : 'default'"
-        @click="activeTab = '日报统计'"
-      >
+        @click="activeTab = '日报统计'">
         日报统计
       </el-button>
       <el-button
         size="default"
         :type="activeTab === '非生产时效' ? 'primary' : 'default'"
-        @click="activeTab = '非生产时效'"
-      >
+        @click="activeTab = '非生产时效'">
         非生产时效
       </el-button>
     </el-button-group>
@@ -127,14 +123,12 @@ const resetQuery = () => {
       v-if="activeTab === '日报统计'"
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
     <NonProductionEfficiency
       v-else
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
   </div>
 </template>
 

+ 118 - 28
src/views/pms/iotrydailyreport/components/NonProductionEfficiency.vue

@@ -205,10 +205,22 @@ const getPieData = () => {
     .filter((item) => item.value > 0)
 }
 
-const resizeChart = () => {
-  chart?.resize()
+const getNptFieldPieData = () => {
+  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+
+  return nonProductionTimeFields
+    .filter(([field]) => !excludedFields.includes(field))
+    .map(([field, label]) => ({
+      name: label,
+      value: getFieldTotal(field)
+    }))
+    .filter((item) => item.value > 0)
 }
 
+const resizeChart = useDebounceFn(() => {
+  renderChart()
+}, 150)
+
 const renderChart = () => {
   if (!chartRef.value) return
 
@@ -218,39 +230,117 @@ const renderChart = () => {
   window.removeEventListener('resize', resizeChart)
   window.addEventListener('resize', resizeChart)
 
-  const pieData = getPieData()
+  const projectPieData = getPieData()
+  const nptFieldPieData = getNptFieldPieData()
+  const chartWidth = chart.getWidth()
+  const chartHeight = chart.getHeight()
+  const projectCenter = chartWidth * 0.25
+  const nptFieldCenter = chartWidth * 0.73
+  const pieCenterY = chartHeight * 0.55
+  const graphic: any[] = [
+    {
+      type: 'text',
+      x: projectCenter,
+      y: 32,
+      style: {
+        text: '项目NPT占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    },
+    {
+      type: 'text',
+      x: nptFieldCenter,
+      y: 32,
+      style: {
+        text: 'NPT各项时间占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    }
+  ]
+
+  if (projectPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: projectCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无项目NPT数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
+
+  if (nptFieldPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: nptFieldCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无NPT项数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
 
   chart.setOption({
     tooltip: {
       trigger: 'item',
-      formatter: '{b}<br/>NPT合计: {c} H<br/>占比: {d}%'
-    },
-    legend: {
-      type: 'scroll',
-      orient: 'vertical',
-      right: 24,
-      top: 32,
-      bottom: 24
+      formatter: (params: any) =>
+        `${params.seriesName}<br/>${params.name}: ${formatNumber(params.value)} H<br/>占比: ${params.percent}%`
     },
-    graphic:
-      pieData.length === 0
-        ? {
-            type: 'text',
-            left: 'center',
-            top: 'middle',
-            style: {
-              text: '暂无NPT数据',
-              fill: '#909399',
-              fontSize: 14
-            }
-          }
-        : undefined,
+    legend: [
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        left: 16,
+        top: 64,
+        bottom: 24,
+        data: projectPieData.map((item) => item.name)
+      },
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        right: 16,
+        top: 64,
+        bottom: 24,
+        data: nptFieldPieData.map((item) => item.name)
+      }
+    ],
+    graphic,
     series: [
       {
-        name: 'NPT合计',
+        name: '项目NPT占比',
+        type: 'pie',
+        radius: ['34%', '56%'],
+        center: ['25%', '55%'],
+        avoidLabelOverlap: true,
+        itemStyle: {
+          borderRadius: 4,
+          borderColor: '#fff',
+          borderWidth: 2
+        },
+        label: {
+          formatter: '{b}: {d}%'
+        },
+        data: projectPieData
+      },
+      {
+        name: 'NPT各项时间占比',
         type: 'pie',
-        radius: ['42%', '68%'],
-        center: ['50%', '50%'],
+        radius: ['34%', '56%'],
+        center: ['73%', '55%'],
         avoidLabelOverlap: true,
         itemStyle: {
           borderRadius: 4,
@@ -260,7 +350,7 @@ const renderChart = () => {
         label: {
           formatter: '{b}: {d}%'
         },
-        data: pieData
+        data: nptFieldPieData
       }
     ]
   })

+ 118 - 28
src/views/pms/iotrydailyreport/components/XjNonProductionEfficiency.vue

@@ -205,10 +205,22 @@ const getPieData = () => {
     .filter((item) => item.value > 0)
 }
 
-const resizeChart = () => {
-  chart?.resize()
+const getNptFieldPieData = () => {
+  const excludedFields: Array<keyof ListItem> = ['selfStopTime', 'relocationTime', 'winterBreakTime']
+
+  return nonProductionTimeFields
+    .filter(([field]) => !excludedFields.includes(field))
+    .map(([field, label]) => ({
+      name: label,
+      value: getFieldTotal(field)
+    }))
+    .filter((item) => item.value > 0)
 }
 
+const resizeChart = useDebounceFn(() => {
+  renderChart()
+}, 150)
+
 const renderChart = () => {
   if (!chartRef.value) return
 
@@ -218,39 +230,117 @@ const renderChart = () => {
   window.removeEventListener('resize', resizeChart)
   window.addEventListener('resize', resizeChart)
 
-  const pieData = getPieData()
+  const projectPieData = getPieData()
+  const nptFieldPieData = getNptFieldPieData()
+  const chartWidth = chart.getWidth()
+  const chartHeight = chart.getHeight()
+  const projectCenter = chartWidth * 0.25
+  const nptFieldCenter = chartWidth * 0.73
+  const pieCenterY = chartHeight * 0.55
+  const graphic: any[] = [
+    {
+      type: 'text',
+      x: projectCenter,
+      y: 32,
+      style: {
+        text: '项目NPT占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    },
+    {
+      type: 'text',
+      x: nptFieldCenter,
+      y: 32,
+      style: {
+        text: 'NPT各项时间占比',
+        fill: '#303133',
+        fontSize: 14,
+        fontWeight: 500,
+        textAlign: 'center',
+        textVerticalAlign: 'middle'
+      }
+    }
+  ]
+
+  if (projectPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: projectCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无项目NPT数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
+
+  if (nptFieldPieData.length === 0) {
+    graphic.push({
+      type: 'text',
+      x: nptFieldCenter,
+      y: pieCenterY,
+      style: {
+        text: '暂无NPT项数据',
+        fill: '#909399',
+        fontSize: 14,
+        textAlign: 'center'
+      }
+    })
+  }
 
   chart.setOption({
     tooltip: {
       trigger: 'item',
-      formatter: '{b}<br/>NPT合计: {c} H<br/>占比: {d}%'
-    },
-    legend: {
-      type: 'scroll',
-      orient: 'vertical',
-      right: 24,
-      top: 32,
-      bottom: 24
+      formatter: (params: any) =>
+        `${params.seriesName}<br/>${params.name}: ${formatNumber(params.value)} H<br/>占比: ${params.percent}%`
     },
-    graphic:
-      pieData.length === 0
-        ? {
-            type: 'text',
-            left: 'center',
-            top: 'middle',
-            style: {
-              text: '暂无NPT数据',
-              fill: '#909399',
-              fontSize: 14
-            }
-          }
-        : undefined,
+    legend: [
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        left: 16,
+        top: 64,
+        bottom: 24,
+        data: projectPieData.map((item) => item.name)
+      },
+      {
+        type: 'scroll',
+        orient: 'vertical',
+        right: 16,
+        top: 64,
+        bottom: 24,
+        data: nptFieldPieData.map((item) => item.name)
+      }
+    ],
+    graphic,
     series: [
       {
-        name: 'NPT合计',
+        name: '项目NPT占比',
+        type: 'pie',
+        radius: ['34%', '56%'],
+        center: ['25%', '55%'],
+        avoidLabelOverlap: true,
+        itemStyle: {
+          borderRadius: 4,
+          borderColor: '#fff',
+          borderWidth: 2
+        },
+        label: {
+          formatter: '{b}: {d}%'
+        },
+        data: projectPieData
+      },
+      {
+        name: 'NPT各项时间占比',
         type: 'pie',
-        radius: ['42%', '68%'],
-        center: ['50%', '50%'],
+        radius: ['34%', '56%'],
+        center: ['73%', '55%'],
         avoidLabelOverlap: true,
         itemStyle: {
           borderRadius: 4,
@@ -260,7 +350,7 @@ const renderChart = () => {
         label: {
           formatter: '{b}: {d}%'
         },
-        data: pieData
+        data: nptFieldPieData
       }
     ]
   })

+ 14 - 20
src/views/pms/iotrydailyreport/summary.vue

@@ -5,6 +5,10 @@ import { useUserStore } from '@/store/modules/user'
 import DailyStatistics from './components/DailyStatistics.vue'
 import NonProductionEfficiency from './components/NonProductionEfficiency.vue'
 
+defineOptions({
+  name: 'IotRyDailyReportSummary'
+})
+
 const deptId = useUserStore().getUser.deptId
 
 interface Query {
@@ -55,19 +59,16 @@ const resetQuery = () => {
 
 <template>
   <div
-    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
-  >
+    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
     <DeptTreeSelect
       :deptId="id"
       :top-id="158"
       v-model="query.deptId"
       @node-click="handleDeptNodeClick"
-      class="row-span-3"
-    />
+      class="row-span-3" />
     <el-form
       size="default"
-      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
-    >
+      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between">
       <div class="flex items-center gap-8">
         <el-form-item label="项目">
           <el-input
@@ -75,8 +76,7 @@ const resetQuery = () => {
             placeholder="请输入项目"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="任务">
           <el-input
@@ -84,8 +84,7 @@ const resetQuery = () => {
             placeholder="请输入任务"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="创建时间">
           <el-date-picker
@@ -96,8 +95,7 @@ const resetQuery = () => {
             end-placeholder="结束日期"
             :shortcuts="rangeShortcuts"
             :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-            class="!w-220px"
-          />
+            class="!w-220px" />
         </el-form-item>
       </div>
       <el-form-item>
@@ -112,15 +110,13 @@ const resetQuery = () => {
       <el-button
         size="default"
         :type="activeTab === '日报统计' ? 'primary' : 'default'"
-        @click="activeTab = '日报统计'"
-      >
+        @click="activeTab = '日报统计'">
         日报统计
       </el-button>
       <el-button
         size="default"
         :type="activeTab === '非生产时效' ? 'primary' : 'default'"
-        @click="activeTab = '非生产时效'"
-      >
+        @click="activeTab = '非生产时效'">
         非生产时效
       </el-button>
     </el-button-group>
@@ -129,14 +125,12 @@ const resetQuery = () => {
       v-if="activeTab === '日报统计'"
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
     <NonProductionEfficiency
       v-else
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
   </div>
 </template>
 

+ 14 - 20
src/views/pms/iotrydailyreport/xsummary.vue

@@ -5,6 +5,10 @@ import { useUserStore } from '@/store/modules/user'
 import XjDailyStatistics from './components/XjDailyStatistics.vue'
 import XjNonProductionEfficiency from './components/XjNonProductionEfficiency.vue'
 
+defineOptions({
+  name: 'IotRyXjDailyReportSummary'
+})
+
 const deptId = useUserStore().getUser.deptId
 
 interface Query {
@@ -55,19 +59,16 @@ const resetQuery = () => {
 
 <template>
   <div
-    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
-  >
+    class="grid grid-cols-[auto_1fr] grid-rows-[62px_48px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
     <DeptTreeSelect
       :deptId="id"
       :top-id="158"
       v-model="query.deptId"
       @node-click="handleDeptNodeClick"
-      class="row-span-3"
-    />
+      class="row-span-3" />
     <el-form
       size="default"
-      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
-    >
+      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between">
       <div class="flex items-center gap-8">
         <el-form-item label="项目">
           <el-input
@@ -75,8 +76,7 @@ const resetQuery = () => {
             placeholder="请输入项目"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="任务">
           <el-input
@@ -84,8 +84,7 @@ const resetQuery = () => {
             placeholder="请输入任务"
             clearable
             @keyup.enter="handleQuery()"
-            class="!w-240px"
-          />
+            class="!w-240px" />
         </el-form-item>
         <el-form-item label="创建时间">
           <el-date-picker
@@ -96,8 +95,7 @@ const resetQuery = () => {
             end-placeholder="结束日期"
             :shortcuts="rangeShortcuts"
             :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-            class="!w-220px"
-          />
+            class="!w-220px" />
         </el-form-item>
       </div>
       <el-form-item>
@@ -112,15 +110,13 @@ const resetQuery = () => {
       <el-button
         size="default"
         :type="activeTab === '日报统计' ? 'primary' : 'default'"
-        @click="activeTab = '日报统计'"
-      >
+        @click="activeTab = '日报统计'">
         日报统计
       </el-button>
       <el-button
         size="default"
         :type="activeTab === '非生产时效' ? 'primary' : 'default'"
-        @click="activeTab = '非生产时效'"
-      >
+        @click="activeTab = '非生产时效'">
         非生产时效
       </el-button>
     </el-button-group>
@@ -129,14 +125,12 @@ const resetQuery = () => {
       v-if="activeTab === '日报统计'"
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
     <XjNonProductionEfficiency
       v-else
       :query="query"
       :dept-name="deptName"
-      :refresh-key="refreshKey"
-    />
+      :refresh-key="refreshKey" />
   </div>
 </template>