diff --git a/src/locales/en.ts b/src/locales/en.ts index 694c713e..ef63ea5d 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -295,6 +295,7 @@ export default { delete: 'Delete', edit: 'Edit', update: 'Update', + copy: 'Copy', preview: 'Preview', more: 'More', sync: 'Sync', @@ -3055,5 +3056,347 @@ export default { exportFilename: 'FormingRecord.xls' } + }, + DataCollection: { + DeviceAttributeType: { + moduleName: 'Acquisition Point Type', + index: 'Index', + code: 'Type Code', + name: 'Type Name', + sort: 'Display Order', + remark: 'Remark', + createTime: 'Create Time', + operate: 'Operate', + + search: 'Search', + reset: 'Reset', + create: 'Create', + batchDelete: 'Batch Delete', + export: 'Export', + + placeholderCode: 'Please enter type code', + placeholderName: 'Please enter type name', + placeholderSort: 'Please enter display order', + placeholderRemark: 'Please enter remark', + + dialogOk: 'Confirm', + dialogCancel: 'Cancel', + + validatorCodeRequired: 'Type code can not be empty', + validatorNameRequired: 'Type name can not be empty', + validatorSortRequired: 'Display order can not be empty', + + exportFilename: 'AcquisitionPointType.xls' + }, + DeviceModel: { + moduleName: 'Acquisition Device Model', + index: 'Index', + code: 'Model Code', + name: 'Model Name', + protocol: 'Protocol', + remark: 'Remark', + createTime: 'Create Time', + operate: 'Operate', + + search: 'Search', + reset: 'Reset', + create: 'Create', + batchDelete: 'Batch Delete', + export: 'Export', + + placeholderCode: 'Please enter model code', + placeholderName: 'Please enter model name', + placeholderProtocol: 'Please select protocol', + placeholderRemark: 'Please enter remark', + + dialogOk: 'Confirm', + dialogCancel: 'Cancel', + + validatorCodeRequired: 'Model code can not be empty', + validatorNameRequired: 'Model name can not be empty', + validatorProtocolRequired: 'Protocol can not be empty', + + exportFilename: 'AcquisitionDeviceModel.xls', + + attributeModuleName: 'Point Management', + attributeCode: 'Point Code', + attributeName: 'Point Name', + attributeType: 'Point Type', + dataType: 'Data Type', + address: 'Register Address', + dataUnit: 'Unit', + ratio: 'Ratio', + + placeholderAttributeCode: 'Please enter point code', + placeholderAttributeName: 'Please enter point name', + placeholderAttributeType: 'Please select point type', + placeholderDataType: 'Please select data type', + placeholderAddress: 'Please enter register address', + placeholderDataUnit: 'Please select unit', + placeholderRatio: 'Please enter ratio', + placeholderAttributeRemark: 'Please enter remark', + + validatorAttributeCodeRequired: 'Point code can not be empty', + validatorAttributeNameRequired: 'Point name can not be empty', + + attributeExportFilename: 'AcquisitionDeviceModelPoint.xls', + + ruleTabLabel: 'Point Rule', + ruleIdentifier: 'Identifier', + ruleFieldName: 'Name', + ruleFieldRule: 'Rule', + ruleDefaultValue: 'Default Value', + ruleCreateTime: 'Create Time', + ruleOperate: 'Operate', + + ruleSearchIdentifierPlaceholder: 'Please enter identifier', + ruleSearchFieldNamePlaceholder: 'Please enter name', + ruleSearchDefaultValuePlaceholder: 'Please enter default value', + + ruleSearch: 'Search', + ruleReset: 'Reset', + + ruleCreateButton: 'Add Alarm Rule', + ruleEditRuleButton: 'Edit', + ruleDeleteRuleButton: 'Delete', + + ruleDialogTitle: 'Edit Point Rule', + ruleDialogIdentifier: 'Identifier', + ruleDialogFieldName: 'Name', + ruleDialogDefaultValue: 'Default Value', + ruleDialogAlarmLevel: 'Alarm Level', + ruleDialogFieldRule: 'Point Rule', + ruleDialogRule: 'Rule', + ruleDialogRuleAttribute: 'Point', + ruleDialogRuleOperator: 'Condition', + ruleDialogRuleValue: 'Value', + + ruleDialogAlarmLevelPlaceholder: 'Please select alarm level', + ruleDialogFieldRulePlaceholder: 'Please select point rule', + ruleDialogRuleAttributePlaceholder: 'Please select point', + ruleDialogRuleOperatorPlaceholder: 'Please select condition', + ruleDialogRuleValuePlaceholder: 'Please enter value' + }, + Device: { + moduleName: 'Acquisition Device', + index: 'Index', + + deviceCode: 'Device Code', + deviceName: 'Device Name', + operatingStatus: 'Operating Status', + protocol: 'Protocol', + status: 'Connection Status', + sampleCycle: 'Sample Cycle(s)', + isEnable: 'Enabled', + collectionTime: 'Collection Time', + operate: 'Operation', + + search: 'Search', + reset: 'Reset', + create: 'Create', + batchDelete: 'Batch Delete', + export: 'Export', + + placeholderDeviceCode: 'Please enter device code', + placeholderDeviceName: 'Please enter device name', + placeholderModel: 'Please select device model', + placeholderSampleCycle: 'Please enter sample cycle', + placeholderUrl: 'Please enter endpoint URL', + placeholderUsername: 'Please enter username', + placeholderPassword: 'Please enter password', + + model: 'Device Model', + url: 'Endpoint URL', + username: 'Username', + password: 'Password', + + settingDialogTitle: 'Device Settings', + + connect: 'Connect', + disconnect: 'Disconnect', + + attributeModuleName: 'Point', + attributeCode: 'Point Code', + attributeName: 'Point Name', + attributeType: 'Point Type', + dataType: 'Data Type', + address: 'Register Address', + dataUnit: 'Unit', + ratio: 'Ratio', + remark: 'Remark', + deviceAttributeTabLabel: 'Device Attributes', + deviceRuleTabLabel: 'Point Rules', + + currentDeviceLabel: 'Current Device: ', + + alarmHistoryTitle: 'Device Alarm History Data', + alarmRuleName: 'Rule Name', + alarmPointName: 'Point Name', + alarmPointValue: 'Point Value', + alarmLevel: 'Alarm Level', + + emptyDescription: 'Click "Point" in the device list to view points and rules', + + exportFilename: 'IoTDevice.xls', + attributeExportFilename: 'AcquisitionDevice-Point.xls', + + attributeLatestValue: 'Latest Value', + attributeLatestCollectionTime: 'Latest Collection Time', + attributeSort: 'Order', + attributePlaceholderSort: 'Please enter order', + + placeholderAttributeCode: 'Please enter point code', + placeholderAttributeName: 'Please enter point name', + placeholderAttributeType: 'Please select point type', + placeholderDataType: 'Please select data type', + placeholderAddress: 'Please enter register address', + placeholderDataUnit: 'Please enter unit', + placeholderRatio: 'Please enter ratio', + placeholderRemark: 'Please enter remark', + + validatorDeviceCodeRequired: 'Device code can not be empty', + validatorDeviceNameRequired: 'Device name can not be empty', + validatorSampleCycleRequired: 'Sample cycle can not be empty', + validatorIsEnableRequired: 'Enable status can not be empty', + validatorUrlRequired: 'Endpoint URL can not be empty', + + attributeValidatorCodeRequired: 'Point code can not be empty', + attributeValidatorNameRequired: 'Point name can not be empty', + attributeValidatorCodeNoChinese: 'Point code can not contain Chinese characters', + attributeValidatorSortNumber: 'Order must contain only numbers', + attributeValidatorRemarkTooLong: 'Remark can not exceed 100 characters', + + messageSelectDeviceRequired: 'Please select a device', + messageDeviceInfoMissingForRules: 'Device information is missing, unable to load point rules' + }, + RunReport: { + moduleName: 'Device Operation Report', + + searchDeviceCodeLabel: 'Device Code', + searchDeviceCodePlaceholder: 'Please enter device code', + searchDeviceNameLabel: 'Device Name', + searchDeviceNamePlaceholder: 'Please enter device name', + searchTimeRangeLabel: 'Device Running Time', + searchTimeRangeStartPlaceholder: 'Start Time', + searchTimeRangeEndPlaceholder: 'End Time', + + searchButtonText: 'Search', + resetButtonText: 'Reset', + exportButtonText: 'Export', + + tableDeviceCodeColumn: 'Device Code', + tableDeviceNameColumn: 'Device Name', + tableRunningTimeColumn: 'Running Time (Hours)', + tableStandbyTimeColumn: 'Standby Time (Hours)', + tableFaultTimeColumn: 'Fault Time (Hours)', + tableWarningTimeColumn: 'Warning Time (Hours)', + tableUtilizationRateColumn: 'Utilization Rate', + tableStartTimeColumn: 'Device Run Start Time', + tableEndTimeColumn: 'Device Run End Time', + + exportFilename: 'DeviceOperationReport.xls' + }, + RealTimeMonitoring: { + moduleName: 'Real-time Data Monitoring', + + searchLineCodeLabel: 'Line Code', + searchLineCodePlaceholder: 'Please enter line code', + searchLineNameLabel: 'Line Name', + searchLineNamePlaceholder: 'Please enter line name', + searchDeviceCodeLabel: 'Device Code', + searchDeviceCodePlaceholder: 'Please enter device code', + searchDeviceNameLabel: 'Device Name', + searchDeviceNamePlaceholder: 'Please enter device name', + + searchButtonText: 'Search', + resetButtonText: 'Reset', + exportButtonText: 'Export', + + tableLineCodeColumn: 'Line Code', + tableLineNameColumn: 'Line Name', + tableDeviceCodeColumn: 'Device Code', + tableDeviceNameColumn: 'Device Name', + tableStatusColumn: 'Connection Status', + tableCollectionTimeColumn: 'Latest Collection Time', + tableOperateColumn: 'Operation', + tableActionSingleMonitorLabel: 'Single Device Monitoring', + + dialogTitle: 'Single Device Monitoring', + dialogDeviceNameLabel: 'Device Name: ', + dialogCollectionTimeLabel: 'Collection Time: ', + + emptyDescription: 'No data', + defaultGroupName: 'Default', + defaultFieldLabelPrefix: 'Field ', + + messageDeviceInfoIncomplete: 'Device information is incomplete', + + exportFilename: 'RealTimeMonitoringDevice.xls' + }, + HistoryData: { + moduleName: 'History Record Query', + + searchLineCodeLabel: 'Line Code', + searchLineCodePlaceholder: 'Please enter line code', + searchLineNameLabel: 'Line Name', + searchLineNamePlaceholder: 'Please enter line name', + searchDeviceCodeLabel: 'Device Code', + searchDeviceCodePlaceholder: 'Please enter device code', + searchDeviceNameLabel: 'Device Name', + searchDeviceNamePlaceholder: 'Please enter device name', + + searchButtonText: 'Search', + resetButtonText: 'Reset', + exportButtonText: 'Export', + + tableLineCodeColumn: 'Line Code', + tableLineNameColumn: 'Line Name', + tableDeviceCodeColumn: 'Device Code', + tableDeviceNameColumn: 'Device Name', + tableCollectionTimeColumn: 'Collection Time', + tableOperateColumn: 'Operation', + tableActionHistoryLabel: 'History', + + dialogTitlePrefix: 'History: ', + dialogCollectionTimeLabel: 'Collection Time', + dialogCollectionTimeStartPlaceholder: 'Start Time', + dialogCollectionTimeEndPlaceholder: 'End Time', + dialogSearchButtonText: 'Search', + dialogResetButtonText: 'Reset', + dialogRecordCollectionTimePrefix: 'Collection Time: ', + + emptyDescription: 'No data', + defaultFieldLabelPrefix: 'Field ', + + exportFilename: 'HistoryDataDevice.xls' + }, + DeviceParamAnalysis: { + moduleName: 'Device Operation Parameter Analysis', + + treeSearchPlaceholder: 'Search device or parameter', + + formTimeLabel: 'Time', + formTimeStartPlaceholder: 'Start Date', + formTimeEndPlaceholder: 'End Date', + + shortcutLast7Days: 'Last 7 Days', + shortcutLastWeek: 'Last Week', + shortcutLastMonth: 'Last Month', + shortcutLast3Months: 'Last 3 Months', + + searchButtonText: 'Search', + resetButtonText: 'Reset', + + emptyDescription: 'No data', + emptySelectNodeDescription: 'Please select a node on the left', + + selectedParamTitle: 'Node: {label}{unit}', + defaultSeriesName: 'Parameter', + + messageLoadTreeFailed: 'Failed to load tree data', + messageNodeNoParams: 'No parameters under this node', + messageDeviceNoParams: 'No parameters under this device', + messageFetchChartFailed: 'Failed to load chart data' + } } } diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 1dfd18f5..7d920434 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -298,6 +298,7 @@ export default { delete: '删除', edit: '编辑', update: '编辑', + copy: '复制', preview: '预览', more: '更多', sync: '同步', @@ -3044,5 +3045,347 @@ export default { exportFilename: '成型记录.xls' } + }, + DataCollection: { + DeviceAttributeType: { + moduleName: '采集点类型', + index: '序号', + code: '类型编码', + name: '类型名称', + sort: '显示顺序', + remark: '备注', + createTime: '创建时间', + operate: '操作', + + search: '搜索', + reset: '重置', + create: '新增', + batchDelete: '批量删除', + export: '导出', + + placeholderCode: '请输入类型编码', + placeholderName: '请输入类型名称', + placeholderSort: '请输入显示顺序', + placeholderRemark: '请输入备注', + + dialogOk: '确 定', + dialogCancel: '取 消', + + validatorCodeRequired: '类型编码不能为空', + validatorNameRequired: '类型名称不能为空', + validatorSortRequired: '显示顺序不能为空', + + exportFilename: '采集点类型.xls' + }, + DeviceModel: { + moduleName: '采集设备模型', + index: '序号', + code: '模型编码', + name: '模型名称', + protocol: '通讯协议', + remark: '备注', + createTime: '创建时间', + operate: '操作', + + search: '搜索', + reset: '重置', + create: '新增', + batchDelete: '批量删除', + export: '导出', + + placeholderCode: '请输入模型编码', + placeholderName: '请输入模型名称', + placeholderProtocol: '请选择通讯协议', + placeholderRemark: '请输入备注', + + dialogOk: '确 定', + dialogCancel: '取 消', + + validatorCodeRequired: '模型编码不能为空', + validatorNameRequired: '模型名称不能为空', + validatorProtocolRequired: '通讯协议不能为空', + + exportFilename: '采集设备模型.xls', + + attributeModuleName: '采集点管理', + attributeCode: '点位编码', + attributeName: '点位名称', + attributeType: '点位类型', + dataType: '数据类型', + address: '寄存器地址', + dataUnit: '单位', + ratio: '倍率', + + placeholderAttributeCode: '请输入点位编码', + placeholderAttributeName: '请输入点位名称', + placeholderAttributeType: '请选择点位类型', + placeholderDataType: '请选择数据类型', + placeholderAddress: '请输入寄存器地址', + placeholderDataUnit: '请选择单位', + placeholderRatio: '请输入倍率', + placeholderAttributeRemark: '请输入备注', + + validatorAttributeCodeRequired: '点位编码不能为空', + validatorAttributeNameRequired: '点位名称不能为空', + + attributeExportFilename: '采集设备模型-点位管理.xls', + + ruleTabLabel: '点位规则', + ruleIdentifier: '标识符', + ruleFieldName: '名称', + ruleFieldRule: '规则', + ruleDefaultValue: '默认值', + ruleCreateTime: '创建时间', + ruleOperate: '操作', + + ruleSearchIdentifierPlaceholder: '请输入标识符', + ruleSearchFieldNamePlaceholder: '请输入名称', + ruleSearchDefaultValuePlaceholder: '请输入默认值', + + ruleSearch: '搜索', + ruleReset: '重置', + + ruleCreateButton: '新增告警规则', + ruleEditRuleButton: '编辑', + ruleDeleteRuleButton: '删除', + + ruleDialogTitle: '编辑点位规则', + ruleDialogIdentifier: '标识符', + ruleDialogFieldName: '名称', + ruleDialogDefaultValue: '默认值', + ruleDialogAlarmLevel: '告警登记', + ruleDialogFieldRule: '点位规则', + ruleDialogRule: '规则', + ruleDialogRuleAttribute: '点位', + ruleDialogRuleOperator: '条件', + ruleDialogRuleValue: '数值', + + ruleDialogAlarmLevelPlaceholder: '请选择告警登记', + ruleDialogFieldRulePlaceholder: '请选择点位规则', + ruleDialogRuleAttributePlaceholder: '请选择点位', + ruleDialogRuleOperatorPlaceholder: '请选择条件', + ruleDialogRuleValuePlaceholder: '请输入数值' + }, + Device: { + moduleName: '采集设备', + index: '序号', + + deviceCode: '设备编号', + deviceName: '设备名称', + operatingStatus: '运行状态', + protocol: '采集协议', + status: '连接状态', + sampleCycle: '采集周期(s)', + isEnable: '是否启用', + collectionTime: '采集时间', + operate: '操作', + + search: '搜索', + reset: '重置', + create: '新增', + batchDelete: '批量删除', + export: '导出', + + placeholderDeviceCode: '请输入设备编号', + placeholderDeviceName: '请输入设备名称', + placeholderModel: '请选择设备模型', + placeholderSampleCycle: '请输入采集周期', + placeholderUrl: '请输入端点URL', + placeholderUsername: '请输入用户名', + placeholderPassword: '请输入密码', + + model: '设备模型', + url: '端点URL', + username: '用户名', + password: '密码', + + settingDialogTitle: '设备设置', + + connect: '连接', + disconnect: '断开连接', + + attributeModuleName: '点位', + attributeCode: '点位编码', + attributeName: '点位名称', + attributeType: '点位类型', + dataType: '数据类型', + address: '寄存器地址', + dataUnit: '单位', + ratio: '倍率', + remark: '备注', + deviceAttributeTabLabel: '设备属性', + deviceRuleTabLabel: '点位规则', + + currentDeviceLabel: '当前设备:', + + alarmHistoryTitle: '设备告警历史数据', + alarmRuleName: '规则名称', + alarmPointName: '点位名称', + alarmPointValue: '点位值', + alarmLevel: '告警等级', + + emptyDescription: '请点击设备列表的“点位”查看采集点和点位规则', + + exportFilename: '物联设备.xls', + attributeExportFilename: '采集设备-点位管理.xls', + + attributeLatestValue: '最新值', + attributeLatestCollectionTime: '最新采集时间', + attributeSort: '顺序', + attributePlaceholderSort: '请输入顺序', + + placeholderAttributeCode: '请输入点位编码', + placeholderAttributeName: '请输入点位名称', + placeholderAttributeType: '请选择点位类型', + placeholderDataType: '请选择数据类型', + placeholderAddress: '请输入寄存器地址', + placeholderDataUnit: '请输入单位', + placeholderRatio: '请输入倍率', + placeholderRemark: '请输入备注', + + validatorDeviceCodeRequired: '设备编号不能为空', + validatorDeviceNameRequired: '设备名称不能为空', + validatorSampleCycleRequired: '采集周期不能为空', + validatorIsEnableRequired: '是否启用不能为空', + validatorUrlRequired: '端点URL不能为空', + + attributeValidatorCodeRequired: '点位编码不能为空', + attributeValidatorNameRequired: '点位名称不能为空', + attributeValidatorCodeNoChinese: '点位编码不允许输入中文', + attributeValidatorSortNumber: '顺序只能输入数字', + attributeValidatorRemarkTooLong: '备注不能超过100字', + + messageSelectDeviceRequired: '请选择一个物联设备', + messageDeviceInfoMissingForRules: '设备信息缺失,无法加载点位规则' + }, + RunReport: { + moduleName: '设备运行报表', + + searchDeviceCodeLabel: '设备编码', + searchDeviceCodePlaceholder: '请输入设备编码', + searchDeviceNameLabel: '设备名称', + searchDeviceNamePlaceholder: '请输入设备名称', + searchTimeRangeLabel: '设备运行时间', + searchTimeRangeStartPlaceholder: '开始时间', + searchTimeRangeEndPlaceholder: '结束时间', + + searchButtonText: '搜索', + resetButtonText: '重置', + exportButtonText: '导出', + + tableDeviceCodeColumn: '设备编码', + tableDeviceNameColumn: '设备名称', + tableRunningTimeColumn: '运行时间(小时)', + tableStandbyTimeColumn: '待机时间(小时)', + tableFaultTimeColumn: '故障时间(小时)', + tableWarningTimeColumn: '警告时间(小时)', + tableUtilizationRateColumn: '稼动率', + tableStartTimeColumn: '设备运行开始时间', + tableEndTimeColumn: '设备运行结束时间', + + exportFilename: '设备运行报表.xls' + }, + RealTimeMonitoring: { + moduleName: '数据实时监控', + + searchLineCodeLabel: '产线编码', + searchLineCodePlaceholder: '请输入产线编码', + searchLineNameLabel: '产线名称', + searchLineNamePlaceholder: '请输入产线名称', + searchDeviceCodeLabel: '设备编码', + searchDeviceCodePlaceholder: '请输入设备编码', + searchDeviceNameLabel: '设备名称', + searchDeviceNamePlaceholder: '请输入设备名称', + + searchButtonText: '搜索', + resetButtonText: '重置', + exportButtonText: '导出', + + tableLineCodeColumn: '产线编码', + tableLineNameColumn: '产线名称', + tableDeviceCodeColumn: '设备编码', + tableDeviceNameColumn: '设备名称', + tableStatusColumn: '连接状态', + tableCollectionTimeColumn: '最新采集时间', + tableOperateColumn: '操作', + tableActionSingleMonitorLabel: '单设备监控', + + dialogTitle: '单设备监控', + dialogDeviceNameLabel: '设备名称:', + dialogCollectionTimeLabel: '采集时间:', + + emptyDescription: '暂无数据', + defaultGroupName: '默认', + defaultFieldLabelPrefix: '字段', + + messageDeviceInfoIncomplete: '设备信息不完整', + + exportFilename: '实时监控设备.xls' + }, + HistoryData: { + moduleName: '历史记录查询', + + searchLineCodeLabel: '产线编码', + searchLineCodePlaceholder: '请输入产线编码', + searchLineNameLabel: '产线名称', + searchLineNamePlaceholder: '请输入产线名称', + searchDeviceCodeLabel: '设备编码', + searchDeviceCodePlaceholder: '请输入设备编码', + searchDeviceNameLabel: '设备名称', + searchDeviceNamePlaceholder: '请输入设备名称', + + searchButtonText: '搜索', + resetButtonText: '重置', + exportButtonText: '导出', + + tableLineCodeColumn: '产线编码', + tableLineNameColumn: '产线名称', + tableDeviceCodeColumn: '设备编码', + tableDeviceNameColumn: '设备名称', + tableCollectionTimeColumn: '采集时间', + tableOperateColumn: '操作', + tableActionHistoryLabel: '历史记录', + + dialogTitlePrefix: '历史记录:', + dialogCollectionTimeLabel: '采集时间', + dialogCollectionTimeStartPlaceholder: '开始时间', + dialogCollectionTimeEndPlaceholder: '结束时间', + dialogSearchButtonText: '查询', + dialogResetButtonText: '重置', + dialogRecordCollectionTimePrefix: '采集时间:', + + emptyDescription: '暂无数据', + defaultFieldLabelPrefix: '字段', + + exportFilename: '历史数据设备.xls' + }, + DeviceParamAnalysis: { + moduleName: '设备运行参数分析', + + treeSearchPlaceholder: '搜索设备或参数', + + formTimeLabel: '时间', + formTimeStartPlaceholder: '开始日期', + formTimeEndPlaceholder: '结束日期', + + shortcutLast7Days: '最近 7 天', + shortcutLastWeek: '上周', + shortcutLastMonth: '上个月', + shortcutLast3Months: '三个月内', + + searchButtonText: '搜索', + resetButtonText: '重置', + + emptyDescription: '暂无数据', + emptySelectNodeDescription: '请选择左侧节点', + + selectedParamTitle: '节点:{label}{unit}', + defaultSeriesName: '参数', + + messageLoadTreeFailed: '获取树数据失败', + messageNodeNoParams: '该节点下暂无参数', + messageDeviceNoParams: '该设备下没有参数', + messageFetchChartFailed: '获取图表数据失败' + } } } diff --git a/src/views/iot/device/DeviceForm.vue b/src/views/iot/device/DeviceForm.vue index c61a80f3..cff7b8b7 100644 --- a/src/views/iot/device/DeviceForm.vue +++ b/src/views/iot/device/DeviceForm.vue @@ -7,7 +7,7 @@ v-if="formType === 'setting' && formData.deviceName" class="text-12px leading-16px text-[var(--el-text-color-secondary)]" > - 设备名称:{{ formData.deviceName }} + {{ t('DataCollection.Device.deviceName') + t('common.colon') + formData.deviceName }} @@ -15,15 +15,21 @@ ref="formRef" :model="formData" :rules="activeRules" - label-width="100px" + label-width="120px" v-loading="formLoading" > @@ -151,7 +173,7 @@ const handleAttributeTypeChange = (val: number | string) => { const formRules = reactive({ attributeCode: [ - { required: true, message: '点位编码不能为空', trigger: 'blur' }, + { required: true, message: t('DataCollection.Device.attributeValidatorCodeRequired'), trigger: 'blur' }, { validator: (_rule: any, value: string, callback: any) => { if (!value) { @@ -159,7 +181,7 @@ const formRules = reactive({ return } if (/[\u4e00-\u9fa5]/.test(value)) { - callback(new Error('点位编码不允许输入中文')) + callback(new Error(t('DataCollection.Device.attributeValidatorCodeNoChinese'))) return } callback() @@ -167,7 +189,7 @@ const formRules = reactive({ trigger: ['blur', 'change'] } ], - attributeName: [{ required: true, message: '点位名称不能为空', trigger: 'blur' }], + attributeName: [{ required: true, message: t('DataCollection.Device.attributeValidatorNameRequired'), trigger: 'blur' }], sort: [ { validator: (_rule: any, value: string, callback: any) => { @@ -176,7 +198,7 @@ const formRules = reactive({ return } if (!/^\d+$/.test(value)) { - callback(new Error('顺序只能输入数字')) + callback(new Error(t('DataCollection.Device.attributeValidatorSortNumber'))) return } callback() @@ -188,7 +210,7 @@ const formRules = reactive({ { validator: (_rule: any, value: string, callback: any) => { if (value && value.length > 100) { - callback(new Error('备注不能超过100字')) + callback(new Error(t('DataCollection.Device.attributeValidatorRemarkTooLong'))) return } callback() diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue index ae89e5ed..c18c6e19 100644 --- a/src/views/iot/device/components/DeviceAttributeList.vue +++ b/src/views/iot/device/components/DeviceAttributeList.vue @@ -1,38 +1,72 @@