diff --git a/packages/examination/src/api/exam-online/index.tsx b/packages/examination/src/api/exam-online/index.tsx new file mode 100644 index 0000000..0f5a853 --- /dev/null +++ b/packages/examination/src/api/exam-online/index.tsx @@ -0,0 +1,40 @@ +import axios from '../axios'; + +export function getList(obj: any) { + return axios({ + url: '/ex/exam-schedule/select', + method: 'get', + params: obj + }) +} + +export function add(obj: any) { + return axios.post( '/ex/exam-schedule/insert', + obj,{ + headers: { + 'Content-Type': 'application/json' + } + }) +} + +export function edit(obj: any) { + return axios({ + url: '/ex/exam-edit', + method: 'get', + }) +} + +export const getIndustryList = async () => { + const response = await axios.get('/ex/exam-schedule/getIndustry'); + return response.data; +}; + +export const getPaperList = async (obj:any) => { + const response = await axios.get('/ex/dict/dictionary?code='+obj); + return response.data; +}; + +export const getRegionList = async (obj:any) => { + const response = await axios.get('/ex/dict/dictionary?code='+obj); + return response.data; +}; \ No newline at end of file diff --git a/packages/examination/src/components/contentMain/index.js b/packages/examination/src/components/contentMain/index.js index 725fdb8..08bb7e8 100644 --- a/packages/examination/src/components/contentMain/index.js +++ b/packages/examination/src/components/contentMain/index.js @@ -19,7 +19,10 @@ import IntegralRule from 'views/integralmember_manage'; // 积分规则 import Store from 'views/store_manage'; // 店铺管理 -import DemoList from 'views/demo/demoList'; // demo list +import DemoList from 'views/demo/demoList'; +import ExamSchedule from "views/exam-online/exam-schedule"; +import ExamAdd from "../../views/exam-online/exam-add"; +import ExamEdit from "../../views/exam-online/exam-edit"; // demo list import Customer from 'views/statistical/list'; import CustomerDetail from 'views/statistical/detail'; @@ -40,6 +43,9 @@ class ContentMain extends Component { + + + diff --git a/packages/examination/src/views/exam-online/compoents/ESBreadcrumbComponent.tsx b/packages/examination/src/views/exam-online/compoents/ESBreadcrumbComponent.tsx new file mode 100644 index 0000000..75da507 --- /dev/null +++ b/packages/examination/src/views/exam-online/compoents/ESBreadcrumbComponent.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +import { Breadcrumb } from 'antd'; +import { Link } from 'react-router-dom'; + +// 定义组件的 Props 类型 +interface ESBreadcrumbComponentProps { + currentText?: string; +} + +const ESBreadcrumbComponent: React.FC = ({ + currentText = '新增考试', + }) => { + return ( + + + 考试安排 + + {currentText} + + ); +}; + +export default ESBreadcrumbComponent; \ 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 new file mode 100644 index 0000000..67d9e47 --- /dev/null +++ b/packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx @@ -0,0 +1,251 @@ +import React, { useRef, useEffect, useState } from 'react'; +// @ts-ignore +import {Form, Input, Select, DatePicker, Space, ColProps, Button, Cascader, DefaultOptionType} from 'antd'; +import type { FormProps, FormInstance } from 'antd'; +import ESBreadcrumbComponent from './ESBreadcrumbComponent'; // 引入面包屑组件 +import { withRouter, RouteComponentProps } from 'react-router-dom'; // 引入 withRouter 和 RouteComponentProps +import { getList, add, edit, getIndustryList, getPaperList } from "api/exam-online/index"; +import {provice} from './city.js'; // 引入省市县数据 + +const { Option } = Select; + +// 定义表单数据的类型 +interface ExamBasicInfo { + examId: string; + examName: string; + regulatoryIndustry: string; + paperName: string; + examScore: string; + examDuration: string; + examRegion: string[]; // 修改为数组类型,用于存储级联选择的值 + examValidTime: Date | null; + examInvalidTime: Date | null; + contentDescription: string; +} + +// 定义组件的 Props 类型 +interface ExamBasicInfoFormProps extends FormProps { + isEdit: boolean; + initialFormData?: ExamBasicInfo; +} + +// 结合路由属性 +interface PropsWithRouter extends ExamBasicInfoFormProps, RouteComponentProps {} + +export const convertToCascaderData = (): DefaultOptionType[] => { + return provice.map(item => { + const province: DefaultOptionType = { + value: item.name, + label: item.name, + children: item.city.map(city => ({ + value: city.name, + label: city.name + })) as DefaultOptionType[] + }; + return province; + }); +} + +const ExamBasicInfoForm: React.FC = (props) => { + const { isEdit, initialFormData = {} as ExamBasicInfo, history } = props; + const formRef = useRef>(null); + const [industryOptions, setIndustryOptions] = useState<{ value: string; label: string }[]>([]); + const [paperOptions, setPaperOptions] = useState<{ value: string; label: string }[]>([]); + + const onFinish = async (values: ExamBasicInfo) => { + try { + // 调用 add 方法将数据发送到后台 + const response = await add(values); + console.log('数据登录成功:', response); + // 登录成功后迁移到 /exam-schedule 页面 + history.push("/exam-schedule"); + } catch (error) { + console.error('数据登录失败:', error); + } + }; + + const onCancel = () => { + history.push("/exam-schedule"); // 使用 history.push 实现跳转 + }; + + const breadcrumbText = isEdit ? '考试编辑' : '新增考试'; + + // 定义 label 列和控件列的布局 + const labelCol: ColProps = { + span: 2, + style: { + textAlign: 'left' + } + }; + const wrapperCol: ColProps = { span: 18 }; // 控件列占 18 个栅格 + + const handleSubmit = () => { + if (formRef.current) { + formRef.current.validateFields().then((values) => { + onFinish(values); + }).catch((errorInfo) => { + console.log('表单验证失败:', errorInfo); + }); + } + }; + + useEffect(() => { + const fetchData = async () => { + try { + // 获取监管行业列表 + const industryResponse = await getIndustryList(); + setIndustryOptions(industryResponse.map((item: any) => ({ value: item.industry_id, label: item.industry_name }))); + + // 获取试卷列表 + // const paperResponse = await getPaperList(); + // setPaperOptions(paperResponse.map(item => ({ value: item, label: item }))); + } catch (error) { + console.error('数据加载失败:', error); + } + }; + + fetchData(); + }, []); + + return ( +
+ {/* 添加面包屑组件 */} + +

考试基本信息

+
+ {/* 隐藏的 examId 输入框 */} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+ ); +}; + +export default withRouter(ExamBasicInfoForm); // 使用 withRouter 高阶组件包裹组件 \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx new file mode 100644 index 0000000..b5bf525 --- /dev/null +++ b/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx @@ -0,0 +1,364 @@ +import React, { useState } from 'react'; +import { Table, Input, Button, Select, DatePicker, Modal, Checkbox } from 'antd'; +import { Link, withRouter } from 'react-router-dom'; +import moment, { Moment } from 'moment'; // 引入 moment +import { getList, add, edit } from "api/exam-online/index"; + +const { Option } = Select; + +// 定义 Exam 类型 +type Exam = { + examId: number; + examName: string; + paperName: string; + regulatedIndustry: string; + examRegion: string; + validFrom: string; + validTo: string; + examDuration: string; + publishStatus: 0 | 1 | 2; // 0: 待发布, 1: 已发布, 2: 已撤回 +}; + +const ExamListPage = ({ history }: { history: any }) => { + const [searchForm, setSearchForm] = useState({ + examName: '', + paperName: '', + regulatedIndustry: '', + validTime: null as Moment | null, // 修改为 Moment 类型 + }); + const [selectedRows, setSelectedRows] = useState([]); + const [examList, setExamList] = useState([]); // 初始化为空数组 + const [pagination, setPagination] = useState({ + current: 1, + pageSize: 10, + total: 0, + }); + + const handleReset = () => { + setSearchForm({ + examName: '', + paperName: '', + regulatedIndustry: '', + validTime: null, + }); + setPagination({ ...pagination, current: 1 }); + handleSearch(); + }; + + const handleSearch = async (page = 1) => { + try { + // 构建请求参数 + const params = { + examName: searchForm.examName, + paperName: searchForm.paperName, + regulatedIndustry: searchForm.regulatedIndustry, + validDate: searchForm.validTime ? searchForm.validTime.format('YYYY-MM-DD') : '', // 使用 moment 的 format 方法 + page: page, + pageSize: pagination.pageSize, + }; + + // 调用 getList 方法向后端发送请求 + const response = await getList(params); + // 假设后端返回的数据结构为 { data: Exam[]; total: number } + const data = response.data; + setExamList(data.data); + setPagination({ ...pagination, current: page, total: data.total }); + } catch (error) { + console.error('查询出错:', error); + } + }; + + const handleDeleteSelected = () => { + // 实现删除选中数据的逻辑 + const newExamList = examList.filter((exam) => !selectedRows.includes(exam.examId)); + setExamList(newExamList); + setSelectedRows([]); + }; + + const handleWithdrawSelected = () => { + // 实现撤回选中数据的逻辑 + const newExamList: Exam[] = examList.map((exam) => { + if (selectedRows.includes(exam.examId) && exam.publishStatus === 1) { + return { ...exam, publishStatus: 2 }; // 修正为 publishStatus + } + return exam; + }); + setExamList(newExamList); + setSelectedRows([]); + }; + + const handlePublishSelected = () => { + // 实现发布选中数据的逻辑 + const newExamList: Exam[] = examList.map((exam) => { + if (selectedRows.includes(exam.examId) && exam.publishStatus === 0) { + return { ...exam, publishStatus: 1 }; // 修正为 publishStatus + } + return exam; + }); + setExamList(newExamList); + setSelectedRows([]); + }; + + const handleAddExam = () => { + // 实现新增考试跳转逻辑 + history.push('/exam-add'); + console.log('跳转到新增考试页面'); + }; + + const handleEdit = (examId: number) => { + // 实现编辑跳转逻辑 + console.log('跳转到编辑页面,examId:', examId); + }; + + const [qrCodeVisible, setQrCodeVisible] = useState(false); + const [qrCodeData, setQrCodeData] = useState(''); + + const handleGenerateQrCode = (examId: number) => { + // 实现生成考试码逻辑 + setQrCodeData(`examId: ${examId}`); + setQrCodeVisible(true); + }; + + const handlePublishSingle = (examId: number) => { + // 实现单条数据发布逻辑 + const newExamList: Exam[] = examList.map((exam) => { + if (exam.examId === examId && exam.publishStatus === 0) { + return { ...exam, publishStatus: 1 }; // 修正为 publishStatus + } + return exam; + }); + setExamList(newExamList); + }; + + const handleWithdrawSingle = (examId: number) => { + // 实现单条数据撤回逻辑 + const newExamList: Exam[] = examList.map((exam) => { + if (exam.examId === examId && exam.publishStatus === 1) { + return { ...exam, publishStatus: 2 }; // 修正为 publishStatus + } + return exam; + }); + setExamList(newExamList); + }; + + const handleDeleteSingle = (examId: number) => { + // 实现单条数据删除逻辑 + const newExamList = examList.filter((exam) => exam.examId !== examId); + setExamList(newExamList); + }; + + // 处理全选和取消全选 + const handleSelectAll = (checked: boolean) => { + if (checked) { + setSelectedRows(examList.map((exam) => exam.examId)); + } else { + setSelectedRows([]); + } + }; + + // 判断是否全选 + const isAllSelected = examList.length > 0 && selectedRows.length === examList.length; + + const columns = [ + { + title: ( + handleSelectAll(e.target.checked)} + /> + ), + dataIndex: 'examId', + key: 'examId', + render: (cellValue: number, record: Exam) => ( + { + if (e.target.checked) { + setSelectedRows([...selectedRows, record.examId]); + } else { + setSelectedRows(selectedRows.filter((id) => id !== record.examId)); + } + }} + /> + ), + }, + // 新增序号列 + { + title: '序号', + key: 'index', + render: (cellValue: unknown, record: Exam, index: number) => (pagination.current - 1) * pagination.pageSize + index + 1, + }, + { + title: '考试名称', + dataIndex: 'examName', + key: 'examName', + render: (text: string, record: Exam) => ( + {text} + ), + }, + { + title: '试卷名称', + dataIndex: 'paperName', + key: 'paperName', + }, + { + title: '监管行业', + dataIndex: 'regulatedIndustry', + key: 'regulatedIndustry', + }, + { + title: '考试区域', + dataIndex: 'examRegion', + key: 'examRegion', + }, + { + title: '考试有效时间', + dataIndex: 'validFrom', + key: 'validFrom', + }, + { + title: '考试无效时间', + dataIndex: 'validTo', + key: 'validTo', + }, + { + title: '考试时长', + dataIndex: 'examDuration', + key: 'examDuration', + }, + { + title: '状态', + dataIndex: 'publishStatus', + key: 'publishStatus', + render: (publishStatus: 0 | 1 | 2) => { + console.log(publishStatus) + switch (publishStatus) { + case 0: + return '待发布'; + case 1: + return '已发布'; + case 2: + return '已撤回'; + default: + return ''; + } + }, + }, + { + title: '操作', + key: 'action', + render: (cellValue: number, record: Exam) => ( + + ), + }, + ]; + + const handleTableChange = (pagination: any) => { + setPagination(pagination); + handleSearch(pagination.current); + }; + + return ( +
+
+ + setSearchForm({ ...searchForm, examName: e.target.value }) + } + style={{ width: 150, marginRight: 8 }} + /> + + setSearchForm({ ...searchForm, paperName: e.target.value }) + } + style={{ width: 150, marginRight: 8 }} + /> + + + setSearchForm({ ...searchForm, validTime: value }) + } + style={{ marginRight: 8 }} + /> + + +
+
+ + + + +
+ + setQrCodeVisible(false)} + footer={null} + > + {/**/} + + + ); +}; + +export default withRouter(ExamListPage); \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/compoents/city.js b/packages/examination/src/views/exam-online/compoents/city.js new file mode 100644 index 0000000..1c57f4a --- /dev/null +++ b/packages/examination/src/views/exam-online/compoents/city.js @@ -0,0 +1,1618 @@ +// 地址文件 + +export const provice = [ + { + name: "北京市", + city: [ + { + name: "北京市", + + } + ] + }, + { + name: "天津市", + city: [ + { + name: "天津市", + + } + ] + }, + { + name: "上海市", + city: [ + { + name: "上海市", + + } + ] + }, + { + name: "重庆市", + city: [ + { + name: "重庆市", + + } + ] + }, + { + name: "河北省", + city: [ + { + name: "石家庄市", + + }, + { + name: "张家口市", + + }, + { + name: "承德市", + + }, + { + name: "秦皇岛市", + + }, + { + name: "唐山市", + + }, + { + name: "廊坊市", + + }, + { + name: "保定市", + + }, + { + name: "衡水市", + + }, + { + name: "沧州市", + + }, + { + name: "邢台市", + + }, + { + name: "邯郸市", + + } + ] + }, + { + name: "山西省", + city: [ + { + name: "太原市", + + }, + { + name: "朔州市", + + }, + { + name: "大同市", + + }, + { + name: "阳泉市", + + }, + { + name: "长治市", + + }, + { + name: "晋城市", + + }, + { + name: "忻州市", + + }, + { + name: "晋中市", + + }, + { + name: "临汾市", + + }, + { + name: "吕梁市", + + }, + { + name: "运城市", + + } + ] + }, + { + name: "内蒙古", + city: [ + { + name: "呼和浩特市", + + }, + { + name: "包头市", + + }, + { + name: "乌海市", + + }, + { + name: "赤峰市", + + }, + { + name: "通辽市", + + }, + { + name: "呼伦贝尔市", + + }, + { + name: "鄂尔多斯市", + + }, + { + name: "乌兰察布市", + + }, + { + name: "巴彦淖尔市", + + }, + { + name: "兴安盟", + + }, + { + name: "锡林郭勒盟", + + }, + { + name: "阿拉善盟", + + } + ] + }, + { + name: "辽宁省", + city: [ + { + name: "沈阳市", + + }, + { + name: "朝阳市", + + }, + { + name: "阜新市", + + }, + { + name: "铁岭市", + + }, + { + name: "抚顺市", + + }, + { + name: "本溪市", + + }, + { + name: "辽阳市", + + }, + { + name: "鞍山市", + + }, + { + name: "丹东市", + + }, + { + name: "大连市", + + }, + { + name: "营口市", + + }, + { + name: "盘锦市", + + }, + { + name: "锦州市", + + }, + { + name: "葫芦岛市", + + } + ] + }, + { + name: "吉林省", + city: [ + { + name: "长春市", + + }, + { + name: "白城市", + + }, + { + name: "松原市", + + }, + { + name: "吉林市", + + }, + { + name: "四平市", + + }, + { + name: "辽源市", + + }, + { + name: "通化市", + + }, + { + name: "白山市", + + }, + { + name: "延边州", + + } + ] + }, + { + name: "黑龙江省", + city: [ + { + name: "哈尔滨市", + + }, + { + name: "齐齐哈尔市", + + }, + { + name: "七台河市", + + }, + { + name: "黑河市", + + }, + { + name: "大庆市", + + }, + { + name: "鹤岗市", + + }, + { + name: "伊春市", + + }, + { + name: "佳木斯市", + + }, + { + name: "双鸭山市", + + }, + { + name: "鸡西市", + + }, + { + name: "牡丹江市", + + }, + { + name: "绥化市", + + }, + { + name: "大兴安岭地区", + + } + ] + }, + { + name: "江苏省", + city: [ + { + name: "南京市", + + }, + { + name: "徐州市", + + }, + { + name: "连云港市", + + }, + { + name: "宿迁市", + + }, + { + name: "淮安市", + + }, + { + name: "盐城市", + + }, + { + name: "扬州市", + + }, + { + name: "泰州市", + + }, + { + name: "南通市", + + }, + { + name: "镇江市", + + }, + { + name: "常州市", + + }, + { + name: "无锡市", + + }, + { + name: "苏州市", + + } + ] + }, + { + name: "浙江省", + city: [ + { + name: "杭州市", + + }, + { + name: "湖州市", + + }, + { + name: "嘉兴市", + + }, + { + name: "舟山市", + + }, + { + name: "宁波市", + + }, + { + name: "绍兴市", + + }, + { + name: "衢州市", + + }, + { + name: "金华市", + + }, + { + name: "台州市", + + }, + { + name: "温州市", + + }, + { + name: "丽水市", + + } + ] + }, + { + name: "安徽省", + city: [ + { + name: "合肥市", + + }, + { + name: "宿州市", + + }, + { + name: "淮北市", + + }, + { + name: "亳州市", + + }, + { + name: "阜阳市", + + }, + { + name: "蚌埠市", + + }, + { + name: "淮南市", + + }, + { + name: "滁州市", + + }, + { + name: "马鞍山市", + + }, + { + name: "芜湖市", + + }, + { + name: "铜陵市", + + }, + { + name: "安庆市", + + }, + { + name: "黄山市", + + }, + { + name: "六安市", + + }, + { + name: "巢湖市", + + }, + { + name: "池州市", + + }, + { + name: "宣城市", + + } + ] + }, + { + name: "福建省", + city: [ + { + name: "福州市", + + }, + { + name: "南平市", + + }, + { + name: "莆田市", + + }, + { + name: "三明市", + + }, + { + name: "泉州市", + + }, + { + name: "厦门市", + + }, + { + name: "漳州市", + + }, + { + name: "龙岩市", + + }, + { + name: "宁德市", + + } + ] + }, + { + name: "江西省", + city: [ + { + name: "南昌市", + + }, + { + name: "九江市", + + }, + { + name: "景德镇市", + + }, + { + name: "鹰潭市", + + }, + { + name: "新余市", + + }, + { + name: "萍乡市", + + }, + { + name: "赣州市", + + }, + { + name: "上饶市", + + }, + { + name: "抚州市", + + }, + { + name: "宜春市", + + }, + { + name: "吉安市", + + } + ] + }, + { + name: "山东省", + city: [ + { + name: "济南市", + + }, + { + name: "青岛市", + + }, + { + name: "聊城市", + + }, + { + name: "德州市", + + }, + { + name: "东营市", + + }, + { + name: "淄博市", + + }, + { + name: "潍坊市", + + }, + { + name: "烟台市", + + }, + { + name: "威海市", + + }, + { + name: "日照市", + + }, + { + name: "临沂市", + + }, + { + name: "枣庄市", + + }, + { + name: "济宁市", + + }, + { + name: "泰安市", + + }, + { + name: "莱芜市", + + }, + { + name: "滨州市", + + }, + { + name: "菏泽市", + + } + ] + }, + { + name: "河南省", + city: [ + { + name: "郑州市", + + }, + { + name: "开封市", + + }, + { + name: "三门峡市", + + }, + { + name: "洛阳市", + + }, + { + name: "焦作市", + + }, + { + name: "新乡市", + + }, + { + name: "鹤壁市", + + }, + { + name: "安阳市", + + }, + { + name: "濮阳市", + + }, + { + name: "商丘市", + + }, + { + name: "许昌市", + + }, + { + name: "漯河市", + + }, + { + name: "平顶山市", + + }, + { + name: "南阳市", + + }, + { + name: "信阳市", + + }, + { + name: "周口市", + + }, + { + name: "驻马店市", + + }, + { + name: "济源市", + + } + ] + }, + { + name: "湖北省", + city: [ + { + name: "武汉市", + + }, + { + name: "十堰市", + + }, + { + name: "襄樊市", + + }, + { + name: "荆门市", + + }, + { + name: "孝感市", + + }, + { + name: "黄冈市", + + }, + { + name: "鄂州市", + + }, + { + name: "黄石市", + + }, + { + name: "咸宁市", + + }, + { + name: "荆州市", + + }, + { + name: "宜昌市", + + }, + { + name: "随州市", + + }, + { + name: "省直辖县级行政单位", + + }, + { + name: "恩施州", + + } + ] + }, + { + name: "湖南省", + city: [ + { + name: "长沙市", + + }, + { + name: "张家界市", + + }, + { + name: "常德市", + + }, + { + name: "益阳市", + + }, + { + name: "岳阳市", + + }, + { + name: "株洲市", + + }, + { + name: "湘潭市", + + }, + { + name: "衡阳市", + + }, + { + name: "郴州市", + + }, + { + name: "永州市", + + }, + { + name: "邵阳市", + + }, + { + name: "怀化市", + + }, + { + name: "娄底市", + + }, + { + name: "湘西州", + + } + ] + }, + { + name: "广东省", + city: [ + { + name: "广州市", + + }, + { + name: "深圳市", + + }, + { + name: "清远市", + + }, + { + name: "韶关市", + + }, + { + name: "河源市", + + }, + { + name: "梅州市", + + }, + { + name: "潮州市", + + }, + { + name: "汕头市", + + }, + { + name: "揭阳市", + + }, + { + name: "汕尾市", + + }, + { + name: "惠州市", + + }, + { + name: "东莞市", + + }, + { + name: "珠海市", + + }, + { + name: "中山市", + + }, + { + name: "江门市", + + }, + { + name: "佛山市", + + }, + { + name: "肇庆市", + + }, + { + name: "云浮市", + + }, + { + name: "阳江市", + + }, + { + name: "茂名市", + + }, + { + name: "湛江市", + + } + ] + }, + { + name: "广西", + city: [ + { + name: "南宁市", + + }, + { + name: "桂林市", + + }, + { + name: "柳州市", + + }, + { + name: "梧州市", + + }, + { + name: "贵港市", + + }, + { + name: "玉林市", + + }, + { + name: "钦州市", + + }, + { + name: "北海市", + + }, + { + name: "防城港市", + + }, + { + name: "崇左市", + + }, + { + name: "百色市", + + }, + { + name: "河池市", + + }, + { + name: "来宾市", + + }, + { + name: "贺州市", + + } + ] + }, + { + name: "海南省", + city: [ + { + name: "海口市", + + }, + { + name: "三亚市", + + }, + { + name: "省直辖行政单位", + + } + ] + }, + { + name: "四川省", + city: [ + { + name: "成都市", + + }, + { + name: "广元市", + + }, + { + name: "绵阳市", + + }, + { + name: "德阳市", + + }, + { + name: "南充市", + + }, + { + name: "广安市", + + }, + { + name: "遂宁市", + + }, + { + name: "内江市", + + }, + { + name: "乐山市", + + }, + { + name: "自贡市", + + }, + { + name: "泸州市", + + }, + { + name: "宜宾市", + + }, + { + name: "攀枝花市", + + }, + { + name: "巴中市", + + }, + { + name: "达州市", + + }, + { + name: "资阳市", + + }, + { + name: "眉山市", + + }, + { + name: "雅安市", + + }, + { + name: "阿坝州", + + }, + { + name: "甘孜州", + + }, + { + name: "凉山州", + + } + ] + }, + { + name: "贵州省", + city: [ + { + name: "贵阳市", + + }, + { + name: "六盘水市", + + }, + { + name: "遵义市", + + }, + { + name: "安顺市", + + }, + { + name: "毕节地区", + + }, + { + name: "铜仁地区", + + }, + { + name: "黔东南州", + + }, + { + name: "黔南州", + + }, + { + name: "黔西南州", + + } + ] + }, + { + name: "云南省", + city: [ + { + name: "昆明市", + + }, + { + name: "曲靖市", + + }, + { + name: "玉溪市", + + }, + { + name: "保山市", + + }, + { + name: "昭通市", + + }, + { + name: "丽江市", + + }, + { + name: "思茅市", + + }, + { + name: "临沧市", + + }, + { + name: "德宏州", + + }, + { + name: "怒江州", + + }, + { + name: "迪庆州", + + }, + { + name: "大理州", + + }, + { + name: "楚雄州", + + }, + { + name: "红河州", + + }, + { + name: "文山州", + + }, + { + name: "西双版纳州", + + } + ] + }, + { + name: "西藏", + city: [ + { + name: "拉萨市", + + }, + { + name: "那曲地区", + + }, + { + name: "昌都地区", + + }, + { + name: "林芝地区", + + }, + { + name: "山南地区", + + }, + { + name: "日喀则地区", + + }, + { + name: "阿里地区", + + } + ] + }, + { + name: "陕西省", + city: [ + { + name: "西安市", + + }, + { + name: "延安市", + + }, + { + name: "铜川市", + + }, + { + name: "渭南市", + + }, + { + name: "咸阳市", + + }, + { + name: "宝鸡市", + + }, + { + name: "汉中市", + + }, + { + name: "榆林市", + + }, + { + name: "安康市", + + }, + { + name: "商洛市", + + } + ] + }, + { + name: "甘肃省", + city: [ + { + name: "兰州市", + + }, + { + name: "嘉峪关市", + + }, + { + name: "白银市", + + }, + { + name: "天水市", + + }, + { + name: "武威市", + + }, + { + name: "酒泉市", + + }, + { + name: "张掖市", + + }, + { + name: "庆阳市", + + }, + { + name: "平凉市", + + }, + { + name: "定西市", + + }, + { + name: "陇南市", + + }, + { + name: "临夏州", + + }, + { + name: "甘南州", + + } + ] + }, + { + name: "青海省", + city: [ + { + name: "西宁市", + + }, + { + name: "海东地区", + + }, + { + name: "海北州", + + }, + { + name: "海南州", + + }, + { + name: "黄南州", + + }, + { + name: "果洛州", + + }, + { + name: "玉树州", + + }, + { + name: "海西州", + + } + ] + }, + { + name: "宁夏", + city: [ + { + name: "银川市", + + }, + { + name: "石嘴山市", + + }, + { + name: "吴忠市", + + }, + { + name: "固原市", + + }, + { + name: "中卫市", + + } + ] + }, + { + name: "新疆", + city: [ + { + name: "乌鲁木齐市", + + }, + { + name: "克拉玛依市", + + }, + { + name: "自治区直辖县级行政单位", + + }, + { + name: "喀什地区", + + }, + { + name: "阿克苏地区", + + }, + { + name: "和田地区", + + }, + { + name: "吐鲁番地区", + + }, + { + name: "哈密地区", + + }, + { + name: "克孜勒苏柯州", + + }, + { + name: "博尔塔拉州", + + }, + { + name: "昌吉州", + + }, + { + name: "巴音郭楞州", + + }, + { + name: "伊犁州", + + }, + { + name: "塔城地区", + + }, + { + name: "阿勒泰地区", + + } + ] + }, + { + name: "香港", + city: [ + { + name: "香港特别行政区", + + } + ] + }, + { + name: "澳门", + city: [ + { + name: "澳门特别行政区", + + } + ] + }, + { + name: "台湾省", + city: [ + { + name: "台北", + + }, + { + name: "高雄", + + }, + { + name: "台中", + + }, + { + name: "花莲", + + }, + { + name: "基隆", + + }, + { + name: "嘉义", + + }, + { + name: "金门", + + }, + { + name: "连江", + + }, + { + name: "苗栗", + + }, + { + name: "南投", + + }, + { + name: "澎湖", + + }, + { + name: "屏东", + + }, + { + name: "台东", + + }, + { + name: "台南", + + }, + { + name: "桃园", + + }, + { + name: "新竹", + + }, + { + name: "宜兰", + + }, + { + name: "云林", + + }, + { + name: "彰化", + + } + ] + } +]; \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/exam-add.tsx b/packages/examination/src/views/exam-online/exam-add.tsx new file mode 100644 index 0000000..5fba006 --- /dev/null +++ b/packages/examination/src/views/exam-online/exam-add.tsx @@ -0,0 +1,34 @@ +import React, { Component } from "react"; +import ExamEditPage from "./compoents/ExamEditPage"; +interface States { + resData: any + visible: boolean + title: string + current: any +} + +class ExamAdd extends Component { + constructor(props: any) { + super(props); + this.state = { + resData: undefined, + visible: false, + title: '', + current: {} + } + } + + componentDidMount() { + // this.getList() + } + + render() { + return ( +
+ +
+ ) + } +} + +export default ExamAdd; \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/exam-edit.tsx b/packages/examination/src/views/exam-online/exam-edit.tsx new file mode 100644 index 0000000..64377bf --- /dev/null +++ b/packages/examination/src/views/exam-online/exam-edit.tsx @@ -0,0 +1,34 @@ +import React, { Component } from "react"; +import ExamEditPage from "./compoents/ExamEditPage"; +interface States { + resData: any + visible: boolean + title: string + current: any +} + +class ExamEdit extends Component { + constructor(props: any) { + super(props); + this.state = { + resData: undefined, + visible: false, + title: '', + current: {} + } + } + + componentDidMount() { + // this.getList() + } + + render() { + return ( +
+ +
+ ) + } +} + +export default ExamEdit; \ No newline at end of file diff --git a/packages/examination/src/views/exam-online/exam-schedule.tsx b/packages/examination/src/views/exam-online/exam-schedule.tsx new file mode 100644 index 0000000..821783c --- /dev/null +++ b/packages/examination/src/views/exam-online/exam-schedule.tsx @@ -0,0 +1,35 @@ +import React, { Component } from "react"; +import ExamListPage from "./compoents/ExamListPage"; + +interface States { + resData: any + visible: boolean + title: string + current: any +} + +class ExamSchedule extends Component { + constructor(props: any) { + super(props); + this.state = { + resData: undefined, + visible: false, + title: '新增公告', + current: {} + } + } + + componentDidMount() { + // this.getList() + } + + render() { + return ( +
+ +
+ ) + } +} + +export default ExamSchedule; \ No newline at end of file diff --git a/packages/examination/src/views/slider/menu.tsx b/packages/examination/src/views/slider/menu.tsx index 73b3292..8a58c53 100644 --- a/packages/examination/src/views/slider/menu.tsx +++ b/packages/examination/src/views/slider/menu.tsx @@ -34,6 +34,17 @@ const menuList = [ } ] }, + { + title: '线上考试', + key: 'exam-online', + // icon: 'icon-peizhi', + subs: [ + { + title: '考试安排', + key: 'exam-schedule', + } + ] + }, { title: '订单管理', key: 'order_mag',