Merge branch 'feature/feature-20250430-h5' of https://e.coding.yili.com/yldc/ylst/ylst-survey-h5 into feature/feature-20250430-h5
This commit is contained in:
@@ -106,6 +106,26 @@ function tooptipFormatter(data: { row: any; column: any; cellValue: any }): VNod
|
|||||||
content: data
|
content: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// render
|
||||||
|
const RenderSlot = {
|
||||||
|
functional: true,
|
||||||
|
props: {
|
||||||
|
row: Object,
|
||||||
|
render: Function,
|
||||||
|
index: Number,
|
||||||
|
column: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props) {
|
||||||
|
return () => {
|
||||||
|
const { row, index, column } = props;
|
||||||
|
return props.render(h, { row, index, column });
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -136,10 +156,19 @@ function tooptipFormatter(data: { row: any; column: any; cellValue: any }): VNod
|
|||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<slot name="column-default" :scope="scope">
|
<slot name="column-default" :scope="scope">
|
||||||
<div
|
<div
|
||||||
|
v-if="!item.render"
|
||||||
class="table-view-html"
|
class="table-view-html"
|
||||||
@click.stop="handleImageClick"
|
@click.stop="handleImageClick"
|
||||||
v-html="scope.row[item.prop]"
|
v-html="scope.row[item.prop]"
|
||||||
></div>
|
></div>
|
||||||
|
|
||||||
|
<RenderSlot
|
||||||
|
v-else
|
||||||
|
:row="scope.row"
|
||||||
|
:render="item.render"
|
||||||
|
:index="scope.$index"
|
||||||
|
:column="item"
|
||||||
|
></RenderSlot>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ function useSetPieChart(
|
|||||||
|
|
||||||
// 如果 data 变动,重新生成图表w
|
// 如果 data 变动,重新生成图表w
|
||||||
watch(series, (value) => {
|
watch(series, (value) => {
|
||||||
console.log(chartInstance);
|
|
||||||
|
|
||||||
const currentOptions = chartInstance.getOption();
|
const currentOptions = chartInstance.getOption();
|
||||||
|
|
||||||
// 合并新的 series 数据到现有配置中
|
// 合并新的 series 数据到现有配置中
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import CommonLayout from '@/components/Layout/CommonLayout.vue';
|
|||||||
|
|
||||||
// 外部获取的数据
|
// 外部获取的数据
|
||||||
const { data } = recommend({});
|
const { data } = recommend({});
|
||||||
|
|
||||||
const props = ref<TablePropsType[]>([
|
const props = ref<TablePropsType[]>([
|
||||||
{
|
{
|
||||||
prop: 'rank',
|
prop: 'rank',
|
||||||
@@ -26,7 +25,18 @@ const props = ref<TablePropsType[]>([
|
|||||||
{
|
{
|
||||||
prop: 'sales_growth_ring_ratio',
|
prop: 'sales_growth_ring_ratio',
|
||||||
label: '销量增长环比',
|
label: '销量增长环比',
|
||||||
width: 120
|
width: 120,
|
||||||
|
render: (h, p) => {
|
||||||
|
return h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
style: {
|
||||||
|
color: p.row.sales_growth_ring_ratio < 0 ? 'red' : 'green'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
p.row.sales_growth_ring_ratio
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user