|
|
|
@ -1,15 +1,16 @@
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import { TinyArea, TinyColumn } from '@ant-design/charts';
|
|
|
|
|
import { Card, Col, Progress, Row, Tabs, DatePicker, Select, Form, Statistic } from 'antd';
|
|
|
|
|
import { Card, Col, Progress, Row, Tabs, DatePicker, Select, Form, Statistic, Button } from 'antd';
|
|
|
|
|
import numeral from 'numeral';
|
|
|
|
|
import { ChartCard, Field } from './Charts';
|
|
|
|
|
import type { DataItem } from '../data.d';
|
|
|
|
|
|
|
|
|
|
import { getAsyncOrgTree, getMainBranchSchool } from '../service';
|
|
|
|
|
import { getAsyncOrgTree, getEduUnitList } from '../service';
|
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
|
|
|
|
import styles from '../style.less';
|
|
|
|
|
import ProForm, { ProFormSelect } from '@ant-design/pro-form';
|
|
|
|
|
import { useRequest } from 'umi';
|
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
|
const topColResponsiveProps = {
|
|
|
|
|
xs: 24,
|
|
|
|
@ -20,11 +21,7 @@ const topColResponsiveProps = {
|
|
|
|
|
offset: 1,
|
|
|
|
|
style: { marginBottom: 24 },
|
|
|
|
|
};
|
|
|
|
|
const cityData = await getAsyncOrgTree({
|
|
|
|
|
org_id: 100025,
|
|
|
|
|
org_type: 1,
|
|
|
|
|
get_next: 1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const layout = {
|
|
|
|
|
labelCol: { span: 8 },
|
|
|
|
|
wrapperCol: { span: 16 },
|
|
|
|
@ -34,12 +31,51 @@ const layout = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => {
|
|
|
|
|
const [provinceId, setProvinceId] = useState("100007")
|
|
|
|
|
const [cityList, setCityList] = useState([]);
|
|
|
|
|
const [areaList, setAreaList] = useState([]);
|
|
|
|
|
|
|
|
|
|
const [schoolList, setSchoolList] = useState([]);
|
|
|
|
|
|
|
|
|
|
const { loading: courseBrowseTimesLoading, data: eduUnitList = null } = useRequest(() => getEduUnitList({
|
|
|
|
|
random_num: 277470,
|
|
|
|
|
area_id: provinceId,
|
|
|
|
|
edu_type: -1,
|
|
|
|
|
// main_school_id: 200125116,
|
|
|
|
|
// org_name:"",
|
|
|
|
|
org_type: 2,
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 1000,
|
|
|
|
|
school_type: -1,
|
|
|
|
|
showPassWord: true,
|
|
|
|
|
}), {
|
|
|
|
|
formatResult: (result) => {
|
|
|
|
|
return result.table_List;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
useEffect(async () => {
|
|
|
|
|
const cityData = await getAsyncOrgTree({
|
|
|
|
|
org_id: provinceId,
|
|
|
|
|
org_type: 1,
|
|
|
|
|
get_next: 1
|
|
|
|
|
});
|
|
|
|
|
setCityList(cityData || []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -50,20 +86,35 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
org_type: 2,
|
|
|
|
|
get_next: 1
|
|
|
|
|
});
|
|
|
|
|
form.setFieldsValue({ area: "" })
|
|
|
|
|
// console.log(form.setFieldsValue({ area: "" }), 'form');
|
|
|
|
|
|
|
|
|
|
form.setFieldsValue({ area: 0 })
|
|
|
|
|
setAreaList(areaData || []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getSchoolData = async (e) => {
|
|
|
|
|
// const areaData = await getAsyncOrgTree({
|
|
|
|
|
// org_id: e,
|
|
|
|
|
// org_type: 2,
|
|
|
|
|
// get_next: 1
|
|
|
|
|
// });
|
|
|
|
|
console.log(e);
|
|
|
|
|
console.log(e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(form.getFieldsValue('school'), 'school')
|
|
|
|
|
// try {
|
|
|
|
|
// schoolData = await getEduUnitList({
|
|
|
|
|
// random_num: 277470,
|
|
|
|
|
// area_id: provinceId,
|
|
|
|
|
// edu_type: -1,
|
|
|
|
|
// // main_school_id: 200125116,
|
|
|
|
|
// org_name: e,
|
|
|
|
|
// org_type: 2,
|
|
|
|
|
// pageNumber: 1,
|
|
|
|
|
// pageSize: 1000,
|
|
|
|
|
// school_type: -1,
|
|
|
|
|
// showPassWord: true,
|
|
|
|
|
// }).then();
|
|
|
|
|
// setSchoolList(schoolData || [])
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// // error.message; // "Oops!"
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -94,11 +145,13 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
onChange={(id) => { getAreaData(id) }}
|
|
|
|
|
// defaultValue={provinceId}
|
|
|
|
|
>
|
|
|
|
|
{cityList.map((e, i) => {
|
|
|
|
|
<Option key={provinceId} value={provinceId}>全部</Option>
|
|
|
|
|
{/* {cityList.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
return <Option key={e.id} value={e.id}>{e.name}</Option>
|
|
|
|
|
})}
|
|
|
|
|
})} */}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
@ -107,12 +160,14 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
// defaultValue={0}
|
|
|
|
|
onChange={(id) => { getSchoolData(id) }}
|
|
|
|
|
>
|
|
|
|
|
{areaList.map((e, i) => {
|
|
|
|
|
<Option key={0} value={0}>全部</Option>
|
|
|
|
|
{/* {areaList.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
return <Option key={e.id} value={e.id}>{e.name}</Option>
|
|
|
|
|
})}
|
|
|
|
|
})} */}
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
@ -126,18 +181,22 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
// value={this.state.value}
|
|
|
|
|
// placeholder={this.props.placeholder}
|
|
|
|
|
// style={this.props.style}
|
|
|
|
|
defaultActiveFirstOption={false}
|
|
|
|
|
showArrow={false}
|
|
|
|
|
filterOption={false}
|
|
|
|
|
// defaultActiveFirstOption={true}
|
|
|
|
|
showArrow={true}
|
|
|
|
|
filterOption={true}
|
|
|
|
|
// onSearch={this.handleSearch}
|
|
|
|
|
// onChange={this.handleChange}
|
|
|
|
|
// onChange={getSchoolData}
|
|
|
|
|
|
|
|
|
|
onSearch={(value) => getSchoolData(value)}
|
|
|
|
|
notFoundContent={null}
|
|
|
|
|
>
|
|
|
|
|
{/* {options} */}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
options={schoolList}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
{console.log(schoolList, 'schoolList')}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Button>确定</Button>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|