Commit 44ec35b4 by Tianqing Liu

feat: 优化重跑日志

1 parent e7f5b49c
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
{{ item.name + ':' }} {{ item.name + ':' }}
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<a-tag>{{ item.status }}</a-tag> <a-tag :color="item.status">{{item.statusText}}</a-tag>
</el-col> </el-col>
</el-row> </el-row>
</a-card> </a-card>
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
} }
msgLogList.value = [] msgLogList.value = []
for (const mallId of queryForm.account_id) { for (const mallId of queryForm.plaza_id) {
// 请求接口 // 请求接口
const rawData = toRaw(queryForm) const rawData = toRaw(queryForm)
const params = { const params = {
...@@ -336,28 +336,30 @@ export default { ...@@ -336,28 +336,30 @@ export default {
endDate: formatDate(rawData.endDate) + ' ' + '00:00:00', endDate: formatDate(rawData.endDate) + ' ' + '00:00:00',
} }
msgLogList.value.push(getLogMsgList(mallId)) msgLogList.value.push(getLogMsgList(mallId, 'processing'))
dataRerunApi.getResult2(params).then( dataRerunApi.getResult2(params).then(
(r) => { (r) => {
console.log('getResult2', r) console.log('getResult2', r)
if (r.data && r.data[0]) { if (r.data) {
msgLogList.value.push(getLogMsgList(r.data[0].mallId), '完成!') msgLogList.value.push(getLogMsgList(r.data.mallId))
} }
} }
) )
} }
} }
const getLogMsgList = function(id, text = '开始...') { const getLogMsgList = function(id, status = 'success') {
const targetMall = plazaList.value.find(item => item.value === id) const targetMall = plazaList.value.find(item => item.value === id)
if (targetMall) { if (targetMall) {
return { return {
name: targetMall.label, name: targetMall.label,
status: text, status,
statusText: status === 'success' ? '完成' : '开始',
} }
} else { } else {
return { return {
name: '未知', name: '未知',
status: '-' status: 'default',
statusText: '-',
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!