Przeglądaj źródła

完善个人信息修改页面

luyanan 8 lat temu
rodzic
commit
ecb19e1d99
2 zmienionych plików z 301 dodań i 156 usunięć
  1. 85 73
      src/main/webapp/information.html
  2. 216 83
      src/main/webapp/js/information.js

+ 85 - 73
src/main/webapp/information.html

@ -400,96 +400,108 @@
400 400
		<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
401 401
		<script type="text/javascript" src="js/information.js"></script>
402 402
		<script>
403
			var yearFlag=2016;			
404
			$(document).on("click",".date-btn",function() {
405
				//yearFlag=$(this).attr("flag");
406
				//ymFlag=$(this).attr("difference");
407
			
408
				$(this).siblings(".mr_calendar_ym").show();
409
				//$(this).parents(".txtExpForm").find(".year").val($(this).text());
410
					
403
			var yearFlag = 2016;			
404
			$(document).on("click", ".date-btn", function() {
405
				var flag = $(this).attr("flag");
406
				console.log(flag);
407
				var c = $(this).val();
408
				if(flag == 1) {
409
					if(c) {
410
						var ye = new Date().getFullYear();
411
						var sroTop = (ye - parseInt(c)) * 32;
412
						$(this).siblings(".mr_calendar_ym").show();
413
						$(this).siblings(".mr_calendar_ym").find(".full_year").scrollTop(sroTop);
414
						$(this).siblings(".mr_calendar_ym").find(".yearli:contains('" + c + "')").addClass("active").siblings().removeClass("active");
415
						return;
416
					} else {
417
						var ye = new Date().getFullYear();
418
						$(this).siblings(".mr_calendar_ym").show();
419
						$(this).siblings(".mr_calendar_ym").find(".yearli:contains('" + ye + "')").addClass("active").siblings().removeClass("active");
420
						return;
421
					}
422
				} else if(flag == 2) {
423
					if(c) {
424
						if(c == "至今") {
425
							$(this).siblings(".mr_calendar_ym").show();
426
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + c+ "')").addClass("active");
427
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + c + "')").siblings().removeClass("active");
428
							return;
429
						} else {
430
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + c.substr(0, 4) + "')").addClass("active");
431
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + c.substr(0, 4) + "')").siblings().removeClass("active");
432
							if(c.substr(5, 1) == 0) {
433
								$(this).siblings(".mr_calendar_ym").find(".mli:contains('" + c.substr(6, 1) + "')").addClass("active");
434
								$(this).siblings(".mr_calendar_ym").find(".mli:contains('" + c.substr(6, 1) + "')").siblings().removeClass("active");
435
							} else {
436
								$(this).siblings(".mr_calendar_ym").find(".mli:contains('" + c.substr(5, 2) + "')").addClass("active");
437
								$(this).siblings(".mr_calendar_ym").find(".mli:contains('" + c.substr(5, 2) + "')").siblings().removeClass("active");
438
							}							
439
							$(this).siblings(".mr_calendar_ym").show();
440
							var ya = $(this).siblings(".mr_calendar_ym").find(".mr_year .ymli").length;
441
							var ye = new Date().getFullYear();
442
							if(ya == 61) {
443
								ye = ye + 1;
444
							}
445
							var sroTop = (ye - parseInt(c.substr(0, 4))) * 32;
446
							$(this).siblings(".mr_calendar_ym").find(".mr_year").scrollTop(sroTop);
447
							return;
448
						}
449
					} else {
450
							var ye = new Date().getFullYear();
451
							$(this).siblings(".mr_calendar_ym").show();
452
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + ye + "')").addClass("active");
453
							$(this).siblings(".mr_calendar_ym").find(".ymli:contains('" + ye + "')").siblings().removeClass("active");
454
							
455
							return;
456
					}
457

458
				}
459
				//$(this).parents(".txtExpForm *").not(".mr_calendar_ym").click(function(){
460
				//alert(1);
461
				//$(this).parents(".txtExpForm").find(".mr_calendar_ym").hide()
462
				//})
411 463
			})
412 464
			$(document).on("click",".yearli",function(){
413 465
			$(this).addClass("active").siblings().removeClass("active");
414 466
			$(this).parents(".mr_calendar_ym ").siblings().val($(this).text());
415 467
			$(this).parents(".mr_calendar_ym ").hide();
416 468
			})
417
			$(document).on("click",".ymli",function(){
418
			$(this).addClass("active").siblings().removeClass("active");
419
			yearFlag=$(this).text();
420
			})
421
			$(document).on("click",".mli",function(){
422
			$(this).addClass("active").siblings().removeClass("active");
423
			if($(this).text()<10) {
424
			var month="0"+$(this).text();
425
			}else{
426
			var month=$(this).text();
427
			}
428
			$(this).parents(".mr_calendar_ym ").siblings().val(yearFlag+"-"+month);
429
			$(this).parents(".mr_calendar_ym ").hide();
430
			})
431
			/* //日历仅有年
432
			$(document).on("click",".yearli",function(){
433
			if(yearFlag==1) {			
434
				$(this).parents(".txtExpForm").find(".year").val($(this).text());
435
			}else if(yearFlag==2) {			
436
				$(this).parents(".txtExpForm").find(".paperYear").val($(this).text());
437
			}else if(yearFlag==3) {
438
			
439
				$(this).parents(".txtExpForm").find(".patentYear").val($(this).text());
440
			}else if(yearFlag==4) {			
441
				$(this).parents(".txtExpForm").find(".honorYear").val($(this).text());
442
			}						
443
			$(".mr_calendar_ym ").hide();
469
			$(document).on("click", ".ymli", function() {
470
				$(this).addClass("active").siblings().removeClass("active");
471
				yearFlag = $(this).text();
472
				if(yearFlag == "至今") {
473
					$(this).parents(".mr_calendar_ym ").siblings().val($(this).text())
474
					$(this).parents(".mr_calendar_ym ").hide();
475
				}
444 476
			})
445
			//日历年月
446
			var yValue=2016;
447
			$(document).on("click",".ymli",function(){			
448
			yValue=$(this).text();
449
			$(this).addClass("active").siblings().removeClass("active");			
477
			$(document).on("click", ".mli", function() {
478
				$(this).addClass("active").siblings().removeClass("active");
479
				if($(this).text() < 10) {
480
					var month = "0" + $(this).text();
481
				} else {
482
					var month = $(this).text();
483
				}
484
				if(yearFlag == "至今") {
485
					var valueM = yearFlag;
486
				} else {
487
					valueM = yearFlag + "-" + month
488
					$(this).parents(".mr_calendar_ym ").siblings().val(valueM);
489
					$(this).parents(".mr_calendar_ym ").hide();
490
				}
491

450 492
			})
451
			$(document).on("click",".mli",function() {						
452
			$(this).addClass("active").siblings().removeClass("active");
453
			
454
			if(yearFlag==5&&ymFlag==1){
455
			$(this).parents(".txtExpForm").find(".startMonth").val(yValue+"-"+$(this).text());
456
		
457
			}else if(yearFlag==5&&ymFlag==2){
458
			alert(2);
459
			$(this).parents(".txtExpForm").find(".stopMonth").val(yValue+"-"+$(this).text());
460
			
461
			}else if(yearFlag==6&&ymFlag==1){
462
			alert(3);
463
			$(this).parents(".txtExpForm").find(".startMonth").val(yValue+"-"+$(this).text());
464
			
465
			}else if(yearFlag==6&&ymFlag==2){
466
			alert(4);
467
			$(this).parents(".txtExpForm").find(".stopMonth").val(yValue+"-"+$(this).text());
468
		
469
			}
470
			
471
			
472
			$(".mr_calendar_ym ").hide();		
473
			}) */
474
			
493

475 494
			function yearAdd() {
476 495
				//先给年下拉框赋内容   			
477 496
				var y = new Date().getFullYear();
478
				for(var i = (y - 60); i < (y + 10); i++) { //以今年为准,前60年,后10年   
479
					$(".mr_year").append('<li class="ymli">' + i + '</li>');				
497
				for(var i = y; i > y - 60; i--) { //以今年为准,前60年,后10年   
498
					$(".mr_year").append('<li class="ymli">' + i + '</li>');
480 499
					$(".full_year").append('<li class="yearli">' + i + '</li>');
481 500
					if(i == y) {
482 501
						$(".mr_year>li:contains(" + i + ")").addClass("active");
483 502
						$(".full_year>li:contains(" + i + ")").addClass("active");
484 503
					}
485 504
				}
486
				
487

488
				/* document.reg_testdate.YYYY.value = y;
489
				document.reg_testdate.MM.value = new Date().getMonth() + 1;
490
				var n = MonHead[new Date().getMonth()];
491
				if(new Date().getMonth() == 1 && IsPinYear(YYYYvalue)) n++;
492
				writeDay(n); //赋日期下拉框Author:meiz */
493 505
			}
494 506
			function month(){
495 507
			   //赋月份的下拉框   

+ 216 - 83
src/main/webapp/js/information.js

@ -58,7 +58,24 @@ $(function(){
58 58
							data[i].degree="";
59 59
						}
60 60
						var string = '<li class="paddingSpace">'
61
							string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+data[i].school+'-'+data[i].college+'-'+data[i].major+'-'+data[i].degree+'<small class="h6Font">'+data[i].year+'</small><em class="exitlist inforedu"></em></div>'
61
							string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'
62
								if(data[i].college&&data[i].major&&data[i].degree){
63
									string+=data[i].school+'-'+data[i].college+'-'+data[i].major+'-'+data[i].degree
64
								}else if(!data[i].college&&data[i].major&&data[i].degree){
65
									string+=data[i].school+'-'+data[i].major+'-'+data[i].degree
66
								}else if(data[i].college&&!data[i].major&&data[i].degree){
67
									string+=data[i].school+'-'+data[i].college+'-'+data[i].degree
68
								}else if(data[i].college&&data[i].major&&!data[i].degree){
69
									string+=data[i].school+'-'+data[i].college+'-'+data[i].major
70
								}else if(!data[i].college&&!data[i].major&&data[i].degree){
71
									string+=data[i].school+'-'+data[i].degree
72
								}else if(!data[i].college&&data[i].major&&!data[i].degree){
73
									string+=data[i].school+'-'+data[i].major
74
								}else if(data[i].college&&!data[i].major&&!data[i].degree){
75
									string+=data[i].school+'-'+data[i].college
76
								}
77
								//+data[i].school+'-'+data[i].college+'-'+data[i].major+'-'+data[i].degree+
78
								string+='<small class="h6Font">'+data[i].year+'</small><em class="exitlist inforedu"></em></div>'
62 79
							string += '<div class="modifybox">'
63 80
							string += '<form class="txtExpForm">'
64 81
							string += '<div class="infor edu">'
@ -137,19 +154,25 @@ $(function(){
137 154
			var timeJobShow = function(data) {
138 155
				jobFil("#timeJobShow");
139 156
				if(data.length>0){
140
					for (var i = 0; i < data.length; i++) {
141
						if(!data[i].startMonth) {
142
							data[i].startMonth="";
143
						}else {
144
							data[i].startMonth=data[i].startMonth.substr(0,4)+"-"+data[i].startMonth.substr(4,6)
145
						}
146
						if(!data[i].stopMonth) {
147
							data[i].stopMonth="";
148
						}else {
149
							data[i].stopMonth=data[i].stopMonth.substr(0,4)+"-"+data[i].stopMonth.substr(4,6)
157
					for (var i = 0; i < data.length; i++) {	
158
						var sDate = "";
159
						var eDate = "";
160
						var string = '<li class="paddingSpace listnone">'
161
							string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+data[i].company+'-'+data[i].title+'<small class="h6Font">';
162
						if(data[i].startMonth){
163
							
164
							sDate =data[i].startMonth.substr(0,4)+"-"+data[i].startMonth.substr(4,6);
165
							if(data[i].stopMonth){
166
								eDate = data[i].stopMonth.substr(0,4)+"-"+data[i].stopMonth.substr(4,6);
167
							}else {
168
								eDate = "至今"
169
							}
150 170
						}
151 171
						var string = '<li class="paddingSpace listnone">'
152
							string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+data[i].company+'-'+data[i].title+'<small class="h6Font">'+data[i].startMonth+' - '+data[i].stopMonth+'</small><em class="exitlist inforedu"></em></div>'
172
							string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+data[i].company+'-'+data[i].title+'<small class="h6Font">';
173
						    string +=sDate;
174
						    if(eDate) string+=("-"+eDate);
175
						    string +='</small><em class="exitlist inforedu"></em></div>';
153 176
							string += '<div class="modifybox">'
154 177
							string += '<form class="txtExpForm">'
155 178
							string += '<div class="infor edu">'
@ -161,7 +184,7 @@ $(function(){
161 184
							string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
162 185
							string += '<div class="txtExp floatL">'
163 186
							string += '<div class="dateExp floatL">'
164
							string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="5" difference="1" value="'+data[i].startMonth+'">'
187
							string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="2" difference="1" value="'+sDate+'">'
165 188
							string += '<div class="mr_calendar_ym clearfix">'
166 189
							string += '<ul class="mr_year">'
167 190
							string += '</ul>'
@ -171,10 +194,10 @@ $(function(){
171 194
							string += '</div>'
172 195
							string += '<div class="lineTo floatL"></div>'
173 196
							string += '<div class="dateExp floatL">'
174
							string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="5" difference="2"  value="'+data[i].stopMonth+'">'
197
							string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="2" difference="2"  value="'+eDate+'">'
175 198
							string += '<div class="mr_calendar_ym clearfix">'
176 199
							string += '<ul class="mr_year">'
177
							string += '<li>至今</li>'
200
							string += '<li class="ymli">至今</li>'
178 201
							string += '</ul>'
179 202
							string += '<ul class="mr_month">'
180 203
							string += '</ul>'
@ -209,17 +232,18 @@ $(function(){
209 232
						}
210 233
						if(!data[i].startMonth){
211 234
							data[i].startMonth='';
212
						}else {
213
							data[i].startMonth=data[i].startMonth.substr(0,4)+"-"+data[i].startMonth.substr(4,6)
214
						}
215
						if(!data[i].stopMonth){
216 235
							data[i].stopMonth='';
217 236
						}else {
218
							data[i].stopMonth=data[i].stopMonth.substr(0,4)+"-"+data[i].stopMonth.substr(4,6)
237
							data[i].startMonth=data[i].startMonth.substr(0,4)+"-"+data[i].startMonth.substr(4,6)+"-"
238
							if(!data[i].stopMonth){
239
								data[i].stopMonth='至今';
240
							}else {
241
								data[i].stopMonth=data[i].stopMonth.substr(0,4)+"-"+data[i].stopMonth.substr(4,6)
242
							}
219 243
						}
220 244
						var string = '<li class="paddingSpace listnone">'
221
							string+='<div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].startMonth +' - '+ data[i].stopMonth +'</small><em class="exitlist inforedu"></em></div>';
222
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div>';
245
							string+='<div><div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].startMonth +''+ data[i].stopMonth +'</small><em class="exitlist inforedu"></em></div>';
246
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div></div>';
223 247
							//string+=' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+data[i].name+'-'+data[i].descp+'-'+data[i].startMonth+'-'+data[i].stopMonth+'<em class="exitlist inforedu"></em></div>'
224 248
							string += '<div class="modifybox">'
225 249
							string += '<form class="txtExpForm">'
@ -232,7 +256,7 @@ $(function(){
232 256
							string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
233 257
							string += '<div class="txtExp floatL">'
234 258
							string += '<div class="dateExp floatL">'
235
							string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="6" difference="1" value="'+data[i].startMonth+'">'
259
							string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="2" difference="1" value="'+data[i].startMonth.substr(0,7)+'">'
236 260
							string += '<div class="mr_calendar_ym clearfix">'
237 261
							string += '<ul class="mr_year">'
238 262
							string += '</ul>'
@ -242,10 +266,10 @@ $(function(){
242 266
							string += '</div>'
243 267
							string += '<div class="lineTo floatL"></div>'
244 268
							string += '<div class="dateExp floatL">'
245
							string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="6" difference="2" value="'+data[i].stopMonth+'">'
269
							string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="2" difference="2" value="'+data[i].stopMonth+'">'
246 270
							string += '<div class="mr_calendar_ym clearfix">'
247 271
							string += '<ul class="mr_year">'
248
							string += '<li>至今</li>'
272
							string += '<li class="ymli">至今</li>'
249 273
							string += '</ul>'
250 274
							string += '<ul class="mr_month">'
251 275
							string += '</ul>'
@ -258,7 +282,7 @@ $(function(){
258 282
							string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt projectDescp" value="'+data[i].descp+'"></div>'
259 283
							string += '</div>'
260 284
							string += '<div class="btnbox">'
261
							string += '<input type="button" value="添加" class="infor-save btn">'
285
							string += '<input type="button" value="保存" class="infor-save btn">'
262 286
							string += '<input type="button" value="取消" class="close btn">'
263 287
							string += '<input type="button" value="删除本条" class="deletebtn">'
264 288
							string += '</div>'
@ -286,8 +310,8 @@ $(function(){
286 310
						}
287 311
							
288 312
						var string = '<li class="paddingSpace listnone">'
289
							string+='<div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
290
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div>';
313
							string+='<div><div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
314
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div></div>';
291 315
							//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
292 316
							string += '<div class="modifybox">'
293 317
							string += '<form class="txtExpForm">'
@ -298,7 +322,7 @@ $(function(){
298 322
							string += '<div class="edu date-box clearfix">'
299 323
							string += '<div class="txtType floatL">发表时间</div>'
300 324
							string += '<div class="txtExp floatL">'
301
							string += '<input type="text" class="date-btn input-txt edu-txt paperYear"  flag="2" value="'+data[i].year+'">'
325
							string += '<input type="text" class="date-btn input-txt edu-txt paperYear"  flag="1" value="'+data[i].year+'">'
302 326
							string += '<div class="mr_calendar_ym clearfix" style="wclassth: 180px; display: none;">'
303 327
							string += '<ul class="full_year">'
304 328
							string += '</ul>'
@ -339,8 +363,8 @@ $(function(){
339 363
						}
340 364
						var string = '<li class="paddingSpace listnone">'
341 365
							//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
342
							string+='<div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
343
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div>';
366
							string+='<div><div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
367
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div></div>';
344 368
							string += '<div class="modifybox">'
345 369
							string += '<form class="txtExpForm">'
346 370
							string += '<div class="infor edu">'
@ -351,7 +375,7 @@ $(function(){
351 375
							string += '<div class="edu date-box clearfix">'
352 376
							string += '<div class="txtType floatL">发表时间</div>'
353 377
							string += '<div class="txtExp floatL">'
354
							string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="3" value="'+data[i].year+'">'
378
							string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="1" value="'+data[i].year+'">'
355 379
							string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
356 380
							string += '<ul class="full_year">'				
357 381
							string += '</ul>'
@ -391,8 +415,8 @@ $(function(){
391 415
						}
392 416
						var string = '<li class="paddingSpace listnone">'
393 417
							//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
394
							string+='<div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
395
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div>';
418
							string+='<div><div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'+ data[i].name +'<small class="h6Font">'+ data[i].year +'</small><em class="exitlist inforedu"></em></div>';
419
							string+='<div class="listdata h5Font pIndent">'+ data[i].descp +'</div></div>';
396 420
							string += '<div class="modifybox">'
397 421
							string += '<form class="txtExpForm">'
398 422
							string += '<div class="infor edu">'
@ -407,7 +431,7 @@ $(function(){
407 431
							string += '<div class="edu date-box clearfix">'
408 432
							string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
409 433
							string += '<div class="txtExp floatL">'
410
							string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="4" value="'+data[i].year+'">'
434
							string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="1" value="'+data[i].year+'">'
411 435
							string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
412 436
							string += '<ul class="full_year">'
413 437
							string += '</ul>'
@ -429,6 +453,7 @@ $(function(){
429 453
			//填充研究方向
430 454
			var researchAreaShow = function ($datas,$datarecords){
431 455
				if($datas != undefined &&  $datas.length != 0 ){
456
					$("#researchAreaList").empty();
432 457
					for(var i =0 ; i< $datas.length;++i){
433 458
						var $data = $datas[i];
434 459
						var $photos = [];
@ -448,11 +473,7 @@ $(function(){
448 473
						showDiv += "</div></div>";
449 474
						$("#researchAreaShow").append(showDiv);
450 475
						$("#researchAreaList").append("<div class='list'><span class='like'>"+$data.count+"</span><span class='ra'>"+$data.caption+"</span><span class='remove'><img src='images/move.png'></span></div>");
451
						// $("#researchAreaList").append("<div class=\"list\"><span class=\"like\">");
452
						// $("#researchAreaList").append($data.count);
453
						// $("#researchAreaList").append("</span>");
454
						// $("#researchAreaList").append($data.caption);
455
						// $("#researchAreaList").append("<span class=\"remove\"><img src=\"images/move.png\"></span></div>");
476
						
456 477
						
457 478
						$(".like-h").load(function(){								
458 479
						})
@ -485,13 +506,22 @@ $.get("/ajax/professor/info/" + userid, function($data) {
485 506
			//展示专家的信息
486 507
			$("#nameS").text($info.name);
487 508
			if($info.office) {
488
				$("#office").text($info.office+",");
509
				if($info.title) {
510
					$("#office").text($info.office+",");
511
				}else{
512
					$("#office").text($info.office);
513
				}
514
				
489 515
			}
490 516
			if($info.title) {
491 517
				$("#titleS").text($info.title);	
492 518
			}
493 519
			if($info.department) {
494
				$("#industryS").text($info.department+",");
520
				if($info.orgName){
521
					$("#industryS").text($info.department+",");
522
				}else{
523
					$("#industryS").text($info.department);
524
				}				
495 525
			}
496 526
			if($info.orgName) {
497 527
				$("#orgNameS").text($info.orgName);
@ -618,8 +648,24 @@ else {
618 648
 	var searchContent = $("#hsearchContent").val();
619 649
 	location.href = "search.html?searchContent=" + searchContent;
620 650
 });
651
 function trim(str) { //删除左右两端的空格			  
652
		return str.replace(/(^\s*)|(\s*$)/g, "");
653
	}
621 654
//头像旁保存
622 655
$("#saveProfessor").on("click",function () {
656
	var length1=trim($("#name").val());
657
	console.log(length1)
658
	var length2=trim($("#orgName").val());
659
	if(!length1&&length2){
660
		$.MsgBox.Alert("消息提醒","姓名不能为空");
661
		return;
662
	}else if(length1&&!length2){
663
		$.MsgBox.Alert("消息提醒","所在机构不能为空");
664
		return;
665
	}else if(!length1&&!length2){
666
		$.MsgBox.Alert("消息提醒","姓名和所在机构不能为空");
667
		return;
668
	}
623 669
	var $data = {};
624 670
	$data.name = $("#name").val();
625 671
	$data.orgId = $("#orgId").val();
@ -647,15 +693,30 @@ $("#saveProfessor").on("click",function () {
647 693
				  				//展示专家的信息
648 694
				  				$(".modifybox").css("display","none");
649 695
				  				$(".infor-browse").css("display","block");
696
				  							$("#nameS").text("");
697
				  							$("#office").text("");
698
				  							$("#titleS").text("");
699
				  							$("#industryS").text("");
700
				  							$("#orgNameS").text("");
701
				  							$("#address").text("");
650 702
				  							$("#nameS").text($info.name);
651 703
				  							if($info.office) {
652
				  								$("#office").text($info.office+",");
704
				  								if($info.title) {
705
				  									$("#office").text($info.office+",");
706
				  								}else{
707
				  									$("#office").text($info.office);
708
				  								}
709
				  								
653 710
				  							}
654 711
				  							if($info.title) {
655 712
				  								$("#titleS").text($info.title);	
656 713
				  							}
657 714
				  							if($info.department) {
658
				  								$("#industryS").text($info.department+",");
715
				  								if($info.orgName){
716
				  									$("#industryS").text($info.department+",");
717
				  								}else{
718
				  									$("#industryS").text($info.department);
719
				  								}				
659 720
				  							}
660 721
				  							if($info.orgName) {
661 722
				  								$("#orgNameS").text($info.orgName);
@ -763,8 +824,21 @@ $("#container .edit").click(function(){
763 824
//学术领域添加
764 825
$("#subjectAdd").click(function(){
765 826
	var val=$("#subject").val();
827
	if(!val){
828
		$.MsgBox.Alert("消息提醒","内容不能为空");
829
		return;
830
	}
831
	var inV=$("#subjectList .acad");	
832
	for(var i=0;i<inV.length;i++){		
833
		if(inV[i].innerText==val)
834
			{
835
				$.MsgBox.Alert("消息提醒","不能添加重复内容");
836
				return;
837
			}	
838
		}
766 839
	$("#subjectList").append("<div class='acad'>"+ val +"<span class='remove'><img src='images/move.png'></span></div>")							
767
	})
840
	$("#subject").val("")
841
})
768 842
//学术领域删除
769 843
$("#subjectList").on("click",".remove",function(){
770 844
	$(this).parent().remove();
@ -801,8 +875,21 @@ $("#subjectList").on("click",".remove",function(){
801 875
//应用行业添加
802 876
$("#industryAdd").click(function(){
803 877
	var val=$("#industry").val();
878
	if(!val){
879
		$.MsgBox.Alert("消息提醒","内容不能为空");
880
		return;
881
	}
882
	var inV=$("#industryList .acad");	
883
	for(var i=0;i<inV.length;i++){		
884
		if(inV[i].innerText==val)
885
			{
886
				$.MsgBox.Alert("消息提醒","不能添加重复内容");
887
				return;
888
			}	
889
		}
804 890
	$("#industryList").append("<div class='acad'>"+ val +"<span class='remove'><img src='images/move.png'></span></div>")							
805
	})
891
	$("#industry").val("")
892
})
806 893
//应用行业删除
807 894
$("#industryList").on("click",".remove",function(){
808 895
	$(this).parent().remove();
@ -839,8 +926,21 @@ $("#industryList").on("click",".remove",function(){
839 926
//研究方向添加
840 927
$("#researchAreaAdd").click(function(){
841 928
	var researchArea=$("#researchArea").val();
929
	if(!researchArea){
930
		$.MsgBox.Alert("消息提醒","内容不能为空");
931
		return;
932
	}
933
	var inV=$("#researchAreaList .ra");	
934
	for(var i=0;i<inV.length;i++){		
935
		if(inV[i].innerText==researchArea)
936
			{
937
				$.MsgBox.Alert("消息提醒","不能添加重复内容");
938
				return;
939
			}	
940
		}
842 941
	$("#researchAreaList").append("<div class='list'><span class='like'>0</span><span class='ra'>"+ researchArea +"</span><span class='remove'><img src='images/move.png'></span></div>")							
843
	});
942
	$("#researchArea").val("");
943
});
844 944

845 945
//研究方向删除
846 946
$("#researchAreaList").on("click",".remove",function(){
@ -868,16 +968,14 @@ $("#researchAreaList").on("click",".remove",function(){
868 968
				"success" : function($data) {
869 969
					if ($data.success)
870 970
					{
871
						$("#researchArea").val("");						
872
						$("#researchAreaList").empty();
873
						$("#researchAreaShow").empty();						
874
						$(".modifybox").css("display","none");
875
						$(".infor-browse").css("display","block");
876 971
						$.get("/ajax/professor/info/" + userid, function($data) 
877 972
								{
878 973
								if ($data.success) 
879 974
								{
880
									researchAreaShow($data.data.researchAreas, $data.data.researchAreaLogs);
975
									$("#researchAreaShow").empty("");
976
									$("#researchAreaShow").show();
977
									$(".modifybox").hide();
978
									researchAreaShow($data.data.researchAreas, $data.data.editResearchAreaLogs);									
881 979
								}
882 980
							});
883 981
						
@ -956,7 +1054,7 @@ var eduFil=function(select){
956 1054
		string += '</div>'
957 1055
		string += '</div>'
958 1056
		string += '<div class="btnbox">'
959
		string += '<input type="button" value="保存" class="infor-save btn" class="saveEduBg">'
1057
		string += '<input type="button" value="添加" class="infor-save btn" class="saveEduBg">'
960 1058
		string += '<input type="button" value="取消" class="close1 close2 btn">'		
961 1059
		string += '</div>'
962 1060
		string += '</form>' 
@ -1084,7 +1182,7 @@ $("#timeJobShow").on("blur", ".jobCompany", function() {
1084 1182
					string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
1085 1183
					string += '<div class="txtExp floatL">'
1086 1184
					string += '<div class="dateExp floatL">'
1087
					string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="5" difference="1" value="">'
1185
					string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="2" difference="1" value="">'
1088 1186
					string += '<div class="mr_calendar_ym clearfix">'
1089 1187
					string += '<ul class="mr_year">'
1090 1188
					string += '</ul>'
@ -1094,10 +1192,10 @@ $("#timeJobShow").on("blur", ".jobCompany", function() {
1094 1192
					string += '</div>'
1095 1193
					string += '<div class="lineTo floatL"></div>'
1096 1194
					string += '<div class="dateExp floatL">'
1097
					string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="5" difference="2"  value="">'
1195
					string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="2" difference="2"  value="">'
1098 1196
					string += '<div class="mr_calendar_ym clearfix">'
1099 1197
					string += '<ul class="mr_year">'
1100
					string += '<li>至今</li>'
1198
					string += '<li class="ymli">至今</li>'
1101 1199
					string += '</ul>'
1102 1200
					string += '<ul class="mr_month">'
1103 1201
					string += '</ul>'
@ -1110,7 +1208,7 @@ $("#timeJobShow").on("blur", ".jobCompany", function() {
1110 1208
					string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobTitle" /></div>'
1111 1209
					string += '</div>'
1112 1210
					string += '<div class="btnbox">'
1113
					string += '<input type="button" value="保存" class="infor-save btn btn-marL">'
1211
					string += '<input type="button" value="添加" class="infor-save btn btn-marL">'
1114 1212
					string += '<input type="button" value="取消" class="close1 close2 btn btn-marB">'
1115 1213
					string += '</div>'
1116 1214
					string += '</form>'
@ -1162,6 +1260,15 @@ var delTimeJob = function(data){
1162 1260
$("#timeJobShow").on("click", ".infor-save", function() {
1163 1261
	var length1 = trim($(this).parents(".txtExpForm").find(".jobCompany").val());
1164 1262
	var length2 = trim($(this).parents(".txtExpForm").find(".jobTitle").val());
1263
	var length3 = trim($(this).parents(".txtExpForm").find(".startMonth").val());
1264
	var length4 = trim($(this).parents(".txtExpForm").find(".stopMonth").val());
1265
	if(!length3&&length4) {
1266
		$.MsgBox.Alert("消息", "没有选开始时间");
1267
		return;
1268
	}else if(length3&&!length4){
1269
		$.MsgBox.Alert("消息", "没有选结束时间");
1270
		return;
1271
	}
1165 1272
	if(!length1&&length2) {
1166 1273
		$.MsgBox.Alert("消息", "机构名称不能为空");
1167 1274
		return;
@ -1181,11 +1288,16 @@ $("#timeJobShow").on("click", ".infor-save", function() {
1181 1288
			$data.company = $(this).parents(".txtExpForm").find(".jobCompany").val();
1182 1289
			
1183 1290
			var s=$(this).parents(".txtExpForm").find(".startMonth").val();
1184
			var st=$(this).parents(".txtExpForm").find(".stopMonth").val();
1185
			console.log(s);
1186
			console.log(st);
1187
			$data.startMonth = s.substr(0,4)+s.substr(5,6);			
1188
			$data.stopMonth =  st.substr(0,4)+st.substr(5,6);
1291
			var st=$(this).parents(".txtExpForm").find(".stopMonth").val();	
1292
			if(s){
1293
				$data.startMonth = s.substr(0,4)+s.substr(5,6);			
1294
			}
1295
			if(st){
1296
				if(st=="至今"){				
1297
				}else{
1298
					$data.stopMonth =  st.substr(0,4)+st.substr(5,6);	
1299
				}
1300
			}
1189 1301
			$data.title = $(this).parents(".txtExpForm").find(".jobTitle").val();
1190 1302
			$.ajax({
1191 1303
				"url" : "/ajax/job",
@ -1193,6 +1305,7 @@ $("#timeJobShow").on("click", ".infor-save", function() {
1193 1305
				"data" : $id ? JSON.stringify($data) : $data,
1194 1306
				"contentType" : $id ? "application/json"
1195 1307
						: "application/x-www-form-urlencoded",
1308
						beforeSend:function(){console.log(this.data)},
1196 1309
				"success" : function($data) {
1197 1310
					if ($data.success) 
1198 1311
					{
@ -1236,7 +1349,7 @@ $("#timeJobShow").on("click", ".infor-save", function() {
1236 1349
					string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
1237 1350
					string += '<div class="txtExp floatL">'
1238 1351
					string += '<div class="dateExp floatL">'
1239
					string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="6" difference="1"  value="">'
1352
					string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="2" difference="1"  value="">'
1240 1353
					string += '<div class="mr_calendar_ym clearfix">'
1241 1354
					string += '<ul class="mr_year">'
1242 1355
					string += '</ul>'
@ -1246,10 +1359,10 @@ $("#timeJobShow").on("click", ".infor-save", function() {
1246 1359
					string += '</div>'
1247 1360
					string += '<div class="lineTo floatL"></div>'
1248 1361
					string += '<div class="dateExp floatL">'
1249
					string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="6" difference="2" value="">'
1362
					string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="2" difference="2" value="">'
1250 1363
					string += '<div class="mr_calendar_ym clearfix">'
1251 1364
					string += '<ul class="mr_year">'
1252
					string += '<li>至今</li>'
1365
					string += '<li class="ymli">至今</li>'
1253 1366
					string += '</ul>'
1254 1367
					string += '<ul class="mr_month">'
1255 1368
					string += '</ul>'
@ -1277,8 +1390,8 @@ $("#timeJobShow").on("click", ".infor-save", function() {
1277 1390
				$("#projectShow").find(".listnone1").toggle(100);
1278 1391
			});
1279 1392
			$("#projectShow").on("click", "em", function() {
1280
				$(this).parent().hide();
1281
				$(this).parent().siblings().show();
1393
				$(this).parent().parent().hide();
1394
				$(this).parent().parent().siblings().show();
1282 1395
				//$(this).parent().parent().children(".")
1283 1396
			});
1284 1397
			$("#projectShow").on("click", ".close", function() {
@ -1313,10 +1426,20 @@ var delProject = function(data){
1313 1426
//项目经历保存		
1314 1427
$("#projectShow").on("click", ".infor-save",function () {
1315 1428
			var length = trim($(this).parents(".txtExpForm").find(".projectName").val());
1429
			var length1 = trim($(this).parents(".txtExpForm").find(".StartMonth").val());
1430
			var length2 = trim($(this).parents(".txtExpForm").find(".StopMonth").val());			
1316 1431
			if(!length) {
1317 1432
				$.MsgBox.Alert("消息", "项目名称不能为空");
1318 1433
				return;
1319 1434
			}
1435
			if(length1&&!length2){
1436
				$.MsgBox.Alert("消息", "没有选结束时间");
1437
				return;
1438
			}
1439
			if(!length1&&length2){
1440
				$.MsgBox.Alert("消息", "没有选开始时间");
1441
				return;
1442
			}
1320 1443
			var $data = {};
1321 1444
			var $id = $(this).parents(".txtExpForm").find(".projectId").val();
1322 1445
			console.log($id);
@ -1325,9 +1448,19 @@ $("#projectShow").on("click", ".infor-save",function () {
1325 1448
			}	
1326 1449
			$data.professorId = userid;
1327 1450
			var s=$(this).parents(".txtExpForm").find(".StartMonth").val();
1328
			var st=$(this).parents(".txtExpForm").find(".StopMonth").val();
1329
			$data.startMonth = s.substr(0,4)+s.substr(5,6);			
1330
			$data.stopMonth =  st.substr(0,4)+st.substr(5,6);
1451
			var st=$(this).parents(".txtExpForm").find(".StopMonth").val();	
1452
			if(s){
1453
				$data.startMonth = s.substr(0,4)+s.substr(5,6);	
1454
			}
1455
			if(st){
1456
				if(st=="至今"){				
1457
				}else{
1458
					$data.stopMonth =  st.substr(0,4)+st.substr(5,6);	
1459
				}
1460
			}
1461
			
1462
			
1463
					
1331 1464
			$data.name = $(this).parents(".txtExpForm").find(".projectName").val()
1332 1465
			$data.descp = $(this).parents(".txtExpForm").find(".projectDescp").val()
1333 1466
			$.ajax({
@ -1366,7 +1499,7 @@ var papFil=function(select){
1366 1499
		string += '<div class="edu date-box clearfix">'
1367 1500
		string += '<div class="txtType floatL">发表时间</div>'
1368 1501
		string += '<div class="txtExp floatL">'
1369
		string += '<input type="text" class="date-btn input-txt edu-txt paperYear" flag="2" value="">'
1502
		string += '<input type="text" class="date-btn input-txt edu-txt paperYear" flag="1" value="">'
1370 1503
		string += '<div class="mr_calendar_ym clearfix" style="wclassth: 180px; display: none;">'
1371 1504
		string += '<ul class="full_year">'
1372 1505
		string += '</ul>'
@ -1383,7 +1516,7 @@ var papFil=function(select){
1383 1516
		string += '</div>'
1384 1517
		string += '<div class="btnbox">'
1385 1518
		string += '<input type="hidden" class="paperId">'
1386
		string += '<input type="button" value="保存" class="infor-save btn" class="paperSave">'
1519
		string += '<input type="button" value="添加" class="infor-save btn" class="paperSave">'
1387 1520
		string += '<input type="button" value="取消" class="close1 close2 btn">'		
1388 1521
		string += '</div></form></div></li>'
1389 1522
		$(""+select+"").prepend(string);
@ -1402,8 +1535,8 @@ var papFil=function(select){
1402 1535
				$("#paperShow").find(".listnone1").toggle(100);
1403 1536
			});
1404 1537
			$("#paperShow").on("click", "em", function() {
1405
				$(this).parent().hide();
1406
				$(this).parent().siblings().show();
1538
				$(this).parent().parent().hide();
1539
				$(this).parent().parent().siblings().show();
1407 1540
				//$(this).parent().parent().children(".")
1408 1541
			});
1409 1542
			$("#paperShow").on("click", ".close", function() {
@ -1493,7 +1626,7 @@ var delPaper = function(data){
1493 1626
		string += '<div class="edu date-box clearfix">'
1494 1627
		string += '<div class="txtType floatL">发表时间</div>'
1495 1628
		string += '<div class="txtExp floatL">'
1496
		string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="3" value="">'
1629
		string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="1" value="">'
1497 1630
		string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
1498 1631
		string += '<ul class="full_year">'				
1499 1632
		string += '</ul>'
@ -1509,7 +1642,7 @@ var delPaper = function(data){
1509 1642
		string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentDescp"></div>'
1510 1643
		string += '</div>'
1511 1644
		string += '<div class="btnbox">'
1512
		string += '<input type="button" value="保存" class="infor-save btn">'
1645
		string += '<input type="button" value="添加" class="infor-save btn">'
1513 1646
		string += '<input type="button" value="取消" class="close1 close2 btn">'		
1514 1647
		string += '</div>'
1515 1648
		string += '</form>'
@ -1525,8 +1658,8 @@ var delPaper = function(data){
1525 1658
		$("#patentShow").find(".listnone1").toggle(100);
1526 1659
	});
1527 1660
	$("#patentShow").on("click", "em", function() {
1528
		$(this).parent().hide();
1529
		$(this).parent().siblings().show();
1661
		$(this).parent().parent().hide();
1662
		$(this).parent().parent().siblings().show();
1530 1663
		//$(this).parent().parent().children(".")
1531 1664
	});
1532 1665
	$("#patentShow").on("click", ".close", function() {
@ -1625,7 +1758,7 @@ $("#honorShow").on("blur", ".honorName", function() {
1625 1758
					string += '<div class="edu date-box clearfix">'
1626 1759
					string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
1627 1760
					string += '<div class="txtExp floatL">'
1628
					string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="4" value="">'
1761
					string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="1" value="">'
1629 1762
					string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
1630 1763
					string += '<ul class="full_year">'
1631 1764
					string += '</ul>'
@ -1633,7 +1766,7 @@ $("#honorShow").on("blur", ".honorName", function() {
1633 1766
					string += '</div>'
1634 1767
					string += '</div>'
1635 1768
					string += '<div class="btnbox">'
1636
					string += '<input type="button" value="保存" class="infor-save btn">'
1769
					string += '<input type="button" value="添加" class="infor-save btn">'
1637 1770
					string += '<input type="button" value="取消" class="close1 close2 btn">'
1638 1771
					string += '</div>'
1639 1772
					string += '</form>'
@ -1649,8 +1782,8 @@ $("#honorShow").on("blur", ".honorName", function() {
1649 1782
				$("#honorShow").find(".listnone1").toggle(100);
1650 1783
			});
1651 1784
			$("#honorShow").on("click", "em", function() {
1652
				$(this).parent().hide();
1653
				$(this).parent().siblings().show();
1785
				$(this).parent().parent().hide();
1786
				$(this).parent().parent().siblings().show();
1654 1787
				//$(this).parent().parent().children(".")
1655 1788
			});
1656 1789
			$("#honorShow").on("click", ".close", function() {