diff --git a/src/components/dashboard/ModeSwitchPopup.vue b/src/components/dashboard/ModeSwitchPopup.vue new file mode 100644 index 0000000..09002e1 --- /dev/null +++ b/src/components/dashboard/ModeSwitchPopup.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/components/dashboard/PlanSection.vue b/src/components/dashboard/PlanSection.vue index 9f06709..44785cc 100644 --- a/src/components/dashboard/PlanSection.vue +++ b/src/components/dashboard/PlanSection.vue @@ -502,6 +502,7 @@ defineExpose({ loadData }) border-radius: 20rpx; padding: 28rpx; box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05); + margin-top: 24rpx; } .section-header { @@ -613,7 +614,7 @@ defineExpose({ loadData }) .trend-stat-card { flex-shrink: 0; - width: 164rpx; + width: 152rpx; background: #f8fafc; border-radius: 12rpx; padding: 20rpx 12rpx; diff --git a/src/components/dashboard/QualitySection.vue b/src/components/dashboard/QualitySection.vue new file mode 100644 index 0000000..362da9e --- /dev/null +++ b/src/components/dashboard/QualitySection.vue @@ -0,0 +1,373 @@ + + + + + \ No newline at end of file diff --git a/src/components/dashboard/StatsSection.vue b/src/components/dashboard/StatsSection.vue index bce7abc..cfbf31e 100644 --- a/src/components/dashboard/StatsSection.vue +++ b/src/components/dashboard/StatsSection.vue @@ -1,6 +1,10 @@ @@ -22,9 +29,16 @@ import { ref, onMounted } from 'vue' import { useI18n } from 'vue-i18n' import request from '@/utils/request' import { formatNumber } from '@/utils/format' +import PlanSection from '@/components/dashboard/PlanSection.vue' +import DeviceSection from '@/components/dashboard/DeviceSection.vue' +import ModeSwitchPopup from '@/components/dashboard/ModeSwitchPopup.vue' const { t } = useI18n() +const emit = defineEmits(['modeChange']) + +const currentMode = ref('production') + const COLOR_PALETTE = [ { border: '#1a3a5c', value: '#1a3a5c' }, { border: '#ff8c00', value: '#ff8c00' }, @@ -58,6 +72,11 @@ async function loadProductionStats() { })) } +function switchMode(mode) { + currentMode.value = mode + emit('modeChange', mode) +} + onMounted(() => { loadProductionStats() }) @@ -70,11 +89,17 @@ defineExpose({ loadProductionStats }) margin-bottom: 24rpx; } +.section-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24rpx; +} + .section-title { font-size: 32rpx; font-weight: 600; color: #1a3a5c; - margin-bottom: 24rpx; } .stats-scroll { diff --git a/src/config.js b/src/config.js index e5e6951..e6a94fa 100644 --- a/src/config.js +++ b/src/config.js @@ -1,8 +1,8 @@ // 应用全局配置 const config = { // baseUrl: 'http://47.106.185.127:48080',127.0.0.1 - baseUrl: 'https://besure.ngsk.tech:7001', - // baseUrl: 'http://192.168.5.167:48081', + // baseUrl: 'https://besure.ngsk.tech:7001', + baseUrl: 'http://192.168.5.167:48081', // baseUrl: '', // 应用信息 appInfo: { diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 7009d94..b14e8b6 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -31,7 +31,28 @@ export default { subtitle: 'Besure Digital Intelligent Control Platform', functionNav: 'Function Navigation', productionOverview: 'Production Overview', + qualityOverview: 'Quality Overview', productionPlan: 'Production Summary', + production: 'Production', + quality: 'Quality', + totalCount: 'Total', + passCount: 'Pass Count', + failCount: 'Fail Count', + qualityTrend: 'Quality Trend', + chartPlaceholder: 'Chart loading...', + totalWangongNumber: 'Total Reported', + totalPassNumber: 'Total Passed', + totalNoPassNumber: 'Total Failed', + totalPassRate: 'Total Pass Rate', + productPassRateRanking: 'Product Pass Rate Ranking', + passNumber: 'Pass Count', + noPassNumber: 'Fail Count', + periodLastWeek: 'Last Week', + periodThisWeek: 'This Week', + periodLast7Days: 'Last 7 Days', + periodLastMonth: 'Last Month', + periodThisMonth: 'This Month', + periodLastYear: 'Last Year', collapseList: 'Collapse', viewMore: 'View More ›', productName: 'Product', @@ -110,6 +131,7 @@ export default { periodLast7Days: 'Last 7 Days', periodLastMonth: 'Last Month', periodThisMonth: 'This Month', + periodLastYear: 'Last Year', utilizationRanking: 'Last 7 Days Utilization Ranking', utilizationRateTrend: 'Utilization Rate', deviceRateTrend: 'Single Device 7-Day Utilization/Boot Rate Trend', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index 930afe7..9389422 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -31,7 +31,28 @@ export default { subtitle: '必硕数字化智能中控平台', functionNav: '功能导航', productionOverview: '生产整体概况', + qualityOverview: '质量概况', productionPlan: '生产概括', + production: '生产', + quality: '质量', + totalCount: '总数', + passCount: '合格数', + failCount: '不合格数', + qualityTrend: '质量趋势', + chartPlaceholder: '图表加载中...', + totalWangongNumber: '报工总数', + totalPassNumber: '合格总数', + totalNoPassNumber: '不合格总数', + totalPassRate: '总合格率', + productPassRateRanking: '产品合格率排行', + passNumber: '合格数', + noPassNumber: '不合格数', + periodLastWeek: '上周', + periodThisWeek: '本周', + periodLast7Days: '近7日', + periodLastMonth: '上月', + periodThisMonth: '本月', + periodLastYear: '近一年', collapseList: '收起列表', viewMore: '查看更多 ›', productName: '产品名称', @@ -110,6 +131,7 @@ export default { periodLast7Days: '近7日', periodLastMonth: '上月', periodThisMonth: '本月', + periodLastYear: '近一年', utilizationRanking: '近7日平均稼动率排名', utilizationRateTrend: '稼动率', deviceRateTrend: '单设备近7日稼动率/开机率趋势', diff --git a/src/pages/index.vue b/src/pages/index.vue index 0972571..3b52d42 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -5,12 +5,9 @@ - - - - - - + + + @@ -27,10 +24,14 @@ import { onLocaleChange, offLocaleChange, setNavigationTitle } from '@/locales' import BannerSection from '@/components/dashboard/BannerSection.vue' import NavSection from '@/components/dashboard/NavSection.vue' import StatsSection from '@/components/dashboard/StatsSection.vue' -import PlanSection from '@/components/dashboard/PlanSection.vue' -import DeviceSection from '@/components/dashboard/DeviceSection.vue' +import QualitySection from '@/components/dashboard/QualitySection.vue' const scrollTop = ref(0) +const currentMode = ref('production') + +function onModeChange(mode) { + currentMode.value = mode +} const currentScrollTop = ref(0) const showGoTop = ref(false) diff --git a/vite.config.js b/vite.config.js index 3f853d4..2fc67ce 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,9 +3,8 @@ import uni from '@dcloudio/vite-plugin-uni' export default defineConfig(() => { return { - base: './', + base: '/', build: { - minify: true, outDir: 'dist', }, server: {