From b5b92997d8d7594f12fa37c87734962b25c1d24f Mon Sep 17 00:00:00 2001
From: "HESU\\HESU" <1696136552@qq.com>
Date: Tue, 6 May 2025 18:20:49 +0800
Subject: [PATCH] 1
---
.../app/controller/VehicleController.php | 135 +++++++-
plugin/admin/app/lang/zh-cn/vehicle.php | 46 ++-
plugin/admin/app/view/index/index.html | 2 +-
plugin/admin/app/view/vehicle/index.html | 8 +-
plugin/admin/app/view/vehicle/insert.html | 275 ++++++++-------
plugin/admin/app/view/vehicle/update.html | 324 +++++++++++++-----
6 files changed, 572 insertions(+), 218 deletions(-)
diff --git a/plugin/admin/app/controller/VehicleController.php b/plugin/admin/app/controller/VehicleController.php
index 401ad87..9296bae 100644
--- a/plugin/admin/app/controller/VehicleController.php
+++ b/plugin/admin/app/controller/VehicleController.php
@@ -56,6 +56,39 @@ class VehicleController extends Crud
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
$translations = array_merge($translations, $common);
+ // 只在中文时使用默认翻译
+ if ($lang === 'zh-cn') {
+ $required_translations = [
+ 'brand' => '车辆品牌',
+ 'brand_placeholder' => '请输入车辆品牌',
+ 'model' => '车辆型号',
+ 'model_placeholder' => '请输入车辆型号',
+ 'vin' => '车架号',
+ 'vin_placeholder' => '请输入车架号',
+ 'status' => '车辆状态',
+ 'status_placeholder' => '请选择状态',
+ 'purchase_location' => '买车地点',
+ 'purchase_location_placeholder' => '请输入买车地点',
+ 'procedure_location' => '手续办理地',
+ 'procedure_location_placeholder' => '请输入手续办理地',
+ 'fbo_location' => 'FBO目的地',
+ 'fbo_location_placeholder' => '请选择FBO目的地',
+ 'current_location' => '车辆所在地',
+ 'current_location_placeholder' => '请选择车辆所在地',
+ 'final_location' => '最终目的地',
+ 'final_location_placeholder' => '请选择最终目的地',
+ 'departure_time' => 'FBO发车时间',
+ 'departure_time_placeholder' => '请选择发车时间',
+ 'arrival_time' => 'FBO到达时间',
+ 'arrival_time_placeholder' => '请选择到达时间',
+ 'shipping_cycle' => '运输周期',
+ 'shipping_cycle_placeholder' => '请输入运输周期',
+ 'img_url' => '图片',
+ 'img_url_placeholder' => '请输入图片URL'
+ ];
+ $translations = array_merge($required_translations, $translations);
+ }
+
return view('vehicle/index', [
'lang' => $lang,
'translations' => $translations
@@ -75,6 +108,39 @@ class VehicleController extends Crud
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
$translations = array_merge($translations, $common);
+ // 只在中文时使用默认翻译
+ if ($lang === 'zh-cn') {
+ $required_translations = [
+ 'brand' => '车辆品牌',
+ 'brand_placeholder' => '请输入车辆品牌',
+ 'model' => '车辆型号',
+ 'model_placeholder' => '请输入车辆型号',
+ 'vin' => '车架号',
+ 'vin_placeholder' => '请输入车架号',
+ 'status' => '车辆状态',
+ 'status_placeholder' => '请选择状态',
+ 'purchase_location' => '买车地点',
+ 'purchase_location_placeholder' => '请输入买车地点',
+ 'procedure_location' => '手续办理地',
+ 'procedure_location_placeholder' => '请输入手续办理地',
+ 'fbo_location' => 'FBO目的地',
+ 'fbo_location_placeholder' => '请选择FBO目的地',
+ 'current_location' => '车辆所在地',
+ 'current_location_placeholder' => '请选择车辆所在地',
+ 'final_location' => '最终目的地',
+ 'final_location_placeholder' => '请选择最终目的地',
+ 'departure_time' => 'FBO发车时间',
+ 'departure_time_placeholder' => '请选择发车时间',
+ 'arrival_time' => 'FBO到达时间',
+ 'arrival_time_placeholder' => '请选择到达时间',
+ 'shipping_cycle' => '运输周期',
+ 'shipping_cycle_placeholder' => '请输入运输周期',
+ 'img_url' => '图片',
+ 'img_url_placeholder' => '请输入图片URL'
+ ];
+ $translations = array_merge($required_translations, $translations);
+ }
+
return view('vehicle/insert', [
'lang' => $lang,
'translations' => $translations
@@ -95,6 +161,39 @@ class VehicleController extends Crud
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
$translations = array_merge($translations, $common);
+ // 只在中文时使用默认翻译
+ if ($lang === 'zh-cn') {
+ $required_translations = [
+ 'brand' => '车辆品牌',
+ 'brand_placeholder' => '请输入车辆品牌',
+ 'model' => '车辆型号',
+ 'model_placeholder' => '请输入车辆型号',
+ 'vin' => '车架号',
+ 'vin_placeholder' => '请输入车架号',
+ 'status' => '车辆状态',
+ 'status_placeholder' => '请选择状态',
+ 'purchase_location' => '买车地点',
+ 'purchase_location_placeholder' => '请输入买车地点',
+ 'procedure_location' => '手续办理地',
+ 'procedure_location_placeholder' => '请输入手续办理地',
+ 'fbo_location' => 'FBO目的地',
+ 'fbo_location_placeholder' => '请选择FBO目的地',
+ 'current_location' => '车辆所在地',
+ 'current_location_placeholder' => '请选择车辆所在地',
+ 'final_location' => '最终目的地',
+ 'final_location_placeholder' => '请选择最终目的地',
+ 'departure_time' => 'FBO发车时间',
+ 'departure_time_placeholder' => '请选择发车时间',
+ 'arrival_time' => 'FBO到达时间',
+ 'arrival_time_placeholder' => '请选择到达时间',
+ 'shipping_cycle' => '运输周期',
+ 'shipping_cycle_placeholder' => '请输入运输周期',
+ 'img_url' => '图片',
+ 'img_url_placeholder' => '请输入图片URL'
+ ];
+ $translations = array_merge($required_translations, $translations);
+ }
+
$data = Vehicle::where('id', $id)->first();
if (!$data) {
return json(['code' => 1, 'msg' => $translations['data_not_found'] ?? '数据不存在']);
@@ -122,6 +221,39 @@ class VehicleController extends Crud
$common = (array)require __DIR__ . '/../lang/' . $lang . '/common.php';
$translations = array_merge($translations, $common);
+ // 只在中文时使用默认翻译
+ if ($lang === 'zh-cn') {
+ $required_translations = [
+ 'brand' => '车辆品牌',
+ 'brand_placeholder' => '请输入车辆品牌',
+ 'model' => '车辆型号',
+ 'model_placeholder' => '请输入车辆型号',
+ 'vin' => '车架号',
+ 'vin_placeholder' => '请输入车架号',
+ 'status' => '车辆状态',
+ 'status_placeholder' => '请选择状态',
+ 'purchase_location' => '买车地点',
+ 'purchase_location_placeholder' => '请输入买车地点',
+ 'procedure_location' => '手续办理地',
+ 'procedure_location_placeholder' => '请输入手续办理地',
+ 'fbo_location' => 'FBO目的地',
+ 'fbo_location_placeholder' => '请选择FBO目的地',
+ 'current_location' => '车辆所在地',
+ 'current_location_placeholder' => '请选择车辆所在地',
+ 'final_location' => '最终目的地',
+ 'final_location_placeholder' => '请选择最终目的地',
+ 'departure_time' => 'FBO发车时间',
+ 'departure_time_placeholder' => '请选择发车时间',
+ 'arrival_time' => 'FBO到达时间',
+ 'arrival_time_placeholder' => '请选择到达时间',
+ 'shipping_cycle' => '运输周期',
+ 'shipping_cycle_placeholder' => '请输入运输周期',
+ 'img_url' => '图片',
+ 'img_url_placeholder' => '请输入图片URL'
+ ];
+ $translations = array_merge($required_translations, $translations);
+ }
+
$data = Vehicle::where('id', $id)->first();
if (!$data) {
return json(['code' => 1, 'msg' => $translations['data_not_found'] ?? '数据不存在']);
@@ -143,7 +275,8 @@ class VehicleController extends Crud
{
foreach ($items as &$item) {
$location = Location::find($item->locations_id);
- $item->status = $this->status[$item->status]??$this->status[0];
+// $item->status = $this->status[$item->status]??$this->status[0];
+ $item->status = "已到达迪拜仓库";
$item->location_name = $location ? $location->name : '';
$final_location = Location::find($item->final_locations_id);
$item->final_location_name = $final_location ? $final_location->name : '';
diff --git a/plugin/admin/app/lang/zh-cn/vehicle.php b/plugin/admin/app/lang/zh-cn/vehicle.php
index 4cf7144..a3125b0 100644
--- a/plugin/admin/app/lang/zh-cn/vehicle.php
+++ b/plugin/admin/app/lang/zh-cn/vehicle.php
@@ -14,22 +14,43 @@ return [
'no_data_selected' => '未选择数据',
'confirm_delete' => '确定要删除吗?',
+ 'id' => 'ID',
'name' => '名称',
'name_placeholder' => '请输入名称',
'name_en' => '英文名称',
'name_en_placeholder' => '请输入英文名称',
- 'vin' => 'VIN',
- 'vin_placeholder' => '请输入VIN',
- 'status' => '状态',
+ 'vin' => '车架号',
+ 'vin_placeholder' => '请输入车架号',
+ 'brand' => '车辆品牌',
+ 'brand_placeholder' => '请输入车辆品牌',
+ 'model' => '车辆型号',
+ 'model_placeholder' => '请输入车辆型号',
+ 'status' => '车辆状态',
'status_placeholder' => '请选择状态',
'status_1' => '正常',
'status_0' => '禁用',
- 'location' => '当前位置',
- 'location_placeholder' => '请选择当前位置',
- 'final_location' => '最终位置',
- 'final_location_placeholder' => '请选择最终位置',
- 'fbo_location' => 'FBO位置',
- 'fbo_location_placeholder' => '请选择FBO位置',
+ 'status_pending' => '待发车',
+ 'status_shipping_to_fbo' => '在途(发往fbo港口)',
+ 'status_arrived_fbo' => '抵达发货港口',
+ 'status_shipping_to_warehouse' => '在途(发往目的地仓库)',
+ 'status_arrived_warehouse' => '抵达仓库',
+ 'status_sold' => '售出',
+ 'purchase_location' => '买车地点',
+ 'purchase_location_placeholder' => '请输入买车地点',
+ 'procedure_location' => '手续办理地',
+ 'procedure_location_placeholder' => '请输入手续办理地',
+ 'fbo_location' => 'FBO目的地',
+ 'fbo_location_placeholder' => '请选择FBO目的地',
+ 'current_location' => '车辆所在地',
+ 'current_location_placeholder' => '请选择车辆所在地',
+ 'final_location' => '最终目的地',
+ 'final_location_placeholder' => '请选择最终目的地',
+ 'departure_time' => 'FBO发车时间',
+ 'departure_time_placeholder' => '请选择发车时间',
+ 'arrival_time' => 'FBO到达时间',
+ 'arrival_time_placeholder' => '请选择到达时间',
+ 'shipping_cycle' => '运输周期',
+ 'shipping_cycle_placeholder' => '请输入运输周期',
'img_url' => '图片',
'img_url_placeholder' => '请输入图片URL',
'created_at' => '创建时间',
@@ -42,5 +63,10 @@ return [
'upload_image' => '上传图片',
'select_location' => '选择位置',
'select_final_location' => '选择目的地',
- 'select_fbo_location' => '选择FBO港口'
+ 'select_fbo_location' => '选择FBO港口',
+ 'please_select' => '请选择',
+ 'self_owned' => '自主',
+ 'agent' => '代理',
+ 'classify' => '分类',
+ 'classify_placeholder' => '请选择分类'
];
\ No newline at end of file
diff --git a/plugin/admin/app/view/index/index.html b/plugin/admin/app/view/index/index.html
index a1c5481..8802738 100644
--- a/plugin/admin/app/view/index/index.html
+++ b/plugin/admin/app/view/index/index.html
@@ -93,7 +93,7 @@
- = $translations['system_name'] ?? 'Vehicle Data Platform' ?>
+ = $translations['system_name'] ?? 'Vehicle Data Platform' ?>