zhengpengju 3 years ago
commit 95e9408ff9

@ -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',
},
],
},
{

@ -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 自动注入。
<Select defaultValue="0" >
<Select defaultValue="" allowClear={true} >
<Option value="0"></Option>
<Option value="1"></Option>
<Option value="2"></Option>
@ -215,8 +215,8 @@ const CourseList: React.FC = () => {
<a
key="detail"
onClick={() => {
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,

@ -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 = () => {
// </Button>,
// ]}
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 = () => {
>
<BetaSchemaForm<DataItem>
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);

@ -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<string, any>,
) {
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,
});
}

@ -1,94 +1,163 @@
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, getMainBranchSchool } 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 areaData = await getAsyncOrgTree({
// org_id: e,
// org_type: 2,
// get_next: 1
// });
console.log(areaData);
}
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 => <Option key={d.value}>{d.text}</Option>);
<Card loading={loading} bordered={false} bodyStyle={{ padding: 0, marginBottom: '24px' }}>
<div className={styles.salesCard}>
<Tabs
tabBarExtraContent={
<div className={styles.salesExtraWrap}>
};
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}>
{/* <a className={isActive('today')} onClick={() => selectDate('today')}>
</a>
<a className={isActive('week')} onClick={() => selectDate('week')}>
</a>
<a className={isActive('month')} onClick={() => selectDate('month')}>
</a>
<a className={isActive('year')} onClick={() => selectDate('year')}>
</a> */}
<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) }}
>
{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 }}
onChange={(id) => { getSchoolData(id) }}
>
{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={false}
showArrow={false}
filterOption={false}
// onSearch={this.handleSearch}
// onChange={this.handleChange}
notFoundContent={null}
>
{/* {options} */}
</Select>
</Form.Item>
</Form>
</div>
<RangePicker
// value={rangePickerValue}
// onChange={handleRangePickerChange}
style={{ width: 256 }}
/>
</div>
}
size="large"
tabBarStyle={{ marginBottom: 24 }}
>
<Col {...topColResponsiveProps}>
<ChartCard
bordered={false}
loading={loading}
title="资质考试数"
action={false}
total={numeral(6560).format('0,0')}
footer={false}
contentHeight={50}
>
<TinyColumn xField="x" height={46} forceFit yField="y" data={visitData} />
</ChartCard>
}
size="large"
tabBarStyle={{ marginBottom: 24 }}
/>
</div>
<Row />
<Row gutter={16}>
<Col {...topColResponsiveProps}>
<Statistic title="资质考试数" value={93} />
</Col>
<Col {...topColResponsiveProps}>
<ChartCard
bordered={false}
loading={loading}
title="累计报名人数"
action={false}
total={numeral(6560).format('0,0')}
footer={false}
contentHeight={50}
>
<TinyColumn xField="x" height={46} forceFit yField="y" data={visitData} />
</ChartCard>
<Col {...topColResponsiveProps}>
<Statistic title="累计报名人数" value={93} suffix="人" />
</Col>
<Col {...topColResponsiveProps}>
<ChartCard
bordered={false}
loading={loading}
title="取得证书人数"
action={false}
total={numeral(6560).format('0,0')}
footer={false}
contentHeight={50}
>
<TinyColumn xField="x" height={46} forceFit yField="y" data={visitData} />
</ChartCard>
<Col {...topColResponsiveProps}>
<Statistic title="取得证书人数" value={93} suffix="人" />
</Col>
<Col {...topColResponsiveProps}>
<ChartCard
@ -96,7 +165,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
loading={loading}
title={`通过率`}
action={false}
total={`${numeral(6560).format('0,0')}`}
// total={`${numeral(6560).format('0,0')}`}
footer={false}
contentHeight={92}
style={{ textAlign: 'center', marginBottom: 0 }}
@ -104,12 +173,10 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
<Progress type="circle" percent={75} width={80} strokeWidth={10} style={{ position: 'relative', margin: '15px auto 0 auto' }} />
</ChartCard>
</Col>
</Tabs>
</div>
</Card>
</Row>
</Card >)
);
};
export default IntroduceRow;

@ -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;
}) => (
<Card loading={loading} bordered={false} bodyStyle={{ padding: 0, marginBottom:'24px' }}>
<Card loading={loading} bordered={false} bodyStyle={{ padding: 0, marginBottom: '24px' }}>
<div className={styles.salesCard}>
<Tabs
tabBarExtraContent={
@ -101,10 +94,10 @@ const SalesCard = ({
}}
/>
</div>
</Col>
</Col>
</Row>
</TabPane>
</Tabs>
</div>
</Card>

@ -129,7 +129,7 @@ const Analysis: FC<AnalysisProps> = () => {
<Suspense fallback={null}>
<AchievementRow loading={loading} visitData={data?.visitData || []} />
</Suspense>
</>
</GridContent>
);

@ -5,28 +5,74 @@ 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<string, any>,
// ) {
// 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,
});
}
/**
*
* /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,
});
}
}
/*
http://10.10.14.199/dsideal_yy/org/getAsyncOrgTree?org_id=100025&org_type=1&get_next=1
org_idID 100025org_type1get_next1
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