From cb3a93b3c186ec1bb8ec8cadcca1109f7e8f312b Mon Sep 17 00:00:00 2001 From: shilei <965026003@qq.com> Date: Thu, 18 Jul 2024 13:40:22 +0800 Subject: [PATCH] =?UTF-8?q?7.18=20=20=E5=9B=BD=E9=99=85=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/system_base_config/index.vue | 202 +++++++++++--------- 1 file changed, 109 insertions(+), 93 deletions(-) diff --git a/src/views/home/system_base_config/index.vue b/src/views/home/system_base_config/index.vue index 7bfd875..cd2ddf1 100644 --- a/src/views/home/system_base_config/index.vue +++ b/src/views/home/system_base_config/index.vue @@ -5,20 +5,20 @@
- + - +
- +
@@ -51,22 +51,22 @@
- + - 营运中 - 歇业中 - 设备维护状态 - 暂停营业 + {{ $t('message.system_base_config.In_operation') }} + {{ $t('message.system_base_config.close_business') }} + {{ $t('message.system_base_config.maintenance_status') }} + {{ $t('message.system_base_config.Suspension') }}
- +
@@ -78,11 +78,11 @@
- + {{ ChooseSpace.ceid }}
@@ -91,11 +91,11 @@
- + {{ ChooseSpace.oid }}
@@ -149,20 +149,20 @@
- + - 自动 - 手动 + {{ $t('message.system_base_config.auto') }} + {{ $t('message.system_base_config.Manual') }}
- +
@@ -197,33 +197,33 @@
- 新增 - + {{ $t('message.system_base_config.add') }} +
- + - - + + - + - 保存 - + {{ $t('message.system_base_config.save') }} +
@@ -234,26 +234,26 @@
- 新增 + {{ $t('message.system_base_config.add') }}
- + - + - + - 保存 - + {{ $t('message.system_base_config.save') }} +
@@ -261,34 +261,43 @@
- + - - + + + - - + + - - + + @@ -297,32 +306,37 @@ - + - - + + + - - + + @@ -330,11 +344,11 @@ @@ -344,8 +358,8 @@ @@ -358,6 +372,8 @@ import { ElMessageBox, ElMessage } from 'element-plus'; import { SysSystemBaseconfigApi, SysChargeMonitorApi } from '/@/api-services/api'; import { onMounted, reactive, ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +const { t } = useI18n(); const ChooseSpace = ref({ swapSoc: null, @@ -419,9 +435,9 @@ const SetElectPrice = async () => { array.push(Electricity.value); const response = await getAPI(SysSystemBaseconfigApi).apiAddStationElecPriceInfoListPost(array); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } resest_price(); handle_price(); @@ -441,9 +457,9 @@ const SetElectBattery = async () => { if (!valid) return; const response = await getAPI(SysSystemBaseconfigApi).apiBatteryOpModelDetailAddPost(batter_form.value); if (response.data.isSuccess) { - ElMessage.success('新增成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('新增失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_apiBatteryOpModelDetailPost(); resest_battery(); @@ -475,9 +491,9 @@ const SetChooseSpace = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetReplacementStrategyPost(ChooseSpace.value); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); }; @@ -489,9 +505,9 @@ const SetLightTime = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetDaytimePost(data); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); }; @@ -501,9 +517,9 @@ const SetChangeOperate = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetChargingOperationModePost(data); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); }; @@ -514,18 +530,18 @@ const SetBusinessTime = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetBusinessHoursPost(data); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); }; const ElecPriceForCharge = async () => { const response = await getAPI(SysChargeMonitorApi).apiDistributeElecPriceForChargeGet(ChooseSpace.value.ceid); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } }; @@ -542,9 +558,9 @@ const SetElectPrice_every = async (item) => { } else { const response = await getAPI(SysSystemBaseconfigApi).apiUpdateStationElecPriceInfoPost(priceArray.value); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error(response.data?.msg || '操作失败'); + ElMessage.error(response.data?.msg || t('message.system_base_config.Operation_failed')); } handle_price(); } @@ -555,9 +571,9 @@ const SetElectBattery_every = async (item) => { } else { const response = await getAPI(SysSystemBaseconfigApi).apiBatteryOpModelDetailUpdatePost(item); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error(response.data?.msg || '操作失败'); + ElMessage.error(response.data?.msg || t('message.system_base_config.Operation_failed')); } handle_apiBatteryOpModelDetailPost(); } @@ -569,9 +585,9 @@ const Delete_ElectBattery_every = async (item) => { }; const response = await getAPI(SysSystemBaseconfigApi).apiBatteryOpModelDetailDeletePost(params); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error(response.data?.msg || '操作失败'); + ElMessage.error(response.data?.msg || t('message.system_base_config.Operation_failed')); } handle_apiBatteryOpModelDetailPost(); }; @@ -579,9 +595,9 @@ const Delete_ElectBattery_every = async (item) => { const Delete_apiGetRemovePriceConfig = async (item) => { const response = await getAPI(SysSystemBaseconfigApi).apiGetRemovePriceConfig(item.id); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error(response.data?.msg || '操作失败'); + ElMessage.error(response.data?.msg || t('message.system_base_config.Operation_failed')); } handle_price(); }; @@ -591,9 +607,9 @@ const SetChangePattern = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetSwitchingOperaModeReqPost(data); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); }; @@ -610,9 +626,9 @@ const SetHandoverStationStatus = async () => { }; const response = await getAPI(SysSystemBaseconfigApi).apiSetSwitchingOperaModeReqPost(data); if (response.data.isSuccess) { - ElMessage.success('操作成功'); + ElMessage.success(t('message.system_base_config.Operation_successful')); } else { - ElMessage.error('操作失败'); + ElMessage.error(t('message.system_base_config.Operation_failed')); } handle_getdata(); };