refactor(manager-web): 将备注重命名为 设备别名
- 更新所有语言包中的相关文案 - 同步更新组件及变量命名
This commit is contained in:
1 parent
e1876f1ce1
commit
af9abdd771
7 files changed
+44
-44
No files matched your search
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': 'Firmware-Version',
|
||||
'device.bindTime': 'Bindungszeit',
|
||||
'device.lastConversation': 'Letzte Konversation',
|
||||
'device.remark': 'Bemerkung',
|
||||
'device.alias': 'Gerätealias',
|
||||
'device.autoUpdate': 'Automatische Aktualisierung',
|
||||
'device.operation': 'Operation',
|
||||
'device.search': 'Suchen',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': 'Sind Sie sicher, dass Sie {count} ausgewählte Geräte entbinden möchten?',
|
||||
'device.batchUnbindSuccess': 'Erfolgreich {count} Geräte entbunden',
|
||||
'device.batchUnbindError': 'Fehler beim Massen-Entbinden aufgetreten',
|
||||
'device.remarkTooLong': 'Bemerkung darf 64 Zeichen nicht überschreiten',
|
||||
'device.remarkSaved': 'Bemerkung erfolgreich gespeichert',
|
||||
'device.remarkSaveFailed': 'Speichern der Bemerkung fehlgeschlagen',
|
||||
'device.aliasTooLong': 'Gerätealias darf 64 Zeichen nicht überschreiten',
|
||||
'device.aliasSaved': 'Gerätealias erfolgreich gespeichert',
|
||||
'device.aliasSaveFailed': 'Speichern des Gerätealias fehlgeschlagen',
|
||||
'device.confirmUnbind': 'Sind Sie sicher, dass Sie dieses Gerät entbinden möchten?',
|
||||
'device.unbindSuccess': 'Gerät erfolgreich entbunden',
|
||||
'device.unbindFailed': 'Entbinden des Geräts fehlgeschlagen',
|
||||
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': 'Firmware Version',
|
||||
'device.bindTime': 'Binding Time',
|
||||
'device.lastConversation': 'Last Conversation',
|
||||
'device.remark': 'Remark',
|
||||
'device.alias': 'Device Alias',
|
||||
'device.autoUpdate': 'Auto Update',
|
||||
'device.operation': 'Operation',
|
||||
'device.search': 'Search',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': 'Are you sure you want to unbind {count} selected devices?',
|
||||
'device.batchUnbindSuccess': 'Successfully unbound {count} devices',
|
||||
'device.batchUnbindError': 'Error occurred during batch unbinding',
|
||||
'device.remarkTooLong': 'Remark cannot exceed 64 characters',
|
||||
'device.remarkSaved': 'Remark saved successfully',
|
||||
'device.remarkSaveFailed': 'Failed to save remark',
|
||||
'device.aliasTooLong': 'Device alias cannot exceed 64 characters',
|
||||
'device.aliasSaved': 'Device alias saved successfully',
|
||||
'device.aliasSaveFailed': 'Failed to save device alias',
|
||||
'device.confirmUnbind': 'Are you sure you want to unbind this device?',
|
||||
'device.unbindSuccess': 'Device unbound successfully',
|
||||
'device.unbindFailed': 'Failed to unbind device',
|
||||
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': 'Versão do Firmware',
|
||||
'device.bindTime': 'Data de Vinculação',
|
||||
'device.lastConversation': 'Última Conversa',
|
||||
'device.remark': 'Observação',
|
||||
'device.alias': 'Alias do dispositivo',
|
||||
'device.autoUpdate': 'Atualização Automática',
|
||||
'device.operation': 'Operação',
|
||||
'device.search': 'Pesquisar',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': 'Tem certeza de que deseja desvincular {count} dispositivos selecionados?',
|
||||
'device.batchUnbindSuccess': '{count} dispositivos desvinculados com sucesso',
|
||||
'device.batchUnbindError': 'Ocorreu um erro durante a desvinculação em lote',
|
||||
'device.remarkTooLong': 'A observação não pode exceder 64 caracteres',
|
||||
'device.remarkSaved': 'Observação salva com sucesso',
|
||||
'device.remarkSaveFailed': 'Falha ao salvar observação',
|
||||
'device.aliasTooLong': 'O alias do dispositivo não pode exceder 64 caracteres',
|
||||
'device.aliasSaved': 'Alias do dispositivo salvo com sucesso',
|
||||
'device.aliasSaveFailed': 'Falha ao salvar o alias do dispositivo',
|
||||
'device.confirmUnbind': 'Tem certeza de que deseja desvincular este dispositivo?',
|
||||
'device.unbindSuccess': 'Dispositivo desvinculado com sucesso',
|
||||
'device.unbindFailed': 'Falha ao desvincular dispositivo',
|
||||
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': 'Phiên bản firmware',
|
||||
'device.bindTime': 'Thời gian liên kết',
|
||||
'device.lastConversation': 'Cuộc trò chuyện cuối',
|
||||
'device.remark': 'Ghi chú',
|
||||
'device.alias': 'Bí danh thiết bị',
|
||||
'device.autoUpdate': 'Tự động cập nhật',
|
||||
'device.operation': 'Thao tác',
|
||||
'device.search': 'Tìm kiếm',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': 'Bạn có chắc chắn muốn hủy liên kết {count} thiết bị đã chọn?',
|
||||
'device.batchUnbindSuccess': 'Đã hủy liên kết thành công {count} thiết bị',
|
||||
'device.batchUnbindError': 'Đã xảy ra lỗi khi hủy liên kết hàng loạt',
|
||||
'device.remarkTooLong': 'Ghi chú không được vượt quá 64 ký tự',
|
||||
'device.remarkSaved': 'Đã lưu ghi chú thành công',
|
||||
'device.remarkSaveFailed': 'Lưu ghi chú thất bại',
|
||||
'device.aliasTooLong': 'Bí danh thiết bị không được vượt quá 64 ký tự',
|
||||
'device.aliasSaved': 'Đã lưu bí danh thiết bị thành công',
|
||||
'device.aliasSaveFailed': 'Lưu bí danh thiết bị thất bại',
|
||||
'device.confirmUnbind': 'Bạn có chắc chắn muốn hủy liên kết thiết bị này?',
|
||||
'device.unbindSuccess': 'Đã hủy liên kết thiết bị thành công',
|
||||
'device.unbindFailed': 'Hủy liên kết thiết bị thất bại',
|
||||
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': '固件版本',
|
||||
'device.bindTime': '绑定时间',
|
||||
'device.lastConversation': '最后对话',
|
||||
'device.remark': '备注',
|
||||
'device.alias': '设备别名',
|
||||
'device.autoUpdate': '自动升级',
|
||||
'device.operation': '操作',
|
||||
'device.search': '搜索',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': '确认要解绑选中的 {count} 台设备吗?',
|
||||
'device.batchUnbindSuccess': '成功解绑 {count} 台设备',
|
||||
'device.batchUnbindError': '批量解绑过程中出现错误',
|
||||
'device.remarkTooLong': '备注不能超过 64 字符',
|
||||
'device.remarkSaved': '备注已保存',
|
||||
'device.remarkSaveFailed': '备注保存失败',
|
||||
'device.aliasTooLong': '设备别名不能超过 64 字符',
|
||||
'device.aliasSaved': '设备别名已保存',
|
||||
'device.aliasSaveFailed': '设备别名保存失败',
|
||||
'device.confirmUnbind': '确认要解绑该设备吗?',
|
||||
'device.unbindSuccess': '设备解绑成功',
|
||||
'device.unbindFailed': '设备解绑失败',
|
||||
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
'device.firmwareVersion': '固件版本',
|
||||
'device.bindTime': '綁定時間',
|
||||
'device.lastConversation': '最後對話',
|
||||
'device.remark': '備註',
|
||||
'device.alias': '設備別名',
|
||||
'device.autoUpdate': '自動升級',
|
||||
'device.operation': '操作',
|
||||
'device.search': '搜索',
|
||||
@@ -505,9 +505,9 @@ export default {
|
||||
'device.confirmBatchUnbind': '確認要解綁選中的 {count} 台設備嗎?',
|
||||
'device.batchUnbindSuccess': '成功解綁 {count} 台設備',
|
||||
'device.batchUnbindError': '批量解綁過程中出現錯誤',
|
||||
'device.remarkTooLong': '備註不能超過 64 字符',
|
||||
'device.remarkSaved': '備註已保存',
|
||||
'device.remarkSaveFailed': '備註保存失敗',
|
||||
'device.aliasTooLong': '設備別名不能超過 64 字符',
|
||||
'device.aliasSaved': '設備別名已保存',
|
||||
'device.aliasSaveFailed': '設備別名保存失敗',
|
||||
'device.confirmUnbind': '確認要解綁該設備嗎?',
|
||||
'device.unbindSuccess': '設備解綁成功',
|
||||
'device.unbindFailed': '設備解綁失敗',
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
<el-tag v-if="scope.row.deviceStatus === 'online'" type="success">{{ $t('device.online') }}</el-tag>
|
||||
<el-tag v-else type="danger">{{ $t('device.offline') }}</el-tag>
|
||||
</template>
|
||||
<template slot="remark" slot-scope="scope">
|
||||
<el-input v-show="scope.row.isEdit" v-model="scope.row.remark" size="mini" maxlength="64" show-word-limit
|
||||
@blur="onRemarkBlur(scope.row)" @keyup.enter.native="onRemarkEnter(scope.row)" />
|
||||
<span v-show="!scope.row.isEdit" class="remark-view">
|
||||
<template slot="alias" slot-scope="scope">
|
||||
<el-input v-show="scope.row.isEdit" v-model="scope.row.alias" size="mini" maxlength="64" show-word-limit
|
||||
@blur="onAliasBlur(scope.row)" @keyup.enter.native="onAliasEnter(scope.row)" />
|
||||
<span v-show="!scope.row.isEdit" class="alias-view">
|
||||
<i class="el-icon-edit" @click="scope.row.isEdit = true" style="cursor: pointer;"></i>
|
||||
<span @click="scope.row.isEdit = true">
|
||||
{{ scope.row.remark || '-' }}
|
||||
{{ scope.row.alias || '-' }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
if (this.mqttServiceAvailable) {
|
||||
columns.push({ prop: 'deviceStatus', label: this.$t('device.deviceStatus'), align: 'center' });
|
||||
}
|
||||
columns.push({ prop: 'remark', label: this.$t('device.remark'), align: 'center' });
|
||||
columns.push({ prop: 'alias', label: this.$t('device.alias'), align: 'center' });
|
||||
columns.push({ prop: 'otaSwitch', label: this.$t('device.autoUpdate'), align: 'center' });
|
||||
return columns;
|
||||
},
|
||||
@@ -262,39 +262,39 @@ export default {
|
||||
handleManualAddDevice() {
|
||||
this.manualAddDeviceDialogVisible = true;
|
||||
},
|
||||
submitRemark(row) {
|
||||
submitAlias(row) {
|
||||
if (row._submitting) return;
|
||||
|
||||
const text = (row.remark || '').trim();
|
||||
const text = (row.alias || '').trim();
|
||||
if (text.length > 64) {
|
||||
this.$message.warning(this.$t('device.remarkTooLong'));
|
||||
this.$message.warning(this.$t('device.aliasTooLong'));
|
||||
return;
|
||||
}
|
||||
if (text === row._originalRemark) {
|
||||
if (text === row._originalAlias) {
|
||||
return;
|
||||
}
|
||||
|
||||
row._submitting = true;
|
||||
this.updateDeviceInfo(row.device_id, { alias: text }, (ok, resp) => {
|
||||
if (ok) {
|
||||
row._originalRemark = text;
|
||||
this.$message.success(this.$t('device.remarkSaved'));
|
||||
row._originalAlias = text;
|
||||
this.$message.success(this.$t('device.aliasSaved'));
|
||||
} else {
|
||||
row.remark = row._originalRemark;
|
||||
this.$message.error(resp.msg || this.$t('device.remarkSaveFailed'));
|
||||
row.alias = row._originalAlias;
|
||||
this.$message.error(resp.msg || this.$t('device.aliasSaveFailed'));
|
||||
}
|
||||
row._submitting = false;
|
||||
});
|
||||
},
|
||||
onRemarkBlur(row) {
|
||||
onAliasBlur(row) {
|
||||
row.isEdit = false;
|
||||
setTimeout(() => {
|
||||
this.submitRemark(row);
|
||||
this.submitAlias(row);
|
||||
}, 100);
|
||||
},
|
||||
onRemarkEnter(row) {
|
||||
onAliasEnter(row) {
|
||||
row.isEdit = false;
|
||||
this.submitRemark(row);
|
||||
this.submitAlias(row);
|
||||
},
|
||||
handleUnbind(device_id) {
|
||||
this.$confirm(this.$t('device.confirmUnbind'), this.$t('message.warning'), {
|
||||
@@ -346,8 +346,8 @@ export default {
|
||||
macAddress: device.macAddress,
|
||||
bindTime: formatCreateDate(device.createDateTimestamp, device.createDate),
|
||||
lastConversation: formatTimestamp(device.lastConnectedAtTimestamp),
|
||||
remark: device.alias,
|
||||
_originalRemark: device.alias,
|
||||
alias: device.alias,
|
||||
_originalAlias: device.alias,
|
||||
isEdit: false,
|
||||
_submitting: false,
|
||||
otaSwitch: device.autoUpdate === 1,
|
||||
|
||||
Reference in new issue
Block a user