fix:bug修复

main
zhoulexin 4 months ago
parent af698f336d
commit 6816292feb

@ -505,8 +505,9 @@ function Annotation(sceneMeta, world, frameInfo) {
if (this.readyState != 4) return;
if (this.status == 200) {
console.log('状态??',microData.labelState)
// 未标注状态
if(!microData.labelState || microData.labelState === '0'){
if(!microData.labelState || microData.labelState !== '1'){
document.getElementById("changed-mark").style.display = "block";
document.getElementById("save-submit").style.display = "block";
}

@ -190,29 +190,39 @@ var Header = function (
saveWorldList(this.data.worldList);
};
this.ui.querySelector("#save-submit").onclick = () => {
let confirm = window.confirm("确认提交?")
let confirm = window.confirm("请确保每个结构都已保存,确认提交?")
const microData = window.microApp.getData()
if(confirm){
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.status == 200){
console.log('提交成功')
window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() })
}
// 自动保存一次再提交
const saveButton = document.getElementById('save-button');
if (saveButton) {
saveButton.click();
}
xhr.open(
"POST",
`${http.requestHttp}/project/label`,
true
);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('authorization', http.token);
xhr.send(JSON.stringify({
dataId:microData.dataId,
type:1,
label:'',
taskId:microData.taskId,
}));
let timeOut = setTimeout(() => {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.status == 200){
console.log('提交成功')
saveButton.style.display = 'none'
document.getElementById('save-submit').style.display = 'none'
// window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() })
}
}
xhr.open(
"POST",
`${http.requestHttp}/project/label`,
true
);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('authorization', http.token);
xhr.send(JSON.stringify({
id:microData.dataId,
type:1,
label:'',
taskId:microData.taskId,
}));
clearTimeout(timeOut);
}, 1000);
}
};
// 通过
@ -228,12 +238,14 @@ var Header = function (
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (this.status == 200){
window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() })
// window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() })
document.getElementById('save-pass').style.display = 'none'
document.getElementById('save-reject').style.display = 'none'
}
}
xhr.open(
"POST",
`${http.requestHttp}/project/qc?dataId=${microData.dataId}&type=${type}&taskId=${microData.taskId}`,
`${http.requestHttp}/project/qc?id=${microData.dataId}&type=${type}&taskId=${microData.taskId}`,
true
);
xhr.setRequestHeader('Content-Type', 'application/json');

@ -93,7 +93,6 @@ function doSaveWorldList(worldList, done) {
label: JSON.stringify(w.annotation.toBoxAnnotations()),
};
});
console.log(ann,'ann')
var xhr = new XMLHttpRequest();
xhr.open("POST", http.requestHttp + "/project/frameSave", true);
xhr.setRequestHeader("Content-Type","application/json")
@ -137,9 +136,9 @@ function deduplicatePreferString(array) {
const map = new Map();
array.forEach(item => {
const key = String(item.id);
const key = String(item.frameId);
// 如果还没有这个key或者已存在的不是string类型而当前的是string类型
if (!map.has(key) || (typeof map.get(key).id !== 'string' && typeof item.id === 'string')) {
if (!map.has(key) || (typeof map.get(key).frameId !== 'string' && typeof item.frameId === 'string')) {
map.set(key, item);
}
});

Loading…
Cancel
Save