初步完成微信员工列表读取

feature/2.0-sales-trade
LiaoYijun 3 years ago
parent 269c3d89d6
commit bb003a7607

@ -1,42 +1,19 @@
import React, {useContext, useEffect} from 'react'; import React, {Component} from 'react';
import {Row, Col, List, Avatar, Table, Space, Radio, Tooltip} from 'antd'; import {Row, Col, List, Avatar} from 'antd';
import {
ContainerOutlined,
SearchOutlined,
} from '@ant-design/icons';
import {stores_Context} from '../config' import {stores_Context} from '../config'
import {Line} from "@ant-design/charts";
import {observer} from 'mobx-react'; import {observer} from 'mobx-react';
import DatePickerCharts from '../charts/DatePickerCharts' import { toJS } from "mobx";
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";
const Wechat_session = () => { class Wechat_session extends Component {
const {orders_store, date_picker_store, customer_store} = useContext(stores_Context); static contextType = stores_Context;
const inchina_data = customer_store.inchina_data; constructor(props) {
super(props);
useEffect(() => { this.stores = this.props.stores;
}
}, []) render() {
const data = [ const {wechatStore} = this.stores;
{ const userList = wechatStore.userList;
title: 'Ant Design Title 1',
},
{
title: 'Ant Design Title 2',
},
{
title: 'Ant Design Title 3',
},
{
title: 'Ant Design Title 4',
},
];
return ( return (
<div> <div>
@ -44,12 +21,12 @@ const Wechat_session = () => {
<Col span={8}> <Col span={8}>
<List <List
itemLayout="horizontal" itemLayout="horizontal"
dataSource={data} dataSource={userList}
renderItem={(item) => ( renderItem={(user) => (
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />} avatar={<Avatar src={user.avatar} />}
title={<a href="https://ant.design">{item.title}</a>} title={user.username}
description="" description=""
/> />
</List.Item> </List.Item>
@ -60,6 +37,7 @@ const Wechat_session = () => {
</Row> </Row>
</div> </div>
); );
}
} }
export default observer(Wechat_session); export default observer(Wechat_session);

@ -6,6 +6,7 @@ import CustomerStore from "./CustomerStore";
import AuthStore from "./AuthStore"; import AuthStore from "./AuthStore";
import ChatSessionStore from "./ChatSessionStore"; import ChatSessionStore from "./ChatSessionStore";
import FinancialStore from "./FinancialStore"; import FinancialStore from "./FinancialStore";
import WechatStore from "./Wechat";
class Index { class Index {
@ -17,6 +18,7 @@ class Index {
this.auth_store = new AuthStore(this); this.auth_store = new AuthStore(this);
this.chat_session_store = new ChatSessionStore(this); this.chat_session_store = new ChatSessionStore(this);
this.financial_store = new FinancialStore(this); this.financial_store = new FinancialStore(this);
this.wechatStore = new WechatStore(this);
makeAutoObservable(this); makeAutoObservable(this);
} }

@ -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;
Loading…
Cancel
Save