123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- $(document).ready(function () {
- $(".onlogin .headnavbtn li.mywork").addClass("navcurrent");
- $(".workmenu>ul>li:contains('成果')").addClass("nowLi");
- loginStatus();
- valUser();
- var userid = $.cookie("userid");
- var userName = $.cookie("userName");
-
- function getRecourceMe(n, isbind, num) {
- var resourceNameVa = $("#patentName").val();
- var $info = {};
- $info.pageSize = 10;
- if (resourceNameVa != "") {
- $info.key = resourceNameVa;
- }
- $info.pageNo = n;
- $info.status = 1;
- $info.id = userid
- $.ajax({
- "url": "/ajax/resResult/pq",
- "type": "GET",
- "success": function (data) {
- if (data.success) {
- $(".importUl").html("");
- if (num == 1) {
- if (data.data.data.length == 0) {
- $("#noresource").removeClass("displayNone");
- $(".noContip").text("没有需要导入的非专");
- return;
- } else {
- $("#noresource").addClass("displayNone");
- }
- } else {
- if (data.data.data.length == 0) {
- $("#noresource").removeClass("displayNone");
- $(".noContip").text("没有符合该搜索条件的内容");
- return;
- } else {
- $("#noresource").addClass("displayNone");
- }
- }
- resourceHtml(data.data.data);
- if (isbind == true) {
- $(".tcdPageCode").createPage({
- pageCount: Math.ceil(data.data.total / data.data.pageSize),
- current: data.data.pageNo,
- backFn: function (p) {
- getRecourceMe(p, false);
- document.body.scrollTop = document.documentElement.scrollTop = 0;
- }
- });
- }
- }
- },
- "data": $info,
- 'type': "get",
- 'error': function () {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- });
- }
- getRecourceMe(1, true, 1);
- function resourceHtml($data) {
- for (var i = 0; i < $data.length; i++) {
- test($data[i])
- }
- }
- function test($data) {
- $.ajax({
- 'url': '/ajax/resResult/researcher',
- 'type': 'get',
- 'data': {
- id: $data.id
- },
- success: function (res) {
- var arr = []
- var dom = []
- for (var i = 0; i < res.data.length; i++) {
- arr.push(res.data[i].name)
- dom.push(res.data[i].professorId)
- }
-
- $.ajax({
- 'url': '/ajax/resResult/selectbyidandPid',
- 'data': {
- id: $data.id,
- pid: userid
- },
- 'type': 'get',
- success: function (res) {
- console.log(res)
- var cc = res.data
- if ($data.name) {
- oSpec = "研究者:" + arr.join(',');
- }
-
- var oT, oText, cs;
- if (cc.length != 0) {
- oT = "importSpan-3";
- oText = "已导入";
- cs = "auto"
- } else {
- oT = "importSpan-1";
- oText = "导入";
- cs = "pointer";
- }
- var oString = '<li>' +
- '<a class="flexCenter">' +
- '<div class="madiaHead patentHead"></div>' +
- '<div class="madiaInfo">' +
- '<p class="h1Font ellipsisSty">' + $data.name + '</p>' +
- '<p class="h2Font ellipsisSty">' + oSpec + '</p>' +
- '<p class="h2Font ellipsisSty">' + '</p>' +
- '</div>' +
- '</a>' +
- '<div class="importBtn">' +
- '<span class="importResource ' + oT + '" data-id="' + $data.id + '" style="cursor:' + cs + '">' + oText + '</span>' +
-
- '<span class="importSpan-3">已导入</span>' +*/
- '</div>' +
- '</li>'
- $(".importUl").append(oString);
- }
- })
- }
- })
- }
-
- $("#resouceName").bind({
- keyup: function () {
- if ($(this).val().length > 30) {
- $(this).val($(this).val().substr(0, 30));
- }
- }
- });
-
- $(".searchSpan").click(function () {
- $(".tcdPageCode").remove();
- $(".aboutRes").append('<div class="tcdPageCode"></div>');
- getRecourceMe(1, true);
- })
-
- $(".importUl").on("click", ".importSpan-1", function () {
- var oF = $(this).attr("flag");
- var $this = $(this);
-
- $.ajax({
- "url": "/ajax/resResult/ass",
- "type": "POST",
- "success": function (data) {
- console.log(data)
- if (data.success) {
- if (data.data > 0) {
- $this.text("导入成功").addClass("importSpan-3").removeClass("importSpan-1").removeClass("importSpan-2").css("cursor", "auto");
- }
- }
- },
- "data": {
- id: $(this).attr("data-id"),
-
-
- researcher: userid
- },
- dataType: "json",
- 'error': function () {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- });
- });
- })
|