From 8791767833712741a9987628b7255d8eb0c361b3 Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Mon, 14 Feb 2022 08:03:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/pages/history/analysis/service.ts | 79 ++++++++++++++------- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/admin/src/pages/history/analysis/service.ts b/admin/src/pages/history/analysis/service.ts index 6807658..a28fbf0 100644 --- a/admin/src/pages/history/analysis/service.ts +++ b/admin/src/pages/history/analysis/service.ts @@ -5,28 +5,59 @@ export async function fakeChartData(): Promise<{ data: AnalysisData }> { return request('/api/fake_analysis_chart_data'); } -/** 获取规则列表 GET /api/rule */ -export async function rule( - params: { - // query - /** 当前的页码 */ - current?: number; - /** 页面的容量 */ - pageSize?: number; - }, - options?: { [key: string]: any }, -) { - return request<{ - data: TableListItem[]; - /** 列表的内容总数 */ - total?: number; - success?: boolean; - }>('/api/rule', { - method: 'GET', - params: { - ...params, - pageSize: 5 - }, - ...(options || {}), + + +/** 获取考试列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */ +// export async function queryExaminationList( +// params: { +// // query +// /** 当前的页码 */ +// current?: number; +// /** 页面的容量 */ +// pageSize?: number; +// }, +// options?: Record, +// ) { +// return request<{ +// data: TableListItem[]; +// /** 列表的内容总数 */ +// total_row?: number; +// /** 页面的容量 */ +// page_size?: number; +// success?: boolean; +// }>('/dsideal_yy/zygh/training/examination/getExaminationList', { +// method: 'GET', +// params: { +// ...params, +// }, +// ...(options || {}), +// }); +// } + + +/** + * 获取主题列表 + * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426 + * @param params + * @returns + */ +export async function getAsyncOrgTree(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('dsideal_yy/org/getAsyncOrgTree', { + params, }); -} \ No newline at end of file +} + + + +/* +获取云南省所有市列表: +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) + +获取市区下的区列表: +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) +*/ \ No newline at end of file From d109f20e8f2208d58c16c5a3a564f157be01447b Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Mon, 14 Feb 2022 08:03:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/components/IntroduceRow.tsx | 217 +++++++++++------- admin/src/pages/history/analysis/index.tsx | 2 +- 2 files changed, 140 insertions(+), 79 deletions(-) diff --git a/admin/src/pages/history/analysis/components/IntroduceRow.tsx b/admin/src/pages/history/analysis/components/IntroduceRow.tsx index 9d36b27..d7885d8 100644 --- a/admin/src/pages/history/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/history/analysis/components/IntroduceRow.tsx @@ -1,94 +1,157 @@ -import { InfoCircleOutlined } from '@ant-design/icons'; +import { useEffect, useRef, useState } from 'react'; import { TinyArea, TinyColumn } from '@ant-design/charts'; -import { Card, Col, Progress, Row, Tabs, DatePicker } from 'antd'; - +import { Card, Col, Progress, Row, Tabs, DatePicker, Select, Form, Statistic } from 'antd'; import numeral from 'numeral'; import { ChartCard, Field } from './Charts'; import type { DataItem } from '../data.d'; -import Trend from './Trend'; -import Yuan from '../utils/Yuan'; + +import { getAsyncOrgTree } from '../service'; +const { Option } = Select; + import styles from '../style.less'; +import ProForm, { ProFormSelect } from '@ant-design/pro-form'; const { RangePicker } = DatePicker; const topColResponsiveProps = { xs: 24, - sm: 12, - md: 12, - lg: 12, - xl: 12, + sm: 4, + md: 4, + lg: 4, + xl: 4, + 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 }, +}; + + + + +const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => { + const [cityList, setCityList] = useState([]); + const [areaList, setAreaList] = useState([]); + const [form] = Form.useForm(); + // eslint-disable-next-line react-hooks/exhaustive-deps + useEffect(() => { + setCityList(cityData || []); + }, []); + + + const getAreaData = async (e) => { + // console.log(e, 'eeeeeeeeeeeee2ee'); + const areaData = await getAsyncOrgTree({ + org_id: e, + org_type: 2, + get_next: 1 + }); + form.setFieldsValue({ area: "" }) + // console.log(form.setFieldsValue({ area: "" }), 'form'); + + setAreaList(areaData || []); + + } + + const getSchoolData = async (e) => { + + } + -const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: DataItem[] }) => ( + const onFinish = (values: any) => { + console.log(values); + }; + const onGenderChange = (value: string) => { + // const options = this.state.data.map(d => ); - -
- + + }; + return ( + +
+
- {/* selectDate('today')}> - 今日 - - selectDate('week')}> - 本周 - - selectDate('month')}> - 本月 - - selectDate('year')}> - 本年 - */} + + +
+ + + + + + + + + + + + + + + + + + + + + +
- +
- } - size="large" - tabBarStyle={{ marginBottom: 24 }} - > - - - - + + } + size="large" + tabBarStyle={{ marginBottom: 24 }} + /> +
+ + + + - - - - + + - - - - + + - - - -
+ + ) -); +}; export default IntroduceRow; diff --git a/admin/src/pages/history/analysis/index.tsx b/admin/src/pages/history/analysis/index.tsx index 37a3eb5..22f9b26 100644 --- a/admin/src/pages/history/analysis/index.tsx +++ b/admin/src/pages/history/analysis/index.tsx @@ -129,7 +129,7 @@ const Analysis: FC = () => { - + ); From aebec36f1c9ba31c4bc2782bfe9a9c763ead219a Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Mon, 14 Feb 2022 11:39:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=B6=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/config/config.ts | 7 ++ .../pages/examination/certificate/index.tsx | 14 ++- .../{index copy.tsx => person.tsx} | 100 +++++++++++++++--- admin/src/pages/examination/service.ts | 47 ++++++++ .../analysis/components/IntroduceRow.tsx | 8 +- .../history/analysis/components/TrainCard.tsx | 13 +-- admin/src/pages/history/analysis/service.ts | 17 ++- 7 files changed, 175 insertions(+), 31 deletions(-) rename admin/src/pages/examination/certificate/{index copy.tsx => person.tsx} (80%) diff --git a/admin/config/config.ts b/admin/config/config.ts index 15c9f95..1295306 100644 --- a/admin/config/config.ts +++ b/admin/config/config.ts @@ -208,6 +208,13 @@ export default defineConfig({ path: '/examination/certificate', component: './examination/certificate', }, + { + name: '制证名单', + icon: 'smile', + hideInMenu: true, + path: '/examination/certificate/person/:id', + component: './examination/certificate/person', + }, ], }, { diff --git a/admin/src/pages/examination/certificate/index.tsx b/admin/src/pages/examination/certificate/index.tsx index 90e9f21..a083766 100644 --- a/admin/src/pages/examination/certificate/index.tsx +++ b/admin/src/pages/examination/certificate/index.tsx @@ -1,5 +1,5 @@ import React, { useState, useRef } from 'react'; -import { useRequest } from 'umi'; +import { useRequest, history } from 'umi'; import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Select } from 'antd'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; @@ -184,7 +184,7 @@ const CourseList: React.FC = () => { if (status !== 'open') { return ( // value 和 onchange 会通过 form 自动注入。 - @@ -215,8 +215,8 @@ const CourseList: React.FC = () => { { - handleUpdateModalVisible(true); - setCurrentRow(record); + history.push('/examination/certificate/person/' + record.examination_id) + }} > 查看名单 @@ -256,7 +256,11 @@ const CourseList: React.FC = () => { value.start_time = create_time[0] value.end_time = create_time[1] } - const _data = await queryCertificateList(); + const _data = await queryCertificateList({ + ...value, + page_number: value.current, + page_size: value.pageSize + }); return { current: _data?.pageNumber, diff --git a/admin/src/pages/examination/certificate/index copy.tsx b/admin/src/pages/examination/certificate/person.tsx similarity index 80% rename from admin/src/pages/examination/certificate/index copy.tsx rename to admin/src/pages/examination/certificate/person.tsx index a87a405..e22b3a2 100644 --- a/admin/src/pages/examination/certificate/index copy.tsx +++ b/admin/src/pages/examination/certificate/person.tsx @@ -10,7 +10,7 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import ProDescriptions from '@ant-design/pro-descriptions'; import type { FormValueType } from './components/UpdateForm'; import UpdateForm from './components/UpdateForm'; -import { saveCertificate, removeCertificate, queryCertificateList } from '../service'; +import { saveCertificate, getExaminationPersonApplyList, getAsyncOrgTree } from '../service'; import type { TableListItem, TableListPagination } from '../data'; import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud'; @@ -106,7 +106,66 @@ const CourseList: React.FC = () => { valueType: 'text', hideInTable: false, hideInForm: false, + hideInSearch: true, + }, + { + title: '市', + dataIndex: 'city_id', + valueType: 'select', + hideInTable: false, + hideInForm: false, hideInSearch: false, + request: async () => { + const data = await getAsyncOrgTree({ + org_id: 100025, + org_type: 1, + get_next: 1 + }).then(); + const option = [] + + data?.map((e, i) => { + console.log(e, i); + + option.push({ label: e.name, value: e.id }) + }) + console.log('city:', data); + + // for (let i = 0; i < Items.length; i++) { + // tags.push({ label: Items[i].tag_name, value: Items[i].tag_id }) + // } + return option; + }, + }, + { + title: '区', + dataIndex: 'district_id', + valueType: 'select', + hideInTable: false, + hideInForm: false, + hideInSearch: false, + dependencies: ['city_id'], + request: async (params) => { + console.log(params, 'params::::'); + + const data = await getAsyncOrgTree({ + org_id: params.city_id, + org_type: 2, + get_next: 1 + }).then(); + const option = [] + + data?.map((e, i) => { + console.log(e, i); + + option.push({ label: e.name, value: e.id }) + }) + console.log('area:', data); + + // for (let i = 0; i < Items.length; i++) { + // tags.push({ label: Items[i].tag_name, value: Items[i].tag_id }) + // } + return option; + }, }, { title: '创建日期', @@ -259,20 +318,24 @@ const CourseList: React.FC = () => { // , // ]} request={async (value) => { - console.log(value, 'form value') - const { create_time } = value; - if (create_time) { - value.start_time = create_time[0] - value.end_time = create_time[1] - } - const _data = await queryCertificateList(); + // console.log(value, 'form value') + // const { create_time } = value; + // if (create_time) { + // value.start_time = create_time[0] + // value.end_time = create_time[1] + // } + // const _data = await getExaminationPersonApplyList({ + // ...value, + // page_number: value.current, + // page_size: value.pageSize + // }); - return { - current: _data?.pageNumber, - data: _data?.table_List, - pageSize: _data?.pageSize, - total: _data?.totalRow || 0, - }; + // return { + // current: _data?.pageNumber, + // data: _data?.table_List, + // pageSize: _data?.pageSize, + // total: _data?.totalRow || 0, + // }; }} // dataSource={list} columns={columns} @@ -350,9 +413,18 @@ const CourseList: React.FC = () => { > layout="horizontal" + // form={schemaForm} layoutType="Form" labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} + // onValuesChange={(values: any) => { + // console.log('values:', values); + // const { city_id } = values + // if (city_id) { + // schemaForm.setFieldsValue({ district_id: "" }) + // } + // }} + onFinish={async (values: any) => { // 表单处理 console.log('columns:', columns); diff --git a/admin/src/pages/examination/service.ts b/admin/src/pages/examination/service.ts index db0f983..8a5f0c3 100644 --- a/admin/src/pages/examination/service.ts +++ b/admin/src/pages/examination/service.ts @@ -168,4 +168,51 @@ export async function queryRulesList( }, ...(options || {}), }); +} + + +/** 获取考试规则列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */ +export async function getExaminationPersonApplyList( + params: { + /** 当前的页码 */ + current?: number; + /** 页面的容量 */ + pageSize?: number; + rules_type?: number, + subject_id?: number, + }, + options?: Record, +) { + return request<{ + data: TableListItem[]; + /** 列表的内容总数 */ + total_row?: number; + /** 页面的容量 */ + page_size?: number; + success?: boolean; + }>('/dsideal_yy/zygh/training/person/getExaminationPersonApplyList', { + method: 'GET', + params: { + ...params, + + }, + ...(options || {}), + }); +} + + + +/** + * 获取省市区 + * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426 + * @param params + * @returns + */ +export async function getAsyncOrgTree(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('dsideal_yy/org/getAsyncOrgTree', { + params, + }); } \ No newline at end of file diff --git a/admin/src/pages/history/analysis/components/IntroduceRow.tsx b/admin/src/pages/history/analysis/components/IntroduceRow.tsx index d7885d8..434504b 100644 --- a/admin/src/pages/history/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/history/analysis/components/IntroduceRow.tsx @@ -5,7 +5,7 @@ import numeral from 'numeral'; import { ChartCard, Field } from './Charts'; import type { DataItem } from '../data.d'; -import { getAsyncOrgTree } from '../service'; +import { getAsyncOrgTree, getMainBranchSchool } from '../service'; const { Option } = Select; import styles from '../style.less'; @@ -58,6 +58,12 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat } const getSchoolData = async (e) => { + // const areaData = await getAsyncOrgTree({ + // org_id: e, + // org_type: 2, + // get_next: 1 + // }); + console.log(areaData); } diff --git a/admin/src/pages/history/analysis/components/TrainCard.tsx b/admin/src/pages/history/analysis/components/TrainCard.tsx index 082869c..3569e71 100644 --- a/admin/src/pages/history/analysis/components/TrainCard.tsx +++ b/admin/src/pages/history/analysis/components/TrainCard.tsx @@ -13,13 +13,6 @@ export type TimeType = 'today' | 'week' | 'month' | 'year'; const { RangePicker } = DatePicker; const { TabPane } = Tabs; -const rankingListData: { title: string; total: number }[] = []; -for (let i = 0; i < 7; i += 1) { - rankingListData.push({ - title: `工专路 ${i} 号店`, - total: 323234, - }); -} const SalesCard = ({ rangePickerValue, @@ -36,7 +29,7 @@ const SalesCard = ({ handleRangePickerChange: (dates: RangePickerValue, dateStrings: [string, string]) => void; selectDate: (key: TimeType) => void; }) => ( - +
- + - +
diff --git a/admin/src/pages/history/analysis/service.ts b/admin/src/pages/history/analysis/service.ts index a28fbf0..f07cf0f 100644 --- a/admin/src/pages/history/analysis/service.ts +++ b/admin/src/pages/history/analysis/service.ts @@ -36,7 +36,7 @@ export async function fakeChartData(): Promise<{ data: AnalysisData }> { /** - * 获取主题列表 + * 获取省市区 * http://10.10.14.252:8080/workspace/myWorkspace.do?projectId=382#6426 * @param params * @returns @@ -51,6 +51,21 @@ export async function getAsyncOrgTree(params: { } +/** + * 获取学校列表 + * /dsideal_yy/admin/new_base/getMainBranchSchool + * @param params + * @returns + */ +export async function getMainBranchSchool(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/admin/new_base/getMainBranchSchool', { + params, + }); +} + /* 获取云南省所有市列表: