监管行业选项修改

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

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

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

Loading…
Cancel
Save