| | |
| | | <div class="grid grid-cols-1 gap-4"> |
| | | |
| | | <!-- 这里将放置预警表格 --> |
| | | <a-table :columns="warningColumns" :data-source="warningData" :pagination="false" class="w-full"> |
| | | <Table :columns="warningColumns" :data-source="warningData" :pagination="false" class="w-full"> |
| | | <template #bodyCell="{ column, record }"> |
| | | <template v-if="column.key === 'status'"> |
| | | <a-tag :color="getStatusColor(record.status)"> |
| | |
| | | <a-button type="link" @click="generateWorkOrder(record)" :disabled="record.maintenanceSuggestion === '暂无建议'">生成工单</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </Table> |
| | | </div> |
| | | |
| | | </Card> |
| | |
| | | <div class="grid grid-cols-2 gap-4 mb-6"> |
| | | <!-- 设备部件寿命预测 --> |
| | | <Card title="设备部件寿命预测"> |
| | | <a-table :columns="lifePredictionColumns" :data-source="lifePredictionData" :pagination="false" class="w-full"> |
| | | <Table :columns="lifePredictionColumns" :data-source="lifePredictionData" :pagination="false" class="w-full"> |
| | | <template #bodyCell="{ column, record }"> |
| | | <template v-if="column.key === 'lifeStatus'"> |
| | | <a-tag :color="getLifeStatusColor(record.remainingDays)"> |
| | |
| | | <a-button type="link" @click="showLifePredictionDetail(record)">详情</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </Table> |
| | | </Card> |
| | | |
| | | <!-- 备件库存与预警 --> |
| | | <Card title="备件库存与预警"> |
| | | <a-table :columns="sparePartColumns" :data-source="sparePartData" :pagination="false" class="w-full"> |
| | | <Table :columns="sparePartColumns" :data-source="sparePartData" :pagination="false" class="w-full"> |
| | | <template #bodyCell="{ column, record }"> |
| | | <template v-if="column.key === 'stockStatus'"> |
| | | <a-tag :color="getStockStatusColor(record.currentStock, record.safetyStock)"> |
| | |
| | | <a-button type="link" @click="showSparePartDetail(record)">详情</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </Table> |
| | | </Card> |
| | | </div> |
| | | |
| | |
| | | <script setup lang="ts"> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { Page } from '@vben/common-ui'; |
| | | import { Card, Table, Tag, Button, Form, Input, Textarea, Select, message } from 'ant-design-vue'; |
| | | import { Button, Card, Form, Input, message, Select, Table, Tag } from 'ant-design-vue'; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | const chartRef = ref<HTMLElement | null>(null); |