Browse Source

feat/지역 검색 기능 추가

master
sanguu516 2 months ago
parent
commit
8dcea3b708
  1. 81
      src/components/flight/ControlApprovalsTable.js
  2. 29
      src/components/flight/NewFlightApprovalsReport.js
  3. 25
      src/containers/flight/ControlApprovalsContainer.js
  4. 23
      src/containers/flight/OperationApprovalsContainer.js
  5. 13
      src/redux/features/laanc/laancSlice.ts
  6. 3
      src/redux/features/laanc/laancState.ts
  7. 4
      src/redux/features/laanc/laancThunk.ts

81
src/components/flight/ControlApprovalsTable.js

@ -261,7 +261,7 @@ export default function ControlApprovalsTable(props) {
), ),
dataIndex: 'areaList', dataIndex: 'areaList',
align: 'center', align: 'center',
width: '85px', width: '90px',
render: areaList => { render: areaList => {
return areaList.length <= 1 ? ( return areaList.length <= 1 ? (
<> <>
@ -291,6 +291,40 @@ export default function ControlApprovalsTable(props) {
return text ? text : '-'; return text ? text : '-';
} }
}, },
{
title: (
<>
요청 <br />
반경
<br />
(m이내)
</>
),
dataIndex: 'reqRadius',
align: 'center',
width: '80px',
editable: true,
render: (text, record) => {
return text ? text : '-';
}
},
{
title: (
<>
허용 <br />
반경
<br />
(m이내)
</>
),
dataIndex: 'fltElev',
align: 'center',
width: '80px',
editable: true,
render: (text, record) => {
return text ? text : '-';
}
},
{ {
title: ( title: (
<> <>
@ -300,7 +334,7 @@ export default function ControlApprovalsTable(props) {
(m이하) (m이하)
</> </>
), ),
dataIndex: 'fltElev', dataIndex: 'allowRadius',
align: 'center', align: 'center',
width: '80px', width: '80px',
editable: true, editable: true,
@ -313,12 +347,14 @@ export default function ControlApprovalsTable(props) {
<> <>
최고비행 최고비행
<br /> <br />
해발고도 (m) 해발고도
<br />
(m)
</> </>
), ),
dataIndex: 'fltElevMax', dataIndex: 'fltElevMax',
align: 'center', align: 'center',
width: '80px', width: '90px',
render: (text, record) => { render: (text, record) => {
return text ? text : '-'; return text ? text : '-';
} }
@ -586,7 +622,7 @@ export default function ControlApprovalsTable(props) {
{ {
align: 'center', align: 'center',
width: '85px', width: '90px',
dataIndex: ['lat', 'lon'], dataIndex: ['lat', 'lon'],
render: (text, record) => { render: (text, record) => {
const lat = record.lat; const lat = record.lat;
@ -603,18 +639,42 @@ export default function ControlApprovalsTable(props) {
dataIndex: 'bufferZone', dataIndex: 'bufferZone',
align: 'center', align: 'center',
editable: true, editable: true,
width: '80px' width: '80px',
render: text => {
return text ? text : <>-</>;
}
},
{
dataIndex: 'reqRadius',
align: 'center',
editable: true,
width: '80px',
render: text => {
return text ? text : <>-</>;
}
},
{
dataIndex: 'allowRadius',
align: 'center',
editable: true,
width: '80px',
render: text => {
return text ? text : <>-</>;
}
}, },
{ {
dataIndex: 'fltElev', dataIndex: 'fltElev',
align: 'center', align: 'center',
editable: true, editable: true,
width: '80px' width: '80px',
render: text => {
return text ? text : <>-</>;
}
}, },
{ {
dataIndex: 'fltElevMax', dataIndex: 'fltElevMax',
align: 'center', align: 'center',
width: '80px', width: '90px',
render: text => { render: text => {
return text ? text : <>-</>; return text ? text : <>-</>;
} }
@ -737,6 +797,8 @@ export default function ControlApprovalsTable(props) {
fltElev: item.fltElev, fltElev: item.fltElev,
rm: item.rm, rm: item.rm,
era: item.era, era: item.era,
reqRadius: item.reqRadius,
allowRadius: item.allowRadius,
fltElevMax: item.fltElevMax, fltElevMax: item.fltElevMax,
purpose: item.purpose, purpose: item.purpose,
reviewedType: item.reviewedType, reviewedType: item.reviewedType,
@ -1124,6 +1186,7 @@ export default function ControlApprovalsTable(props) {
await dispatch( await dispatch(
updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' }) updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' })
); );
setCheckList([]);
await dispatch( await dispatch(
getLaancAprvList({ getLaancAprvList({
searchStDt: props.startDate, searchStDt: props.startDate,
@ -1260,7 +1323,7 @@ export default function ControlApprovalsTable(props) {
rowExpandable: record => record?.areaList?.length > 1 rowExpandable: record => record?.areaList?.length > 1
}} }}
scroll={{ scroll={{
x: 1600 x: 1700
}} }}
rowHoverable={false} rowHoverable={false}
expandIconColumnIndex={-1} expandIconColumnIndex={-1}

29
src/components/flight/NewFlightApprovalsReport.js

@ -83,8 +83,13 @@ export default function NewFlightApprovalsReport(props) {
type='select' type='select'
id='filterArea' id='filterArea'
bsSize='sm' bsSize='sm'
value={props.filterArea} value={props.filterArea.ctprvn}
onChange={e => props.setFilterArea(e.target.value)} onChange={e =>
props.setFilterArea({
...props.filterArea,
ctprvn: e.target.value
})
}
> >
{Object.values(CityCategories).map(city => ( {Object.values(CityCategories).map(city => (
<option key={city} value={city}> <option key={city} value={city}>
@ -98,10 +103,15 @@ export default function NewFlightApprovalsReport(props) {
type='select' type='select'
id='district' id='district'
bsSize='sm' bsSize='sm'
value={props.district} value={props.filterArea.sig}
onChange={e => props.setDistrict(e.target.value)} onChange={e =>
props.setFilterArea({
...props.filterArea,
sig: e.target.value
})
}
> >
{DistrictCategories[props.filterArea]?.map(district => ( {DistrictCategories[props.filterArea.ctprvn]?.map(district => (
<option key={district} value={district}> <option key={district} value={district}>
{district} {district}
</option> </option>
@ -113,8 +123,13 @@ export default function NewFlightApprovalsReport(props) {
type='text' type='text'
bsSize='sm' bsSize='sm'
placeholder='주소를 입력해주세요.' placeholder='주소를 입력해주세요.'
value={props.filterId} value={props.filterArea.address}
onChange={e => props.setFilterId(e.target.value)} onChange={e =>
props.setFilterArea({
...props.filterArea,
address: e.target.value
})
}
onKeyPress={handleKeyDown} onKeyPress={handleKeyDown}
/> />
</div> </div>

25
src/containers/flight/ControlApprovalsContainer.js

@ -64,11 +64,13 @@ export default function ControlApprovalsContainer({ mode }) {
const [filterId, setFilterId] = useState(''); const [filterId, setFilterId] = useState('');
// 지역 // 지역
const [filterArea, setFilterArea] = useState('전체'); const [filterArea, setFilterArea] = useState({
ctprvn: '전체',
// 시군구 sig: '전체',
const [district, setDistrict] = useState('전체'); address: ''
});
console.log('>>>', filterArea);
const { map, mapType } = useSelector(state => state.mapState); const { map, mapType } = useSelector(state => state.mapState);
// popup // popup
@ -77,7 +79,6 @@ export default function ControlApprovalsContainer({ mode }) {
const popupRef = useRef(null); const popupRef = useRef(null);
const rightMenuRef = useRef(null); const rightMenuRef = useRef(null);
const savedRightMenuRef = useRef(null); const savedRightMenuRef = useRef(null);
const [clientX, setClientX] = useState(0);
// 비행구역 데이터블록 // 비행구역 데이터블록
const [dataBlocks, setDataBlocks] = useState([]); const [dataBlocks, setDataBlocks] = useState([]);
@ -242,7 +243,9 @@ export default function ControlApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea, ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address,
approvalCd: approvalCd:
search === '승인' search === '승인'
? 'S' ? 'S'
@ -258,7 +261,9 @@ export default function ControlApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea, ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address,
applyNo: search applyNo: search
}) })
); );
@ -267,7 +272,9 @@ export default function ControlApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address
}) })
); );
} }
@ -504,8 +511,6 @@ export default function ControlApprovalsContainer({ mode }) {
handleDragEnd={handleDragEnd} handleDragEnd={handleDragEnd}
filterId={filterId} filterId={filterId}
setFilterId={setFilterId} setFilterId={setFilterId}
district={district}
setDistrict={setDistrict}
filterArea={filterArea} filterArea={filterArea}
setFilterArea={setFilterArea} setFilterArea={setFilterArea}
/> />

23
src/containers/flight/OperationApprovalsContainer.js

@ -76,10 +76,11 @@ export default function OperationApprovalsContainer({ mode }) {
const [filterId, setFilterId] = useState(''); const [filterId, setFilterId] = useState('');
// 지역 // 지역
const [filterArea, setFilterArea] = useState('전체'); const [filterArea, setFilterArea] = useState({
ctprvn: '전체',
// 시군구 sig: '전체',
const [district, setDistrict] = useState('전체'); address: ''
});
const { map, mapType } = useSelector(state => state.mapState); const { map, mapType } = useSelector(state => state.mapState);
@ -267,7 +268,9 @@ export default function OperationApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea, ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address,
approvalCd: approvalCd:
search === '승인' search === '승인'
? 'S' ? 'S'
@ -283,7 +286,9 @@ export default function OperationApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea, ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address,
applyNo: search applyNo: search
}) })
); );
@ -292,7 +297,9 @@ export default function OperationApprovalsContainer({ mode }) {
getLaancAprvList({ getLaancAprvList({
searchStDt: searchDate.startDate, searchStDt: searchDate.startDate,
searchEndDt: searchDate.endDate, searchEndDt: searchDate.endDate,
selectZone: filterArea ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn,
sig: filterArea.sig === '전체' ? '' : filterArea.sig,
address: filterArea.address
}) })
); );
} }
@ -879,8 +886,6 @@ export default function OperationApprovalsContainer({ mode }) {
handleDragEnd={handleDragEnd} handleDragEnd={handleDragEnd}
filterId={filterId} filterId={filterId}
setFilterId={setFilterId} setFilterId={setFilterId}
district={district}
setDistrict={setDistrict}
filterArea={filterArea} filterArea={filterArea}
setFilterArea={setFilterArea} setFilterArea={setFilterArea}
/> />

13
src/redux/features/laanc/laancSlice.ts

@ -413,12 +413,13 @@ const laancSlice = createSlice({
state.laancAprvList = action.payload as ILaancAprvListRs[]; state.laancAprvList = action.payload as ILaancAprvListRs[];
state.laancAprvLoading = false; state.laancAprvLoading = false;
}); });
builder.addCase(updateLaancAprvReview.pending, (state, action) => { // builder.addCase(updateLaancAprvReview.pending, (state, action) => {
state.laancAprvLoading = true; // state.laancAprvLoading = true;
}); // });
builder.addCase(updateLaancAprvReview.fulfilled, (state, action) => { // builder.addCase(updateLaancAprvReview.fulfilled, (state, action) => {
state.laancAprvLoading = false;
}); // state.laancAprvLoading = false;
// });
} }
}); });

3
src/redux/features/laanc/laancState.ts

@ -631,6 +631,9 @@ export interface ILaancAprvListRq {
searchStDt: string; searchStDt: string;
searchEndDt: string; searchEndDt: string;
approvalCd: string; approvalCd: string;
ctprvn?: string;
sig?: string;
adress?: string;
} }
export interface ILaancAprvListRs { export interface ILaancAprvListRs {

4
src/redux/features/laanc/laancThunk.ts

@ -288,7 +288,8 @@ export const getLaancAprvList = createAsyncThunk(
era: item.areaList[0].era, era: item.areaList[0].era,
dtl: item.areaList[0].dtl, dtl: item.areaList[0].dtl,
planAreaSno: item.areaList[0].planAreaSno, planAreaSno: item.areaList[0].planAreaSno,
reqRadius: item.areaList[0].reqRadius,
allowRadius: item.areaList[0].allowRadius,
fltElevMax: fltElevMax:
!item.areaList[0].fltElevMax && !item.areaList[0].fltElevMax &&
item.areaList[0].approvalCd === 'U' item.areaList[0].approvalCd === 'U'
@ -353,6 +354,7 @@ export const updateLaancAprvReview = createAsyncThunk(
try { try {
const data: { any } = await axios.patch(`api/bas/dos/plan/reviewed`, rq); const data: { any } = await axios.patch(`api/bas/dos/plan/reviewed`, rq);
console.log('>>', data); console.log('>>', data);
return data; return data;
} catch (error) { } catch (error) {
openModal({ openModal({

Loading…
Cancel
Save