cyril.tsui 1 рік тому
джерело
коміт
60a73a73d7
1 змінених файлів з 14 додано та 8 видалено
  1. +14
    -8
      src/pages/PublicNotice/Search_GLD/SearchForm.js

+ 14
- 8
src/pages/PublicNotice/Search_GLD/SearchForm.js Переглянути файл

@@ -45,8 +45,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
dateFrom: data.dateFrom,
dateTo: data.dateTo,
contact: data.contact,
// status: (status?.type && status?.type != 'all') ? status?.type : "",
status: data.status,
status: (data.status === '' || data.status.includes("all")) ? "" : data.status,
orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "",
issueId: issueSelected?.id,
groupNo: data.groupNo,
@@ -197,12 +196,19 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
value={selectedStatus}
onChange={(event, newValue) => {
console.log(newValue)
const selectedLabels = newValue.map(option => option.type);
const selectedLabelsString = `${selectedLabels.join(',')}`;
console.log(selectedLabelsString)
setSelectedStatus(newValue);
setSelectedLabelsString(selectedLabelsString);
const findAllIndex = newValue.findIndex((ele) => {
return ele.type === "all"
})

if (findAllIndex > -1) {
setSelectedStatus([newValue[findAllIndex]]);
setSelectedLabelsString('all')
} else {
const selectedLabels = newValue.map(option => option.type);
const selectedLabelsString = `${selectedLabels.join(',')}`;
setSelectedStatus(newValue);
setSelectedLabelsString(selectedLabelsString);
}
}}
getOptionLabel={(option) => option.label}
renderInput={(params) => (


Завантаження…
Відмінити
Зберегти