From bb003a76072e7c25547de3681c2582036330e406 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Tue, 27 Sep 2022 14:42:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=91=98=E5=B7=A5=E5=88=97=E8=A1=A8=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/charts/Wechat_session.js | 56 +++++++++++------------------------- src/stores/Index.js | 2 ++ src/stores/Wechat.js | 32 +++++++++++++++++++++ 3 files changed, 51 insertions(+), 39 deletions(-) create mode 100644 src/stores/Wechat.js diff --git a/src/charts/Wechat_session.js b/src/charts/Wechat_session.js index aadccf5..7db438e 100644 --- a/src/charts/Wechat_session.js +++ b/src/charts/Wechat_session.js @@ -1,42 +1,19 @@ -import React, {useContext, useEffect} from 'react'; -import {Row, Col, List, Avatar, Table, Space, Radio, Tooltip} from 'antd'; -import { - ContainerOutlined, - SearchOutlined, -} from '@ant-design/icons'; +import React, {Component} from 'react'; +import {Row, Col, List, Avatar} from 'antd'; import {stores_Context} from '../config' -import {Line} from "@ant-design/charts"; import {observer} from 'mobx-react'; -import DatePickerCharts from '../charts/DatePickerCharts' -import {NavLink, useParams} from "react-router-dom"; -import * as comm from "../utils/commons"; -import * as config from "../config"; -import SiteSelect from "../charts/SiteSelect"; -import GroupSelect from "../charts/GroupSelect"; -import {utils, writeFileXLSX} from "xlsx"; +import { toJS } from "mobx"; -const Wechat_session = () => { +class Wechat_session extends Component { - const {orders_store, date_picker_store, customer_store} = useContext(stores_Context); - const inchina_data = customer_store.inchina_data; - - useEffect(() => { - - }, []) - const data = [ - { - title: 'Ant Design Title 1', - }, - { - title: 'Ant Design Title 2', - }, - { - title: 'Ant Design Title 3', - }, - { - title: 'Ant Design Title 4', - }, - ]; + static contextType = stores_Context; + constructor(props) { + super(props); + this.stores = this.props.stores; + } + render() { + const {wechatStore} = this.stores; + const userList = wechatStore.userList; return (
@@ -44,12 +21,12 @@ const Wechat_session = () => { ( + dataSource={userList} + renderItem={(user) => ( } - title={{item.title}} + avatar={} + title={user.username} description="" /> @@ -60,6 +37,7 @@ const Wechat_session = () => {
); + } } export default observer(Wechat_session); diff --git a/src/stores/Index.js b/src/stores/Index.js index be0d252..dd027bb 100644 --- a/src/stores/Index.js +++ b/src/stores/Index.js @@ -6,6 +6,7 @@ import CustomerStore from "./CustomerStore"; import AuthStore from "./AuthStore"; import ChatSessionStore from "./ChatSessionStore"; import FinancialStore from "./FinancialStore"; +import WechatStore from "./Wechat"; class Index { @@ -17,6 +18,7 @@ class Index { this.auth_store = new AuthStore(this); this.chat_session_store = new ChatSessionStore(this); this.financial_store = new FinancialStore(this); + this.wechatStore = new WechatStore(this); makeAutoObservable(this); } diff --git a/src/stores/Wechat.js b/src/stores/Wechat.js new file mode 100644 index 0000000..39308c1 --- /dev/null +++ b/src/stores/Wechat.js @@ -0,0 +1,32 @@ +import {makeAutoObservable, runInAction} from "mobx" +import { + CaretUpOutlined, + CaretDownOutlined +} from '@ant-design/icons'; +import {Tag} from 'antd'; +import * as config from "../config"; +import moment from "moment"; +import {NavLink} from "react-router-dom"; +import * as req from '../utils/request'; + + +class Wechat { + + constructor(rootStore) { + this.rootStore = rootStore; + makeAutoObservable(this); + + req.fetchJSON(config.HT_HOST + '/weixin/wxwork/get_permit_user_list') + .then(json => { + console.info(json); + runInAction(() => { + this.userList = json.Result; + }) + }); + } + userList = [{username: '---', avatar: 'https://joeschmoe.io/api/v1/random'},{username: '---', avatar: 'https://joeschmoe.io/api/v1/random'}]; + +} + + +export default Wechat; \ No newline at end of file