diff --git a/src/locales/en.ts b/src/locales/en.ts
index 7f007775..5c7a1810 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -4406,5 +4406,91 @@ export default {
statusStored: 'Stored',
statusStarted: 'Started'
}
+ },
+ GanttChart: {
+ Index: {
+ searchTimeLabel: 'Query Time',
+ startPlaceholder: 'Start Time',
+ endPlaceholder: 'End Time',
+ deviceLabel: 'Device',
+ devicePlaceholder: 'Please select device',
+ buttonSearch: 'Search',
+ buttonReset: 'Reset'
+ },
+ CardView: {
+ legendScheduled: 'Scheduled',
+ legendMerged: 'Merged',
+ legendPaused: 'Paused',
+ legendPendingStorage: 'Pending Storage',
+ legendStored: 'Stored',
+ statPlanCount: 'Plans',
+ statCapacity: 'Capacity',
+ planCodeLabel: 'Plan Code:',
+ productLabel: 'Product:',
+ planNumberLabel: 'Plan Qty:',
+ deliveryDateLabel: 'Delivery Date:',
+ startLabel: 'Start:',
+ endLabel: 'End:',
+ emptyDescription: 'No Plans',
+ statusScheduled: 'Scheduled',
+ statusMerged: 'Merged',
+ statusPaused: 'Paused',
+ statusPendingStorage: 'Pending Storage',
+ statusStored: 'Stored',
+ statusUnknown: 'Unknown'
+ },
+ GanttPanel: {
+ detailTitle: 'Schedule Info',
+ deviceNameLabel: 'Device Name',
+ deviceIdLabel: 'Device ID',
+ capacityLabel: 'Capacity',
+ dailyAvgLabel: 'Daily Avg Report',
+ dataCollectionCapacityLabel: 'DC Capacity',
+ planCountLabel: 'Plan Count',
+ planDetailTitle: 'Plan Details',
+ planCodeColon: 'Plan Code: ',
+ planNumberColon: 'Plan Qty: ',
+ deliveryDateColon: 'Delivery Date: ',
+ startColon: 'Start: ',
+ endColon: 'End: ',
+ latestStartColon: 'Latest Start: ',
+ emptyDescription: 'No Schedule Info',
+ adjustTaskTitle: 'Adjust Task',
+ deviceLabel: 'Device',
+ devicePlaceholder: 'Please select device',
+ startDateLabel: 'Start Date',
+ startDatePlaceholder: 'Please select start date',
+ durationLabel: 'Days',
+ buttonCancel: 'Cancel',
+ buttonConfirm: 'Confirm',
+ editStartDateTitle: 'Edit Start Time',
+ startTimeLabel: 'Start Time',
+ startTimePlaceholder: 'Please select start time',
+ warningCompleteDeviceDate: 'Please complete device and start date',
+ warningValidTime: 'Please select a valid time',
+ columnTaskName: 'Task Name',
+ columnStartTime: 'Start Time',
+ columnDays: 'Days',
+ scaleMonthFormat: 'MMM YYYY',
+ tooltipTaskDetail: 'Task Detail',
+ tooltipTaskCode: 'Task Code: ',
+ tooltipProduct: 'Product: ',
+ tooltipDetailId: 'Detail ID: ',
+ tooltipPlanNumber: 'Plan Qty: ',
+ tooltipStart: 'Start: ',
+ tooltipEnd: 'End: ',
+ tooltipLatestStart: 'Latest Start: ',
+ tooltipSummary: 'Summary',
+ tooltipDevice: 'Device: ',
+ tooltipDetailCount: 'Detail Count: ',
+ tooltipTotalPlanNumber: 'Total Plan Qty: ',
+ tooltipEarliestStart: 'Earliest Start: ',
+ tooltipLatestEnd: 'Latest End: ',
+ statusScheduled: 'Scheduled',
+ statusStarted: 'Started',
+ statusPaused: 'Paused',
+ statusPendingStorage: 'Pending Storage',
+ statusStored: 'Stored'
+ }
}
}
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index deaddcff..8b896efa 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -4624,5 +4624,91 @@ export default {
statusStored: '已入库',
statusStarted: '已开工'
}
+ },
+ GanttChart: {
+ Index: {
+ searchTimeLabel: '查询时间',
+ startPlaceholder: '开始时间',
+ endPlaceholder: '结束时间',
+ deviceLabel: '设备',
+ devicePlaceholder: '请选择设备',
+ buttonSearch: '查询',
+ buttonReset: '重置'
+ },
+ CardView: {
+ legendScheduled: '已排产',
+ legendMerged: '已并工',
+ legendPaused: '暂停',
+ legendPendingStorage: '待入库',
+ legendStored: '已入库',
+ statPlanCount: '计划数',
+ statCapacity: '产能',
+ planCodeLabel: '计划编号:',
+ productLabel: '产品:',
+ planNumberLabel: '计划数量:',
+ deliveryDateLabel: '交货日期:',
+ startLabel: '开始:',
+ endLabel: '结束:',
+ emptyDescription: '暂无计划',
+ statusScheduled: '已排产',
+ statusMerged: '已并工',
+ statusPaused: '暂停',
+ statusPendingStorage: '待入库',
+ statusStored: '已入库',
+ statusUnknown: '未知'
+ },
+ GanttPanel: {
+ detailTitle: '计划信息',
+ deviceNameLabel: '设备名称',
+ deviceIdLabel: '设备ID',
+ capacityLabel: '产能',
+ dailyAvgLabel: '每日报工平均值',
+ dataCollectionCapacityLabel: '数据采集产能',
+ planCountLabel: '计划条数',
+ planDetailTitle: '计划明细',
+ planCodeColon: '计划编码:',
+ planNumberColon: '计划数量:',
+ deliveryDateColon: '交货日期:',
+ startColon: '开始:',
+ endColon: '结束:',
+ latestStartColon: '最晚开工:',
+ emptyDescription: '暂无计划信息',
+ adjustTaskTitle: '调整任务',
+ deviceLabel: '设备',
+ devicePlaceholder: '请选择设备',
+ startDateLabel: '开始日期',
+ startDatePlaceholder: '请选择开始日期',
+ durationLabel: '天数',
+ buttonCancel: '取消',
+ buttonConfirm: '确定',
+ editStartDateTitle: '修改开始时间',
+ startTimeLabel: '开始时间',
+ startTimePlaceholder: '请选择开始时间',
+ warningCompleteDeviceDate: '请完善设备和开始日期',
+ warningValidTime: '请选择有效的时间',
+ columnTaskName: '任务名称',
+ columnStartTime: '开始时间',
+ columnDays: '天数',
+ scaleMonthFormat: 'YYYY年M月',
+ tooltipTaskDetail: '任务明细',
+ tooltipTaskCode: '任务单:',
+ tooltipProduct: '产品:',
+ tooltipDetailId: '明细ID:',
+ tooltipPlanNumber: '计划数量:',
+ tooltipStart: '开始:',
+ tooltipEnd: '结束:',
+ tooltipLatestStart: '最晚开工:',
+ tooltipSummary: '汇总',
+ tooltipDevice: '设备:',
+ tooltipDetailCount: '任务明细条数:',
+ tooltipTotalPlanNumber: '计划总数:',
+ tooltipEarliestStart: '最早计划开始:',
+ tooltipLatestEnd: '最晚计划结束:',
+ statusScheduled: '已排产',
+ statusStarted: '已开工',
+ statusPaused: '暂停',
+ statusPendingStorage: '待入库',
+ statusStored: '已入库'
+ }
}
}
diff --git a/src/views/mes/components/ScheduleGanttPanel.vue b/src/views/mes/components/ScheduleGanttPanel.vue
index 0bf5399d..0c69429b 100644
--- a/src/views/mes/components/ScheduleGanttPanel.vue
+++ b/src/views/mes/components/ScheduleGanttPanel.vue
@@ -2,7 +2,7 @@
-
计划信息
+
{{ t('GanttChart.GanttPanel.detailTitle') }}
- {{ activePreviewDevice.deviceName }}
- {{ activePreviewDevice.deviceId }}
- {{ activePreviewDevice.ratedCapacity ?? '-' }}
- {{ activePreviewDevice.dailyAverageValue ?? '-' }}
- {{ activePreviewDevice.dataCollectionCapacity ?? '-' }}
- {{ activePreviewDevice.plans?.length ?? 0 }}
+ {{ activePreviewDevice.deviceName }}
+ {{ activePreviewDevice.deviceId }}
+ {{ activePreviewDevice.ratedCapacity ?? '-' }}
+ {{ activePreviewDevice.dailyAverageValue ?? '-' }}
+ {{ activePreviewDevice.dataCollectionCapacity ?? '-' }}
+ {{ activePreviewDevice.plans?.length ?? 0 }}
- 计划明细
+ {{ t('GanttChart.GanttPanel.planDetailTitle') }}
-
计划编码:{{ plan.taskCode ?? '-' }}
-
计划数量:{{ plan.planNumber ?? '-' }}
-
交货日期:{{ plan.deliveryDateStr ?? '-' }}
-
开始:{{ plan.planStartTimeStr || '-' }}
-
结束:{{ plan.planEndTimeStr || '-' }}
-
最晚开工:{{ plan.latestStartTimeStr || '-' }}
+
{{ t('GanttChart.GanttPanel.planCodeColon') }}{{ plan.taskCode ?? '-' }}
+
{{ t('GanttChart.GanttPanel.planNumberColon') }}{{ plan.planNumber ?? '-' }}
+
{{ t('GanttChart.GanttPanel.deliveryDateColon') }}{{ plan.deliveryDateStr ?? '-' }}
+
{{ t('GanttChart.GanttPanel.startColon') }}{{ plan.planStartTimeStr || '-' }}
+
{{ t('GanttChart.GanttPanel.endColon') }}{{ plan.planEndTimeStr || '-' }}
+
{{ t('GanttChart.GanttPanel.latestStartColon') }}{{ plan.latestStartTimeStr || '-' }}
-
+
-
+
-
-
+
+
-
+
-
+
- 取消
- 确定
+ {{ t('GanttChart.GanttPanel.buttonCancel') }}
+ {{ t('GanttChart.GanttPanel.buttonConfirm') }}
-
+
-
+
- 取消
- 确定
+ {{ t('GanttChart.GanttPanel.buttonCancel') }}
+ {{ t('GanttChart.GanttPanel.buttonConfirm') }}
@@ -102,16 +102,19 @@
import dayjs from 'dayjs'
import { gantt } from 'dhtmlx-gantt'
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'
+import { useI18n } from '@/hooks/web/useI18n'
defineOptions({ name: 'ScheduleGanttPanel' })
+const { t } = useI18n()
+
// 计划状态颜色映射表
const PLAN_STATUS_COLOR_MAP = {
- 1: { label: '已排产', color: '#409eff', textColor: '#ffffff', sort: 1 },
- 8: { label: '已开工', color: '#67c23a', textColor: '#ffffff', sort: 2 },
- 3: { label: '暂停', color: '#e6a23c', textColor: '#ffffff', sort: 3 },
- 4: { label: '待入库', color: '#f56c6c', textColor: '#ffffff', sort: 4 },
- 5: { label: '已入库', color: '#8e7cc3', textColor: '#ffffff', sort: 5 },
+ 1: { label: t('GanttChart.GanttPanel.statusScheduled'), color: '#409eff', textColor: '#ffffff', sort: 1 },
+ 8: { label: t('GanttChart.GanttPanel.statusStarted'), color: '#67c23a', textColor: '#ffffff', sort: 2 },
+ 3: { label: t('GanttChart.GanttPanel.statusPaused'), color: '#e6a23c', textColor: '#ffffff', sort: 3 },
+ 4: { label: t('GanttChart.GanttPanel.statusPendingStorage'), color: '#f56c6c', textColor: '#ffffff', sort: 4 },
+ 5: { label: t('GanttChart.GanttPanel.statusStored'), color: '#8e7cc3', textColor: '#ffffff', sort: 5 },
}
const sortedPlanStatusList = Object.entries(PLAN_STATUS_COLOR_MAP)
@@ -339,25 +342,25 @@ const buildTaskTooltipHtml = (task: any, start?: Date, end?: Date) => {
const plan = task?._planData
if (plan) {
return `
- 任务明细
- 任务单:${plan.taskCode ?? '-'}
- 产品:${plan.productCode ?? '-'} / ${plan.productName ?? '-'}
- 明细ID:${plan.taskDetailId ?? '-'}
- 计划数量:${plan.planNumber ?? '-'}
- 开始:${formatTooltipDateTime(start ?? task?.start_date)}
- 结束:${formatTooltipDateTime(end ?? task?.end_date)}
- 最晚开工:${formatTooltipDateTime(plan.latestStartTimeStr)}
+ ${t('GanttChart.GanttPanel.tooltipTaskDetail')}
+ ${t('GanttChart.GanttPanel.tooltipTaskCode')}${plan.taskCode ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipProduct')}${plan.productCode ?? '-'} / ${plan.productName ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipDetailId')}${plan.taskDetailId ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipPlanNumber')}${plan.planNumber ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipStart')}${formatTooltipDateTime(start ?? task?.start_date)}
+ ${t('GanttChart.GanttPanel.tooltipEnd')}${formatTooltipDateTime(end ?? task?.end_date)}
+ ${t('GanttChart.GanttPanel.tooltipLatestStart')}${formatTooltipDateTime(plan.latestStartTimeStr)}
`
}
const device = task?._deviceData
const summary = getDeviceTaskSummary(task)
return `
- 汇总
- 设备:${device?.deviceName ?? '-'}
- 任务明细条数:${summary.planCount}
- 计划总数:${summary.totalPlanNumber}
- 最早计划开始:${summary.earliestStart}
- 最晚计划结束:${summary.latestEnd}
+ ${t('GanttChart.GanttPanel.tooltipSummary')}
+ ${t('GanttChart.GanttPanel.tooltipDevice')}${device?.deviceName ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipDetailCount')}${summary.planCount}
+ ${t('GanttChart.GanttPanel.tooltipTotalPlanNumber')}${summary.totalPlanNumber}
+ ${t('GanttChart.GanttPanel.tooltipEarliestStart')}${summary.earliestStart}
+ ${t('GanttChart.GanttPanel.tooltipLatestEnd')}${summary.latestEnd}
`
}
const getTaskByTooltipNode = (node: HTMLElement) => {
@@ -617,7 +620,7 @@ const openTaskAdjustDialog = (task: any) => {
const handleTaskAdjustSubmit = () => {
if (!taskAdjustTaskId.value || !props.editable) return
if (!taskAdjustForm.deviceTaskId || !taskAdjustForm.startDate) {
- message.warning('请完善设备和开始日期')
+ message.warning(t('GanttChart.GanttPanel.warningCompleteDeviceDate'))
return
}
const task = gantt.getTask(taskAdjustTaskId.value)
@@ -643,7 +646,7 @@ const handleStartDateEditorSubmit = () => {
}
const newStart = dayjs(startDateEditorValue.value)
if (!newStart.isValid()) {
- message.warning('请选择有效的时间')
+ message.warning(t('GanttChart.GanttPanel.warningValidTime'))
return
}
const duration = Math.max(Number(task.duration) || 1, 1)
@@ -717,14 +720,14 @@ const initGanttPreview = () => {
gantt.config.columns = [
{
name: 'text',
- label: '任务名称',
+ label: t('GanttChart.GanttPanel.columnTaskName'),
tree: true,
width: '*',
min_width: 200
},
{
name: 'start_date',
- label: '开始时间',
+ label: t('GanttChart.GanttPanel.columnStartTime'),
align: 'center',
width: 210,
template: (task: any) =>
@@ -734,7 +737,7 @@ const initGanttPreview = () => {
},
{
name: 'duration',
- label: '天数',
+ label: t('GanttChart.GanttPanel.columnDays'),
align: 'center',
width: 60,
template: (task: any) =>
@@ -750,7 +753,7 @@ const initGanttPreview = () => {
]
gantt.config.scales = [
- { unit: 'month', step: 1, format: (date) => dayjs(date).format('YYYY年M月') },
+ { unit: 'month', step: 1, format: (date) => dayjs(date).format(t('GanttChart.GanttPanel.scaleMonthFormat')) },
{ unit: 'day', step: 1, format: (date) => dayjs(date).format('MM-DD') }
]
diff --git a/src/views/mes/ganttChart/components/ScheduleCardView.vue b/src/views/mes/ganttChart/components/ScheduleCardView.vue
index 3ca48811..71058b5d 100644
--- a/src/views/mes/ganttChart/components/ScheduleCardView.vue
+++ b/src/views/mes/ganttChart/components/ScheduleCardView.vue
@@ -1,49 +1,40 @@
-
-
-
-
- 计划编号:
+ {{ t('GanttChart.CardView.planCodeLabel') }}
{{ plan.taskCode }}
- 产品:
+ {{ t('GanttChart.CardView.productLabel') }}
{{ plan.productCode }} / {{ plan.productName }}
- 计划数量:
+ {{ t('GanttChart.CardView.planNumberLabel') }}
{{ plan.planNumber }}
- 交货日期:
+ {{ t('GanttChart.CardView.deliveryDateLabel') }}
{{ plan.deliveryDateStr || '-' }}
- 开始:
+ {{ t('GanttChart.CardView.startLabel') }}
{{ plan.planStartTimeStr }}
- 结束:
+ {{ t('GanttChart.CardView.endLabel') }}
{{ plan.planEndTimeStr }}
-
-
+
@@ -115,8 +104,12 @@