/**
 * 会议资源管理
 */
import React, { Component } from "react";
import { connect } from "dva";
import { Form, Alert, Row, Col, Tabs, Button } from "antd";
import { getHuaweiManageResource } from "../../../services/api";
const { TabPane } = Tabs;
import "../meeting.less";
import ResourceManage from "./ResourceManage";
// import OrderInquiry from "./OrderInquiry";
@connect(state => ({
  client: state.client.client
}))
@Form.create()
export default class Resource extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = {
      resourceList: [
        {
          title: "会议并发方数",
          usedCount: "0",
          sumCount: "0",
          unit: "方",
          key: "0"
        },
        {
          title: "云会议室（运营VMR专用_25）",
          usedCount: "0",
          sumCount: "0",
          unit: "个",
          key: "1"
        },
        {
          title: "用户账号数",
          usedCount: "0",
          sumCount: "0",
          unit: "个",
          key: "2"
        },
        {
          title: "1080P硬件终端接入数",
          usedCount: "0",
          sumCount: "0",
          unit: "个",
          key: "3"
        },
        {
          title: "720P硬件终端接入数",
          usedCount: "0",
          sumCount: "0",
          unit: "个",
          key: "4"
        },
        {
          title: "第三方硬件终端数",
          usedCount: "0",
          sumCount: "0",
          unit: "个",
          key: "5"
        },
        // {
        //   title: "第三方电子白板接入账号数",
        //   usedCount: "",
        //   sumCount: "",
        //   unit: "个",
        //   key: "6"
        // },
        // {
        //   title: "直播端口数",
        //   usedCount: "",
        //   sumCount: "",
        //   unit: "个",
        //   key: "7"
        // },
        {
          title: "录播空间",
          usedCount: "0",
          sumCount: "0",
          unit: "G",
          key: "6"
        }
      ]
      // keyTab: '1'
    };
  }
  componentWillMount() {
    // if (this.props && this.props.location && this.props.location.state === '2') {
    //   this.setState({
    //     keyTab: '2'
    //   })
    // }
    // this._getHuaweiManageResource();
  }

  // _getHuaweiManageResource() {
  //   getHuaweiManageResource({}).then(res => {
  //     if (res.retType === "0" && !!res.data) {
  //       const resourceList = this.state.resourceList;
  //       resourceList[0].usedCount = res.data.confCallCount.usedCount;
  //       resourceList[0].sumCount = res.data.confCallCount.sumCount;
  //       resourceList[1].usedCount =
  //         res.data.vmr.length > 0 ? res.data.vmr[0].vmrPkgCount : "0";
  //       resourceList[1].sumCount =
  //         res.data.vmr.length > 0 ? res.data.vmr[0].vmrPkgParties : "0";
  //       resourceList[2].usedCount = res.data.teSoftCount.usedCount;
  //       resourceList[2].sumCount = res.data.teSoftCount.sumCount;
  //       resourceList[3].usedCount = res.data.te1080pHardCount.usedCount;
  //       resourceList[3].sumCount = res.data.te1080pHardCount.sumCount;
  //       resourceList[4].usedCount = res.data.te720pHardCount.usedCount;
  //       resourceList[4].sumCount = res.data.te720pHardCount.sumCount;
  //       resourceList[5].usedCount = res.data.thirdPartyHardCount.usedCount;
  //       resourceList[5].sumCount = res.data.thirdPartyHardCount.sumCount;
  //       resourceList[6].usedCount = res.data.recordCapability.usedCount;
  //       resourceList[6].sumCount = res.data.recordCapability.sumCount;

  //       this.setState({
  //         resourceList
  //       });
  //     }
  //   });
  // }
  render() {
    return (
      <div className="meeting">
        <Tabs
          //  defaultActiveKey={this.state.keyTab}
          className="3"
        >
          <TabPane tab="会议资源管理" key="1">
            <ResourceManage />
          </TabPane>
          {/* <TabPane tab="订单查询" key="2">
            <OrderInquiry />
          </TabPane> */}
        </Tabs>
      </div>
    );
  }
}
