生涯考试历史(质考试数据)

master
Administrator 3 years ago
parent 7890ee9dd0
commit 72cb389fa6

@ -5,12 +5,13 @@ import numeral from 'numeral';
import { ChartCard, Field } from './Charts';
import type { DataItem } from '../data.d';
import { getAsyncOrgTree, getEduUnitList } from '../service';
import { getAsyncOrgTree, getEduUnitList,getExaminationStatistics } from '../service';
const { Option } = Select;
import styles from '../style.less';
import ProForm, { ProFormSelect } from '@ant-design/pro-form';
import { useRequest } from 'umi';
import {listMyLearningChapterCourse} from "../../../../../../web/src/pages/course/list/service";
const { RangePicker } = DatePicker;
const topColResponsiveProps = {
@ -28,13 +29,16 @@ const layout = {
wrapperCol: { span: 16 },
};
let city_id=0;
let area_id=0;
let school=0;
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 [options, setOptions] = useState([]);
const [fetching, setFetching] = useState(false);
const fetchRef = useRef(0);
@ -57,6 +61,30 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
});
const {data: examinationData, run } = useRequest(() => {
return getExaminationStatistics({
bureau_id:school,
city_id:city_id,
district_id: area_id,
province_id: provinceId
});
},{
formatResult: (result) => {
if(result.credential_person_count===0||result.apply_person_count===0){
const num=0;
result.num=num;
}else {
const percent=result.credential_person_count/result.apply_person_count;
const num=percent.toFixed(4);
result.num=num;
}
return result;
}
});
// 获取市数据
const { data: cityData, loading: cityLoading } = useRequest(() => {
return getAsyncOrgTree({
@ -66,7 +94,6 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
});
},{
formatResult: (result) => {
console.log('result')
return result;
}
});
@ -75,13 +102,11 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
// eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => {
console.log('cityData', cityData);
setCityList(cityData || []);
}, [cityData]);
const getAreaData = async (e: any) => {
// console.log(e, 'eeeeeeeeeeeee2ee');
const areaData = await getAsyncOrgTree({
org_id: e,
org_type: 2,
@ -89,28 +114,29 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
});
form.setFieldsValue({ area: 0 })
setAreaList(areaData || []);
run()
}
const getSchoolData = async () => {
const 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,
})
retrun [{label:'aaaa', value:'1111'},{label:'aaaa', value:'1111'}]
}
// const getSchoolData = async (e) => {
//
// const 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,
// })
// retrun [{label:'aaaa', value:'1111'},{label:'aaaa', value:'1111'}]
// }
const onFinish = (values: any) => {
console.log(values);
// console.log(values);
};
const onGenderChange = (value: string) => {
@ -122,14 +148,15 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
/**
*
* @param value
* @param value
*/
const handleSearch = async (value: any) => {
if (value >= 'a' && value <= 'z') {
return false;
}
if (value) {
console.log('value::', value)
school=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,
@ -143,10 +170,13 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
school_type: -1,
showPassWord: true,
});
setOptions(table_List);
} else {
setOptions([]);
}
};
return (
@ -157,28 +187,39 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
<Form.Item name="city" label="市" >
<Select
style={{ width: 120 }}
onChange={(id) => { getAreaData(id) }}
defaultValue={0}
onChange={(id) => {
city_id=id;
getAreaData(id)
}}
// defaultValue={provinceId}
>
<Option key={provinceId} value={provinceId}></Option>
<Option key={0} value={0}></Option>
{
cityList.forEach((e) => {
return <Option key={e?.id} value={e?.id}>{e?.name}</Option>
})
cityList.length!==0?
cityList.map((item)=>{
return <Option key={item.id+'city'} value={item.id}>{item.name}</Option>
}):''
}
</Select>
</Form.Item>
<Form.Item name="area" label="区" >
<Select
style={{ width: 120 }}
// defaultValue={0}
onChange={(id) => { getSchoolData(id) }}
defaultValue={0}
onChange={(id) => {
area_id=id;
handleSearch('');
}}
>
<Option key={0} value={0}></Option>
{/* {areaList.map((e, i) => {
return <Option key={e.id} value={e.id}>{e.name}</Option>
})} */}
{
areaList.length!==0?
areaList.map((item)=>{
return <Option key={item.id+'area'} value={item.id}>{item.name}</Option>
}):''
}
</Select>
</Form.Item>
<Form.Item name="school" label="学校">
@ -194,13 +235,32 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
filterOption={false}
// onChange={getSchoolData}
notFoundContent={fetching ? <Spin size="small" /> : null}
fieldNames={{ value: "ORG_ID", label: "ORG_NAME" }}
// fieldNames={{ value: "ORG_ID", label: "ORG_NAME" }}
onSearch={handleSearch}
options={options}
/>
{console.log(schoolList, 'schoolList111')}
allowClear={true}
onClear={()=>{
console.log('清空')
school=0;
run();
}}
onChange={(e)=>{
console.log('e.target.value',e)
if(e!==undefined){
school=e;
run();
}
}}
// options={options}
>
{
options.length!==0?
options.map((item)=>{
return <Option key={item.ORG_ID+'school'} value={item.ORG_ID}>{item.ORG_NAME}</Option>
}):''
}
</Select>
</Form.Item>
<Button></Button>
</Form>
</Col>
</Row>
@ -208,13 +268,13 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
<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}} />
<Statistic title="资质考试数" value={examinationData?examinationData.examination_count:'--'} 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}} />
<Statistic title="累计报名人数" value={examinationData?examinationData.apply_person_count:'--'} 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}} />
<Statistic title="取得证书人数" value={examinationData?examinationData.credential_person_count:'--'} suffix="人" style={{fontSize:16,fontWeight:500}} />
</Col>
</Row>
</Col>
@ -230,7 +290,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
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' }} />
<Progress type="circle" percent={examinationData?.num*100} width={80} strokeWidth={10} style={{ position: 'relative', margin: '15px auto 0 auto' }} />
</ChartCard>
</Col>
</Row>

@ -38,8 +38,8 @@ export async function fakeChartData(): Promise<{ data: AnalysisData }> {
/**
*
* http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426
* @param params
* @returns
* @param params
* @returns
*/
export async function getAsyncOrgTree(params: {
page_size: number;
@ -54,8 +54,8 @@ export async function getAsyncOrgTree(params: {
/**
*
* /dsideal_yy/ypt/sys/org/getEduUnitList
* @param params
* @returns
* @param params
* @returns
*/
export async function getEduUnitList(params: {
page_size: number;
@ -68,8 +68,8 @@ export async function getEduUnitList(params: {
/**
*
* /dsideal_yy/zygh/training/statistics/getCredentialPersonStatistics
* @param params
* @returns
* @param params
* @returns
*/
export async function getCredentialPersonStatistics(params: {
province_id: { province_id: number };
@ -82,8 +82,8 @@ export async function getCredentialPersonStatistics(params: {
/**
*
* /dsideal_yy/zygh/training/statistics/getCredentialPersonStatistics
* @param params
* @returns
* @param params
* @returns
*/
export async function getExaminationPersonStatistics(params: {
page_number: number,
@ -96,7 +96,17 @@ export async function getExaminationPersonStatistics(params: {
});
}
//获取 获取资质考试数据
export async function getExaminationStatistics(params: {
bureau_id: number,
city_id: number,
district_id: number,
province_id: number,
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/zygh/training/statistics/getExaminationStatistics', {
params,
});
}
@ -111,4 +121,4 @@ http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=100025&org_type=1&get_
http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=200265&org_type=2&get_next=1
org_idIDorg_type2get_next1
*/
*/

Loading…
Cancel
Save