Browse Source

专利论文列表

luyanan 7 years ago
parent
commit
c4a0518dc0
5 changed files with 318 additions and 6 deletions
  1. 156 0
      js/paperList.js
  2. 156 0
      js/patentList.js
  3. 3 3
      paperImport.html
  4. 2 2
      paperList.html
  5. 1 1
      patentList.html

+ 156 - 0
js/paperList.js

@ -0,0 +1,156 @@
1
$(document).ready(function(){
2
	$(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
3
	$(".workmenu>ul>li").eq(4).addClass("nowLi");
4
	loginStatus(); //判断个人是否登录
5
	valUser();
6
	var userid = $.cookie("userid");
7
	var paperId;
8
	/*资源列表查询*/
9
	function getPaperMe(n,isbind,num) {
10
		var paperNameVa=$("#paperName").val();
11
		var $info={};
12
		$info.id=userid;
13
		$info.pageSize=10;
14
		if(paperName !="") {
15
			$info.key=paperNameVa;
16
		}
17
		$info.pageNo=n;
18
		$.ajax({
19
			"url": "/ajax/ppatent/byProfessor",
20
			"type": "GET",
21
			"data": $info,
22
			"dataType": "json",
23
			"success": function(data) {
24
				console.log(data)
25
				if(data.success) {
26
					var dataStr = data.data.data;
27
					$("#patentList").html("");
28
					if(num==1) {
29
						if(dataStr.length==0) {
30
							$("#noresource").removeClass("displayNone");
31
							$(".noContip").text("您还未导入任何论文");
32
							return;
33
						}else{
34
							$("#noresource").addClass("displayNone");
35
						}
36
					}else{
37
						if(dataStr.length==0) {
38
							$("#noresource").removeClass("displayNone");
39
							$(".noContip").text("没有符合该搜索条件的内容");
40
							return;
41
						}else{
42
							$("#noresource").addClass("displayNone");
43
						}
44
					}
45
					paperHtml(dataStr);
46
					if(isbind == true) {
47
						$(".tcdPageCode").createPage({
48
							pageCount: Math.ceil(data.data.total / data.data.pageSize),
49
							current: data.data.pageNo,
50
							backFn: function(p) {
51
								getPaperMe(p,false);
52
							}
53
						});
54
					}
55
				}
56
			},
57
			'error': function() {
58
				$.MsgBox.Alert('提示', '服务器连接超时!');
59
			}
60
		});
61
	}
62
	 getPaperMe(1,true,1);
63
	 function paperHtml($data) {
64
	 	for(var i=0;i<$data.length;i++) {
65
	 		var oTime,pageview="",oHtml,oLi='';
66
	 		
67
 			oTime="导入于 "+TimeTr($data[i].assTime);
68
 			pageview='<li><span>阅读量 '+$data[i].pageViews+'</span></li>';
69
 			oHtml="paperShow.html"
70
 			
71
	 	var oStr='<li '+oLi+'>'+
72
				'<a href="'+oHtml+'?paperId='+$data[i].id+'" target="_blank">'+
73
					'<div class="madiaHead resouseHead"></div>'	+						
74
						'<div class="madiaInfo">'+					
75
							'<p class="h1Font ellipsisSty">'+$data[i].name+'</p>'+						
76
							'<ul class="h2Font clearfix">'+
77
								'<li><span>'+oTime+'</span></li>'+pageview+
78
							'</ul>'+
79
						'</div>'+
80
				'</a>'+
81
				'<ul class="madiaEdit">'+
82
					'<li><span class="deteleThis2" data-id="'+$data[i].id+'"></span></li>'+
83
					'<li><span class="editThis" data-id="'+$data[i].id+'"></span></li>'+
84
				'</ul>'+
85
			'</li>'	
86
			$("#patentList").append(oStr);
87
	 	}
88
	 }
89
	/*点击修改跳转修改页面*/
90
	$("#patentList").on("click",".editThis",function(){
91
		location.href="resourceIssue.html?resourceId="+$(this).attr("data-id")
92
	})
93
	/*点击删除跳转修改页面*/
94
	$("#patentList").on("click",".deteleThis2",function(){
95
		resourceId=$(this).attr("data-id");
96
		$.MsgBox.Confirm("提示", "确认删除该资源?",deleResource);
97
	})
98
	/*删除函数*/
99
	function deleResource() {
100
			$.ajax({
101
					"url": "/ajax/ppaper/cAss",
102
					"type": "POST",
103
					"success": function(data) {
104
						if(data.success) {	
105
							getPaperMe(1,false);
106
						}
107
					},
108
					"data": {
109
						"id":paperId,
110
						"uid":userid
111
					},
112
					"beforeSend": function() { /*console.log(this.data)*/ },
113
					"contentType": "application/x-www-form-urlencoded",
114
					dataType: "json"
115
				});
116
	}
117
	/*输入资源名称限制字数*/
118
	$("#paperName").bind({
119
		keyup: function() {
120
			if($(this).val().length > 30) {
121
				$(this).val($(this).val().substr(0, 30));
122
			}
123
		}
124
	});
125
	/*点击搜索*/
126
	$(".searchSpan").click(function(){
127
		$(".tcdPageCode").remove();
128
		$(".aboutRes").append('<div class="tcdPageCode"></div>');
129
		getPaperMe(1,true);
130
	})
131
	getProfessorData(userid);
132
	function getProfessorData(professorId) {
133
		$.ajax({
134
			"url": "/ajax/professor/editBaseInfo/" + professorId,
135
			"type": "get",
136
			"async": true,
137
			"success": function(data) {
138
				if(data.success) {
139
					var oAuthType=data.data.authType;
140
					if(oAuthType==0){
141
						$("a:contains('需求')").attr("href","myDemand.html");
142
					}else if(oAuthType==1){
143
						$("a:contains('需求')").attr("href","needList.html");
144
					}
145
					
146
					
147
				} else {
148
					$.MsgBox.Alert("提示", "服务器连接失败");
149
				}
150
			},
151
			"error": function() {
152
				$.MsgBox.Alert('提示', '服务器连接失败');
153
			}
154
		})
155
	}
156
})

+ 156 - 0
js/patentList.js

@ -0,0 +1,156 @@
1
$(document).ready(function(){
2
	$(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
3
	$(".workmenu>ul>li").eq(3).addClass("nowLi");
4
	loginStatus(); //判断个人是否登录
5
	valUser();
6
	var userid = $.cookie("userid");
7
	var patentId;
8
	/*资源列表查询*/
9
	function getPatentMe(n,isbind,num) {
10
		var patentNameVa=$("#patentName").val();
11
		var $info={};
12
		$info.id=userid;
13
		$info.pageSize=10;
14
		if(patentName !="") {
15
			$info.key=patentNameVa;
16
		}
17
		$info.pageNo=n;
18
		$.ajax({
19
			"url": "/ajax/ppatent/byProfessor",
20
			"type": "GET",
21
			"data": $info,
22
			"dataType": "json",
23
			"success": function(data) {
24
				console.log(data)
25
				if(data.success) {
26
					var dataStr = data.data.data;
27
					$("#patentList").html("");
28
					if(num==1) {
29
						if(dataStr.length==0) {
30
							$("#noresource").removeClass("displayNone");
31
							$(".noContip").text("您还未导入任何专利");
32
							return;
33
						}else{
34
							$("#noresource").addClass("displayNone");
35
						}
36
					}else{
37
						if(dataStr.length==0) {
38
							$("#noresource").removeClass("displayNone");
39
							$(".noContip").text("没有符合该搜索条件的内容");
40
							return;
41
						}else{
42
							$("#noresource").addClass("displayNone");
43
						}
44
					}
45
					patentHtml(dataStr);
46
					if(isbind == true) {
47
						$(".tcdPageCode").createPage({
48
							pageCount: Math.ceil(data.data.total / data.data.pageSize),
49
							current: data.data.pageNo,
50
							backFn: function(p) {
51
								getPatentMe(p,false);
52
							}
53
						});
54
					}
55
				}
56
			},
57
			'error': function() {
58
				$.MsgBox.Alert('提示', '服务器连接超时!');
59
			}
60
		});
61
	}
62
	 getPatentMe(1,true,1);
63
	 function patentHtml($data) {
64
	 	for(var i=0;i<$data.length;i++) {
65
	 		var oTime,pageview="",oHtml,oLi='';
66
	 		
67
 			oTime="导入于 "+TimeTr($data[i].assTime);
68
 			pageview='<li><span>阅读量 '+$data[i].pageViews+'</span></li>';
69
 			oHtml="patentShow.html"
70
 			
71
	 	var oStr='<li '+oLi+'>'+
72
				'<a href="'+oHtml+'?patentId='+$data[i].id+'" target="_blank">'+
73
					'<div class="madiaHead resouseHead"></div>'	+						
74
						'<div class="madiaInfo">'+					
75
							'<p class="h1Font ellipsisSty">'+$data[i].name+'</p>'+						
76
							'<ul class="h2Font clearfix">'+
77
								'<li><span>'+oTime+'</span></li>'+pageview+
78
							'</ul>'+
79
						'</div>'+
80
				'</a>'+
81
				'<ul class="madiaEdit">'+
82
					'<li><span class="deteleThis2" data-id="'+$data[i].id+'"></span></li>'+
83
					'<li><span class="editThis" data-id="'+$data[i].id+'"></span></li>'+
84
				'</ul>'+
85
			'</li>'	
86
			$("#patentList").append(oStr);
87
	 	}
88
	 }
89
	/*点击修改跳转修改页面*/
90
	$("#patentList").on("click",".editThis",function(){
91
		location.href="resourceIssue.html?resourceId="+$(this).attr("data-id")
92
	})
93
	/*点击删除跳转修改页面*/
94
	$("#patentList").on("click",".deteleThis2",function(){
95
		resourceId=$(this).attr("data-id");
96
		$.MsgBox.Confirm("提示", "确认删除该资源?",deleResource);
97
	})
98
	/*删除函数*/
99
	function deleResource() {
100
			$.ajax({
101
					"url": "/ajax/ppatent/cAss",
102
					"type": "POST",
103
					"success": function(data) {
104
						if(data.success) {	
105
							getPatentMe(1,false);
106
						}
107
					},
108
					"data": {
109
						"id":patentId,
110
						"uid":userid
111
					},
112
					"beforeSend": function() { /*console.log(this.data)*/ },
113
					"contentType": "application/x-www-form-urlencoded",
114
					dataType: "json"
115
				});
116
	}
117
	/*输入资源名称限制字数*/
118
	$("#patentName").bind({
119
		keyup: function() {
120
			if($(this).val().length > 30) {
121
				$(this).val($(this).val().substr(0, 30));
122
			}
123
		}
124
	});
125
	/*点击搜索*/
126
	$(".searchSpan").click(function(){
127
		$(".tcdPageCode").remove();
128
		$(".aboutRes").append('<div class="tcdPageCode"></div>');
129
		getPatentMe(1,true);
130
	})
131
	getProfessorData(userid);
132
	function getProfessorData(professorId) {
133
		$.ajax({
134
			"url": "/ajax/professor/editBaseInfo/" + professorId,
135
			"type": "get",
136
			"async": true,
137
			"success": function(data) {
138
				if(data.success) {
139
					var oAuthType=data.data.authType;
140
					if(oAuthType==0){
141
						$("a:contains('需求')").attr("href","myDemand.html");
142
					}else if(oAuthType==1){
143
						$("a:contains('需求')").attr("href","needList.html");
144
					}
145
					
146
					
147
				} else {
148
					$.MsgBox.Alert("提示", "服务器连接失败");
149
				}
150
			},
151
			"error": function() {
152
				$.MsgBox.Alert('提示', '服务器连接失败');
153
			}
154
		})
155
	}
156
})

+ 3 - 3
paperImport.html

@ -4,7 +4,7 @@
4 4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 5
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6 6
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7
<title>专利-我的工作台-科袖网</title>
7
<title>论文-我的工作台-科袖网</title>
8 8
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" media="screen" />
9 9
<link href="css/bootstrap.min.css" rel="stylesheet">
10 10
<link type="text/css" href="css/common.css" rel="stylesheet">
@ -27,8 +27,8 @@
27 27
	        </div>
28 28
	        <div class="workcon workconG">
29 29
				<div class="workcontit">
30
					<a class="worksamlltit" href="patentList.html">我的专利</a>
31
					<a class="worksamlltit worksamlltitnow">导入专利</a>
30
					<a class="worksamlltit" href="paperList.html">我的论文</a>
31
					<a class="worksamlltit worksamlltitnow">导入论文</a>
32 32
				</div>
33 33
				<div class="tipShow">
34 34
			    	<span class="floatL">导入与您相关的专利,企业可以通过它们找到您,与您开展合作!</span>

+ 2 - 2
paperList.html

@ -28,7 +28,7 @@
28 28
	        <div class="workcon workconG">
29 29
				<div class="workcontit">
30 30
					<a class="worksamlltit worksamlltitnow">我的论文</a>
31
					<a class="worksamlltit" href="patentImport.html">导入论文</a>
31
					<a class="worksamlltit" href="paperImport.html">导入论文</a>
32 32
				</div>
33 33
				<div class="itemListBolck">
34 34
					<div class="topOperaBlock clearfix">
@ -70,6 +70,6 @@
70 70
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
71 71
<script type="text/javascript" src="js/jquery.page.js"></script>
72 72
<script type="text/javascript" src="js/common.js"></script>
73
<!--<script type="text/javascript" src="js/resourceList.js"></script>-->
73
<script type="text/javascript" src="js/paperList.js"></script>
74 74
</body>
75 75
</html>

+ 1 - 1
patentList.html

@ -70,6 +70,6 @@
70 70
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
71 71
<script type="text/javascript" src="js/jquery.page.js"></script>
72 72
<script type="text/javascript" src="js/common.js"></script>
73
<!--<script type="text/javascript" src="js/resourceList.js"></script>-->
73
<script type="text/javascript" src="js/patentList.js"></script>
74 74
</body>
75 75
</html>