diff --git a/packages/examination/src/views/examPaper/examPaperAdd.tsx b/packages/examination/src/views/examPaper/examPaperAdd.tsx
index a239023..7c44990 100644
--- a/packages/examination/src/views/examPaper/examPaperAdd.tsx
+++ b/packages/examination/src/views/examPaper/examPaperAdd.tsx
@@ -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
{
style={{ width: 1190 }}
rules={[{ required: true, message: '请输入内容描述' }]}
>
-
+
试题详情
diff --git a/packages/examination/src/views/examPaper/examPaperList.tsx b/packages/examination/src/views/examPaper/examPaperList.tsx
index 428c795..38b2dac 100644
--- a/packages/examination/src/views/examPaper/examPaperList.tsx
+++ b/packages/examination/src/views/examPaper/examPaperList.tsx
@@ -39,7 +39,7 @@ class ExamPaperList extends Component
{
const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values);
}
- this.handlegetList();
+ this.handlegetList('def');
}
// 字典
@@ -52,15 +52,16 @@ class ExamPaperList extends Component {
}
// 查询
- 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 {
const success = res['success'];
if (success) {
message.success('删除成功');
- this.handlegetList();
+ this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@@ -123,7 +124,7 @@ class ExamPaperList extends Component {
const success = res['success'];
if (success) {
message.success('删除成功');
- this.handlegetList();
+ this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@@ -225,7 +226,7 @@ class ExamPaperList extends Component {
const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
- this.handlegetList();
+ this.handlegetList('def');
}, 0);
};
@@ -363,7 +364,7 @@ class ExamPaperList extends Component {
diff --git a/packages/examination/src/views/question/questionAdd.tsx b/packages/examination/src/views/question/questionAdd.tsx
index dba709c..b40c538 100644
--- a/packages/examination/src/views/question/questionAdd.tsx
+++ b/packages/examination/src/views/question/questionAdd.tsx
@@ -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;
@@ -347,7 +348,7 @@ class QuestionAdd extends Component {
rules={[{ required: true, message: "请输入题干内容" }]}
>
diff --git a/packages/examination/src/views/question/questionEdit.tsx b/packages/examination/src/views/question/questionEdit.tsx
index b133666..1f46092 100644
--- a/packages/examination/src/views/question/questionEdit.tsx
+++ b/packages/examination/src/views/question/questionEdit.tsx
@@ -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 {
rules={[{ required: true, message: '请输入题干内容' }]}
>
diff --git a/packages/examination/src/views/question/questionList.tsx b/packages/examination/src/views/question/questionList.tsx
index 49f25b7..e0817bc 100644
--- a/packages/examination/src/views/question/questionList.tsx
+++ b/packages/examination/src/views/question/questionList.tsx
@@ -41,7 +41,7 @@ class QuestionList extends Component {
const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values);
}
- this.handlegetList();
+ this.handlegetList('def');
}
// 字典
@@ -70,7 +70,7 @@ class QuestionList extends Component {
}
// 查询
- 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 {
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 {
const success = res['success'];
if (success) {
message.success('删除成功');
- this.handlegetList();
+ this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@@ -147,7 +148,7 @@ class QuestionList extends Component {
const success = res['success'];
if (success) {
message.success('删除成功');
- this.handlegetList();
+ this.handlegetList('def');
} else {
message.error('删除失败,请稍后重试');
}
@@ -182,7 +183,7 @@ class QuestionList extends Component {
const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
- this.handlegetList();
+ this.handlegetList('def');
}, 0);
};
@@ -337,7 +338,7 @@ class QuestionList extends Component {
diff --git a/packages/examination/src/views/slider/index.js b/packages/examination/src/views/slider/index.js
index f4ab3f8..ec6550a 100644
--- a/packages/examination/src/views/slider/index.js
+++ b/packages/examination/src/views/slider/index.js
@@ -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;
diff --git a/packages/examination/src/views/slider/menu.tsx b/packages/examination/src/views/slider/menu.tsx
index 60225c9..23c5e3c 100644
--- a/packages/examination/src/views/slider/menu.tsx
+++ b/packages/examination/src/views/slider/menu.tsx
@@ -1,3 +1,5 @@
+import React from "react";
+
const menuList = [
{
title: '统计分析看板',
@@ -10,12 +12,12 @@ const menuList = [
icon: 'icon',
subs: [
{
- title: '客户列表',
+ title: 客户列表,
key: 'customer',
icon: 'icon',
},
{
- title: '服务统计',
+ title: 服务统计,
key: 'serviceStatistics',
icon: 'icon',
}
@@ -24,38 +26,24 @@ const menuList = [
]
},
{
- title: '题库管理',
- key: 'question',
+ title: '线上考试',
+ key: 'exam-online',
icon: 'icon-peizhi',
subs: [
{
- title: '题库列表',
+ title: 题库列表,
key: 'questionList',
- }
- ]
- },
- {
- title: '试卷管理',
- key: 'examPaper',
- icon: 'icon-peizhi',
- subs: [
+ },
{
- title: '试卷列表',
+ title: 试卷列表,
key: 'examPaperList',
- }
- ]
- },
- {
- title: '线上考试',
- key: 'exam-online',
- icon: 'icon-peizhi',
- subs: [
+ },
{
- title: '考试安排',
+ title: 考试安排,
key: 'exam-schedule',
},
{
- title: '考试统计',
+ title: 考试统计,
key: 'exam-statistics',
}
]
diff --git a/packages/examination/src/views/statistical/customerRetention.tsx b/packages/examination/src/views/statistical/customerRetention.tsx
index bd6973c..eae7ef7 100644
--- a/packages/examination/src/views/statistical/customerRetention.tsx
+++ b/packages/examination/src/views/statistical/customerRetention.tsx
@@ -19,6 +19,7 @@ interface Enterprise {
uploadTime: string;
description: string;
fileUid: string;
+ fileName: string;
}
interface FormData {
@@ -67,10 +68,12 @@ const CustomerRetention: React.FC = ({ 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 = ({ customer }) => {
dataIndex: 'file',
key: 'file',
sorter: true,
- render: (text: any, record: { fileUid: string; }) => (
+ render: (text: any, record: {
+ fileName: any;
+ fileUid: string; }) => (
- showModal2(record.fileUid)}>服务声明扫描图片文件链接
+ showModal2(record.fileUid)}>{record.fileName}
),
},
@@ -103,26 +108,27 @@ const CustomerRetention: React.FC = ({ 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 = ({ customer }) => {
{contextHolder}
-
-
{customer.customerName}
-
+
{loading ? (
@@ -305,7 +311,7 @@ const CustomerRetention: React.FC
= ({ customer }) => {
-
+
diff --git a/packages/examination/src/views/statistical/detail.tsx b/packages/examination/src/views/statistical/detail.tsx
index 28448cf..7820096 100644
--- a/packages/examination/src/views/statistical/detail.tsx
+++ b/packages/examination/src/views/statistical/detail.tsx
@@ -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'] = [
{
diff --git a/packages/examination/src/views/statistical/enterpriseFile.tsx b/packages/examination/src/views/statistical/enterpriseFile.tsx
index a559b2a..e7130b1 100644
--- a/packages/examination/src/views/statistical/enterpriseFile.tsx
+++ b/packages/examination/src/views/statistical/enterpriseFile.tsx
@@ -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
= ({ customer }) => {
- // State to store data and loading state
- const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
const [items, setItems] = useState- ([]);
const [items2, setItems2] = useState([]);
const [items3, setItems3] = useState([]);
const [items4, setItems4] = useState([]);
const [downloadStat, setDownloadStat] = useState(false);
-
- const [testVal, setTestVal] = useState(0);
-
- // Simulate data fetching on component mount
useEffect(() => {
setLoading(true);
message.open({
@@ -66,7 +51,6 @@ const EnterpriseFile: React.FC = ({ 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 = ({ customer }) => {
{
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
{
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{
const { list, loading, industryOptions, organMap } = this.state;
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
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 (