Skip to content

Commit

Permalink
fix: pc-tool save bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guhao committed Apr 24, 2023
1 parent 104c2ba commit 47a1b40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion frontend/pc-tool/src/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export async function saveObject(config: any) {
let url = '/api/annotate/data/save';
let data = await post(url, config);
data = data.data || [];
console.log(data);
let keyMap = {} as Record<string, Record<string, string>>;
data.forEach((e: any) => {
let dataId = e.dataId;
Expand Down
8 changes: 4 additions & 4 deletions frontend/pc-tool/src/common/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class Editor extends BaseEditor {
});
this.showMsg('success', this.lang('save-ok'));
} catch (e: any) {
console.error(e);
this.showMsg('error', this.lang('save-error'));
}
bsState.saving = false;
Expand All @@ -102,19 +103,19 @@ export default class Editor extends BaseEditor {
Object.keys(keyMap).forEach((dataId) => {
let dataKeyMap = keyMap[dataId];
let annotates = this.dataManager.getFrameObject(dataId) || [];
annotates.forEach((annotate:any) => {
annotates.forEach((annotate: any) => {
let frontId = annotate.uuid;
let backId = dataKeyMap[frontId];
if (!backId) return;
annotate.id = backId;
annotate.userData.backId = backId;
// annotate.uuid = backId;
});
});
}
async getResultSources(frame?: IFrame) {
let { state } = this;
frame = frame || this.getCurrentFrame();
if(!frame.sources){
if (!frame.sources) {
let sources = await api.getResultSources(frame.id);
sources.unshift({
name: 'Without Task',
Expand All @@ -125,7 +126,6 @@ export default class Editor extends BaseEditor {
}
this.setSources(frame.sources);


// let sourceMap = {};
// sources.forEach((e) => {
// sourceMap[e.sourceId] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ export function classificationToSave(classification: IClassification) {
};
});

console.log(data);
return data;
}
export function isAttrVisible(
Expand Down

0 comments on commit 47a1b40

Please sign in to comment.