样式调整

main
liuyiliang 3 months ago
parent af2ec9c3b3
commit 4428a3f4c0
  1. 6
      packages/examination/src/App.tsx
  2. 37
      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. 36
      packages/examination/src/views/slider/menu.tsx
  11. 52
      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. 100
      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)} />
<Content className={collapsed === true ? 'noLeft' : 'left'} style={{ position: 'absolute', top: 70, right: 0, bottom: 0 }}>
<Breadcrumb style={{margin: '12px 16px', height: '20px'}} separator=">" >
{breadcrumb.map((item, index) => (
{breadcrumb.map((item: any, index) => (
<Breadcrumb.Item key={index}>
<span style={{ color: index === breadcrumb.length - 1 ? '#6789E2' : 'inherit' , fontWeight: 600 }}>
{item}
<span style={{fontWeight: 600 }}>
{item.title}
</span>
</Breadcrumb.Item>
))}

@ -80,11 +80,15 @@ body {
.iconColor{
color: #B5DBFF;
}
/*.container{*/
/* background: #fff;*/
/* border-radius: 5px;*/
/* border: 1px solid #ddd;*/
/* padding: 30px;*/
/*}*/
.container{
background: #fff;
border-radius: 5px;
border: 1px solid #ddd;
padding: 30px;
padding: 15px;
}
.special-class .ant-table-body{
@ -119,13 +123,14 @@ body {
.ikd-page-header {
color: #323232;
margin-bottom: 20px;
margin-bottom: 15px;
border-left: 4px solid #7ea0f9;
padding-left: 10px;
}
.ikd-page-header .title {
height: 40px;
font-size: 18px;
line-height: 40px;
font-size: medium;
font-weight: 600;
}
.list-filter {
@ -226,6 +231,10 @@ table.ikd-input-table {
background-color: #f7fbfe;
}
.ant-table-container table > thead > tr:first-child th:last-child {
border-top-right-radius: 1px;
}
.ant-table-thead > tr > th {
border-top: 1px solid #000000;
border-left: 1px solid #000000;
@ -237,6 +246,9 @@ table.ikd-input-table {
border-bottom: 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 {
border-bottom: 1px solid transparent;
}
@ -299,4 +311,13 @@ table.ikd-input-table {
/*.header {*/
/* position: fixed !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 { add, getIndustryList, getPaperListWithDetails } from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表
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;
@ -344,7 +345,7 @@ const ExamBasicInfoForm: React.FC<PropsWithRouter> = (props) => {
label="内容描述"
name="remark"
>
<Input.TextArea rows={4} />
<Input.TextArea rows={4} maxLength={200} showCount/>
</Form.Item>
<Form.Item wrapperCol={{ ...wrapperCol, offset: labelCol.span }}>
<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 { getList ,findIndustry} from 'api/question';
import { dictionary } from "../../api/dict";
import TextArea from "antd/es/input/TextArea";
const { Option } = Select;
@ -459,7 +460,7 @@ class ExamPaperAdd extends Component<any, States> {
style={{ width: 1190 }}
rules={[{ required: true, message: '请输入内容描述' }]}
>
<Input.TextArea placeholder="请输入内容描述" />
<Input.TextArea placeholder="请输入内容描述" maxLength={200} showCount/>
</Form.Item>
<div style={{ display: 'flex' }}>
<h3 style={{ fontWeight: 'bold' }}></h3>

@ -39,7 +39,7 @@ class ExamPaperList extends Component<any, States> {
const values = JSON.parse(savedFormValues);
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 });
const values = this.formRef.current.getFieldsValue();
const { num, page } = this.state;
const data = {
...values,
num,
page
page : stat && stat === 'init' ? 1 : page
};
this.setState({ page: data.page, num: data.num });
sessionStorage.setItem('examPaperListFormValues', JSON.stringify(values));
getList(data).then((res) => {
this.setState({
@ -94,7 +95,7 @@ class ExamPaperList extends Component<any, States> {
const success = res['success'];
if (success) {
message.success('删除成功');
this.handlegetList();
this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@ -123,7 +124,7 @@ class ExamPaperList extends Component<any, States> {
const success = res['success'];
if (success) {
message.success('删除成功');
this.handlegetList();
this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@ -217,7 +218,7 @@ class ExamPaperList extends Component<any, States> {
const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
this.handlegetList();
this.handlegetList('def');
}, 0);
};
@ -351,7 +352,7 @@ class ExamPaperList extends Component<any, States> {
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" onClick={() => {
this.handlegetList();
this.handlegetList('init');
}}></Button>
</Form.Item>
</Form>

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

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

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

@ -7,11 +7,32 @@ import { FolderOutlined, FileOutlined, FolderOpenOutlined, DownOutlined, UpOutli
const { SubMenu } = Menu;
// 查找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) => {
var result = [];
const findMenu = (menus, targetKey, path = []) => {
for (const menu of menus) {
const currentPath = [...path, menu.title];
const currentPath = [...path, {
title: menu.title,
key: menu.key
}];
if (menu.key === targetKey) {
result = currentPath;
return;

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

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

@ -13,10 +13,16 @@ const onChange = (key: string) => {
const App: React.FC = () => {
const location = useLocation();
// 提取 record 数据,若没有则设为默认值
const { record } = location.state as { record: any } || {};
console.log("record", record)
let { record } = location.state as { record: any } || {};
if (!record || !record.id) {
const hash = window.location.hash;
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'] = [
{

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

@ -89,9 +89,9 @@ class Customer extends React.Component<Props, State>{
handleDetail(record: any) {
// @ts-ignore
const { history } = this.props;
console.log(record)
history.push({
pathname: '/customerDetail',
search: '?id='+record.customerId+'&name='+encodeURI(record.customerName),
state: { record },
});
}
@ -104,6 +104,8 @@ class Customer extends React.Component<Props, State>{
this.state.listQuery.typePid = form.getFieldValue('typePid');
const { customerNo, customerName, typePname, contacts, contactsPhone } = JSON.parse(JSON.stringify(values))
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.getListApi(this.state.listQuery)
}
@ -167,53 +169,57 @@ class Customer extends React.Component<Props, State>{
const { list, loading, industryOptions, organMap } = this.state;
return (
<div className="container">
<div className="ikd-page-header"><div className="title"></div></div>
<div className="list-filter">
<Form
ref={this.formRef}
className="filter"
layout="inline"
name="basic"
onFinish={onFinish}
onFinishFailed={onFinishFailed}>
<Form.Item
label="关键字:"
name="keyword">
<Input style={{ width: 230 }} placeholder="请输入输入客户名称/编号关键字" />
</Form.Item>
<Form.Item
label="归属机构:"
name="insuranceId">
<TreeSelect
treeDataSimpleMode
style={{ width: 300 }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="全部"
loadData={onLoadData}
treeData={organMap}
/>
</Form.Item>
<Form.Item
label="管理分类:"
name="typePid">
<Select placeholder="全部" style={{ width: 200 }} allowClear>
{
industryOptions && industryOptions.map((item: { value: any; label: any }) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
</Form.Item>
<Form.Item>
<Button htmlType="button" onClick={onReset}>
</Button>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
<div className="header-filter">
<div className="ikd-page-header"><div className="title"></div></div>
<div className="list-filter">
<Form
ref={this.formRef}
className="filter"
layout="inline"
name="basic"
style={{ paddingLeft: 20 }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}>
<Form.Item
label="关键字:"
name="keyword">
<Input style={{ width: 230 }} placeholder="请输入客户名称/编号关键字" />
</Form.Item>
<Form.Item
label="归属机构:"
name="insuranceId">
<TreeSelect
treeDataSimpleMode
style={{ width: 300 }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="全部"
loadData={onLoadData}
treeData={organMap}
/>
</Form.Item>
<Form.Item
label="管理分类:"
name="typePid">
<Select placeholder="全部" style={{ width: 200 }} allowClear>
{
industryOptions && industryOptions.map((item: { value: any; label: any }) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
</Form.Item>
<Form.Item>
<Button htmlType="button" onClick={onReset}>
</Button>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit"></Button>
</Form.Item>
</Form>
</div>
</div>
<div className="ikd-page-header" style={{ marginLeft: 10 }}><div className="title"></div></div>
<Table dataSource={list} columns={columns} rowKey="customerId"
bordered={true}
size={'small'}

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

Loading…
Cancel
Save