统计分析

master
xialiang 3 years ago
parent fd213010f2
commit 6e3021b588

@ -1,5 +1,5 @@
/** 历次考试成绩统计 */
import { PlusOutlined } from '@ant-design/icons';
import { DownloadOutlined, PlusOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import React, { useState, useRef } from 'react';
@ -31,41 +31,27 @@ const TableList: React.FC = () => {
width: 48,
},
{
title: '生涯课程',
dataIndex: 'name',
title: '考试名称',
dataIndex: 'examination_name',
valueType: 'textarea',
},
{
title: '学习人数',
dataIndex: 'callNo',
title: '报名人数',
dataIndex: 'apply_count',
sorter: true,
hideInForm: true,
renderText: (val: string) => `${val}`,
},
{
title: '学习完成率',
dataIndex: 'callNo',
sorter: true,
hideInForm: true,
renderText: (val: string) => `${val}%`,
},
{
title: '考试报名人数',
dataIndex: 'callNo',
sorter: true,
hideInForm: true,
renderText: (val: string) => `${val}`,
},
{
title: '考试通过人数',
dataIndex: 'callNo',
title: '通过人数',
dataIndex: 'pass_count',
sorter: true,
hideInForm: true,
renderText: (val: string) => `${val}`,
},
{
title: '考试通过率',
dataIndex: 'callNo',
title: '比例',
dataIndex: 'pass_rate',
sorter: true,
hideInForm: true,
renderText: (val: string) => `${val}%`,
@ -82,20 +68,15 @@ const TableList: React.FC = () => {
search={false}
options={false}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleModalVisible(true);
}}
>
<PlusOutlined />
<Button icon={<DownloadOutlined />} type="primary" key="subscribeAlert" href={`/dsideal_yy/zygh/training/statistics/exportExaminationData`}>
</Button>,
]}
request={async (value) => {
const _data = await getExaminationPersonStatistics({ sort_type: 0, sort_colum: 1 });
console.log(value, "value11")
const _data = await getExaminationPersonStatistics({ ...value, current: value.page_number, sort_type: 2, sort_colum: 1 });
return {
data: _data?.list,
data: _data?.table_List,
};
}}
columns={columns}

@ -1,5 +1,5 @@
/** 各市州资质证书统计 */
import { PlusOutlined } from '@ant-design/icons';
import { DownloadOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Col, Row } from 'antd';
import React, { useState, useRef } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
@ -12,71 +12,7 @@ import type { TableListItem, TableListPagination } from '../data';
import type { FormValueType } from '@/pages/ListTableList2/components/UpdateForm2';
import cookie from 'react-cookies';
/**
*
*
* @param fields
*/
const handleAdd = async (fields: TableListItem) => {
const hide = message.loading('正在添加');
try {
await addRule({ ...fields });
hide();
message.success('添加成功');
return true;
} catch (error) {
hide();
message.error('添加失败请重试!');
return false;
}
};
/**
*
*
* @param fields
*/
const handleUpdate = async (fields: FormValueType, currentRow?: TableListItem) => {
const hide = message.loading('正在配置');
try {
await updateRule({
...currentRow,
...fields,
});
hide();
message.success('配置成功');
return true;
} catch (error) {
hide();
message.error('配置失败请重试!');
return false;
}
};
/**
*
*
* @param selectedRows
*/
const handleRemove = async (selectedRows: TableListItem[]) => {
const hide = message.loading('正在删除');
if (!selectedRows) return true;
try {
await removeRule({
key: selectedRows.map((row) => row.key),
});
hide();
message.success('删除成功,即将刷新');
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
const topColResponsiveProps = {
xs: 24,
@ -148,12 +84,11 @@ const TableList: React.FC = () => {
data: _data?.list,
};
}}
toolBarRender={(record) => {
console.log(record, 'a]]')
toolBarRender={() => {
return [
<a key="subscribeAlert" href={`/dsideal_yy/zygh/training/statistics/exportCredentialData?province_id=${cookie.load('background_province_id')}`}>
<Button type="primary" icon={<DownloadOutlined />} key="subscribeAlert" href={`/dsideal_yy/zygh/training/statistics/exportCredentialData?province_id=${cookie.load('background_province_id')}`}>
</a>,
</Button>,
]
}}

@ -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>

@ -53,15 +53,15 @@ export async function getAsyncOrgTree(params: {
/**
*
* /dsideal_yy/admin/new_base/getMainBranchSchool
* /dsideal_yy/ypt/sys/org/getEduUnitList
* @param params
* @returns
*/
export async function getMainBranchSchool(params: {
export async function getEduUnitList(params: {
page_size: number;
//count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('/dsideal_yy/admin/new_base/getMainBranchSchool', {
return request('/dsideal_yy/ypt/sys/org/getEduUnitList', {
params,
});
}
@ -97,11 +97,17 @@ export async function getExaminationPersonStatistics(params: {
}
/*
http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=100025&org_type=1&get_next=1
org_idID 100025org_type1get_next1
/dsideal_yy/ypt/sys/org/getEduUnitList?random_num=277470&area_id=200125116&edu_type=-1&main_school_id=200125116&org_name=&org_type=2&pageNumber=1&pageSize=20&school_type=-1&showPassWord=true
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