|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
|
|
import { TinyArea, TinyColumn } from '@ant-design/charts';
|
|
|
|
|
import { Card, Col, Progress, Row, Tabs, DatePicker, Select, Form, Statistic, Button } from 'antd';
|
|
|
|
|
import { Card, Col, Progress, Row, Tabs, DatePicker, Select, Form, Statistic, Button, Spin, Space } from 'antd';
|
|
|
|
|
import numeral from 'numeral';
|
|
|
|
|
import { ChartCard, Field } from './Charts';
|
|
|
|
|
import type { DataItem } from '../data.d';
|
|
|
|
@ -12,6 +12,7 @@ import styles from '../style.less';
|
|
|
|
|
import ProForm, { ProFormSelect } from '@ant-design/pro-form';
|
|
|
|
|
import { useRequest } from 'umi';
|
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
|
|
|
|
|
|
const topColResponsiveProps = {
|
|
|
|
|
xs: 24,
|
|
|
|
|
sm: 4,
|
|
|
|
@ -27,9 +28,6 @@ const layout = {
|
|
|
|
|
wrapperCol: { span: 16 },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => {
|
|
|
|
|
const [provinceId, setProvinceId] = useState("100007")
|
|
|
|
|
const [cityList, setCityList] = useState([]);
|
|
|
|
@ -37,6 +35,10 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
|
|
|
|
|
const [schoolList, setSchoolList] = useState([]);
|
|
|
|
|
|
|
|
|
|
const [options, setOptions] = useState([]);
|
|
|
|
|
const [fetching, setFetching] = useState(false);
|
|
|
|
|
const fetchRef = useRef(0);
|
|
|
|
|
|
|
|
|
|
const { loading: courseBrowseTimesLoading, data: eduUnitList = null } = useRequest(() => getEduUnitList({
|
|
|
|
|
random_num: 277470,
|
|
|
|
|
area_id: provinceId,
|
|
|
|
@ -55,31 +57,30 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
useEffect(async () => {
|
|
|
|
|
const cityData = await getAsyncOrgTree({
|
|
|
|
|
// 获取市数据
|
|
|
|
|
const { data: cityData, loading: cityLoading } = useRequest(() => {
|
|
|
|
|
return getAsyncOrgTree({
|
|
|
|
|
org_id: provinceId,
|
|
|
|
|
org_type: 1,
|
|
|
|
|
get_next: 1
|
|
|
|
|
});
|
|
|
|
|
setCityList(cityData || []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},{
|
|
|
|
|
formatResult: (result) => {
|
|
|
|
|
console.log('result')
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
|
|
|
|
}, []);
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
console.log('cityData', cityData);
|
|
|
|
|
setCityList(cityData || []);
|
|
|
|
|
}, [cityData]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getAreaData = async (e) => {
|
|
|
|
|
const getAreaData = async (e: any) => {
|
|
|
|
|
// console.log(e, 'eeeeeeeeeeeee2ee');
|
|
|
|
|
const areaData = await getAsyncOrgTree({
|
|
|
|
|
org_id: e,
|
|
|
|
@ -88,17 +89,11 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
});
|
|
|
|
|
form.setFieldsValue({ area: 0 })
|
|
|
|
|
setAreaList(areaData || []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
let timeout: NodeJS.Timeout | null;
|
|
|
|
|
|
|
|
|
|
const getSchoolData = async (e, callback) => {
|
|
|
|
|
const getSchoolData = async () => {
|
|
|
|
|
|
|
|
|
|
// timeout = setTimeout(async () => {
|
|
|
|
|
try {
|
|
|
|
|
schoolData = await getEduUnitList({
|
|
|
|
|
const schoolData = await getEduUnitList({
|
|
|
|
|
random_num: 277470,
|
|
|
|
|
area_id: provinceId,
|
|
|
|
|
edu_type: -1,
|
|
|
|
@ -109,21 +104,8 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
pageSize: 1000,
|
|
|
|
|
school_type: -1,
|
|
|
|
|
showPassWord: true,
|
|
|
|
|
}).then((e) => {
|
|
|
|
|
callback(e.table_List)
|
|
|
|
|
console.log(e.table_List);
|
|
|
|
|
setSchoolList(e.table_List || [])
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// error.message; // "Oops!"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// }, 500);
|
|
|
|
|
|
|
|
|
|
// console.log(schoolList, 'schoolList 1');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
retrun [{label:'aaaa', value:'1111'},{label:'aaaa', value:'1111'}]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -137,105 +119,116 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
<Card loading={loading} bordered={false} bodyStyle={{ padding: 0, marginBottom: '24px' }}>
|
|
|
|
|
<div className={styles.salesCard}>
|
|
|
|
|
<Tabs
|
|
|
|
|
tabBarExtraContent={<div className={styles.salesExtraWrap}>
|
|
|
|
|
<div className={styles.salesExtra}>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 学校下拉搜索
|
|
|
|
|
* @param value
|
|
|
|
|
*/
|
|
|
|
|
const handleSearch = async (value: any) => {
|
|
|
|
|
if (value >= 'a' && value <= 'z') {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (value) {
|
|
|
|
|
console.log('value::', value)
|
|
|
|
|
// setOptions([{ORG_NAME:"aaa", ORG_ID:"111"},{ORG_NAME:"aab", ORG_ID:"112"}])
|
|
|
|
|
const { table_List } = await getEduUnitList({
|
|
|
|
|
random_num: 277470,
|
|
|
|
|
area_id: provinceId,
|
|
|
|
|
edu_type: -1,
|
|
|
|
|
// main_school_id: 200125116,
|
|
|
|
|
org_name: value,
|
|
|
|
|
org_type: 2,
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 1000,
|
|
|
|
|
school_type: -1,
|
|
|
|
|
showPassWord: true,
|
|
|
|
|
});
|
|
|
|
|
setOptions(table_List);
|
|
|
|
|
} else {
|
|
|
|
|
setOptions([]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
<Form {...layout} form={form} name="control-hooks" onFinish={onFinish}>
|
|
|
|
|
|
|
|
|
|
<Form.Item name="city" label="市" style={{ float: "left" }}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
onChange={(id) => { getAreaData(id) }}
|
|
|
|
|
// defaultValue={provinceId}
|
|
|
|
|
>
|
|
|
|
|
<Option key={provinceId} value={provinceId}>全部</Option>
|
|
|
|
|
{/* {cityList.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
return <Option key={e.id} value={e.id}>{e.name}</Option>
|
|
|
|
|
})} */}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item name="area" label="区" style={{ float: "left" }}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
// defaultValue={0}
|
|
|
|
|
onChange={(id) => { getSchoolData(id) }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={0} value={0}>全部</Option>
|
|
|
|
|
{/* {areaList.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
return <Option key={e.id} value={e.id}>{e.name}</Option>
|
|
|
|
|
})} */}
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item name="school" label="学校">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
showSearch
|
|
|
|
|
style={{ width: 220 }}
|
|
|
|
|
// value={this.state.value}
|
|
|
|
|
// placeholder={this.props.placeholder}
|
|
|
|
|
// style={this.props.style}
|
|
|
|
|
// defaultActiveFirstOption={true}
|
|
|
|
|
showArrow={true}
|
|
|
|
|
filterOption={true}
|
|
|
|
|
// onSearch={this.handleSearch}
|
|
|
|
|
// onChange={getSchoolData}
|
|
|
|
|
fieldNames={{ value: "ORG_ID", label: "ORG_NAME" }}
|
|
|
|
|
onSearch={(value) => getSchoolData(value)}
|
|
|
|
|
notFoundContent={null}
|
|
|
|
|
options={schoolList}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
{console.log(schoolList, 'schoolList111')}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Button>确定</Button>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
size="large"
|
|
|
|
|
tabBarStyle={{ marginBottom: 24 }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Row />
|
|
|
|
|
return (
|
|
|
|
|
<Card loading={loading} bordered={false} bodyStyle={{ padding: 0, marginBottom: '24px' }}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col {...topColResponsiveProps}>
|
|
|
|
|
<Statistic title="资质考试数" value={93} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col {...topColResponsiveProps}>
|
|
|
|
|
<Statistic title="累计报名人数" value={93} suffix="人" />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col {...topColResponsiveProps}>
|
|
|
|
|
<Statistic title="取得证书人数" value={93} suffix="人" />
|
|
|
|
|
<Col>
|
|
|
|
|
<Form form={form} name="control-hooks" onFinish={onFinish} layout='inline' style={{padding:'24px 24px 0px 24px'}}>
|
|
|
|
|
<Form.Item name="city" label="市" >
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
onChange={(id) => { getAreaData(id) }}
|
|
|
|
|
// defaultValue={provinceId}
|
|
|
|
|
>
|
|
|
|
|
<Option key={provinceId} value={provinceId}>全部</Option>
|
|
|
|
|
{
|
|
|
|
|
cityList.forEach((e) => {
|
|
|
|
|
return <Option key={e?.id} value={e?.id}>{e?.name}</Option>
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="area" label="区" >
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 120 }}
|
|
|
|
|
// defaultValue={0}
|
|
|
|
|
onChange={(id) => { getSchoolData(id) }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={0} value={0}>全部</Option>
|
|
|
|
|
{/* {areaList.map((e, i) => {
|
|
|
|
|
|
|
|
|
|
return <Option key={e.id} value={e.id}>{e.name}</Option>
|
|
|
|
|
})} */}
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="school" label="学校">
|
|
|
|
|
<Select
|
|
|
|
|
showSearch
|
|
|
|
|
style={{ width: 220 }}
|
|
|
|
|
// value={this.state.value}
|
|
|
|
|
// placeholder={this.props.placeholder}
|
|
|
|
|
// style={this.props.style}
|
|
|
|
|
// defaultActiveFirstOption={true}
|
|
|
|
|
defaultActiveFirstOption={false}
|
|
|
|
|
showArrow={true}
|
|
|
|
|
filterOption={false}
|
|
|
|
|
// onChange={getSchoolData}
|
|
|
|
|
notFoundContent={fetching ? <Spin size="small" /> : null}
|
|
|
|
|
fieldNames={{ value: "ORG_ID", label: "ORG_NAME" }}
|
|
|
|
|
onSearch={handleSearch}
|
|
|
|
|
options={options}
|
|
|
|
|
/>
|
|
|
|
|
{console.log(schoolList, 'schoolList111')}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Button>确定</Button>
|
|
|
|
|
</Form>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={[24, 0]} style={{padding:'0 24px 10px 24px'}}>
|
|
|
|
|
<Col xs={14} sm={14} md={14} lg={14} xl={14} style={{padding:12}}>
|
|
|
|
|
<Row gutter={24} style={{padding:12, border:'solid 1px #f0f0f0', height:'100%'}} >
|
|
|
|
|
<Col xs={8} sm={8} md={8} lg={8} xl={8}>
|
|
|
|
|
<Statistic title="资质考试数" value={93} suffix="次" style={{fontSize:16,fontWeight:500}} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={8} sm={8} md={8} lg={8} xl={8}>
|
|
|
|
|
<Statistic title="累计报名人数" value={93} suffix="人" style={{fontSize:16,fontWeight:500}} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={8} sm={8} md={8} lg={8} xl={8}>
|
|
|
|
|
<Statistic title="取得证书人数" value={93} suffix="人" style={{fontSize:16,fontWeight:500}} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col {...topColResponsiveProps}>
|
|
|
|
|
<Col xs={10} sm={10} md={10} lg={10} xl={10} style={{padding:12}}>
|
|
|
|
|
<ChartCard
|
|
|
|
|
bordered={false}
|
|
|
|
|
loading={loading}
|
|
|
|
|
title={`通过率`}
|
|
|
|
|
title={<span style={{fontSize:16,fontWeight:500}}>通过率</span>}
|
|
|
|
|
action={false}
|
|
|
|
|
// total={`${numeral(6560).format('0,0')}`}
|
|
|
|
|
footer={false}
|
|
|
|
|
contentHeight={92}
|
|
|
|
|
style={{ textAlign: 'center', marginBottom: 0 }}
|
|
|
|
|
style={{ textAlign: 'center', marginBottom: 0 , padding:12, border:'solid 1px #f0f0f0'}}
|
|
|
|
|
bodyStyle={{padding:0}}
|
|
|
|
|
>
|
|
|
|
|
<Progress type="circle" percent={75} width={80} strokeWidth={10} style={{ position: 'relative', margin: '15px auto 0 auto' }} />
|
|
|
|
|
</ChartCard>
|
|
|
|
|