已添加9个文件
已修改5个文件
已删除137个文件
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = è¯å¯¼äºï¼ç®¡çä¿¡æ¯ç³»ç»ï¼
|
| | | VITE_APP_TITLE = å·¥èºæ¥è¦ä¼å管çç³»ç»
|
| | |
|
| | | # å¼åç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'development'
|
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = MISï¼ç®¡çä¿¡æ¯ç³»ç»ï¼
|
| | | VITE_APP_TITLE = å·¥èºæ¥è¦ä¼å管çç³»ç»
|
| | |
|
| | | # ç产ç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'production'
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // æ¥è¯¢æ¥è¦é
ç½®å表 |
| | | export function listAlarmConfig(query) { |
| | | return request({ |
| | | url: '/alarm/config/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦é
置详ç»ä¿¡æ¯ |
| | | export function getAlarmConfig(configId) { |
| | | return request({ |
| | | url: '/alarm/config/' + configId, |
| | | method: 'get' |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢æ¥è¦é
ç½® |
| | | export function addAlarmConfig(data) { |
| | | return request({ |
| | | url: '/alarm/config', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹æ¥è¦é
ç½® |
| | | export function updateAlarmConfig(data) { |
| | | return request({ |
| | | url: '/alarm/config', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // å 餿¥è¦é
ç½® |
| | | export function delAlarmConfig(configIds) { |
| | | return request({ |
| | | url: '/alarm/config/' + configIds, |
| | | method: 'delete' |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹æ¥è¦é
ç½®ç¶æ |
| | | export function changeStatus(configId, status) { |
| | | const data = { |
| | | configId, |
| | | status |
| | | }; |
| | | return request({ |
| | | url: '/alarm/config/changeStatus', |
| | | method: 'put', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åºæ¥è¦é
ç½® |
| | | export function exportAlarmConfig(query) { |
| | | return request({ |
| | | url: '/alarm/config/export', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // æ¥è¯¢æ¥è¦åå²å表 |
| | | export function listAlarmHistory(query) { |
| | | return request({ |
| | | url: '/alarm/history/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦åå²è¯¦æ
|
| | | export function getAlarmHistoryDetail(alarmId) { |
| | | return request({ |
| | | url: '/alarm/history/detail/' + alarmId, |
| | | method: 'get' |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åºæ¥è¦åå² |
| | | export function exportAlarmHistory(query) { |
| | | return request({ |
| | | url: '/alarm/history/export', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // æ¥è¯¢æ¥è¦çæ§å表 |
| | | export function listAlarmMonitor(query) { |
| | | return request({ |
| | | url: '/alarm/monitor/list', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // 确认æ¥è¦ |
| | | export function confirmAlarm(data) { |
| | | return request({ |
| | | url: '/alarm/monitor/confirm', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // è§£å³æ¥è¦ |
| | | export function resolveAlarm(data) { |
| | | return request({ |
| | | url: '/alarm/monitor/resolve', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦è¯¦æ
|
| | | export function getAlarmDetail(alarmId) { |
| | | return request({ |
| | | url: '/alarm/monitor/detail/' + alarmId, |
| | | method: 'get' |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // è·åæ¥è¦ç»è®¡æ°æ® |
| | | export function getAlarmStatistics(query) { |
| | | return request({ |
| | | url: '/alarm/statistics', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦ç±»ååå¸ |
| | | export function getAlarmTypeDistribution(query) { |
| | | return request({ |
| | | url: '/alarm/statistics/typeDistribution', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦ç级åå¸ |
| | | export function getAlarmLevelDistribution(query) { |
| | | return request({ |
| | | url: '/alarm/statistics/levelDistribution', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦è¶å¿åæ |
| | | export function getAlarmTrend(query) { |
| | | return request({ |
| | | url: '/alarm/statistics/trend', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åè®¾å¤æ¥è¦æè¡æ¦ |
| | | export function getDeviceAlarmRank(query) { |
| | | return request({ |
| | | url: '/alarm/statistics/deviceRank', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // è·åæ¥è¦å¤çèæ¶ç»è®¡ |
| | | export function getHandleTimeStatistics(query) { |
| | | return request({ |
| | | url: '/alarm/statistics/handleTime', |
| | | method: 'get', |
| | | params: query |
| | | }); |
| | | } |
| | |
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | path: '/main/MobileChat',
|
| | | component: Layout,
|
| | | redirect: '',
|
| | | hidden: true,
|
| | | permissions: ['MobileChat:edit'],
|
| | | children: [
|
| | | {
|
| | | path: '',
|
| | | component: () => import('@/views/chatHome/chatHomeIndex/MobileChat'),
|
| | | name: 'MobileChat',
|
| | | meta: { title: 'AI对è¯', activeMenu: '/chatHome/chatHomeIndex'}
|
| | | }
|
| | | ]
|
| | | },
|
| | | // {
|
| | | // path: '/main/MobileChat',
|
| | | // component: Layout,
|
| | | // redirect: '',
|
| | | // hidden: true,
|
| | | // permissions: ['MobileChat:edit'],
|
| | | // children: [
|
| | | // {
|
| | | // path: '',
|
| | | // component: () => import('@/views/chatHome/chatHomeIndex/MobileChat'),
|
| | | // name: 'MobileChat',
|
| | | // meta: { title: 'AI对è¯', activeMenu: '/chatHome/chatHomeIndex'}
|
| | | // }
|
| | | // ]
|
| | | // },
|
| | | {
|
| | | path: '/system/role-auth',
|
| | | component: Layout,
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="alarm-trend-analysis"> |
| | | <el-card shadow="never" class="search-card"> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="æ¶é´èå´"> |
| | | <el-date-picker |
| | | v-model="searchForm.dateRange" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥è¦çº§å«"> |
| | | <el-select v-model="searchForm.alarmLevel" placeholder="è¯·éæ©æ¥è¦çº§å«" clearable> |
| | | <el-option label="严é" value="严é" /> |
| | | <el-option label="ä¸ç" value="ä¸ç" /> |
| | | <el-option label="轻微" value="轻微" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å"> |
| | | <el-select v-model="searchForm.equipmentType" placeholder="è¯·éæ©è®¾å¤ç±»å" clearable> |
| | | <el-option label="å·¥èºè®¾å¤" value="å·¥èºè®¾å¤" /> |
| | | <el-option label="æ£æµè®¾å¤" value="æ£æµè®¾å¤" /> |
| | | <el-option label="å
¶ä»è®¾å¤" value="å
¶ä»è®¾å¤" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">æ¥è¯¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-card shadow="never" class="chart-card"> |
| | | <template #header> |
| | | <span>æ¥è¦è¶å¿åæ</span> |
| | | </template> |
| | | <div ref="chartContainer" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20" style="margin-top: 20px;"> |
| | | <el-col :span="12"> |
| | | <el-card shadow="never" class="chart-card"> |
| | | <template #header> |
| | | <span>æ¥è¦çº§å«åå¸</span> |
| | | </template> |
| | | <div ref="levelChartContainer" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-card shadow="never" class="chart-card"> |
| | | <template #header> |
| | | <span>æ¥è¦è®¾å¤ç±»ååå¸</span> |
| | | </template> |
| | | <div ref="equipmentChartContainer" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'AlarmTrendAnalysis', |
| | | data() { |
| | | return { |
| | | searchForm: { |
| | | dateRange: [], |
| | | alarmLevel: '', |
| | | equipmentType: '' |
| | | }, |
| | | trendData: { |
| | | categories: ['12-01', '12-02', '12-03', '12-04', '12-05', '12-06', '12-07'], |
| | | severe: [8, 12, 9, 15, 11, 13, 10], |
| | | moderate: [22, 25, 20, 28, 24, 26, 23], |
| | | minor: [35, 38, 32, 40, 36, 39, 34] |
| | | }, |
| | | levelData: [ |
| | | { name: '严é', value: 78 }, |
| | | { name: 'ä¸ç', value: 178 }, |
| | | { name: '轻微', value: 272 } |
| | | ], |
| | | equipmentData: [ |
| | | { name: 'å·¥èºè®¾å¤', value: 280 }, |
| | | { name: 'æ£æµè®¾å¤', value: 120 }, |
| | | { name: 'å
¶ä»è®¾å¤', value: 128 } |
| | | ] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initCharts() |
| | | }, |
| | | methods: { |
| | | handleSearch() { |
| | | console.log('æ¥è¯¢æ°æ®', this.searchForm) |
| | | this.initCharts() |
| | | }, |
| | | initCharts() { |
| | | this.renderTrendChart() |
| | | this.renderLevelChart() |
| | | this.renderEquipmentChart() |
| | | }, |
| | | renderTrendChart() { |
| | | console.log('æ¸²ææ¥è¦è¶å¿å¾è¡¨', this.trendData) |
| | | }, |
| | | renderLevelChart() { |
| | | console.log('æ¸²ææ¥è¦çº§å«åå¸å¾è¡¨', this.levelData) |
| | | }, |
| | | renderEquipmentChart() { |
| | | console.log('æ¸²ææ¥è¦è®¾å¤ç±»ååå¸å¾è¡¨', this.equipmentData) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .alarm-trend-analysis { |
| | | padding: 16px; |
| | | background-color: #f0f2f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .search-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .chart-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .chart-container { |
| | | height: 400px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | color: #909399; |
| | | font-size: 16px; |
| | | border: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | /* æé®æ ·å¼ä¼å */ |
| | | :deep(.el-button) { |
| | | border-radius: 6px; |
| | | padding: 8px 16px; |
| | | text-align: center; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | /* è¡¨åæ§ä»¶æ ·å¼ä¼å */ |
| | | :deep(.el-input__inner), |
| | | :deep(.el-select__input) { |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | :deep(.el-date-editor) { |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | /* å¡ç头鍿 ·å¼ */ |
| | | :deep(.el-card__header) { |
| | | background-color: #fafafa; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="alarm-rule-config"> |
| | | <el-card shadow="never" class="search-card"> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="è§ååç§°"> |
| | | <el-input v-model="searchForm.ruleName" placeholder="请è¾å
¥è§ååç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å"> |
| | | <el-select v-model="searchForm.equipmentType" placeholder="è¯·éæ©è®¾å¤ç±»å"> |
| | | <el-option label="å·¥èºè®¾å¤" value="å·¥èºè®¾å¤" /> |
| | | <el-option label="æ£æµè®¾å¤" value="æ£æµè®¾å¤" /> |
| | | <el-option label="å
¶ä»è®¾å¤" value="å
¶ä»è®¾å¤" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" @click="handleReset">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card shadow="never" class="table-card"> |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>æ¥è¦è§åé
ç½®</span> |
| | | <el-button type="primary" icon="el-icon-plus" @click="handleAdd">æ°å¢è§å</el-button> |
| | | </div> |
| | | </template> |
| | | <el-table :data="ruleList" style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{textAlign: 'center'}"> |
| | | <el-table-column type="index" label="åºå·" width="80" /> |
| | | <el-table-column prop="ruleName" label="è§ååç§°" /> |
| | | <el-table-column prop="equipmentType" label="设å¤ç±»å" /> |
| | | <el-table-column prop="parameter" label="çæ§åæ°" /> |
| | | <el-table-column prop="alarmLevel" label="æ¥è¦çº§å«" /> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" width="180" show-overflow-tooltip/> |
| | | <el-table-column prop="status" label="ç¶æ" width="150"> |
| | | <template #default="scope"> |
| | | <el-switch v-model="scope.row.status" active-text="å¯ç¨" inactive-text="ç¦ç¨" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="150" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button size="small" type="text" @click="handleEdit(scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" type="text" @click="handleDelete(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="ruleList.length" |
| | | :page-size="10" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'AlarmRule', |
| | | data() { |
| | | return { |
| | | searchForm: { |
| | | ruleName: '', |
| | | equipmentType: '' |
| | | }, |
| | | ruleList: [ |
| | | { |
| | | id: 1, |
| | | ruleName: '温度è¿é«æ¥è¦', |
| | | equipmentType: 'å·¥èºè®¾å¤', |
| | | parameter: '温度', |
| | | alarmLevel: '严é', |
| | | createTime: '2025-12-01 10:30:00', |
| | | status: true |
| | | }, |
| | | { |
| | | id: 2, |
| | | ruleName: 'ååå¼å¸¸æ¥è¦', |
| | | equipmentType: 'å·¥èºè®¾å¤', |
| | | parameter: 'åå', |
| | | alarmLevel: 'ä¸ç', |
| | | createTime: '2025-12-02 14:20:00', |
| | | status: true |
| | | }, |
| | | { |
| | | id: 3, |
| | | ruleName: 'æµéè¿ä½æ¥è¦', |
| | | equipmentType: 'æ£æµè®¾å¤', |
| | | parameter: 'æµé', |
| | | alarmLevel: '轻微', |
| | | createTime: '2025-12-03 09:15:00', |
| | | status: false |
| | | }, |
| | | { |
| | | id: 4, |
| | | ruleName: 'çµåä¸ç¨³å®æ¥è¦', |
| | | equipmentType: 'å
¶ä»è®¾å¤', |
| | | parameter: 'çµå', |
| | | alarmLevel: 'ä¸ç', |
| | | createTime: '2025-12-04 16:45:00', |
| | | status: true |
| | | }, |
| | | { |
| | | id: 5, |
| | | ruleName: 'æ¶²ä½å¼å¸¸æ¥è¦', |
| | | equipmentType: 'å·¥èºè®¾å¤', |
| | | parameter: 'æ¶²ä½', |
| | | alarmLevel: '严é', |
| | | createTime: '2025-12-05 11:20:00', |
| | | status: true |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | handleSearch() { |
| | | console.log('æç´¢', this.searchForm) |
| | | }, |
| | | handleReset() { |
| | | this.searchForm = { |
| | | ruleName: '', |
| | | equipmentType: '' |
| | | } |
| | | }, |
| | | handleAdd() { |
| | | console.log('æ°å¢è§å') |
| | | }, |
| | | handleEdit(row) { |
| | | console.log('ç¼è¾è§å', row) |
| | | }, |
| | | handleDelete(row) { |
| | | console.log('å é¤è§å', row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .alarm-rule-config { |
| | | padding: 16px; |
| | | background-color: #f0f2f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .search-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .table-card { |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .card-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | .pagination { |
| | | margin-top: 16px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding-right: 20px; |
| | | } |
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="alarm-handle-knowledge"> |
| | | <el-card shadow="never" class="search-card"> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="ç¥è¯åºæ é¢"> |
| | | <el-input v-model="searchForm.title" placeholder="请è¾å
¥ç¥è¯åºæ é¢" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥è¦ç±»å"> |
| | | <el-select v-model="searchForm.alarmType" placeholder="è¯·éæ©æ¥è¦ç±»å" clearable> |
| | | <el-option label="温度æ¥è¦" value="温度æ¥è¦" /> |
| | | <el-option label="å忥è¦" value="å忥è¦" /> |
| | | <el-option label="æ¯å¨æ¥è¦" value="æ¯å¨æ¥è¦" /> |
| | | <el-option label="æ¶²ä½æ¥è¦" value="æ¶²ä½æ¥è¦" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">æç´¢</el-button> |
| | | <el-button icon="el-icon-plus" @click="handleAdd">æ°å¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card shadow="never" class="table-card" > |
| | | <el-table :data="knowledgeList" style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{textAlign: 'center'}"> |
| | | <el-table-column type="index" label="åºå·" width="80" /> |
| | | <el-table-column prop="title" label="ç¥è¯åºæ é¢" min-width="200" /> |
| | | <el-table-column prop="alarmType" label="æ¥è¦ç±»å" width="120" /> |
| | | <el-table-column prop="alarmLevel" label="æ¥è¦çº§å«" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getAlarmLevelType(scope.row.alarmLevel)"> |
| | | {{ scope.row.alarmLevel }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" width="180" /> |
| | | <el-table-column prop="creator" label="å建人" width="100" /> |
| | | <el-table-column prop="status" label="ç¶æ" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'å¯ç¨' ? 'success' : 'info'"> |
| | | {{ scope.row.status }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="250" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button size="small" type="text" icon="el-icon-view" @click="handleView(scope.row)">æ¥ç</el-button> |
| | | <el-button size="small" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="knowledgeList.length" |
| | | :page-size="10" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'AlarmHandleKnowledge', |
| | | data() { |
| | | return { |
| | | searchForm: { |
| | | title: '', |
| | | alarmType: '' |
| | | }, |
| | | knowledgeList: [ |
| | | { |
| | | id: 1, |
| | | title: 'ååºé温度è¿é«æ¥è¦å¤çæµç¨', |
| | | alarmType: '温度æ¥è¦', |
| | | alarmLevel: '严é', |
| | | createTime: '2025-12-01 14:30:00', |
| | | creator: '管çå', |
| | | status: 'å¯ç¨' |
| | | }, |
| | | { |
| | | id: 2, |
| | | title: 'ç¦»å¿æ³µæ¯å¨å¼å¸¸æ¥è¦å¤çæå', |
| | | alarmType: 'æ¯å¨æ¥è¦', |
| | | alarmLevel: 'ä¸ç', |
| | | createTime: '2025-12-02 09:15:00', |
| | | creator: '设å¤å·¥ç¨å¸', |
| | | status: 'å¯ç¨' |
| | | }, |
| | | { |
| | | id: 3, |
| | | title: 'å¨ç½æ¶²ä½è¿ä½æ¥è¦å¤çæ¹æ³', |
| | | alarmType: 'æ¶²ä½æ¥è¦', |
| | | alarmLevel: '轻微', |
| | | createTime: '2025-12-03 16:45:00', |
| | | creator: 'å·¥èºå·¥ç¨å¸', |
| | | status: 'å¯ç¨' |
| | | }, |
| | | { |
| | | id: 4, |
| | | title: 'å缩æºååè¿é«æ¥è¦åºæ¥é¢æ¡', |
| | | alarmType: 'å忥è¦', |
| | | alarmLevel: '严é', |
| | | createTime: '2025-12-04 11:20:00', |
| | | creator: 'å®å
¨ä¸»ç®¡', |
| | | status: 'å¯ç¨' |
| | | }, |
| | | { |
| | | id: 5, |
| | | title: 'å¹²ç¥æºæ¹¿åº¦å¼å¸¸æ¥è¦å¤çæµç¨', |
| | | alarmType: '湿度æ¥è¦', |
| | | alarmLevel: 'ä¸ç', |
| | | createTime: '2025-12-05 15:10:00', |
| | | creator: 'å·¥èºå·¥ç¨å¸', |
| | | status: 'ç¦ç¨' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | getAlarmLevelType(level) { |
| | | switch (level) { |
| | | case '严é': |
| | | return 'danger' |
| | | case 'ä¸ç': |
| | | return 'warning' |
| | | case '轻微': |
| | | return 'info' |
| | | default: |
| | | return 'info' |
| | | } |
| | | }, |
| | | handleSearch() { |
| | | console.log('æç´¢ç¥è¯åº', this.searchForm) |
| | | }, |
| | | handleAdd() { |
| | | console.log('æ°å¢ç¥è¯åº') |
| | | }, |
| | | handleView(row) { |
| | | console.log('æ¥çç¥è¯åºè¯¦æ
', row) |
| | | }, |
| | | handleEdit(row) { |
| | | console.log('ç¼è¾ç¥è¯åº', row) |
| | | }, |
| | | handleDelete(row) { |
| | | console.log('å é¤ç¥è¯åº', row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .alarm-handle-knowledge { |
| | | padding: 16px; |
| | | background-color: #f0f2f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .search-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .table-card { |
| | | margin-top: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .pagination { |
| | | margin-top: 16px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding-right: 20px; |
| | | } |
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="real-time-alarm"> |
| | | <el-card shadow="never" class="alarm-stats-card"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <div class="stat-item"> |
| | | <div class="stat-number severe">12</div> |
| | | <div class="stat-label">䏥鿥è¦</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div class="stat-item"> |
| | | <div class="stat-number moderate">28</div> |
| | | <div class="stat-label">ä¸çæ¥è¦</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div class="stat-item"> |
| | | <div class="stat-number minor">45</div> |
| | | <div class="stat-label">轻微æ¥è¦</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div class="stat-item"> |
| | | <div class="stat-number total">85</div> |
| | | <div class="stat-label">仿¥æ»æ¥è¦</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | |
| | | <el-card shadow="never" class="table-card"> |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>宿¶æ¥è¦çæ§</span> |
| | | <el-button type="primary" icon="el-icon-refresh" @click="handleRefresh">å·æ°</el-button> |
| | | </div> |
| | | </template> |
| | | <el-table :data="alarmList" style="width: 100%" height="500" :header-cell-style="{textAlign: 'center'}" :cell-style="{textAlign: 'center'}"> |
| | | <el-table-column type="index" label="åºå·" width="80" /> |
| | | <el-table-column prop="alarmTime" label="æ¥è¦æ¶é´" width="180" /> |
| | | <el-table-column prop="equipmentName" label="设å¤åç§°" /> |
| | | <el-table-column prop="parameter" label="æ¥è¦åæ°" /> |
| | | <el-table-column prop="alarmValue" label="æ¥è¦å¼" /> |
| | | <el-table-column prop="threshold" label="éå¼" /> |
| | | <el-table-column prop="alarmLevel" label="æ¥è¦çº§å«" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getAlarmLevelType(scope.row.alarmLevel)"> |
| | | {{ scope.row.alarmLevel }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="status" label="å¤çç¶æ" width="120"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'å·²å¤ç' ? 'success' : 'warning'"> |
| | | {{ scope.row.status }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="200" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button size="small" type="text" icon="el-icon-view" @click="handleView(scope.row)">æ¥ç</el-button> |
| | | <el-button size="small" type="text" icon="el-icon-check" @click="handleProcess(scope.row)">å¤ç</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'RealTimeAlarm', |
| | | data() { |
| | | return { |
| | | alarmList: [ |
| | | { |
| | | id: 1, |
| | | alarmTime: '2025-12-16 11:50:23', |
| | | equipmentName: 'ååºéA', |
| | | parameter: '温度', |
| | | alarmValue: '185°C', |
| | | threshold: 'â¤180°C', |
| | | alarmLevel: '严é', |
| | | status: 'æªå¤ç' |
| | | }, |
| | | { |
| | | id: 2, |
| | | alarmTime: '2025-12-16 11:48:15', |
| | | equipmentName: 'ç¦»å¿æºB', |
| | | parameter: 'æ¯å¨', |
| | | alarmValue: '0.8mm/s', |
| | | threshold: 'â¤0.5mm/s', |
| | | alarmLevel: 'ä¸ç', |
| | | status: 'æªå¤ç' |
| | | }, |
| | | { |
| | | id: 3, |
| | | alarmTime: '2025-12-16 11:45:30', |
| | | equipmentName: 'è¾éæ³µC', |
| | | parameter: 'åå', |
| | | alarmValue: '4.2MPa', |
| | | threshold: 'â¤4.0MPa', |
| | | alarmLevel: '轻微', |
| | | status: 'å·²å¤ç' |
| | | }, |
| | | { |
| | | id: 4, |
| | | alarmTime: '2025-12-16 11:42:18', |
| | | equipmentName: 'ååºéD', |
| | | parameter: 'pHå¼', |
| | | alarmValue: '4.2', |
| | | threshold: '5.0-7.0', |
| | | alarmLevel: 'ä¸ç', |
| | | status: 'æªå¤ç' |
| | | }, |
| | | { |
| | | id: 5, |
| | | alarmTime: '2025-12-16 11:38:55', |
| | | equipmentName: 'å¹²ç¥æºE', |
| | | parameter: '湿度', |
| | | alarmValue: '15%', |
| | | threshold: 'â¤10%', |
| | | alarmLevel: '轻微', |
| | | status: 'å·²å¤ç' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | getAlarmLevelType(level) { |
| | | switch (level) { |
| | | case '严é': |
| | | return 'danger' |
| | | case 'ä¸ç': |
| | | return 'warning' |
| | | case '轻微': |
| | | return 'info' |
| | | default: |
| | | return 'info' |
| | | } |
| | | }, |
| | | handleRefresh() { |
| | | console.log('å·æ°æ¥è¦æ°æ®') |
| | | }, |
| | | handleView(row) { |
| | | console.log('æ¥çæ¥è¦è¯¦æ
', row) |
| | | }, |
| | | handleProcess(row) { |
| | | console.log('å¤çæ¥è¦', row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .real-time-alarm { |
| | | padding: 16px; |
| | | background-color: #f0f2f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .alarm-stats-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .table-card { |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .stat-item { |
| | | text-align: center; |
| | | padding: 24px 16px; |
| | | background-color: #ffffff; |
| | | border-radius: 12px; |
| | | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .stat-item:hover { |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .stat-number { |
| | | font-size: 36px; |
| | | font-weight: bold; |
| | | margin-bottom: 12px; |
| | | letter-spacing: 1px; |
| | | } |
| | | |
| | | .stat-number.severe { |
| | | color: #f56c6c; |
| | | text-shadow: 0 2px 4px rgba(245, 108, 108, 0.1); |
| | | } |
| | | |
| | | .stat-number.moderate { |
| | | color: #e6a23c; |
| | | text-shadow: 0 2px 4px rgba(230, 162, 60, 0.1); |
| | | } |
| | | |
| | | .stat-number.minor { |
| | | color: #67c23a; |
| | | text-shadow: 0 2px 4px rgba(103, 194, 58, 0.1); |
| | | } |
| | | |
| | | .stat-number.total { |
| | | color: #409eff; |
| | | text-shadow: 0 2px 4px rgba(64, 158, 255, 0.1); |
| | | } |
| | | |
| | | .stat-label { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .card-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-table__header-wrapper) { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | :deep(.el-table__header th) { |
| | | font-weight: 600; |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | :deep(.el-table__body tr:hover) { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | /* æé®æ ·å¼ä¼å */ |
| | | :deep(.el-button) { |
| | | border-radius: 6px; |
| | | padding: 8px 16px; |
| | | text-align: center; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | /* æä½æ 䏿¢è¡ */ |
| | | :deep(.el-table__column--fixed-right) { |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | :deep(.el-table__fixed-right) { |
| | | height: 100% !important; |
| | | } |
| | | |
| | | /* æ ç¾æ ·å¼ä¼å */ |
| | | :deep(.el-tag) { |
| | | border-radius: 12px; |
| | | padding: 4px 12px; |
| | | font-size: 12px; |
| | | font-weight: 500; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="alarm-stats-report"> |
| | | <el-card shadow="never" class="search-card"> |
| | | <el-form :inline="true" :model="searchForm" class="demo-form-inline"> |
| | | <el-form-item label="æ¥è¡¨ç±»å"> |
| | | <el-select v-model="searchForm.reportType" placeholder="è¯·éæ©æ¥è¡¨ç±»å"> |
| | | <el-option label="æ¥æ¥" value="æ¥æ¥" /> |
| | | <el-option label="卿¥" value="卿¥" /> |
| | | <el-option label="ææ¥" value="ææ¥" /> |
| | | <el-option label="壿¥" value="壿¥" /> |
| | | <el-option label="å¹´æ¥" value="å¹´æ¥" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="searchForm.statsDate" |
| | | type="date" |
| | | placeholder="éæ©ç»è®¡æ¥æ" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">çææ¥è¡¨</el-button> |
| | | <el-button type="success" icon="el-icon-download" @click="handleExport">å¯¼åºæ¥è¡¨</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card shadow="never" class="report-card"> |
| | | <template #header> |
| | | <span>æ¥è¦ç»è®¡æ¥è¡¨ - 2025å¹´12æ</span> |
| | | </template> |
| | | |
| | | <div class="report-summary"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">æ»æ¥è¦æ°</div> |
| | | <div class="summary-value">425</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">å·²å¤çæ¥è¦</div> |
| | | <div class="summary-value handled">398</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">æªå¤çæ¥è¦</div> |
| | | <div class="summary-value pending">27</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <div class="report-content"> |
| | | <h3>1. æ¥è¦çº§å«ç»è®¡</h3> |
| | | <el-table :data="levelStats" style="width: 100%; margin-bottom: 20px;"> |
| | | <el-table-column prop="level" label="æ¥è¦çº§å«" /> |
| | | <el-table-column prop="count" label="æ°é" /> |
| | | <el-table-column prop="percentage" label="å æ¯" /> |
| | | <el-table-column prop="handled" label="å·²å¤ç" /> |
| | | <el-table-column prop="pending" label="æªå¤ç" /> |
| | | </el-table> |
| | | |
| | | <h3>2. 设å¤ç±»åæ¥è¦ç»è®¡</h3> |
| | | <el-table :data="equipmentStats" style="width: 100%; margin-bottom: 20px;"> |
| | | <el-table-column prop="type" label="设å¤ç±»å" /> |
| | | <el-table-column prop="count" label="æ¥è¦æ°é" /> |
| | | <el-table-column prop="percentage" label="å æ¯" /> |
| | | </el-table> |
| | | |
| | | <h3>3. æ¥è¦å¤çæ¶æç»è®¡</h3> |
| | | <el-table :data="handlingTimeStats" style="width: 100%; margin-bottom: 20px;"> |
| | | <el-table-column prop="range" label="å¤çæ¶é¿èå´" /> |
| | | <el-table-column prop="count" label="æ¥è¦æ°é" /> |
| | | <el-table-column prop="percentage" label="å æ¯" /> |
| | | </el-table> |
| | | |
| | | <h3>4. æåº¦æ¥è¦è¶å¿</h3> |
| | | <div ref="trendChart" class="trend-chart-container"></div> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'AlarmStatsReport', |
| | | data() { |
| | | return { |
| | | searchForm: { |
| | | reportType: 'ææ¥', |
| | | statsDate: '2025-12-01' |
| | | }, |
| | | levelStats: [ |
| | | { level: '严é', count: 78, percentage: '18.35%', handled: 75, pending: 3 }, |
| | | { level: 'ä¸ç', count: 178, percentage: '41.88%', handled: 170, pending: 8 }, |
| | | { level: '轻微', count: 169, percentage: '39.76%', handled: 153, pending: 16 } |
| | | ], |
| | | equipmentStats: [ |
| | | { type: 'å·¥èºè®¾å¤', count: 280, percentage: '65.88%' }, |
| | | { type: 'æ£æµè®¾å¤', count: 85, percentage: '20.00%' }, |
| | | { type: 'å
¶ä»è®¾å¤', count: 60, percentage: '14.12%' } |
| | | ], |
| | | handlingTimeStats: [ |
| | | { range: '0-30åé', count: 280, percentage: '65.88%' }, |
| | | { range: '30-60åé', count: 75, percentage: '17.65%' }, |
| | | { range: '1-2å°æ¶', count: 45, percentage: '10.59%' }, |
| | | { range: '2å°æ¶ä»¥ä¸', count: 25, percentage: '5.88%' } |
| | | ] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initTrendChart() |
| | | }, |
| | | methods: { |
| | | handleSearch() { |
| | | console.log('çææ¥è¡¨', this.searchForm) |
| | | }, |
| | | handleExport() { |
| | | console.log('å¯¼åºæ¥è¡¨') |
| | | }, |
| | | initTrendChart() { |
| | | console.log('åå§åè¶å¿å¾è¡¨') |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .alarm-stats-report { |
| | | padding: 16px; |
| | | background-color: #f0f2f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .search-card { |
| | | margin-bottom: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .report-card { |
| | | margin-top: 16px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .report-summary { |
| | | margin: 20px; |
| | | padding: 20px; |
| | | background-color: #fafafa; |
| | | border-radius: 8px; |
| | | border: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | .summary-item { |
| | | background-color: #ffffff; |
| | | padding: 24px 16px; |
| | | border-radius: 12px; |
| | | text-align: center; |
| | | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .summary-item:hover { |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .summary-label { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | margin-bottom: 12px; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .summary-value { |
| | | font-size: 32px; |
| | | font-weight: bold; |
| | | color: #409eff; |
| | | letter-spacing: 1px; |
| | | } |
| | | |
| | | .summary-value.handled { |
| | | color: #67c23a; |
| | | } |
| | | |
| | | .summary-value.pending { |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | .report-content { |
| | | margin: 20px; |
| | | } |
| | | |
| | | .report-content h3 { |
| | | margin-bottom: 16px; |
| | | color: #303133; |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | padding-bottom: 8px; |
| | | border-bottom: 2px solid #409eff; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .trend-chart-container { |
| | | height: 350px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | margin-top: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | color: #909399; |
| | | border: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | :deep(.el-table__header-wrapper) { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | :deep(.el-table__header th) { |
| | | font-weight: 600; |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | :deep(.el-table__body tr:hover) { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | /* æé®æ ·å¼ä¼å */ |
| | | :deep(.el-button) { |
| | | border-radius: 6px; |
| | | padding: 8px 16px; |
| | | text-align: center; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | /* è¡¨åæ§ä»¶æ ·å¼ä¼å */ |
| | | :deep(.el-input__inner), |
| | | :deep(.el-select__input) { |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | :deep(.el-date-editor) { |
| | | border-radius: 6px; |
| | | } |
| | | </style> |
| | |
| | | <div class="dashboard"> |
| | | <!-- 顶鍿¨ªå两æ --> |
| | | <div class="dashboard-top"> |
| | | <!-- å·¦ï¼ä¼ä¸ä¿¡æ¯+ä¸å¤§æ°æ®å¡çï¼ä¸ä¸æåï¼ --> |
| | | <!-- å·¦ï¼ç³»ç»æ¦è§+æ°æ®å¡ç --> |
| | | <div class="top-left"> |
| | | <div class="company-info"> |
| | | <div class="section-title">ç»éä¿¡æ¯</div> |
| | | <div class="system-info"> |
| | | <div class="section-title">å·¥èºæ¥è¦ä¼å管çç³»ç»</div> |
| | | <div style="display: flex;align-items: center;gap: 20px"> |
| | | <img :src="userStore.avatar" class="avatar" alt=""/> |
| | | <div class="company-card"> |
| | | <div class="company-name">{{userStore.name}}</div> |
| | | <div class="company-meta">{{userStore.roleName}}</div> |
| | | <div class="system-card"> |
| | | <div class="system-name">å·¥èºæ¥è¦ä¼å管çç³»ç»</div> |
| | | <div class="system-meta">宿¶çæ§ Â· æºè½åæ · 髿å¤ç</div> |
| | | </div> |
| | | <div style="display: flex;align-items: center;gap: 8px"> |
| | | <el-icon color="#5053B5" size="22"><Clock /></el-icon> |
| | | <span>ç»éæ¥æï¼{{userStore.currentLoginTime}}</span> |
| | | <span>å½åæ¶é´ï¼{{ currentTime }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="data-cards"> |
| | | <div class="data-card sales"> |
| | | <div class="data-title">é宿°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">æ¬æéå®é¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthSaleMoney}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">æªå¼ç¥¨éé¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthSaleHaveMoney}}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="data-card total"> |
| | | <div class="data-title">æ»æ¥è¦æ°</div> |
| | | <div class="data-value">{{ alarmStats.total }}</div> |
| | | <div class="data-desc">å·²å¤ç {{ alarmStats.handled }} | æªå¤ç {{ alarmStats.pending }}</div> |
| | | </div> |
| | | <div class="data-card purchase"> |
| | | <div class="data-title">éè´æ°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">æ¬æéè´é¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthPurchaseMoney}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">å¾
仿¬¾éé¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthPurchaseHaveMoney}}</div> |
| | | </div> |
| | | </div> |
| | | <div class="data-card pending"> |
| | | <div class="data-title">æªå¤çæ¥è¦</div> |
| | | <div class="data-value">{{ alarmStats.pending }}</div> |
| | | <div class="data-desc">严é {{ alarmStats.severePending }} | ä¸ç {{ alarmStats.moderatePending }} | 轻微 {{ alarmStats.minorPending }}</div> |
| | | </div> |
| | | <div class="data-card inventory"> |
| | | <div class="data-title">åºåæ°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">å½ååºåæ»é/ä»¶</div> |
| | | <div class="data-value">{{businessInfo.inventoryNum}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">仿¥å
¥åº/ä»¶</div> |
| | | <div class="data-value">{{businessInfo.todayInventoryNum}}</div> |
| | | </div> |
| | | </div> |
| | | <div class="data-card today"> |
| | | <div class="data-title">仿¥æ¥è¦</div> |
| | | <div class="data-value">{{ alarmStats.today }}</div> |
| | | <div class="data-desc">忝 {{ alarmStats.today忝 }}% | ç¯æ¯ {{ alarmStats.todayç¯æ¯ }}%</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- å³ï¼å¾
åäºé¡¹ --> |
| | | <div class="todo-panel"> |
| | | <div class="section-title">å¾
åäºé¡¹</div> |
| | | <ul class="todo-list" v-if="todoList.length > 0"> |
| | | <li v-for="item in todoList" :key="item.id"> |
| | | <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 20px"> |
| | | <!-- å³ï¼å¾
å¤çæ¥è¦å表 --> |
| | | <div class="alarm-panel"> |
| | | <div class="section-title">å¾
å¤çæ¥è¦</div> |
| | | <ul class="alarm-list" v-if="pendingAlarms.length > 0"> |
| | | <li v-for="item in pendingAlarms" :key="item.id"> |
| | | <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 10px"> |
| | | <div style="display: flex;justify-content: space-between;align-items: center;"> |
| | | <div class="todo-title">æµç¨ç¼å·ï¼{{item.approveId}}</div> |
| | | <div class="todo-division">ç³è¯·é¨é¨ï¼{{item.approveDeptName}}</div> |
| | | <div class="todo-time">{{item.approveTime}}</div> |
| | | <div class="alarm-title">{{ item.equipmentName }} - {{ item.parameter }}</div> |
| | | <el-tag :type="getAlarmLevelType(item.alarmLevel)">{{ item.alarmLevel }}</el-tag> |
| | | </div> |
| | | <div class="todo-division">审æ¹äºç±ï¼{{item.approveReason}}</div> |
| | | <div style="display: flex;justify-content: space-between;align-items: center;"> |
| | | <div class="alarm-value">æ¥è¦å¼: {{ item.alarmValue }} | éå¼: {{ item.threshold }}</div> |
| | | <div class="alarm-time">{{ item.alarmTime }}</div> |
| | | </div> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | <div v-else style="text-align: center"> |
| | | ææ æ°æ® |
| | | <div v-else style="text-align: center; color: #909399; padding: 20px;"> |
| | | ææ å¾
å¤çæ¥è¦ |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- ä¸é¨æ¨ªå两æ --> |
| | | <div class="dashboard-row"> |
| | | <div class="main-panel"> |
| | | <div class="section-title">客æ·ååéé¢åæ</div> |
| | | <div class="contract-summary"> |
| | | <div class="contract-info"> |
| | | <img src="../assets/images/khtitle.png" alt="" style="width: 42px"/> |
| | | <div class="contract-card"> |
| | | <div class="contract-name">æ»ååéé¢(å
)</div> |
| | | <div class="contract-meta"> |
| | | <div class="main-amount">{{sum}}</div> |
| | | <div>å¨åæ¯: <span class="up">{{yny}}% </span> æ¥ç¯æ¯: <span class="up">{{chain}}% </span></div> |
| | | </div> |
| | | </div> |
| | | <div class="section-title">æ¥è¦è¶å¿åæ</div> |
| | | <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries" :tooltip="tooltipLine" :xAxis="xAxis" :yAxis="yAxis" style="height: 300px;"></Echarts> |
| | | </div> |
| | | <div class="main-panel"> |
| | | <div class="section-title">æ¥è¦çº§å«åå¸</div> |
| | | <div style="display: flex;align-items: center;gap: 20px;justify-content: space-evenly;height: 300px;"> |
| | | <div style="width: 50%;"> |
| | | <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStylePie" :series="levelPieSeries" :tooltip="pieTooltip"></Echarts> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;align-items: center;gap: 20px;justify-content: space-evenly;height: 180px;margin-top: 20px"> |
| | | <div> |
| | | <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStylePie" |
| | | :series="materialPieSeries" |
| | | :tooltip="pieTooltip"></Echarts> |
| | | </div> |
| | | <ul class="contract-list"> |
| | | <li v-for="item in materialPieSeries[0].data" :key="item.name"> |
| | | <ul class="level-list" style="width: 50%;"> |
| | | <li v-for="item in levelPieSeries[0].data" :key="item.name"> |
| | | <div style="display: flex;align-items: center;justify-content: space-between;width: 100%"> |
| | | <div class="line" :style="{color: item.itemStyle.color}">â{{item.name}}</div> |
| | | <div style="width: 70px">{{item.rate}}%</div> |
| | | <div>ï¿¥{{item.value}}</div> |
| | | <div class="line" :style="{color: item.itemStyle.color}">â{{ item.name }}</div> |
| | | <div style="width: 60px;">{{ item.value }}次</div> |
| | | <div style="width: 60px;">{{ item.rate }}%</div> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <div class="main-panel"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <div class="section-title">åºæ¶åºä»ç»è®¡</div> |
| | | <!-- <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">--> |
| | | <!-- <el-radio-button label="æå¨" :value="1" />--> |
| | | <!-- <el-radio-button label="ææ" :value="2" />--> |
| | | <!-- <el-radio-button label="æå£åº¦" :value="3" />--> |
| | | <!-- </el-radio-group>--> |
| | | </div> |
| | | <Echarts ref="chart" |
| | | :color="barColors2" |
| | | :chartStyle="chartStyle" |
| | | :grid="grid" |
| | | :series="barSeries" |
| | | :tooltip="tooltip" |
| | | :xAxis="xAxis" |
| | | :yAxis="yAxis" |
| | | style="height: 260px"></Echarts> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- åºé¨æ¨ªå两æ --> |
| | | <div class="dashboard-row"> |
| | | <!-- <div class="main-panel">--> |
| | | <!-- <div class="section-title">è´¨éç»è®¡</div>--> |
| | | <!-- <div class="quality-cards">--> |
| | | <!-- <div class="quality-card one">åææå·²æ£æµæ° <span>{{qualityStatisticsObject.supplierNum}}ä»¶</span></div>--> |
| | | <!-- <div class="quality-card two">è¿ç¨æ£éªæ°é <span>{{qualityStatisticsObject.processNum}}ä»¶</span></div>--> |
| | | <!-- <div class="quality-card three">åºåå·²æ£æ°é <span>{{qualityStatisticsObject.factoryNum}}ä»¶</span></div>--> |
| | | <!-- </div>--> |
| | | <!-- <Echarts ref="chart"--> |
| | | <!-- :chartStyle="chartStyle"--> |
| | | <!-- :grid="grid"--> |
| | | <!-- :legend="barLegend"--> |
| | | <!-- :series="barSeries1"--> |
| | | <!-- :tooltip="tooltip"--> |
| | | <!-- :xAxis="xAxis1"--> |
| | | <!-- :yAxis="yAxis1"--> |
| | | <!-- style="height: 260px"></Echarts>--> |
| | | <!-- </div>--> |
| | | <div class="main-panel"> |
| | | <div class="section-title">忬¾ä¸å¼ç¥¨åæ</div> |
| | | <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries" |
| | | :tooltip="tooltipLine" :xAxis="xAxis2" :yAxis="yAxis2" style="height: 270px;"></Echarts> |
| | | <div class="section-title">è®¾å¤æ¥è¦ç»è®¡</div> |
| | | <Echarts ref="chart" :color="barColors" :chartStyle="chartStyle" :grid="grid" :series="equipmentBarSeries" :tooltip="tooltip" :xAxis="equipmentXAxis" :yAxis="yAxis" style="height: 300px;"></Echarts> |
| | | </div> |
| | | <div class="main-panel"> |
| | | <div class="section-title">æ¥è¦å¤çæ¶æåæ</div> |
| | | <Echarts ref="chart" :color="barColors" :chartStyle="chartStyle" :grid="grid" :series="handlingTimeSeries" :tooltip="tooltip" :xAxis="handlingTimeXAxis" :yAxis="yAxis" style="height: 300px;"></Echarts> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue' |
| | | import { ref, onMounted, reactive, computed } from 'vue' |
| | | import Echarts from "@/components/Echarts/echarts.vue"; |
| | | import * as echarts from 'echarts'; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { |
| | | analysisCustomerContractAmounts, getAmountHalfYear, |
| | | getBusiness, |
| | | homeTodos, |
| | | qualityStatistics, |
| | | statisticsReceivablePayable |
| | | } from "@/api/viewIndex.js"; |
| | | import { Clock } from '@element-plus/icons-vue'; |
| | | |
| | | const userStore = useUserStore() |
| | | // å½åæ¶é´ |
| | | const currentTime = computed(() => { |
| | | const now = new Date(); |
| | | return now.toLocaleString('zh-CN'); |
| | | }); |
| | | |
| | | const businessInfo = ref({ |
| | | inventoryNum: 0, |
| | | monthPurchaseHaveMoney: 0, |
| | | monthPurchaseMoney: 0, |
| | | monthSaleHaveMoney: 0, |
| | | monthSaleMoney: 0, |
| | | todayInventoryNum: 0, |
| | | }) |
| | | const qualityStatisticsObject = ref({ |
| | | supplierNum: 0, |
| | | processNum: 0, |
| | | factoryNum: 0, |
| | | }) |
| | | const sum = ref(0) |
| | | const yny = ref(0) |
| | | const chain = ref(0) |
| | | // æ¥è¦ç»è®¡æ°æ® |
| | | const alarmStats = reactive({ |
| | | total: 425, |
| | | handled: 398, |
| | | pending: 27, |
| | | severePending: 8, |
| | | moderatePending: 12, |
| | | minorPending: 7, |
| | | today: 35, |
| | | today忝: '+12.5', |
| | | todayç¯æ¯: '-8.3' |
| | | }); |
| | | |
| | | const pieLegend = reactive({ |
| | | show: false, |
| | | }) |
| | | const barSeries = ref([ |
| | | // å¾
å¤çæ¥è¦å表 |
| | | const pendingAlarms = ref([ |
| | | { |
| | | type: 'bar', |
| | | data: [], |
| | | label: { |
| | | show: true, |
| | | } |
| | | }, |
| | | ]) |
| | | const barSeries1 = ref([ |
| | | { |
| | | name: 'åææä¸åæ ¼æ°', |
| | | type: 'bar', |
| | | barGap: 0, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [] |
| | | id: 1, |
| | | equipmentName: 'ååºéA', |
| | | parameter: '温度', |
| | | alarmValue: '185°C', |
| | | threshold: 'â¤180°C', |
| | | alarmLevel: '严é', |
| | | alarmTime: '2025-12-16 14:30:23' |
| | | }, |
| | | { |
| | | name: 'è¿ç¨ä¸åæ ¼æ°', |
| | | type: 'bar', |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [] |
| | | id: 2, |
| | | equipmentName: 'ç¦»å¿æºB', |
| | | parameter: 'æ¯å¨', |
| | | alarmValue: '0.8mm/s', |
| | | threshold: 'â¤0.5mm/s', |
| | | alarmLevel: 'ä¸ç', |
| | | alarmTime: '2025-12-16 14:28:15' |
| | | }, |
| | | { |
| | | name: 'åºåä¸åæ ¼æ°', |
| | | type: 'bar', |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [] |
| | | id: 3, |
| | | equipmentName: 'ååºéD', |
| | | parameter: 'pHå¼', |
| | | alarmValue: '4.2', |
| | | threshold: '5.0-7.0', |
| | | alarmLevel: 'ä¸ç', |
| | | alarmTime: '2025-12-16 14:22:18' |
| | | }, |
| | | ]) |
| | | { |
| | | id: 4, |
| | | equipmentName: 'å¹²ç¥æºE', |
| | | parameter: '湿度', |
| | | alarmValue: '15%', |
| | | threshold: 'â¤10%', |
| | | alarmLevel: '轻微', |
| | | alarmTime: '2025-12-16 14:18:55' |
| | | } |
| | | ]); |
| | | |
| | | // å¾è¡¨æ ·å¼ |
| | | const chartStyle = { |
| | | width: '100%', |
| | | height: '100%' // 设置å¾è¡¨å®¹å¨çé«åº¦ |
| | | } |
| | | height: '100%' |
| | | }; |
| | | |
| | | const chartStylePie = { |
| | | width: '140%', |
| | | height: '140%' // 设置å¾è¡¨å®¹å¨çé«åº¦ |
| | | } |
| | | width: '100%', |
| | | height: '100%' |
| | | }; |
| | | |
| | | const grid = { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | } |
| | | const barLegend = { |
| | | show: true, |
| | | data: ['åææä¸åæ ¼æ°', 'è¿ç¨ä¸åæ ¼æ°', 'åºåä¸åæ ¼æ°'] |
| | | } |
| | | const barLegend1 = { |
| | | show: true, |
| | | data: ['é¢ä»è´¦æ¬¾', 'åºä»è´¦æ¬¾', '颿¶è´¦æ¬¾', 'åºæ¶è´¦æ¬¾'] |
| | | } |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }; |
| | | |
| | | // æ¥è¦è¶å¿åæ - æçº¿å¾ |
| | | const lineLegend = { |
| | | show: true, |
| | | data: ['å¼ç¥¨', '忬¾'] |
| | | } |
| | | const tooltip = { |
| | | data: ['严é', 'ä¸ç', '轻微'] |
| | | }; |
| | | |
| | | const tooltipLine = { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | type: 'cross' |
| | | } |
| | | } |
| | | const xAxis = [{ |
| | | }; |
| | | |
| | | const xAxis = ref({ |
| | | type: 'category', |
| | | data: ['12-01', '12-02', '12-03', '12-04', '12-05', '12-06', '12-07'] |
| | | }); |
| | | |
| | | const yAxis = ref({ |
| | | type: 'value', |
| | | }] |
| | | const xAxis1 = ref([{ |
| | | type: 'category', |
| | | axisTick: { show: false }, |
| | | data: [] |
| | | }]) |
| | | const yAxis = [{ |
| | | type: 'category', |
| | | data: [ 'åºä»è´¦æ¬¾', 'åºæ¶è´¦æ¬¾',] |
| | | }] |
| | | const yAxis1 = [{ |
| | | type: 'value' |
| | | }] |
| | | const pieTooltip = reactive({ |
| | | trigger: 'item', |
| | | formatter: function (params) { |
| | | // å¨æçææç¤ºä¿¡æ¯ï¼åºäºæ°æ®é¡¹ç name 屿§ |
| | | const description = params.name === 'æ¬æåæ¬¾éé¢' ? 'æ¬æåæ¬¾éé¢' : 'åºæ¶æ¬¾éé¢'; |
| | | return `${description} ${formatNumber(params.value)}å
${params.percent}%`; |
| | | name: 'æ¥è¦æ°é' |
| | | }); |
| | | |
| | | const lineSeries = ref([ |
| | | { |
| | | name: '严é', |
| | | type: 'line', |
| | | data: [8, 12, 9, 15, 11, 13, 10], |
| | | itemStyle: { |
| | | color: '#f56c6c' |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | showSymbol: true |
| | | }, |
| | | position: 'right' |
| | | }) |
| | | const materialPieSeries = ref([ |
| | | { |
| | | name: 'ä¸ç', |
| | | type: 'line', |
| | | data: [22, 25, 20, 28, 24, 26, 23], |
| | | itemStyle: { |
| | | color: '#e6a23c' |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | showSymbol: true |
| | | }, |
| | | { |
| | | name: '轻微', |
| | | type: 'line', |
| | | data: [35, 38, 32, 40, 36, 39, 34], |
| | | itemStyle: { |
| | | color: '#67c23a' |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | showSymbol: true |
| | | } |
| | | ]); |
| | | |
| | | // æ¥è¦çº§å«åå¸ - é¥¼å¾ |
| | | const pieLegend = { |
| | | show: false |
| | | }; |
| | | |
| | | const pieTooltip = { |
| | | trigger: 'item', |
| | | formatter: '{b}: {c}次 ({d}%)' |
| | | }; |
| | | |
| | | const levelPieSeries = ref([ |
| | | { |
| | | type: 'pie', |
| | | radius: ['66%', '90%'], |
| | | radius: ['60%', '80%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderColor: '#fff', |
| | |
| | | label: { |
| | | show: false |
| | | }, |
| | | data: [] |
| | | } |
| | | ]) |
| | | const lineSeries = ref([ |
| | | { |
| | | type: 'line', |
| | | data: [], |
| | | label: { |
| | | show: true |
| | | }, |
| | | showSymbol: true, // æ¾ç¤ºåç¹ |
| | | }, |
| | | ]) |
| | | const tooltipLine = { |
| | | trigger: 'axis', |
| | | } |
| | | const yAxis2 = ref([ |
| | | { |
| | | type: 'value', |
| | | } |
| | | ]) |
| | | const xAxis2 = ref([ |
| | | { |
| | | type: 'category', |
| | | data: [], |
| | | axisLabel: { |
| | | interval: 0, |
| | | formatter: function(value) { |
| | | return value.replace(/~/g, '\n'); |
| | | data: [ |
| | | { |
| | | name: '严é', |
| | | value: 78, |
| | | rate: 18.35, |
| | | itemStyle: { color: '#f56c6c' } |
| | | }, |
| | | { |
| | | name: 'ä¸ç', |
| | | value: 178, |
| | | rate: 41.88, |
| | | itemStyle: { color: '#e6a23c' } |
| | | }, |
| | | { |
| | | name: '轻微', |
| | | value: 169, |
| | | rate: 39.76, |
| | | itemStyle: { color: '#67c23a' } |
| | | } |
| | | ] |
| | | } |
| | | ]); |
| | | |
| | | // è®¾å¤æ¥è¦ç»è®¡ - æ±ç¶å¾ |
| | | const barColors = ['#409eff', '#67c23a', '#e6a23c', '#f56c6c', '#909399']; |
| | | |
| | | const tooltip = { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }; |
| | | |
| | | const equipmentXAxis = ref({ |
| | | type: 'category', |
| | | data: ['ååºé', 'ç¦»å¿æº', 'è¾éæ³µ', 'å¹²ç¥æº', 'å缩æº'] |
| | | }); |
| | | |
| | | const equipmentBarSeries = ref([ |
| | | { |
| | | name: 'æ¥è¦æ°é', |
| | | type: 'bar', |
| | | data: [125, 85, 78, 65, 72], |
| | | itemStyle: { |
| | | color: function(params) { |
| | | return barColors[params.dataIndex % barColors.length]; |
| | | } |
| | | }, |
| | | label: { |
| | | show: true, |
| | | position: 'top' |
| | | } |
| | | } |
| | | ]) |
| | | ]); |
| | | |
| | | // å¾
åäºé¡¹ |
| | | const todoList = ref([]) |
| | | const radio1 = ref(1) |
| | | // æ¥è¦å¤çæ¶æåæ - æ±ç¶å¾ |
| | | const handlingTimeXAxis = ref({ |
| | | type: 'category', |
| | | data: ['0-30åé', '30-60åé', '1-2å°æ¶', '2å°æ¶ä»¥ä¸'] |
| | | }); |
| | | |
| | | // å¾è¡¨å¼ç¨ |
| | | const barChart = ref(null) |
| | | const lineChart = ref(null) |
| | | const barColors2 = ['#5181DB', '#D369E0', '#F2CA6D', '#60CCA8'] |
| | | const handlingTimeSeries = ref([ |
| | | { |
| | | name: 'å¤çæ°é', |
| | | type: 'bar', |
| | | data: [280, 75, 45, 25], |
| | | itemStyle: { |
| | | color: function(params) { |
| | | return barColors[params.dataIndex % barColors.length]; |
| | | } |
| | | }, |
| | | label: { |
| | | show: true, |
| | | position: 'top' |
| | | } |
| | | } |
| | | ]); |
| | | |
| | | // éæºé¢è²çæå½æ° |
| | | const getRandomColor = () => { |
| | | return '#' + Math.floor(Math.random() * 0xffffff).toString(16).padStart(6, '0'); |
| | | } |
| | | // è·åæ¥è¦çº§å«æ ·å¼ |
| | | const getAlarmLevelType = (level) => { |
| | | switch(level) { |
| | | case '严é': return 'danger'; |
| | | case 'ä¸ç': return 'warning'; |
| | | case '轻微': return 'info'; |
| | | default: return 'info'; |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getBusinessData() |
| | | analysisCustomer() |
| | | todoInfoS() |
| | | statisticsReceivable() |
| | | qualityStatisticsInfo() |
| | | getAmountHalfYearNum() |
| | | }) |
| | | // æ°æ®ç»è®¡ |
| | | const getBusinessData = () => { |
| | | getBusiness().then((res) => { |
| | | businessInfo.value = {...res.data} |
| | | }) |
| | | } |
| | | // ååéé¢ |
| | | const analysisCustomer = () => { |
| | | analysisCustomerContractAmounts().then((res) => { |
| | | sum.value = res.data.sum |
| | | yny.value = res.data.yny |
| | | chain.value = res.data.chain |
| | | // 为æ¯ä¸ªæ°æ®é¡¹åé
éæºé¢è² |
| | | materialPieSeries.value[0].data = res.data.item.map(item => ({ |
| | | ...item, |
| | | itemStyle: { color: getRandomColor() } |
| | | })) |
| | | }) |
| | | } |
| | | // å¾
åäºé¡¹ |
| | | const todoInfoS = () => { |
| | | homeTodos().then((res) => { |
| | | todoList.value = res.data |
| | | }) |
| | | } |
| | | // åºä»åºæ¶ç»è®¡ |
| | | const statisticsReceivable = (type) => { |
| | | console.log(type) |
| | | statisticsReceivablePayable({type: radio1.value}).then((res) => { |
| | | barSeries.value[0].data = [ |
| | | // { value: res.data.prepayMoney, itemStyle: { color: barColors2[0] } }, |
| | | { value: res.data.payableMoney, itemStyle: { color: barColors2[0] } }, |
| | | // { value: res.data.advanceMoney, itemStyle: { color: barColors2[2] } }, |
| | | { value: res.data.receivableMoney, itemStyle: { color: barColors2[1] } } |
| | | ] |
| | | }) |
| | | } |
| | | // è´¨æ£ç»è®¡ |
| | | const qualityStatisticsInfo = () => { |
| | | qualityStatistics().then((res) => { |
| | | res.data.item.forEach(item => { |
| | | xAxis1.value[0].data.push(item.date) |
| | | barSeries1.value[0].data.push(item.supplierNum) |
| | | barSeries1.value[1].data.push(item.processNum) |
| | | barSeries1.value[2].data.push(item.factoryNum) |
| | | }) |
| | | qualityStatisticsObject.value.supplierNum = res.data.supplierNum |
| | | qualityStatisticsObject.value.processNum = res.data.processNum |
| | | qualityStatisticsObject.value.factoryNum = res.data.factoryNum |
| | | }) |
| | | } |
| | | const getAmountHalfYearNum = async () => { |
| | | const res = await getAmountHalfYear() |
| | | console.log(res) |
| | | const monthName = [] |
| | | const receiptAmount = [] |
| | | const invoiceAmount = [] |
| | | res.data.forEach(item => { |
| | | monthName.push(item.month) |
| | | receiptAmount.push(item.receiptAmount) |
| | | invoiceAmount.push(item.invoiceAmount) |
| | | }) |
| | | // æ£ç¡®ååºå¼èµå¼ï¼å建æ°ç xAxis å series 对象 |
| | | xAxis2.value[0].data = monthName |
| | | xAxis2.value[0].data = monthName.map(item => item.replace(/~/g, '\n~')); |
| | | lineSeries.value = [ |
| | | { |
| | | name: 'å¼ç¥¨', |
| | | type: 'line', |
| | | data: receiptAmount, |
| | | stack: 'Total', |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { |
| | | offset: 0, |
| | | color: 'rgba(131, 207, 255, 1)' |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: 'rgba(186, 228, 255, 1)' |
| | | } |
| | | ]) |
| | | }, |
| | | itemStyle: { |
| | | color: '#2D99FF', |
| | | borderColor: '#2D99FF' |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | lineStyle: { |
| | | width: 0 |
| | | }, |
| | | showSymbol: true, |
| | | }, |
| | | { |
| | | name: '忬¾', |
| | | type: 'line', |
| | | data: invoiceAmount, |
| | | stack: 'Total', |
| | | lineStyle: { |
| | | width: 0 |
| | | }, |
| | | itemStyle: { |
| | | color: '#83CFFF', |
| | | borderColor: '#83CFFF' |
| | | }, |
| | | showSymbol: true, |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { |
| | | offset: 0, |
| | | color: 'rgba(54, 153, 255, 1)' |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: 'rgba(89, 169, 254, 1)' |
| | | } |
| | | ]) |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | } |
| | | ] |
| | | } |
| | | // 页é¢å è½½å®æåçåå§åæä½ |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .dashboard-top { |
| | | display: flex; |
| | | gap: 20px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .company-info { |
| | | |
| | | .system-info { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 8px; |
| | | padding: 20px; |
| | | min-width: 0; |
| | | background-color: #EFF2FB; /* ä½¿ç¨æå®çèæ¯é¢è² */ |
| | | background-image: url("../assets/images/denglu.png"); |
| | | background-size: cover; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | background-color: #EFF2FB; |
| | | border-radius: 12px; |
| | | height: 138px; |
| | | } |
| | | .avatar { |
| | | width: 60px; |
| | | height: 60px; |
| | | border-radius: 50%; |
| | | object-fit: contain; |
| | | background: #fff; |
| | | border: 1px solid #eee; |
| | | } |
| | | .company-card { |
| | | |
| | | .system-card { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | |
| | | padding-right: 15px; |
| | | } |
| | | |
| | | .company-card::after { |
| | | content: ''; |
| | | position: absolute; |
| | | right: 0; |
| | | top: 0; |
| | | bottom: 0; |
| | | width: 1px; |
| | | background-color: #C9C5C5; |
| | | border-radius: 2px; |
| | | } |
| | | .company-name { |
| | | font-weight: 400; |
| | | font-size: 16px; |
| | | .system-name { |
| | | font-weight: 600; |
| | | font-size: 18px; |
| | | color: #161A9A; |
| | | } |
| | | .company-meta { |
| | | |
| | | .system-meta { |
| | | font-weight: 400; |
| | | font-size: 12px; |
| | | color: #818185; |
| | | } |
| | | |
| | | .data-cards { |
| | | display: flex; |
| | | gap: 16px; |
| | |
| | | border-radius: 12px; |
| | | padding: 20px; |
| | | } |
| | | .data-title { |
| | | font-weight: 700; |
| | | font-size: 26px; |
| | | color: #FFFFFF; |
| | | } |
| | | .data-num { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .data-card { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 14px 10px 10px 10px; |
| | | padding: 16px; |
| | | min-width: 160px; |
| | | box-shadow: 0 2px 8px #eee; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 32%; |
| | | height: 140px; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .data-card.sales { |
| | | background-image: url("../assets/images/xioashoushuju.png"); |
| | | background-size: cover; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | |
| | | .data-card:hover { |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | } |
| | | .data-card.purchase { |
| | | background-image: url("../assets/images/caigou.png"); |
| | | background-size: cover; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | |
| | | .data-card.total { |
| | | background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%); |
| | | color: #fff; |
| | | } |
| | | .data-card.inventory { |
| | | background-image: url("../assets/images/kucun.png"); |
| | | background-size: cover; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | |
| | | .data-card.pending { |
| | | background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%); |
| | | color: #fff; |
| | | } |
| | | .data-desc { |
| | | font-weight: 500; |
| | | font-size: 13px; |
| | | color: #FFFFFF; |
| | | |
| | | .data-card.today { |
| | | background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%); |
| | | color: #fff; |
| | | } |
| | | |
| | | .data-title { |
| | | font-weight: 600; |
| | | font-size: 16px; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .data-value { |
| | | font-size: 18px; |
| | | font-weight: 500; |
| | | margin: 10px 0; |
| | | color: #FFFFFF; |
| | | font-size: 32px; |
| | | font-weight: bold; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .data-desc { |
| | | font-size: 12px; |
| | | opacity: 0.9; |
| | | } |
| | | |
| | | .top-left { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20px; |
| | | width: 50%; |
| | | width: 60%; |
| | | } |
| | | .todo-panel { |
| | | |
| | | .alarm-panel { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 20px; |
| | | width: 50%; |
| | | width: 40%; |
| | | } |
| | | .todo-list { |
| | | |
| | | .alarm-list { |
| | | list-style: none; |
| | | padding: 0; |
| | | margin: 0; |
| | | font-size: 15px; |
| | | font-size: 14px; |
| | | overflow-y: auto; |
| | | height: 260px; |
| | | } |
| | | .todo-list li { |
| | | |
| | | .alarm-list li { |
| | | border-radius: 8px; |
| | | margin-bottom: 12px; |
| | | padding: 8px 20px; |
| | | height: 74px; |
| | | padding: 12px 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | background: rgba(225,227,250,0.62); |
| | | background: #f8f9fa; |
| | | border-left: 4px solid #409eff; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .todo-title { |
| | | font-weight: 400; |
| | | |
| | | .alarm-list li:hover { |
| | | background: #e9ecef; |
| | | transform: translateX(4px); |
| | | } |
| | | |
| | | .alarm-title { |
| | | font-weight: 600; |
| | | font-size: 14px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .alarm-value { |
| | | font-size: 12px; |
| | | color: #000000; |
| | | position: relative; |
| | | color: #606266; |
| | | } |
| | | .todo-title::before { |
| | | content: ''; /* å¿
éï¼è¡¨ç¤ºè¿éæä¸ä¸ªå
容 */ |
| | | position: absolute; |
| | | left: -10px; /* å®ä½å°å·¦ä¾§ */ |
| | | top: 50%; /* åç´å±
ä¸ */ |
| | | transform: translateY(-50%); /* å¾®è°åç´å±
ä¸ */ |
| | | width: 6px; /* åçç´å¾ */ |
| | | height: 6px; /* åçç´å¾ */ |
| | | background: #498CEB; |
| | | border-radius: 50%; /* 让å
¶åæåå½¢ */ |
| | | } |
| | | .todo-division { |
| | | font-weight: 400; |
| | | |
| | | .alarm-time { |
| | | font-size: 12px; |
| | | color: #000000; |
| | | color: #909399; |
| | | } |
| | | .todo-time { |
| | | font-weight: 400; |
| | | font-size: 12px; |
| | | color: #000000; |
| | | } |
| | | .todo-meta { |
| | | color: #888; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .dashboard-row { |
| | | display: flex; |
| | | gap: 20px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .main-panel { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .section-title { |
| | | position: relative; |
| | | font-size: 18px; |
| | | color: #333; |
| | | padding-left: 10px; |
| | | margin-bottom: 10px; |
| | | margin-bottom: 20px; |
| | | font-weight: 700; |
| | | } |
| | | |
| | |
| | | content: ''; |
| | | width: 4px; |
| | | height: 18px; |
| | | background-color: #002FA7; |
| | | background-color: #409eff; |
| | | border-radius: 2px; |
| | | } |
| | | .contract-info { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 20px; |
| | | height: 90px; |
| | | background: rgba(245,245,245,0.59); |
| | | width: 100%; |
| | | border-radius: 10px; |
| | | padding: 10px 30px; |
| | | } |
| | | .contract-summary { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 30px; |
| | | } |
| | | .contract-card { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | } |
| | | .contract-name { |
| | | font-weight: 400; |
| | | font-size: 14px; |
| | | color: #050505; |
| | | } |
| | | .contract-meta { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | gap: 80px; |
| | | } |
| | | .main-amount { |
| | | font-size: 24px; |
| | | color: rgba(51,50,50,0.85); |
| | | } |
| | | .up { color: #e57373; } |
| | | .contract-list { |
| | | margin-top: 16px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | list-style: none; |
| | | |
| | | .level-list { |
| | | margin: 0; |
| | | padding: 0; |
| | | height: 190px; |
| | | list-style: none; |
| | | height: 200px; |
| | | overflow-y: auto; |
| | | width: 460px; |
| | | width: 100%; |
| | | } |
| | | |
| | | .level-list li { |
| | | margin-bottom: 15px; |
| | | padding: 10px; |
| | | background: #f8f9fa; |
| | | border-radius: 6px; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .level-list li:hover { |
| | | background: #e9ecef; |
| | | } |
| | | |
| | | .line { |
| | | position: relative; |
| | | width: 230px; |
| | | } |
| | | .line::after { |
| | | content: ''; |
| | | position: absolute; |
| | | right: 2px; |
| | | top: 0; |
| | | bottom: 0; |
| | | width: 1px; |
| | | background-color: #C9C5C5; |
| | | border-radius: 2px; |
| | | } |
| | | .contract-list li { |
| | | margin-top: 10px; |
| | | } |
| | | .quality-cards { |
| | | display: flex; |
| | | gap: 12px; |
| | | margin-bottom: 12px; |
| | | } |
| | | .quality-card { |
| | | border-radius: 8px; |
| | | padding: 15px 10px 10px 50px; |
| | | font-weight: 400; |
| | | font-size: 12px; |
| | | color: rgba(0,0,0,0.67); |
| | | width: 236px; |
| | | height: 49px; |
| | | background-size: cover; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | .quality-card.one { |
| | | background-image: url("../assets/images/yuancailiao.png"); |
| | | } |
| | | .quality-card.two { |
| | | background-image: url("../assets/images/guocheng.png"); |
| | | } |
| | | .quality-card.three { |
| | | background-image: url("../assets/images/chuchang.png"); |
| | | |
| | | } |
| | | .quality-card span { |
| | | color: #4fc3f7; |
| | | font-weight: bold; |
| | | margin-left: 6px; |
| | | } |
| | | .chart { |
| | | width: 100%; |
| | | height: 220px; |
| | | margin-top: 10px; |
| | | width: 80px; |
| | | font-weight: 500; |
| | | } |
| | | </style> |
| | |
| | | const { VITE_APP_ENV } = env;
|
| | | const baseUrl =
|
| | | VITE_APP_ENV == "development"
|
| | | ? "http://192.168.1.147:7003" // å¼åç¯å¢å端æ¥å£
|
| | | : "http://10.136.12.71:7003"; // ç产ç¯å¢å端æ¥å£
|
| | | ? "http://127.0.0.1:7003" // å¼åç¯å¢å端æ¥å£
|
| | | : "http://10.136.12.71:8016"; // ç产ç¯å¢å端æ¥å£
|
| | |
|
| | | return {
|
| | | // é¨ç½²ç产ç¯å¢åå¼åç¯å¢ä¸çURLã
|