Commit 30c0796a by 李伟康

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

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