From 6e3021b5887d72dfe7bc804847dd87e1efe608f7 Mon Sep 17 00:00:00 2001
From: xialiang <1818147@qq.com>
Date: Fri, 18 Feb 2022 16:24:41 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=88=86=E6=9E=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../analysis/components/AchievementRow.tsx | 47 +++----
.../analysis/components/CertificateRow.tsx | 73 +----------
.../analysis/components/IntroduceRow.tsx | 117 +++++++++++++-----
admin/src/pages/history/analysis/service.ts | 12 +-
4 files changed, 115 insertions(+), 134 deletions(-)
diff --git a/admin/src/pages/history/analysis/components/AchievementRow.tsx b/admin/src/pages/history/analysis/components/AchievementRow.tsx
index 5761c77..de97dbd 100644
--- a/admin/src/pages/history/analysis/components/AchievementRow.tsx
+++ b/admin/src/pages/history/analysis/components/AchievementRow.tsx
@@ -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={() => [
- ,
]}
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}
diff --git a/admin/src/pages/history/analysis/components/CertificateRow.tsx b/admin/src/pages/history/analysis/components/CertificateRow.tsx
index 58f11a3..f05b242 100644
--- a/admin/src/pages/history/analysis/components/CertificateRow.tsx
+++ b/admin/src/pages/history/analysis/components/CertificateRow.tsx
@@ -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 [
-
+ } key="subscribeAlert" href={`/dsideal_yy/zygh/training/statistics/exportCredentialData?province_id=${cookie.load('background_province_id')}`}>
导出名单
- ,
+ ,
]
}}
diff --git a/admin/src/pages/history/analysis/components/IntroduceRow.tsx b/admin/src/pages/history/analysis/components/IntroduceRow.tsx
index 35fcbba..a6b5e55 100644
--- a/admin/src/pages/history/analysis/components/IntroduceRow.tsx
+++ b/admin/src/pages/history/analysis/components/IntroduceRow.tsx
@@ -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
@@ -107,12 +160,14 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
@@ -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} */}
-
-
+ options={schoolList}
+
+ />
+ {console.log(schoolList, 'schoolList')}
+
+ 确定
diff --git a/admin/src/pages/history/analysis/service.ts b/admin/src/pages/history/analysis/service.ts
index efb5cc6..41ded79 100644
--- a/admin/src/pages/history/analysis/service.ts
+++ b/admin/src/pages/history/analysis/service.ts
@@ -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_id(云南省ID 100025),org_type(默认传1),get_next(默认传1)
+/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_id(市ID),org_type(默认传2),get_next(默认传1)