更新优化
This commit is contained in:
@@ -284,15 +284,17 @@ const actions = {
|
||||
} else if (data.resp_name === 'add_log') {
|
||||
let logs = data.resp_info.add_log
|
||||
let loglist = []
|
||||
let logLists = [...state.logList]
|
||||
for (let i = 0; i < logs.length; i++) {
|
||||
let texts = logs[i].split('|')
|
||||
loglist.push({
|
||||
if (logLists.length > 20) logLists.splice(logLists.length - 1, 1)
|
||||
loglist.unshift({
|
||||
time: texts[0],
|
||||
text: texts[2],
|
||||
status: texts[1]
|
||||
})
|
||||
}
|
||||
let list = [...state.logList, ...loglist]
|
||||
let list = [...loglist, ...state.logList]
|
||||
commit('setData', { name: 'logList', data: list })
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user