import React from 'react';
import ReactDOM from 'react-dom';
import './assets/css/index.less'
import AgileTCEditor from './kityminderEditor';
import { FromChooseItem, ModalTip } from './index'
// import t from './index'
import { Button } from 'antd'
// console.log(t)
// 本地调试DEMO
class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      tab: 1,
    };
  }
  handleClick = (tab, show) => {
    this.setState({ tab });
    setTimeout(() => {
      this.setState({ show });
    }, 100);
  };
  onDel() {
    this.setState({
      tab: 2
    })
  }
  render() {
    const { tab } = this.state;
    let content = null;
    if (tab === 1) {
      // content = <AgileTCEditor />;
      content = <ModalTip
        title = {'删除确认'}
        content = {`删除用例集将会一并删除它的子用例集和用例，是否确定删除？`}
        onClose = {() => {
          // setDelModel(false)
        }}
        onOk = {(e) => this.onDel(e)}
      />
    } else {
      content = <FromChooseItem
        renderFormList={[
          {
            name: '步骤描述',
            colSpan: 24,
            key: 'stepDescription',
            type: 'editor',
            required: true,
            placeholder: '请输入用例操作步骤',
          },
          {
            name: '负责人',
            colSpan: 12,
            key: 'testOwnerList',
            type: 'searchPeople',
            required: true,
            multiple: true,
            placeholder: '请输入负责人',
            options: []
          }
        ]}
        valueData={{}}
        labelWidth={'104px'}
        onChange={(key, value) => console.log(111)}
      />;
    }
    setTimeout(() => {
      this.onDel()
    }, 200)
    return (
      <div>
        <Button onClick={() => this.handleClick(1, false)}>1</Button>
        <Button onClick={() => this.handleClick(2, true)}>2</Button>
        <div style={{width: '900px'}}>{content}</div>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));
