|
@@ -1,4 +1,4 @@ |
|
|
// material-ui |
|
|
|
|
|
|
|
|
// material-uistatus |
|
|
import { |
|
|
import { |
|
|
Button, |
|
|
Button, |
|
|
Grid, TextField, |
|
|
Grid, TextField, |
|
@@ -22,17 +22,17 @@ import {FormattedMessage, useIntl} from "react-intl"; |
|
|
const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { |
|
|
const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { |
|
|
const intl = useIntl(); |
|
|
const intl = useIntl(); |
|
|
const [type, setType] = React.useState([]); |
|
|
const [type, setType] = React.useState([]); |
|
|
const [status, setStatus] = React.useState([{ key: 0, label: 'all', type: 'all' }]); |
|
|
|
|
|
|
|
|
const [status, setStatus] = React.useState({ key: 0, label: 'all', type: 'all' }); |
|
|
|
|
|
|
|
|
const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); |
|
|
const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom); |
|
|
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); |
|
|
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); |
|
|
const [selectedLabelsString, setSelectedLabelsString] = React.useState(''); |
|
|
|
|
|
|
|
|
// const [selectedLabelsString, setSelectedLabelsString] = React.useState(''); |
|
|
|
|
|
|
|
|
const { reset, register, handleSubmit } = useForm() |
|
|
const { reset, register, handleSubmit } = useForm() |
|
|
const marginBottom = 2.5; |
|
|
const marginBottom = 2.5; |
|
|
|
|
|
|
|
|
const onSubmit = (data) => { |
|
|
const onSubmit = (data) => { |
|
|
data.status = selectedLabelsString |
|
|
|
|
|
|
|
|
data.status = status.type; |
|
|
let typeArray = []; |
|
|
let typeArray = []; |
|
|
|
|
|
|
|
|
for (let i = 0; i < type.length; i++) { |
|
|
for (let i = 0; i < type.length; i++) { |
|
@@ -52,7 +52,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { |
|
|
|
|
|
|
|
|
function resetForm() { |
|
|
function resetForm() { |
|
|
setType([]); |
|
|
setType([]); |
|
|
setStatus([{ key: 0, label: 'All', labelCht: "全部", type: 'all' }]); |
|
|
|
|
|
|
|
|
setStatus({ key: 0, label: 'All', labelCht: "全部", type: 'all' }); |
|
|
reset(); |
|
|
reset(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -150,8 +150,39 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { |
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<Autocomplete |
|
|
|
|
|
{...register("status")} |
|
|
|
|
|
id="status" |
|
|
|
|
|
size="small" |
|
|
|
|
|
// filterOptions={(options)=>options} |
|
|
|
|
|
options={ |
|
|
|
|
|
localStorage.getItem('userData').creditor ? |
|
|
|
|
|
ComboData.publicNoticeStatic_Creditor : |
|
|
|
|
|
ComboData.publicNoticeStatic |
|
|
|
|
|
} |
|
|
|
|
|
value={status} |
|
|
|
|
|
// inputValue={status?.labelCht} |
|
|
|
|
|
getOptionLabel={(option) => intl.formatMessage({id: option.label})} |
|
|
|
|
|
onChange={(event, newValue) => { |
|
|
|
|
|
setStatus(newValue); |
|
|
|
|
|
}} |
|
|
|
|
|
renderInput={(params) => ( |
|
|
|
|
|
<TextField {...params} |
|
|
|
|
|
label={intl.formatMessage({id: 'status'})} |
|
|
|
|
|
aria-label={intl.formatMessage({id: 'status'})} |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
)} |
|
|
|
|
|
// InputLabelProps={{ |
|
|
|
|
|
// shrink: true |
|
|
|
|
|
// }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
{/* <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
<Autocomplete |
|
|
<Autocomplete |
|
|
multiple |
|
|
multiple |
|
|
{...register("status")} |
|
|
{...register("status")} |
|
@@ -198,15 +229,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { |
|
|
// shrink: true |
|
|
// shrink: true |
|
|
// }} |
|
|
// }} |
|
|
/> |
|
|
/> |
|
|
</Grid> |
|
|
|
|
|
{/*<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:3}}>*/} |
|
|
|
|
|
{/* <TextField*/} |
|
|
|
|
|
{/* fullWidth*/} |
|
|
|
|
|
{/* {...register("subDivisionId")}*/} |
|
|
|
|
|
{/* id="subDivision"*/} |
|
|
|
|
|
{/* label="Sub-Division"*/} |
|
|
|
|
|
{/* />*/} |
|
|
|
|
|
{/*</Grid>*/} |
|
|
|
|
|
|
|
|
</Grid> */} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|