Pārlūkot izejas kodu

perf: 多语言词条格式优化

vera_min 2 mēneši atpakaļ
vecāks
revīzija
194ba04630

+ 4 - 4
src/i18n/index.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-02 12:21:54
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:16:04
+ * @LastEditTime: 2025-08-06 01:54:53
  * @FilePath: /sagoo-admin-ui/src/i18n/index.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -26,9 +26,9 @@ import pagesTable18nZhcn from './pages/tableI18n/zh-cn';
 import pagesTable18nEn from './pages/tableI18n/en';
 import pagesTable18nZhtw from './pages/tableI18n/zh-tw';
 
-import pagesIotmanagerZhcn from '/@/i18n/pages/iotmanager/zh-cn';
-import pagesIotmanagerEn from '/@/i18n/pages/iotmanager/en';
-import pagesIotmanagerZhtw from '/@/i18n/pages/iotmanager/zh-tw';
+import pagesIotmanagerZhcn from './pages/iotmanagerI18n/zh-cn';
+import pagesIotmanagerEn from './pages/iotmanagerI18n/en';
+import pagesIotmanagerZhtw from './pages/iotmanagerI18n/zh-tw';
 
 // 定义语言国际化内容
 /**

+ 6 - 3
src/i18n/pages/formI18n/en.ts

@@ -5,7 +5,8 @@ export default {
 		email: 'email',
 		autograph: 'autograph',
 		createdTime: "Created Time",
-		alarmStatus: "Alarm Status"
+		alarmStatus: "Alarm Status",
+		categoryName: "Category Name"
 	},
 	formI18nPlaceholder: {
 		name: 'Please enter your name',
@@ -13,7 +14,8 @@ export default {
 		autograph: 'Please enter the login account name',
 		startDate: "The start date",
 		endDate: "The end date",
-		alarmStatus: "Alarm Status"
+		alarmStatus: "Alarm Status",
+		categoryName: "Category Name"
 	},
 	formI18nOption: {
 		unprocessed: "Unprocessed",
@@ -22,6 +24,7 @@ export default {
 	},
 	formI18nButton: {
 		query: "Query",
-		reset: "Reset"
+		reset: "Reset",
+		addCategory: "Add Category"
 	}
 };

+ 7 - 4
src/i18n/pages/formI18n/zh-cn.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-02 12:21:54
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:10:34
+ * @LastEditTime: 2025-08-06 01:58:18
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/formI18n/zh-cn.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -13,7 +13,8 @@ export default {
 		email: '用户归属组织',
 		autograph: '登陆账户名',
 		createdTime: "创建时间",
-		alarmStatus: "告警状态"
+		alarmStatus: "告警状态",
+		categoryName: "分类名称"
 	},
 	formI18nPlaceholder: {
 		name: '请输入姓名',
@@ -21,7 +22,8 @@ export default {
 		autograph: '请输入登陆账户名',
 		startDate: "开始日期",
 		endDate: "结束日期",
-		alarmStatus: "告警状态"
+		alarmStatus: "告警状态",
+		categoryName: "请输入分类名称"
 	},
 	formI18nOption: {
 		unprocessed: "未处理",
@@ -30,6 +32,7 @@ export default {
 	},
 	formI18nButton: {
 		query: "查询",
-		reset: "重置"
+		reset: "重置",
+		addCategory: "新增分类"
 	}
 };

+ 7 - 4
src/i18n/pages/formI18n/zh-tw.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-02 12:21:54
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:07:37
+ * @LastEditTime: 2025-08-06 02:00:06
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/formI18n/zh-tw.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -13,7 +13,8 @@ export default {
 		email: '用戶歸屬部門',
 		autograph: '登入帳戶名',
 		createdTime: "創建時間",
-		alarmStatus: "告警狀態"
+		alarmStatus: "告警狀態",
+		categoryName: "分類名稱"
 	},
 	formI18nPlaceholder: {
 		name: '請輸入姓名',
@@ -21,7 +22,8 @@ export default {
 		autograph: '請輸入登入帳戶名',
 		startDate: "開始日期",
 		endDate: "結束日期",
-		alarmStatus: "告警狀態"
+		alarmStatus: "告警狀態",
+		categoryName: "請輸入分類名稱"
 	},
 	formI18nOption: {
 		unprocessed: "未處理",
@@ -30,6 +32,7 @@ export default {
 	},
 	formI18nButton: {
 		query: "查詢",
-		reset: "重置"
+		reset: "重置",
+		addCategory: "新增分類"
 	}
 };

+ 31 - 0
src/i18n/pages/iotmanager/en.ts → src/i18n/pages/iotmanagerI18n/en.ts

@@ -1,3 +1,11 @@
+/*
+ * @Author: vera_min vera_min@163.com
+ * @Date: 2025-08-05 12:42:31
+ * @LastEditors: vera_min vera_min@163.com
+ * @LastEditTime: 2025-08-06 02:05:11
+ * @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
+ */
 // 定义内容
 export default {
 	dashboard: {
@@ -46,5 +54,28 @@ export default {
 			detail: "Detail",
 			process: "Process"
 		}
+	},
+	device: {
+		tableI18nColumn: {
+			id: "ID",
+			alarmType: "Alarm Type",
+			alarmLevel: "Rule Level",
+			ruleName: "Rule Name",
+			productKey: "Product Key",
+			deviceKey: "Device Key",
+			alarmStatus: "Alarm Status",
+			alarmTime: "Alarm Time",
+			operation: "Operation"
+		},
+		tableI18nAlarmType: {
+			ruleAlarm: "Rule Alarm",
+			deviceSelfAlarm: "Device Self Alarm",
+			ruleAlarmUpgrade: "Rule Alarm Upgrade"
+		},
+		tableI18nStatus: {
+			unprocessed: "Unprocessed",
+			processed: "Processed",
+			ignored: "Ignored"
+		}
 	}
 };

+ 31 - 0
src/i18n/pages/iotmanager/zh-cn.ts → src/i18n/pages/iotmanagerI18n/zh-cn.ts

@@ -1,3 +1,11 @@
+/*
+ * @Author: vera_min vera_min@163.com
+ * @Date: 2025-08-05 12:42:31
+ * @LastEditors: vera_min vera_min@163.com
+ * @LastEditTime: 2025-08-06 02:02:22
+ * @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
+ */
 // 定义内容
 export default {
 	dashboard: {
@@ -46,5 +54,28 @@ export default {
 			detail: "详情",
 			process: "处理"
 		}
+	},
+	device: {
+		tableI18nColumn: {
+			id: "ID",
+			alarmType: "告警类型",
+			alarmLevel: "规则级别",
+			ruleName: "规则名称",
+			productKey: "产品标识",
+			deviceKey: "设备标识",
+			alarmStatus: "告警状态",
+			alarmTime: "告警时间",
+			operation: "操作"
+		},
+		tableI18nAlarmType: {
+			ruleAlarm: "规则告警",
+			deviceSelfAlarm: "设备自主告警",
+			ruleAlarmUpgrade: "规侧告警升级"
+		},
+		tableI18nStatus: {
+			unprocessed: "未处理",
+			processed: "已处理",
+			ignored: "已忽略"
+		}
 	}
 };

+ 24 - 1
src/i18n/pages/iotmanager/zh-tw.ts → 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-05 13:18:54
+ * @LastEditTime: 2025-08-06 02:04:56
  * @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
  */
@@ -54,5 +54,28 @@ export default {
 			detail: "詳情",
 			process: "處理"
 		}
+	},
+	device: {
+		tableI18nColumn: {
+			id: "ID",
+			alarmType: "告警類型",
+			alarmLevel: "規則級別",
+			ruleName: "規則名稱",
+			productKey: "產品標識",
+			deviceKey: "設備標識",
+			alarmStatus: "告警狀態",
+			alarmTime: "告警時間",
+			operation: "操作"
+		},
+		tableI18nAlarmType: {
+			ruleAlarm: "規則告警",
+			deviceSelfAlarm: "設備自主告警",
+			ruleAlarmUpgrade: "規側告警升級"
+		},
+		tableI18nStatus: {
+			unprocessed: "未處理",
+			processed: "已處理",
+			ignored: "已忽略"
+		},
 	}
 };

+ 1 - 18
src/i18n/pages/tableI18n/en.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-06 01:16:57
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:16:57
+ * @LastEditTime: 2025-08-06 02:09:42
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/en.ts
  * @Description: 表格国际化 - 英文
  */
@@ -10,25 +10,8 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		alarmType: "Alarm Type",
-		alarmLevel: "Rule Level", 
-		ruleName: "Rule Name",
-		productKey: "Product Key",
-		deviceKey: "Device Key",
-		alarmStatus: "Alarm Status",
-		alarmTime: "Alarm Time",
 		operation: "Operation"
 	},
-	tableI18nAlarmType: {
-		ruleAlarm: "Rule Alarm",
-		deviceSelfAlarm: "Device Self Alarm",
-		ruleAlarmUpgrade: "Rule Alarm Upgrade"
-	},
-	tableI18nStatus: {
-		unprocessed: "Unprocessed",
-		processed: "Processed", 
-		ignored: "Ignored"
-	},
 	tableI18nAction: {
 		detail: "Detail",
 		handle: "Handle"

+ 1 - 18
src/i18n/pages/tableI18n/zh-cn.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-06 01:16:57
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:18:05
+ * @LastEditTime: 2025-08-06 02:09:52
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-cn.ts
  * @Description: 表格国际化 - 简体中文
  */
@@ -10,25 +10,8 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		alarmType: "告警类型",
-		alarmLevel: "规则级别", 
-		ruleName: "规则名称",
-		productKey: "产品标识",
-		deviceKey: "设备标识",
-		alarmStatus: "告警状态",
-		alarmTime: "告警时间",
 		operation: "操作"
 	},
-	tableI18nAlarmType: {
-		ruleAlarm: "规则告警",
-		deviceSelfAlarm: "设备自主告警",
-		ruleAlarmUpgrade: "规侧告警升级"
-	},
-	tableI18nStatus: {
-		unprocessed: "未处理",
-		processed: "已处理", 
-		ignored: "已忽略"
-	},
 	tableI18nAction: {
 		detail: "详情",
 		handle: "处理"

+ 1 - 18
src/i18n/pages/tableI18n/zh-tw.ts

@@ -2,7 +2,7 @@
  * @Author: vera_min vera_min@163.com
  * @Date: 2025-08-06 01:16:57
  * @LastEditors: vera_min vera_min@163.com
- * @LastEditTime: 2025-08-06 01:18:22
+ * @LastEditTime: 2025-08-06 02:05:18
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-tw.ts
  * @Description: 表格国际化 - 繁体中文
  */
@@ -10,25 +10,8 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		alarmType: "告警類型",
-		alarmLevel: "規則級別", 
-		ruleName: "規則名稱",
-		productKey: "產品標識",
-		deviceKey: "設備標識",
-		alarmStatus: "告警狀態",
-		alarmTime: "告警時間",
 		operation: "操作"
 	},
-	tableI18nAlarmType: {
-		ruleAlarm: "規則告警",
-		deviceSelfAlarm: "設備自主告警",
-		ruleAlarmUpgrade: "規側告警升級"
-	},
-	tableI18nStatus: {
-		unprocessed: "未處理",
-		processed: "已處理", 
-		ignored: "已忽略"
-	},
 	tableI18nAction: {
 		detail: "詳情",
 		handle: "處理"

+ 14 - 14
src/views/iot/alarm/log/index.vue

@@ -33,37 +33,37 @@
 			<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading" max-height="calc(100vh  - 255px)">
 				<el-table-column label="ID" align="center" prop="id" width="100" v-col="'ID'" />
 				<!-- 告警类型 -->
-				<el-table-column :label="$t('message.tableI18nColumn.alarmType')" prop="type" width="120" show-overflow-tooltip v-col="'type'">
+				<el-table-column :label="$t('message.device.tableI18nColumn.alarmType')" prop="type" width="120" show-overflow-tooltip v-col="'type'">
 					<template #default="scope">
 						<!-- 规则告警 -->
-						<span v-if="scope.row.type == 1">{{ $t('message.tableI18nAlarmType.ruleAlarm') }}</span>
+						<span v-if="scope.row.type == 1">{{ $t('message.device.tableI18nAlarmType.ruleAlarm') }}</span>
             <!-- 设备自主告警 -->
-						<span v-else-if="scope.row.type == 2">{{ $t('message.tableI18nAlarmType.deviceSelfAlarm') }}</span>
+						<span v-else-if="scope.row.type == 2">{{ $t('message.device.tableI18nAlarmType.deviceSelfAlarm') }}</span>
             <!--  规则侧告警升级 -->
-						<span v-else-if="scope.row.type == 3">{{ $t('message.tableI18nAlarmType.ruleAlarmUpgrade') }}</span>
+						<span v-else-if="scope.row.type == 3">{{ $t('message.device.tableI18nAlarmType.ruleAlarmUpgrade') }}</span>
             <!-- 规则告警 -->
-						<span v-else>{{ $t('message.tableI18nAlarmType.deviceSelfAlarm') }}</span>
+						<span v-else>{{ $t('message.device.tableI18nAlarmType.deviceSelfAlarm') }}</span>
 					</template>
 				</el-table-column>
 				<!-- 规则级别 -->
-				<el-table-column :label="$t('message.tableI18nColumn.alarmLevel')" prop="alarmLevel.name" width="100" align="center" show-overflow-tooltip v-col="'alarmLevel'"></el-table-column>
+				<el-table-column :label="$t('message.device.tableI18nColumn.alarmLevel')" prop="alarmLevel.name" width="100" align="center" show-overflow-tooltip v-col="'alarmLevel'"></el-table-column>
 				<!-- 规则名称 -->
-				<el-table-column :label="$t('message.tableI18nColumn.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
+				<el-table-column :label="$t('message.device.tableI18nColumn.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
 				<!-- 产品标识 -->
-				<el-table-column :label="$t('message.tableI18nColumn.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
+				<el-table-column :label="$t('message.device.tableI18nColumn.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
 				<!-- 设备标识 -->
-				<el-table-column :label="$t('message.tableI18nColumn.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
+				<el-table-column :label="$t('message.device.tableI18nColumn.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
 
 				<!-- 告警状态 -->
-				<el-table-column prop="status" :label="$t('message.tableI18nColumn.alarmStatus')" width="120" align="center" v-col="'status'">
+				<el-table-column prop="status" :label="$t('message.device.tableI18nColumn.alarmStatus')" width="120" align="center" v-col="'status'">
 					<template #default="scope">
-						<el-tag type="danger" size="small" v-if="scope.row.status == 0">{{ $t('message.tableI18nStatus.unprocessed') }}</el-tag>
-						<el-tag type="success" size="small" v-if="scope.row.status == 1">{{ $t('message.tableI18nStatus.processed') }}</el-tag>
-						<el-tag type="info" size="small" v-if="scope.row.status == 2">{{ $t('message.tableI18nStatus.ignored') }}</el-tag>
+						<el-tag type="danger" size="small" v-if="scope.row.status == 0">{{ $t('message.device.tableI18nStatus.unprocessed') }}</el-tag>
+						<el-tag type="success" size="small" v-if="scope.row.status == 1">{{ $t('message.device.tableI18nStatus.processed') }}</el-tag>
+						<el-tag type="info" size="small" v-if="scope.row.status == 2">{{ $t('message.device.tableI18nStatus.ignored') }}</el-tag>
 					</template>
 				</el-table-column>
 				<!-- 告警时间 -->
-				<el-table-column prop="createdAt" :label="$t('message.tableI18nColumn.alarmTime')" align="center" width="160" v-col="'createdAt'"></el-table-column>
+				<el-table-column prop="createdAt" :label="$t('message.device.tableI18nColumn.alarmTime')" align="center" width="160" v-col="'createdAt'"></el-table-column>
 				<!-- 操作 -->
 				<el-table-column :label="$t('message.tableI18nColumn.operation')" width="140" align="center" fixed="right" v-col="'handle'">
 					<template #default="scope">

+ 4 - 4
src/views/iot/device/category/index.vue

@@ -2,21 +2,21 @@
   <div class="page">
     <el-card shadow="nover">
       <el-form inline>
-        <el-form-item label="分类名称">
-          <el-input v-model="tableData.param.name" placeholder="请输入分类名称" @keyup.enter.native="getCateList" class="w-50" clearable />
+        <el-form-item :label="$t('message.formI18nLabel.categoryName')">
+          <el-input v-model="tableData.param.name" :placeholder="$t('message.formI18nPlaceholder.categoryName')" @keyup.enter.native="getCateList" class="w-50" clearable />
         </el-form-item>
         <el-form-item>
           <el-button type="primary" class="ml10" @click="getCateList">
             <el-icon>
               <ele-Search />
             </el-icon>
-            查询
+            {{ $t('message.formI18nButton.query') }}
           </el-button>
           <el-button type="primary" class="ml10" @click="onOpenAdd" v-auth="'add'">
             <el-icon>
               <ele-FolderAdd />
             </el-icon>
-            新增分类
+            {{ $t('message.formI18nButton.addCategory') }}
           </el-button>
         </el-form-item>
       </el-form>