From ef09887144cee14b87196e09f1acebb18c587bcc Mon Sep 17 00:00:00 2001
From: zhang_nuo <zhang_12370@163.com>
Date: 星期五, 06 二月 2026 18:03:15 +0800
Subject: [PATCH] 调整生产订单 调整生产工单页面逻辑 调整主页ui排版 修改质量模块大屏ui排版和没有数据的状态
---
src/views/index.vue | 158 +++++++++++++--
src/views/reportAnalysis/qualityAnalysis/components/center-bottom.vue | 6
src/views/reportAnalysis/qualityAnalysis/index.vue | 2
src/views/productionManagement/productionOrder/New.vue | 11
src/views/reportAnalysis/qualityAnalysis/components/right-top.vue | 154 +++++++++++---
src/views/reportAnalysis/qualityAnalysis/components/left-top.vue | 2
src/views/productionManagement/workOrder/index.vue | 12
src/views/reportAnalysis/qualityAnalysis/components/center-center.vue | 178 +++++++++--------
src/views/reportAnalysis/qualityAnalysis/components/right-bottom.vue | 2
src/views/productionManagement/productionOrder/index.vue | 38 +-
src/views/reportAnalysis/qualityAnalysis/components/left-bottom.vue | 2
11 files changed, 380 insertions(+), 185 deletions(-)
diff --git a/src/views/index.vue b/src/views/index.vue
index 7968b2e..59eb106 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -698,37 +698,78 @@
display: flex;
gap: 20px;
margin-bottom: 20px;
- align-items: flex-start;
- justify-content: space-evenly;
+ align-items: stretch;
+ justify-content: flex-start;
+ flex-wrap: nowrap;
}
+
+.top-left {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ height: 180px;
+ flex: 0 0 320px;
+ min-width: 280px;
+}
+
+.data-cards {
+ flex: 1 1 auto;
+ min-width: 0;
+ display: flex;
+ gap: 16px;
+ justify-content: flex-start;
+ background: #ffffff;
+ border-radius: 12px;
+ padding: 20px;
+ overflow: hidden;
+}
+
+.todo-panel {
+ background: #fff;
+ border-radius: 12px;
+ padding: 20px;
+ height: 180px;
+ flex: 0 0 360px;
+ min-width: 320px;
+}
+
+.welcome-banner {
+ padding: 12px 14px;
+ background: linear-gradient(135deg, rgba(229, 240, 255, 0.95), rgba(214, 232, 255, 0.75), rgba(207, 236, 255, 0.95));
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 4px;
+ flex-direction: column;
+}
+
+.welcome-title {
+ flex: 1 1 auto;
+ min-width: 0;
+ font-size: 12px;
+ font-weight: bolder;
+ color: #222;
+ line-height: 1.3;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.welcome-time {
+ flex: 0 0 auto;
+ margin-top: 0;
+ font-size: 8px;
+ font-weight: bold;
+ color: rgba(0, 0, 0, 0.55);
+ white-space: nowrap;
+}
+
.company-info {
padding: 0;
overflow: hidden;
border-radius: 12px;
background: #fff;
height: 100%;
-}
-
-.welcome-banner {
- padding: 10px 10px;
- background: linear-gradient(135deg, rgba(229, 240, 255, 0.9), rgba(214, 232, 255, 0.7), rgba(207, 236, 255, 0.9));
-}
-
-.welcome-title {
- font-size: 18px;
- font-weight: 700;
- color: #222;
- line-height: 1.3;
-}
-
-.welcome-user {
- margin-right: 6px;
-}
-
-.welcome-time {
- margin-top: 10px;
- font-size: 16px;
- color: rgba(0, 0, 0, 0.55);
}
.user-card {
@@ -785,7 +826,6 @@
flex: 0 0 auto;
}
.data-cards {
- width: 50%;
display: flex;
gap: 16px;
justify-content: flex-start;
@@ -849,14 +889,16 @@
flex-direction: column;
gap: 20px;
height: 180px;
- width: 20%;
+ flex: 0 0 320px;
+ min-width: 280px;
}
.todo-panel {
background: #fff;
border-radius: 12px;
padding: 20px;
height: 180px;
- width: 30%;
+ flex: 0 0 360px;
+ min-width: 320px;
}
.todo-list {
height: 100px;
@@ -1151,4 +1193,66 @@
min-width: 220px;
}
}
+
+@media (max-width: 1280px) {
+ .dashboard-top {
+ flex-wrap: wrap;
+ }
+
+ .top-left {
+ flex: 1 1 320px;
+ }
+
+ .data-cards {
+ flex: 1 1 560px;
+ }
+
+ .todo-panel {
+ flex: 1 1 320px;
+ min-width: 280px;
+ height: auto;
+ }
+}
+
+@media (max-width: 768px) {
+ .dashboard {
+ padding: 12px;
+ }
+
+ .dashboard-top {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .top-left,
+ .data-cards,
+ .todo-panel {
+ width: 100%;
+ flex: 1 1 auto;
+ min-width: 0;
+ }
+
+ .top-left {
+ height: auto;
+ }
+
+ .data-cards {
+ flex-wrap: wrap;
+ }
+
+ .data-card {
+ width: calc(50% - 8px);
+ min-width: 160px;
+ }
+
+ .welcome-banner {
+ flex-direction: column;
+ align-items: flex-start;
+
+ }
+
+ .welcome-title {
+ white-space: normal;
+ }
+}
</style>
\ No newline at end of file
diff --git a/src/views/productionManagement/productionOrder/New.vue b/src/views/productionManagement/productionOrder/New.vue
index 1e93cfb..ac6fb2a 100644
--- a/src/views/productionManagement/productionOrder/New.vue
+++ b/src/views/productionManagement/productionOrder/New.vue
@@ -54,11 +54,11 @@
>
<el-date-picker
v-model="formState.productionDate"
- type="date"
+ type="datetime"
placeholder="璇烽�夋嫨鐢熶骇鏃ユ湡"
:size="size"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD HH:mm:ss"
+ value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%"
/>
</el-form-item>
@@ -116,7 +116,8 @@
productModelName: "",
unit: "",
quantity: 0,
- productionDate: new Date().toISOString().substr(0, 10),
+ // 榛樿鏈夊勾鏈堟棩鏃跺垎绉�
+ productionDate: new Date().toISOString().substr(0, 10) + ' 00:00:00',
});
const isShow = computed({
@@ -141,7 +142,7 @@
productName: "",
productModelName: "",
quantity: '',
- productionDate: new Date().toISOString().substr(0, 10),
+ productionDate: new Date().toISOString().substr(0, 10) + ' 00:00:00',
};
isShow.value = false;
};
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 185c1e1..c9abe3c 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -120,11 +120,11 @@
// prop: "salesContractNo",
// width: '150px',
// },
- {
- label: "瀹㈡埛鍚嶇О",
- prop: "customerName",
- width: '200px',
- },
+ // {
+ // label: "瀹㈡埛鍚嶇О",
+ // prop: "customerName",
+ // width: '200px',
+ // },
{
label: "浜у搧鍚嶇О",
prop: "productCategory",
@@ -156,23 +156,23 @@
width: 180,
},
{
- label: "寮�濮嬫棩鏈�",
- prop: "startTime",
+ label: "鐢熶骇鏃ユ湡",
+ prop: "productionDate",
formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
width: 120,
},
- {
- label: "缁撴潫鏃ユ湡",
- prop: "endTime",
- formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
- width: 120,
- },
- {
- label: "浜や粯鏃ユ湡",
- prop: "deliveryDate",
- formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
- width: 120,
- },
+ // {
+ // label: "缁撴潫鏃ユ湡",
+ // prop: "endTime",
+ // formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
+ // width: 120,
+ // },
+ // {
+ // label: "浜や粯鏃ユ湡",
+ // prop: "deliveryDate",
+ // formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
+ // width: 120,
+ // },
{
dataType: "action",
label: "鎿嶄綔",
diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index fddcb30..1539354 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -312,12 +312,12 @@
handleEdit(row);
},
},
- {
- name: "娴佽浆鍗�",
- clickFun: row => {
- downloadAndPrintWorkOrder(row);
- },
- },
+ // {
+ // name: "娴佽浆鍗�",
+ // clickFun: row => {
+ // downloadAndPrintWorkOrder(row);
+ // },
+ // },
{
name: "闄勪欢",
clickFun: row => {
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/qualityAnalysis/components/center-bottom.vue
index 24d9552..40cf699 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/center-bottom.vue
@@ -1,9 +1,6 @@
<template>
<div>
- <div class="chart-header">
<PanelHeader title="瀹屾垚妫�楠屾暟" />
- <div class="warn-range" @click="handleRangeClick">杩�7澶�</div>
- </div>
<div class="main-panel panel-item-customers">
<Echarts
ref="chart"
@@ -151,7 +148,6 @@
const yAxis1 = [
{
type: 'value',
- name: '鍗曚綅: 浠�',
nameLocation: 'start',
nameTextStyle: { color: '#B8C8E0', fontSize: 12, padding: [0, 0, 0, 10] },
axisLabel: { color: '#B8C8E0', fontSize: 12 },
@@ -247,7 +243,7 @@
border: 1px solid #1a58b0;
padding: 18px;
width: 100%;
- height: 449px;
+ height: 450px;
position: relative;
background: radial-gradient(circle at 50% 50%, rgba(78, 228, 255, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
}
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/center-center.vue b/src/views/reportAnalysis/qualityAnalysis/components/center-center.vue
index 8d28f7a..f3c9252 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/center-center.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/center-center.vue
@@ -1,23 +1,46 @@
<template>
<div>
+ <PanelHeader title="涓嶅悎鏍奸璀�" />
<div class="warn-panel">
- <div class="warn-header">
- <div class="warn-header-left">
- <div class="warn-badge"></div>
- <span class="warn-title">涓嶅悎鏍奸璀�</span>
- </div>
- <div class="warn-range" @click="handleRangeClick">杩�7澶�</div>
- </div>
-
<div class="warn-body">
<div class="warn-list" role="list">
- <div v-for="item in warnings" :key="item.id" class="warn-item" role="listitem" @click="openWarning(item)">
- <div class="warn-tag" :class="tagClass(item.type)">{{ item.parentProductTitle }}-{{ item.productTitle }}
+ <!-- loading锛氬睍绀洪鏋舵灦瀛� -->
+ <template v-if="loading">
+ <div v-for="n in 6" :key="`skeleton-${n}`" class="warn-item skeleton" role="listitem">
+ <div class="warn-tag skeleton-block"></div>
+ <div class="warn-text skeleton-block"></div>
+ <div class="warn-action skeleton-block"></div>
+ <div class="warn-date skeleton-block"></div>
</div>
- <div class="warn-text" :title="item.title">{{ item.title }}</div>
- <div class="warn-action" @click.stop="openWarning(item)">鏌ョ湅</div>
- <div class="warn-date">{{ item.date }}</div>
- </div>
+ </template>
+
+ <!-- 绌烘暟鎹細鍏堝睍绀烘灦瀛� + 绌虹姸鎬� -->
+ <template v-else-if="warnings.length === 0">
+ <div v-for="n in 4" :key="`empty-row-${n}`" class="warn-item is-empty" role="listitem">
+ <div class="warn-tag tag-empty">鈥�</div>
+ <div class="warn-text empty-text">鏆傛棤棰勮淇℃伅</div>
+ <div class="warn-action empty-action">鏌ョ湅</div>
+ <div class="warn-date empty-date">--</div>
+ </div>
+ </template>
+
+ <!-- 鏈夋暟鎹細姝e父娓叉煋 -->
+ <template v-else>
+ <div
+ v-for="item in warnings"
+ :key="item.id"
+ class="warn-item"
+ role="listitem"
+ @click="openWarning(item)"
+ >
+ <div class="warn-tag" :class="tagClass(item.type)">
+ {{ item.parentProductTitle }}-{{ item.productTitle }}
+ </div>
+ <div class="warn-text" :title="item.title">{{ item.title }}</div>
+ <div class="warn-action" @click.stop="openWarning(item)">鏌ョ湅</div>
+ <div class="warn-date">{{ item.date }}</div>
+ </div>
+ </template>
</div>
</div>
</div>
@@ -25,12 +48,13 @@
</template>
<script setup>
-import { computed, getCurrentInstance, ref, onMounted } from 'vue'
-import Echarts from '@/components/Echarts/echarts.vue'
+import { getCurrentInstance, ref, onMounted } from 'vue'
import { nonComplianceWarning } from '@/api/viewIndex.js'
+import PanelHeader from "@/views/reportAnalysis/qualityAnalysis/components/PanelHeader.vue";
const { proxy } = getCurrentInstance() || {}
+const loading = ref(false)
const warnings = ref([])
// 鍗犳瘮鏁版嵁
@@ -39,12 +63,6 @@
semiFinishedProductRatio: 0,
finishedProductRatio: 0,
})
-
-const TAG_COLORS = {
- raw: '#7C4DFF',
- final: '#F5A000',
- semi: '#FF66CC',
-}
const tagClass = (type) => {
if (type === 'raw') return 'tag-raw'
@@ -60,60 +78,8 @@
return 'raw' // 榛樿鍊�
}
-const pieChartStyle = { width: '100%', height: '100%' }
-
-const pieOptions = {
- backgroundColor: 'transparent',
- textStyle: { color: '#B8C8E0' },
-}
-
-const pieTooltip = {
- trigger: 'item',
- formatter: (p) => `${p.name}锛�${p.value}%`,
-}
-
-const pieData = computed(() => {
- return [
- { name: '鍘熸潗鏂�', value: ratios.value.rawMaterialRatio, itemStyle: { color: TAG_COLORS.raw } },
- { name: '鍗婃垚鍝�', value: ratios.value.semiFinishedProductRatio, itemStyle: { color: TAG_COLORS.semi } },
- { name: '鎴愬搧', value: ratios.value.finishedProductRatio, itemStyle: { color: TAG_COLORS.final } },
- ]
-})
-
-const pieSeries = computed(() => {
- return [
- {
- type: 'pie',
- radius: ['0%', '68%'],
- center: ['50%', '50%'],
- startAngle: 90,
- clockwise: true,
- avoidLabelOverlap: true,
- label: { show: false },
- labelLine: { show: false },
- itemStyle: {
- borderColor: '#071a3a',
- borderWidth: 4,
- shadowBlur: 14,
- shadowColor: 'rgba(0, 0, 0, 0.35)',
- },
- data: pieData.value,
- },
- {
- // 鍐呭湀鏆楃幆锛屽寮哄眰娆�
- type: 'pie',
- radius: ['70%', '74%'],
- center: ['50%', '50%'],
- silent: true,
- label: { show: false },
- labelLine: { show: false },
- itemStyle: { color: 'rgba(78, 228, 255, 0.12)' },
- data: [1],
- },
- ]
-})
-
const fetchWarnings = async () => {
+ loading.value = true
try {
const res = await nonComplianceWarning()
if (res?.code === 200 && res?.data) {
@@ -140,10 +106,14 @@
date,
}
})
+ } else {
+ warnings.value = []
}
} catch (e) {
- // 鎺ュ彛澶辫触鍒欎繚鎸佺┖鏁版嵁
+ warnings.value = []
console.error('鑾峰彇涓嶅悎鏍奸璀﹀け璐�:', e)
+ } finally {
+ loading.value = false
}
}
@@ -153,12 +123,7 @@
proxy.$modal.alert(title)
return
}
- // 鍏滃簳锛氭病鏈夊叏灞� modal 鏃剁敤 console
console.log('warning:', { ...item })
-}
-
-const handleRangeClick = () => {
- // 鍏堟寜鎴浘鍋氶潤鎬佲�滆繎7澶┾�濓紝鍚庣画鏈夌湡瀹炵瓫閫夐渶姹傚啀鎺ュ叆
}
onMounted(() => {
@@ -173,7 +138,7 @@
display: flex;
flex-direction: column;
gap: 12px;
- height: 100%;
+ height: 90%;
box-sizing: border-box;
}
@@ -352,4 +317,53 @@
opacity: 0.35;
pointer-events: none;
}
+
+.warn-empty {
+ padding: 10px 0 0;
+}
+
+.warn-item.is-empty {
+ opacity: 0.9;
+ cursor: default;
+}
+
+.tag-empty {
+ background: rgba(184, 200, 224, 0.22);
+ color: rgba(184, 200, 224, 0.85);
+ font-weight: 700;
+}
+
+.empty-text {
+ color: rgba(232, 241, 255, 0.75);
+}
+
+.empty-action {
+ color: rgba(255, 77, 79, 0.55);
+}
+
+.empty-date {
+ color: rgba(184, 200, 224, 0.45);
+}
+
+/* skeleton */
+.warn-item.skeleton {
+ pointer-events: none;
+}
+
+.skeleton-block {
+ height: 18px;
+ border-radius: 4px;
+ background: linear-gradient(90deg, rgba(184, 200, 224, 0.08) 25%, rgba(184, 200, 224, 0.18) 37%, rgba(184, 200, 224, 0.08) 63%);
+ background-size: 400% 100%;
+ animation: shimmer 1.2s ease-in-out infinite;
+}
+
+.warn-item.skeleton .warn-tag.skeleton-block {
+ height: 28px;
+}
+
+@keyframes shimmer {
+ 0% { background-position: 100% 0; }
+ 100% { background-position: -100% 0; }
+}
</style>
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/left-bottom.vue b/src/views/reportAnalysis/qualityAnalysis/components/left-bottom.vue
index 33f431d..5de1b06 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/left-bottom.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/left-bottom.vue
@@ -159,7 +159,7 @@
border: 1px solid #1a58b0;
padding: 18px;
width: 100%;
- height: 449px;
+ height: 948px;
}
.chart-wrapper {
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue b/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
index 8237a3f..bdfa196 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
@@ -304,7 +304,7 @@
border: 1px solid #1a58b0;
padding: 14px 18px;
width: 100%;
- height: 960px;
+ height: 950px;
box-sizing: border-box;
}
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/right-bottom.vue b/src/views/reportAnalysis/qualityAnalysis/components/right-bottom.vue
index 49621f3..98dfeaa 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/right-bottom.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/right-bottom.vue
@@ -163,7 +163,7 @@
border: 1px solid #1a58b0;
padding: 18px;
width: 100%;
- height: 420px;
+ height: 447px;
}
.pie-chart-wrapper {
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/right-top.vue b/src/views/reportAnalysis/qualityAnalysis/components/right-top.vue
index 890e99a..6f4ccae 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/right-top.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/right-top.vue
@@ -3,21 +3,56 @@
<PanelHeader title="涓嶅悎鏍间骇鍝佹帓鍚�" />
<div class="main-panel panel-item-customers">
<div class="main-panel-container">
- <div style="color: white" class="main-panel-box" v-for="(item, index) in panelList" :key="index">
- <!-- <div style="flex: 1" class="main-panel-box-left">{{ item.rank }}</div> -->
- <div style="flex: 1" class="main-panel-box-left">{{ item.productName }}</div>
- <div style="flex: 3" class="main-panel-box-right">
- <!-- <div class="main-panel-box-right-title">{{ item.productName }}</div> -->
- <div class="main-panel-box-right-text">
- <span>鎬绘暟閲忥細{{ item.total }}</span>
- <span>宸插畬鎴愶細{{ item.finished }}</span>
- <span>鍚堟牸鐜囷細{{ item.qualifiedRate }}%</span>
- </div>
- <div class="main-panel-box-right-progress">
- <el-progress :percentage="item.percentage" :format="format" />
+ <!-- loading锛氶鏋舵灦瀛� -->
+ <template v-if="loading">
+ <div class="main-panel-box skeleton" v-for="n in 6" :key="`sk-${n}`">
+ <div class="main-panel-box-left skeleton-block"></div>
+ <div class="main-panel-box-right">
+ <div class="main-panel-box-right-text">
+ <span class="skeleton-block"></span>
+ <span class="skeleton-block"></span>
+ <span class="skeleton-block"></span>
+ </div>
+ <div class="main-panel-box-right-progress">
+ <el-progress :percentage="0" :show-text="false" />
+ </div>
</div>
</div>
- </div>
+ </template>
+
+ <!-- empty锛氬厛缁欐灦瀛愶紝鍐嶇粰绌虹姸鎬� -->
+ <template v-else-if="panelList.length === 0">
+ <div style="color: white" class="main-panel-box is-empty" v-for="n in 4" :key="`empty-${n}`">
+ <div style="flex: 1" class="main-panel-box-left">鈥�</div>
+ <div style="flex: 3" class="main-panel-box-right">
+ <div class="main-panel-box-right-text">
+ <span>鎬绘暟閲忥細--</span>
+ <span>宸插畬鎴愶細--</span>
+ <span>鍚堟牸鐜囷細--</span>
+ </div>
+ <div class="main-panel-box-right-progress">
+ <el-progress :percentage="0" :format="format" />
+ </div>
+ </div>
+ </div>
+ </template>
+
+ <!-- data -->
+ <template v-else>
+ <div style="color: white" class="main-panel-box" v-for="(item, index) in panelList" :key="index">
+ <div style="flex: 1" class="main-panel-box-left">{{ item.productName }}</div>
+ <div style="flex: 3" class="main-panel-box-right">
+ <div class="main-panel-box-right-text">
+ <span>鎬绘暟閲忥細{{ item.total }}</span>
+ <span>宸插畬鎴愶細{{ item.finished }}</span>
+ <span>鍚堟牸鐜囷細{{ item.qualifiedRate }}%</span>
+ </div>
+ <div class="main-panel-box-right-progress">
+ <el-progress :percentage="item.percentage" :format="format" />
+ </div>
+ </div>
+ </div>
+ </template>
</div>
</div>
</div>
@@ -28,36 +63,42 @@
import { unqualifiedProductRanking } from '@/api/viewIndex.js'
import PanelHeader from './PanelHeader.vue'
+const loading = ref(false)
const panelList = ref([])
const format = (percentage) => {
return `${percentage}%`
}
-const fetchData = () => {
- unqualifiedProductRanking()
- .then((res) => {
- if (res?.code === 200 && Array.isArray(res?.data)) {
- const data = res.data
- panelList.value = data.map((item, index) => {
- const total = Number(item.totalCount) || 0
- const finished = Number(item.completedCount) || 0
- const passRate = Number(item.passRate) || 0
-
- return {
- rank: `Top${index + 1}`,
- productName: item.productName || `浜у搧${index + 1}`,
- total: total.toFixed(2),
- finished: finished.toFixed(2),
- qualifiedRate: passRate.toFixed(2),
- percentage: Math.min(100, Math.max(0, passRate)), // 纭繚鐧惧垎姣斿湪0-100涔嬮棿
- }
- })
- }
- })
- .catch((err) => {
- console.error('鑾峰彇宸ュ崟鎵ц鏁堢巼鍒嗘瀽鏁版嵁澶辫触:', err)
- })
+const fetchData = async () => {
+ loading.value = true
+ try {
+ const res = await unqualifiedProductRanking()
+ if (res?.code === 200 && Array.isArray(res?.data)) {
+ const data = res.data
+ panelList.value = data.map((item, index) => {
+ const total = Number(item.totalCount) || 0
+ const finished = Number(item.completedCount) || 0
+ const passRate = Number(item.passRate) || 0
+
+ return {
+ rank: `Top${index + 1}`,
+ productName: item.productName || `浜у搧${index + 1}`,
+ total: total.toFixed(2),
+ finished: finished.toFixed(2),
+ qualifiedRate: passRate.toFixed(2),
+ percentage: Math.min(100, Math.max(0, passRate)),
+ }
+ })
+ } else {
+ panelList.value = []
+ }
+ } catch (err) {
+ panelList.value = []
+ console.error('鑾峰彇涓嶅悎鏍间骇鍝佹帓鍚嶆暟鎹け璐�:', err)
+ } finally {
+ loading.value = false
+ }
}
onMounted(() => {
@@ -129,4 +170,43 @@
height: 449px;
overflow: hidden;
}
+
+.panel-empty {
+ padding-top: 6px;
+}
+
+.main-panel-box.is-empty {
+ opacity: 0.9;
+}
+
+.main-panel-box.skeleton {
+ pointer-events: none;
+}
+
+.skeleton-block {
+ height: 18px;
+ border-radius: 4px;
+ background: linear-gradient(90deg, rgba(184, 200, 224, 0.08) 25%, rgba(184, 200, 224, 0.18) 37%, rgba(184, 200, 224, 0.08) 63%);
+ background-size: 400% 100%;
+ animation: shimmer 1.2s ease-in-out infinite;
+}
+
+.main-panel-box-left.skeleton-block {
+ height: 28px;
+ margin: 0 20px;
+}
+
+.main-panel-box.skeleton .main-panel-box-right-text span.skeleton-block {
+ display: inline-block;
+ width: 30%;
+}
+
+@keyframes shimmer {
+ 0% {
+ background-position: 100% 0;
+ }
+ 100% {
+ background-position: -100% 0;
+ }
+}
</style>
diff --git a/src/views/reportAnalysis/qualityAnalysis/index.vue b/src/views/reportAnalysis/qualityAnalysis/index.vue
index a6458a9..ccb99a6 100644
--- a/src/views/reportAnalysis/qualityAnalysis/index.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/index.vue
@@ -275,7 +275,7 @@
flex: 1;
display: flex;
flex-direction: column;
-gap: 24px;
+gap: 16px;
width: 520px;
}
--
Gitblit v1.9.3