var userid = $.cookie("userid");
var tId = GetQueryString("id");
//分享关注按钮
$('.shareWeixin').hover(function () {
$('.shareCode').stop(true, false).fadeToggle();
});
$(function () {
loginStatus(); //判断个人是否登录
// if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
// location.href="http://" + window.location.host + "/e/p.html?id="+tId;
// }
function subjectShow(data) {
if (data != undefined && data.length != 0) {
var subs = strToAry(data)
if (subs.length > 0) {
for (var i = 0; i < subs.length; i++) {
$("#subjectShow").append("
" + subs[i] + "");
};
}
}
}
function industryShow(data) {
if (data != undefined && data.length != 0) {
var subs = strToAry(data)
if (subs.length > 0) {
for (var i = 0; i < subs.length; i++) {
$("#industryShow").append("" + subs[i] + "
");
};
}
}
}
var pageNo = 1,
pagePerNo = 1,
rows = 20,
rowsTen = 10,
secretaryId = '',
chiefId = ''
var memberArr = {},
paperArr = [],
patentArr = [],
unpatentArr = []
var oAjax = function (url, dataS, otype, oFun, beforeFun, completeFun, async) {
$.ajax({
async: async ==null ? true : async,
url: url,
dataType: 'json',
type: otype,
data: dataS,
traditional: true,
beforeSend: beforeFun,
success: function (res) {
if (res.success) {
oFun(res)
}
},
complete: completeFun
});
},
insertNodata = function (targetE, newStr) {
var parent = document.getElementById(targetE).parentNode;
var kong = document.createElement("div");
kong.className = "con-kong";
kong.innerHTML = '' +
'暂时没有符合该搜索条件的内容
'
if (newStr) {
kong.querySelector(".txtbox").innerHTML = newStr;
}
if (parent.firstChild.className == "con-kong") {
return
} else {
parent.insertBefore(kong, parent.firstChild);
}
},
removeNodata = function (targetE) {
var parent = document.getElementById(targetE).parentNode;
if (parent.firstChild.className == "con-kong") {
parent.removeChild(parent.firstChild);
} else {
return
}
},
getUserInfo = function () {
oAjax("/ajax/team/qo", {
id: tId
}, "get", function (data) {
var $info = data.data;
$("#proName").text($info.name);
if ($info.city) {
$("#proAddress").html($info.city + "");
}
$("#proOther").text($info.orgName);
document.title = $info.name + "-科袖网"
//简介
if ($info.descp) {
$("#descpS").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
$("#descpS").text($info.descp);
}
//学术领域
if ($info.subject) {
$("#subjectShow").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
subjectShow($info.subject);
}
//行业领域
if ($info.industry) {
$("#industryShow").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
industryShow($info.industry);
}
var weibotitle = $info.name;
var weibourl = window.location.href;
var weibopic = "";
$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + weibotitle + "&url=" + weibourl + "&pic=" + weibopic + "&ralateUid=6242830109&searchPic=false&style=simple");
});
},
professorListVal = function (isbind, ff) {
var aimId = "expertli",
aimIdF = "teamMembers",
newStr = ""
oAjax("/ajax/team/pro", {
id: tId,
pageSize: 30,
pageNo: pageNo,
}, "get", function (res) {
var $info = res.data.data;
console.log($info)
if ($info.length > 0) {
$("#" + aimId).parent().find(".js-load-more").show();
$("#" + aimIdF).parent().find(".js-load-more").show();
if (res.data.pageNo !== pageNo) {
if (ff) {
$("#" + aimIdF).parent().find(".js-load-more").unbind("click");
$("#" + aimIdF).parent().find(".js-load-more").hide();
} else {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
$("#" + aimIdF).parent().find(".js-load-more").unbind("click");
$("#" + aimIdF).parent().find(".js-load-more").hide();
}
return
}
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
var item = $info[i].professor;
memberArr[item] = {};
if ($info[i].secretary) {
secretaryId = $info[i].professor
}
if ($info[i].chief) {
chiefId = $info[i].professor
}
}
// console.log($info[i])
if (ff) {
detailPro(aimIdF, 1)
} else {
detailPro(aimId)
detailPro(aimIdF, 1)
}
}
if (isbind) {
if (ff) {
$("#" + aimIdF).parent().find(".js-load-more").unbind("click").on("click", function () {
pageNo++
professorListVal(false)
})
} else {
$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
pageNo++
professorListVal(false)
})
$("#" + aimIdF).parent().find(".js-load-more").unbind("click").on("click", function () {
pageNo++
professorListVal(false)
})
}
}
if ($info.length < rowsTen) {
if (ff) {
$("#" + aimIdF).parent().find(".js-load-more").unbind("click");
$("#" + aimIdF).parent().find(".js-load-more").hide();
} else {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
$("#" + aimIdF).parent().find(".js-load-more").unbind("click");
$("#" + aimIdF).parent().find(".js-load-more").hide();
}
}
}, function () {
if (ff) {
$("#" + aimIdF).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimIdF).parent().find(".js-load-more").addClass("active");
} else {
$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimId).parent().find(".js-load-more").addClass("active");
$("#" + aimIdF).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimIdF).parent().find(".js-load-more").addClass("active");
}
}, function () {
if (ff) {
$("#" + aimIdF).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimIdF).parent().find(".js-load-more").removeClass("active");
} else {
$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimId).parent().find(".js-load-more").removeClass("active");
$("#" + aimIdF).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimIdF).parent().find(".js-load-more").removeClass("active");
}
})
},
searchProfessor = function () {
var keyt = $('#searchMe').val()
if (keyt === '') {
return
}
var aimId = "searchMembers"
oAjax("/ajax/team/pro/search", {
"team": tId,
"key": keyt,
"authType": 1,
"rows": 10
}, "get", function (res) {
var $info = res.data;
if ($info.length > 0) {
removeNodata(aimId);
$("#" + aimId).html('')
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
var li4 = ''
if ($info[i].id in memberArr) {
li4 = '已添加'
} else {
li4 = '添加'
}
var ownerSty = "",
ownerSt = "",
hasImg = "../images/default-photo.jpg"
var userType = autho($info[i].authType, $info[i].orgAuth, $info[i].authStatus);
ownerSt = userType.title;
ownerSty = userType.sty;
if ($info[i].hasHeadImage) {
hasImg = "/images/head/" + $info[i].id + "_l.jpg"
}
var title = $info[i].title || "";
var orgName = $info[i].orgName || "";
var office = $info[i].office || "";
if (title != "") {
var ttitle = title + ",";
} else {
if (office != "") {
var ttitle = office + ",";
} else {
var ttitle = office;
}
}
if (orgName != "") {
orgName = orgName;
}
var itemlist = '';
itemlist += ''
itemlist += '';
itemlist += '';
itemlist += '
';
itemlist += '' + $info[i].name + '';
itemlist += '
';
itemlist += '
' + ttitle + orgName + '
';
itemlist += '
';
itemlist += ''
itemlist += li4
itemlist += '
'
itemlist += '';
$("#" + aimId).append(itemlist)
}
} else {
$("#" + aimId).hide()
insertNodata(aimId);
}
})
},
unpatentListVal = function (isbind) {
var aimId = "proUnPatent",
newStr = "尚未关联任何非专利成果"
oAjax("/ajax/team/resResult", {
id: tId,
pageSize: rows,
pageNo: pagePerNo,
}, "get", function (res) {
var $info = res.data.data;
$("#showUnPatent").html("")
if ($info.length > 0) {
if (res.data.total > 0 && res.data.total < 99) {
$("#unpatCount").text(res.data.total);
if (res.data.total == 0 || res.data.total == 1) {
$("#unpatCount").text('');
}
}
if (res.data.total > 99) {
// $("#unpatCount").text("99+");
}
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
unpatentArr.push($info[i].researchResult)
}
detailUnPat(aimId)
} else {
$("#showUnPatent").parents('.otherShow').hide()
}
var liLen = document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if ($info.length == 0 && liLen == 0) {
$("#" + aimId).hide()
insertNodata(aimId, newStr);
}
if (isbind) {
$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
pagePerNo++
unpatentListVal(false)
})
}
if ($info.length < rows) {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
}
}, function () {
$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimId).parent().find(".js-load-more").addClass("active");
}, function () {
$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimId).parent().find(".js-load-more").removeClass("active");
})
},
searchUnPatent = function () { //收缩
var keyt = $('#searchUnPatentKey').val()
if (keyt === '') {
return
}
var aimId = "searchUnPatent"
oAjax("/ajax/team/resResult/search", {
"team": tId,
"key": keyt,
"status": ['1'],
"pageSize": 10,
"pageNo": 1
}, "get", function (res) {
var $info = res.data.data;
if ($info.length > 0) {
removeNodata(aimId);
$("#" + aimId).html('')
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
var li4 = ''
if (unpatentArr.indexOf($info[i].id) > -1) {
li4 = '已添加'
} else {
li4 = '添加'
}
var resIM = ''
if ($info[i].pic) {
var src = '/data/researchResult' + $info[i].pic.split(",")[0]
resIM = '';
}
var itemlist = '';
itemlist += '';
itemlist += resIM
itemlist += '';
itemlist += '
' + $info[i].name + '
';
itemlist += '
研究者:
';
itemlist += '
所属机构:
';
itemlist += '
';
itemlist += ''
itemlist += li4
itemlist += '
'
itemlist += '';
var $itemlist = $(itemlist);
$("#" + aimId).append($itemlist)
console.log($info[i])
queryResearcher($info[i].id, $info[i])
if ($info[i].orgId) {
queryReseOrgName($info[i].orgId, $itemlist)
}
}
} else {
$("#" + aimId).hide()
insertNodata(aimId);
}
})
},
patentListVal = function (isbind) {
var aimId = "proPatent",
newStr = "尚未关联任何专利成果"
oAjax("/ajax/team/patent", {
id: tId,
pageSize: rows,
pageNo: pagePerNo,
}, "get", function (res) {
$("#showPatent").html("")
var $info = res.data.data;
if ($info.length > 0) {
if (res.data.total > 0 && res.data.total < 99) {
$("#patCount").text(res.data.total);
}
if (res.data.total > 99) {
$("#patCount").text("99+");
}
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
patentArr.push($info[i].patent)
}
detailPat(aimId)
} else {
$("#showPatent").parents('.otherShow').hide()
}
var liLen = document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if ($info.length == 0 && liLen == 0) {
$("#" + aimId).hide()
insertNodata(aimId, newStr);
}
if (isbind) {
$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
pagePerNo++
patentListVal(false)
})
}
if ($info.length < rows) {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
}
}, function () {
$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimId).parent().find(".js-load-more").addClass("active");
}, function () {
$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimId).parent().find(".js-load-more").removeClass("active");
})
},
searchPatent = function () {
var keyt = $('#searchPatentKey').val()
if (keyt === '') {
return
}
var aimId = "searchPatent"
oAjax("/ajax/team/patent/search", {
"team": tId,
"key": keyt,
"rows": 10
}, "get", function (res) {
var $info = res.data;
if ($info.length > 0) {
removeNodata(aimId);
$("#" + aimId).html('')
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
var li4 = ''
if (patentArr.indexOf($info[i].id) > -1) {
li4 = '已添加'
} else {
li4 = '添加'
}
var itemlist = '';
itemlist += '';
itemlist += '';
itemlist += '
' + $info[i].name + '
';
itemlist += '
发明人:' + $info[i].authors.substring(0, $info[i].authors.length - 1) + '
';
itemlist += '
申请人:' + $info[i].reqPerson + '
';
itemlist += '
';
itemlist += ''
itemlist += li4
itemlist += '
'
itemlist += '';
$("#" + aimId).append(itemlist)
}
} else {
$("#" + aimId).hide()
insertNodata(aimId);
}
})
},
paperListVal = function (isbind) {
var aimId = "proPaper",
newStr = "尚未关联任何论文"
oAjax("/ajax/team/paper", {
id: tId,
pageSize: rows,
pageNo: pagePerNo
}, "get", function (res) {
var $info = res.data.data;
$("#showPaper").html("")
if ($info.length > 0) {
if (res.data.total > 0 && res.data.total < 99) {
$("#parCount").text(res.data.total);
}
if (res.data.total > 99) {
$("#parCount").text("99+");
}
if (res.data.pageNo !== pagePerNo) {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
return
}
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
paperArr.push($info[i].paper)
}
detailPer(aimId)
} else {
$("#showPaper").parents(".otherShow").hide()
}
var liLen = document.getElementById(aimId).querySelectorAll("li").length;
removeNodata(aimId);
if ($info.length == 0 && liLen == 0) {
$("#" + aimId).hide()
insertNodata(aimId, newStr);
}
if (isbind) {
$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
pagePerNo++
paperListVal(false)
})
}
if ($info.length < rows) {
$("#" + aimId).parent().find(".js-load-more").unbind("click");
$("#" + aimId).parent().find(".js-load-more").hide();
}
}, function () {
$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
$("#" + aimId).parent().find(".js-load-more").addClass("active");
}, function () {
$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
$("#" + aimId).parent().find(".js-load-more").removeClass("active");
})
},
searchPaper = function () {
var keyt = $('#searchPaperKey').val()
if (keyt === '') {
return
}
var aimId = "searchPaper"
oAjax("/ajax/team/paper/search", {
"team": tId,
"key": keyt,
"rows": 10
}, "get", function (res) {
var $info = res.data;
if ($info.length > 0) {
removeNodata(aimId);
$("#" + aimId).html('')
$("#" + aimId).show()
for (var i = 0; i < $info.length; i++) {
var li4 = ''
if (paperArr.indexOf($info[i].id) > -1) {
li4 = '已添加'
} else {
li4 = '添加'
}
var moreInf = ""
if (!$info[i].cn4periodical) {
$info[i].cn4periodical = "";
}
if (!$info[i].en4periodical) {
$info[i].en4periodical = "";
}
if (!$info[i].pubDay) {
$info[i].pubDay = "";
}
moreInf = $info[i].cn4periodical + " " + $info[i].en4periodical + " " + $info[i].pubDay;
var itemlist = '';
itemlist += '';
itemlist += '';
itemlist += '
' + $info[i].name + '
';
itemlist += '
作者:' + $info[i].authors.substring(0, $info[i].authors.length - 1) + '
';
itemlist += '
期刊:' + moreInf + '
';
itemlist += '
';
itemlist += ''
itemlist += li4
itemlist += '
'
itemlist += '';
$("#" + aimId).append(itemlist)
}
} else {
$("#" + aimId).hide()
insertNodata(aimId);
}
})
},
detailUnPat = function (obj) {
oAjax("/ajax/resResult/qm", {
id: unpatentArr,
}, "get", function (data) {
var dataStr = data.data;
for (var i = 0; i < dataStr.length; i++) {
if (dataStr[i].status == 1) {
// var $itemlist = $(strAdd);
queryResearcher(dataStr[i].id, dataStr[i])
// queryFeiZhuan(dataStr[i].id, $itemlist) //研究者名称
if (dataStr[i].orgId) {
// queryReseOrgName(dataStr[i].orgId,)
}
}
}
}, function () {}, false);
},
queryResearcher = function (id, dataStr, $list) {
if (id) {
homepageUnPatent(id, dataStr) //主页非专
oAjax("/ajax/resResult/researcher", {
"id": id
}, 'get', function ($data) {
var arr = []
var show
var nameShow
var subject
if ($data.data.length) {
// $list.find('.researchers').parent().removeClass('displayNone')
// $list.find('.researchers').parent().addClass('haha')
for (var i = 0; i < $data.data.length; i++) {
arr.push($data.data[i].name)
var resIM = ''
if (dataStr.pic) {
var src = '/data/researchResult' + dataStr.pic.split(",")[0]
resIM = '';
}
if (dataStr.orgId) { //所属机构渲染
show = '所属机构:' + '
';
} else {
show = '所属机构:' + '
';
}
if (dataStr.subject) { //应用领域渲染
subject = '应用领域:' +dataStr.subject+ '
';
} else {
subject = '应用领域:' + '
';
}
if ($data.data[i].name) {
nameShow = '研究者:' + $data.data[i].name + '
';
} else {
nameShow = '研究者:' + $data.data[i].name + '
';
}
var strAdd = '';
strAdd += '';
strAdd += resIM
strAdd += '' + dataStr.name + '
';
strAdd += nameShow
strAdd += subject
strAdd += show;
strAdd += '
';
strAdd += ''
strAdd += ''
strAdd += '- 取消关联
'
strAdd += '
'
var list = $(strAdd)
$('#proUnPatent').append(list);
orgN(dataStr.orgId, list)
// if (i < 3) {
// $("#showUnPatent").append(list)
// }
}
}
})
}
},
orgN = function (par, $pa) {
$.ajax({
"url": "ajax/org/" + par,
"type": "GET",
"success": function (data) {
console.log(data)
if (data.success) {
$pa.find('.resOrgName').html("所属机构"+ data.data.name)
}
},
"data": {
"id": par
},
dataType: "json",
'error': function () {
$.MsgBox.Alert('提示', '服务器连接超时!');
}
});
}
//主页非专
homepageUnPatent = function (id, dataStr) {
oAjax("/ajax/resResult/researcher", {
"id": id
}, 'get', function ($data) {
var show
var nameShow
var subject
if ($data.data.length) {
// $list.find('.researchers').parent().removeClass('displayNone')
// $list.find('.researchers').parent().addClass('haha')
for (var i = 0; i < $data.data.length; i++) {
var resIM = ''
if (dataStr.pic) {
var src = '/data/researchResult' + dataStr.pic.split(",")[0]
resIM = '';
}
if (dataStr.orgId) { //所属机构渲染
show = '所属机构:' + '
';
} else {
show = '所属机构:' + '
';
}
if (dataStr.subject) { //所属机构渲染
subject = '应用领域:' +subject+ '
';
} else {
subject = '所属机构:' + '
';
}
if ($data.data[i].name) {
nameShow = '研究者:' + $data.data[i].name + '
';
} else {
nameShow = '研究者:' + $data.data[i].name + '
';
}
var strAdd = '';
strAdd += '';
strAdd += resIM
strAdd += '' + dataStr.name + '
';
strAdd += nameShow
strAdd += subject
strAdd += show;
strAdd += '
';
strAdd += ''
strAdd += ''
strAdd += '- 取消关联
'
strAdd += '
'
var list = $(strAdd)
orgN(dataStr.orgId, list)
if (i < 3) {
$("#showUnPatent").append(list)
}
}
}
})
}
queryReseOrgName = function (id, $list) {
if (id) {
cacheModel.getCompany(id, function (sc, value) {
if (sc) {
$list.find(".resOrgName").parent().removeClass('displayNone')
if (value.forShort) {
$list.find(".resOrgName").html(value.forShort)
} else {
$list.find(".resOrgName").html(value.name)
}
}
})
}
},
detailPat = function (obj) {
oAjax("/ajax/ppatent/qm", {
id: patentArr,
}, "get", function (data) {
var dataStr = data.data;
for (var i = 0; i < dataStr.length; i++) {
var strAdd = '';
strAdd += '';
strAdd += '';
strAdd += '' + dataStr[i].name + '
';
strAdd += '
发明人:' + dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) + '
';
strAdd += '
申请人:' + dataStr[i].reqPerson + '
';
strAdd += '
';
strAdd += '';
strAdd += ''
strAdd += '- 取消关联
'
strAdd += '
'
$("#" + obj).append(strAdd)
if (i < 3) {
$("#showPatent").append(strAdd);
}
}
});
},
detailPer = function (obj) {
oAjax("/ajax/ppaper/qm", {
id: paperArr,
}, "get", function (data) {
var dataStr = data.data;
for (var i = 0; i < dataStr.length; i++) {
var moreInf = ""
if (!dataStr[i].cn4periodical) {
dataStr[i].cn4periodical = "";
}
if (!dataStr[i].en4periodical) {
dataStr[i].en4periodical = "";
}
if (!dataStr[i].pubDay) {
dataStr[i].pubDay = "";
}
moreInf = dataStr[i].cn4periodical + " " + dataStr[i].en4periodical + " " + dataStr[i].pubDay
var strAdd = '';
strAdd += '';
strAdd += '';
strAdd += '' + dataStr[i].name + '
';
strAdd += '
作者:' + dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) + '
';
strAdd += '
期刊:' + moreInf + '
';
strAdd += '
';
strAdd += '';
strAdd += ''
strAdd += '- 取消关联
'
strAdd += '
'
if (i < 3) {
$('#showPaper').append(strAdd)
}
$('#' + obj).append(strAdd)
}
});
},
detailPro = function (obj, flag) {
document.getElementById(obj).innerHTML = ""
var li;
for (item in memberArr) {
oAjax("/ajax/professor/info/" + item, null, "get", function (data) {
memberArr[item] = data.data
}, function () {}, function () {}, false)
}
for (item in memberArr) {
if (item != {}) {
var dataStr = memberArr[item]
var dImg = "../images/default-photo.jpg"
if (dataStr.hasHeadImage) {
dImg = "/images/head/" + dataStr.id + "_l.jpg"
}
var li2 = '',
li4 = ""
var tatu;
if (flag === 1) {
if (chiefId === dataStr.id) {
li4 += '首席专家'
} else {
li4 += '设为首席专家'
}
if (secretaryId === dataStr.id) {
li4 += '团队秘书'
} else {
li4 += '设为团队秘书'
li4 += '移出团队'
}
} else {
if (secretaryId === dataStr.id) {
li2 += '团队秘书'
}
if (chiefId === dataStr.id) {
li2 += '首席专家'
}
}
var title = dataStr.title || "";
var orgName = dataStr.orgName || "";
var office = dataStr.office || "";
if (title != "") {
var ttitle = title + ",";
} else {
if (office != "") {
var ttitle = office + ",";
} else {
var ttitle = office;
}
}
if (orgName != "") {
orgName = orgName;
}
var strAdd = '';
strAdd += '';
strAdd += '';
strAdd += '' + dataStr.name + '
';
strAdd += '
' + ttitle + orgName + '
';
strAdd += '
';
strAdd += '' + li2 + '
'
strAdd += '';
strAdd += ''
strAdd += li4
strAdd += '
'
// console.log(chiefId)
if (chiefId === dataStr.id) {
$("#" + obj).prepend(strAdd)
} else {
$("#" + obj).append(strAdd)
}
}
}
},
bindClickFun = function () {
//==== members model =====//
$("#manageMembers").on("click", function () {
$(".questionCover").fadeIn();
$("body").css("position", "fixed");
var btn = document.querySelector('#searchMe')
var st = $('.steptit>a').attr('data-index')
if (btn.value !== '' && st != 1) {
//点击
$('.steptit>a').first().trigger('click') // 自动触发点击事件返回到 tab第一项
}
})
$("#workclose,#btnCancel").on("click", function () {
$(".questionCover").fadeOut();
$("body").css("position", "");
$('#teamMembers').html('')
$('#expertli').html('')
memberArr = {}
pageNo = 1
professorListVal(true)
})
$('.queStep').on('click', '.steptit>a', function () { // a 标签tab切换
$('.queStep .steptit>a').removeClass('active')
$(this).addClass('active')
var st = $(this).attr("data-index")
$('.queStep .quemain .artAbout').addClass('displayNone')
$('.queStep .quemain .artAbout').eq(st).removeClass('displayNone')
if (st === '0') {
memberArr = {}
$('#teamMembers').html('')
pageNo = 1
professorListVal(true, true)
} else if (st === '1') {
$('#searchMembers').html('')
$('#searchMe').val('')
searchProfessor()
}
})
$('.queStep').on('click', '.searchSpan', function () {
searchProfessor()
})
$('.queStep').on('click', '.addThis', function (e) {
var _this = this
var fl = $(this).attr("data-flag")
if (fl === '1') {
var pid = $(this).attr("data-id")
oAjax("/ajax/team/insertPro", {
id: tId,
professor: pid
}, "post", function (data) {
$(_this).addClass("added").text("已添加")
$(_this).attr("data-flag", '0')
})
}
e.stopPropagation()
})
$('.queStep').on('click', '.setAdmin', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "此操作会退出登录,您将是去对该团队的管理权,确认设置团队秘书?", function () {
console.log(tId)
console.log(pid)
oAjax("/ajax/team/secretary", {
id: tId,
newPro: pid
}, "post", function (data) {
if (data.success) {
exit()
location.href = "index.html"
}
})
});
})
$('.queStep').on('click', '.setFirstPro', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "此操作会取消原有首席专家,确认设置首席专家?", function () {
oAjax("/ajax/team/chief", {
id: tId,
newPro: pid
}, "post", function (data) {
if (data.success) {
memberArr = {}
$('#teamMembers').html('')
pageNo = 1
secretaryId = ''
chiefId = ''
professorListVal(true, true)
}
})
});
})
$('.queStep').on('mouseenter', ".cancelTeamSta", function (e) {
$(this).removeClass('authTeamSta').text('取消首席身份')
})
$('.queStep').on('mouseleave', ".cancelTeamSta", function (e) {
$(this).addClass('authTeamSta').text('首席专家')
})
$('.queStep').on('click', '.cancelTeamSta', function () {
$.MsgBox.Confirm("提示", "确认取消首席专家?", function () {
oAjax("/ajax/team/chief", {
id: tId,
newPro: ''
}, "post", function (data) {
if (data.success) {
memberArr = {}
$('#teamMembers').html('')
pageNo = 1
secretaryId = ''
chiefId = ''
professorListVal(true, true)
}
})
});
})
$('.queStep').on('click', '.deloutPro', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "确定将该成员移出团队?", function () {
oAjax("/ajax/team/deletePro", {
id: tId,
professor: pid
}, "post", function (data) {
if (data.success) {
memberArr = {}
$('#teamMembers').html('')
pageNo = 1
secretaryId = ''
chiefId = ''
professorListVal(true, true)
}
})
});
})
//==== members model =====//
$("#updateTeam").on('click', function () {
location.href = "updateTeam.html?id=" + tId
});
$("#delTeam").on('click', function () {
$.MsgBox.Confirm("提示", "确定删除该团队?", function () {
oAjax("/ajax/team/delete", {
id: tId
}, "post", function (data) {
if (data.success) {
location.href = "teamList.html"
}
})
});
});
//==== paper =====//
$('#item5user').on('click', '.steptit>a', function () {
console.log(124)
$('#item5user .steptit>a').removeClass('active')
$(this).addClass('active')
var st = $(this).attr("data-index")
$('#item5user>.otherShow>.aboutRes').addClass('displayNone')
$('#item5user>.otherShow>.aboutRes').eq(st).removeClass('displayNone')
if (st === '0') {
paperArr = []
$('#proPaper').html('')
pagePerNo = 1
paperListVal(true)
} else if (st === '1') {
$('#searchPaper').html('')
$('#searchPaperKey').val('')
searchPaper()
}
})
$('#item5user').on('click', '.searchSpan', function () {
searchPaper()
})
$('#item5user').on('click', 'li.addThis', function () {
var _this = this
var fl = $(this).attr("data-flag")
if (fl === '1') {
var pid = $(this).attr("data-id")
oAjax("/ajax/team/insertPaper", {
id: tId,
paper: pid
}, "post", function (data) {
$(_this).addClass("added").text("已添加")
$(_this).attr("data-flag", '0')
})
}
})
$('#item5user,#showPaper').on('click', '.deloutPro', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "确定取消关联该论文?", function () {
oAjax("/ajax/team/deletePaper", {
id: tId,
paper: pid
}, "post", function (data) {
if (data.success) {
paperArr = []
$('#proPaper').html('')
pagePerNo = 1
paperListVal(true)
}
})
});
})
//==== paper =====//
//==== patent =====//
$('#item6drop2').on('click', '.steptit>a', function () {
$('#item6drop2 .steptit>a').removeClass('active')
$(this).addClass('active')
var st = $(this).attr("data-index")
$('#item6drop2 .aboutRes').addClass('displayNone')
$('#item6drop2 .aboutRes').eq(st).removeClass('displayNone')
if (st === '0') {
patentArr = []
$('#proPatent').html('')
pagePerNo = 1
patentListVal(true)
} else if (st === '1') {
$('#searchPatent').html('')
$('#searchPatentKey').val('')
$('#searchPatentKey').val(null)
searchPatent()
}
})
$('#item6drop2').on('click', '.searchSpan', function () {
searchPatent()
})
$('#item6drop2').on('click', 'li.addThis', function () {
var _this = this
var fl = $(this).attr("data-flag")
if (fl === '1') {
var pid = $(this).attr("data-id")
oAjax("/ajax/team/insertPatent", {
id: tId,
patent: pid
}, "post", function (data) {
$(_this).addClass("added").text("已添加")
$(_this).attr("data-flag", '0')
})
}
})
$('#item6drop2,#showPatent').on('click', '.deloutPro', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "确定取消关联该专利成果?", function () {
oAjax("/ajax/team/deletePatent", {
id: tId,
patent: pid
}, "post", function (data) {
if (data.success) {
patentArr = []
$('#proPatent').html('')
pagePerNo = 1
patentListVal(true)
}
})
});
})
//==== patent =====//
//==== unpatent =====//
$('#item6drop1').on('click', '.steptit>a', function () {
$('#item6drop1 .steptit>a').removeClass('active')
$(this).addClass('active')
var st = $(this).attr("data-index")
$('#item6drop1 .aboutRes').addClass('displayNone')
$('#item6drop1 .aboutRes').eq(st).removeClass('displayNone')
if (st === '0') {
unpatentArr = []
$('#proUnPatent').html('')
pagePerNo = 1
unpatentListVal(true)
} else if (st === '1') {
$('#searchUnPatent').html('')
$('#searchUnPatentKey').val('')
searchUnPatent()
}
})
$('#item6drop1').on('click', '.searchSpan', function () {
searchUnPatent()
})
$('#item6drop1').on('click', 'li.addThis', function () {
var _this = this
var fl = $(this).attr("data-flag")
if (fl === '1') {
var pid = $(this).attr("data-id")
oAjax("/ajax/team/insertResResult", {
id: tId,
researchResult: pid
}, "post", function (data) {
$(_this).addClass("added").text("已添加")
$(_this).attr("data-flag", '0')
})
}
})
$('#item6drop1,#showUnPatent').on('click', '.deloutPro', function () {
var pid = $(this).attr("data-id")
$.MsgBox.Confirm("提示", "确定取消关联该非专利成果?", function () {
oAjax("/ajax/team/deleteResResult", {
id: tId,
researchResult: pid
}, "post", function (data) {
if (data.success) {
unpatentArr = []
$('#proUnPatent').html('')
pagePerNo = 1
unpatentListVal(true)
}
})
});
})
//==== unpatent =====//
$('#seeMoreF,#seeMoreZ').unbind("click").on("click", function () {
$(".leftconItem").hide();
var activeTab = $('#item6user').attr("rel");
$("#item6user").show()
$("ul.mainNavUl li").removeClass("liNow");
$('#tab6user').addClass("liNow");
$(".moreNav").hide();
var pa = $(".moreNavUl.wendaUl>li.liNow").attr("rel")
$("#" + pa).find("ul").html("")
$("#" + pa).find(".js-load-more").show();
$(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
$("#item6drop1").show()
$("#item6more").show()
unpatentListVal(true);
})
$('#seeMoreL').unbind("click").on("click", function () {
$(".leftconItem").hide();
var activeTab = $('#item5user').attr("rel");
$("#item5user").show()
$("ul.mainNavUl li").removeClass("liNow");
$('#tab5user').addClass("liNow");
$(".moreNav").hide();
})
$("#tab6user").unbind("click").on("click", function () {
var pa = $(".moreNavUl.wendaUl>li.liNow").attr("rel")
$("#" + pa).find("ul").html("")
$("#" + pa).find(".js-load-more").show();
$(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
$("#item6drop1").show().siblings().hide();
unpatentListVal(true);
})
$(".moreNavUl.wendaUl").on("click", "li", function () {
var pa = $(this).attr("rel")
$("#" + pa).find("ul").html("")
$("#" + pa).find(".js-load-more").show();
var sortN = $(this).attr("data-num");
if (sortN == 1) {
unpatentListVal(true);
} else if (sortN == 2) {
patentListVal(true);
}
})
}
getUserInfo();
professorListVal(true);
unpatentListVal(true);
patentListVal(true);
paperListVal(true);
bindClickFun();
})