优化错误提示

This commit is contained in:
lin
2025-11-21 12:15:26 +08:00
parent daddb4bfff
commit 4b1ea8ad30
19 changed files with 368 additions and 45 deletions

View File

@@ -333,7 +333,15 @@ export default {
message: '保存成功'
})
this.$emit('submitSuccess')
}).finally(() => {
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
} else {
@@ -346,7 +354,15 @@ export default {
if (this.saveSuccess) {
this.saveSuccess()
}
}).finally(() => {
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
}
@@ -371,9 +387,15 @@ export default {
message: '重置成功 已保存'
})
this.getCommonChannel(this.form.gbId)
}).catch((error) => {
console.error(error)
}).finally(() => {
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
}).catch(() => {
@@ -393,6 +415,13 @@ export default {
this.getPaths()
this.getRegionPaths()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})

View File

@@ -373,6 +373,13 @@ export default {
node.parent.expand()
this.$emit('onChannelChange', node.data.deviceId)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
addChannelFormDevice: function(id, node) {
this.$refs.gbDeviceSelect.openDialog((rows) => {
@@ -393,7 +400,15 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.loaded = false
node.expand()
}).finally(() => {
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
})
@@ -413,7 +428,15 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.loaded = false
node.expand()
}).finally(() => {
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
.finally(() => {
this.loading = false
})
})

View File

@@ -73,6 +73,13 @@ export default {
}
this.initMap()
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
initMap(){
let center = fromLonLat([116.41020, 39.915119])

View File

@@ -119,7 +119,6 @@ import VueEasyTree from '@wchbrad/vue-easy-tree'
import regionEdit from './../dialog/regionEdit'
import gbDeviceSelect from './../dialog/GbDeviceSelect'
import GbChannelSelect from '../dialog/GbChannelSelect.vue'
import chooseCivilCode from '@/views/dialog/chooseCivilCode.vue'
export default {
name: 'DeviceTree',
@@ -199,6 +198,7 @@ export default {
})
},
loadNode: function(node, resolve) {
console.log(22222)
if (node.level === 0) {
resolve([{
treeId: '',
@@ -364,8 +364,13 @@ export default {
this.$emit('onChannelChange', node.data.deviceId)
node.parent.loaded = false
node.parent.expand()
}).catch(function(error) {
console.log(error)
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
},
addChannelFormDevice: function(id, node) {

View File

@@ -602,6 +602,13 @@ export default {
this.startBroadcast(streamInfo.rtc)
}
})
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
} else if (this.broadcastStatus === 1) {
this.broadcastStatus = -1
this.broadcastRtc.close()
@@ -690,6 +697,13 @@ export default {
this.broadcastRtc.close()
this.broadcastStatus = -1
this.$store.dispatch('play/broadcastStop', [this.channelId])
.catch((error) => {
this.$message({
showClose: true,
message: error,
type: 'error'
})
})
}
}
}