vera_min преди 2 месеца
родител
ревизия
2bbaa7b1bf

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

@@ -6,7 +6,11 @@ export default {
 		autograph: 'autograph',
 		createdTime: "Created Time",
 		alarmStatus: "Alarm Status",
-		categoryName: "Category Name"
+		categoryName: "Category Name",
+		sort: "Sort",
+		parentCategory: "Parent Category",
+		categoryKey: "Category Key",
+		desc: "Description"
 	},
 	formI18nPlaceholder: {
 		name: 'Please enter your name',
@@ -15,7 +19,10 @@ export default {
 		startDate: "The start date",
 		endDate: "The end date",
 		alarmStatus: "Alarm Status",
-		categoryName: "Category Name"
+		categoryName: "Please enter a category Name",
+		parentCategory: "Please select a category",
+		categoryKey: "Please enter a category key",
+		desc: "Please enter a description"
 	},
 	formI18nOption: {
 		unprocessed: "Unprocessed",
@@ -25,6 +32,9 @@ export default {
 	formI18nButton: {
 		query: "Query",
 		reset: "Reset",
-		addCategory: "Add Category"
+		addCategory: "Add Category",
+		edit: "Edit",
+		add: "Add",
+		cancel: "Cancel",
 	}
 };

+ 14 - 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:58:18
+ * @LastEditTime: 2025-08-06 03:05:50
  * @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
  */
@@ -14,7 +14,11 @@ export default {
 		autograph: '登陆账户名',
 		createdTime: "创建时间",
 		alarmStatus: "告警状态",
-		categoryName: "分类名称"
+		categoryName: "分类名称",
+		sort: "排序",
+		parentCategory: "上级分类",
+		categoryKey: "分类标识",
+		desc: "描述"
 	},
 	formI18nPlaceholder: {
 		name: '请输入姓名',
@@ -23,7 +27,10 @@ export default {
 		startDate: "开始日期",
 		endDate: "结束日期",
 		alarmStatus: "告警状态",
-		categoryName: "请输入分类名称"
+		categoryName: "请输入分类名称",
+		parentCategory: "请选择分类",
+		categoryKey: "请输入分类标识",
+		desc: "请输入描述"
 	},
 	formI18nOption: {
 		unprocessed: "未处理",
@@ -33,6 +40,9 @@ export default {
 	formI18nButton: {
 		query: "查询",
 		reset: "重置",
-		addCategory: "新增分类"
+		addCategory: "新增分类",
+		edit: "修 改",
+		add: "添 加",
+		cancel: "取 消",
 	}
 };

+ 14 - 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 02:00:06
+ * @LastEditTime: 2025-08-06 03:26:41
  * @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
  */
@@ -14,7 +14,11 @@ export default {
 		autograph: '登入帳戶名',
 		createdTime: "創建時間",
 		alarmStatus: "告警狀態",
-		categoryName: "分類名稱"
+		categoryName: "分類名稱",
+		sort: "排序",
+		parentCategory: "上級分類",
+		categoryKey: "分類標識",
+		desc: "描述"
 	},
 	formI18nPlaceholder: {
 		name: '請輸入姓名',
@@ -23,7 +27,10 @@ export default {
 		startDate: "開始日期",
 		endDate: "結束日期",
 		alarmStatus: "告警狀態",
-		categoryName: "請輸入分類名稱"
+		categoryName: "請輸入分類名稱",
+		parentCategory: "請選擇分類",
+		categoryKey: "請輸入分類標識",
+		desc: "請輸入描述"
 	},
 	formI18nOption: {
 		unprocessed: "未處理",
@@ -33,6 +40,9 @@ export default {
 	formI18nButton: {
 		query: "查詢",
 		reset: "重置",
-		addCategory: "新增分類"
+		addCategory: "新增分類",
+		edit: "修 改",
+		add: "添 加",
+		cancel: "取 消",
 	}
 };

+ 17 - 24
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-06 02:05:11
+ * @LastEditTime: 2025-08-06 03:23:00
  * @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
  */
@@ -29,33 +29,27 @@ export default {
 	},
 	alarmList: {
 		title: "Alarm Messages",
-		moreInfo: "More Info",
-		columns: {
-			id: "ID",
-			alarmType: "Alarm Type",
-			alarmLevel: "Rule Level",
-			ruleName: "Rule Name",
-			productKey: "Product Key",
-			deviceKey: "Device Key",
-			status: "Status",
-			createdAt: "Alarm Time",
-			actions: "Actions"
+		moreInfo: "More Info"
+	},
+	device: {
+		tableI18nColumn: {
+			categoryName: "Category Name",
+			desc: "Description",
+			sort: "Sort",
 		},
-		alarmTypes: {
-			ruleAlarm: "Rule Alarm",
-			deviceSelfAlarm: "Device Self Alarm",
-			ruleAlarmUpgrade: "Rule Alarm Upgrade"
+		tableI18nAlarmType: {
 		},
-		status: {
-			processed: "Processed",
-			unprocessed: "Unprocessed"
+		tableI18nStatus: {
 		},
-		actions: {
-			detail: "Detail",
-			process: "Process"
+		tableI18nConfirm: {
+			deleteMessage: "This operation will permanently delete the category: {name}, continue?",
+		},
+		tableI18nAction: {
+			addCategory: "Add Category",
+			editCategory: "Edit Category"
 		}
 	},
-	device: {
+	alarm: {
 		tableI18nColumn: {
 			id: "ID",
 			alarmType: "Alarm Type",
@@ -65,7 +59,6 @@ export default {
 			deviceKey: "Device Key",
 			alarmStatus: "Alarm Status",
 			alarmTime: "Alarm Time",
-			operation: "Operation"
 		},
 		tableI18nAlarmType: {
 			ruleAlarm: "Rule Alarm",

+ 17 - 24
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-06 02:02:22
+ * @LastEditTime: 2025-08-06 03:22:35
  * @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
  */
@@ -29,33 +29,27 @@ export default {
 	},
 	alarmList: {
 		title: "告警消息",
-		moreInfo: "更多信息",
-		columns: {
-			id: "ID",
-			alarmType: "告警类型",
-			alarmLevel: "规则级别",
-			ruleName: "规则名称",
-			productKey: "产品标识",
-			deviceKey: "设备标识",
-			status: "告警状态",
-			createdAt: "告警时间",
-			actions: "操作"
+		moreInfo: "更多信息"
+	},
+	device: {
+		tableI18nColumn: {
+			categoryName: "分类名称",
+			desc: "描述",
+			sort: "排序",
 		},
-		alarmTypes: {
-			ruleAlarm: "规则告警",
-			deviceSelfAlarm: "设备自主告警",
-			ruleAlarmUpgrade: "规侧告警升级"
+		tableI18nAlarmType: {
 		},
-		status: {
-			processed: "已处理",
-			unprocessed: "未处理"
+		tableI18nStatus: {
 		},
-		actions: {
-			detail: "详情",
-			process: "处理"
+		tableI18nConfirm: {
+			deleteMessage: "此操作将永久删除分类:{name}, 是否继续?",
+		},
+		tableI18nAction: {
+			addCategory: "添加分类",
+			editCategory: "修改分类"
 		}
 	},
-	device: {
+	alarm: {
 		tableI18nColumn: {
 			id: "ID",
 			alarmType: "告警类型",
@@ -65,7 +59,6 @@ export default {
 			deviceKey: "设备标识",
 			alarmStatus: "告警状态",
 			alarmTime: "告警时间",
-			operation: "操作"
 		},
 		tableI18nAlarmType: {
 			ruleAlarm: "规则告警",

+ 18 - 25
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-06 02:04:56
+ * @LastEditTime: 2025-08-06 03:23:24
  * @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
  */
@@ -29,33 +29,27 @@ export default {
 	},
 	alarmList: {
 		title: "告警消息",
-		moreInfo: "更多信息",
-		columns: {
-			id: "ID",
-			alarmType: "告警類型",
-			alarmLevel: "規則級別",
-			ruleName: "規則名稱",
-			productKey: "產品標識",
-			deviceKey: "設備標識",
-			status: "告警狀態",
-			createdAt: "告警時間",
-			actions: "操作"
+		moreInfo: "更多信息"
+	},
+	device: {
+		tableI18nColumn: {
+			categoryName: "分類名稱",
+			desc: "描述",
+			sort: "排序",
 		},
-		alarmTypes: {
-			ruleAlarm: "規則告警",
-			deviceSelfAlarm: "設備自主告警",
-			ruleAlarmUpgrade: "規側告警升級"
+		tableI18nAlarmType: {
 		},
-		status: {
-			processed: "已處理",
-			unprocessed: "未處理"
+		tableI18nStatus: {
 		},
-		actions: {
-			detail: "詳情",
-			process: "處理"
+		tableI18nConfirm: {
+			deleteMessage: "此操作將永久刪除分類:{name}, 是否繼續?",
+		},
+		tableI18nAction: {
+			addCategory: "添加分類",
+			editCategory: "修改分類"
 		}
 	},
-	device: {
+	alarm: {
 		tableI18nColumn: {
 			id: "ID",
 			alarmType: "告警類型",
@@ -65,7 +59,6 @@ export default {
 			deviceKey: "設備標識",
 			alarmStatus: "告警狀態",
 			alarmTime: "告警時間",
-			operation: "操作"
 		},
 		tableI18nAlarmType: {
 			ruleAlarm: "規則告警",
@@ -76,6 +69,6 @@ export default {
 			unprocessed: "未處理",
 			processed: "已處理",
 			ignored: "已忽略"
-		},
+		}
 	}
 };

+ 14 - 2
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 02:09:42
+ * @LastEditTime: 2025-08-06 14:37:43
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/en.ts
  * @Description: 表格国际化 - 英文
  */
@@ -12,8 +12,20 @@ export default {
 		id: "ID",
 		operation: "Operation"
 	},
+	tableI18nConfirm: {
+		deleteTitle: "Confirm",
+		confirmText: "Delete",
+		cancelText: "Cancel",
+		deleteSuccess: "Delete Success",
+		addSuccess: "Create Success",
+		addFailed: "Create Failed",
+		editSuccess: "Edit Success"
+	},
 	tableI18nAction: {
 		detail: "Detail",
-		handle: "Handle"
+		handle: "Handle",
+		add: "Add",
+		edit: "Edit",
+		delete: "Delete"
 	}
 };

+ 14 - 2
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 02:09:52
+ * @LastEditTime: 2025-08-06 14:35:07
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-cn.ts
  * @Description: 表格国际化 - 简体中文
  */
@@ -12,8 +12,20 @@ export default {
 		id: "ID",
 		operation: "操作"
 	},
+	tableI18nConfirm: {
+		deleteTitle: "提示",
+		confirmText: "删除",
+		cancelText: "取消",
+		deleteSuccess: "删除成功",
+		addSuccess: "添加成功",
+		addFailed: "添加失败",
+		editSuccess: "修改成功"
+	},
 	tableI18nAction: {
 		detail: "详情",
-		handle: "处理"
+		handle: "处理",
+		add: "新增",
+		edit: "修改",
+		delete: "删除"
 	}
 };

+ 14 - 2
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 02:05:18
+ * @LastEditTime: 2025-08-06 14:39:37
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-tw.ts
  * @Description: 表格国际化 - 繁体中文
  */
@@ -12,8 +12,20 @@ export default {
 		id: "ID",
 		operation: "操作"
 	},
+	tableI18nConfirm: {
+		deleteTitle: "提示",
+		confirmText: "刪除",
+		cancelText: "取消",
+		deleteSuccess: "刪除成功",
+		addSuccess: "添加成功",
+		addFailed: "添加失敗",
+		editSuccess: "修改成功"
+	},
 	tableI18nAction: {
 		detail: "詳情",
-		handle: "處理"
+		handle: "處理",
+		add: "新增",
+		edit: "修改",
+		delete: "刪除"
 	}
 };

+ 1 - 1
src/store/modules/themeConfig.ts

@@ -132,7 +132,7 @@ const themeConfigModule: Module<ThemeConfigState, RootStateTypes> = {
 			// 网站副标题(登录页顶部文字)
 			globalViceTitle: 'IOT管理系统',
 			// 默认初始语言,可选值"<zh-cn|en|zh-tw>",默认 zh-cn
-			globalI18n: Local.get('themeConfig').globalI18n || 'zh-cn',
+			globalI18n: Local.get('themeConfig')?.globalI18n || 'zh-cn',
 			// 默认全局组件大小,可选值"<large|'default'|small>",默认 'large'
 			globalComponentSize: 'default',
 		},

+ 30 - 17
src/views/iot/alarm/list/index.vue

@@ -9,31 +9,44 @@
 					</div>
 					<el-table :data="tableData.data" style="width: 100%" v-loading="loading">
 						<el-table-column label="ID" align="center" prop="id" width="100" v-col="'ID'" />
-						<el-table-column :label="$t('message.alarmList.columns.alarmType')" width="120" prop="type" align="center" show-overflow-tooltip v-col="'type'">
+						<!-- 告警类型 -->
+						<el-table-column :label="$t('message.alarm.tableI18nColumn.alarmType')" width="120" prop="type" align="center" show-overflow-tooltip v-col="'type'">
 							<template #default="scope">
-								<span v-if="scope.row.type == 1">{{ $t('message.alarmList.alarmTypes.ruleAlarm') }}</span>
-								<span v-else-if="scope.row.type == 2">{{ $t('message.alarmList.alarmTypes.deviceSelfAlarm') }}</span>
-								<span v-else-if="scope.row.type == 3">{{ $t('message.alarmList.alarmTypes.ruleAlarmUpgrade') }}</span>
-								<span v-else>{{ $t('message.alarmList.alarmTypes.deviceSelfAlarm') }}</span>
+								<!-- 规则告警 -->
+								<span v-if="scope.row.type == 1">{{ $t('message.alarm.tableI18nAlarmType.ruleAlarm') }}</span>
+								<!-- 设备自主告警 -->
+								<span v-else-if="scope.row.type == 2">{{ $t('message.alarm.tableI18nAlarmType.deviceSelfAlarm') }}</span>
+								<!--  规则侧告警升级 -->
+								<span v-else-if="scope.row.type == 3">{{ $t('message.alarm.tableI18nAlarmType.ruleAlarmUpgrade') }}</span>
+								<!-- 设备自主告警 -->
+								<span v-else>{{ $t('message.alarm.tableI18nAlarmType.deviceSelfAlarm') }}</span>
 							</template>
 						</el-table-column>
-						<el-table-column :label="$t('message.alarmList.columns.alarmLevel')" width="120" align="center" prop="alarmLevel.name" show-overflow-tooltip v-col="'alarmLevel'" />
-						<el-table-column :label="$t('message.alarmList.columns.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
-						<el-table-column :label="$t('message.alarmList.columns.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
-						<el-table-column :label="$t('message.alarmList.columns.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
-
-						<el-table-column prop="status" :label="$t('message.alarmList.columns.status')" width="100" align="center" v-col="'status'">
+						<!-- 规则级别 -->
+						<el-table-column :label="$t('message.alarm.tableI18nColumn.alarmLevel')" width="120" align="center" prop="alarmLevel.name" show-overflow-tooltip v-col="'alarmLevel'" />
+						<!-- 规则名称 -->
+						<el-table-column :label="$t('message.alarm.tableI18nColumn.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
+						<!-- 产品标识 -->
+						<el-table-column :label="$t('message.alarm.tableI18nColumn.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
+						<!-- 设备标识 -->
+						<el-table-column :label="$t('message.alarm.tableI18nColumn.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
+						<!-- 告警状态 -->
+						<el-table-column prop="status" :label="$t('message.alarm.tableI18nColumn.alarmStatus')" width="120" align="center" v-col="'status'">
 							<template #default="scope">
-								<el-tag type="success" size="small" v-if="scope.row.status">{{ $t('message.alarmList.status.processed') }}</el-tag>
-								<el-tag type="info" size="small" v-else>{{ $t('message.alarmList.status.unprocessed') }}</el-tag>
+								<el-tag type="success" size="small" v-if="scope.row.status">{{ $t('message.alarm.tableI18nStatus.processed') }}</el-tag>
+								<el-tag type="info" size="small" v-else>{{ $t('message.alarm.tableI18nStatus.unprocessed') }}</el-tag>
 							</template>
 						</el-table-column>
-						<el-table-column prop="createdAt" :label="$t('message.alarmList.columns.createdAt')" align="center" width="170" v-col="'createdAt'"></el-table-column>
-						<el-table-column :label="$t('message.alarmList.columns.actions')" width="130" align="center" fixed="right" v-col="'handle'">
+						<!-- 告警时间 -->
+						<el-table-column prop="createdAt" :label="$t('message.alarm.tableI18nColumn.alarmTime')" align="center" width="170" v-col="'createdAt'"></el-table-column>
+						<!-- 操作 -->
+						<el-table-column :label="$t('message.tableI18nColumn.operation')" width="130" align="center" fixed="right" v-col="'handle'">
 							<template #default="scope">
-								<el-button v-auth="'detail'" size="small" text type="primary" @click="onOpenDetailDic(scope.row)">{{ $t('message.alarmList.actions.detail') }}</el-button>
+								<!-- 详情 -->
+								<el-button v-auth="'detail'" size="small" text type="primary" @click="onOpenDetailDic(scope.row)">{{ $t('message.tableI18nAction.detail') }}</el-button>
+								<!-- 处理 -->
 								<el-button v-auth="'edit'" size="small" text type="warning" @click="onOpenEditDic(scope.row)" v-if="scope.row.status == 0"
-									>{{ $t('message.alarmList.actions.process') }}</el-button
+									>{{ $t('message.tableI18nAction.handle') }}</el-button
 								>
 							</template>
 						</el-table-column>

+ 15 - 15
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.device.tableI18nColumn.alarmType')" prop="type" width="120" show-overflow-tooltip v-col="'type'">
+				<el-table-column :label="$t('message.alarm.tableI18nColumn.alarmType')" prop="type" width="120" show-overflow-tooltip v-col="'type'">
 					<template #default="scope">
 						<!-- 规则告警 -->
-						<span v-if="scope.row.type == 1">{{ $t('message.device.tableI18nAlarmType.ruleAlarm') }}</span>
+						<span v-if="scope.row.type == 1">{{ $t('message.alarm.tableI18nAlarmType.ruleAlarm') }}</span>
             <!-- 设备自主告警 -->
-						<span v-else-if="scope.row.type == 2">{{ $t('message.device.tableI18nAlarmType.deviceSelfAlarm') }}</span>
+						<span v-else-if="scope.row.type == 2">{{ $t('message.alarm.tableI18nAlarmType.deviceSelfAlarm') }}</span>
             <!--  规则侧告警升级 -->
-						<span v-else-if="scope.row.type == 3">{{ $t('message.device.tableI18nAlarmType.ruleAlarmUpgrade') }}</span>
-            <!-- 规则告警 -->
-						<span v-else>{{ $t('message.device.tableI18nAlarmType.deviceSelfAlarm') }}</span>
+						<span v-else-if="scope.row.type == 3">{{ $t('message.alarm.tableI18nAlarmType.ruleAlarmUpgrade') }}</span>
+            <!-- 设备自主告警 -->
+						<span v-else>{{ $t('message.alarm.tableI18nAlarmType.deviceSelfAlarm') }}</span>
 					</template>
 				</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.alarm.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.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
+				<el-table-column :label="$t('message.alarm.tableI18nColumn.ruleName')" prop="ruleName" show-overflow-tooltip v-col="'ruleName'" />
 				<!-- 产品标识 -->
-				<el-table-column :label="$t('message.device.tableI18nColumn.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
+				<el-table-column :label="$t('message.alarm.tableI18nColumn.productKey')" prop="productKey" show-overflow-tooltip v-col="'productKey'" />
 				<!-- 设备标识 -->
-				<el-table-column :label="$t('message.device.tableI18nColumn.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
+				<el-table-column :label="$t('message.alarm.tableI18nColumn.deviceKey')" prop="deviceKey" show-overflow-tooltip v-col="'deviceKey'" />
 
 				<!-- 告警状态 -->
-				<el-table-column prop="status" :label="$t('message.device.tableI18nColumn.alarmStatus')" width="120" align="center" v-col="'status'">
+				<el-table-column prop="status" :label="$t('message.alarm.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.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>
+						<el-tag type="danger" size="small" v-if="scope.row.status == 0">{{ $t('message.alarm.tableI18nStatus.unprocessed') }}</el-tag>
+						<el-tag type="success" size="small" v-if="scope.row.status == 1">{{ $t('message.alarm.tableI18nStatus.processed') }}</el-tag>
+						<el-tag type="info" size="small" v-if="scope.row.status == 2">{{ $t('message.alarm.tableI18nStatus.ignored') }}</el-tag>
 					</template>
 				</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 prop="createdAt" :label="$t('message.alarm.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">

+ 169 - 0
src/views/iot/device/category/component/addOrEdit.vue

@@ -0,0 +1,169 @@
+<template>
+	<div>
+		<el-dialog :title="(ruleForm.id ? $t('message.device.tableI18nAction.editCategory') : $t('message.device.tableI18nAction.addCategory'))" v-model="isShowDialog" width="600px">
+			<el-form ref="formRef" :model="ruleForm" :rules="rules" label-width="90px">
+				<el-row :gutter="35">
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+						<!-- 上级分类 -->
+						<el-form-item :label="$t('message.formI18nLabel.parentCategory')" :label-width="currentLocale === 'en' ? '120px' : '90px'">
+							<el-cascader :options="deptData" :props="{ checkStrictly: true, emitPath: false, value: 'id', label: 'name' }" :placeholder="$t('message.formI18nPlaceholder.parentCategory')" clearable class="w100" v-model="ruleForm.parentId">
+								<template #default="{ node, data }">
+									<span>{{ data.name }}</span>
+									<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
+								</template>
+							</el-cascader>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="16" :lg="16" :xl="16">
+						<!-- 分类名称 -->
+						<el-form-item :label="$t('message.formI18nLabel.categoryName')" prop="name" :label-width="currentLocale === 'en' ? '120px' : '90px'">
+							<el-input v-model="ruleForm.name" :placeholder="$t('message.formI18nPlaceholder.categoryName')" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8">
+						<!-- 排序 -->
+						<el-form-item :label="$t('message.formI18nLabel.sort')" prop="sort" label-width="40px">
+							<el-input-number v-model="ruleForm.sort" :min="0" :max="100" step="1" step-strictly="true" controls-position="right" :placeholder="$t('message.formI18nPlaceholder.sort')" class="w100" />
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+						<!-- 分类标识 -->
+						<el-form-item :label="$t('message.formI18nLabel.categoryKey')" prop="key" :label-width="currentLocale === 'en' ? '120px' : '90px'">
+							<el-input v-model="ruleForm.key" :placeholder="$t('message.formI18nPlaceholder.categoryKey')" clearable></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+						<!-- 描述 -->
+						<el-form-item :label="$t('message.formI18nLabel.desc')" prop="desc" :label-width="currentLocale === 'en' ? '120px' : '90px'">
+							<el-input v-model="ruleForm.desc" type="textarea" :placeholder="$t('message.formI18nPlaceholder.desc')" maxlength="150"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<template #footer>
+				<span class="dialog-footer">
+					<el-button @click="onCancel">{{ $t('message.formI18nButton.cancel') }}</el-button>
+					<el-button type="primary" @click="onSubmit" :loading="loading">{{ ruleForm.id ? $t('message.formI18nButton.edit') : $t('message.formI18nButton.add') }}</el-button>
+				</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, toRefs, defineComponent, ref, unref, computed, defineEmits } from 'vue';
+import api from '/@/api/device';
+import { ElMessage } from 'element-plus';
+import { useI18n } from 'vue-i18n';
+
+// 国际化
+const { locale, t } = useI18n();
+
+const currentLocale = computed(() => locale.value);	
+
+
+const emit = defineEmits(['getCateList']);
+
+
+interface RuleFormState {
+	id?: number;
+	parentId: number;
+	name: string;
+	key: string;
+	desc: string;
+	sort: number;
+	children?: RuleFormState[];
+}
+
+const baseForm: RuleFormState = {
+	parentId: 0, // 上级分类
+	name: '', // 分类名称
+	key: '',
+	desc: '',
+	sort: 0
+};
+
+		const formRef = ref<HTMLElement | null>(null);
+		const loading = ref(false); // 添加loading状态'
+		const isShowDialog = ref(false);
+		const deptData = ref([]);// 分类数据
+		const orgData = ref([]);// 组织数据
+		// 使用computed自动响应语言变化
+		const rules = computed(() => ({
+				name: [{ required: true, message: t('message.formI18nPlaceholder.categoryName'), trigger: 'blur' }],
+				key: [{ required: true, message: t('message.formI18nPlaceholder.categoryKey'), trigger: 'blur' }],
+		}));
+		const ruleForm = ref({
+			...baseForm,
+		})
+
+		// // 打开弹窗
+		const openDialog = (row?: RuleFormState | number) => {
+			resetForm();
+			api.category.getList({ status: 1 }).then((res: any) => {
+				deptData.value = res.category || [];
+			});
+
+
+			if (row && typeof row === 'object') {
+				ruleForm.value = row;
+			} else if (row && typeof row === 'number') {
+				ruleForm.value.parentId = row;
+			}
+			isShowDialog.value = true;
+		};
+		// 关闭弹窗
+		const closeDialog = () => {
+			isShowDialog.value = false;
+		};
+		// 取消
+		const onCancel = () => {
+			closeDialog();
+		};
+		// 新增
+		const onSubmit = () => {
+			const formWrap = unref(formRef) as any;
+			if (!formWrap) return;
+			formWrap.validate(async (valid: boolean) => {
+				if (valid) {
+					// 禁用按钮
+					loading.value = true;
+					if (!ruleForm.value.parentId) {
+						ruleForm.value.parentId = 0;
+					}
+					if (!ruleForm.value.id) {
+						//添加
+						try {
+							// 等待提交完成
+							await api.category.add(ruleForm.value);
+							ElMessage.success(t('message.tableI18nConfirm.addSuccess'));
+							closeDialog(); // 关闭弹窗
+							emit('getCateList');
+						} catch (error) {
+							ElMessage.error(t('message.tableI18nConfirm.addFailed'));
+						}
+					} else {
+						//修改
+						try {
+							// 等待提交完成
+							await api.category.edit(ruleForm.value);
+							ElMessage.success(t('message.tableI18nConfirm.editSuccess'));
+							closeDialog(); // 关闭弹窗
+							emit('getCateList');
+						} catch (error) { }
+					}
+					// 启用按钮
+					loading.value = false;
+				} else {
+					// 表单验证失败时,启用按钮
+					loading.value = false;
+				}
+			});
+		};
+		const resetForm = () => {
+			ruleForm.value = {
+				...baseForm,
+			};
+		};
+defineExpose({ openDialog });
+</script>

+ 0 - 175
src/views/iot/device/category/component/edit.vue

@@ -1,175 +0,0 @@
-<template>
-	<div class="system-edit-dept-container">
-		<el-dialog :title="(ruleForm.id ? '修改' : '添加') + '分类'" v-model="isShowDialog" width="600px">
-			<el-form ref="formRef" :model="ruleForm" :rules="rules" label-width="90px">
-				<el-row :gutter="35">
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-						<el-form-item label="上级分类">
-							<el-cascader :options="deptData" :props="{ checkStrictly: true, emitPath: false, value: 'id', label: 'name' }" placeholder="请选择分类" clearable class="w100" v-model="ruleForm.parentId">
-								<template #default="{ node, data }">
-									<span>{{ data.name }}</span>
-									<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
-								</template>
-							</el-cascader>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="16" :lg="16" :xl="16">
-						<el-form-item label="分类名称" prop="name">
-							<el-input v-model="ruleForm.name" placeholder="请输入分类名称" clearable></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8">
-						<el-form-item label="排序" prop="sort" label-width="40px">
-							<el-input-number v-model="ruleForm.sort" :min="0" controls-position="right" placeholder="请输入排序" class="w100" />
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-						<el-form-item label="分类标识" prop="key">
-							<el-input v-model="ruleForm.key" placeholder="请输入分类名称" clearable></el-input>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-						<el-form-item label="描述" prop="desc">
-							<el-input v-model="ruleForm.desc" type="textarea" placeholder="请输入描述" maxlength="150"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-			<template #footer>
-				<span class="dialog-footer">
-					<el-button @click="onCancel">取 消</el-button>
-					<el-button type="primary" @click="onSubmit" :loading="loading">{{ ruleForm.id ? '修 改' : '添 加' }}</el-button>
-				</span>
-			</template>
-		</el-dialog>
-	</div>
-</template>
-
-<script lang="ts">
-import { reactive, toRefs, defineComponent, ref, unref } from 'vue';
-import api from '/@/api/device';
-import { ElMessage } from 'element-plus';
-
-interface RuleFormState {
-	id?: number;
-	parentId: number;
-	name: string;
-	key: string;
-	desc: string;
-	sort: number;
-	children?: RuleFormState[];
-}
-interface DeptSate {
-	isShowDialog: boolean;
-	ruleForm: RuleFormState;
-	deptData: RuleFormState[];
-	orgData: any[];
-	rules: object;
-}
-
-const baseForm: RuleFormState = {
-	parentId: 0, // 上级分类
-	name: '', // 分类名称
-	key: '',
-	desc: '',
-	sort: 0
-};
-
-export default defineComponent({
-	name: 'deviceEditCate',
-	setup(prop, { emit }) {
-		const formRef = ref<HTMLElement | null>(null);
-		const loading = ref(false); // 添加loading状态
-		const state = reactive<DeptSate>({
-			isShowDialog: false,
-			ruleForm: {
-				...baseForm,
-			},
-			deptData: [], // 分类数据
-			orgData: [], // 组织数据
-			rules: {
-				name: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
-				key: [{ required: true, message: '分类标识不能为空', trigger: 'blur' }],
-			},
-		});
-
-		// 打开弹窗
-		const openDialog = (row?: RuleFormState | number) => {
-			resetForm();
-			api.category.getList({ status: 1 }).then((res: any) => {
-				state.deptData = res.category || [];
-			});
-
-
-			if (row && typeof row === 'object') {
-				state.ruleForm = row;
-			} else if (row && typeof row === 'number') {
-				state.ruleForm.parentId = row;
-			}
-			state.isShowDialog = true;
-		};
-		// 关闭弹窗
-		const closeDialog = () => {
-			state.isShowDialog = false;
-		};
-		// 取消
-		const onCancel = () => {
-			closeDialog();
-		};
-		// 新增
-		const onSubmit = () => {
-			const formWrap = unref(formRef) as any;
-			if (!formWrap) return;
-			formWrap.validate(async (valid: boolean) => {
-				if (valid) {
-					// 禁用按钮
-					loading.value = true;
-					if (!state.ruleForm.parentId) {
-						state.ruleForm.parentId = 0;
-					}
-					if (!state.ruleForm.id) {
-						//添加
-						try {
-							// 等待提交完成
-							await api.category.add(state.ruleForm);
-							ElMessage.success('分类添加成功');
-							closeDialog(); // 关闭弹窗
-							emit('getCateList');
-						} catch (error) {
-							ElMessage.error('分类添加失败');
-						}
-					} else {
-						//修改
-						try {
-							// 等待提交完成
-							await api.category.edit(state.ruleForm);
-							ElMessage.success('分类修改成功');
-							closeDialog(); // 关闭弹窗
-							emit('getCateList');
-						} catch (error) { }
-					}
-					// 启用按钮
-					loading.value = false;
-				} else {
-					// 表单验证失败时,启用按钮
-					loading.value = false;
-				}
-			});
-		};
-		const resetForm = () => {
-			state.ruleForm = {
-				...baseForm,
-			};
-		};
-		return {
-			loading,
-			openDialog,
-			closeDialog,
-			onCancel,
-			onSubmit,
-			formRef,
-			...toRefs(state),
-		};
-	},
-});
-</script>

+ 72 - 79
src/views/iot/device/category/index.vue

@@ -3,15 +3,17 @@
     <el-card shadow="nover">
       <el-form inline>
         <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-input v-model="tableData.param.name" :placeholder="$t('message.formI18nPlaceholder.categoryName')" @keyup.enter.native="getCateList" class="w-50" clearable :style="{width: currentLang === 'en' ? '220px' : '150px' }" />
         </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 />
@@ -21,27 +23,39 @@
         </el-form-item>
       </el-form>
       <el-table :data="tableData.data" style="width: 100%" row-key="id" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" v-loading="tableData.loading">
-        <el-table-column prop="name" label="分类名称" v-col="'name'" show-overflow-tooltip> </el-table-column>
-        <el-table-column prop="desc" label="描述" align="center" v-col="'desc'"></el-table-column>
-        <el-table-column prop="sort" v-col="'sort'" label="排序" align="center"></el-table-column>
-        <el-table-column label="操作" align="center" width="140" fixed="right">
+        <!-- 分类名称 -->
+        <el-table-column prop="name" :label="$t('message.device.tableI18nColumn.categoryName')" v-col="'name'" show-overflow-tooltip> </el-table-column>
+        <!-- 描述 -->
+        <el-table-column prop="desc" :label="$t('message.device.tableI18nColumn.desc')" align="center" v-col="'desc'"></el-table-column>
+        <!-- 排序 -->
+        <el-table-column prop="sort" v-col="'sort'" :label="$t('message.device.tableI18nColumn.sort')" align="center"></el-table-column>
+        <!-- 操作 -->
+        <el-table-column :label="$t('message.tableI18nColumn.operation')" align="center" width="140" fixed="right">
           <template #default="scope">
-            <el-button size="small" type="text" @click="onOpenAdd(scope.row)" v-auth="'add'">新增</el-button>
-            <el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-auth="'edit'">修改</el-button>
-            <el-button size="small" text type="info" @click="onTabelRowDel(scope.row)" v-auth="'del'">删除</el-button>
+            <!-- 新增 -->
+            <el-button size="small" type="text" @click="onOpenAdd(scope.row)" v-auth="'add'">{{ $t('message.tableI18nAction.add') }}</el-button>
+            <!-- 修改 -->
+            <el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-auth="'edit'">{{ $t('message.tableI18nAction.edit') }}</el-button>
+            <!-- 删除 -->
+            <el-button size="small" text type="info" @click="onTabelRowDel(scope.row)" v-auth="'del'">{{ $t('message.tableI18nAction.delete') }}</el-button>
           </template>
         </el-table-column>
       </el-table>
     </el-card>
-    <EditCate ref="editDeptRef" @getCateList="getCateList" />
+    <AddOrEditCate ref="addOrEditRef" @getCateList="getCateList" />
   </div>
 </template>
 
-<script lang="ts">
-import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue';
+<script lang="ts" setup>
+import { ref, onMounted, computed, watch } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus';
-import EditCate from './component/edit.vue';
+import AddOrEditCate from './component/addOrEdit.vue';
 import api from '/@/api/device';
+import { useI18n } from 'vue-i18n';
+
+const { t, locale } = useI18n();
+
+const currentLang = computed(() => locale.value);
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
@@ -53,75 +67,54 @@ interface TableDataRow {
   leader: string;
   children?: TableDataRow[];
 }
-interface TableDataState {
-  tableData: {
-    data: Array<TableDataRow>;
-    loading: boolean;
-    param: {
-      name: string;
-      status: number;
-    };
-  };
-}
 
-export default defineComponent({
-  name: 'deviceCate',
-  components: { EditCate },
-  setup() {
-    const editDeptRef = ref();
-    const state = reactive<TableDataState>({
-      tableData: {
-        data: [],
-        loading: false,
-        param: {
-          name: '',
-          status: -1,
-        },
-      },
-    });
-    // 初始化表格数据
-    const initTableData = () => {
+const addOrEditRef = ref();
+const tableData = ref<any>({
+    data: [],
+    loading: false,
+    param: {
+      name: '',
+      status: -1,
+    },
+});
+// 初始化表格数据
+const initTableData = () => {
+  getCateList();
+};
+const getCateList = () => {
+  tableData.value.loading = true;
+  api.category.getList(tableData.value.param).then((res: any) => {
+    tableData.value.data = res.category;
+  }).finally(() => (tableData.value.loading = false));
+};
+// 打开新增菜单弹窗
+const onOpenAdd = (row?: TableDataRow) => {
+  addOrEditRef.value.openDialog(row?.id);
+};
+// 打开编辑菜单弹窗
+const onOpenEdit = (row: TableDataRow) => {
+  addOrEditRef.value.openDialog({ ...row });
+};
+// 删除当前行
+const onTabelRowDel = (row: TableDataRow) => {
+  ElMessageBox.confirm(
+    t('message.device.tableI18nConfirm.deleteMessage', { name: row.name }),
+    t('message.tableI18nConfirm.deleteTitle'),
+    {
+      confirmButtonText: t('message.tableI18nConfirm.confirmText'),
+      cancelButtonText: t('message.tableI18nConfirm.cancelText'),
+      type: 'warning',
+    }
+  ).then(() => {
+    api.category.del(row.id).then(() => {
+      // 删除成功
+      ElMessage.success(t('message.tableI18nConfirm.deleteSuccess'));
       getCateList();
-    };
-    const getCateList = () => {
-      state.tableData.loading = true;
-      api.category.getList(state.tableData.param).then((res: any) => {
-        state.tableData.data = res.category;
-      }).finally(() => (state.tableData.loading = false));
-    };
-    // 打开新增菜单弹窗
-    const onOpenAdd = (row?: TableDataRow) => {
-      editDeptRef.value.openDialog(row?.id);
-    };
-    // 打开编辑菜单弹窗
-    const onOpenEdit = (row: TableDataRow) => {
-      editDeptRef.value.openDialog({ ...row });
-    };
-    // 删除当前行
-    const onTabelRowDel = (row: TableDataRow) => {
-      ElMessageBox.confirm(`此操作将永久删除分类:${row.name}, 是否继续?`, '提示', {
-        confirmButtonText: '删除',
-        cancelButtonText: '取消',
-        type: 'warning',
-      }).then(() => {
-        api.category.del(row.id).then(() => {
-          ElMessage.success('删除成功');
-          getCateList();
-        });
-      });
-    };
-    // 页面加载时
-    onMounted(() => {
-      initTableData();
     });
-    return {
-      editDeptRef,
-      getCateList,
-      onOpenAdd,
-      onOpenEdit,
-      onTabelRowDel,
-      ...toRefs(state),
-    };
-  },
+  });
+};
+// 页面加载时
+onMounted(() => {
+  initTableData();
 });
 </script>