优化bug
This commit is contained in:
+53
-30
@@ -9,6 +9,11 @@ const dayjs = require('dayjs')
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
errors: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
if (that.$store.getters.token) {
|
||||
@@ -21,41 +26,59 @@ export default {
|
||||
let that = this
|
||||
const currentTime = dayjs().format('HH:mm:ss');
|
||||
if (val.message) {
|
||||
that.$message({
|
||||
message: val.message,
|
||||
type: val.type,
|
||||
})
|
||||
if (that.errors.indexOf(val.message) === -1) {
|
||||
that.errors.push(val.message)
|
||||
that.$message({
|
||||
message: val.message,
|
||||
type: val.type,
|
||||
onClose() {
|
||||
that.errors.splice(that.errors.indexOf(val.message), 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (val.notify) {
|
||||
that.$notify({
|
||||
title: '温馨提示:' + currentTime,
|
||||
message: val.notify,
|
||||
type: val.type,
|
||||
duration: 0
|
||||
})
|
||||
if (that.errors.indexOf(val.notify) === -1) {
|
||||
that.errors.push(val.notify)
|
||||
that.$notify({
|
||||
title: '温馨提示:' + currentTime,
|
||||
message: val.notify,
|
||||
type: val.type,
|
||||
duration: 0,
|
||||
onClose() {
|
||||
that.errors.splice(that.errors.indexOf(val.notify), 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (val.confirm) {
|
||||
that.$notify({
|
||||
title: '温馨提示:' + currentTime,
|
||||
duration: 0,
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div class="notify_text">${val.confirm}</div><div class="notify_btns"><div class="notify_btn notify_btn2" id="notifyAgain" data-type="continue_task">重试</div></div>`,
|
||||
onClick(event) {
|
||||
if (val.req && val.req === 'continue_task') {
|
||||
// 下一个任务
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'continue_task',
|
||||
req_type: 1,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
if (that.errors.indexOf(val.confirm) === -1) {
|
||||
that.errors.push(val.confirm)
|
||||
that.$notify({
|
||||
title: '温馨提示:' + currentTime,
|
||||
duration: 0,
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div class="notify_text">${val.confirm}</div><div class="notify_btns"><div class="notify_btn notify_btn2" id="notifyAgain" data-type="continue_task">重试</div></div>`,
|
||||
onClick(event) {
|
||||
if (val.req && val.req === 'continue_task') {
|
||||
// 下一个任务
|
||||
that.$store.dispatch('chat/websocketsend', {
|
||||
req_name: 'continue_task',
|
||||
req_type: 1,
|
||||
req_info: {}
|
||||
}).then(() => {
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
this.close()
|
||||
},
|
||||
onClose() {
|
||||
that.errors.splice(that.errors.indexOf(val.confirm), 1)
|
||||
}
|
||||
this.close()
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
|
||||
Reference in New Issue
Block a user