Procházet zdrojové kódy

feat: 设备管理-产品-详情增加多语言词条

vera_min před 2 měsíci
rodič
revize
4d35a9db94

+ 41 - 1
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-08 21:22:28
+ * @LastEditTime: 2025-08-08 23:30:52
  * @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
  */
@@ -32,6 +32,46 @@ export default {
 		moreInfo: "More Info"
 	},
 	device: {
+		product: "Product",
+		producDetail: {
+			productInfo: "Product Information",
+			// Switch Status
+			enable: "ON",
+			disable: "OFF",
+			productIdentifier: "Product Identifier",
+			productCategory: "Product Category",
+			deviceType: "Device Type",
+			productImage: "Product Image",
+			loadFailed: "Load Failed",
+			messageProtocol: "Message Protocol",
+			// 物模型相关
+			thingModel: "Thing Model",
+			propertyDefinition: "Property Definition",
+			propertyIdentifier: "Property Identifier",
+			propertyName: "Property Name",
+			dataType: "Data Type",
+			precision: "Precision",
+			unit: "Unit",
+			readOnly: "Read Only",
+			readonly: "Read Only",
+			readWrite: "Read/Write",
+			remark: "Remark",
+			functionDefinition: "Function Definition",
+			functionIdentifier: "Function Identifier",
+			eventDefinition: "Event Definition",
+			eventIdentifier: "Event Identifier",
+			name: "Name",
+			eventLevel: "Event Level",
+			normal: "Normal",
+			warning: "Warning",
+			urgent: "Urgent",
+			tagDefinition: "Tag Definition",
+			// 导入导出
+			importModel: "Import Thing Model",
+			exportModel: "Export Thing Model",
+			deviceAccess: "Device Access",
+			dataParsing: "Data Parsing"
+		},
 		tableI18nColumn: {
 			categoryName: "Category Name",
 			desc: "Description",

+ 43 - 6
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-08 21:26:06
+ * @LastEditTime: 2025-08-08 23:12:36
  * @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
  */
@@ -32,6 +32,46 @@ export default {
 		moreInfo: "更多信息"
 	},
 	device: {
+		product: "产品",
+		producDetail: {
+			productInfo: "产品信息",
+			// 开关状态
+			enable: "启用",
+			disable: "停用",
+			productIdentifier: "产品标识",
+			productCategory: "产品分类",
+			deviceType: "设备类型",
+			productImage: "产品图片",
+			loadFailed: "加载失败",
+			messageProtocol: "消息协议",
+			// 物模型相关
+			thingModel: "物模型",
+			propertyDefinition: "属性定义",
+			propertyIdentifier: "属性标识",
+			propertyName: "属性名称",
+			dataType: "数据类型",
+			precision: "精度",
+			unit: "单位",
+			readOnly: "是否只读",
+			readonly: "只读",
+			readWrite: "读写",
+			remark: "说明",
+			functionDefinition: "功能定义",
+			functionIdentifier: "功能标识",
+			eventDefinition: "事件定义",
+			eventIdentifier: "事件标识",
+			name: "名称",
+			eventLevel: "事件级别",
+			normal: "普通",
+			warning: "警告",
+			urgent: "紧急",
+			tagDefinition: "标签定义",
+			// 导入导出
+			importModel: "导入物模型",
+			exportModel: "导出物模型",
+			deviceAccess: "设备接入",
+			dataParsing: "数据解析"
+		},
 		tableI18nColumn: {
 			categoryName: "分类名称",
 			desc: "描述",
@@ -54,8 +94,8 @@ export default {
 			deleteProductMessage: "此操作将永久删除产品:{name},是否继续?"
 		},
 		tableI18nAction: {
-			addCategory: "添加分类",
-			editCategory: "修改分类",
+			addCategory: "新增分类",
+			editCategory: "编辑分类",
 			deviceManagement: "设备管理",
 		},
 		formI18nLabel: {
@@ -74,9 +114,6 @@ export default {
 			subDevice: "子设备",
 			on: "已启用",
 			off: "未启用"
-		},
-		formI18nButton: {
-			addProduct: "新增产品"
 		}
 			
 	},

+ 46 - 6
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-08 21:22:52
+ * @LastEditTime: 2025-08-08 23:14: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
  */
@@ -11,14 +11,14 @@ export default {
 	dashboard: {
 		"产品": "產品",
 		"在线设备": "在線設備",
-		"设备消息": "設備息",
+		"设备消息": "設備息",
 		"设备警告": "設備警告",
 		"启用": "啟用",
 		"停用": "停用",
 		"本月": "本月",
 		"今日": "今日",
 		warningType: "預警類型",
-		messageCount: "息量",
+		messageCount: "息量",
 		warningCount: "預警量",
 		"超紧急": "超緊急",
 		"緊急": "緊急",
@@ -28,10 +28,50 @@ export default {
 		total: "總計"
 	},
 	alarmList: {
-		title: "告警息",
-		moreInfo: "更多信息"
+		title: "告警息",
+		moreInfo: "更多資訊"
 	},
 	device: {
+		product: "產品",
+		producDetail: {
+			productInfo: "產品資訊",
+			// 開關狀態
+			enable: "啟用",
+			disable: "停用",
+			productIdentifier: "產品標識",
+			productCategory: "產品分類",
+			deviceType: "設備類型",
+			productImage: "產品圖片",
+			loadFailed: "載入失敗",
+			messageProtocol: "訊息協議",
+			// 物模型相關
+			thingModel: "物模型",
+			propertyDefinition: "屬性定義",
+			propertyIdentifier: "屬性標識",
+			propertyName: "屬性名稱",
+			dataType: "數據類型",
+			precision: "精度",
+			unit: "單位",
+			readOnly: "是否只讀",
+			readonly: "只讀",
+			readWrite: "讀寫",
+			remark: "說明",
+			functionDefinition: "功能定義",
+			functionIdentifier: "功能標識",
+			eventDefinition: "事件定義",
+			eventIdentifier: "事件標識",
+			name: "名稱",
+			eventLevel: "事件級別",
+			normal: "普通",
+			warning: "警告",
+			urgent: "緊急",
+			tagDefinition: "標籤定義",
+			// 導入導出
+			importModel: "導入物模型",
+			exportModel: "導出物模型",
+			deviceAccess: "設備接入",
+			dataParsing: "資料解析"
+		},
 		tableI18nColumn: {
 			categoryName: "分類名稱",
 			desc: "描述",
@@ -55,7 +95,7 @@ export default {
 		},
 		tableI18nAction: {
 			addCategory: "添加分類",
-			editCategory: "修改分類",
+			editCategory: "編輯分類",
 			deviceManagement: "設備管理"
 		},
 		formI18nLabel: {

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

@@ -10,7 +10,8 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		operation: "Operation"
+		operation: "Operation",
+		des: "Description",
 	},
 	tableI18nConfirm: {
 		deleteTitle: "Confirm",

+ 7 - 6
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-08 21:17:25
+ * @LastEditTime: 2025-08-08 22:30:49
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-cn.ts
  * @Description: 表格国际化 - 简体中文
  */
@@ -10,16 +10,17 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		operation: "操作"
+		operation: "操作",
+		des: "描述",
 	},
 	tableI18nConfirm: {
 		deleteTitle: "提示",
 		confirmText: "删除",
 		cancelText: "取消",
 		deleteSuccess: "删除成功",
-		addSuccess: "添加成功",
-		addFailed: "添加失败",
-		editSuccess: "修改成功",
+		addSuccess: "新增成功",
+		addFailed: "新增失败",
+		editSuccess: "编辑成功",
 		deleteSelectedMessage: "你确定要删除所选数据?",
 		selectDataFirst: "请选择要删除的数据。"
 	},
@@ -27,7 +28,7 @@ export default {
 		detail: "详情",
 		handle: "处理",
 		add: "新增",
-		edit: "修改",
+		edit: "编辑",
 		delete: "删除"
 	}
 };

+ 7 - 6
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-08 21:19:12
+ * @LastEditTime: 2025-08-08 22:31:05
  * @FilePath: /sagoo-admin-ui/src/i18n/pages/tableI18n/zh-tw.ts
  * @Description: 表格国际化 - 繁体中文
  */
@@ -10,16 +10,17 @@
 export default {
 	tableI18nColumn: {
 		id: "ID",
-		operation: "操作"
+		operation: "操作",
+		des: "描述",
 	},
 	tableI18nConfirm: {
 		deleteTitle: "提示",
 		confirmText: "刪除",
 		cancelText: "取消",
 		deleteSuccess: "刪除成功",
-		addSuccess: "添加成功",
-		addFailed: "添加失敗",
-		editSuccess: "修改成功",
+		addSuccess: "新增成功",
+		addFailed: "新增失敗",
+		editSuccess: "編輯成功",
 		deleteSelectedMessage: "你確定要刪除所選數據?",
 		selectDataFirst: "請選擇要刪除的數據。",
 	},
@@ -27,7 +28,7 @@ export default {
 		detail: "詳情",
 		handle: "處理",
 		add: "新增",
-		edit: "修改",
+		edit: "編輯",
 		delete: "刪除"
 	}
 };

+ 258 - 181
src/views/iot/device/product/detail.vue

@@ -2,154 +2,209 @@
 	<div class="page bg page-full">
 		<div class="content">
 			<div class="cont_box" style="align-items: center;">
-				<div class="title">产品:{{ detail.name }}</div>
+				<!-- 产品 -->
+				<div class="title">{{ `${$t('message.device.product')}:${detail.name}` }}</div>
 				<!-- <el-tag :type="developer_status == 1 ? 'success' : 'danger'" style="margin:0 20px;">{{ developer_status == 1 ? '已发布' : '未发布' }}</el-tag> -->
-				<el-switch v-auth="'startOrStop'" style="margin:0 20px;" v-model="developer_status" inline-prompt :active-value="1" :inactive-value="0" active-text="启用" inactive-text="停用" @change="CkOption"></el-switch>
+				<el-switch v-auth="'startOrStop'" style="margin:0 20px;" v-model="developer_status" inline-prompt :active-value="1" :inactive-value="0" :active-text="$t('message.device.producDetail.enable')" :inactive-text="$t('message.device.producDetail.disable')" @change="CkOption"></el-switch>
 			</div>
 		</div>
 
 		<el-tabs v-model="activeName" style="padding: 0 20px;" @tab-click="handleClick">
-			<el-tab-pane label="产品信息" name="1">
+			<!-- 产品信息 -->
+			<el-tab-pane :label="$t('message.device.producDetail.productInfo')" name="1">
 				<div class="pro-box">
-					<div class="protitle">产品信息</div>
-					<el-button type="" :icon="Edit" class="buttonedit" v-auth="'edit'" @click="onOpenEditDic(detail)">编辑</el-button>
+					<div class="protitle">{{$t('message.device.producDetail.productInfo')}}</div>
+					<!-- 编辑 -->
+					<el-button type="" :icon="Edit" class="buttonedit" v-auth="'edit'" @click="onOpenEditDic(detail)">{{ $t('message.tableI18nAction.edit') }}</el-button>
 				</div>
 
 				<el-descriptions class="margin-top" :column="3" border>
-					<el-descriptions-item label="产品标识"><copy :text="detail.key"></copy></el-descriptions-item>
-					<el-descriptions-item label="产品分类">{{ detail.categoryName }}</el-descriptions-item>
-					<el-descriptions-item label="设备类型">{{ detail.deviceType }}</el-descriptions-item>
-					<el-descriptions-item label="产品图片">
+					<!-- 产品标识 -->
+					<el-descriptions-item :label="$t('message.device.producDetail.productIdentifier')"><copy :text="detail.key"></copy></el-descriptions-item>
+					<!-- 产品分类 -->
+					<el-descriptions-item :label="$t('message.device.producDetail.productCategory')">{{ detail.categoryName }}</el-descriptions-item>
+					<!-- 设备类型 -->
+					<el-descriptions-item :label="$t('message.device.producDetail.deviceType')">{{ detail.deviceType }}</el-descriptions-item>
+					<!-- 产品图片 -->
+					<el-descriptions-item :label="$t('message.device.producDetail.productImage')">
 						<el-image style="width: 80px; height: 80px" :src="detail.icon" :previewSrcList="[detail.icon]" fit="contain">
 							<template #error>
 								<div class="image-slot">
 									<ele-Picture style="width: 30px;" />
-									加载失败
+									<!-- 加载失败 -->
+									{{ $t('message.device.producDetail.loadFailed') }}
 								</div>
 							</template>
 						</el-image>
 					</el-descriptions-item>
-					<el-descriptions-item label="消息协议">{{ detail.messageProtocol }}</el-descriptions-item>
-					<el-descriptions-item label="接入方式">{{ detail.transportProtocol }}</el-descriptions-item>
-					<el-descriptions-item label="描述">{{ detail.desc }}</el-descriptions-item>
+					<!-- 消息协议 -->
+					<el-descriptions-item :label="$t('message.device.producDetail.messageProtocol')">{{ detail.messageProtocol }}</el-descriptions-item>
+					<!-- 接入方式 -->
+					<el-descriptions-item :label="$t('message.device.tableI18nColumn.transportProtocol')">{{ detail.transportProtocol }}</el-descriptions-item>
+					<!-- 描述 -->
+					<el-descriptions-item :label="$t('message.tableI18nColumn.des')">{{ detail.desc }}</el-descriptions-item>
 				</el-descriptions>
 			</el-tab-pane>
-			<el-tab-pane label="物模型" name="2">
+			<!-- 物模型 -->
+			<el-tab-pane :label="$t('message.device.producDetail.thingModel')" name="2">
 				<el-tabs type="border-card" v-model="activetab" @tab-click="wuhandleClick">
-					<el-tab-pane label="属性定义" name="attr">
+					<!-- 属性定义 -->
+					<el-tab-pane :label="$t('message.device.producDetail.propertyDefinition')" name="attr">
 						<div class="wu-title">
-							<div class="title">属性定义</div>
-							<div><el-button size="small" type="primary" v-auth="'edit'" @click="onOpenEditAttr()">添加</el-button>
+							<div class="title">{{$t('message.device.producDetail.propertyDefinition')}}</div>
+							<!-- 新增 -->
+							<div>
+								<el-button size="small" type="primary" v-auth="'edit'" @click="onOpenEditAttr()">{{$t('message.tableI18nAction.add')}}</el-button>
 							</div>
 						</div>
 
-						<el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'attr'">
-							<el-table-column label="属性标识" align="center" prop="key" />
-							<el-table-column label="属性名称" prop="name" show-overflow-tooltip />
-							<el-table-column prop="valueType" label="数据类型" width="100" align="center">
+						<el-table style="width: 100%" :data="tableData.data" v-loading="tableData.loading" v-if="activetab == 'attr'">
+							<!-- 属性标识 -->
+							<el-table-column :label="$t('message.device.producDetail.propertyIdentifier')" align="center" prop="key" />
+							<!-- 属性名称 -->
+							<el-table-column :label="$t('message.device.producDetail.propertyName')" prop="name" show-overflow-tooltip />
+							<!-- 数据类型 -->
+							<el-table-column prop="valueType" :label="$t('message.device.producDetail.dataType')" width="100" align="center">
 								<template #default="scope">
 									<span>{{ scope.row.valueType.type }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column prop="decimals" label="精度" width="60" align="center">
+							<!-- 精度 -->
+							<el-table-column prop="decimals" :label="$t('message.device.producDetail.precision')" :width="currentLang == 'en' ? '100' : '60'" align="center">
 								<template #default="scope">
 									<span>{{ scope.row.valueType.decimals }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column prop="unit" label="单位" width="60" align="center">
+							<!-- 单位 -->
+							<el-table-column prop="unit" :label="$t('message.device.producDetail.unit')" width="60" align="center">
 								<template #default="scope">
 									<span>{{ scope.row.valueType.unit }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column prop="accessMode" label="是否只读" width="120" align="center">
+							<!-- 是否只读 -->
+							<el-table-column prop="accessMode" :label="$t('message.device.producDetail.readOnly')" width="120" align="center">
 								<template #default="scope">
-									<el-tag type="info" size="small" v-if="scope.row.accessMode">只读</el-tag>
-									<el-tag type="success" size="small" v-else>读写</el-tag>
+									<!-- 只读 -->
+									<el-tag type="info" size="small" v-if="scope.row.accessMode">{{ $t('message.device.producDetail.readonly') }}</el-tag>
+									<!-- 读写 -->
+									<el-tag type="success" size="small" v-else>{{ $t('message.device.producDetail.readWrite') }}</el-tag>
 								</template>
 							</el-table-column>
-							<el-table-column label="说明" prop="desc" show-overflow-tooltip />
-							<el-table-column label="操作" width="300" align="center" fixed="right">
+							<!-- 说明 -->
+							<el-table-column :label="$t('message.device.producDetail.remark')" prop="desc" show-overflow-tooltip />
+							<!-- 操作 -->
+							<el-table-column :label="$t('message.tableI18nColumn.operation')" width="120" align="center" fixed="right">
 								<template #default="scope">
-									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditAttr(scope.row)">修改</el-button>
-									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'attr')">删除</el-button>
+									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditAttr(scope.row)">{{ $t('message.tableI18nAction.edit') }}</el-button>
+									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'attr')">{{ $t('message.tableI18nAction.delete') }}</el-button>
 								</template>
 							</el-table-column>
 						</el-table>
 					</el-tab-pane>
-					<el-tab-pane label="功能定义" name="fun">
+					<!-- 功能定义 -->
+					<el-tab-pane :label="$t('message.device.producDetail.functionDefinition')" name="fun">
 						<div class="wu-title">
-							<div class="title">功能定义</div>
-							<div><el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditFun()">添加</el-button>
+							<div class="title">{{$t('message.device.producDetail.functionDefinition')}}</div>
+							<!-- 新增 -->
+							<div>
+								<el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditFun()">{{$t('message.tableI18nAction.add')}}</el-button>
 							</div>
 						</div>
 
 						<el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'fun'">
-							<el-table-column label="功能标识" align="center" prop="key" />
-							<el-table-column label="名称" prop="name" show-overflow-tooltip />
-
-							<el-table-column label="描述" prop="desc" show-overflow-tooltip />
-							<el-table-column label="操作" width="300" align="center" fixed="right">
+							<el-table-column :label="$t('message.device.producDetail.functionIdentifier')" align="center" prop="key" />
+							<el-table-column :label="$t('message.device.producDetail.name')" prop="name" show-overflow-tooltip />
+							<!-- 描述 -->
+							<el-table-column :label="$t('message.tableI18nColumn.des')" prop="desc" show-overflow-tooltip />
+							<!-- 操作 -->
+							<el-table-column :label="$t('message.tableI18nColumn.operation')" width="120" align="center" fixed="right">
 								<template #default="scope">
-									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditFun(scope.row)">修改</el-button>
-									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'fun')">删除</el-button>
+									<!-- 编辑 -->
+									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditFun(scope.row)">{{ $t('message.tableI18nAction.edit') }}</el-button>
+									<!-- 删除 -->
+									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'fun')">{{ $t('message.tableI18nAction.delete') }}</el-button>
 								</template>
 							</el-table-column>
 						</el-table>
 					</el-tab-pane>
-					<el-tab-pane label="事件定义" name="event">
+					<!-- 事件定义 -->
+					<el-tab-pane :label="$t('message.device.producDetail.eventDefinition')" name="event">
 						<div class="wu-title">
-							<div class="title">事件定义</div>
+							<div class="title">{{$t('message.device.producDetail.eventDefinition')}}</div>
 							<div>
-								<el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditEvent()">添加</el-button>
+								<el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditEvent()">{{$t('message.tableI18nAction.add')}}</el-button>
 							</div>
 						</div>
 
 						<el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'event'">
-							<el-table-column label="事件标识" align="center" prop="key" />
-							<el-table-column label="名称" prop="name" show-overflow-tooltip />
-							<el-table-column prop="level" label="事件级别" width="120" align="center">
+							<!-- 事件标识 -->
+							<el-table-column :label="$t('message.device.producDetail.eventIdentifier')" align="center" prop="key" />
+							<!-- 事件名称 -->
+							<el-table-column :label="$t('message.device.producDetail.name')" prop="name" show-overflow-tooltip />
+							<!-- 事件级别 -->
+							<el-table-column prop="level" :label="$t('message.device.producDetail.eventLevel')" width="120" align="center">
 								<template #default="scope">
-									<el-tag size="small" v-if="scope.row.level == 0">普通</el-tag>
-									<el-tag type="warning" size="small" v-if="scope.row.level == 1">警告</el-tag>
-									<el-tag type="danger" size="small" v-if="scope.row.level == 2">紧急</el-tag>
+									<!-- 普通 -->
+									<el-tag size="small" v-if="scope.row.level == 0">{{ $t('message.device.producDetail.normal') }}</el-tag>
+									<!-- 警告 -->
+									<el-tag type="warning" size="small" v-if="scope.row.level == 1">{{ $t('message.device.producDetail.warning') }}</el-tag>
+									<!-- 紧急 -->
+									<el-tag type="danger" size="small" v-if="scope.row.level == 2">{{ $t('message.device.producDetail.urgent') }}</el-tag>
 								</template>
 							</el-table-column>
-							<el-table-column label="描述" prop="desc" show-overflow-tooltip />
-
-							<el-table-column label="操作" width="300" align="center" fixed="right">
+							<!-- 描述 -->
+							<el-table-column :label="$t('message.tableI18nColumn.des')" prop="desc" show-overflow-tooltip />
+							<!-- 操作 -->
+							<el-table-column :label="$t('message.tableI18nColumn.operation')" width="120" align="center" fixed="right">
 								<template #default="scope">
-									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditEvent(scope.row)">修改</el-button>
-									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'event')">删除</el-button>
+									<!-- 编辑 -->
+									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditEvent(scope.row)">{{ $t('message.tableI18nAction.edit') }}</el-button>
+									<!-- 删除 -->
+									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'event')">{{ $t('message.tableI18nAction.delete') }}</el-button>
 								</template>
 							</el-table-column>
 						</el-table>
 					</el-tab-pane>
-					<el-tab-pane label="标签定义" name="tab">
+					<!-- 标签定义 -->
+					<el-tab-pane :label="$t('message.device.producDetail.tagDefinition')" name="tab">
 						<div class="wu-title">
-							<div class="title">标签定义</div>
-							<div><el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditTab()">添加</el-button>
+							<!-- 标签定义 -->
+							<div class="title">{{ $t('message.device.producDetail.tagDefinition') }}</div>
+							<!-- 添加 -->
+							<div>
+								<el-button size="small" type="primary" v-auth="'add'" @click="onOpenEditTab()">{{ $t('message.tableI18nAction.add') }}</el-button>
 							</div>
 						</div>
 
 						<el-table style="width: 100%" :data="tableData.data" v-if="activetab == 'tab'">
-							<el-table-column label="属性标识" align="center" prop="key" />
-							<el-table-column label="属性名称" prop="name" show-overflow-tooltip />
-							<el-table-column prop="valueType" label="数据类型" width="120" align="center">
+							<!-- 标签标识 -->
+							<el-table-column :label="$t('message.device.producDetail.propertyIdentifier')" align="center" prop="key" />
+							<!-- 属性名称 -->
+							<el-table-column :label="$t('message.device.producDetail.propertyName')" prop="name" show-overflow-tooltip />
+							<!-- 数据类型 -->
+							<el-table-column prop="valueType" :label="$t('message.device.producDetail.dataType')" width="120" align="center">
 								<template #default="scope">
 									<span>{{ scope.row.valueType.type }}</span>
 								</template>
 							</el-table-column>
-							<el-table-column prop="accessMode" label="是否只读" width="120" align="center">
+							<!-- 是否只读 -->
+							<el-table-column prop="accessMode" :label="$t('message.device.producDetail.readOnly')" width="120" align="center">
 								<template #default="scope">
-									<el-tag type="info" size="small" v-if="scope.row.accessMode">只读</el-tag>
-									<el-tag type="success" size="small" v-else>读写</el-tag>
+									<!-- 只读 -->
+									<el-tag type="info" size="small" v-if="scope.row.accessMode">{{ $t('message.device.producDetail.readonly') }}</el-tag>
+									<!-- 读写 -->
+									<el-tag type="success" size="small" v-else>{{ $t('message.device.producDetail.readWrite') }}</el-tag>
 								</template>
 							</el-table-column>
-							<el-table-column label="描述" prop="desc" show-overflow-tooltip />
-							<el-table-column label="操作" width="300" align="center" fixed="right">
+							<!-- 描述 -->
+							<el-table-column :label="$t('message.tableI18nColumn.des')" prop="desc" show-overflow-tooltip />
+							<!-- 操作 -->
+							<el-table-column :label="$t('message.tableI18nColumn.operation')" width="120" align="center" fixed="right">
 								<template #default="scope">
-									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditTag(scope.row)">修改</el-button>
-									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'tab')">删除</el-button>
+									<!-- 编辑 -->
+									<el-button size="small" text type="warning" v-auth="'edit'" @click="onEditTag(scope.row)">{{ $t('message.tableI18nAction.edit') }}</el-button>
+									<!-- 删除 -->
+									<el-button size="small" text type="danger" v-auth="'del'" @click="onRowDel(scope.row.key, 'tab')">{{ $t('message.tableI18nAction.delete') }}</el-button>
 								</template>
 							</el-table-column>
 						</el-table>
@@ -158,25 +213,29 @@
 				<div class="import">
 					<div class="row_bet">
 						<el-upload accept="json" :show-file-list="false" :limit="1" :data="{ productKey: detail.key }" :headers="headers" :action="uploadUrl" :on-success="updateImg">
+							<!-- 导入物模型 -->
 							<el-button size="small">
 								<el-icon> <ele-Upload /> </el-icon>
-								导入物模型
+								{{ $t('message.device.producDetail.importModel') }}
 							</el-button>
 						</el-upload>
+						<!-- 导出物模型 -->
 						<el-button size="small" type="default" class="ml10" @click="onRowExport()">
 							<el-icon>
 								<ele-Download />
 							</el-icon>
-							导出物模型
+							{{ $t('message.device.producDetail.exportModel') }}
 						</el-button>
 					</div>
 				</div>
 				<pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="getList()" />
 			</el-tab-pane>
-			<el-tab-pane label="设备接入" name="3">
+			<!-- 设备接入 -->
+			<el-tab-pane :label="$t('message.device.producDetail.deviceAccess')" name="3">
 				<deviceIn></deviceIn>
 			</el-tab-pane>
-			<el-tab-pane label="数据解析" name="4" lazy>
+			<!-- 数据解析 -->
+			<el-tab-pane :label="$t('message.device.producDetail.dataParsing')" name="4" lazy>
 				<dataParse v-if="activeName === '4'" :script="detail.scriptInfo" @updateScript="updateScript">
 				</dataParse>
 			</el-tab-pane>
@@ -188,13 +247,13 @@
 		<EditTab ref="editTabRef" @typeList="gettab" />
 	</div>
 </template>
-<script lang="ts">
-import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
+<script lang="ts" setup>
+import { toRefs, reactive, onMounted, ref, defineComponent, computed } from 'vue';
 import { Edit } from '@element-plus/icons-vue';
 import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
 import downloadFile from '/@/utils/download';
 import getOrigin from '/@/utils/origin';
-
+import { useI18n } from 'vue-i18n';
 
 import EditDic from './component/editPro.vue';
 import deviceIn from './component/deviceIn.vue';
@@ -208,32 +267,36 @@ import { useRoute } from 'vue-router';
 
 import api from '/@/api/device';
 
-interface TableDataState {
-	isShowDialog: boolean;
-	detail: any;
-	developer_status: number;
-	activeName: string;
-	activetab: string;
-	tableData: {
-		data: [];
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			name: string;
-			productKey: string | string[];
-			deviceType: string;
-			status: string;
-			dateRange: string[];
-		} | any;
-	};
-}
-export default defineComponent({
-	name: 'deviceEditPro',
-	components: { EditDic, EditAttr, EditFun, EditEvent, EditTab, deviceIn, dataParse },
-
-	setup(prop, context) {
+const { locale } = useI18n();
+
+const currentLang = computed(() => locale.value);
+
+// interface TableDataState {
+// 	isShowDialog: boolean;
+// 	detail: any;
+// 	developer_status: number;
+// 	activeName: string;
+// 	activetab: string;
+// 	tableData: {
+// 		data: [];
+// 		total: number;
+// 		loading: boolean;
+// 		param: {
+// 			pageNum: number;
+// 			pageSize: number;
+// 			name: string;
+// 			productKey: string | string[];
+// 			deviceType: string;
+// 			status: string;
+// 			dateRange: string[];
+// 		} | any;
+// 	};
+// }
+// export default defineComponent({
+// 	name: 'deviceEditPro',
+// 	components: { EditDic, EditAttr, EditFun, EditEvent, EditTab, deviceIn, dataParse },
+
+// 	setup(prop, context) {
 
 		const uploadUrl: string = getOrigin("/product/tsl/import");
 		const headers = {
@@ -245,40 +308,54 @@ export default defineComponent({
 		const editFunRef = ref();
 		const editEventRef = ref();
 		const editTabRef = ref();
-		const state = reactive<TableDataState>({
-			isShowDialog: false,
-			activeName: '1', // 分类数据
-			activetab: 'attr', // 分类数据
-			detail: {},
-			developer_status: 0,
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					productKey: route.params?.id,
-					pageSize: 20,
-					status: '',
-					dateRange: [],
-				},
+		const activeName = ref('1');// 分类数据
+		const activetab = ref('attr');// 分类数据
+		const detail = ref<any>({});
+		const developer_status = ref(0);
+		const tableData = ref({
+			data: [],
+			total: 0,
+			loading: false,
+			param: {
+				pageNum: 1,
+				productKey: route.params?.id,
+				pageSize: 20,
+				status: '',
+				dateRange: [],
 			},
 		});
+		// const state = reactive<TableDataState>({
+		// 	activeName: '1', // 分类数据
+		// 	activetab: 'attr', // 分类数据
+		// 	detail: {},
+		// 	developer_status: 0,
+		// 	tableData: {
+		// 		data: [],
+		// 		total: 0,
+		// 		loading: false,
+		// 		param: {
+		// 			pageNum: 1,
+		// 			productKey: route.params?.id,
+		// 			pageSize: 20,
+		// 			status: '',
+		// 			dateRange: [],
+		// 		},
+		// 	},
+		// });
 
 		onMounted(() => {
 			productDetail()
 			//第一次加载
-			api.model.property(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.Data;
-				state.tableData.total = res.Total;
+			api.model.property(tableData.value.param).then((res: any) => {
+				tableData.value.data = res.Data;
+				tableData.value.total = res.Total;
 			});
 		});
-
 		function productDetail() {
 			const productKey = route.params?.id;
 			api.product.detail(productKey).then((res: any) => {
-				state.detail = res.data;
-				state.developer_status = res.data.status
+				detail.value = res.data;
+				developer_status.value = res.data.status
 			});
 		}
 
@@ -375,7 +452,7 @@ export default defineComponent({
 
 		//根据不同类型获取列表
 		const getList = () => {
-			switch (state.activetab) {
+			switch (activetab.value) {
 				case 'attr':
 					getproperty();
 					break;
@@ -392,34 +469,34 @@ export default defineComponent({
 		};
 
 		const getproperty = () => {
-			api.model.property(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.Data;
-				state.tableData.total = res.Total;
+			api.model.property(tableData.value.param).then((res: any) => {
+				tableData.value.data = res.Data;
+				tableData.value.total = res.Total;
 			});
 		};
 
 		const getfunction = () => {
-			api.model.function(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.Data;
-				state.tableData.total = res.Total;
+			api.model.function(tableData.value.param).then((res: any) => {
+				tableData.value.data = res.Data;
+				tableData.value.total = res.Total;
 			});
 		};
 		const getevent = () => {
-			api.model.event(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.Data;
-				state.tableData.total = res.Total;
+			api.model.event(tableData.value.param).then((res: any) => {
+				tableData.value.data = res.Data;
+				tableData.value.total = res.Total;
 			});
 		};
 
 		const gettab = () => {
-			api.model.tag(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.Data;
-				state.tableData.total = res.Total;
+			api.model.tag(tableData.value.param).then((res: any) => {
+				tableData.value.data = res.Data;
+				tableData.value.total = res.Total;
 			});
 		};
 
 		const wuhandleClick = (tab: any) => {
-			state.activetab = tab.props.name;
+			activetab.value = tab.props.name;
 			switch (tab.props.name) {
 				case 'attr':
 					getproperty();
@@ -440,27 +517,27 @@ export default defineComponent({
 		};
 
 		const updateScript = (scriptInfo: string) => {
-			state.detail.scriptInfo = scriptInfo
+			detail.value.scriptInfo = scriptInfo
 		};
 
-		const CkOption = (developer_status: number) => {
-			if (developer_status == 0) {
+		const CkOption = (developerStatus: number) => {
+			if (developerStatus == 0) {
 				api.product.undeploy(route.params.id).then((res: any) => {
 					ElMessage.success('操作成功');
-					state.developer_status = 0;
-				}).catch(() => state.developer_status = 1)
+					developer_status.value = 0;
+				}).catch(() => developer_status.value = 1)
 			} else {
 				api.product.deploy(route.params.id).then((res: any) => {
 					ElMessage.success('操作成功');
-					state.developer_status = 1;
-				}).catch(() => state.developer_status = 0)
+					developer_status.value = 1;
+				}).catch(() => developer_status.value = 0)
 			}
 		}
 
 		// 导出
 		const onRowExport = () => {
 
-			api.product.export({ productKey: state.detail.key }).then((res: any) => downloadFile(res, "TSL-" + state.detail.key + "-" + getCurrentTime() + ".json"))
+			api.product.export({ productKey: detail.value.key }).then((res: any) => downloadFile(res, "TSL-" + detail.value.key + "-" + getCurrentTime() + ".json"))
 		};
 
 
@@ -482,42 +559,42 @@ export default defineComponent({
 			}
 		};
 
-		return {
-			updateImg,
-			headers,
-			uploadUrl,
-			getCurrentTime,
-			onRowExport,
-			Edit,
-			updateScript,
-			editDicRef,
-			editAttrRef,
-			editFunRef,
-			editEventRef,
-			editTabRef,
-			CkOption,
-			onRowDel,
-			onEditFun,
-			onEditEvent,
-			onEditTag,
-			onEditAttr,
-			getList,
-			getproperty,
-			getfunction,
-			getevent,
-			gettab,
-			wuhandleClick,
-			onOpenEditTab,
-			onOpenEditEvent,
-			productDetail,
-			onOpenEditAttr,
-			onOpenEditFun,
-			onOpenEditDic,
-			handleClick,
-			...toRefs(state),
-		};
-	},
-});
+// 		return {
+// 			updateImg,
+// 			headers,
+// 			uploadUrl,
+// 			getCurrentTime,
+// 			onRowExport,
+// 			Edit,
+// 			updateScript,
+// 			editDicRef,
+// 			editAttrRef,
+// 			editFunRef,
+// 			editEventRef,
+// 			editTabRef,
+// 			CkOption,
+// 			onRowDel,
+// 			onEditFun,
+// 			onEditEvent,
+// 			onEditTag,
+// 			onEditAttr,
+// 			getList,
+// 			getproperty,
+// 			getfunction,
+// 			getevent,
+// 			gettab,
+// 			wuhandleClick,
+// 			onOpenEditTab,
+// 			onOpenEditEvent,
+// 			productDetail,
+// 			onOpenEditAttr,
+// 			onOpenEditFun,
+// 			onOpenEditDic,
+// 			handleClick,
+// 			...toRefs(state),
+// 		};
+// 	},
+// });
 </script>
 <style scoped>
 .import {