|
|
|
|
@ -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');
|
|
|
|
|
|