|
@@ -4829,34 +4829,14 @@ $("#confirm-import").click(function() {
|
|
|
|
|
|
async function startImportProject(key) {
|
|
async function startImportProject(key) {
|
|
try {
|
|
try {
|
|
- console.log("start Import");
|
|
|
|
let result = await ajaxPost("/pm/api/importProject",{key:key,updateData:projTreeObj.getImportProjectDate()});
|
|
let result = await ajaxPost("/pm/api/importProject",{key:key,updateData:projTreeObj.getImportProjectDate()});
|
|
- setTimeout(importProcessChecking,2000);
|
|
|
|
|
|
+ importProcessChecking(key);
|
|
}catch (error){
|
|
}catch (error){
|
|
alert(error);
|
|
alert(error);
|
|
- $.bootstrapLoading.end();
|
|
|
|
}finally {
|
|
}finally {
|
|
STATE.importing = false;
|
|
STATE.importing = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- async function importProcessChecking() {
|
|
|
|
- let result = await ajaxPost("/pm/api/importProcessChecking",{key:key,user_id:userID});
|
|
|
|
- if(result.error == 1){
|
|
|
|
- let message = result.msg?result.msg:result.message;
|
|
|
|
- setTimeout(function () {
|
|
|
|
- $.bootstrapLoading.progressEnd();//不做这个的话太快,页面不会自动关闭
|
|
|
|
- },500);
|
|
|
|
- alert(message)
|
|
|
|
- }else if(result.error == 0){
|
|
|
|
- if(result.status == "processing"){
|
|
|
|
- setTimeout(importProcessChecking,2000);
|
|
|
|
- }else if(result.status == "complete"){
|
|
|
|
- $.bootstrapLoading.progressEnd();
|
|
|
|
- refreshAllPage();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
|
|
|
|
$("#import_project_data").change(function(){
|
|
$("#import_project_data").change(function(){
|
|
@@ -5040,6 +5020,49 @@ function refreshProjSummary(project, summaryInfo) {
|
|
projTreeObj.refreshNodeData(refreshNodes);
|
|
projTreeObj.refreshNodeData(refreshNodes);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$(function () {
|
|
$(function () {
|
|
if(isShow) $('#welcomePage').modal('show');//是否显示欢迎页
|
|
if(isShow) $('#welcomePage').modal('show');//是否显示欢迎页
|
|
-});
|
|
|
|
|
|
+ $('#importChongqing').click(async function () {
|
|
|
|
+ if (STATE.importing) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ STATE.importing = true;
|
|
|
|
+ $('#welcomePage').modal('hide');
|
|
|
|
+ try {
|
|
|
|
+ let key = uuid.v1();
|
|
|
|
+ $.bootstrapLoading.progressStart("欢迎使用大司空云计价",true);
|
|
|
|
+ $("#progress_modal_body").text("正在导入测评项目,请稍候……");
|
|
|
|
+ let result = await ajaxPost("/pm/api/importChongqingProject",{user_id: userID,key:key});
|
|
|
|
+ importProcessChecking(key);
|
|
|
|
+ }catch (error){
|
|
|
|
+ alert(error);
|
|
|
|
+ }finally {
|
|
|
|
+ STATE.importing = false;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+async function importProcessChecking(key) {
|
|
|
|
+ setTimeout(checking,2000)
|
|
|
|
+ async function checking() {
|
|
|
|
+ let result = await ajaxPost("/pm/api/importProcessChecking",{key:key,user_id:userID});
|
|
|
|
+ if(result.error == 1){
|
|
|
|
+ let message = result.msg?result.msg:result.message;
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ $.bootstrapLoading.progressEnd();//不做这个的话太快,页面不会自动关闭
|
|
|
|
+ },500);
|
|
|
|
+ alert(message)
|
|
|
|
+ }else if(result.error == 0){
|
|
|
|
+ if(result.status == "processing"){
|
|
|
|
+ setTimeout(checking,2000);
|
|
|
|
+ }else if(result.status == "complete"){
|
|
|
|
+ $.bootstrapLoading.progressEnd();
|
|
|
|
+ refreshAllPage();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|