diff --git a/apps/web-antd/src/views/ops/cleaning/work-order/data.ts b/apps/web-antd/src/views/ops/cleaning/work-order/data.ts index ad179a2cb..c5ca2d958 100644 --- a/apps/web-antd/src/views/ops/cleaning/work-order/data.ts +++ b/apps/web-antd/src/views/ops/cleaning/work-order/data.ts @@ -51,45 +51,10 @@ export const STATUS_TAB_OPTIONS = [ label: '进行中', statuses: ['DISPATCHED', 'CONFIRMED', 'ARRIVED', 'QUEUED'], }, - { key: 'PAUSED', label: '已暂停', statuses: ['PAUSED'] }, { key: 'COMPLETED', label: '已完成', statuses: ['COMPLETED'] }, { key: 'CANCELLED', label: '已取消', statuses: ['CANCELLED'] }, ]; -/** 优先级样式映射 */ -export const PRIORITY_STYLE_MAP: Record< - number, - { - animation: boolean; - bgColor: string; - color: string; - icon: string; - label: string; - } -> = { - 0: { - label: 'P0', - color: '#F44336', - bgColor: '#FFEBEE', - icon: 'lucide:zap', - animation: true, - }, - 1: { - label: 'P1', - color: '#FF9800', - bgColor: '#FFF3E0', - icon: 'lucide:alert-triangle', - animation: false, - }, - 2: { - label: 'P2', - color: '#9E9E9E', - bgColor: '#FAFAFA', - icon: 'lucide:info', // Added icon - animation: false, - }, -}; - /** 工单类型选项 */ export const ORDER_TYPE_OPTIONS = [ { label: '保洁', value: OpsOrderCenterApi.OrderType.CLEAN }, diff --git a/apps/web-antd/src/views/ops/cleaning/work-order/detail/index.vue b/apps/web-antd/src/views/ops/cleaning/work-order/detail/index.vue index a6ba37e72..0fc3225dc 100644 --- a/apps/web-antd/src/views/ops/cleaning/work-order/detail/index.vue +++ b/apps/web-antd/src/views/ops/cleaning/work-order/detail/index.vue @@ -18,7 +18,6 @@ import { IconifyIcon } from '@vben/icons'; import { formatDateTime } from '@vben/utils'; import { - Alert, Avatar, Button, Card, @@ -43,11 +42,12 @@ import { } from '#/api/ops/cleaning'; import { getOrderDetail } from '#/api/ops/order-center'; +import { usePriorityInfo } from '../../../work-order/data'; +import CleaningDetailExt from '../components/cleaning-detail-ext.vue'; import { CLEANING_TYPE_TEXT_MAP, ORDER_TYPE_COLOR_MAP, ORDER_TYPE_TEXT_MAP, - PRIORITY_STYLE_MAP, STATUS_COLOR_MAP, STATUS_ICON_MAP, STATUS_TEXT_MAP, @@ -295,10 +295,7 @@ const [CancelFormModal, cancelFormModalApi] = useVbenModal({ destroyOnClose: true, }); -/** 获取优先级样式 */ -function getPriorityStyle(priority: number) { - return PRIORITY_STYLE_MAP[priority] || PRIORITY_STYLE_MAP[2]; -} +const { getPriorityInfo } = usePriorityInfo(); /** 计算作业时长 */ const workDuration = computed(() => { @@ -334,15 +331,6 @@ const isOvertime = computed(() => { ); }); -/** 是否显示离岗警告 */ -const showLeaveWarning = computed(() => { - return ( - order.value.status === 'ARRIVED' && - badgeStatus.value && - !badgeStatus.value.isInArea - ); -}); - /** 动态生成应该显示的状态步骤(根据 timeline 过滤) */ const visibleSteps = computed(() => { // 必须显示的节点(主流程) @@ -639,22 +627,18 @@ onUnmounted(stopPolling); {{ STATUS_TEXT_MAP[order.status] }} - {{ getPriorityStyle(order.priority)?.label }} + {{ getPriorityInfo(order.priority).label }}
@@ -852,26 +836,6 @@ onUnmounted(stopPolling);
- - - - - - @@ -891,7 +855,7 @@ onUnmounted(stopPolling); 作业进度 - +