修改国际化配置

This commit is contained in:
lsymicc
2025-06-10 17:33:41 +08:00
parent ee0eeabcc8
commit b80c625e11
15 changed files with 721 additions and 412 deletions

View File

@@ -1,8 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="$t('KPIAnalysis_StockIn.lblWidthSearch')">
<!-- 仓库 -->
<el-form-item :label="this.$t('KPIAnalysis_StockIn.warehouse')" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="this.$t('KPIAnalysis_StockIn.placeholderWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
@@ -11,19 +12,22 @@
/>
</el-select>
</el-form-item>
<el-form-item label="年月" prop="yearMonth">
<!-- 年月 -->
<el-form-item :label="this.$t('KPIAnalysis_StockIn.yearMonth')" prop="yearMonth">
<el-date-picker
v-model="queryParams.yearMonth"
type="month"
placeholder="选择年月"
:placeholder="this.$t('KPIAnalysis_StockIn.placeholderYearMonth')"
value-format="yyyy-MM"
format="yyyy-MM"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!-- 【查询】按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('KPIAnalysis_StockIn.btnSearch') }}</el-button>
<!-- 【重置】按钮 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('KPIAnalysis_StockIn.btnReset') }}</el-button>
</el-form-item>
</el-form>
@@ -108,7 +112,8 @@ export default {
updateChart() {
const option = {
title: {
text: '入库均匀分析',
// 标题:入库均匀分析
text: this.$t('KPIAnalysis_StockIn.textChartStockIn'),
left: 'center'
},
tooltip: {
@@ -127,7 +132,8 @@ export default {
},
yAxis: {
type: 'value',
name: '数量'
// 数量
name: this.$t('KPIAnalysis_StockIn.textYAxisName')
},
series: [{
data: this.chartData.counts,

View File

@@ -1,8 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="$t('KPIAnalysis_StockIn.lblWidthSearch')">
<!-- 仓库 -->
<el-form-item :label="$t('KPIAnalysis_StockOut.warehouse')" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('KPIAnalysis_StockOut.placeholderWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
@@ -11,19 +12,22 @@
/>
</el-select>
</el-form-item>
<el-form-item label="年月" prop="yearMonth">
<!-- 年月 -->
<el-form-item :label="$t('KPIAnalysis_StockOut.yearMonth')" prop="yearMonth">
<el-date-picker
v-model="queryParams.yearMonth"
type="month"
placeholder="选择年月"
:placeholder="$t('KPIAnalysis_StockOut.placeholderYearMonth')"
value-format="yyyy-MM"
format="yyyy-MM"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!-- 【查询】按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('KPIAnalysis_StockOut.btnSearch') }}</el-button>
<!-- 【重置】按钮 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('KPIAnalysis_StockOut.btnReset') }}</el-button>
</el-form-item>
</el-form>
@@ -108,7 +112,8 @@ export default {
updateChart() {
const option = {
title: {
text: '出库均匀分析',
// 标题:出库均匀分析
text: this.$t('KPIAnalysis_StockOut.textChartStockOut'),
left: 'center'
},
tooltip: {
@@ -127,7 +132,8 @@ export default {
},
yAxis: {
type: 'value',
name: '数量'
// 数量
name: this.$t('KPIAnalysis_StockOut.textYAxisName')
},
series: [{
data: this.chartData.counts,

View File

@@ -1,8 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="$t('KPIAnalysis_Roadway.lblWidthSearch')">
<!-- 仓库 -->
<el-form-item :label="$t('KPIAnalysis_Roadway.warehouse')" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('KPIAnalysis_Roadway.placeholderWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
@@ -11,29 +12,33 @@
/>
</el-select>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<!-- 开始时间 -->
<el-form-item :label="$t('KPIAnalysis_Roadway.dateStart')" prop="startTime">
<el-date-picker
v-model="queryParams.startTime"
type="datetime"
placeholder="选择开始时间"
:placeholder="$t('KPIAnalysis_Roadway.placeholderDateStart')"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
clearable
/>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<!-- 结束时间 -->
<el-form-item :label="$t('KPIAnalysis_Roadway.dateEnd')" prop="endTime">
<el-date-picker
v-model="queryParams.endTime"
type="datetime"
placeholder="选择结束时间"
:placeholder="$t('KPIAnalysis_Roadway.placeholderDateEnd')"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!-- 【搜索】按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('KPIAnalysis_Roadway.btnSearch') }}</el-button>
<!-- 【重置】按钮 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('KPIAnalysis_Roadway.btnReset') }}</el-button>
</el-form-item>
</el-form>
@@ -119,7 +124,8 @@ export default {
updateChart() {
const option = {
title: {
text: '巷道均匀分析',
// 巷道均匀分析
text: this.$t('KPIAnalysis_Roadway.textChartRoadway'),
left: 'center'
},
tooltip: {
@@ -129,7 +135,8 @@ export default {
}
},
legend: {
data: ['入库数量', '出库数量'],
// 【入库数量】、【出库数量】
data: [this.$t('KPIAnalysis_Roadway.quantityOfStockIn'), this.$t('KPIAnalysis_Roadway.quantityOfStockOut')],
top: '30px'
},
xAxis: {
@@ -142,11 +149,13 @@ export default {
},
yAxis: {
type: 'value',
name: '数量'
// 数量
name: this.$t('KPIAnalysis_Roadway.textValue')
},
series: [
{
name: '入库数量',
// 入库数量
name: this.$t('KPIAnalysis_Roadway.quantityOfStockIn'),
data: this.chartData.inCounts,
type: 'bar',
barWidth: '30%',
@@ -159,7 +168,8 @@ export default {
}
},
{
name: '出库数量',
// 出库数量
name: this.$t('KPIAnalysis_Roadway.quantityOfStockOut'),
data: this.chartData.outCounts,
type: 'bar',
barWidth: '30%',

View File

@@ -1,8 +1,9 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="$t('KPIAnalysis_CargoSpace.lblWidthSearch')">
<!-- 仓库 -->
<el-form-item :label="$t('KPIAnalysis_CargoSpace.warehouse')" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('KPIAnalysis_CargoSpace.placeholderWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
@@ -12,8 +13,10 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!-- 【搜索】按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('KPIAnalysis_CargoSpace.btnSearch') }}</el-button>
<!-- 【重置】按钮 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('KPIAnalysis_CargoSpace.btnReset') }}</el-button>
</el-form-item>
</el-form>
@@ -85,8 +88,9 @@ export default {
this.$message.error(response.msg);
}
}).catch(error => {
console.error('获取数据失败:', error);
this.$message.error('获取数据失败');
// 提示:获取数据失败
console.error(this.$t('KPIAnalysis_CargoSpace.errorGetData') + ':', error);
this.$message.error(this.$t('KPIAnalysis_CargoSpace.errorGetData'));
});
},
/** 重置按钮操作 */
@@ -106,12 +110,14 @@ export default {
updateChart() {
console.log('chartData:', this.chartData);
if (!this.chartData || !this.chartData.data || this.chartData.data.length === 0) {
console.warn('无效的图表数据');
// 提示:无效的图表数据
console.warn(this.$t('KPIAnalysis_CargoSpace.warnInvalidChartData'));
return;
}
// 获取数据中所有的巷道字段
const firstItem = this.chartData.data[0];
// 巷道
const roadwayFields = Object.keys(firstItem).filter(key => key.startsWith('巷道'));
// 准备系列配置
@@ -121,21 +127,24 @@ export default {
data: this.chartData.data.map(item => item[roadway]),
barWidth: '30%',
itemStyle: {
// 巷道1-4
color: roadway === '巷道1' ? '#1890ff' :
roadway === '巷道2' ? '#52c41a' :
roadway === '巷道3' ? '#1890ff' :
roadway === '巷道4' ? '#52c41a' : '#1890ff'
roadway === '巷道2' ? '#52c41a' :
roadway === '巷道3' ? '#1890ff' :
roadway === '巷道4' ? '#52c41a' : '#1890ff'
},
label: {
show: true,
position: 'top'
}
}));
console.log('生成的系列配置:', series);
// 提示:生成的系列配置
console.log(this.$t('KPIAnalysis_CargoSpace.config'), series);
const option = {
title: {
text: '货位状态分析',
// 货位状态分析
text: this.$t('KPIAnalysis_CargoSpace.textChartCargoSpace'),
left: 'center'
},
tooltip: {
@@ -161,7 +170,8 @@ export default {
},
yAxis: {
type: 'value',
name: '数量'
// 数量
name: this.$t('KPIAnalysis_CargoSpace.textValue')
},
series: series
};

View File

@@ -2,8 +2,9 @@
<div class="app-container">
<div class="search-box">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable @change="handleWarehouseChange">
<!-- 仓库 -->
<el-form-item :label="$t('KPIAnalysis_CargoPlan.warehouse')" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('KPIAnalysis_CargoPlan.placeholderWarehouse')" clearable @change="handleWarehouseChange">
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
@@ -12,12 +13,14 @@
/>
</el-select>
</el-form-item>
<el-form-item label="巷道">
<!-- 巷道 -->
<el-form-item :label="$t('KPIAnalysis_CargoPlan.raodway')">
<el-select v-model="queryParams.roadwayId" style="width: 150px" @change="handleRoadwayChange">
<el-option v-for="item in roadwayOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="排">
<!-- 排 -->
<el-form-item :label="$t('KPIAnalysis_CargoPlan.row')">
<el-select v-model="queryParams.thePlatoon" style="width: 150px" @change="handlePlatoonChange">
<el-option v-for="item in platoonOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
@@ -35,6 +38,7 @@
import * as echarts from 'echarts'
import {getRoadways, getPlatoons, getChartData, getChartMag} from "@/api/kpi/spacePlan"
import {listWarehouse} from "@/api/bas/warehouse";
import VueI18n from 'vue-i18n';
export default {
name: 'SpacePlan',
@@ -169,8 +173,10 @@ this.getWarehouseList()
}
},
title: {
text: '库位分布平面图',
subtext: this.queryParams.thePlatoon + '排'
// 标题:库位分布平面图
text: this.$t('KPIAnalysis_CargoPlan.title'),
// 子标题:排
subtext: this.queryParams.thePlatoon + this.$t('KPIAnalysis_CargoPlan.row')
},
grid: {
width: '90%',
@@ -202,27 +208,33 @@ this.getWarehouseList()
legend: {
data: [
{
name: '空位',
// 图例:空位
name: this.$t('KPIAnalysis_CargoPlan.legendEmpty'),
itemStyle: { color: '#AEEEEE' }
},
{
name: '满位',
// 图例:满位
name: this.$t('KPIAnalysis_CargoPlan.legendOccupied'),
itemStyle: { color: '#FF9900' }
},
{
name: '入库分配',
// 图例:入库分配
name: this.$t('KPIAnalysis_CargoPlan.legendStockInAssigned'),
itemStyle: { color: '#FFFF00' }
},
{
name: '出库分配',
itemStyle: { color: '#00CC00' }
},
{
name: '入库需盘点',
// 图例:出库分配
name: this.$t('KPIAnalysis_CargoPlan.legendStockOutAssigned'),
itemStyle: { color: '#FF0000' }
},
{
name: '出库需盘点',
// 图例:入库需盘点
name: this.$t('KPIAnalysis_CargoPlan.legendStockInException'),
itemStyle: { color: '#FF0000' }
},
{
// 图例:出库需盘点
name: this.$t('KPIAnalysis_CargoPlan.legendStockOutException'),
itemStyle: { color: '#0000FF' }
}
],
@@ -232,7 +244,8 @@ this.getWarehouseList()
},
series: [
{
name: '空位',
// 空位
name: this.$t('KPIAnalysis_CargoPlan.legendEmpty'),
type: 'heatmap',
data: this.chartData.empty,
itemStyle: {
@@ -241,7 +254,8 @@ this.getWarehouseList()
}
},
{
name: '满位',
// 满位
name: this.$t('KPIAnalysis_CargoPlan.legendOccupied'),
type: 'heatmap',
data: this.chartData.full,
itemStyle: {
@@ -250,7 +264,8 @@ this.getWarehouseList()
}
},
{
name: '入库分配',
// 入库分配
name: this.$t('KPIAnalysis_CargoPlan.legendStockInAssigned'),
type: 'heatmap',
data: this.chartData.inAllot,
itemStyle: {
@@ -259,7 +274,8 @@ this.getWarehouseList()
}
},
{
name: '出库分配',
// 出库分配
name: this.$t('KPIAnalysis_CargoPlan.legendStockOutAssigned'),
type: 'heatmap',
data: this.chartData.outAllot,
itemStyle: {
@@ -268,7 +284,8 @@ this.getWarehouseList()
}
},
{
name: '入库需盘点',
// 入库需盘点
name: this.$t('KPIAnalysis_CargoPlan.legendStockInException'),
type: 'heatmap',
data: this.chartData.inCheck,
itemStyle: {
@@ -277,7 +294,8 @@ this.getWarehouseList()
}
},
{
name: '出库需盘点',
// 出库需盘点
name: this.$t('KPIAnalysis_CargoPlan.legendStockOutException'),
type: 'heatmap',
data: this.chartData.outCheck,
itemStyle: {
@@ -302,7 +320,14 @@ this.getWarehouseList()
// 格式化普通仓库提示信息
formatTooltip(params) {
if (params.seriesName !== '满位') {
return params.seriesName + '<br>' + this.queryParams.thePlatoon + '排' + (params.data[0] + 1) + '列' + (params.data[1] + 1) + '层';
// 排
if (this.$i18n.locale ==='zh-cn') {
return params.seriesName + '<br>' + this.queryParams.thePlatoon + '排' + (params.data[0] + 1) + '列' + (params.data[1] + 1) + '层';
}
else{
return params.seriesName + '<br>' + this.$t('KPIAnalysis_CargoPlan.row') + ':' + this.queryParams.thePlatoon + ' ' + this.$t('KPIAnalysis_CargoPlan.column') + ':' + (params.data[0] + 1) + ' ' + this.$t('KPIAnalysis_CargoPlan.floor') + ': ' + (params.data[1] + 1);
}
}
const returnData = {
@@ -347,7 +372,8 @@ this.getWarehouseList()
});
})
.catch(error => {
console.error('获取货位信息失败:', error);
// 提示:获取货位信息失败
console.error(this.$t('KPIAnalysis_CargoPlan.failGetCargoSpace') + ':', error);
})
.finally(() => {
// 清除加载状态