diff --git a/src/App.js b/src/App.js index c990e07..4929d43 100644 --- a/src/App.js +++ b/src/App.js @@ -1,122 +1,120 @@ -import './App.css'; -import React, {useContext} from 'react'; -import { - HomeOutlined, - TeamOutlined, - DashboardOutlined, - FileProtectOutlined, - CustomerServiceTwoTone, - DollarOutlined, - AreaChartOutlined, - WechatOutlined, - UserOutlined -} from '@ant-design/icons'; -import {Layout, Menu, Image, Spin} from 'antd'; -import {BrowserRouter, Route, Routes, NavLink} from "react-router-dom" -import Home from "./views/Home" -import Dashboard from "./views/Dashboard" -import Orders from "./views/Orders" -import Orders_sub from "./views/Orders_sub" -import ProtectedRoute from "./views/ProtectedRoute" -import Customer_care_inchina from "./charts/Customer_care_inchina" -import Customer_care_potential from "./charts/Customer_care_potential" -import Customer_care_regular from "./charts/Customer_care_regular" -import Wechat_session from "./charts/Wechat_session" -import WhatsApp_session from "./charts/WhatsApp_session" -import Credit_card_bill from "./views/Credit_card_bill" -import Logo from './logo.png' -import {stores_Context} from "./config"; -import {observer} from "mobx-react"; - +import "./App.css"; +import React, { useContext } from "react"; +import { HomeOutlined, TeamOutlined, DashboardOutlined, FileProtectOutlined, CustomerServiceTwoTone, SnippetsTwoTone, DollarOutlined, AreaChartOutlined, WechatOutlined, UserOutlined } from "@ant-design/icons"; +import { Layout, Menu, Image, Spin } from "antd"; +import { BrowserRouter, Route, Routes, NavLink } from "react-router-dom"; +import Home from "./views/Home"; +import Dashboard from "./views/Dashboard"; +import Orders from "./views/Orders"; +import Orders_sub from "./views/Orders_sub"; +import ProtectedRoute from "./views/ProtectedRoute"; +import Customer_care_inchina from "./charts/Customer_care_inchina"; +import Customer_care_potential from "./charts/Customer_care_potential"; +import Customer_care_regular from "./charts/Customer_care_regular"; +import Wechat_session from "./charts/Wechat_session"; +import WhatsApp_session from "./charts/WhatsApp_session"; +import Credit_card_bill from "./views/Credit_card_bill"; +import exchange_rate from "./charts/ExchangeRate"; +import Sale from "./views/Sale"; +import Logo from "./logo.png"; +import { stores_Context } from "./config"; +import { observer } from "mobx-react"; +import ExchangeRate from "./charts/ExchangeRate"; const App = () => { + const { Content, Footer, Sider } = Layout; + const { auth_store } = useContext(stores_Context); + const menu_items = [ + { key: 1, label: 主页, icon: }, + { + key: 2, + label: "市场", + icon: , + children: [ + { key: 21, label: 订单数据, icon: }, + { key: 22, label: 仪表盘, icon: }, + ], + }, + { + key: 5, + label: "销售", + icon: , + children: [{ key: 51, label: 业绩数据 }], + }, + { + key: 3, + label: "客运", + icon: , + children: [ + { key: 31, label: 潜力客户 }, + { key: 32, label: 老客户 }, + { key: 33, label: 在华客户 }, + { key: 34, label: 微信会话存档 }, + { key: 35, label: WhatsApp会话存档 }, + ], + }, + { + key: 4, + label: "财务", + icon: , + children: [ + { key: 41, label: 信用卡账单 }, + { key: 42, label: 汇率 }, + ], + }, + ]; - const {Content, Footer, Sider} = Layout; - const {auth_store} = useContext(stores_Context); - - const menu_items = [ - {key: 1, label: 主页, icon: }, - { - key: 2, label: '市场', icon: , - children: [ - {key: 21, label: 订单数据, icon: ,}, - {key: 22, label: 仪表盘, icon: }, - ] - }, - { - key: 3, label: '客运', icon: , - children: [ - {key: 31, label: 潜力客户}, - {key: 32, label: 老客户}, - {key: 33, label: 在华客户}, - {key: 34, label: 微信会话存档}, - {key: 35, label: WhatsApp会话存档}, - ] - }, - { - key: 4, - label: '财务', - icon: , - children: [ - {key: 41, label: 信用卡账单}, - ] - }, - - - ]; - - return ( - - - - - - - - - - }/> - }> - }/> - }/> - }/> - - }> - }/> - }/> - }/> - }/> - }/> - - }> - }/> - - - -
- {auth_store.user.name} ({auth_store.user.userid})
- Hainatravel Dashboard ©2022 Created by IT -
-
- - - ); - -} + return ( + + + + + + + + + + } /> + }> + } /> + } /> + } /> + + }> + } /> + } /> + } /> + } /> + } /> + + }> + } /> + } /> + + }> + } /> + + + +
+ {auth_store.user.name} ({auth_store.user.userid})
+ Hainatravel Dashboard ©2022 Created by IT +
+
+ + + ); +}; export default observer(App); diff --git a/src/charts/Customer_care_inchina.js b/src/charts/Customer_care_inchina.js index d8ab1dc..d2b6ba8 100644 --- a/src/charts/Customer_care_inchina.js +++ b/src/charts/Customer_care_inchina.js @@ -95,7 +95,7 @@ const Customer_care_inchina = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "在华客人.xlsx"); diff --git a/src/charts/Customer_care_potential.js b/src/charts/Customer_care_potential.js index 0d8caf4..d7c7d01 100644 --- a/src/charts/Customer_care_potential.js +++ b/src/charts/Customer_care_potential.js @@ -89,7 +89,7 @@ const Customer_care_potential = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "潜力客户.xlsx"); diff --git a/src/charts/Customer_care_regular.js b/src/charts/Customer_care_regular.js index 687286e..bf743a0 100644 --- a/src/charts/Customer_care_regular.js +++ b/src/charts/Customer_care_regular.js @@ -94,7 +94,7 @@ const Customer_care_regular = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "老客户.xlsx"); diff --git a/src/charts/ExchangeRate.js b/src/charts/ExchangeRate.js new file mode 100644 index 0000000..828abea --- /dev/null +++ b/src/charts/ExchangeRate.js @@ -0,0 +1,76 @@ +import React, { Component } from "react"; +import { Table, Button, Space, Radio } from "antd"; +import { SearchOutlined } from "@ant-design/icons"; +import GroupSelect from "./GroupSelect"; +import DatePickerCharts from "./DatePickerCharts"; +import { stores_Context } from "../config"; +import { observer } from "mobx-react"; +import * as comm from "../utils/commons"; +import { Line } from "@ant-design/charts"; +import * as config from "../config"; + +class ExchangeRate extends Component { + static contextType = stores_Context; + + constructor(props) { + super(props); + } + + render() { + const { dashboard_store, date_picker_store } = this.context; + const { exchangeRate_data } = dashboard_store; + const line_data_source = comm.empty(exchangeRate_data.data) ? [] : exchangeRate_data.data.CurrencyData1; + const line_config = { + data: line_data_source, + padding: "auto", + xField: "er_date", + yField: "er_htrate", + seriesField: "er_currency", + xAxis: { + type: "timeCat", + }, + point: { + size: 4, + shape: "cicle", + }, + label: {}, //显示标签 + tooltip: { + // customContent: (title, items) => { + // const data = items[0]?.data || {}; + // return `
${title}
${data.seriesField} ${data.yField}
`; + // }, + // itemTpl: '
  • {name}: {value}
  • ', + customItems: items => { + let result_arr = []; + items.forEach(item => { + item.value = item.data.er_htrate + " | " + item.data.er_bankrate; + return result_arr.push(item); + }); + return result_arr; //return [{color:'red',name:'sss',value:22},{color:'red',name:'aaaa',value:22}]; + }, + }, + smooth: true, + }; + + return ( +
    +

    汇率 HT|Bank

    + + + + + +
    + ); + } +} + +export default observer(ExchangeRate); diff --git a/src/charts/GroupSelect.js b/src/charts/GroupSelect.js index de5ed42..83102fb 100644 --- a/src/charts/GroupSelect.js +++ b/src/charts/GroupSelect.js @@ -14,13 +14,15 @@ class GroupSelect extends Component {