/** * @author CYQ * 企业管理--监管设置页面 */ import React from "react"; import { Form, Button, Cascader, Alert, Tabs } from "antd"; import style from "styled-components"; import { getSysPoliceList, saveComRegulatorSet, getComRegulatorSet } from "../../../services/api"; const formItemLayout = { labelCol: { xs: { span: 4 }, sm: { span: 4 }, md: { span: 3 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 }, md: { span: 14 } } }; const FormItem = Form.Item; const { TabPane } = Tabs; @Form.create() export default class OfficeSupervisor extends React.Component { constructor(props, context) { super(props, context); this.state = { regulator: [], info: [] }; } /******************************生命周期******************************/ componentWillMount() { this.__getComRegulatorSet(); this.__getSysPoliceList(); } //获取已经配置过机构的信息 __getComRegulatorSet() { getComRegulatorSet({ regulatorType:'2' }).then(res => { if (res.retType === "0") { this.setState({ info: res.data }); } }); } //获取所有派出所信息 __getSysPoliceList() { getSysPoliceList({ regulatorType:'2' }).then(data => { let regulator = data.data.map(val => { return { value: val.policeId, label: val.policeName, children: val.childList && val.childList.map(valChild => { return { value: valChild.policeId, label: valChild.policeName, children: Object.prototype.toString .call(valChild.childList) .slice(8, -1) == "Array" && valChild.childList.length != 0 && valChild.childList.map(valChildChild => { return { value: valChildChild.policeId, label: valChildChild.policeName }; }) }; }) }; }); this.setState({ regulator: regulator }); }); } /******************************相关事件******************************/ _submit() { this.props.form.validateFields((err, values) => { if (!err) { saveComRegulatorSet({ cityOrgId: values.regulator[0], districtOrgId: values.regulator[1], policeStationId: values.regulator[2], regulatorType:'2' }).then(data => { if (data.retType === "0") { } }); } }); } render() { const { getFieldDecorator } = this.props.form; return (