提交 b11a3160 authored 作者: lidongxu's avatar lidongxu

refactor(schedule.vue): 修复:店内执行上报_数组列的内容显示有中括号问题去掉

上级 3a34c4f8
......@@ -65,7 +65,7 @@
</div>
</div>
<!-- 展示模式 -->
<div v-else>{{ row[col.prop] || '-' }}</div>
<div v-else>{{ formatter(row, col, row[col.prop] || '-') }}</div>
</template>
</el-table-column>
</template>
......@@ -120,6 +120,11 @@ const props = defineProps({
useFill: {
type: Boolean,
default: false
},
// 格式化表格某列内容
formatter: {
type: Function,
default: (row, col, cellValue) => cellValue
}
})
const emit = defineEmits(['updateColumns', 'getTableList', 'updateShowSearch'])
......
......@@ -12,9 +12,11 @@
:visibleProps="visibleProps"
:params="params"
:useFill="useFill"
:formatter="formatterFn"
@updateColumns="updateColumns"
@getTableList="getTableList"
@updateShowSearch="updateShowSearch" />
@updateShowSearch="updateShowSearch"
/>
</template>
<script setup
......@@ -352,7 +354,7 @@
fill: true,
width: 170,
render: (_, row, col) => {
// options 根据参考属性值来决定
// options 根据参考属性值来决定(计划值)
let list = splitAndFilter(row[col.referenceKey])
let isFullFlavor = false
// 如果数组里有"全系列"/"全口味"则修改数组
......@@ -1125,6 +1127,15 @@
isLoading.value = false
}
// 表格格式化指定列的数据内容
const formatterFn = (row, col, cellValue) => {
if (col.prop === 'actualPromotionFlavor') {
// 对数组内容格式化,为空时,显示'-'
return cellValue.length ? cellValue.join(',') : '-'
}
return cellValue
}
onMounted(() => {
updateColumns()
getTableList()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论