diff --git a/packages/examination/src/App.tsx b/packages/examination/src/App.tsx index 5f58ed2..b8951e1 100644 --- a/packages/examination/src/App.tsx +++ b/packages/examination/src/App.tsx @@ -58,10 +58,10 @@ class App extends React.Component {
- {breadcrumb.map((item, index) => ( + {breadcrumb.map((item: any, index) => ( - - {item} + + {item.title} ))} diff --git a/packages/examination/src/style/common.css b/packages/examination/src/style/common.css index 6cfc692..80acc8f 100644 --- a/packages/examination/src/style/common.css +++ b/packages/examination/src/style/common.css @@ -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;*/ - /*}*/ \ No newline at end of file + /*}*/ + .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; + } \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx index 5a8193f..089c305 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx @@ -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 = (props) => { label="内容描述" name="remark" > - +
diff --git a/packages/examination/src/views/examPaper/examPaperAdd.tsx b/packages/examination/src/views/examPaper/examPaperAdd.tsx index bdf6602..ec92dad 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 95de7f6..6089d9f 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('删除失败,请稍后重试'); } @@ -217,7 +218,7 @@ class ExamPaperList extends Component { 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 { diff --git a/packages/examination/src/views/question/questionAdd.tsx b/packages/examination/src/views/question/questionAdd.tsx index a1f1f68..e84d65d 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; @@ -341,7 +342,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 bb299ad..bdd0a8f 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 4f24b63..bb7e34a 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); }; @@ -334,7 +335,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} - +
+
{customer.customerName}
+
{loading ? ( @@ -305,7 +311,7 @@ const CustomerRetention: React.FC = ({ customer }) => {
-