| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 | /** * Created by Mai on 2017/3/8. */// 获取用户全部项目数据var GetAllProjectData = function (callback) {    $.ajax({        type:"POST",        url: '/pm/api/getProjects',        data: {'data': JSON.stringify({"user_id": userID, "compilation": compilationData._id})},        dataType: 'json',        cache: false,        timeout: 50000,        success: function(result){            if (result.error === 0) {                callback(result.data);                //Tree = $.fn.treeTable.init(table, ProjTreeSetting, result.data);            } else {                alert('error: ' + result.message);            }        },        error: function(jqXHR, textStatus, errorThrown){            alert('error ' + textStatus + " " + errorThrown);        }    });}// 更新数据到服务器var UpdateProjectData = function (updateData, callback) {    $.ajax({        type:"POST",        url: '/pm/api/updateProjects',        data: {'data': JSON.stringify({"user_id": userID, "updateData": updateData})},        dataType: 'json',        cache: false,        timeout: 50000,        success: function(result){            if (result.error === 0) {                callback(result.data);            } else {                alert('error: ' + result.message);            }        },        error: function(jqXHR, textStatus, errorThrown){            alert('error ' + textStatus + " " + errorThrown);        }    });};// 重命名项目var RenameProject_ajax = function(projId, newName, callback) {    $.ajax({        type: "POST",        url: '/pm/api/renameProject',        data: {'data': JSON.stringify({"user_id": userID, "id": projId, "newName": newName})},        dataType: 'json',        cache: false,        timeout: 15000,        success: function(result){            if (result.error === 0) {                callback();            } else {                alert('error' + result.message);            }        },        error: function(iqXHR, textStatus, errorThrown){            alert('error ' + textStatus + " " + errorThrown)        }    });};// 打开项目前,提交数据var BeforeOpenProject = function (projId, updateData, callback) {    $.ajax({        type: "POST",        url: '/pm/api/beforeOpenProject',        data: {'data': JSON.stringify({"user_id": userID, "proj_id": projId, "updateData": updateData})},        dataType: 'json',        cache: false,        timeout: 15000,        success: function (result) {            if (result.error === 0) {                callback();            } else {                alert('error' + result.message);            }        },        error: function(iqXHR, textStatus, errorThrown){            alert('error ' + textStatus + " " + errorThrown)        }    });}function moveProjects(data,callback) {    CommonAjax.post( '/pm/api/moveProject',data,callback)}
 |