Commit 30c0796a by 李伟康

refactor(CustomerOpportunities): 重构表格数据结构和任务状态映射

- 将列表数据源从 list 改为 tableData
- 更新标签数据显示字段从 tags 改为 tagList
- 修正任务推送结果状态码映射关系
1 parent 6b0dd959
......@@ -8,9 +8,9 @@
<view class="header-item action-col">操作</view>
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<template v-if="tableData.length">
<scroll-view class="table-body" scroll-y @scrolltolower="$emit('loadMore')">
<view v-for="(item, index) in list" :key="index" class="table-row">
<view v-for="(item, index) in tableData" :key="index" class="table-row">
<view class="row-item customer-col">
<view class="customer-info">
<view class="avatar">{{ getAvatar(item.customerName) }}</view>
......@@ -86,9 +86,10 @@ export default {
watch: {
list: {
handler(val) {
this.tableData = val
this.$nextTick(() => {
val.forEach((item, index) => {
this.showTagMore(item.tags, index)
this.showTagMore(item.tagList, index)
})
})
},
......@@ -153,7 +154,7 @@ export default {
if (cutWidth + 34 < listWidth) targetIndex += 1
}).exec()
if (targetIndex) {
this.$set(this.tableData[index], 'tags', tags.slice(0, targetIndex))
this.$set(this.tableData[index], 'tagList', tags.slice(0, targetIndex))
this.$set(this.tableData[index], 'hasMoreTags', true)
}
} catch (error) {
......
......@@ -99,8 +99,8 @@ export default {
if (item.taskStatus == 1) taskRecordList.push({
label: '推送结果', key: 'pushResult', format: (status) => {
return {
2: '成功',
3: '失败',
1: '成功',
2: '失败',
}[status] || '-'
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!