修复服务、设备新增后不显示新的数据

This commit is contained in:
wu
2022-08-22 14:30:19 +08:00
parent 783b54e101
commit c02125f192
2 changed files with 3 additions and 2 deletions

View File

@@ -491,13 +491,14 @@ export default {
} }
}, },
addDevice () { addDevice () {
const that = this
this.$prompt('输入设备名称', '新加设备', { this.$prompt('输入设备名称', '新加设备', {
confirmButtonText: '确定', confirmButtonText: '确定',
inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/,
inputErrorMessage: '请输入设备名称' inputErrorMessage: '请输入设备名称'
}).then(({ value }) => { }).then(({ value }) => {
this.$api.ADD_DEVICE({ action: 'add_device', name: value, server_id: this.serverData.id }) this.$api.ADD_DEVICE({ action: 'add_device', name: value, server_id: this.serverData.id })
this.getDevice() that.getDevice()
this.$message({ this.$message({
message: '新加设备成功', message: '新加设备成功',
type: 'success' type: 'success'

View File

@@ -283,7 +283,7 @@ export default {
process.env.VUE_APP_HSLSERVER_PASSWORD, process.env.VUE_APP_HSLSERVER_PASSWORD,
{ data: this.serverSettings.Content } { data: this.serverSettings.Content }
) )
this.$api.ADD_SERVER({ await this.$api.ADD_SERVER({
action: 'add_server', action: 'add_server',
name: row.deviceName, name: row.deviceName,
url: row.url, url: row.url,