Merge remote-tracking branch 'origin/main'

main
hujunpeng 3 months ago
commit f36c964ab3
  1. 6
      packages/examination/src/App.tsx
  2. 35
      packages/examination/src/style/common.css
  3. 5
      packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx
  4. 3
      packages/examination/src/views/examPaper/examPaperAdd.tsx
  5. 15
      packages/examination/src/views/examPaper/examPaperList.tsx
  6. 3
      packages/examination/src/views/question/questionAdd.tsx
  7. 3
      packages/examination/src/views/question/questionEdit.tsx
  8. 15
      packages/examination/src/views/question/questionList.tsx
  9. 23
      packages/examination/src/views/slider/index.js
  10. 32
      packages/examination/src/views/slider/menu.tsx
  11. 24
      packages/examination/src/views/statistical/customerRetention.tsx
  12. 14
      packages/examination/src/views/statistical/detail.tsx
  13. 18
      packages/examination/src/views/statistical/enterpriseFile.tsx
  14. 10
      packages/examination/src/views/statistical/list.tsx
  15. 17
      packages/examination/src/views/statistical/serviceStatistics.tsx

@ -58,10 +58,10 @@ class App extends React.Component {
<Header changeCollapse={this.changeCollapse.bind(this)} /> <Header changeCollapse={this.changeCollapse.bind(this)} />
<Content className={collapsed === true ? 'noLeft' : 'left'} style={{ position: 'absolute', top: 70, right: 0, bottom: 0 }}> <Content className={collapsed === true ? 'noLeft' : 'left'} style={{ position: 'absolute', top: 70, right: 0, bottom: 0 }}>
<Breadcrumb style={{margin: '12px 16px', height: '20px'}} separator=">" > <Breadcrumb style={{margin: '12px 16px', height: '20px'}} separator=">" >
{breadcrumb.map((item, index) => ( {breadcrumb.map((item: any, index) => (
<Breadcrumb.Item key={index}> <Breadcrumb.Item key={index}>
<span style={{ color: index === breadcrumb.length - 1 ? '#6789E2' : 'inherit' , fontWeight: 600 }}> <span style={{fontWeight: 600 }}>
{item} {item.title}
</span> </span>
</Breadcrumb.Item> </Breadcrumb.Item>
))} ))}

@ -80,11 +80,15 @@ body {
.iconColor{ .iconColor{
color: #B5DBFF; color: #B5DBFF;
} }
/*.container{*/
/* background: #fff;*/
/* border-radius: 5px;*/
/* border: 1px solid #ddd;*/
/* padding: 30px;*/
/*}*/
.container{ .container{
background: #fff; background: #fff;
border-radius: 5px; padding: 15px;
border: 1px solid #ddd;
padding: 30px;
} }
.special-class .ant-table-body{ .special-class .ant-table-body{
@ -119,13 +123,14 @@ body {
.ikd-page-header { .ikd-page-header {
color: #323232; color: #323232;
margin-bottom: 20px; margin-bottom: 15px;
border-left: 4px solid #7ea0f9;
padding-left: 10px;
} }
.ikd-page-header .title { .ikd-page-header .title {
height: 40px; font-size: medium;
font-size: 18px; font-weight: 600;
line-height: 40px;
} }
.list-filter { .list-filter {
@ -226,6 +231,10 @@ table.ikd-input-table {
background-color: #f7fbfe; background-color: #f7fbfe;
} }
.ant-table-container table > thead > tr:first-child th:last-child {
border-top-right-radius: 1px;
}
.ant-table-thead > tr > th { .ant-table-thead > tr > th {
border-top: 1px solid #000000; border-top: 1px solid #000000;
border-left: 1px solid #000000; border-left: 1px solid #000000;
@ -237,6 +246,9 @@ table.ikd-input-table {
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
border-left: 1px solid #000000; border-left: 1px solid #000000;
} }
.ant-table-tbody > tr.ant-table-row-selected > td {
border-color: rgb(0 0 0);
}
.ant-table-tbody > tr:last-child > td { .ant-table-tbody > tr:last-child > td {
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
} }
@ -300,3 +312,12 @@ table.ikd-input-table {
/* position: fixed !important;*/ /* position: fixed !important;*/
/* width: 100% !important;*/ /* width: 100% !important;*/
/*}*/ /*}*/
.header-filter {
border-radius: 5px;
padding: 10px;
box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 26%);
margin-bottom: 10px;
}
.ant-breadcrumb li:last-child a {
color: #6789E2;
}

@ -6,7 +6,8 @@ import ESBreadcrumbComponent from './ESBreadcrumbComponent'; // 引入面包屑
import { withRouter, RouteComponentProps } from 'react-router-dom'; // 引入 withRouter 和 RouteComponentProps import { withRouter, RouteComponentProps } from 'react-router-dom'; // 引入 withRouter 和 RouteComponentProps
import { add, getIndustryList, getPaperListWithDetails } from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表 import { add, getIndustryList, getPaperListWithDetails } from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表
import { provice } from './city.js'; // 引入省市县数据 import { provice } from './city.js'; // 引入省市县数据
import moment, { Moment } from 'moment'; // 引入 moment import moment, { Moment } from 'moment';
import TextArea from "antd/es/input/TextArea"; // 引入 moment
const { Option } = Select; const { Option } = Select;
@ -345,7 +346,7 @@ const ExamBasicInfoForm: React.FC<PropsWithRouter> = (props) => {
label="内容描述" label="内容描述"
name="remark" name="remark"
> >
<Input.TextArea rows={4} /> <Input.TextArea rows={4} maxLength={200} showCount/>
</Form.Item> </Form.Item>
<Form.Item wrapperCol={{ ...wrapperCol, offset: labelCol.span }}> <Form.Item wrapperCol={{ ...wrapperCol, offset: labelCol.span }}>
<div style={{ textAlign: "right" }}> <div style={{ textAlign: "right" }}>

@ -3,6 +3,7 @@ import { Form, Input, Button, Radio, Checkbox, Select, message, Modal, Table } f
import { getRandomQuestions, addExamPaper, editExamPaper, getExamPaperDetail} from 'api/examPaper'; import { getRandomQuestions, addExamPaper, editExamPaper, getExamPaperDetail} from 'api/examPaper';
import { getList ,findIndustry} from 'api/question'; import { getList ,findIndustry} from 'api/question';
import { dictionary } from "../../api/dict"; import { dictionary } from "../../api/dict";
import TextArea from "antd/es/input/TextArea";
const { Option } = Select; const { Option } = Select;
@ -459,7 +460,7 @@ class ExamPaperAdd extends Component<any, States> {
style={{ width: 1190 }} style={{ width: 1190 }}
rules={[{ required: true, message: '请输入内容描述' }]} rules={[{ required: true, message: '请输入内容描述' }]}
> >
<Input.TextArea placeholder="请输入内容描述" /> <Input.TextArea placeholder="请输入内容描述" maxLength={200} showCount/>
</Form.Item> </Form.Item>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<h3 style={{ fontWeight: 'bold' }}></h3> <h3 style={{ fontWeight: 'bold' }}></h3>

@ -39,7 +39,7 @@ class ExamPaperList extends Component<any, States> {
const values = JSON.parse(savedFormValues); const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values); this.formRef.current.setFieldsValue(values);
} }
this.handlegetList(); this.handlegetList('def');
} }
// 字典 // 字典
@ -52,15 +52,16 @@ class ExamPaperList extends Component<any, States> {
} }
// 查询 // 查询
handlegetList() { handlegetList(stat: string) {
this.setState({ loading: true }); this.setState({ loading: true });
const values = this.formRef.current.getFieldsValue(); const values = this.formRef.current.getFieldsValue();
const { num, page } = this.state; const { num, page } = this.state;
const data = { const data = {
...values, ...values,
num, num,
page page : stat && stat === 'init' ? 1 : page
}; };
this.setState({ page: data.page, num: data.num });
sessionStorage.setItem('examPaperListFormValues', JSON.stringify(values)); sessionStorage.setItem('examPaperListFormValues', JSON.stringify(values));
getList(data).then((res) => { getList(data).then((res) => {
this.setState({ this.setState({
@ -94,7 +95,7 @@ class ExamPaperList extends Component<any, States> {
const success = res['success']; const success = res['success'];
if (success) { if (success) {
message.success('删除成功'); message.success('删除成功');
this.handlegetList(); this.handlegetList('def');
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -123,7 +124,7 @@ class ExamPaperList extends Component<any, States> {
const success = res['success']; const success = res['success'];
if (success) { if (success) {
message.success('删除成功'); message.success('删除成功');
this.handlegetList(); this.handlegetList('def');
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -225,7 +226,7 @@ class ExamPaperList extends Component<any, States> {
const changePage = (current: number, pageSize: number) => { const changePage = (current: number, pageSize: number) => {
setTimeout(() => { setTimeout(() => {
this.setState({ page: current, num: pageSize }); this.setState({ page: current, num: pageSize });
this.handlegetList(); this.handlegetList('def');
}, 0); }, 0);
}; };
@ -363,7 +364,7 @@ class ExamPaperList extends Component<any, States> {
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit" onClick={() => { <Button type="primary" htmlType="submit" onClick={() => {
this.handlegetList(); this.handlegetList('init');
}}></Button> }}></Button>
</Form.Item> </Form.Item>
</Form> </Form>

@ -5,6 +5,7 @@ import { addQuestion, findIndustry } from "api/question";
import * as XLSX from "xlsx"; import * as XLSX from "xlsx";
// @ts-ignore // @ts-ignore
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import TextArea from "antd/es/input/TextArea";
const { Option } = Select; const { Option } = Select;
@ -347,7 +348,7 @@ class QuestionAdd extends Component<any, States> {
rules={[{ required: true, message: "请输入题干内容" }]} rules={[{ required: true, message: "请输入题干内容" }]}
> >
<Input.TextArea <Input.TextArea
placeholder="请输入题干内容" placeholder="请输入题干内容" maxLength={200} showCount
style={{ width: 1100, height: 60 }} style={{ width: 1100, height: 60 }}
/> />
</Form.Item> </Form.Item>

@ -2,6 +2,7 @@ import React, { Component } from'react';
import { Form, Input, Button, Radio, Checkbox, Select, message } from 'antd'; import { Form, Input, Button, Radio, Checkbox, Select, message } from 'antd';
import { dictionary } from "api/dict/index"; import { dictionary } from "api/dict/index";
import { findIndustry, getQuestionDetail, editQuestion } from 'api/question'; import { findIndustry, getQuestionDetail, editQuestion } from 'api/question';
import TextArea from "antd/es/input/TextArea";
const { Option } = Select; const { Option } = Select;
@ -181,7 +182,7 @@ class QuestionEdit extends Component<any, States> {
rules={[{ required: true, message: '请输入题干内容' }]} rules={[{ required: true, message: '请输入题干内容' }]}
> >
<Input.TextArea <Input.TextArea
placeholder="请输入题干内容" placeholder="请输入题干内容" maxLength={200} showCount
style={{ width: 1100, height: 60 }} style={{ width: 1100, height: 60 }}
/> />
</Form.Item> </Form.Item>

@ -41,7 +41,7 @@ class QuestionList extends Component<any, States> {
const values = JSON.parse(savedFormValues); const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values); this.formRef.current.setFieldsValue(values);
} }
this.handlegetList(); this.handlegetList('def');
} }
// 字典 // 字典
@ -70,7 +70,7 @@ class QuestionList extends Component<any, States> {
} }
// 查询 // 查询
handlegetList() { handlegetList(stat: string) {
this.setState({ loading: true }); this.setState({ loading: true });
const values = this.formRef.current.getFieldsValue(); const values = this.formRef.current.getFieldsValue();
const { num, page } = this.state; const { num, page } = this.state;
@ -78,8 +78,9 @@ class QuestionList extends Component<any, States> {
const data = { const data = {
...values, ...values,
num, num,
page page : stat && stat === 'init' ? 1 : page
}; };
this.setState({ page: data.page, num: data.num });
sessionStorage.setItem('questionListFormValues', JSON.stringify(values)); sessionStorage.setItem('questionListFormValues', JSON.stringify(values));
getList(data) getList(data)
.then((res) => { .then((res) => {
@ -115,7 +116,7 @@ class QuestionList extends Component<any, States> {
const success = res['success']; const success = res['success'];
if (success) { if (success) {
message.success('删除成功'); message.success('删除成功');
this.handlegetList(); this.handlegetList('def');
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -147,7 +148,7 @@ class QuestionList extends Component<any, States> {
const success = res['success']; const success = res['success'];
if (success) { if (success) {
message.success('删除成功'); message.success('删除成功');
this.handlegetList(); this.handlegetList('def');
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -182,7 +183,7 @@ class QuestionList extends Component<any, States> {
const changePage = (current: number, pageSize: number) => { const changePage = (current: number, pageSize: number) => {
setTimeout(() => { setTimeout(() => {
this.setState({ page: current, num: pageSize }); this.setState({ page: current, num: pageSize });
this.handlegetList(); this.handlegetList('def');
}, 0); }, 0);
}; };
@ -337,7 +338,7 @@ class QuestionList extends Component<any, States> {
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit" onClick={() => { <Button type="primary" htmlType="submit" onClick={() => {
this.handlegetList(); this.handlegetList('init');
}}></Button> }}></Button>
</Form.Item> </Form.Item>
</Form> </Form>

@ -7,11 +7,32 @@ import { FolderOutlined, FileOutlined, FolderOpenOutlined, DownOutlined, UpOutli
const { SubMenu } = Menu; const { SubMenu } = Menu;
// 查找key对应的title // 查找key对应的title
// export const findTitleByKey = (key) => {
// var result = [];
// const findMenu = (menus, targetKey, path = []) => {
// for (const menu of menus) {
// const currentPath = [...path, menu.title];
// if (menu.key === targetKey) {
// result = currentPath;
// return;
// }
// if (menu.subs && menu.subs.length > 0) {
// findMenu(menu.subs, targetKey, currentPath);
// }
// }
// };
// findMenu(menuList, key);
// return result;
// };
export const findTitleByKey = (key) => { export const findTitleByKey = (key) => {
var result = []; var result = [];
const findMenu = (menus, targetKey, path = []) => { const findMenu = (menus, targetKey, path = []) => {
for (const menu of menus) { for (const menu of menus) {
const currentPath = [...path, menu.title]; const currentPath = [...path, {
title: menu.title,
key: menu.key
}];
if (menu.key === targetKey) { if (menu.key === targetKey) {
result = currentPath; result = currentPath;
return; return;

@ -1,3 +1,5 @@
import React from "react";
const menuList = [ const menuList = [
{ {
title: '统计分析看板', title: '统计分析看板',
@ -10,12 +12,12 @@ const menuList = [
icon: 'icon', icon: 'icon',
subs: [ subs: [
{ {
title: '客户列表', title: <a href="#/customer"></a>,
key: 'customer', key: 'customer',
icon: 'icon', icon: 'icon',
}, },
{ {
title: '服务统计', title: <a href="#/serviceStatistics"></a>,
key: 'serviceStatistics', key: 'serviceStatistics',
icon: 'icon', icon: 'icon',
} }
@ -24,38 +26,24 @@ const menuList = [
] ]
}, },
{ {
title: '题库管理', title: '线上考试',
key: 'question', key: 'exam-online',
icon: 'icon-peizhi', icon: 'icon-peizhi',
subs: [ subs: [
{ {
title: '题库列表', title: <a href="#/questionList"></a>,
key: 'questionList', key: 'questionList',
}
]
}, },
{ {
title: '试卷管理', title: <a href="#/examPaperList"></a>,
key: 'examPaper',
icon: 'icon-peizhi',
subs: [
{
title: '试卷列表',
key: 'examPaperList', key: 'examPaperList',
}
]
}, },
{ {
title: '线上考试', title: <a href="#/exam-schedule"></a>,
key: 'exam-online',
icon: 'icon-peizhi',
subs: [
{
title: '考试安排',
key: 'exam-schedule', key: 'exam-schedule',
}, },
{ {
title: '考试统计', title: <a href="#/exam-statistics"></a>,
key: 'exam-statistics', key: 'exam-statistics',
} }
] ]

@ -19,6 +19,7 @@ interface Enterprise {
uploadTime: string; uploadTime: string;
description: string; description: string;
fileUid: string; fileUid: string;
fileName: string;
} }
interface FormData { interface FormData {
@ -67,10 +68,12 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
getListApi({}, query.page, query.num) getListApi({}, query.page, query.num)
}, []); }, []);
const columns = [ const columns: any = [
{ {
title: '序号', title: '序号',
align: 'center',
dataIndex: 'key', dataIndex: 'key',
width: 50,
render: (text: string, record: any, index: number) => index + 1 render: (text: string, record: any, index: number) => index + 1
}, },
{ {
@ -88,9 +91,11 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
dataIndex: 'file', dataIndex: 'file',
key: 'file', key: 'file',
sorter: true, sorter: true,
render: (text: any, record: { fileUid: string; }) => ( render: (text: any, record: {
fileName: any;
fileUid: string; }) => (
<Space size="middle"> <Space size="middle">
<a onClick={() => showModal2(record.fileUid)}></a> <a onClick={() => showModal2(record.fileUid)}>{record.fileName}</a>
</Space> </Space>
), ),
}, },
@ -103,11 +108,11 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
}; };
const handleOk = () => { const handleOk = () => {
setLoading(true); // setLoading(true);
if (fileList.length == 0) { if (fileList.length == 0) {
openNotification('top', '请上传文件', 'info'); openNotification('top', '请上传文件', 'info');
return; return;
} } else {
var formData = { var formData = {
customerId: customer.customerId, customerId: customer.customerId,
fileId: fileRes?.fileId, fileId: fileRes?.fileId,
@ -123,6 +128,7 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
form.resetFields(['description']); // 重置description字段 form.resetFields(['description']); // 重置description字段
setIsModalOpen(false); setIsModalOpen(false);
}).catch(() => { }) }).catch(() => { })
}
}; };
const handleCancel = () => { const handleCancel = () => {
@ -246,9 +252,9 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
<div> <div>
{contextHolder} {contextHolder}
<div> <div>
<div> <div style={{ display: 'flex',justifyContent: 'space-between', width: '100%' }}>
<span style={{fontWeight: 600, fontSize: 16}}>{customer.customerName}</span> <div className="ikd-page-header"><div className="title">{customer.customerName}</div></div>
<Button type="primary" style={{ marginBottom: 20, float: 'right' }} onClick={showModal}></Button> <Button type="primary" style={{ marginBottom: 10, float: 'right' }} onClick={showModal}></Button>
</div> </div>
{loading ? ( {loading ? (
<Spin tip="Loading..." /> <Spin tip="Loading..." />
@ -305,7 +311,7 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => {
</Upload.Dragger> </Upload.Dragger>
</div> </div>
<Form.Item label="说明描述" name="description" rules={[{ required: false }]}> <Form.Item label="说明描述" name="description" rules={[{ required: false }]}>
<TextArea rows={4} /> <TextArea rows={4} maxLength={200} showCount/>
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>

@ -13,10 +13,16 @@ const onChange = (key: string) => {
const App: React.FC = () => { const App: React.FC = () => {
const location = useLocation(); const location = useLocation();
// 提取 record 数据,若没有则设为默认值 let { record } = location.state as { record: any } || {};
const { record } = location.state as { record: any } || {}; if (!record || !record.id) {
const hash = window.location.hash;
console.log("record", record) const [path, queryString] = hash.slice(1).split('?');
const urlParams = new URLSearchParams(queryString);
record = {
customerId: parseInt(urlParams.get('id')+""),
customerName: urlParams.get('name')
}
}
const items: TabsProps['items'] = [ const items: TabsProps['items'] = [
{ {

@ -4,15 +4,6 @@ import {getEnterpriseArchives} from 'api/statistical'
import {downPdf} from 'utils/exportPdf'; import {downPdf} from 'utils/exportPdf';
interface Enterprise {
key: string;
customerNo: string;
customerName: string;
industry: string;
contacts: string;
phone: string;
}
interface CustomerRetentionProps { interface CustomerRetentionProps {
customer: any; customer: any;
} }
@ -47,18 +38,12 @@ interface PolicyServiceItem {
const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => { const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
// State to store data and loading state
const [data, setData] = useState<Enterprise[]>([]);
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const [items, setItems] = useState<Item[]>([]); const [items, setItems] = useState<Item[]>([]);
const [items2, setItems2] = useState<PolicyItem[]>([]); const [items2, setItems2] = useState<PolicyItem[]>([]);
const [items3, setItems3] = useState<HiveClaimStatistics[][]>([]); const [items3, setItems3] = useState<HiveClaimStatistics[][]>([]);
const [items4, setItems4] = useState<PolicyServiceItem[]>([]); const [items4, setItems4] = useState<PolicyServiceItem[]>([]);
const [downloadStat, setDownloadStat] = useState<boolean>(false); const [downloadStat, setDownloadStat] = useState<boolean>(false);
const [testVal, setTestVal] = useState<number>(0);
// Simulate data fetching on component mount
useEffect(() => { useEffect(() => {
setLoading(true); setLoading(true);
message.open({ message.open({
@ -66,7 +51,6 @@ const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
content: '数据加载中..', content: '数据加载中..',
duration: 0, duration: 0,
}); });
// getEnterpriseArchives({ customerId: '90020242601'}).then(res => {
getEnterpriseArchives({ customerId: customer.customerId}).then(res => { getEnterpriseArchives({ customerId: customer.customerId}).then(res => {
var baseData = [ var baseData = [
{ {
@ -513,7 +497,7 @@ const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
<div style={{ <div style={{
height: '106px', height: '106px',
border: '1px solid rgba(220, 228, 248, 0.29)', border: '1px solid rgba(220, 228, 248, 0.29)',
borderRadius: '5px', borderRadius: '2px',
backgroundColor: 'rgba(220, 228, 248, 0.29)', backgroundColor: 'rgba(220, 228, 248, 0.29)',
marginBottom: '20px', marginBottom: '20px',
justifyContent: 'center', justifyContent: 'center',

@ -89,9 +89,9 @@ class Customer extends React.Component<Props, State>{
handleDetail(record: any) { handleDetail(record: any) {
// @ts-ignore // @ts-ignore
const { history } = this.props; const { history } = this.props;
console.log(record)
history.push({ history.push({
pathname: '/customerDetail', pathname: '/customerDetail',
search: '?id='+record.customerId+'&name='+encodeURI(record.customerName),
state: { record }, state: { record },
}); });
} }
@ -104,6 +104,8 @@ class Customer extends React.Component<Props, State>{
this.state.listQuery.typePid = form.getFieldValue('typePid'); this.state.listQuery.typePid = form.getFieldValue('typePid');
const { customerNo, customerName, typePname, contacts, contactsPhone } = JSON.parse(JSON.stringify(values)) const { customerNo, customerName, typePname, contacts, contactsPhone } = JSON.parse(JSON.stringify(values))
const _listQuery = { ...this.state.listQuery, customerNo, customerName, typePname, contacts, contactsPhone } const _listQuery = { ...this.state.listQuery, customerNo, customerName, typePname, contacts, contactsPhone }
_listQuery.page = 1;
_listQuery.num = this.state.listQuery? this.state.listQuery.num : 20;
this.setState({ listQuery: _listQuery }); this.setState({ listQuery: _listQuery });
this.getListApi(this.state.listQuery) this.getListApi(this.state.listQuery)
} }
@ -167,6 +169,7 @@ class Customer extends React.Component<Props, State>{
const { list, loading, industryOptions, organMap } = this.state; const { list, loading, industryOptions, organMap } = this.state;
return ( return (
<div className="container"> <div className="container">
<div className="header-filter">
<div className="ikd-page-header"><div className="title"></div></div> <div className="ikd-page-header"><div className="title"></div></div>
<div className="list-filter"> <div className="list-filter">
<Form <Form
@ -174,12 +177,13 @@ class Customer extends React.Component<Props, State>{
className="filter" className="filter"
layout="inline" layout="inline"
name="basic" name="basic"
style={{ paddingLeft: 20 }}
onFinish={onFinish} onFinish={onFinish}
onFinishFailed={onFinishFailed}> onFinishFailed={onFinishFailed}>
<Form.Item <Form.Item
label="关键字:" label="关键字:"
name="keyword"> name="keyword">
<Input style={{ width: 230 }} placeholder="请输入输入客户名称/编号关键字" /> <Input style={{ width: 230 }} placeholder="请输入客户名称/编号关键字" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="归属机构:" label="归属机构:"
@ -214,6 +218,8 @@ class Customer extends React.Component<Props, State>{
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</div>
<div className="ikd-page-header" style={{ marginLeft: 10 }}><div className="title"></div></div>
<Table dataSource={list} columns={columns} rowKey="customerId" <Table dataSource={list} columns={columns} rowKey="customerId"
bordered={true} bordered={true}
size={'small'} size={'small'}

@ -118,7 +118,8 @@ const App: React.FC = () => {
const onFinish = (values: object) => { const onFinish = (values: object) => {
const form = formRef.current; const form = formRef.current;
const safeQuery = query ?? {page: 1, num: 20}; const safeQuery = {page: 1, num: query? query.num : 20};
setQuery(safeQuery);
getListApi({ getListApi({
dateFilter: form.getFieldValue('dateFilter'), dateFilter: form.getFieldValue('dateFilter'),
startDate: form.getFieldValue('selectDateTime') ? formatDate(form.getFieldValue('selectDateTime')[0]) : null, startDate: form.getFieldValue('selectDateTime') ? formatDate(form.getFieldValue('selectDateTime')[0]) : null,
@ -142,10 +143,10 @@ const App: React.FC = () => {
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0'); // const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0'); // const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0'); // const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day}`;
} }
@ -179,7 +180,8 @@ const App: React.FC = () => {
return ( return (
<div className="container"> <div className="container">
<div> <div>
<div className="list-filter" style={{display: 'flex'}}> <div className="header-filter">
<div className="list-filter" style={{display: 'flex', padding: 15}}>
<Form <Form
form={form} form={form}
ref={formRef} ref={formRef}
@ -196,7 +198,7 @@ const App: React.FC = () => {
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label="保单数据日期" name="selectDateTime"> <Form.Item label="保单数据日期" name="selectDateTime">
<RangePicker showTime style={{ width: 350 }} onChange={(value, dateString) => {}}/> <RangePicker style={{ width: 300 }} onChange={(value, dateString) => {}}/>
</Form.Item> </Form.Item>
<Form.Item label="事故预防状态" name="serviceStatus"> <Form.Item label="事故预防状态" name="serviceStatus">
<Select <Select
@ -216,6 +218,7 @@ const App: React.FC = () => {
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</div>
<Button type="primary" style={{ marginBottom: 10, float: 'right' }} onClick={goExport}></Button> <Button type="primary" style={{ marginBottom: 10, float: 'right' }} onClick={goExport}></Button>
{loading ? ( {loading ? (
<Spin tip="Loading..." /> <Spin tip="Loading..." />

Loading…
Cancel
Save