/**
* 会议室列表
*/
import React, { Component } from "react";
import { connect } from "dva";
import { Table, Button, Input, Alert, Spin, Select, } from "antd";
import Detail from "./Detail";
// import Join from "./Join";
import tablePage from '../../../utils/hoc/tablePage';
import Create from "./Create";
import { withRouter } from "dva/router";
import "../meeting.less";
import { addUTC } from '../../../utils/utils';
const Option = Select.Option;
@connect(state => ({
client: state.client.client,
loginStatus: state.client.loginStatus,
currentConferID: state.client.currentConferID,
updateISRefreshMeetingList: state.client.updateISRefreshMeetingList
}))
@tablePage()
@withRouter
export default class MyMeeting extends Component {
constructor(props, context) {
super(props, context);
this.state = {
searchMeetingData: {
//获取会议列表参数
pageIndex: 1,
pageSize: 10
},
forceUpdate: false, //刷新数据
tableList: [], //会议列表数据
visible: false, //抽屉详情状态
clickConferenceID: null, //当前选中的会议id
updateMeetListState: false,
createVisible: false, //创建会议的模态框状态
joinVisible: false //加入会议的模态框状态
};
}
componentDidMount() {
this.props.loginStatus && this.getMyMeetingList(1);
}
componentWillReceiveProps(nextProps) {
// if (
// nextProps.loginStatus !== this.props.loginStatus &&
// nextProps.loginStatus
// ) {
// this.getMyMeetingList(1);
// }
// if (nextProps.updateISRefreshMeetingList) {
// const _this = this;
// setTimeout(function() {
// _this.getMyMeetingList(1);
// }, 800);
// }
}
//获取我的会议列表
// getMyMeetingList(pageIndex, param) {
// if (!!this.props.client) {
// const _this = this;
// this.props.client.getMyConfList(
// pageIndex,
// this.state.searchMeetingData.pageSize,
// function(ret) {
// if (ret.result) {
// _this.setState({
// tableList: ret.info
// });
// }
// _this.props.dispatch({
// type: `client/setISRefreshMeetingList`,
// payload: {
// updateISRefreshMeetingList: false
// }
// });
// }
// );
// }
// }
//重新加入会议
// joinMeeting(record) {
// var defaultPsw = "******";
// var confPsw = record.chairmanPasswd;
// if (confPsw == defaultPsw || confPsw == "") {
// confPsw = record.generalPasswd;
// }
// let joinConfParam = {
// conferenceId: record.conferenceID,
// accessNumber: record.accessNumber,
// confPasswd: confPsw
// };
// const _this = this;
// this.props.client.joinConference(joinConfParam, function(ret) {
// if (ret.result) {
// _this.props.dispatch({
// type: `client/setCurrentConferID`,
// payload: {
// currentConferID: record.conferenceID,
// currentConferTopic: record.topic
// }
// });
// }
// });
// }
searchPassward(data, param) {
let text = '-'
if (data.length > 0) {
data.map(item => {
if (item['conferenceRole'] == param) {
text = item['password'] ? item['password'] : '-'
}
})
}
return text
}
// 表格渲染
renderOrderList = () => {
const columns = [
{
title: "会议主题",
dataIndex: "subject",
key: "subject"
},
{
title: "会议开始时间",
dataIndex: "startTime",
key: "startTime",
render: (text, record) => (
{addUTC(text, 'add')}
)
},
{
title: "会议结束时间",
dataIndex: "endTime",
key: "endTime",
render: (text, record) => (
{addUTC(text, 'add')}
)
},
{
title: "会议ID",
dataIndex: "conferenceID",
key: "conferenceID"
},
{
title: "来宾密码",
dataIndex: "generalPasswd",
key: "generalPasswd",
render: (text, record) => (
{
this.searchPassward(record.passwordEntry, 'general')
}
)
},
{
title: "主席密码",
dataIndex: "chairmanPasswd",
key: "chairmanPasswd",
render: (text, record) => (
{
this.searchPassward(record.passwordEntry, 'chair')
}
)
},
{
title: "会议类型",
dataIndex: "mediaTypes",
key: "mediaTypes",
render: (text, record) => (
{text ? text.indexOf('Video') > -1 ? text.indexOf('HDVideo') > -1 ? '高清视频' : '标清视频' : '语音' : '其他类型'}
)
},
{
title: "操作",
key: "action",
render: (text, record) => (
{
this.setState({
visible: true,
clickConferenceID: record.conferenceID
});
}}
>
详情
{/* {
this.joinMeeting(record);
}}
>
加入
*/}
{/* {this.props.currentConferID === record.conferenceID ? (
{
this.props.history.push({
pathname: `/meeting/control`,
state: record
});
}}
>
会议控制
) : (
""
)} */}
)
}
];
const { PageTable, isInit } = this.props;
if (!isInit) return;
return (