监管行业选项修改

main
liuyiliang 3 months ago
parent 8cb58645cd
commit 342de14da4
  1. 8
      packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx
  2. 8
      packages/examination/src/views/exam-online/compoents/ExamListPage.tsx
  3. 8
      packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx

@ -24,7 +24,7 @@ const ExamDetailAnalysisPage: React.FC = () => {
const [examName, setExamName] = useState(''); const [examName, setExamName] = useState('');
const [paperName, setPaperName] = useState(''); const [paperName, setPaperName] = useState('');
const [examArea, setExamArea] = useState(''); const [examArea, setExamArea] = useState('');
const [industry, setIndustry] = useState(''); const [industry, setIndustry] = useState(null);
const [industryOptions, setIndustryOptions] = useState<{ value: string; label: string }[]>([]); const [industryOptions, setIndustryOptions] = useState<{ value: string; label: string }[]>([]);
const [tableData, setTableData] = useState<ExamDataItem[]>([]); const [tableData, setTableData] = useState<ExamDataItem[]>([]);
const [pagination, setPagination] = useState({ const [pagination, setPagination] = useState({
@ -62,7 +62,7 @@ const ExamDetailAnalysisPage: React.FC = () => {
setExamName(''); setExamName('');
setPaperName(''); setPaperName('');
setExamArea(''); setExamArea('');
setIndustry(''); setIndustry(null);
handleSearch(); handleSearch();
}; };
@ -70,7 +70,7 @@ const ExamDetailAnalysisPage: React.FC = () => {
const param = { const param = {
examName:examName, examName:examName,
paperName:paperName, paperName:paperName,
industry:industry, industry:!industry ? '' : industry,
examArea:examArea, examArea:examArea,
} }
const fetchData = async () => { const fetchData = async () => {
@ -205,8 +205,8 @@ const ExamDetailAnalysisPage: React.FC = () => {
value={industry} value={industry}
onChange={(value) => setIndustry(value)} onChange={(value) => setIndustry(value)}
style={{ width: 150 }} // 调整下拉框宽度 style={{ width: 150 }} // 调整下拉框宽度
allowClear
> >
<Option key="" value=""></Option>
{industryOptions.map((option) => ( {industryOptions.map((option) => (
<Option key={option.value} value={option.value}> <Option key={option.value} value={option.value}>
{option.label} {option.label}

@ -29,7 +29,7 @@ const ExamListPage = ({ history }: { history: any }) => {
const [searchForm, setSearchForm] = useState({ const [searchForm, setSearchForm] = useState({
examName: '', examName: '',
paperName: '', paperName: '',
regulatedIndustry: '', regulatedIndustry: null,
validTime: null as Moment | null, // 修改为 Moment 类型 validTime: null as Moment | null, // 修改为 Moment 类型
}); });
const [selectedRows, setSelectedRows] = useState<number[]>([]); const [selectedRows, setSelectedRows] = useState<number[]>([]);
@ -62,7 +62,7 @@ const ExamListPage = ({ history }: { history: any }) => {
setSearchForm({ setSearchForm({
examName: '', examName: '',
paperName: '', paperName: '',
regulatedIndustry: '', regulatedIndustry: null,
validTime: null, validTime: null,
}); });
setPagination({ ...pagination, current: 1 }); setPagination({ ...pagination, current: 1 });
@ -77,7 +77,7 @@ const ExamListPage = ({ history }: { history: any }) => {
const params = { const params = {
examName: searchForm.examName, examName: searchForm.examName,
paperName: searchForm.paperName, paperName: searchForm.paperName,
regulatedIndustry: searchForm.regulatedIndustry, regulatedIndustry: !searchForm.regulatedIndustry ? '' : searchForm.regulatedIndustry,
validDate: searchForm.validTime ? searchForm.validTime.format('YYYY-MM-DD') : '' // 使用 moment 的 format 方法 validDate: searchForm.validTime ? searchForm.validTime.format('YYYY-MM-DD') : '' // 使用 moment 的 format 方法
}; };
@ -512,8 +512,8 @@ const ExamListPage = ({ history }: { history: any }) => {
setSearchForm({...searchForm, regulatedIndustry: value}) setSearchForm({...searchForm, regulatedIndustry: value})
} }
style={{width: 240}} style={{width: 240}}
allowClear
> >
<Option key="" value=""></Option>
{industryOptions.map(option => ( {industryOptions.map(option => (
<Option key={option.value} value={option.value}> <Option key={option.value} value={option.value}>
{option.label} {option.label}

@ -23,7 +23,7 @@ export type PaperAnalysisDataItem = {
const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => { const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
const [paperName, setPaperName] = useState(''); const [paperName, setPaperName] = useState('');
const [industry, setIndustry] = useState(''); const [industry, setIndustry] = useState(null);
const [industryOptions, setIndustryOptions] = useState<{ value: string; label: string }[]>([]); const [industryOptions, setIndustryOptions] = useState<{ value: string; label: string }[]>([]);
const [tableData, setTableData] = useState<PaperAnalysisDataItem[]>([]); const [tableData, setTableData] = useState<PaperAnalysisDataItem[]>([]);
const [pagination, setPagination] = useState({ const [pagination, setPagination] = useState({
@ -55,7 +55,7 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
const handleReset = () => { const handleReset = () => {
setPaperName(''); setPaperName('');
setIndustry(''); setIndustry(null);
setTableData(tableData); setTableData(tableData);
setPagination({ setPagination({
...pagination, ...pagination,
@ -76,7 +76,7 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
const handleSearch = () => { const handleSearch = () => {
const param = { const param = {
paperName:paperName, paperName:paperName,
industry:industry, industry:!industry ? '' : industry
} }
const fetchData = async () => { const fetchData = async () => {
try { try {
@ -161,8 +161,8 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
value={industry} value={industry}
onChange={(value) => setIndustry(value)} onChange={(value) => setIndustry(value)}
style={{ width: 300 }} style={{ width: 300 }}
allowClear
> >
<Option key="" value=""></Option>
{industryOptions.map((option) => ( {industryOptions.map((option) => (
<Option key={option.value} value={option.value}> <Option key={option.value} value={option.value}>
{option.label} {option.label}

Loading…
Cancel
Save