출발지 도착지
This commit is contained in:
parent
9f97a16d6a
commit
c657d6f7a0
|
|
@ -115,11 +115,13 @@ export function LocationSwapSelectorComponent(props: LocationSwapSelectorProps)
|
||||||
// 코드 관리에서 가져오기
|
// 코드 관리에서 가져오기
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await apiClient.get(`/api/codes/${dataSource.codeCategory}`);
|
const response = await apiClient.get(`/code-management/codes`, {
|
||||||
|
params: { categoryCode: dataSource.codeCategory },
|
||||||
|
});
|
||||||
if (response.data.success && response.data.data) {
|
if (response.data.success && response.data.data) {
|
||||||
const codeOptions = response.data.data.map((code: any) => ({
|
const codeOptions = response.data.data.map((code: any) => ({
|
||||||
value: code.code_value || code.codeValue,
|
value: code.code_value || code.codeValue || code.code,
|
||||||
label: code.code_name || code.codeName,
|
label: code.code_name || code.codeName || code.name,
|
||||||
}));
|
}));
|
||||||
setOptions(codeOptions);
|
setOptions(codeOptions);
|
||||||
}
|
}
|
||||||
|
|
@ -135,13 +137,17 @@ export function LocationSwapSelectorComponent(props: LocationSwapSelectorProps)
|
||||||
// 테이블에서 가져오기
|
// 테이블에서 가져오기
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await apiClient.get(`/api/dynamic/${dataSource.tableName}`, {
|
const response = await apiClient.get(`/dynamic-form/list/${dataSource.tableName}`, {
|
||||||
params: { pageSize: 1000 },
|
params: { page: 1, pageSize: 1000 },
|
||||||
});
|
});
|
||||||
if (response.data.success && response.data.data) {
|
if (response.data.success && response.data.data) {
|
||||||
const tableOptions = response.data.data.map((row: any) => ({
|
// data가 배열인지 또는 data.rows인지 확인
|
||||||
value: row[dataSource.valueField || "id"],
|
const rows = Array.isArray(response.data.data)
|
||||||
label: row[dataSource.labelField || "name"],
|
? response.data.data
|
||||||
|
: response.data.data.rows || [];
|
||||||
|
const tableOptions = rows.map((row: any) => ({
|
||||||
|
value: String(row[dataSource.valueField || "id"] || ""),
|
||||||
|
label: String(row[dataSource.labelField || "name"] || ""),
|
||||||
}));
|
}));
|
||||||
setOptions(tableOptions);
|
setOptions(tableOptions);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue