import { Pagination, Dialog, Input, Button, Table, Select } from "@alifd/next"; import request from '../../../_server/index.js' import React from "react"; import "./index.less"; const columns = [ { title: "id", dataIndex: "id", width: 100, }, { title: "系统", dataIndex: "sysName", width: 100, }, { title: "业务类型编码", dataIndex: "typeCode", }, { title: "业务类型", dataIndex: "typeName", }, { title: "子类型编码", dataIndex: "code", }, { title: "子类型名称", dataIndex: "name", }, ]; class DatamapLayer extends React.Component{ constructor(props: any) { super(props); this.state = { result: [], pageNum: 1, systemList: [], typeList: [] } this.getSystem() } componentDidMount() { this.onSubmit() } getSystem = () => { request.postUrl("/a/report/enum/getSystem").then((res: any) => { if (res.code === 0) { this.setState({ systemList: res.data, }); return; } }); }; getBusinessType = (id: any) => { request .postUrl("/a/report/enum/getBusinessType", { id, }) .then((res: any) => { if (res.code === 0) { this.setState({ typeList: res.data, }); return; } }); }; handleOk = () => { console.log('出发数据', this.state) this.props.setDatamapDetail(this.state.record); } closeDialog = () => { console.log('关闭') this.props.closeDatamapLayer(); } onSubmit = () => { console.log('提交', this.state) let { sysId, typeId, pageNum, code, name } = this.state; request .postUrl("/a/report/enum/getDataEnumList", { sysId, typeId, name, code, pageSize: 10, pageNum, }) .then((res: any) => { if (res.code === 0) { this.setState({ result: res.data.result, total: res.data.total, }); return; } }); }; onChangeSelect = (e: any, name: string) => { this.setState({ [name]: e, }); if (name === "sysId") { this.getBusinessType(e); } } onChange = (e: any) => { console.log('选中数据', e) if (e && e.target) { this.setState({ [e.target.name]: e.target.value, }); } } render() { let _this = this return (
系统
业务类型
子类型编码
子类型名称
{ this.setState({ pageNum: current }) this.onSubmit() }} >
); } } export { DatamapLayer };