perf: 订单>仪表盘-移动订单: 搜索组件

feature/pivot
Lei OT 2 years ago
parent 40b07c503e
commit 51ae4c9cea

@ -1,10 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Table, Button, Space, Radio} from 'antd'; import { Table, } from 'antd';
import {SearchOutlined} from '@ant-design/icons'; import SearchForm from './../components/search/SearchForm';
import GroupSelect from '../components/search/GroupSelect'; import { stores_Context } from '../config';
import DatePickerCharts from "../components/search/DatePickerCharts"; import { observer } from 'mobx-react';
import {stores_Context} from "../config";
import {observer} from "mobx-react";
class MobileDeal extends Component { class MobileDeal extends Component {
static contextType = stores_Context; static contextType = stores_Context;
@ -14,24 +12,30 @@ class MobileDeal extends Component {
} }
render() { render() {
const {dashboard_store} = this.context; const { dashboard_store, date_picker_store } = this.context;
const mobile_data = dashboard_store.mobile_data; const mobile_data = dashboard_store.mobile_data;
return ( return (
<div> <div>
<h2>移动成交</h2> <h2>移动成交</h2>
<GroupSelect store={mobile_data}/> <SearchForm
<Space size="large"> defaultValue={{
<DatePickerCharts hide_vs={true}/> initialValue: {
...date_picker_store.formValues,
<Radio.Group value={mobile_data.date_type} onChange={mobile_data.onChange_datetype}> ...mobile_data.mobileSearchValues,
<Radio value="applyDate">预定日期</Radio> },
<Radio value="startDate">出发日期</Radio> shows: ['DateType', 'DepartmentList', 'dates'],
</Radio.Group> fieldProps: {
DepartmentList: { show_all: false, mode: 'multiple', col: 24 },
<Button type="primary" icon={<SearchOutlined/>} loading={mobile_data.loading} onClick={() => { WebCode: { show_all: true },
dates: { hide_vs: true, col: 12 },
DateType: { col: 6, disabledKeys: ['ConfirmDate'] },
},
}}
onSubmit={(_err, obj, form, str) => {
dashboard_store.setMobileSearchValues(obj, form);
mobile_data.asyncFetch(); mobile_data.asyncFetch();
}}>统计</Button> }}
</Space> />
<Table dataSource={mobile_data.data} columns={mobile_data.columns} pagination={false} size="small" /> <Table dataSource={mobile_data.data} columns={mobile_data.columns} pagination={false} size="small" />
</div> </div>
); );

@ -35,7 +35,7 @@ class DataTypeSelect extends Component {
{...extProps} {...extProps}
> >
{dateTypes.map((ele) => ( {dateTypes.map((ele) => (
<Select.Option key={ele.key} value={ele.key}> <Select.Option key={ele.key} value={ele.key} disabled={extProps.disabledKeys.includes(ele.key)}>
{ele.label} {ele.label}
</Select.Option> </Select.Option>
))} ))}

@ -221,7 +221,7 @@ export default observer((props) => {
<Row gutter={10} style={{ background: '#f9fafa', margin: '0px 0px 10px 0px', padding: '16px 8px 0 8px', boxShadow: '0px 0px 3px 0px rgba(0,0,0,0.15)' }}> <Row gutter={10} style={{ background: '#f9fafa', margin: '0px 0px 10px 0px', padding: '16px 8px 0 8px', boxShadow: '0px 0px 3px 0px rgba(0,0,0,0.15)' }}>
{getFields({ sort, initialValue, hides, shows, fieldProps, form })} {getFields({ sort, initialValue, hides, shows, fieldProps, form })}
{/* 'textAlign': 'right' */} {/* 'textAlign': 'right' */}
<Col flex="1 0 120px" style={{ padding: '0px 5px', display: 'flex', justifyContent: 'flex-end', alignItems: 'flex-start' }}> <Col flex="1 0 90px" style={{ padding: '0px 5px', display: 'flex', justifyContent: 'flex-end', alignItems: 'flex-start' }}>
<Space align="center"> <Space align="center">
<Button size={'middle'} type="primary" icon={<SearchOutlined />} htmlType="submit"> <Button size={'middle'} type="primary" icon={<SearchOutlined />} htmlType="submit">
{confirmText || '统计'} {confirmText || '统计'}
@ -312,7 +312,7 @@ function getFields(props) {
rules={[{ required: true, message: '选择小组' }]} rules={[{ required: true, message: '选择小组' }]}
> >
<GroupSelect {...fieldProps.DepartmentList} labelInValue={true} /> <GroupSelect {...fieldProps.DepartmentList} labelInValue={true} />
</Form.Item> </Form.Item>, fieldProps?.DepartmentList?.col
), ),
item( item(
'WebCode', 'WebCode',
@ -378,9 +378,9 @@ function getFields(props) {
'DateType', 'DateType',
99, 99,
<Form.Item name={`DateType`} initialValue={at(props, 'initialValue.DateType')[0] || { key: 'applyDate', label: '提交日期' }}> <Form.Item name={`DateType`} initialValue={at(props, 'initialValue.DateType')[0] || { key: 'applyDate', label: '提交日期' }}>
<DateTypeSelect labelInValue={true} /> <DateTypeSelect labelInValue={true} disabledKeys={fieldProps?.DateType?.disabledKeys || []} />
</Form.Item>, </Form.Item>,
3 fieldProps?.DateType?.col || 3
), ),
item( item(
'years', 'years',
@ -405,7 +405,7 @@ function getFields(props) {
<Form.Item> <Form.Item>
<DatePickerCharts isform={true} {...fieldProps.dates} form={form} /> <DatePickerCharts isform={true} {...fieldProps.dates} form={form} />
</Form.Item>, </Form.Item>,
midCol fieldProps?.dates?.col || midCol
), ),
item( item(
'operator', 'operator',

@ -1,6 +1,7 @@
import { makeAutoObservable, runInAction } from "mobx"; import { makeAutoObservable, runInAction } from "mobx";
import * as config from "../config"; import * as config from "../config";
import { resultDataCb } from '../components/DateGroupRadio/date'; import { resultDataCb } from '../components/DateGroupRadio/date';
import { groupsMappedByKey } from './../libs/ht';
class DashboardStore { class DashboardStore {
constructor(rootStore) { constructor(rootStore) {
@ -197,7 +198,17 @@ class DashboardStore {
group_handleChange: this.handleChange_group_select.bind(this), group_handleChange: this.handleChange_group_select.bind(this),
onChange_datetype: this.onChange_datetype.bind(this), onChange_datetype: this.onChange_datetype.bind(this),
asyncFetch: this.get_CountYDOrder.bind(this), asyncFetch: this.get_CountYDOrder.bind(this),
mobileSearchValues: {
'DateType': { key: 'applyDate', value: 'applyDate', label: '预定日期'},
'DepartmentList': ["1", "2", "28", "7", "8", "9", "11", "12", "20", "21", "18"].map(ele => groupsMappedByKey[ele] ),
}
}; };
setMobileSearchValues(obj, values) {
this.mobile_data.date_type = obj.DateType;
this.mobile_data.groups = obj.DepartmentList;
}
// 移动成交 end // 移动成交 end
// 汇率变化 begin // 汇率变化 begin

Loading…
Cancel
Save