資產管理 : 過濾無效檔案、更新資產編輯和圖表資料來源的處理邏輯
This commit is contained in:
parent
8243900f96
commit
2dfc2e5297
@ -148,13 +148,15 @@ const edit = async (id) => {
|
|||||||
// changeParams({ ...searchParams.value, main_id: record.id });
|
// changeParams({ ...searchParams.value, main_id: record.id });
|
||||||
const res = await getAssetSingle(id);
|
const res = await getAssetSingle(id);
|
||||||
if (res.isSuccess) {
|
if (res.isSuccess) {
|
||||||
res.data.oriFile = res.data.oriFile.map((file, index) => ({
|
res.data.oriFile = res.data.oriFile
|
||||||
...file,
|
.filter((file) => file.saveName)
|
||||||
key: index,
|
.map((file, index) => ({
|
||||||
src: file.file_url,
|
...file,
|
||||||
name: file.orgName,
|
key: index,
|
||||||
ext: file.saveName.split(".")[file.saveName.split(".").length - 1],
|
src: file.file_url,
|
||||||
}));
|
name: file.orgName,
|
||||||
|
ext: file.saveName.split(".")[file.saveName.split(".").length - 1],
|
||||||
|
}));
|
||||||
res.data.sub_device = res.data.sub_device?.map(
|
res.data.sub_device = res.data.sub_device?.map(
|
||||||
({ device_number, points }) => ({
|
({ device_number, points }) => ({
|
||||||
device_number,
|
device_number,
|
||||||
|
@ -32,7 +32,9 @@ const getMenuData = async () => {
|
|||||||
const getData = async (id) => {
|
const getData = async (id) => {
|
||||||
const res = await getGraphData(id);
|
const res = await getGraphData(id);
|
||||||
if (res.isSuccess) {
|
if (res.isSuccess) {
|
||||||
dataSource.value = res.data.map((d) => ({ ...d, key: d.id }));
|
dataSource.value = res.data
|
||||||
|
.filter((d) => d.oriSavName)
|
||||||
|
.map((d) => ({ ...d, key: d.id }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user