From 7dc0d2e346c77cf2ba87dddacfdfda01af6f7503 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 24 Aug 2023 16:24:15 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=90=9C=E7=B4=A2=E9=A1=B9=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/BusinessSelect.jsx | 6 +- src/components/search/DataTypeSelect.jsx | 50 ++++++++------- src/components/search/GroupSelect.jsx | 82 ++++++++++++------------ src/components/search/SiteSelect.jsx | 41 ++++-------- src/libs/ht.js | 65 +++++++++++++++++++ 5 files changed, 146 insertions(+), 98 deletions(-) create mode 100644 src/libs/ht.js diff --git a/src/components/search/BusinessSelect.jsx b/src/components/search/BusinessSelect.jsx index 3dd40cc..b97fcb3 100644 --- a/src/components/search/BusinessSelect.jsx +++ b/src/components/search/BusinessSelect.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import {Select} from 'antd'; import {observer} from "mobx-react"; +import { biz } from '../../libs/ht'; const Business_unit = (props) => { @@ -16,10 +17,7 @@ const Business_unit = (props) => { onChange={(value) => store.bu_handleChange(value)} > {props.show_all ? ALL 事业部 : ''} - 公共开支 - GH事业部 - 国际事业部 - 孵化学院 + {biz.map(ele => {ele.label})} ); diff --git a/src/components/search/DataTypeSelect.jsx b/src/components/search/DataTypeSelect.jsx index d6790e9..e6f185d 100644 --- a/src/components/search/DataTypeSelect.jsx +++ b/src/components/search/DataTypeSelect.jsx @@ -1,30 +1,32 @@ -import React, { Component } from "react"; -import { Select } from "antd"; -import { observer } from "mobx-react"; +import React, { Component } from 'react'; +import { Select } from 'antd'; +import { observer } from 'mobx-react'; +import { dateTypes } from './../../libs/ht'; class DataTypeSelect extends Component { - constructor(props) { - super(props); - } + constructor(props) { + super(props); + } - render() { - const store = this.props.store; - return ( -
- -
- ); - } + render() { + const store = this.props.store; + return ( +
+ +
+ ); + } } export default observer(DataTypeSelect); diff --git a/src/components/search/GroupSelect.jsx b/src/components/search/GroupSelect.jsx index 1df05cd..95a0e6e 100644 --- a/src/components/search/GroupSelect.jsx +++ b/src/components/search/GroupSelect.jsx @@ -1,48 +1,46 @@ -import React, {Component} from 'react'; -import {Select} from 'antd'; -import {observer} from "mobx-react"; +import React, { Component } from 'react'; +import { Select } from 'antd'; +import { observer } from 'mobx-react'; +import { groups } from '../../libs/ht'; class GroupSelect extends Component { + constructor(props) { + super(props); + } - constructor(props) { - super(props); - } - - render() { - const store = this.props.store; - return ( -
- -
- ); - } + render() { + const { store, mode, value, onChange, show_all, ...extProps } = this.props; + return ( +
+ +
+ ); + } } export default observer(GroupSelect); diff --git a/src/components/search/SiteSelect.jsx b/src/components/search/SiteSelect.jsx index 809c21d..abb138b 100644 --- a/src/components/search/SiteSelect.jsx +++ b/src/components/search/SiteSelect.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import {Select} from 'antd'; import {observer} from 'mobx-react'; - +import { sites } from '../../libs/ht'; class SiteSelect extends Component { constructor(props) { @@ -10,39 +10,24 @@ class SiteSelect extends Component { render() { - const store = this.props.store; + const { store, mode, value, onChange, show_all, ...extProps } = this.props; return (
); diff --git a/src/libs/ht.js b/src/libs/ht.js new file mode 100644 index 0000000..ad23b01 --- /dev/null +++ b/src/libs/ht.js @@ -0,0 +1,65 @@ +/** + * 事业部 + */ +export const biz = [ + { key: '0', label: '公共开支', code: '' }, + { key: '1', label: 'GH事业部', code: '' }, + { key: '2', label: '国际事业部', code: '' }, + { key: '4', label: '孵化学院', code: '' }, +]; +/** + * 小组 + */ +export const groups = [ + { key: '1,2,28,7,33', label: 'GH事业部', code: 'GH', children: [] }, + { key: '8,9,11,12,20,21', label: '国际事业部', code: 'INT', children: [] }, + { key: '10,18,16,30', label: '孵化学院', code: '', children: [] }, + { key: '1', label: 'CH直销', code: '', children: [] }, + { key: '2', label: 'CH大客户', code: '', children: [] }, + { key: '28', label: 'AH亚洲项目组', code: 'AH', children: [] }, + { key: '33', label: 'GH项目组', code: '', children: [] }, + { key: '7', label: '市场推广', code: '', children: [] }, + { key: '8', label: '德语', code: '', children: [] }, + { key: '9', label: '日语', code: '', children: [] }, + { key: '11', label: '法语', code: '', children: [] }, + { key: '12', label: '西语', code: '', children: [] }, + { key: '20', label: '俄语', code: '', children: [] }, + { key: '21', label: '意语', code: '', children: [] }, + { key: '10', label: '商旅', code: '', children: [] }, + { key: '18', label: 'CT', code: 'CT', children: [] }, + { key: '16', label: 'APP', code: 'APP', children: [] }, + { key: '30', label: 'Trippest', code: 'TP', children: [] }, + { key: '31', label: '花梨鹰', code: '', children: [] }, +]; +/** + * 来源 + */ +export const sites = [ + { key: '2', label: 'CHT', code: 'CHT' }, + { key: '8', label: 'AH', code: 'AH' }, + { key: '163', label: 'GH', code: 'GH' }, + { key: '28', label: '客运中国', code: 'GHKYZG' }, + { key: '7', label: '客运海外', code: 'GHKYHW' }, + { key: '172', label: 'B业务', code: 'GHTOB' }, + { key: '11,12,20,21,10,18', label: '国际(入境)', code: 'JP,VAC,IT,GM,RU,VC' }, + { key: '122,200,211,100,188', label: '国际(海外)', code: 'VACHW,ITHW,GMHW,RUHW,VCHW' }, + { key: '11', label: '日语', code: 'JP' }, + { key: '12', label: '西语', code: 'VAC' }, + { key: '122', label: '西语海外', code: 'VACHW' }, + { key: '20', label: '意大利', code: 'IT' }, + { key: '200', label: '意大利海外', code: 'ITHW' }, + { key: '21', label: '德语', code: 'GM' }, + { key: '211', label: '德语海外', code: 'GMHW' }, + { key: '10', label: '俄语', code: 'RU' }, + { key: '100', label: '俄语海外', code: 'RUHW' }, + { key: '18', label: '法语', code: 'VC' }, + { key: '188', label: '法语海外', code: 'VCHW' }, + { key: '16', label: 'CT', code: 'CT' }, + { key: '30', label: 'TP', code: 'trippest' }, + { key: '31', label: '花梨鹰', code: 'HLY' }, +]; +export const dateTypes = [ + { key: 'applyDate', label: '提交日期' }, + { key: 'ConfirmDate', label: '确认日期' }, + { key: 'startDate', label: '走团日期' }, +];