style: 搜索组件吸顶

feature/pivot
Lei OT 2 years ago
parent 7eb57a0ffd
commit 46e6dfcf1e

@ -34,3 +34,10 @@
.p-s1{
padding: .5em;
}
.sticky-top{
margin: -16px -8px .5em -8px;
position: sticky;
top: 0;
z-index: 100;
}

@ -17,7 +17,7 @@ const Customer_care_inchina = () => {
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top'>
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{
@ -39,6 +39,8 @@ const Customer_care_inchina = () => {
}}
/>
</Col>
</Row>
<Row gutter={16} >
<Col span={24}>
<h2>在华客人</h2>
</Col>

@ -16,9 +16,9 @@ const Customer_care_potential = () => {
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top'>
<Col className="gutter-row" span={24}>
<SearchForm
<SearchForm className='sticky-top'
defaultValue={{
initialValue: {
...date_picker_store.formValues,
@ -38,6 +38,8 @@ const Customer_care_potential = () => {
}}
/>
</Col>
</Row>
<Row gutter={16} >
<Col span={24}>
<h2>潜力客户</h2>
</Col>

@ -1,23 +1,19 @@
import React, {useContext, useEffect} from 'react';
import {Row, Col, Divider, Table} from 'antd';
import {utils, writeFileXLSX} from 'xlsx';
import {stores_Context} from '../config';
import {observer} from 'mobx-react';
import React, { useContext, useEffect } from 'react';
import { Row, Col, Divider, Table } from 'antd';
import { utils, writeFileXLSX } from 'xlsx';
import { stores_Context } from '../config';
import { observer } from 'mobx-react';
import SearchForm from './../components/search/SearchForm';
const Customer_care_regular = () => {
const {orders_store, date_picker_store, customer_store} = useContext(stores_Context);
const { orders_store, date_picker_store, customer_store } = useContext(stores_Context);
const regular_data = customer_store.regular_data;
useEffect(() => {
}, []);
useEffect(() => {}, []);
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className="sticky-top">
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{
@ -39,12 +35,16 @@ const Customer_care_regular = () => {
}}
/>
</Col>
</Row>
<Row gutter={16}>
<Col span={24}>
<h2>老客户</h2>
</Col>
<Col span={24}>
<Table dataSource={regular_data.data} loading={regular_data.loading} columns={
[
<Table
dataSource={regular_data.data}
loading={regular_data.loading}
columns={[
{
title: '统计条目',
dataIndex: 'ItemName',
@ -64,7 +64,7 @@ const Customer_care_regular = () => {
title: '成行率',
dataIndex: 'SUCRate',
key: 'SUCRate',
render: (text, record) => <span>{Math.round(text * 100)}%</span>
render: (text, record) => <span>{Math.round(text * 100)}%</span>,
},
{
title: '毛利',
@ -76,18 +76,30 @@ const Customer_care_regular = () => {
dataIndex: 'PersonNum',
key: 'PersonNum',
},
]
} size="small" pagination={false} rowKey={record => record.ItemName}
]}
size="small"
pagination={false}
rowKey={(record) => record.ItemName}
/>
</Col>
<Col span={24}>
<Divider orientation="right" plain><a
<Divider orientation="right" plain>
<a
onClick={() => {
const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]);
writeFileXLSX(wb, "老客户.xlsx");
}}>导出excel</a></Divider>
<Table id="table_to_xlsx" pagination={false} loading={regular_data.loading} dataSource={regular_data.data_detail} scroll={{x: 1200 }} columns={
[
const wb = utils.table_to_book(document.getElementById('table_to_xlsx').getElementsByTagName('table')[0]);
writeFileXLSX(wb, '老客户.xlsx');
}}
>
导出excel
</a>
</Divider>
<Table
id="table_to_xlsx"
pagination={false}
loading={regular_data.loading}
dataSource={regular_data.data_detail}
scroll={{ x: 1200 }}
columns={[
{
title: '订单号',
dataIndex: 'COLI_ID',
@ -160,16 +172,13 @@ const Customer_care_regular = () => {
dataIndex: 'ZH',
key: 'ZH',
},
]
} size="small"
rowKey={record => record.COLI_ID}
]}
size="small"
rowKey={(record) => record.COLI_ID}
/>
</Col>
</Row>
</div>
);
};
export default observer(Customer_care_regular);

@ -154,5 +154,5 @@ export const resultDataCb = (dataRaw, dateGroup, { data1, data2 }, fieldMapper,
const retData = [].concat(parseData1, reindexData2 ).map(ele => ({...ele, [fieldMapper.dateKey]: data1KeyMappedStr[ele[fieldMapper.dateKey]] || data2KeyMappedStr[ele[fieldMapper.dateKey]]}));
const avg1 = parse1.avgVal;
// console.log('callback', dateGroup, retData, data1KeyMappedStr, data2KeyMappedStr);
cb(dateGroup, retData, avg1);
cb(dateGroup, retData, avg1, parse2.avgVal);
};

@ -19,7 +19,7 @@ const AgentGroupCount = () => {
return (
<>
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top' >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{

@ -15,7 +15,7 @@ const DestinationGroupCount = () => {
return (
<>
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top'>
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{

@ -174,7 +174,7 @@ export default observer(() => {
};
return (
<>
<Row gutter={16} style={{ margin: '-16px -8px' }}>
<Row gutter={16} className='sticky-top' >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{

@ -162,8 +162,7 @@ export default observer(() => {
};
return (
<>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'sticky', top: 0, zIndex: 10 }}>
{/* style={{ margin: '-16px -8px', padding: 0 }} */}
<Row gutter={16} className='sticky-top' >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{

@ -323,7 +323,7 @@ class Orders extends Component {
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top' >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{
@ -345,6 +345,8 @@ class Orders extends Component {
}}
/>
</Col>
</Row>
<Row gutter={[16, { sm: 16, lg: 32 }]}>
<Col span={24} style={{ textAlign: 'right' }}>
<DateGroupRadio
visible={data_source.length !== 0}
@ -355,9 +357,6 @@ class Orders extends Component {
fieldMapper={orders_store.orderCountDataFieldMapper}
/>
</Col>
</Row>
<Row gutter={[16, { sm: 16, lg: 32 }]}>
<Col span={24}>
<Spin spinning={orders_store.loading}>
<Line {...config} />

@ -262,7 +262,7 @@ const Orders_sub = () => {
};
return (
<div>
<Row gutter={{ sm: 16, lg: 32 }}>
<Row gutter={{ sm: 16, lg: 32 }} className="sticky-top">
<Col md={24} lg={12} xxl={14}>
<NavLink to={`/orders`}>返回</NavLink>
</Col>
@ -286,6 +286,9 @@ const Orders_sub = () => {
}}
/>
</Col>
</Row>
<Row gutter={[16, { xs: 8, sm: 16, md: 24, lg: 32 }]}>
<Col span={24} style={{ textAlign: 'right' }}>
<DateGroupRadio
visible={data_source.length !== 0}
@ -296,9 +299,6 @@ const Orders_sub = () => {
fieldMapper={orders_store.orderCount_type_dateRadio.orderCountDataFieldMapper}
/>
</Col>
</Row>
<Row gutter={[16, { xs: 8, sm: 16, md: 24, lg: 32 }]}>
<Col className="gutter-row" span={24}>
<Line {...line} />
</Col>

@ -205,7 +205,7 @@ const Sale = () => {
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Row gutter={16} className='sticky-top' >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{

@ -105,7 +105,7 @@ const Sale_KPI = () => {
const lineConfig = { appendPadding: 10, xField: 'groupDateVal', yField: 'SumML', seriesField: 'groupsLabel', isGroup: true, smooth: true, meta: comm.cloneDeep(dataFieldAlias), };
return (
<div>
<Row gutter={16} style={{ margin: '-16px -8px' }}>
<Row gutter={16} className='sticky-top' >
<Col md={24} lg={24} xxl={24}>
<SearchForm
defaultValue={{

Loading…
Cancel
Save