[1078] 增加恢复出厂和终端复位
This commit is contained in:
@@ -282,5 +282,23 @@ export function queryDriverInfo(phoneNumber) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function factoryReset(phoneNumber) {
|
||||||
|
return request({
|
||||||
|
method: 'post',
|
||||||
|
url: '/api/jt1078/control/factory-reset',
|
||||||
|
params: {
|
||||||
|
phoneNumber: phoneNumber
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function reset(phoneNumber) {
|
||||||
|
return request({
|
||||||
|
method: 'post',
|
||||||
|
url: '/api/jt1078/control/reset',
|
||||||
|
params: {
|
||||||
|
phoneNumber: phoneNumber
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
add,
|
add,
|
||||||
addChannel, controlPlayback, deleteDevice,
|
addChannel, controlPlayback, deleteDevice, factoryReset,
|
||||||
fillLight, getRecordTempUrl, linkDetection,
|
fillLight, getRecordTempUrl, linkDetection,
|
||||||
play, ptz, queryAttribute,
|
play, ptz, queryAttribute,
|
||||||
queryChannels, queryConfig,
|
queryChannels, queryConfig,
|
||||||
queryDeviceById,
|
queryDeviceById,
|
||||||
queryDevices, queryDriverInfo, queryPosition, queryRecordList, sendTextMessage, setConfig, startPlayback,
|
queryDevices, queryDriverInfo, queryPosition, queryRecordList, reset, sendTextMessage, setConfig, startPlayback,
|
||||||
stopPlay, stopPlayback, telephoneCallback, update,
|
stopPlay, stopPlayback, telephoneCallback, update,
|
||||||
updateChannel, wiper
|
updateChannel, wiper
|
||||||
} from '@/api/jtDevice'
|
} from '@/api/jtDevice'
|
||||||
@@ -270,6 +270,26 @@ const actions = {
|
|||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
factoryReset({ commit }, phoneNumber) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
factoryReset(phoneNumber).then(response => {
|
||||||
|
const { data } = response
|
||||||
|
resolve(data)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
reset({ commit }, phoneNumber) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reset(phoneNumber).then(response => {
|
||||||
|
const { data } = response
|
||||||
|
resolve(data)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -277,6 +277,10 @@ export default {
|
|||||||
this.telephoneCallback(itemData)
|
this.telephoneCallback(itemData)
|
||||||
} else if (command === 'driverInfo') {
|
} else if (command === 'driverInfo') {
|
||||||
this.queryDriverInfo(itemData)
|
this.queryDriverInfo(itemData)
|
||||||
|
} else if (command === 'factoryReset') {
|
||||||
|
this.factoryReset(itemData)
|
||||||
|
} else if (command === 'reset') {
|
||||||
|
this.reset(itemData)
|
||||||
} else {
|
} else {
|
||||||
this.$message.info('尚不支持')
|
this.$message.info('尚不支持')
|
||||||
}
|
}
|
||||||
@@ -312,6 +316,42 @@ export default {
|
|||||||
this.$refs.driverInfo.openDialog(data)
|
this.$refs.driverInfo.openDialog(data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
factoryReset: function(itemData) {
|
||||||
|
this.$confirm('确定恢复出厂设置', '提示', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$store.dispatch('jtDevice/factoryReset', itemData.phoneNumber)
|
||||||
|
.then(data => {
|
||||||
|
this.$message.success({
|
||||||
|
showClose: true,
|
||||||
|
message: '消息已经下发'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
reset: function(itemData) {
|
||||||
|
this.$confirm('确定开始终端复位', '提示', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$store.dispatch('jtDevice/reset', itemData.phoneNumber)
|
||||||
|
.then(data => {
|
||||||
|
this.$message.success({
|
||||||
|
showClose: true,
|
||||||
|
message: '消息已经下发'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
linkDetection: function(itemData) {
|
linkDetection: function(itemData) {
|
||||||
this.$store.dispatch('jtDevice/linkDetection', itemData.phoneNumber)
|
this.$store.dispatch('jtDevice/linkDetection', itemData.phoneNumber)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user