Parcourir la source

feat: 组态管理-大屏设计:删除按钮二次确认增加支持多语言

vera_min il y a 1 mois
Parent
commit
ede95e3378

+ 3 - 2
src/i18n/pages/iotmanagerI18n/en.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-05 12:42:31
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-30 13:26:21
+ * @LastEditTime: 2025-08-30 13:38:20
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/iotmanagerI18n/en.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -400,7 +400,8 @@ export default {
 			deleteDiagramMessage: "This operation will permanently delete the diagram: {name}, continue?",
 			configureNamePlaceholder: "Enter configure name",
 			configureNameValidator: "Configure name cannot be empty.",
-			defaultCategory: "Default Category"
+			defaultCategory: "Default Category",
+			deleteScreenMessage: "This operation will permanently delete the screen: {name}, continue?"
 		}
 	}
 };

+ 3 - 2
src/i18n/pages/iotmanagerI18n/zh-cn.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-05 12:42:31
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-30 13:25:32
+ * @LastEditTime: 2025-08-30 13:38:05
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/iotmanagerI18n/zh-cn.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -400,7 +400,8 @@ export default {
 			deleteDiagramMessage: "此操作将永久删除组态图:{name}, 是否继续?",
 			configureNamePlaceholder: "输入组态图名称",
 			configureNameValidator: "组态图名称不能为空",
-			defaultCategory: "默认分类"
+			defaultCategory: "默认分类",
+			deleteScreenMessage: "此操作将永久删除大屏:{name}, 是否继续?"
 		}
 	}
 };

+ 3 - 2
src/i18n/pages/iotmanagerI18n/zh-tw.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-05 12:42:31
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-30 13:27:03
+ * @LastEditTime: 2025-08-30 13:38:45
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/iotmanager/zh-tw.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -400,7 +400,8 @@ export default {
 			deleteDiagramMessage: "此操作將永久刪除組態圖:{name}, 是否繼續?",
 			configureNamePlaceholder: "輸入組態圖名稱",
 			configureNameValidator: "組態圖名稱不能為空",
-			defaultCategory: "默認分類"
+			defaultCategory: "默認分類",
+			deleteScreenMessage: "此操作將永久刪除大屏:{name}, 是否繼續?"
 		}
 	}
 };

+ 9 - 4
src/views/iot/configuration/screen/index.vue

@@ -64,6 +64,9 @@ import api from '/@/api/screen';
 import { ElMessageBox, ElMessage } from 'element-plus';
 import { useSearch } from '/@/hooks/useCommon';
 import EditForm from './edit.vue';
+import { useI18n } from 'vue-i18n';
+// 国际化
+const { t } = useI18n();
 
 const editFormRef = ref();
 
@@ -140,13 +143,15 @@ const preview = async (row: any) => {
 };
 
 const onDel = (row: any) => {
-  ElMessageBox.confirm(`此操作将删除大屏:“${row.projectName}”,是否继续?`, '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
+  ElMessageBox.confirm(
+    t('message.configuration.designScreen.deleteScreenMessage', { name: row.projectName }), 
+    t('message.tableI18nConfirm.deleteTitle'), {
+    confirmButtonText: t('message.tableI18nConfirm.confirmText'),
+    cancelButtonText: t('message.tableI18nConfirm.cancelText'),
     type: 'warning',
   }).then(async () => {
     await api.del([row.id as string]);
-    ElMessage.success('删除成功');
+    ElMessage.success(t('message.tableI18nConfirm.deleteSuccess'));
     getList();
   });
 };