|
|
|
@ -53,56 +53,86 @@ const Sale = () => {
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
const column_config_create = (tab_name) => {
|
|
|
|
|
let config_data = {
|
|
|
|
|
//seriesField: "OPI_Name",
|
|
|
|
|
label: {
|
|
|
|
|
position: 'top',
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
label: {
|
|
|
|
|
autoHide: false,
|
|
|
|
|
autoRotate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// legend: {
|
|
|
|
|
// itemValue: {
|
|
|
|
|
// formatter: (text, item) => {
|
|
|
|
|
// const items = ml_data.filter(d => d.groups === item.value); // 按分组筛选
|
|
|
|
|
// return items.length ? items.reduce((a, b) => a + b.COLI_ML, 0) : ""; // 计算总数
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// tooltip: {
|
|
|
|
|
// customContent: (title, items) => {
|
|
|
|
|
// const data = items[0].data || {};console.log(data);
|
|
|
|
|
// return `<div>${title}</div>wwwwwww<div></div>`;
|
|
|
|
|
// },
|
|
|
|
|
// title: (title, datum) => {
|
|
|
|
|
// return title; // + " " + comm.getWeek(datum.COLI_Date); // 显示周几
|
|
|
|
|
// },
|
|
|
|
|
// },};
|
|
|
|
|
};
|
|
|
|
|
let average_value = 0; //平均线的值
|
|
|
|
|
let config_data = [];
|
|
|
|
|
switch (tab_name) {
|
|
|
|
|
case 'All':
|
|
|
|
|
config_data.data = type_data.dataSource;
|
|
|
|
|
config_data.xField = 'OPI_Name';
|
|
|
|
|
config_data.yField = 'COLI_ML2';
|
|
|
|
|
average_value = Math.round(config_data.data.reduce((a, b) => a + b.COLI_ML2, 0) / config_data.data.length);
|
|
|
|
|
break;
|
|
|
|
|
case 'ResponseRateWhatsApp':
|
|
|
|
|
config_data.data = type_data.dataSource;
|
|
|
|
|
config_data.xField = 'OPI_Name';
|
|
|
|
|
config_data.yField = 'COLI_ConfirmTimeAVG';
|
|
|
|
|
average_value = Math.round(config_data.data.reduce((a, b) => a + b.COLI_ConfirmTimeAVG, 0) / config_data.data.length);
|
|
|
|
|
break;
|
|
|
|
|
case 'ResponseRateByWL':
|
|
|
|
|
config_data.data = type_data.dataSource;
|
|
|
|
|
config_data.xField = 'OPI_Name';
|
|
|
|
|
config_data.yField = 'PriceTime';
|
|
|
|
|
average_value = Math.round(config_data.data.reduce((a, b) => a + b.PriceTime, 0) / config_data.data.length);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
config_data.data = [];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return config_data;
|
|
|
|
|
return {
|
|
|
|
|
...config_data,
|
|
|
|
|
...{
|
|
|
|
|
//seriesField: "OPI_Name",//分组
|
|
|
|
|
label: {
|
|
|
|
|
position: 'top',
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
label: {
|
|
|
|
|
autoHide: false,
|
|
|
|
|
autoRotate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// legend: {
|
|
|
|
|
// itemValue: {
|
|
|
|
|
// formatter: (text, item) => {
|
|
|
|
|
// const items = ml_data.filter(d => d.groups === item.value); // 按分组筛选
|
|
|
|
|
// return items.length ? items.reduce((a, b) => a + b.COLI_ML, 0) : ""; // 计算总数
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
// tooltip: {
|
|
|
|
|
// customContent: (title, items) => {
|
|
|
|
|
// const data = items[0].data || {};console.log(data);
|
|
|
|
|
// return `<div>${title}</div>wwwwwww<div></div>`;
|
|
|
|
|
// },
|
|
|
|
|
// title: (title, datum) => {
|
|
|
|
|
// return title; // + " " + comm.getWeek(datum.COLI_Date); // 显示周几
|
|
|
|
|
// },
|
|
|
|
|
// },};
|
|
|
|
|
annotations: average_value
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
type: 'text',
|
|
|
|
|
position: ['start', average_value],
|
|
|
|
|
content: average_value,
|
|
|
|
|
offsetX: -15,
|
|
|
|
|
style: {
|
|
|
|
|
fill: '#F4664A',
|
|
|
|
|
textBaseline: 'bottom',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'line',
|
|
|
|
|
start: [-10, average_value],
|
|
|
|
|
end: ['max', average_value],
|
|
|
|
|
style: {
|
|
|
|
|
stroke: '#F4664A',
|
|
|
|
|
lineDash: [2, 2],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: [],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
const column_config = column_config_create(sale_store.active_tab_key);
|
|
|
|
|
|
|
|
|
@ -146,6 +176,65 @@ const Sale = () => {
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const tab_items = [
|
|
|
|
|
{
|
|
|
|
|
key: 'All',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 总览
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'ResponseRateWhatsApp',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<UserSwitchOutlined /> 回复率
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'ResponseRateByWL',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<UserSwitchOutlined /> 沟通数据
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Country',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 国籍
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Product',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 产品类型
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'TravelMotivation',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 出行目的
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'GuestGroupType',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 成员关系
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
|
|
|
|
@ -240,67 +329,8 @@ const Sale = () => {
|
|
|
|
|
sale_store.onChange_Tabs(active_key);
|
|
|
|
|
sale_store.get_department_order_ml_by_type(date_picker_store);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 总览
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="All"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<UserSwitchOutlined /> 回复率
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="ResponseRateWhatsApp"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<UserSwitchOutlined /> 沟通数据
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="ResponseRateByWL"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined /> 国籍
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="Country"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
产品类型
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="Product"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
出行目的
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="TravelMotivation"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
成员关系
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="GuestGroupType"
|
|
|
|
|
></Tabs.TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
items={tab_items}
|
|
|
|
|
></Tabs>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Table
|
|
|
|
|