|
@ -6,513 +6,6 @@ $(function() {
|
6
|
6
|
var authSD
|
7
|
7
|
var userid = $.cookie("userid");
|
8
|
8
|
if(userid) {
|
9
|
|
//填充学术领域
|
10
|
|
var subjectShow = function(data) {
|
11
|
|
if(data != undefined && data.length != 0) {
|
12
|
|
var subs = new Array();
|
13
|
|
if(data.indexOf(',')) {
|
14
|
|
subs = data.split(',');
|
15
|
|
} else {
|
16
|
|
subs[0] = data;
|
17
|
|
}
|
18
|
|
if(subs.length > 0) {
|
19
|
|
for(var i = 0; i < subs.length; i++) {
|
20
|
|
$("#subjectList").append('<li>'+ subs[i] + '<div class="closeThis"></div></li>');
|
21
|
|
$("#subjectShow").append('<li>'+ subs[i] + '</li>');
|
22
|
|
};
|
23
|
|
}
|
24
|
|
}
|
25
|
|
}
|
26
|
|
//填充应用行业
|
27
|
|
var industryShow = function(data) {
|
28
|
|
if(data != undefined && data.length != 0) {
|
29
|
|
var subs = new Array();
|
30
|
|
if(data.indexOf(',')) {
|
31
|
|
subs = data.split(',');
|
32
|
|
} else {
|
33
|
|
subs[0] = data;
|
34
|
|
}
|
35
|
|
if(subs.length > 0) {
|
36
|
|
for(var i = 0; i < subs.length; i++) {
|
37
|
|
$("#industryList").append('<li>' + subs[i] + '<div class="closeThis"></div></li>');
|
38
|
|
$("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
|
39
|
|
|
40
|
|
};
|
41
|
|
}
|
42
|
|
}
|
43
|
|
}
|
44
|
|
//填充教育背景
|
45
|
|
var eduBgShow = function(data) {
|
46
|
|
eduFil("#eduUl");
|
47
|
|
if(data.length > 0) {
|
48
|
|
for(var i = 0; i < data.length; i++) {
|
49
|
|
if(!data[i].year) {
|
50
|
|
data[i].year = "";
|
51
|
|
}
|
52
|
|
if(!data[i].college) {
|
53
|
|
data[i].college = "";
|
54
|
|
}
|
55
|
|
if(!data[i].major) {
|
56
|
|
data[i].major = "";
|
57
|
|
}
|
58
|
|
if(!data[i].degree) {
|
59
|
|
data[i].degree = "";
|
60
|
|
}
|
61
|
|
var string = '<li class="paddingSpace">'
|
62
|
|
string += ' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>'
|
63
|
|
if(data[i].college && data[i].major && data[i].degree) {
|
64
|
|
string += data[i].school + '-' + data[i].college + '-' + data[i].major + '-' + data[i].degree
|
65
|
|
} else if(!data[i].college && data[i].major && data[i].degree) {
|
66
|
|
string += data[i].school + '-' + data[i].major + '-' + data[i].degree
|
67
|
|
} else if(data[i].college && !data[i].major && data[i].degree) {
|
68
|
|
string += data[i].school + '-' + data[i].college + '-' + data[i].degree
|
69
|
|
} else if(data[i].college && data[i].major && !data[i].degree) {
|
70
|
|
string += data[i].school + '-' + data[i].college + '-' + data[i].major
|
71
|
|
} else if(!data[i].college && !data[i].major && data[i].degree) {
|
72
|
|
string += data[i].school + '-' + data[i].degree
|
73
|
|
} else if(!data[i].college && data[i].major && !data[i].degree) {
|
74
|
|
string += data[i].school + '-' + data[i].major
|
75
|
|
} else if(data[i].college && !data[i].major && !data[i].degree) {
|
76
|
|
string += data[i].school + '-' + data[i].college
|
77
|
|
}
|
78
|
|
//+data[i].school+'-'+data[i].college+'-'+data[i].major+'-'+data[i].degree+
|
79
|
|
string += '<small class="h6Font">' + data[i].year + '</small><em class="exitlist inforedu"></em></div>'
|
80
|
|
string += '<div class="modifybox">'
|
81
|
|
string += '<form class="txtExpForm">'
|
82
|
|
string += '<div class="infor edu">'
|
83
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">学</em>校</div>'
|
84
|
|
string += '<input type="hidden" class="eduId" value="' + data[i].id + '">'
|
85
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt school" value="' + data[i].school + '"></div>'
|
86
|
|
string += '</div>'
|
87
|
|
string += '<div class="edu date-box clearfix">'
|
88
|
|
string += '<div class="txtType floatL">毕业年份</div>'
|
89
|
|
string += '<div class="txtExp floatL">'
|
90
|
|
if(data[i].year) {
|
91
|
|
string += '<input type="text" class="date-btn input-txt edu-txt year" name="YYYY" flag="1" value="' + data[i].year + '">'
|
92
|
|
} else {
|
93
|
|
string += '<input type="text" class="date-btn input-txt edu-txt year" name="YYYY" flag="1" value="">'
|
94
|
|
}
|
95
|
|
|
96
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
97
|
|
string += '<ul class="full_year">'
|
98
|
|
string += '</ul>'
|
99
|
|
string += '</div>'
|
100
|
|
string += '</div>'
|
101
|
|
string += '</div>'
|
102
|
|
string += '<div class="infor edu">'
|
103
|
|
string += '<div class="txtType floatL"><em class="emspace">院</em>系</div>'
|
104
|
|
if(data[i].college) {
|
105
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt floatL college" value="' + data[i].college + '"></div>'
|
106
|
|
} else {
|
107
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt floatL college"></div>'
|
108
|
|
}
|
109
|
|
|
110
|
|
string += '</div>'
|
111
|
|
string += '<div class="infor edu">'
|
112
|
|
string += '<div class="txtType floatL"><em class="emspace">专</em>业</div>'
|
113
|
|
if(data[i].major) {
|
114
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt major" value="' + data[i].major + '"></div>'
|
115
|
|
} else {
|
116
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt major" ></div>'
|
117
|
|
}
|
118
|
|
|
119
|
|
string += '</div>'
|
120
|
|
string += '<div class="edu ulbox clearfix">'
|
121
|
|
string += '<div class="txtType floatL">获得学位</div>'
|
122
|
|
string += '<div class="mr_timed_div input-txt edu-txt floatL">'
|
123
|
|
string += '<i class="mr_sj"></i>'
|
124
|
|
string += '<input type="hidden" name="degree_text">'
|
125
|
|
if(data[i].degree) {
|
126
|
|
string += '<input type="button" class="mr_btn" name="degree_val" onclick="showmenu()" id="div_select2" value="' + data[i].degree + '">'
|
127
|
|
} else {
|
128
|
|
string += '<input type="button" class="mr_btn" name="degree_val" onclick="showmenu()" id="div_select2" value="本科">'
|
129
|
|
}
|
130
|
|
|
131
|
|
string += '<div class="xl_list">'
|
132
|
|
string += '<ul class="ul_edubg ulShow" style="display:none">'
|
133
|
|
string += '<li>学士</li>'
|
134
|
|
string += '<li>硕士</li>'
|
135
|
|
string += '<li>博士</li>'
|
136
|
|
string += '<li>其他</li>'
|
137
|
|
string += '</ul>'
|
138
|
|
string += '</div>'
|
139
|
|
string += '</div>'
|
140
|
|
string += '</div>'
|
141
|
|
string += '<div class="btnbox btnboxO">'
|
142
|
|
string += '<input type="button" value="保存" class="btnModel saveEduBg">'
|
143
|
|
string += '<input type="button" value="取消" class="btnModel btnCancel">'
|
144
|
|
string += '<input type="button" value="删除本条" class="btnModel fontLink">'
|
145
|
|
string += '</div>'
|
146
|
|
string += '</form>'
|
147
|
|
string += '</div>'
|
148
|
|
string += '</li>'
|
149
|
|
|
150
|
|
$("#eduUl").append(string);
|
151
|
|
}
|
152
|
|
}
|
153
|
|
}
|
154
|
|
//填充社会兼职
|
155
|
|
var timeJobShow = function(data) {
|
156
|
|
jobFil("#timeJobShow");
|
157
|
|
if(data.length > 0) {
|
158
|
|
for(var i = 0; i < data.length; i++) {
|
159
|
|
var sDate = "";
|
160
|
|
var eDate = "";
|
161
|
|
if(data[i].department) {
|
162
|
|
var dep = "-" + data[i].department;
|
163
|
|
var depart = data[i].department;
|
164
|
|
} else {
|
165
|
|
var dep = "";
|
166
|
|
var depart = ""
|
167
|
|
}
|
168
|
|
if(data[i].startMonth) {
|
169
|
|
|
170
|
|
sDate = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
|
171
|
|
if(data[i].stopMonth) {
|
172
|
|
eDate = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6);
|
173
|
|
} else {
|
174
|
|
eDate = "至今"
|
175
|
|
}
|
176
|
|
}
|
177
|
|
var string = '<li class="paddingSpace listnone">'
|
178
|
|
string += ' <div class="listdata h4Font h4tit edudata"><i class="listpoint"></i>' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">';
|
179
|
|
string += sDate;
|
180
|
|
if(eDate) string += ("-" + eDate);
|
181
|
|
string += '</small><em class="exitlist inforedu"></em></div>';
|
182
|
|
string += '<div class="modifybox">'
|
183
|
|
string += '<form class="txtExpForm">'
|
184
|
|
string += '<div class="infor edu">'
|
185
|
|
string += '<div class="txtType floatL"><b class="required_star"></b>机构名称</div>'
|
186
|
|
string += '<input type="hidden" class="jobId" value="' + data[i].id + '">'
|
187
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobCompany" value="' + data[i].company + '"/></div>'
|
188
|
|
string += '</div>'
|
189
|
|
string += '<div class="edu date-box clearfix">'
|
190
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
191
|
|
string += '<div class="txtExp floatL">'
|
192
|
|
string += '<div class="dateExp floatL">'
|
193
|
|
string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="2" difference="1" value="' + sDate + '">'
|
194
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
195
|
|
string += '<ul class="mr_year">'
|
196
|
|
string += '</ul>'
|
197
|
|
string += '<ul class="mr_month">'
|
198
|
|
string += '</ul>'
|
199
|
|
string += '</div>'
|
200
|
|
string += '</div>'
|
201
|
|
string += '<div class="lineTo floatL"></div>'
|
202
|
|
string += '<div class="dateExp floatL">'
|
203
|
|
string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="2" difference="2" value="' + eDate + '">'
|
204
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
205
|
|
string += '<ul class="mr_year">'
|
206
|
|
string += '<li class="ymli">至今</li>'
|
207
|
|
string += '</ul>'
|
208
|
|
string += '<ul class="mr_month">'
|
209
|
|
string += '</ul>'
|
210
|
|
string += '</div>'
|
211
|
|
string += '</div>'
|
212
|
|
string += '</div>'
|
213
|
|
string += '</div>'
|
214
|
|
string += '<div class="infor edu btn-marL">'
|
215
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">职</em>位</div>'
|
216
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobTitle" value="' + data[i].title + '"/></div>'
|
217
|
|
string += '</div>'
|
218
|
|
string += '<div class="infor edu btn-marL">'
|
219
|
|
string += '<div class="txtType floatL">所在部门</div>'
|
220
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobdepartment" value="' + depart + '"/></div>'
|
221
|
|
string += '</div>'
|
222
|
|
string += '<div class="btnbox">'
|
223
|
|
string += '<input type="button" value="保存" class="infor-save btn btn-marL">'
|
224
|
|
string += '<input type="button" value="取消" class="close btn btn-marB">'
|
225
|
|
string += '<input type="button" value="删除本条" class="deletebtn">'
|
226
|
|
string += '</div>'
|
227
|
|
string += '</form>'
|
228
|
|
string += '</div>'
|
229
|
|
string += '</li>'
|
230
|
|
$("#timeJobShow").append(string);
|
231
|
|
}
|
232
|
|
}
|
233
|
|
}
|
234
|
|
//填充项目经历
|
235
|
|
var projectShow = function(data) {
|
236
|
|
projectFil("#projectShow")
|
237
|
|
if(data.length > 0) {
|
238
|
|
for(var i = 0; i < data.length; i++) {
|
239
|
|
if(!data[i].descp) {
|
240
|
|
|
241
|
|
data[i].descp = "";
|
242
|
|
}
|
243
|
|
if(!data[i].startMonth) {
|
244
|
|
data[i].startMonth = '';
|
245
|
|
data[i].stopMonth = '';
|
246
|
|
} else {
|
247
|
|
data[i].startMonth = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + "-"
|
248
|
|
if(!data[i].stopMonth) {
|
249
|
|
data[i].stopMonth = '至今';
|
250
|
|
} else {
|
251
|
|
data[i].stopMonth = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6)
|
252
|
|
}
|
253
|
|
}
|
254
|
|
var string = '<li class="paddingSpace listnone">'
|
255
|
|
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>';
|
256
|
|
string += '<div class="listdata h5Font">' + data[i].descp + '</div></div>';
|
257
|
|
//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>'
|
258
|
|
string += '<div class="modifybox">'
|
259
|
|
string += '<form class="txtExpForm">'
|
260
|
|
string += '<div class="infor edu">'
|
261
|
|
string += '<div class="txtType floatL"><b class="required_star"></b>项目名称</div>'
|
262
|
|
string += '<input type="hidden" class="projectId" value="' + data[i].id + '"/>'
|
263
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt projectName" value="' + data[i].name + '"></div>'
|
264
|
|
string += '</div>'
|
265
|
|
string += '<div class="edu date-box clearfix">'
|
266
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
267
|
|
string += '<div class="txtExp floatL">'
|
268
|
|
string += '<div class="dateExp floatL">'
|
269
|
|
string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="2" difference="1" value="' + data[i].startMonth.substr(0, 7) + '">'
|
270
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
271
|
|
string += '<ul class="mr_year">'
|
272
|
|
string += '</ul>'
|
273
|
|
string += '<ul class="mr_month">'
|
274
|
|
string += '</ul>'
|
275
|
|
string += '</div>'
|
276
|
|
string += '</div>'
|
277
|
|
string += '<div class="lineTo floatL"></div>'
|
278
|
|
string += '<div class="dateExp floatL">'
|
279
|
|
string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="2" difference="2" value="' + data[i].stopMonth + '">'
|
280
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
281
|
|
string += '<ul class="mr_year">'
|
282
|
|
string += '<li class="ymli">至今</li>'
|
283
|
|
string += '</ul>'
|
284
|
|
string += '<ul class="mr_month">'
|
285
|
|
string += '</ul>'
|
286
|
|
string += '</div>'
|
287
|
|
string += '</div>'
|
288
|
|
string += '</div>'
|
289
|
|
string += '</div>'
|
290
|
|
string += '<div class="infor edu">'
|
291
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
292
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt projectDescp" value="' + data[i].descp + '"></div>'
|
293
|
|
string += '</div>'
|
294
|
|
string += '<div class="btnbox">'
|
295
|
|
string += '<input type="button" value="保存" class="infor-save btn">'
|
296
|
|
string += '<input type="button" value="取消" class="close btn">'
|
297
|
|
string += '<input type="button" value="删除本条" class="deletebtn">'
|
298
|
|
string += '</div>'
|
299
|
|
string += '</form>'
|
300
|
|
string += '</div>'
|
301
|
|
string += '</li>'
|
302
|
|
$("#projectShow").append(string);
|
303
|
|
|
304
|
|
}
|
305
|
|
}
|
306
|
|
}
|
307
|
|
//填充著作论文文章
|
308
|
|
var paperShow = function(data) {
|
309
|
|
papFil("#paperShow");
|
310
|
|
if(data.length > 0) {
|
311
|
|
for(var i = 0; i < data.length; i++) {
|
312
|
|
if(!data[i].year) {
|
313
|
|
data[i].year = "";
|
314
|
|
}
|
315
|
|
if(!data[i].descp) {
|
316
|
|
data[i].descp = "";
|
317
|
|
}
|
318
|
|
if(!data[i].url) {
|
319
|
|
data[i].url = "";
|
320
|
|
}
|
321
|
|
|
322
|
|
var string = '<li class="paddingSpace listnone">'
|
323
|
|
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>';
|
324
|
|
string += '<div class="listdata h5Font">' + data[i].descp + '</div></div>';
|
325
|
|
//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
|
326
|
|
string += '<div class="modifybox">'
|
327
|
|
string += '<form class="txtExpForm">'
|
328
|
|
string += '<div class="infor edu">'
|
329
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
330
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperName" value="' + data[i].name + '"></div>'
|
331
|
|
string += '</div>'
|
332
|
|
string += '<div class="edu date-box clearfix">'
|
333
|
|
string += '<div class="txtType floatL">发表时间</div>'
|
334
|
|
string += '<div class="txtExp floatL">'
|
335
|
|
string += '<input type="text" class="date-btn input-txt edu-txt paperYear" flag="1" value="' + data[i].year + '">'
|
336
|
|
string += '<div class="mr_calendar_ym clearfix" style="wclassth: 180px; display: none;">'
|
337
|
|
string += '<ul class="full_year">'
|
338
|
|
string += '</ul>'
|
339
|
|
string += '</div>'
|
340
|
|
string += '</div>'
|
341
|
|
string += '</div>'
|
342
|
|
string += '<div class="infor edu">'
|
343
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
344
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperDescp" value="' + data[i].descp + '"></div>'
|
345
|
|
string += '</div>'
|
346
|
|
// string += '<div class="infor edu">'
|
347
|
|
// string += '<div class="txtType floatL"><em class="emspace">链</em>接</div>'
|
348
|
|
// string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperUrl" value="'+data[i].url+'"></div>'
|
349
|
|
// string += '</div>'
|
350
|
|
string += '<div class="btnbox">'
|
351
|
|
string += '<input type="hidden" class="paperId" value="' + data[i].id + '">'
|
352
|
|
string += '<input type="button" value="保存" class="infor-save btn" class="paperSave">'
|
353
|
|
string += '<input type="button" value="取消" class="close btn">'
|
354
|
|
string += '<input type="button" value="删除本条" class="deletebtn">'
|
355
|
|
string += '</div></form></div></li>'
|
356
|
|
$("#paperShow").append(string);
|
357
|
|
}
|
358
|
|
}
|
359
|
|
}
|
360
|
|
//填充专利
|
361
|
|
var patentShow = function(data) {
|
362
|
|
patFil("#patentShow");
|
363
|
|
if(data.length > 0) {
|
364
|
|
for(var i = 0; i < data.length; i++) {
|
365
|
|
if(!data[i].year) {
|
366
|
|
data[i].year = "";
|
367
|
|
}
|
368
|
|
if(!data[i].descp) {
|
369
|
|
data[i].descp = "";
|
370
|
|
}
|
371
|
|
if(!data[i].url) {
|
372
|
|
data[i].url = "";
|
373
|
|
}
|
374
|
|
var string = '<li class="paddingSpace listnone">'
|
375
|
|
//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
|
376
|
|
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>';
|
377
|
|
string += '<div class="listdata h5Font">' + data[i].descp + '</div></div>';
|
378
|
|
string += '<div class="modifybox">'
|
379
|
|
string += '<form class="txtExpForm">'
|
380
|
|
string += '<div class="infor edu">'
|
381
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
382
|
|
string += '<input type="hidden" class="patentId" value="' + data[i].id + '">'
|
383
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentName" value="' + data[i].name + '"></div>'
|
384
|
|
string += '</div>'
|
385
|
|
string += '<div class="edu date-box clearfix">'
|
386
|
|
string += '<div class="txtType floatL">发表时间</div>'
|
387
|
|
string += '<div class="txtExp floatL">'
|
388
|
|
string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="1" value="' + data[i].year + '">'
|
389
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
390
|
|
string += '<ul class="full_year">'
|
391
|
|
string += '</ul>'
|
392
|
|
string += '</div>'
|
393
|
|
string += '</div>'
|
394
|
|
string += '</div>'
|
395
|
|
// string += '<div class="infor edu">'
|
396
|
|
// string += '<div class="txtType floatL"><em class="emspace">链</em>接</div>'
|
397
|
|
// string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentUrl" value="'+data[i].url+'"></div>'
|
398
|
|
// string += '</div>'
|
399
|
|
string += '<div class="infor edu">'
|
400
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
401
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentDescp"value="' + data[i].descp + '"></div>'
|
402
|
|
string += '</div>'
|
403
|
|
string += '<div class="btnbox">'
|
404
|
|
string += '<input type="button" value="保存" class="infor-save btn">'
|
405
|
|
string += '<input type="button" value="取消" class="close btn">'
|
406
|
|
string += '<input type="button" value="删除本条" class="deletebtn">'
|
407
|
|
string += '</div>'
|
408
|
|
string += '</form>'
|
409
|
|
string += '</div>'
|
410
|
|
string += '</li>'
|
411
|
|
$("#patentShow").append(string);
|
412
|
|
}
|
413
|
|
}
|
414
|
|
}
|
415
|
|
//填充荣誉
|
416
|
|
var honorShow = function(data) {
|
417
|
|
hounerFil("#honorShow");
|
418
|
|
if(data.length > 0) {
|
419
|
|
for(var i = 0; i < data.length; i++) {
|
420
|
|
if(!data[i].year) {
|
421
|
|
data[i].year = "";
|
422
|
|
}
|
423
|
|
if(!data[i].descp) {
|
424
|
|
data[i].descp = "";
|
425
|
|
}
|
426
|
|
var string = '<li class="paddingSpace listnone">'
|
427
|
|
//string+=' <div class="listdata edudata"><i class="listpoint"></i>'+data[i].year+'-'+data[i].name+'-'+data[i].descp+'<em class="exitlist inforedu"></em></div>'
|
428
|
|
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>';
|
429
|
|
string += '<div class="listdata h5Font">' + data[i].descp + '</div></div>';
|
430
|
|
string += '<div class="modifybox">'
|
431
|
|
string += '<form class="txtExpForm">'
|
432
|
|
string += '<div class="infor edu">'
|
433
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
434
|
|
string += '<input type="hidden" class="honorId" value="' + data[i].id + '">'
|
435
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt honorName" value="' + data[i].name + '"></div>'
|
436
|
|
string += '</div>'
|
437
|
|
string += '<div class="infor edu">'
|
438
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
439
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentDescp" value="' + data[i].descp + '"></div>'
|
440
|
|
string += '</div>'
|
441
|
|
string += '<div class="edu date-box clearfix">'
|
442
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
443
|
|
string += '<div class="txtExp floatL">'
|
444
|
|
string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="1" value="' + data[i].year + '">'
|
445
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
446
|
|
string += '<ul class="full_year">'
|
447
|
|
string += '</ul>'
|
448
|
|
string += '</div>'
|
449
|
|
string += '</div>'
|
450
|
|
string += '</div>'
|
451
|
|
string += '<div class="btnbox">'
|
452
|
|
string += '<input type="button" value="保存" class="infor-save btn">'
|
453
|
|
string += '<input type="button" value="取消" class="close btn">'
|
454
|
|
string += '<input type="button" value="删除本条" class="deletebtn">'
|
455
|
|
string += '</div>'
|
456
|
|
string += '</form>'
|
457
|
|
string += '</div>'
|
458
|
|
string += '</li>'
|
459
|
|
$("#honorShow").append(string);
|
460
|
|
}
|
461
|
|
}
|
462
|
|
}
|
463
|
|
//填充研究方向
|
464
|
|
var researchAreaShow = function($datas, $datarecords) {
|
465
|
|
if($datas != undefined && $datas.length != 0) {
|
466
|
|
$("#researchAreaList").empty();
|
467
|
|
for(var i = 0; i < $datas.length; ++i) {
|
468
|
|
var $data = $datas[i];
|
469
|
|
var $photos = [];
|
470
|
|
//获取头像
|
471
|
|
if($datarecords.length > 0) {
|
472
|
|
$photos = getRecords($datarecords, $data.caption);
|
473
|
|
}
|
474
|
|
var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><div class="favorCount" caption="'+ $data.caption +'">';
|
475
|
|
if($photos.length < 6) {
|
476
|
|
for(var j = 0; j < $photos.length; ++j) {
|
477
|
|
if($photos[j].img) {
|
478
|
|
showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
|
479
|
|
} else {
|
480
|
|
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
|
481
|
|
}
|
482
|
|
}
|
483
|
|
} else {
|
484
|
|
for(var j = $photos.length - 5; j < $photos.length; ++j) {
|
485
|
|
if($photos[j].img) {
|
486
|
|
showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
|
487
|
|
} else {
|
488
|
|
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
|
489
|
|
}
|
490
|
|
}
|
491
|
|
showDiv += '<span class="like-people like-more"></span>';
|
492
|
|
}
|
493
|
|
showDiv += "</div></li>";
|
494
|
|
|
495
|
|
$("#researchAreaShow ul").append(showDiv);
|
496
|
|
$("#researchAreaList").append("<li class='yjlist'><span class='like'>" + $data.count + "</span><span class='ra'>" + $data.caption + "</span><span class='closeThis'></span></li>");
|
497
|
|
|
498
|
|
}
|
499
|
|
}
|
500
|
|
}
|
501
|
|
//判断点赞的用户是否有头像
|
502
|
|
var getRecords = function($researchAreaLogs, caption) {
|
503
|
|
var ret = [];
|
504
|
|
var t = 0;
|
505
|
|
for(var i = 0; i < $researchAreaLogs.length; i++) {
|
506
|
|
if(caption == $researchAreaLogs[i].caption) {
|
507
|
|
ret[t] = {
|
508
|
|
id: $researchAreaLogs[i].opreteProfessorId,
|
509
|
|
img: $researchAreaLogs[i].hasHeadImage
|
510
|
|
}
|
511
|
|
t++;
|
512
|
|
}
|
513
|
|
}
|
514
|
|
return ret;
|
515
|
|
}
|
516
|
9
|
//获取数据,填充页面
|
517
|
10
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
518
|
11
|
if($data.success) {
|
|
@ -520,6 +13,9 @@ $(function() {
|
520
|
13
|
var $info = $data.data;
|
521
|
14
|
if($info) {
|
522
|
15
|
//展示专家的信息
|
|
16
|
if($info.hasHeadImage){
|
|
17
|
$("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
|
|
18
|
}
|
523
|
19
|
$("#proName").text($info.name);
|
524
|
20
|
var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
|
525
|
21
|
$("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
|
|
@ -600,14 +96,6 @@ $(function() {
|
600
|
96
|
if($info.projects) {
|
601
|
97
|
projectShow($info.projects)
|
602
|
98
|
}
|
603
|
|
//著作 论文 文章
|
604
|
|
if($info.papers) {
|
605
|
|
paperShow($info.papers);
|
606
|
|
}
|
607
|
|
//专利
|
608
|
|
if($info.patents) {
|
609
|
|
patentShow($info.patents);
|
610
|
|
}
|
611
|
99
|
//荣誉及奖项
|
612
|
100
|
if($info.honors) {
|
613
|
101
|
honorShow($info.honors);
|
|
@ -624,113 +112,76 @@ $(function() {
|
624
|
112
|
location.href = "login.html";
|
625
|
113
|
return;
|
626
|
114
|
}
|
627
|
|
|
628
|
115
|
|
629
|
|
function trim(str) { //删除左右两端的空格
|
630
|
|
return str.replace(/(^\s*)|(\s*$)/g, "");
|
631
|
|
}
|
|
116
|
//////////////////基本信息增删改查相关开始//////////////
|
632
|
117
|
//头像旁保存
|
633
|
118
|
$("#saveProfessor").on("click", function() {
|
634
|
|
var length1 = trim($("#name").text());
|
635
|
|
//console.log(length1)
|
636
|
|
var length2 = trim($("#orgName").val());
|
|
119
|
var Str1=trim($("#title").val());//职称
|
|
120
|
var Str2=trim($("#officeRevise").val());//职位
|
|
121
|
var Str3=trim($("#orgName").val());//所在机构
|
|
122
|
var Str4=trim($("#department").val());//所在部门
|
|
123
|
if(Str1.length>20){$.MsgBox.Alert("提示", "职称不得超过20个字");return;}
|
|
124
|
if(Str2.length>20){$.MsgBox.Alert("提示", "职位不得超过20个字");return;}
|
|
125
|
if(Str3.length>50){$.MsgBox.Alert("提示", "所在机构不得超过50个字");return;}
|
|
126
|
if(Str4.length>20){$.MsgBox.Alert("提示", "所在部门不得超过20个字");return;}
|
|
127
|
|
637
|
128
|
var loginName=$("#mobilePhone").val();
|
638
|
129
|
if(trim(loginName)){
|
639
|
130
|
var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
|
640
|
131
|
if(!hunPhone.test(loginName.trim())) {
|
641
|
|
$.MsgBox.Alert("消息提醒", "联系电话格式不对,请输入正确的格式");
|
|
132
|
$.MsgBox.Alert("提示", "联系电话格式有误,请检查后重新填写");
|
642
|
133
|
return;
|
643
|
134
|
}
|
644
|
135
|
}
|
|
136
|
// if(trim(loginName)) {
|
|
137
|
// if(loginName.length > 50) {
|
|
138
|
// $.MsgBox.Alert('提示', '联系电话不得超过50个字');
|
|
139
|
// return;
|
|
140
|
// }
|
|
141
|
// }
|
|
142
|
|
645
|
143
|
var mail=$("#moileMail").val();
|
646
|
144
|
if(trim(mail)){
|
647
|
145
|
var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
648
|
146
|
if(!gunf.test(mail.trim())) {
|
649
|
|
$.MsgBox.Alert("消息提醒", "请输入正确的邮箱格式");
|
650
|
|
return;
|
651
|
|
}
|
652
|
|
}
|
653
|
|
if(!length1 && length2) {
|
654
|
|
$.MsgBox.Alert("消息提醒", "姓名不能为空");
|
655
|
|
return;
|
656
|
|
} else if(length1 && !length2) {
|
657
|
|
$.MsgBox.Alert("消息提醒", "所在机构不能为空");
|
658
|
|
return;
|
659
|
|
} else if(!length1 && !length2) {
|
660
|
|
$.MsgBox.Alert("消息提醒", "姓名和所在机构不能为空");
|
661
|
|
return;
|
662
|
|
}
|
663
|
|
if(nameD != length1 && orgD != length2) {
|
664
|
|
if(authSD) {
|
665
|
|
$.MsgBox.Confirm("消息", "修改姓名&&和所在机构会导致身份验证失效?", personUpdata);
|
666
|
|
|
667
|
|
return;
|
668
|
|
} else {
|
669
|
|
personUpdata();
|
670
|
|
}
|
671
|
|
|
672
|
|
} else if(nameD == length1 && orgD != length2) {
|
673
|
|
if(authSD) {
|
674
|
|
$.MsgBox.Confirm("消息", "修改所在机构会导致身份验证失效?", personUpdata);
|
675
|
|
return;
|
676
|
|
} else {
|
677
|
|
personUpdata();
|
678
|
|
}
|
679
|
|
|
680
|
|
} else if(nameD != length1 && orgD == length2) {
|
681
|
|
if(authSD) {
|
682
|
|
$.MsgBox.Confirm("消息", "修改姓名会导致身份验证失效?", personUpdata);
|
|
147
|
$.MsgBox.Alert("提示", "联系邮箱格式有误,请检查后重新填写");
|
683
|
148
|
return;
|
684
|
|
} else {
|
685
|
|
personUpdata();
|
686
|
149
|
}
|
687
|
|
|
688
|
|
} else {
|
689
|
|
personUpdata();
|
690
|
150
|
}
|
691
|
|
|
|
151
|
personUpdata();
|
692
|
152
|
});
|
693
|
153
|
//更新认证状态函数
|
694
|
|
var upStatus = function() {
|
695
|
|
$.ajax({
|
696
|
|
url: "/ajax/professor/authStatus",
|
697
|
|
dataType: 'json', //数据格式类型
|
698
|
|
type: 'post', //http请求类型
|
699
|
|
data: {
|
700
|
|
authStatus: 0,
|
701
|
|
id: userid
|
702
|
|
},
|
703
|
|
timeout: 10000, //超时设置
|
704
|
|
success: function(data) {
|
705
|
|
if(data.success) {} else {
|
706
|
|
|
707
|
|
}
|
708
|
|
}
|
709
|
|
})
|
710
|
|
}
|
|
154
|
// var upStatus = function() {
|
|
155
|
// $.ajax({
|
|
156
|
// url: "/ajax/professor/authStatus",
|
|
157
|
// dataType: 'json', //数据格式类型
|
|
158
|
// type: 'post', //http请求类型
|
|
159
|
// data: {
|
|
160
|
// authStatus: 0,
|
|
161
|
// id: userid
|
|
162
|
// },
|
|
163
|
// timeout: 10000, //超时设置
|
|
164
|
// success: function(data) {
|
|
165
|
// if(data.success) {} else {
|
|
166
|
//
|
|
167
|
// }
|
|
168
|
// }
|
|
169
|
// })
|
|
170
|
// }
|
711
|
171
|
|
712
|
172
|
function personUpdata() {
|
713
|
|
if(nameD == $("#name").text() && orgD == $("#orgName").val()) {
|
714
|
|
|
715
|
|
} else {
|
716
|
|
if(authSD) {
|
717
|
|
upStatus();
|
718
|
|
}
|
719
|
|
|
720
|
|
}
|
721
|
|
|
722
|
173
|
var $data = {};
|
723
|
|
$data.name = $("#name").val();
|
|
174
|
$data.name = $("#name").text();
|
724
|
175
|
$data.orgId = $("#orgId").val();
|
725
|
176
|
$data.orgName = $("#orgName").val();
|
726
|
177
|
$data.title = $("#title").val();
|
727
|
178
|
$data.department = $("#department").val();
|
728
|
179
|
$data.phone=$("#mobilePhone").val();
|
729
|
180
|
$data.email=$("#moileMail").val();
|
730
|
|
if($("#Province input[name=cho_Province]").val() != "请选择省份") {
|
|
181
|
if($("#Province input[name=cho_Province]").val() != "请选择所在省/直辖市") {
|
731
|
182
|
$data.province = $("#Province input[name=cho_Province]").val(); //省
|
732
|
183
|
}
|
733
|
|
if($("#City input[name=cho_City]").val() != "请选择城市") {
|
|
184
|
if($("#City input[name=cho_City]").val() != "请选择所在城市") {
|
734
|
185
|
$data.address = $("#City input[name=cho_City]").val(); //市
|
735
|
186
|
}
|
736
|
187
|
$data.office = $("#officeRevise").val();
|
|
@ -742,7 +193,6 @@ $(function() {
|
742
|
193
|
"url": "../ajax/professor",
|
743
|
194
|
"type": userid ? "PUT" : "POST",
|
744
|
195
|
"success": function(rdata) {
|
745
|
|
|
746
|
196
|
if(rdata.success) {
|
747
|
197
|
if(userid) {
|
748
|
198
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
|
@ -752,15 +202,7 @@ $(function() {
|
752
|
202
|
//展示专家的信息
|
753
|
203
|
$(".modifybox").css("display", "none");
|
754
|
204
|
$(".coninfocon").css("display", "block");
|
755
|
|
if($info.authType) {
|
756
|
|
$("#authSta").text("已认证");
|
757
|
|
} else {
|
758
|
|
$("#authSta").text("未认证");
|
759
|
|
}
|
760
|
|
nameD = $info.name;
|
761
|
|
authSD = $info.authStatus;
|
762
|
|
orgD = $info.orgName;
|
763
|
|
$("#nameS").text("");
|
|
205
|
|
764
|
206
|
$("#office").text("");
|
765
|
207
|
$("#titleS").text("");
|
766
|
208
|
$("#industryS").text("");
|
|
@ -812,7 +254,6 @@ $(function() {
|
812
|
254
|
$("#orgName").val($info.orgName);
|
813
|
255
|
$("#department").val($info.department);
|
814
|
256
|
$("#officeRevise").val($info.office);
|
815
|
|
//$("#addressRevise").val($info.address);
|
816
|
257
|
//省
|
817
|
258
|
//console.log($info.province);
|
818
|
259
|
$("#Province .mr_show").text("");
|
|
@ -832,7 +273,7 @@ $(function() {
|
832
|
273
|
location.href = "information.html?id=" + rdata.data;
|
833
|
274
|
}
|
834
|
275
|
} else {
|
835
|
|
alert(rdata.msg);
|
|
276
|
$.MsgBox.Alert("提示", rdata.msg);
|
836
|
277
|
}
|
837
|
278
|
},
|
838
|
279
|
"data": userid ? JSON.stringify($data) : $data,
|
|
@ -840,30 +281,10 @@ $(function() {
|
840
|
281
|
dataType: "json"
|
841
|
282
|
});
|
842
|
283
|
}
|
843
|
|
//上传图像的hover
|
844
|
|
$(".head-left").hover(function() {
|
845
|
|
$(".replace-photo").animate({
|
846
|
|
"bottom": "0px"
|
847
|
|
});
|
848
|
|
}, function() {
|
849
|
|
$(".replace-photo").animate({
|
850
|
|
"bottom": "-50px"
|
851
|
|
});
|
852
|
|
})
|
853
|
|
|
|
284
|
//////////////////基本信息增删改查相关结束//////////////
|
854
|
285
|
|
855
|
|
//获取点击那个编辑,及
|
856
|
|
$("#container .edit").click(function() {
|
857
|
|
var edit = $(".edit").index(this);
|
858
|
|
$(".right-title span").eq(edit - 1).css("color", "#3e3e3e");
|
859
|
|
$(".coninfocon").eq(edit).hide();
|
860
|
|
$(".modifybox").eq(edit).show();
|
861
|
|
//点击取消的操作
|
862
|
|
$(".btnCancel").click(function() {
|
863
|
|
$(".modifybox").eq(edit).hide();
|
864
|
|
$(".coninfocon").eq(edit).show();
|
865
|
|
});
|
866
|
|
}); //个人简介保存
|
|
286
|
//////////////////个人简介增删改查相关开始//////////////
|
|
287
|
//个人简介保存
|
867
|
288
|
$("#saveDescp").on("click", function() {
|
868
|
289
|
$.ajax({
|
869
|
290
|
"url": "../ajax/professor/descp",
|
|
@ -876,91 +297,139 @@ $(function() {
|
876
|
297
|
"success": function($data) {
|
877
|
298
|
//debugger;;
|
878
|
299
|
if($data.success) {
|
879
|
|
$(".coninfocon").css("display", "block");
|
880
|
|
$(".indu").css("display", "none");
|
881
|
|
$("#descpS").text($("#descp").val());
|
|
300
|
if($("#descp").val().length>500){
|
|
301
|
$.MsgBox.Alert("提示", "个人简介不得超过500个字");
|
|
302
|
return;
|
|
303
|
}else{
|
|
304
|
$(".coninfocon").css("display", "block");
|
|
305
|
$(".modifybox").css("display", "none");
|
|
306
|
$("#descpS").text($("#descp").val());
|
|
307
|
}
|
882
|
308
|
} else {
|
883
|
|
$.MsgBox.Alert("message", $data.msg);
|
|
309
|
$.MsgBox.Alert("提示", $data.msg);
|
884
|
310
|
}
|
885
|
311
|
}
|
886
|
312
|
})
|
887
|
313
|
})
|
888
|
|
//学术领域添加
|
|
314
|
//////////////////个人简介增删改查相关结束//////////////
|
|
315
|
|
|
316
|
//////////////////学术领域增删改查相关开始//////////////
|
|
317
|
//填充学术领域
|
|
318
|
var subjectShow = function(data) {
|
|
319
|
if(data != undefined && data.length != 0) {
|
|
320
|
var subs = new Array();
|
|
321
|
if(data.indexOf(',')) {
|
|
322
|
subs = data.split(',');
|
|
323
|
} else {
|
|
324
|
subs[0] = data;
|
|
325
|
}
|
|
326
|
if(subs.length > 0) {
|
|
327
|
for(var i = 0; i < subs.length; i++) {
|
|
328
|
$("#subjectList").append('<li>'+ subs[i] + '<div class="closeThis"></div></li>');
|
|
329
|
$("#subjectShow").append('<li>'+ subs[i] + '</li>');
|
|
330
|
};
|
|
331
|
}
|
|
332
|
}
|
|
333
|
}
|
|
334
|
//学术领域添加
|
889
|
335
|
$("#subjectAdd").click(function() {
|
890
|
|
var val = $("#subject").val();
|
891
|
|
if(!val) {
|
892
|
|
$.MsgBox.Alert("消息提醒", "内容不能为空");
|
|
336
|
var val = $("#subject").val();
|
|
337
|
if(!val) {
|
|
338
|
$.MsgBox.Alert("提示", "内容不能为空");
|
|
339
|
return;
|
|
340
|
}
|
|
341
|
if(val.length>10){$.MsgBox.Alert("提示", "学术领域不得超过10个字");return;}
|
|
342
|
var inV = $("#subjectList .wmlist");
|
|
343
|
for(var i = 0; i < inV.length; i++) {
|
|
344
|
if(inV[i].innerText == val) {
|
|
345
|
$.MsgBox.Alert("提示", "不能添加重复内容");
|
893
|
346
|
return;
|
894
|
347
|
}
|
895
|
|
var inV = $("#subjectList .wmlist");
|
896
|
|
for(var i = 0; i < inV.length; i++) {
|
897
|
|
if(inV[i].innerText == val) {
|
898
|
|
$.MsgBox.Alert("消息提醒", "不能添加重复内容");
|
899
|
|
return;
|
900
|
|
}
|
901
|
|
}
|
902
|
|
$("#subjectList").append('<li>'+ val + '<div class="closeThis"></div></li>')
|
903
|
|
$("#subject").val("")
|
904
|
|
})
|
905
|
|
//学术领域删除
|
|
348
|
}
|
|
349
|
$("#subjectList").append('<li>'+ val + '<div class="closeThis"></div></li>')
|
|
350
|
$("#subject").val("")
|
|
351
|
})
|
|
352
|
//学术领域删除
|
906
|
353
|
$("#subjectList").on("click", ".closeThis", function() {
|
907
|
|
$(this).parent().remove();
|
908
|
|
})
|
909
|
|
//学术领域保存
|
|
354
|
$(this).parent().remove();
|
|
355
|
})
|
|
356
|
//学术领域保存
|
910
|
357
|
$("#subjectSave").on("click", function() {
|
911
|
|
$(this).parents(".modifybox").hide();
|
912
|
|
var subjects = $("#subjectList li");
|
913
|
|
var subjectAll = "";
|
914
|
|
if(subjects.size() > 0) {
|
915
|
|
for(var i = 0; i < subjects.size(); i++) {
|
916
|
|
subjectAll += subjects[i].innerText;
|
917
|
|
subjectAll += ',';
|
|
358
|
$(this).parents(".modifybox").hide();
|
|
359
|
var subjects = $("#subjectList li");
|
|
360
|
var subjectAll = "";
|
|
361
|
if(subjects.size() > 0) {
|
|
362
|
for(var i = 0; i < subjects.size(); i++) {
|
|
363
|
subjectAll += subjects[i].innerText;
|
|
364
|
subjectAll += ',';
|
|
365
|
};
|
|
366
|
subjectAll = subjectAll.substring(0, subjectAll.length - 1);
|
|
367
|
}
|
|
368
|
$.ajax({
|
|
369
|
"url": "/ajax/professor/subject",
|
|
370
|
"type": "POST",
|
|
371
|
"data": {
|
|
372
|
"id": userid,
|
|
373
|
"subject": subjectAll
|
|
374
|
},
|
|
375
|
"contentType": "application/x-www-form-urlencoded",
|
|
376
|
"success": function($data) {
|
|
377
|
if($data.success) {
|
|
378
|
$("#subject").val("");
|
|
379
|
$("#subjectShow").empty();
|
|
380
|
$("#subjectList").empty();
|
|
381
|
$(".coninfocon").css("display", "block");
|
|
382
|
subjectShow(subjectAll);
|
|
383
|
} else {
|
|
384
|
$.MsgBox.Alert("message", $data.msg);
|
|
385
|
}
|
|
386
|
}
|
|
387
|
});
|
|
388
|
})
|
|
389
|
//////////////////学术领域增删改查相关结束//////////////
|
|
390
|
|
|
391
|
//////////////////应用行业增删改查相关开始//////////////
|
|
392
|
//填充应用行业
|
|
393
|
var industryShow = function(data) {
|
|
394
|
if(data != undefined && data.length != 0) {
|
|
395
|
var subs = new Array();
|
|
396
|
if(data.indexOf(',')) {
|
|
397
|
subs = data.split(',');
|
|
398
|
} else {
|
|
399
|
subs[0] = data;
|
|
400
|
}
|
|
401
|
if(subs.length > 0) {
|
|
402
|
for(var i = 0; i < subs.length; i++) {
|
|
403
|
$("#industryList").append('<li>' + subs[i] + '<div class="closeThis"></div></li>');
|
|
404
|
$("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
|
|
405
|
|
918
|
406
|
};
|
919
|
|
subjectAll = subjectAll.substring(0, subjectAll.length - 1);
|
920
|
407
|
}
|
921
|
|
$.ajax({
|
922
|
|
"url": "/ajax/professor/subject",
|
923
|
|
"type": "POST",
|
924
|
|
"data": {
|
925
|
|
"id": userid,
|
926
|
|
"subject": subjectAll
|
927
|
|
},
|
928
|
|
"contentType": "application/x-www-form-urlencoded",
|
929
|
|
"success": function($data) {
|
930
|
|
if($data.success) {
|
931
|
|
$("#subject").val("");
|
932
|
|
$("#subjectShow").empty();
|
933
|
|
$("#subjectList").empty();
|
934
|
|
$(".coninfocon").css("display", "block");
|
935
|
|
subjectShow(subjectAll);
|
936
|
|
} else {
|
937
|
|
$.MsgBox.Alert("message", $data.msg);
|
938
|
|
}
|
939
|
|
}
|
940
|
|
});
|
941
|
|
})
|
942
|
|
//应用行业添加
|
|
408
|
}
|
|
409
|
}
|
|
410
|
//应用行业添加
|
943
|
411
|
$("#industryAdd").click(function() {
|
944
|
|
var val = $("#industry").val();
|
945
|
|
if(!val) {
|
946
|
|
$.MsgBox.Alert("消息提醒", "内容不能为空");
|
|
412
|
var val = $("#industry").val();
|
|
413
|
if(!val) {
|
|
414
|
$.MsgBox.Alert("提示", "内容不能为空");
|
|
415
|
return;
|
|
416
|
}
|
|
417
|
if(val.length>10){$.MsgBox.Alert("提示", "行业领域不得超过10个字");return;}
|
|
418
|
var inV = $("#industryList li");
|
|
419
|
for(var i = 0; i < inV.length; i++) {
|
|
420
|
if(inV[i].innerText == val) {
|
|
421
|
$.MsgBox.Alert("提示", "不能添加重复内容");
|
947
|
422
|
return;
|
948
|
423
|
}
|
949
|
|
var inV = $("#industryList li");
|
950
|
|
for(var i = 0; i < inV.length; i++) {
|
951
|
|
if(inV[i].innerText == val) {
|
952
|
|
$.MsgBox.Alert("消息提醒", "不能添加重复内容");
|
953
|
|
return;
|
954
|
|
}
|
955
|
|
}
|
956
|
|
$("#industryList").append("<li>" + val + "<span class='closeThis'></span></li>")
|
957
|
|
$("#industry").val("")
|
958
|
|
})
|
959
|
|
//应用行业删除
|
|
424
|
}
|
|
425
|
$("#industryList").append("<li>" + val + "<span class='closeThis'></span></li>")
|
|
426
|
$("#industry").val("")
|
|
427
|
})
|
|
428
|
//应用行业删除
|
960
|
429
|
$("#industryList").on("click", ".closeThis", function() {
|
961
|
|
$(this).parent().remove();
|
962
|
|
})
|
963
|
|
//应用行业保存
|
|
430
|
$(this).parent().remove();
|
|
431
|
})
|
|
432
|
//应用行业保存
|
964
|
433
|
$("#industrySave").on("click", function() {
|
965
|
434
|
var industrys = $("#industryList li");
|
966
|
435
|
var industryAll = "";
|
|
@ -993,206 +462,257 @@ $(function() {
|
993
|
462
|
}
|
994
|
463
|
});
|
995
|
464
|
})
|
996
|
|
//研究方向添加
|
|
465
|
//////////////////应用行业增删改查相关结束//////////////
|
|
466
|
|
|
467
|
//////////////////研究方向增删改查相关开始//////////////
|
|
468
|
//填充研究方向
|
|
469
|
var researchAreaShow = function($datas, $datarecords) {
|
|
470
|
if($datas != undefined && $datas.length != 0) {
|
|
471
|
$("#researchAreaList").empty();
|
|
472
|
for(var i = 0; i < $datas.length; ++i) {
|
|
473
|
var $data = $datas[i];
|
|
474
|
var $photos = [];
|
|
475
|
//获取头像
|
|
476
|
if($datarecords.length > 0) {
|
|
477
|
$photos = getRecords($datarecords, $data.caption);
|
|
478
|
}
|
|
479
|
var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><div class="favorCount" caption="'+ $data.caption +'">';
|
|
480
|
if($photos.length < 6) {
|
|
481
|
for(var j = 0; j < $photos.length; ++j) {
|
|
482
|
if($photos[j].img) {
|
|
483
|
showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
|
|
484
|
} else {
|
|
485
|
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
|
|
486
|
}
|
|
487
|
}
|
|
488
|
} else {
|
|
489
|
for(var j = $photos.length - 5; j < $photos.length; ++j) {
|
|
490
|
if($photos[j].img) {
|
|
491
|
showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
|
|
492
|
} else {
|
|
493
|
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
|
|
494
|
}
|
|
495
|
}
|
|
496
|
showDiv += '<span class="like-people like-more"></span>';
|
|
497
|
}
|
|
498
|
showDiv += "</div></li>";
|
|
499
|
|
|
500
|
$("#researchAreaShow").append(showDiv);
|
|
501
|
$("#researchAreaList").append("<li class='yjlist'><span class='like'>" + $data.count + "</span><span class='ra'>" + $data.caption + "</span><span class='closeThis'></span></li>");
|
|
502
|
|
|
503
|
}
|
|
504
|
}
|
|
505
|
}
|
|
506
|
//判断点赞的用户是否有头像
|
|
507
|
var getRecords = function($researchAreaLogs, caption) {
|
|
508
|
var ret = [];
|
|
509
|
var t = 0;
|
|
510
|
for(var i = 0; i < $researchAreaLogs.length; i++) {
|
|
511
|
if(caption == $researchAreaLogs[i].caption) {
|
|
512
|
ret[t] = {
|
|
513
|
id: $researchAreaLogs[i].opreteProfessorId,
|
|
514
|
img: $researchAreaLogs[i].hasHeadImage
|
|
515
|
}
|
|
516
|
t++;
|
|
517
|
}
|
|
518
|
}
|
|
519
|
return ret;
|
|
520
|
}
|
|
521
|
//研究方向添加
|
997
|
522
|
$("#researchAreaAdd").click(function() {
|
998
|
523
|
var researchArea = $("#researchArea").val();
|
999
|
524
|
if(!researchArea) {
|
1000
|
|
$.MsgBox.Alert("消息提醒", "内容不能为空");
|
|
525
|
$.MsgBox.Alert("提示", "内容不能为空");
|
1001
|
526
|
return;
|
1002
|
527
|
}
|
|
528
|
if(researchArea.length>20){$.MsgBox.Alert("提示", "研究方向不得超过20个字");return;}
|
1003
|
529
|
var inV = $("#researchAreaList .ra");
|
1004
|
530
|
for(var i = 0; i < inV.length; i++) {
|
1005
|
531
|
if(inV[i].innerText == researchArea) {
|
1006
|
|
$.MsgBox.Alert("消息提醒", "不能添加重复内容");
|
|
532
|
$.MsgBox.Alert("提示", "不能添加重复内容");
|
1007
|
533
|
return;
|
1008
|
534
|
}
|
1009
|
535
|
}
|
1010
|
536
|
$("#researchAreaList").append("<li class='yjlist'><span class='like'>0</span><span class='ra'>" + researchArea + "</span><span class='closeThis'></span></li>")
|
1011
|
537
|
$("#researchArea").val("");
|
1012
|
538
|
});
|
1013
|
|
|
1014
|
539
|
//研究方向删除
|
1015
|
540
|
$("#researchAreaList").on("click", ".closeThis", function() {
|
1016
|
|
$(this).parent().remove();
|
1017
|
|
})
|
1018
|
|
//研究方向保存
|
|
541
|
$(this).parent().remove();
|
|
542
|
})
|
|
543
|
//研究方向保存
|
1019
|
544
|
$("#researchAreaSave").on("click", function() {
|
1020
|
|
//debugger;
|
1021
|
|
var $data = [];
|
1022
|
|
var researchAreas = $("#researchAreaList .list .ra");
|
1023
|
|
if(researchAreas.length > 0) {
|
1024
|
|
for(var i = 0; i < researchAreas.length; i++) {
|
1025
|
|
var $rd = {};
|
1026
|
|
$rd.professorId = userid;
|
1027
|
|
$rd.caption = researchAreas[i].innerText;
|
1028
|
|
$data[i] = $rd;
|
1029
|
|
}
|
|
545
|
var $data = [];
|
|
546
|
var researchAreas = $("#researchAreaList .yjlist .ra");
|
|
547
|
if(researchAreas.length > 0) {
|
|
548
|
for(var i = 0; i < researchAreas.length; i++) {
|
|
549
|
var $rd = {};
|
|
550
|
$rd.professorId = userid;
|
|
551
|
$rd.caption = researchAreas[i].innerText;
|
|
552
|
$data[i] = $rd;
|
1030
|
553
|
}
|
1031
|
|
var $has = $data.length > 0;
|
1032
|
|
$.ajax({
|
1033
|
|
"url": $has ? "../ajax/researchArea" : "../ajax/researchArea/" + userid,
|
1034
|
|
"type": $has ? "PUT" : "DELETE",
|
1035
|
|
"data": $has ? JSON.stringify($data) : null,
|
1036
|
|
"contentType": $has ? "application/json" : "application/x-www-form-urlencoded",
|
1037
|
|
"success": function($data) {
|
1038
|
|
if($data.success) {
|
1039
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1040
|
|
if($data.success) {
|
1041
|
|
$("#researchAreaShow").empty("");
|
1042
|
|
$("#researchAreaShow").show();
|
1043
|
|
$("#researchAreaShow").parents(".modifybox").hide();
|
1044
|
|
researchAreaShow($data.data.researchAreas, $data.data.editResearchAreaLogs);
|
1045
|
|
}
|
1046
|
|
});
|
|
554
|
}
|
|
555
|
var $has = $data.length > 0;
|
|
556
|
$.ajax({
|
|
557
|
"url": $has ? "../ajax/researchArea" : "../ajax/researchArea/" + userid,
|
|
558
|
"type": $has ? "PUT" : "DELETE",
|
|
559
|
"data": $has ? JSON.stringify($data) : null,
|
|
560
|
"contentType": $has ? "application/json" : "application/x-www-form-urlencoded",
|
|
561
|
"success": function($data) {
|
|
562
|
if($data.success) {
|
|
563
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
|
564
|
if($data.success) {
|
|
565
|
$("#researchAreaShow").empty("");
|
|
566
|
$("#researchAreaShow").parents(".coninfocon").show();
|
|
567
|
$("#researchAreaList").parents(".modifybox").hide();
|
|
568
|
researchAreaShow($data.data.researchAreas, $data.data.editResearchAreaLogs);
|
|
569
|
}
|
|
570
|
});
|
1047
|
571
|
|
1048
|
|
} else {
|
1049
|
|
$.MsgBox.Alert("message", $data.msg);
|
1050
|
|
}
|
|
572
|
} else {
|
|
573
|
$.MsgBox.Alert("message", $data.msg);
|
1051
|
574
|
}
|
1052
|
|
});
|
1053
|
|
})
|
1054
|
|
/*Ӧ����ҵ�������*/
|
1055
|
|
$("#other").click(function() {
|
1056
|
|
$(".addbox").toggle();
|
1057
|
|
});
|
1058
|
|
//教育背景最下面的例子
|
1059
|
|
$("#eduBgList").on("mouseover mouseout", ".eg", function(even) {
|
1060
|
|
if(event.type == "mouseover") {
|
1061
|
|
$(this).find("span").show();
|
1062
|
|
} else if(event.type == "mouseout") {
|
1063
|
|
$(this).find("span").hide();
|
1064
|
|
}
|
|
575
|
}
|
|
576
|
});
|
1065
|
577
|
})
|
1066
|
|
|
1067
|
|
function trim(str) { //删除左右两端的空格
|
1068
|
|
return str.replace(/(^\s*)|(\s*$)/g, "");
|
1069
|
|
}
|
1070
|
|
$("#eduUl").on("blur", ".school", function() {
|
1071
|
|
var valueE = $(this).val();
|
1072
|
|
var length = trim(valueE);
|
1073
|
|
if(!length) {
|
1074
|
|
$.MsgBox.Alert("消息", "学校不能为空");
|
|
578
|
//////////////////研究方向增删改查相关结束//////////////
|
|
579
|
|
|
580
|
//////////////////教育背景增删改查相关开始//////////////
|
|
581
|
//填充教育背景
|
|
582
|
var eduBgShow = function(data) {
|
|
583
|
eduFil("#eduUl");
|
|
584
|
if(data.length > 0) {
|
|
585
|
for(var i = 0; i < data.length; i++) {
|
|
586
|
var college="",major="",degree=""
|
|
587
|
if(data[i].college){
|
|
588
|
college =' - ' + data[i].college
|
|
589
|
}else{
|
|
590
|
data[i].college="";
|
|
591
|
}
|
|
592
|
if(data[i].major){
|
|
593
|
major =' - ' + data[i].major
|
|
594
|
}else{
|
|
595
|
data[i].major="";
|
|
596
|
}
|
|
597
|
if(data[i].degree){
|
|
598
|
degree =' - ' + eduDegree[data[i].degree]
|
|
599
|
if(data[i].degree==0){
|
|
600
|
degree =""
|
|
601
|
}
|
|
602
|
}else{
|
|
603
|
data[i].degree="";
|
|
604
|
}
|
|
605
|
|
|
606
|
var string = '<li>'
|
|
607
|
string += '<div class="showBx"> <div class="h4Font h4tit">'
|
|
608
|
string += data[i].school + college + major + degree
|
|
609
|
string += '<small class="h6Font">' + data[i].year + '</small><em class="btnClick exitlist">编辑</em></div></div>'
|
|
610
|
string += '<div class="modifybox"><ul class="cmpFrmList">'
|
|
611
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>学校名称:</span><div class="col-w-10">'
|
|
612
|
string += '<input type="text" class="frmcontype school" placeholder="请填写就读的学校" value="' + data[i].school + '" /><input type="hidden" class="eduId" value="' + data[i].id + '"></div></li>'
|
|
613
|
string += '<li><span class="col-w-2 lableSpan">院系名称:</span><div class="col-w-10">'
|
|
614
|
string += '<input type="text" class="frmcontype college" placeholder="请填写就读的院系" value="' + data[i].college + '" /></div></li>'
|
|
615
|
string += '<li><span class="col-w-2 lableSpan">专业名称:</span><div class="col-w-10">'
|
|
616
|
string += '<input type="text" class="frmcontype major" placeholder="请填写就读的专业" value="' + data[i].major + '" /></div></li>'
|
|
617
|
string += '<li><span class="col-w-2 lableSpan">学位:</span><div class="col-w-5"><em class="mr_sj"></em>'
|
|
618
|
string += '<select class="frmcontype mr_btn">'
|
|
619
|
string +='<option value="0">请选择获得的学位</option>'
|
|
620
|
string +='<option value="1">博士</option>'
|
|
621
|
string +='<option value="2">硕士</option>'
|
|
622
|
string +='<option value="3">学士</option>'
|
|
623
|
string +='<option value="4">大专</option>'
|
|
624
|
string +='<option value="5">其他</option>'
|
|
625
|
string +='</select></div></li>'
|
|
626
|
string += '<li><span class="col-w-2 lableSpan">毕业时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
627
|
string +='<div class="col-w-5" style="position:relative"><em class="mr_sj"></em><input type="text" class="date-btn frmcontype year" flag="1" placeholder="请选择毕业时间" value="' + data[i].year + '" />'
|
|
628
|
string +='<div class="mr_calendar_ym clearfix"><ul class="full_year"></ul></div></div>'
|
|
629
|
string +='</form></div></li>'
|
|
630
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
631
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
632
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelList">取消</button>'
|
|
633
|
string +='<button type="button" class="frmcontype btnModel fontLink">删除本条</button></div></li>'
|
|
634
|
string +='</ul></div><li>';
|
|
635
|
var $string=$(string)
|
|
636
|
$("#eduUl").append($string);
|
|
637
|
$string.find(".mr_btn").val(data[i].degree);
|
1075
|
638
|
}
|
1076
|
|
})
|
1077
|
|
//教育背景填充函数
|
1078
|
|
var eduFil = function(select) {
|
1079
|
|
var string = '<li class="listnone1" style="display:none">'
|
1080
|
|
string += '<div class="modifybox" style="display:block">'
|
1081
|
|
string += '<form class="txtExpForm">'
|
1082
|
|
string += '<div class="infor edu">'
|
1083
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">学</em>校</div>'
|
1084
|
|
string += '<input type="hidden" class="eduId">'
|
1085
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt school"></div>'
|
1086
|
|
string += '</div>'
|
1087
|
|
string += '<div class="edu date-box clearfix">'
|
1088
|
|
string += '<div class="txtType floatL">毕业年份</div>'
|
1089
|
|
string += '<div class="txtExp floatL">'
|
1090
|
|
string += '<input type="text" class="date-btn input-txt edu-txt year" name="YYYY" flag="1" value="">'
|
1091
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
1092
|
|
string += '<ul class="full_year">'
|
1093
|
|
string += '</ul>'
|
1094
|
|
string += '</div>'
|
1095
|
|
string += '</div>'
|
1096
|
|
string += '</div>'
|
1097
|
|
string += '<div class="infor edu">'
|
1098
|
|
string += '<div class="txtType floatL"><em class="emspace">院</em>系</div>'
|
1099
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt floatL college"></div>'
|
1100
|
|
string += '</div>'
|
1101
|
|
string += '<div class="infor edu">'
|
1102
|
|
string += '<div class="txtType floatL"><em class="emspace">专</em>业</div>'
|
1103
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt major" ></div>'
|
1104
|
|
string += '</div>'
|
1105
|
|
string += '<div class="edu ulbox clearfix">'
|
1106
|
|
string += '<div class="txtType floatL">获得学位</div>'
|
1107
|
|
string += '<div class="mr_timed_div input-txt edu-txt floatL">'
|
1108
|
|
string += '<i class="mr_sj"></i>'
|
1109
|
|
string += '<input type="hidden" name="degree_text">'
|
1110
|
|
string += '<input type="button" class="mr_btn" name="degree_val" onclick="showmenu()" id="div_select2" value="本科">'
|
1111
|
|
string += '<div class="xl_list">'
|
1112
|
|
string += '<ul class="ul_edubg ulShow" style="display:none">'
|
1113
|
|
string += '<li>学士</li>'
|
1114
|
|
string += '<li>硕士</li>'
|
1115
|
|
string += '<li>博士</li>'
|
1116
|
|
string += '<li>其他</li>'
|
1117
|
|
string += '</ul>'
|
1118
|
|
string += '</div>'
|
1119
|
|
string += '</div>'
|
1120
|
|
string += '</div>'
|
1121
|
|
string += '<div class="btnbox btnboxO">'
|
1122
|
|
string += '<input type="button" value="添加" class="btnModel saveEduBg">'
|
1123
|
|
string += '<input type="button" value="取消" class="btnModel btnCancel">'
|
1124
|
|
string += '</div>'
|
1125
|
|
string += '</form>'
|
1126
|
|
string += '</div>'
|
1127
|
|
string += '</li>'
|
1128
|
|
$("" + select + "").prepend(string);
|
|
639
|
|
1129
|
640
|
}
|
1130
|
|
//教育背景添加
|
1131
|
|
$("#addEdu").on("click", function() {
|
1132
|
|
$("#eduUl").find(".listnone1").toggle(100);
|
1133
|
|
});
|
1134
|
|
$("#eduUl").on("click", ".close1", function() {
|
1135
|
|
$("#eduUl").find(".listnone1").toggle(100);
|
1136
|
|
});
|
1137
|
|
$("#eduUl").on("click", "em", function() {
|
1138
|
|
$(this).parent().hide();
|
1139
|
|
$(this).parent().siblings().show();
|
1140
|
|
//$(this).parent().parent().children(".")
|
1141
|
|
});
|
1142
|
|
$("#eduUl").on("click", ".mr_btn", function() {
|
1143
|
|
$(this).siblings(".xl_list").children("ul").show();
|
1144
|
|
});
|
1145
|
|
$("#eduUl").on("click", ".ul_edubg li", function() {
|
1146
|
|
$(this).parents(".xl_list").siblings(".mr_btn").val($(this).text());
|
1147
|
|
$(this).parent().hide();
|
1148
|
|
});
|
1149
|
|
$("#eduUl").on("click", ".btnCancel", function() {
|
1150
|
|
$(this).parents(".modifybox").hide();
|
1151
|
|
$(this).parents(".modifybox").siblings().show();
|
1152
|
|
|
1153
|
|
});
|
1154
|
|
|
1155
|
|
$("#eduUl").on("click", ".fontLink", function() {
|
1156
|
|
var deuId = $(this).parents(".txtExpForm").find(".eduId").val();
|
1157
|
|
delEdu(deuId);
|
|
641
|
}
|
|
642
|
//教育背景填充函数
|
|
643
|
var eduFil = function(select) {
|
|
644
|
var string ='<li class="listnone1" style="display:none;"><div class="modifybox" style="display:block;"><ul class="cmpFrmList">'
|
|
645
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>学校名称:</span><div class="col-w-10">'
|
|
646
|
string += '<input type="text" class="frmcontype school" placeholder="请填写就读的学校" /><input type="hidden" class="eduId"></div></li>'
|
|
647
|
string += '<li><span class="col-w-2 lableSpan">院系名称:</span><div class="col-w-10">'
|
|
648
|
string += '<input type="text" class="frmcontype college" placeholder="请填写就读的院系" /></div></li>'
|
|
649
|
string += '<li><span class="col-w-2 lableSpan">专业名称:</span><div class="col-w-10">'
|
|
650
|
string += '<input type="text" class="frmcontype major" placeholder="请填写就读的专业" /></div></li>'
|
|
651
|
string += '<li><span class="col-w-2 lableSpan">学位:</span><div class="col-w-5"><em class="mr_sj"></em>'
|
|
652
|
string += '<select class="frmcontype mr_btn">'
|
|
653
|
string +='<option value="0">请选择获得的学位</option>'
|
|
654
|
string +='<option value="1">博士</option>'
|
|
655
|
string +='<option value="2">硕士</option>'
|
|
656
|
string +='<option value="3">学士</option>'
|
|
657
|
string +='<option value="4">大专</option>'
|
|
658
|
string +='<option value="5">其他</option>'
|
|
659
|
string +='</select></div></li>'
|
|
660
|
string += '<li><span class="col-w-2 lableSpan">毕业时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
661
|
string +='<div class="col-w-5" style="position:relative"><em class="mr_sj"></em><input type="text" class="date-btn frmcontype year" flag="1" placeholder="请选择毕业时间" />'
|
|
662
|
string +='<div class="mr_calendar_ym clearfix"><ul class="full_year"></ul></div></div>'
|
|
663
|
string +='</form></div></li>'
|
|
664
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
665
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
666
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelO">取消</button></div></li>'
|
|
667
|
string +='</ul></div><li>';
|
|
668
|
$("" + select + "").prepend(string);
|
|
669
|
}
|
|
670
|
var eduThis=""
|
|
671
|
$("#eduUl").on("click", ".fontLink", function() {//编辑各个列表中的删除
|
|
672
|
eduThis = $(this).parents(".modifybox").find(".eduId").val();
|
|
673
|
$.MsgBox.Confirm("提示", "确认删除该教育背景?",delEdu);
|
1158
|
674
|
});
|
1159
|
675
|
//教育背景,对已经添加的背景删除
|
1160
|
|
var delEdu = function(data) {
|
1161
|
|
$.ajax({
|
1162
|
|
"url": "/ajax/edu/" + data,
|
1163
|
|
"type": "DELETE",
|
1164
|
|
"success": function($data) {
|
1165
|
|
if($data.success) {
|
1166
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1167
|
|
if($data.success) {
|
1168
|
|
$("#eduUl").empty("");
|
1169
|
|
eduBgShow($data.data.edus);
|
1170
|
|
}
|
1171
|
|
});
|
1172
|
|
} else {
|
1173
|
|
alert($data.msg);
|
1174
|
|
}
|
|
676
|
var delEdu = function() {
|
|
677
|
$.ajax({
|
|
678
|
"url": "/ajax/edu/" + eduThis,
|
|
679
|
"type": "DELETE",
|
|
680
|
"success": function($data) {
|
|
681
|
if($data.success) {
|
|
682
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
|
683
|
if($data.success) {
|
|
684
|
$("#eduUl").empty("");
|
|
685
|
eduBgShow($data.data.edus);
|
|
686
|
}
|
|
687
|
});
|
|
688
|
} else {
|
|
689
|
$.MsgBox.Alert("提示",$data.msg);
|
1175
|
690
|
}
|
1176
|
|
});
|
1177
|
|
}
|
1178
|
|
//教育背景保存
|
1179
|
|
$("#eduUl").on("click", ".saveEduBg", function() {
|
1180
|
|
var length = trim($(this).parents(".txtExpForm").find(".school").val());
|
1181
|
|
if(!length) {
|
1182
|
|
$.MsgBox.Alert("消息", "学校不能为空");
|
1183
|
|
return;
|
1184
|
691
|
}
|
|
692
|
});
|
|
693
|
}
|
|
694
|
//教育背景保存
|
|
695
|
$("#eduUl").on("click", ".saveGo", function() {
|
|
696
|
var length = trim($(this).parents(".modifybox").find(".school").val());
|
|
697
|
var length2 = trim($(this).parents(".modifybox").find(".college").val());
|
|
698
|
var length3 = trim($(this).parents(".modifybox").find(".major").val());
|
|
699
|
|
|
700
|
if(!length){ $.MsgBox.Alert("提示", "请填写学校名称");return;}
|
|
701
|
if(length.length>50){ $.MsgBox.Alert("提示", "学校名称不得超过50个字");return;}
|
|
702
|
if(length2.length>20){ $.MsgBox.Alert("提示", "院系名称不得超过20个字");return;}
|
|
703
|
if(length3.length>20){ $.MsgBox.Alert("提示", "专业名称不得超过20个字");return;}
|
|
704
|
|
1185
|
705
|
var $data = {};
|
1186
|
|
var $id = $(this).parents(".txtExpForm").find(".eduId").val();
|
|
706
|
var $id = $(this).parents(".modifybox").find(".eduId").val();
|
1187
|
707
|
if($id) {
|
1188
|
708
|
$data.id = $id;
|
1189
|
709
|
}
|
1190
|
710
|
$data.professorId = userid;
|
1191
|
|
$data.year = $(this).parents(".txtExpForm").find(".year").val();
|
1192
|
|
$data.school = $(this).parents(".txtExpForm").find(".school").val();
|
1193
|
|
$data.college = $(this).parents(".txtExpForm").find(".college").val();
|
1194
|
|
$data.major = $(this).parents(".txtExpForm").find(".major").val();
|
1195
|
|
$data.degree = $(this).parents(".txtExpForm").find(".mr_btn").val();
|
|
711
|
$data.year = $(this).parents(".modifybox").find(".year").val();
|
|
712
|
$data.school = $(this).parents(".modifybox").find(".school").val();
|
|
713
|
$data.college = $(this).parents(".modifybox").find(".college").val();
|
|
714
|
$data.major = $(this).parents(".modifybox").find(".major").val();
|
|
715
|
$data.degree = $(this).parents(".modifybox").find(".mr_btn").val();
|
1196
|
716
|
$.ajax({
|
1197
|
717
|
"url": "/ajax/edu",
|
1198
|
718
|
"type": $id ? "PUT" : "POST",
|
|
@ -1205,8 +725,6 @@ $(function() {
|
1205
|
725
|
$("#eduUl").empty("");
|
1206
|
726
|
eduBgShow($data.data.edus);
|
1207
|
727
|
yearAdd();
|
1208
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1209
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1210
|
728
|
}
|
1211
|
729
|
});
|
1212
|
730
|
} else {
|
|
@ -1215,648 +733,379 @@ $(function() {
|
1215
|
733
|
}
|
1216
|
734
|
});
|
1217
|
735
|
})
|
1218
|
|
//社会兼职
|
1219
|
|
$("#timeJobShow").on("blur", ".jobCompany", function() {
|
1220
|
|
var valueE = $(this).val();
|
1221
|
|
var length = trim(valueE);
|
1222
|
|
if(!length) {
|
1223
|
|
$.MsgBox.Alert("消息", "机构名称不能为空");
|
1224
|
|
}
|
1225
|
|
})
|
1226
|
|
$("#timeJobShow").on("blur", ".jobTitle", function() {
|
1227
|
|
var valueE = $(this).val();
|
1228
|
|
var length = trim(valueE);
|
1229
|
|
if(!length) {
|
1230
|
|
$.MsgBox.Alert("消息", "职位不能为空");
|
1231
|
|
}
|
1232
|
|
})
|
1233
|
|
var jobFil = function(select) {
|
1234
|
|
var string = '<li class="listnone1" style="display:none">'
|
1235
|
|
string += '<div class="modifybox" style="display:block;">'
|
1236
|
|
string += '<form class="txtExpForm">'
|
1237
|
|
string += '<div class="infor edu">'
|
1238
|
|
string += '<div class="txtType floatL"><b class="required_star"></b>机构名称</div>'
|
1239
|
|
string += '<input type="hidden" class="jobId">'
|
1240
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobCompany" /></div>'
|
1241
|
|
string += '</div>'
|
1242
|
|
string += '<div class="edu date-box clearfix">'
|
1243
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
1244
|
|
string += '<div class="txtExp floatL">'
|
1245
|
|
string += '<div class="dateExp floatL">'
|
1246
|
|
string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt startMonth" flag="2" difference="1" value="">'
|
1247
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
1248
|
|
string += '<ul class="mr_year">'
|
1249
|
|
string += '</ul>'
|
1250
|
|
string += '<ul class="mr_month">'
|
1251
|
|
string += '</ul>'
|
1252
|
|
string += '</div>'
|
1253
|
|
string += '</div>'
|
1254
|
|
string += '<div class="lineTo floatL"></div>'
|
1255
|
|
string += '<div class="dateExp floatL">'
|
1256
|
|
string += '<input type="text" maxLength="6" class="date-btn input-txt edu-txt stopMonth" flag="2" difference="2" value="">'
|
1257
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
1258
|
|
string += '<ul class="mr_year">'
|
1259
|
|
string += '<li class="ymli">至今</li>'
|
1260
|
|
string += '</ul>'
|
1261
|
|
string += '<ul class="mr_month">'
|
1262
|
|
string += '</ul>'
|
1263
|
|
string += '</div>'
|
1264
|
|
string += '</div>'
|
1265
|
|
string += '</div>'
|
1266
|
|
string += '</div>'
|
1267
|
|
string += '<div class="infor edu btn-marL">'
|
1268
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">职</em>位</div>'
|
1269
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobTitle" /></div>'
|
1270
|
|
string += '</div>'
|
1271
|
|
string += '<div class="infor edu btn-marL">'
|
1272
|
|
string += '<div class="txtType floatL">所在部门</div>'
|
1273
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt jobdepartment" /></div>'
|
1274
|
|
string += '</div>'
|
1275
|
|
string += '<div class="btnbox">'
|
1276
|
|
string += '<input type="button" value="添加" class="infor-save btn btn-marL">'
|
1277
|
|
string += '<input type="button" value="取消" class="close1 close2 btn btn-marB">'
|
1278
|
|
string += '</div>'
|
1279
|
|
string += '</form>'
|
1280
|
|
string += '</div>'
|
1281
|
|
string += '</li>'
|
1282
|
|
$("" + select + "").prepend(string);
|
1283
|
|
}
|
1284
|
|
//专利添加
|
1285
|
|
$("#timeJobAdd").on("click", function() {
|
1286
|
|
$("#timeJobShow").find(".listnone1").toggle(100);
|
1287
|
|
});
|
1288
|
|
$("#timeJobShow").on("click", ".close1", function() {
|
1289
|
|
$("#timeJobShow").find(".listnone1").toggle(100);
|
1290
|
|
});
|
1291
|
|
$("#timeJobShow").on("click", "em", function() {
|
1292
|
|
$(this).parent().hide();
|
1293
|
|
$(this).parent().siblings().show();
|
1294
|
|
//$(this).parent().parent().children(".")
|
1295
|
|
});
|
1296
|
|
$("#timeJobShow").on("click", ".btnCancel", function() {
|
1297
|
|
$(this).parents(".modifybox").hide();
|
1298
|
|
$(this).parents(".modifybox").siblings().show();
|
1299
|
|
});
|
1300
|
|
$("#timeJobShow").on("click", ".fontLink", function() {
|
1301
|
|
var deuId = $(this).parents(".txtExpForm").find(".jobId").val();
|
1302
|
|
delTimeJob(deuId);
|
1303
|
|
});
|
1304
|
|
//社会兼职,对添加的兼职删除
|
1305
|
|
var delTimeJob = function(data) {
|
1306
|
|
$.ajax({
|
1307
|
|
"url": "/ajax/job/" + data,
|
1308
|
|
"type": "DELETE",
|
1309
|
|
"success": function($data) {
|
1310
|
|
if($data.success) {
|
1311
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1312
|
|
if($data.success) {
|
1313
|
|
$("#timeJobShow").empty("");
|
1314
|
|
timeJobShow($data.data.jobs);
|
1315
|
|
}
|
1316
|
|
});
|
1317
|
|
} else {
|
1318
|
|
alert($data.msg);
|
1319
|
|
}
|
1320
|
|
}
|
1321
|
|
});
|
1322
|
|
}
|
1323
|
|
//社会兼职保存
|
1324
|
|
$("#timeJobShow").on("click", ".infor-save", function() {
|
1325
|
|
var length1 = trim($(this).parents(".txtExpForm").find(".jobCompany").val());
|
1326
|
|
var length2 = trim($(this).parents(".txtExpForm").find(".jobTitle").val());
|
1327
|
|
var length3 = trim($(this).parents(".txtExpForm").find(".startMonth").val());
|
1328
|
|
var length4 = trim($(this).parents(".txtExpForm").find(".stopMonth").val());
|
1329
|
|
if(!length3 && length4) {
|
1330
|
|
$.MsgBox.Alert("消息", "没有选开始时间");
|
1331
|
|
return;
|
1332
|
|
} else if(length3 && !length4) {
|
1333
|
|
$.MsgBox.Alert("消息", "没有选结束时间");
|
1334
|
|
return;
|
1335
|
|
}
|
1336
|
|
if(!length1 && length2) {
|
1337
|
|
$.MsgBox.Alert("消息", "机构名称不能为空");
|
1338
|
|
return;
|
1339
|
|
} else if(length1 && !length2) {
|
1340
|
|
$.MsgBox.Alert("消息", "职位不能为空");
|
1341
|
|
return;
|
1342
|
|
} else if(!length1 && !length2) {
|
1343
|
|
$.MsgBox.Alert("消息", "职位&&机构名称不能为空");
|
1344
|
|
return;
|
1345
|
|
}
|
1346
|
|
var $data = {};
|
1347
|
|
var $id = $(this).parents(".txtExpForm").find(".jobId").val();
|
1348
|
|
if($id) {
|
1349
|
|
$data.id = $id;
|
1350
|
|
}
|
1351
|
|
$data.professorId = userid;
|
1352
|
|
$data.company = $(this).parents(".txtExpForm").find(".jobCompany").val();
|
1353
|
|
$data.department = $(this).parents(".txtExpForm").find(".jobdepartment").val();
|
1354
|
|
var s = $(this).parents(".txtExpForm").find(".startMonth").val();
|
1355
|
|
var st = $(this).parents(".txtExpForm").find(".stopMonth").val();
|
1356
|
|
if(s) {
|
1357
|
|
$data.startMonth = s.substr(0, 4) + s.substr(5, 6);
|
1358
|
|
}
|
1359
|
|
if(st) {
|
1360
|
|
if(st == "至今") {} else {
|
1361
|
|
$data.stopMonth = st.substr(0, 4) + st.substr(5, 6);
|
|
736
|
//////////////////教育背景增删改查相关结束///////////////
|
|
737
|
|
|
738
|
//////////////////工作经历增删改查相关开始///////////////
|
|
739
|
//填充工作经历
|
|
740
|
var timeJobShow = function(data) {
|
|
741
|
jobFil("#timeJobShow");
|
|
742
|
if(data.length > 0) {
|
|
743
|
for(var i = 0; i < data.length; i++) {
|
|
744
|
var sDate = "";
|
|
745
|
var eDate = "";
|
|
746
|
if(data[i].department) {
|
|
747
|
var dep = "-" + data[i].department;
|
|
748
|
var depart = data[i].department;
|
|
749
|
} else {
|
|
750
|
var dep = "";
|
|
751
|
var depart = ""
|
1362
|
752
|
}
|
1363
|
|
}
|
1364
|
|
$data.title = $(this).parents(".txtExpForm").find(".jobTitle").val();
|
1365
|
|
$.ajax({
|
1366
|
|
"url": "/ajax/job",
|
1367
|
|
"type": $id ? "PUT" : "POST",
|
1368
|
|
"data": $id ? JSON.stringify($data) : $data,
|
1369
|
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
1370
|
|
beforeSend: function() {
|
1371
|
|
//console.log(this.data)
|
1372
|
|
},
|
1373
|
|
"success": function($data) {
|
1374
|
|
if($data.success) {
|
|
753
|
if(data[i].startMonth) {
|
1375
|
754
|
|
1376
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1377
|
|
if($data.success) {
|
1378
|
|
$("#timeJobShow").empty("");
|
1379
|
|
timeJobShow($data.data.jobs);
|
1380
|
|
yearAdd();
|
1381
|
|
month();
|
1382
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1383
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1384
|
|
}
|
1385
|
|
});
|
|
755
|
sDate = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
|
|
756
|
if(data[i].stopMonth) {
|
|
757
|
eDate = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6);
|
1386
|
758
|
} else {
|
1387
|
|
$.MsgBox.Alert("message", $data.msg);
|
|
759
|
eDate = "至今"
|
1388
|
760
|
}
|
1389
|
761
|
}
|
1390
|
|
});
|
1391
|
|
})
|
1392
|
|
//项目经历
|
1393
|
|
$("#projectShow").on("blur", ".projectName", function() {
|
1394
|
|
var valueE = $(this).val();
|
1395
|
|
var length = trim(valueE);
|
1396
|
|
if(!length) {
|
1397
|
|
$.MsgBox.Alert("消息", "项目名称不能为空");
|
|
762
|
var string ='<li>'
|
|
763
|
string += ' <div class="showBx"><div class="h4Font h4tit">' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">';
|
|
764
|
string += sDate;
|
|
765
|
if(eDate) string += ("-" + eDate);
|
|
766
|
string += '</small><em class="btnClick exitlist">编辑</em></div></div>';
|
|
767
|
string += '<div class="modifybox"><ul class="cmpFrmList">'
|
|
768
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>机构名称:</span><div class="col-w-10">'
|
|
769
|
string += '<input type="text" class="frmcontype jobCompany" placeholder="请填写就职的机构" value="' + data[i].company + '" /><input type="hidden" class="jobId" value="' + data[i].id + '"></div></li>'
|
|
770
|
string += '<li><span class="col-w-2 lableSpan">所在部门:</span><div class="col-w-10">'
|
|
771
|
string += '<input type="text" class="frmcontype jobdepartment" placeholder="请填写就职的部门" value="' + depart + '" /></div></li>'
|
|
772
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>职位:</span><div class="col-w-10">'
|
|
773
|
string += '<input type="text" class="frmcontype jobTitle" placeholder="请填写担任的职位" value="' + data[i].title + '" /></div></li>'
|
|
774
|
string += '<li><span class="col-w-2 lableSpan">任职时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
775
|
string += '<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype startMonth" flag="2" difference="1" placeholder="请选择起始时间" value="' + sDate + '" />'
|
|
776
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"></ul><ul class="mr_month"></ul></div></div>'
|
|
777
|
string +='<div class="col-w-1 alignCenter">至</div>'
|
|
778
|
string +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype stopMonth" flag="2" difference="2" placeholder="请选择结束时间" value="' + eDate + '" />'
|
|
779
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"><li class="ymli">至今</li></ul><ul class="mr_month"></ul></div></div>'
|
|
780
|
string +='</form></div></li>'
|
|
781
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
782
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
783
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelList">取消</button>'
|
|
784
|
string +='<button type="button" class="frmcontype btnModel fontLink">删除本条</button></div></li>'
|
|
785
|
string +='</ul></div><li>';
|
|
786
|
$("#timeJobShow").append(string);
|
|
787
|
}
|
1398
|
788
|
}
|
1399
|
|
});
|
1400
|
|
|
1401
|
|
var projectFil = function(select) {
|
1402
|
|
var string = '<li class="listnone1" style="display:none;">'
|
1403
|
|
string += '<div class="modifybox" style="display:block;">'
|
1404
|
|
string += '<form class="txtExpForm">'
|
1405
|
|
string += '<div class="infor edu">'
|
1406
|
|
string += '<div class="txtType floatL"><b class="required_star"></b>项目名称</div>'
|
1407
|
|
string += '<input type="hidden" class="projectId" />'
|
1408
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt projectName"></div>'
|
1409
|
|
string += '</div>'
|
1410
|
|
string += '<div class="edu date-box clearfix">'
|
1411
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
1412
|
|
string += '<div class="txtExp floatL">'
|
1413
|
|
string += '<div class="dateExp floatL">'
|
1414
|
|
string += '<input type="text" class="date-btn input-txt edu-txt project StartMonth" flag="2" difference="1" value="">'
|
1415
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
1416
|
|
string += '<ul class="mr_year">'
|
1417
|
|
string += '</ul>'
|
1418
|
|
string += '<ul class="mr_month">'
|
1419
|
|
string += '</ul>'
|
1420
|
|
string += '</div>'
|
1421
|
|
string += '</div>'
|
1422
|
|
string += '<div class="lineTo floatL"></div>'
|
1423
|
|
string += '<div class="dateExp floatL">'
|
1424
|
|
string += '<input type="text" class="date-btn input-txt edu-txt project StopMonth" flag="2" difference="2" value="">'
|
1425
|
|
string += '<div class="mr_calendar_ym clearfix">'
|
1426
|
|
string += '<ul class="mr_year">'
|
1427
|
|
string += '<li class="ymli">至今</li>'
|
1428
|
|
string += '</ul>'
|
1429
|
|
string += '<ul class="mr_month">'
|
1430
|
|
string += '</ul>'
|
1431
|
|
string += '</div>'
|
1432
|
|
string += '</div>'
|
1433
|
|
string += '</div>'
|
1434
|
|
string += '</div>'
|
1435
|
|
string += '<div class="infor edu">'
|
1436
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
1437
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt projectDescp" ></div>'
|
1438
|
|
string += '</div>'
|
1439
|
|
string += '<div class="btnbox">'
|
1440
|
|
string += '<input type="button" value="添加" class="infor-save btn">'
|
1441
|
|
string += '<input type="button" value="取消" class="close1 close2 btn">'
|
1442
|
|
string += '</div>'
|
1443
|
|
string += '</form>'
|
1444
|
|
string += '</div>'
|
1445
|
|
string += '</li>'
|
|
789
|
}
|
|
790
|
var jobFil = function(select) {
|
|
791
|
var string ='<li class="listnone1" style="display:none;"><div class="modifybox" style="display:block;"><ul class="cmpFrmList">'
|
|
792
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>机构名称:</span><div class="col-w-10">'
|
|
793
|
string += '<input type="text" class="frmcontype jobCompany" placeholder="请填写就职的机构" /><input type="hidden" class="jobId"></div></li>'
|
|
794
|
string += '<li><span class="col-w-2 lableSpan">所在部门:</span><div class="col-w-10">'
|
|
795
|
string += '<input type="text" class="frmcontype jobdepartment" placeholder="请填写就职的部门" /></div></li>'
|
|
796
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>职位:</span><div class="col-w-10">'
|
|
797
|
string += '<input type="text" class="frmcontype jobTitle" placeholder="请填写担任的职位" /></div></li>'
|
|
798
|
string += '<li><span class="col-w-2 lableSpan">任职时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
799
|
string += '<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype startMonth" flag="2" difference="1" placeholder="请选择起始时间" />'
|
|
800
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"></ul><ul class="mr_month"></ul></div></div>'
|
|
801
|
string +='<div class="col-w-1 alignCenter">至</div>'
|
|
802
|
string +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype stopMonth" flag="2" difference="2" placeholder="请选择结束时间" />'
|
|
803
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"><li class="ymli">至今</li></ul><ul class="mr_month"></ul></div></div>'
|
|
804
|
string +='</form></div></li>'
|
|
805
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
806
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
807
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelO">取消</button></div></li>'
|
|
808
|
string +='</ul></div><li>';
|
1446
|
809
|
$("" + select + "").prepend(string);
|
1447
|
810
|
}
|
1448
|
|
$("#projectAdd").on("click", function() {
|
1449
|
|
$("#projectShow").find(".listnone1").toggle(100);
|
1450
|
|
});
|
1451
|
|
$("#projectShow").on("click", ".close1", function() {
|
1452
|
|
$("#projectShow").find(".listnone1").toggle(100);
|
|
811
|
var jobThis=""
|
|
812
|
$("#timeJobShow").on("click", ".fontLink", function() {//编辑各个列表中的删除
|
|
813
|
jobThis = $(this).parents(".modifybox").find(".jobId").val();
|
|
814
|
$.MsgBox.Confirm("提示", "确认删除该工作经历?",delTimeJob);
|
1453
|
815
|
});
|
1454
|
|
$("#projectShow").on("click", "em", function() {
|
1455
|
|
$(this).parent().parent().hide();
|
1456
|
|
$(this).parent().parent().siblings().show();
|
1457
|
|
//$(this).parent().parent().children(".")
|
1458
|
|
});
|
1459
|
|
$("#projectShow").on("click", ".btnCancel", function() {
|
1460
|
|
$(this).parents(".modifybox").hide();
|
1461
|
|
$(this).parents(".modifybox").siblings().show();
|
1462
|
|
});
|
1463
|
|
$("#projectShow").on("click", ".fontLink", function() {
|
1464
|
|
var deuId = $(this).parents(".txtExpForm").find(".projectId").val();
|
1465
|
|
delProject(deuId);
|
1466
|
|
});
|
1467
|
|
//项目经历,对添加的项目删除
|
1468
|
|
var delProject = function(data) {
|
|
816
|
//社会兼职,对添加的兼职删除
|
|
817
|
var delTimeJob = function() {
|
1469
|
818
|
$.ajax({
|
1470
|
|
"url": "/ajax/project/" + data,
|
|
819
|
"url": "/ajax/job/" + jobThis,
|
1471
|
820
|
"type": "DELETE",
|
1472
|
821
|
"success": function($data) {
|
1473
|
822
|
if($data.success) {
|
1474
|
823
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1475
|
824
|
if($data.success) {
|
1476
|
|
$("#projectShow").empty("");
|
1477
|
|
projectShow($data.data.projects);
|
|
825
|
$("#timeJobShow").empty("");
|
|
826
|
timeJobShow($data.data.jobs);
|
1478
|
827
|
}
|
1479
|
828
|
});
|
1480
|
829
|
} else {
|
1481
|
|
alert($data.msg);
|
|
830
|
$.MsgBox.Alert("提示",$data.msg);
|
1482
|
831
|
}
|
1483
|
832
|
}
|
1484
|
833
|
});
|
1485
|
834
|
}
|
1486
|
|
|
1487
|
|
//项目经历保存
|
1488
|
|
$("#projectShow").on("click", ".infor-save", function() {
|
1489
|
|
var length = trim($(this).parents(".txtExpForm").find(".projectName").val());
|
1490
|
|
var length1 = trim($(this).parents(".txtExpForm").find(".StartMonth").val());
|
1491
|
|
var length2 = trim($(this).parents(".txtExpForm").find(".StopMonth").val());
|
1492
|
|
if(!length) {
|
1493
|
|
$.MsgBox.Alert("消息", "项目名称不能为空");
|
1494
|
|
return;
|
1495
|
|
}
|
1496
|
|
if(length1 && !length2) {
|
1497
|
|
$.MsgBox.Alert("消息", "没有选结束时间");
|
1498
|
|
return;
|
1499
|
|
}
|
1500
|
|
if(!length1 && length2) {
|
1501
|
|
$.MsgBox.Alert("消息", "没有选开始时间");
|
1502
|
|
return;
|
1503
|
|
}
|
1504
|
|
var $data = {};
|
1505
|
|
var $id = $(this).parents(".txtExpForm").find(".projectId").val();
|
1506
|
|
//console.log($id);
|
1507
|
|
if($id) {
|
1508
|
|
$data.id = $id;
|
1509
|
|
}
|
1510
|
|
$data.professorId = userid;
|
1511
|
|
var s = $(this).parents(".txtExpForm").find(".StartMonth").val();
|
1512
|
|
var st = $(this).parents(".txtExpForm").find(".StopMonth").val();
|
1513
|
|
if(s) {
|
1514
|
|
$data.startMonth = s.substr(0, 4) + s.substr(5, 6);
|
1515
|
|
}
|
1516
|
|
if(st) {
|
1517
|
|
if(st == "至今") {} else {
|
1518
|
|
$data.stopMonth = st.substr(0, 4) + st.substr(5, 6);
|
1519
|
|
}
|
1520
|
|
}
|
1521
|
|
|
1522
|
|
$data.name = $(this).parents(".txtExpForm").find(".projectName").val()
|
1523
|
|
$data.descp = $(this).parents(".txtExpForm").find(".projectDescp").val()
|
1524
|
|
$.ajax({
|
1525
|
|
"url": "../ajax/project",
|
1526
|
|
"type": $id ? "PUT" : "POST",
|
1527
|
|
"data": $id ? JSON.stringify($data) : $data,
|
1528
|
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
1529
|
|
"success": function($data) {
|
1530
|
|
if($data.success) {
|
1531
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1532
|
|
if($data.success) {
|
1533
|
|
$("#projectShow").empty("");
|
1534
|
|
projectShow($data.data.projects);
|
1535
|
|
yearAdd();
|
1536
|
|
month();
|
1537
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1538
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1539
|
|
}
|
1540
|
|
});
|
1541
|
|
} else {
|
1542
|
|
$.MsgBox.Alert("message", $data.msg);
|
1543
|
|
}
|
1544
|
|
}
|
1545
|
|
});
|
1546
|
|
})
|
1547
|
|
//著作论文 文章
|
1548
|
|
|
1549
|
|
var papFil = function(select) {
|
1550
|
|
var string = '<li class="listnone1" style="display:none;" >'
|
1551
|
|
string += '<div class="modifybox" style="display:block;">'
|
1552
|
|
string += '<form class="txtExpForm">'
|
1553
|
|
string += '<div class="infor edu">'
|
1554
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
1555
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperName" ></div>'
|
1556
|
|
string += '</div>'
|
1557
|
|
string += '<div class="edu date-box clearfix">'
|
1558
|
|
string += '<div class="txtType floatL">发表时间</div>'
|
1559
|
|
string += '<div class="txtExp floatL">'
|
1560
|
|
string += '<input type="text" class="date-btn input-txt edu-txt paperYear" flag="1" value="">'
|
1561
|
|
string += '<div class="mr_calendar_ym clearfix" style="wclassth: 180px; display: none;">'
|
1562
|
|
string += '<ul class="full_year">'
|
1563
|
|
string += '</ul>'
|
1564
|
|
string += '</div>'
|
1565
|
|
string += '</div>'
|
1566
|
|
string += '</div>'
|
1567
|
|
string += '<div class="infor edu">'
|
1568
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
1569
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperDescp" ></div>'
|
1570
|
|
string += '</div>'
|
1571
|
|
// string += '<div class="infor edu">'
|
1572
|
|
// string += '<div class="txtType floatL"><em class="emspace">链</em>接</div>'
|
1573
|
|
// string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt paperUrl"></div>'
|
1574
|
|
// string += '</div>'
|
1575
|
|
string += '<div class="btnbox">'
|
1576
|
|
string += '<input type="hidden" class="paperId">'
|
1577
|
|
string += '<input type="button" value="添加" class="infor-save btn" class="paperSave">'
|
1578
|
|
string += '<input type="button" value="取消" class="close1 close2 btn">'
|
1579
|
|
string += '</div></form></div></li>'
|
1580
|
|
$("" + select + "").prepend(string);
|
1581
|
|
}
|
1582
|
|
$("#paperShow").on("blur", ".paperName", function() {
|
1583
|
|
var valueE = $(this).val();
|
1584
|
|
var length = trim(valueE);
|
1585
|
|
if(!length) {
|
1586
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
1587
|
|
}
|
1588
|
|
})
|
1589
|
|
$("#papAdd").on("click", function() {
|
1590
|
|
$("#paperShow").find(".listnone1").toggle(100);
|
1591
|
|
});
|
1592
|
|
$("#paperShow").on("click", ".close1", function() {
|
1593
|
|
$("#paperShow").find(".listnone1").toggle(100);
|
1594
|
|
});
|
1595
|
|
$("#paperShow").on("click", "em", function() {
|
1596
|
|
$(this).parent().parent().hide();
|
1597
|
|
$(this).parent().parent().siblings().show();
|
1598
|
|
//$(this).parent().parent().children(".")
|
1599
|
|
});
|
1600
|
|
$("#paperShow").on("click", ".btnCancel", function() {
|
1601
|
|
$(this).parents(".modifybox").hide();
|
1602
|
|
$(this).parents(".modifybox").siblings().show();
|
1603
|
|
|
1604
|
|
});
|
1605
|
|
$("#paperShow").on("click", ".fontLink", function() {
|
1606
|
|
var deuId = $(this).parents(".txtExpForm").find(".paperId").val();
|
1607
|
|
delPaper(deuId);
|
1608
|
|
});
|
1609
|
|
//著作论文 文章 ,对添加的论文删除
|
1610
|
|
var delPaper = function(data) {
|
1611
|
|
$.ajax({
|
1612
|
|
"url": "../ajax/paper/" + data,
|
1613
|
|
"type": "DELETE",
|
1614
|
|
"success": function($data) {
|
1615
|
|
if($data.success) {
|
1616
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1617
|
|
if($data.success) {
|
1618
|
|
$("#paperShow").empty("");
|
1619
|
|
paperShow($data.data.papers);
|
1620
|
|
}
|
1621
|
|
});
|
1622
|
|
} else {
|
1623
|
|
alert($data.msg);
|
1624
|
|
}
|
1625
|
|
}
|
1626
|
|
});
|
|
835
|
//社会兼职保存
|
|
836
|
$("#timeJobShow").on("click", ".saveGo", function() {
|
|
837
|
var length1 = trim($(this).parents(".modifybox").find(".jobCompany").val());
|
|
838
|
var length2 = trim($(this).parents(".modifybox").find(".jobTitle").val());
|
|
839
|
var length3 = trim($(this).parents(".modifybox").find(".startMonth").val());
|
|
840
|
var length4 = trim($(this).parents(".modifybox").find(".stopMonth").val());
|
|
841
|
var length5 = trim($(this).parents(".modifybox").find(".jobdepartment").val());
|
|
842
|
|
|
843
|
if(length1.length>50){ $.MsgBox.Alert("提示", "机构名称不得超过50个字");return;}
|
|
844
|
if(length5.length>20){ $.MsgBox.Alert("提示", "部门名称不得超过20个字");return;}
|
|
845
|
|
|
846
|
if(!length3 && length4) {
|
|
847
|
$.MsgBox.Alert("提示", "请选择工作的开始时间");
|
|
848
|
return;
|
|
849
|
} else if(length3 && !length4) {
|
|
850
|
$.MsgBox.Alert("提示", "请选择工作的结束时间");
|
|
851
|
return;
|
1627
|
852
|
}
|
1628
|
|
//著作 论文 文章 保存
|
1629
|
|
$("#paperShow").on("click", ".infor-save", function() {
|
1630
|
|
var length = trim($(this).parents(".txtExpForm").find(".paperName").val());
|
1631
|
|
if(!length) {
|
1632
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
|
853
|
if(!length1 && length2) {
|
|
854
|
$.MsgBox.Alert("提示", "请填写机构名称");
|
|
855
|
return;
|
|
856
|
} else if(length1 && !length2) {
|
|
857
|
$.MsgBox.Alert("提示", "请填写职位");
|
|
858
|
return;
|
|
859
|
} else if(!length1 && !length2) {
|
|
860
|
$.MsgBox.Alert("提示", "请填写机构名称和职位");
|
1633
|
861
|
return;
|
1634
|
862
|
}
|
1635
|
863
|
var $data = {};
|
1636
|
|
var $id = $(this).parents(".txtExpForm").find(".paperId").val();
|
|
864
|
var $id = $(this).parents(".modifybox").find(".jobId").val();
|
1637
|
865
|
if($id) {
|
1638
|
866
|
$data.id = $id;
|
1639
|
867
|
}
|
1640
|
868
|
$data.professorId = userid;
|
1641
|
|
$data.year = $(this).parents(".txtExpForm").find(".paperYear").val();
|
1642
|
|
$data.name = $(this).parents(".txtExpForm").find(".paperName").val();
|
1643
|
|
$data.descp = $(this).parents(".txtExpForm").find(".paperDescp").val();
|
1644
|
|
$data.url = $(this).parents(".txtExpForm").find(".paperUrl").val();
|
|
869
|
$data.company = $(this).parents(".modifybox").find(".jobCompany").val();
|
|
870
|
$data.department = $(this).parents(".modifybox").find(".jobdepartment").val();
|
|
871
|
var s = $(this).parents(".modifybox").find(".startMonth").val();
|
|
872
|
var st = $(this).parents(".modifybox").find(".stopMonth").val();
|
|
873
|
if(s) {
|
|
874
|
$data.startMonth = s.substr(0, 4) + s.substr(5, 6);
|
|
875
|
}
|
|
876
|
if(st) {
|
|
877
|
if(st == "至今") {} else {
|
|
878
|
$data.stopMonth = st.substr(0, 4) + st.substr(5, 6);
|
|
879
|
}
|
|
880
|
}
|
|
881
|
$data.title = $(this).parents(".modifybox").find(".jobTitle").val();
|
1645
|
882
|
$.ajax({
|
1646
|
|
"url": "../ajax/paper",
|
|
883
|
"url": "/ajax/job",
|
1647
|
884
|
"type": $id ? "PUT" : "POST",
|
1648
|
885
|
"data": $id ? JSON.stringify($data) : $data,
|
1649
|
886
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
|
887
|
beforeSend: function() {
|
|
888
|
//console.log(this.data)
|
|
889
|
},
|
1650
|
890
|
"success": function($data) {
|
1651
|
891
|
if($data.success) {
|
|
892
|
|
1652
|
893
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1653
|
894
|
if($data.success) {
|
1654
|
|
$("#paperShow").empty("");
|
1655
|
|
paperShow($data.data.papers);
|
|
895
|
$("#timeJobShow").empty("");
|
|
896
|
timeJobShow($data.data.jobs);
|
1656
|
897
|
yearAdd();
|
1657
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1658
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
|
898
|
month();
|
1659
|
899
|
}
|
1660
|
900
|
});
|
1661
|
901
|
} else {
|
1662
|
|
$.MsgBox.Alert("message", $data.msg);
|
|
902
|
$.MsgBox.Alert("提示", $data.msg);
|
1663
|
903
|
}
|
1664
|
904
|
}
|
1665
|
905
|
});
|
1666
|
|
});
|
1667
|
|
//专利
|
1668
|
|
$("#patentShow").on("blur", ".patentName", function() {
|
1669
|
|
var valueE = $(this).val();
|
1670
|
|
var length = trim(valueE);
|
1671
|
|
if(!length) {
|
1672
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
1673
|
|
}
|
1674
|
906
|
})
|
1675
|
|
var patFil = function(select) {
|
1676
|
|
var string = '<li class="listnone1" style="display:none;">'
|
1677
|
|
string += '<div class="modifybox" style="display:block;">'
|
1678
|
|
string += '<form class="txtExpForm">'
|
1679
|
|
string += '<div class="infor edu">'
|
1680
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
1681
|
|
string += '<input type="hidden" class="patentId">'
|
1682
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentName"></div>'
|
1683
|
|
string += '</div>'
|
1684
|
|
string += '<div class="edu date-box clearfix">'
|
1685
|
|
string += '<div class="txtType floatL">发表时间</div>'
|
1686
|
|
string += '<div class="txtExp floatL">'
|
1687
|
|
string += '<input type="text" class="date-btn input-txt edu-txt patentYear" flag="1" value="">'
|
1688
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
1689
|
|
string += '<ul class="full_year">'
|
1690
|
|
string += '</ul>'
|
1691
|
|
string += '</div>'
|
1692
|
|
string += '</div>'
|
1693
|
|
string += '</div>'
|
1694
|
|
// string += '<div class="infor edu">'
|
1695
|
|
// string += '<div class="txtType floatL"><em class="emspace">链</em>接</div>'
|
1696
|
|
// string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentUrl"></div>'
|
1697
|
|
// string += '</div>'
|
1698
|
|
string += '<div class="infor edu">'
|
1699
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
1700
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentDescp"></div>'
|
1701
|
|
string += '</div>'
|
1702
|
|
string += '<div class="btnbox">'
|
1703
|
|
string += '<input type="button" value="添加" class="infor-save btn">'
|
1704
|
|
string += '<input type="button" value="取消" class="close1 close2 btn">'
|
1705
|
|
string += '</div>'
|
1706
|
|
string += '</form>'
|
1707
|
|
string += '</div>'
|
1708
|
|
string += '</li>'
|
1709
|
|
$("" + select + "").prepend(string);
|
1710
|
|
}
|
1711
|
|
//专利添加
|
1712
|
|
$("#patenAdd").on("click", function() {
|
1713
|
|
$("#patentShow").find(".listnone1").toggle(100);
|
1714
|
|
});
|
1715
|
|
$("#patentShow").on("click", ".close1", function() {
|
1716
|
|
$("#patentShow").find(".listnone1").toggle(100);
|
1717
|
|
});
|
1718
|
|
$("#patentShow").on("click", "em", function() {
|
1719
|
|
$(this).parent().parent().hide();
|
1720
|
|
$(this).parent().parent().siblings().show();
|
1721
|
|
//$(this).parent().parent().children(".")
|
1722
|
|
});
|
1723
|
|
$("#patentShow").on("click", ".btnCancel", function() {
|
1724
|
|
$(this).parents(".modifybox").hide();
|
1725
|
|
$(this).parents(".modifybox").siblings().show();
|
|
907
|
//////////////////工作经历增删改查相关结束///////////////
|
1726
|
908
|
|
1727
|
|
});
|
|
909
|
//////////////////项目经历增删改查相关开始///////////////
|
|
910
|
//填充项目经历
|
|
911
|
var projectShow = function(data) {
|
|
912
|
projectFil("#projectShow")
|
|
913
|
if(data.length > 0) {
|
|
914
|
for(var i = 0; i < data.length; i++) {
|
|
915
|
if(!data[i].descp) {
|
|
916
|
data[i].descp = "";
|
|
917
|
}
|
|
918
|
if(!data[i].startMonth) {
|
|
919
|
data[i].startMonth = '';
|
|
920
|
data[i].stopMonth = '';
|
|
921
|
} else {
|
|
922
|
data[i].startMonth = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + " - "
|
|
923
|
if(!data[i].stopMonth) {
|
|
924
|
data[i].stopMonth = '至今';
|
|
925
|
} else {
|
|
926
|
data[i].stopMonth = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6)
|
|
927
|
}
|
|
928
|
}
|
|
929
|
var stringHtml = '<li>';
|
|
930
|
stringHtml += '<div class="showBx"><div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].startMonth + '' + data[i].stopMonth + '</small><em class="btnClick exitlist">编辑</em></div>';
|
|
931
|
stringHtml += '<div class="h5Font">' + data[i].descp + '</div>';
|
|
932
|
stringHtml += '</div>';
|
|
933
|
stringHtml += '<div class="modifybox"><ul class="cmpFrmList">'
|
|
934
|
stringHtml += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>项目名称:</span><div class="col-w-10">'
|
|
935
|
stringHtml += '<input type="text" class="frmcontype projectName" placeholder="请填写项目名称" value="' + data[i].name + '" /><input type="hidden" class="projectId" value="' + data[i].id + '"></div></li>'
|
|
936
|
stringHtml += '<li><span class="col-w-2 lableSpan">项目时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
937
|
stringHtml += '<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype project StartMonth" flag="2" difference="1" placeholder="请选择起始时间" value="' + data[i].startMonth.substr(0, 7) + '" />'
|
|
938
|
stringHtml +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"></ul><ul class="mr_month"></ul></div></div>'
|
|
939
|
stringHtml +='<div class="col-w-1 alignCenter">至</div>'
|
|
940
|
stringHtml +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype project StopMonth" flag="2" difference="2" placeholder="请选择结束时间" value="' + data[i].stopMonth + '" />'
|
|
941
|
stringHtml +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"><li class="ymli">至今</li></ul><ul class="mr_month"></ul></div></div>'
|
|
942
|
stringHtml +='</form></div></li>'
|
|
943
|
stringHtml += '<li><span class="col-w-2 lableSpan">项目描述:</span><div class="col-w-10">'
|
|
944
|
stringHtml += '<div class="msgContbox"><textarea class="frmcontype projectDescp" placeholder="请填写项目描述">' + data[i].descp + '</textarea></div></div></li>'
|
|
945
|
stringHtml +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
946
|
stringHtml +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
947
|
stringHtml +='<button type="button" class="frmcontype btnModel btnCancel cancelList">取消</button>'
|
|
948
|
stringHtml +='<button type="button" class="frmcontype btnModel fontLink">删除本条</button></div></li>'
|
1728
|
949
|
|
1729
|
|
$("#patentShow").on("click", ".fontLink", function() {
|
1730
|
|
var deuId = $(this).parents(".txtExpForm").find(".patentId").val();
|
1731
|
|
delPatent(deuId);
|
1732
|
|
})
|
1733
|
|
//专利 ,对添加的专利删除
|
1734
|
|
var delPatent = function(data) {
|
|
950
|
$("#projectShow").append(stringHtml);
|
|
951
|
}
|
|
952
|
}
|
|
953
|
}
|
|
954
|
//项目经历添加填充
|
|
955
|
var projectFil = function(select) {
|
|
956
|
var string ='<li class="listnone1" style="display:none;"><div class="modifybox" style="display:block;"><ul class="cmpFrmList">'
|
|
957
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>项目名称:</span><div class="col-w-10">'
|
|
958
|
string += '<input type="text" class="frmcontype projectName" placeholder="请填写项目名称" /><input type="hidden" class="projectId"></div></li>'
|
|
959
|
string += '<li><span class="col-w-2 lableSpan">项目时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
960
|
string += '<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype project StartMonth" flag="2" difference="1" placeholder="请选择起始时间" />'
|
|
961
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"></ul><ul class="mr_month"></ul></div></div>'
|
|
962
|
string +='<div class="col-w-1 alignCenter">至</div>'
|
|
963
|
string +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype project StopMonth" flag="2" difference="2" placeholder="请选择结束时间" />'
|
|
964
|
string +='<div class="mr_calendar_ym clearfix"><ul class="mr_year"><li class="ymli">至今</li></ul><ul class="mr_month"></ul></div></div>'
|
|
965
|
string +='</form></div></li>'
|
|
966
|
string += '<li><span class="col-w-2 lableSpan">项目描述:</span><div class="col-w-10">'
|
|
967
|
string += '<div class="msgContbox"><textarea class="frmcontype projectDescp" placeholder="请填写项目描述"></textarea></div></div></li>'
|
|
968
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
969
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
970
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelO">取消</button></div></li>'
|
|
971
|
string +='</ul></div><li>';
|
|
972
|
$("" + select + "").prepend(string);
|
|
973
|
}
|
|
974
|
var projectThis=""
|
|
975
|
$("#projectShow").on("click", ".fontLink", function() {//编辑各个列表中的删除
|
|
976
|
projectThis = $(this).parents(".modifybox").find(".projectId").val();
|
|
977
|
$.MsgBox.Confirm("提示", "确认删除该项目经历?",delProject);
|
|
978
|
});
|
|
979
|
//项目经历,对添加的项目删除
|
|
980
|
var delProject = function() {
|
1735
|
981
|
$.ajax({
|
1736
|
|
"url": "/ajax/patent/" + data,
|
|
982
|
"url": "/ajax/project/" + projectThis,
|
1737
|
983
|
"type": "DELETE",
|
1738
|
984
|
"success": function($data) {
|
1739
|
985
|
if($data.success) {
|
1740
|
986
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1741
|
987
|
if($data.success) {
|
1742
|
|
$("#patentShow").empty();
|
1743
|
|
patentShow($data.data.patents);
|
1744
|
|
|
|
988
|
$("#projectShow").empty("");
|
|
989
|
projectShow($data.data.projects);
|
1745
|
990
|
}
|
1746
|
991
|
});
|
1747
|
992
|
} else {
|
1748
|
|
alert($data.msg);
|
|
993
|
$.MsgBox.Alert("提示",$data.msg);
|
1749
|
994
|
}
|
1750
|
995
|
}
|
1751
|
996
|
});
|
1752
|
997
|
}
|
1753
|
|
|
1754
|
|
//专利保存
|
1755
|
|
$("#patentShow").on("click", ".infor-save", function() {
|
1756
|
|
var length = trim($(this).parents(".txtExpForm").find(".patentName").val());
|
1757
|
|
if(!length) {
|
1758
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
1759
|
|
return;
|
1760
|
|
}
|
1761
|
|
var $data = {};
|
1762
|
|
var $id = $(this).parents(".txtExpForm").find(".patentId").val();
|
1763
|
|
if($id) {
|
1764
|
|
$data.id = $id;
|
|
998
|
//项目经历保存
|
|
999
|
$("#projectShow").on("click", ".saveGo", function() {
|
|
1000
|
var length = trim($(this).parents(".modifybox").find(".projectName").val());
|
|
1001
|
var length1 = trim($(this).parents(".modifybox").find(".StartMonth").val());
|
|
1002
|
var length2 = trim($(this).parents(".modifybox").find(".StopMonth").val());
|
|
1003
|
var lengthDescp = trim($(this).parents(".modifybox").find(".projectDescp").val());
|
|
1004
|
|
|
1005
|
if(lengthDescp.length>200){$.MsgBox.Alert("提示", "项目描述不得超过200个字");return;}
|
|
1006
|
if(!length){ $.MsgBox.Alert("提示", "请填写项目名称");return;}
|
|
1007
|
if(length.length>50){ $.MsgBox.Alert("提示", "项目名称不得超过50个字");return;}
|
|
1008
|
|
|
1009
|
if(length1 && !length2) { $.MsgBox.Alert("提示", "没有选结束时间");return;}
|
|
1010
|
if(!length1 && length2) {$.MsgBox.Alert("提示", "没有选开始时间");return;}
|
|
1011
|
var $data = {};
|
|
1012
|
var $id = $(this).parents(".modifybox").find(".projectId").val();
|
|
1013
|
if($id) {
|
|
1014
|
$data.id = $id;
|
|
1015
|
}
|
|
1016
|
$data.professorId = userid;
|
|
1017
|
var s = $(this).parents(".modifybox").find(".StartMonth").val();
|
|
1018
|
var st = $(this).parents(".modifybox").find(".StopMonth").val();
|
|
1019
|
if(s) {
|
|
1020
|
$data.startMonth = s.substr(0, 4) + s.substr(5, 6);
|
|
1021
|
}
|
|
1022
|
if(st) {
|
|
1023
|
if(st == "至今") {} else {
|
|
1024
|
$data.stopMonth = st.substr(0, 4) + st.substr(5, 6);
|
1765
|
1025
|
}
|
1766
|
|
$data.professorId = userid;
|
1767
|
|
$data.year = $(this).parents(".txtExpForm").find(".patentYear").val();
|
1768
|
|
$data.name = $(this).parents(".txtExpForm").find(".patentName").val();
|
1769
|
|
$data.descp = $(this).parents(".txtExpForm").find(".patentDescp").val();
|
1770
|
|
$data.url = $(this).parents(".txtExpForm").find(".patentUrl").val();
|
1771
|
|
$.ajax({
|
1772
|
|
"url": "../ajax/patent",
|
1773
|
|
"type": $id ? "PUT" : "POST",
|
1774
|
|
"data": $id ? JSON.stringify($data) : $data,
|
1775
|
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
1776
|
|
"success": function($data) {
|
1777
|
|
if($data.success) {
|
|
1026
|
}
|
1778
|
1027
|
|
1779
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1780
|
|
if($data.success) {
|
1781
|
|
$("#patentShow").empty("");
|
1782
|
|
patentShow($data.data.patents);
|
1783
|
|
yearAdd();
|
1784
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1785
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1786
|
|
}
|
1787
|
|
});
|
1788
|
|
} else {
|
1789
|
|
$.MsgBox.Alert("message", $data.msg);
|
1790
|
|
}
|
|
1028
|
$data.name = $(this).parents(".modifybox").find(".projectName").val()
|
|
1029
|
$data.descp = $(this).parents(".modifybox").find(".projectDescp").val()
|
|
1030
|
$.ajax({
|
|
1031
|
"url": "../ajax/project",
|
|
1032
|
"type": $id ? "PUT" : "POST",
|
|
1033
|
"data": $id ? JSON.stringify($data) : $data,
|
|
1034
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
|
1035
|
"success": function($data) {
|
|
1036
|
if($data.success) {
|
|
1037
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
|
1038
|
if($data.success) {
|
|
1039
|
$("#projectShow").empty("");
|
|
1040
|
projectShow($data.data.projects);
|
|
1041
|
yearAdd();
|
|
1042
|
month();
|
|
1043
|
}
|
|
1044
|
});
|
|
1045
|
} else {
|
|
1046
|
$.MsgBox.Alert("提示", $data.msg);
|
1791
|
1047
|
}
|
1792
|
|
});
|
1793
|
|
})
|
1794
|
|
//荣誉及奖项
|
1795
|
|
$("#honorShow").on("blur", ".honorName", function() {
|
1796
|
|
var valueE = $(this).val();
|
1797
|
|
var length = trim(valueE);
|
1798
|
|
if(!length) {
|
1799
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
1800
|
|
}
|
|
1048
|
}
|
|
1049
|
});
|
1801
|
1050
|
})
|
|
1051
|
//////////////////项目经历增删改查相关结束///////////////
|
|
1052
|
|
|
1053
|
//////////////////荣誉奖项增删改查相关开始///////////////
|
|
1054
|
var honorShow = function(data) {
|
|
1055
|
hounerFil("#honorShow");
|
|
1056
|
if(data.length > 0) {
|
|
1057
|
for(var i = 0; i < data.length; i++) {
|
|
1058
|
if(!data[i].year) {
|
|
1059
|
data[i].year = "";
|
|
1060
|
}
|
|
1061
|
if(!data[i].descp) {
|
|
1062
|
data[i].descp = "";
|
|
1063
|
}
|
|
1064
|
var stringHtml = '<li>';
|
|
1065
|
stringHtml += '<div class="showBx"><div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small><em class="btnClick exitlist">编辑</em></div>';
|
|
1066
|
stringHtml += '<div class="h5Font">' + data[i].descp + '</div>';
|
|
1067
|
stringHtml += '</div>';
|
|
1068
|
stringHtml += '<div class="modifybox"><ul class="cmpFrmList">'
|
|
1069
|
stringHtml += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>奖项名称:</span><div class="col-w-10">'
|
|
1070
|
stringHtml += '<input type="text" class="frmcontype honorName" placeholder="请填写奖项名称" value="' + data[i].name + '" /><input type="hidden" class="honorId" value="' + data[i].id + '"></div></li>'
|
|
1071
|
stringHtml += '<li><span class="col-w-2 lableSpan">获奖时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
1072
|
stringHtml +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype project honorYear" placeholder="请填写奖项时间" flag="1" value="' + data[i].year + '" />'
|
|
1073
|
stringHtml +='<div class="mr_calendar_ym clearfix"><ul class="full_year"></ul></div></div>'
|
|
1074
|
stringHtml +='</form></div></li>'
|
|
1075
|
stringHtml += '<li><span class="col-w-2 lableSpan">获奖描述:</span><div class="col-w-10">'
|
|
1076
|
stringHtml += '<div class="msgContbox"><textarea class="frmcontype honorDescp" placeholder="请填写获奖描述">' + data[i].descp + '</textarea></div></div></li>'
|
|
1077
|
stringHtml +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
1078
|
stringHtml +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
1079
|
stringHtml +='<button type="button" class="frmcontype btnModel btnCancel cancelList">取消</button>'
|
|
1080
|
stringHtml +='<button type="button" class="frmcontype btnModel fontLink">删除本条</button></div></li>'
|
|
1081
|
$("#honorShow").append(stringHtml);
|
|
1082
|
}
|
|
1083
|
}
|
|
1084
|
}
|
1802
|
1085
|
var hounerFil = function(select) {
|
1803
|
|
var string = '<li class="listnone1" style="display:none">'
|
1804
|
|
string += '<div class="modifybox" style="display:block">'
|
1805
|
|
string += '<form class="txtExpForm">'
|
1806
|
|
string += '<div class="infor edu">'
|
1807
|
|
string += '<div class="txtType floatL"><b class="required_star"></b><em class="emspace">标</em>题</div>'
|
1808
|
|
string += '<input type="hidden" class="honorId">'
|
1809
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt honorName"></div>'
|
1810
|
|
string += '</div>'
|
1811
|
|
string += '<div class="infor edu">'
|
1812
|
|
string += '<div class="txtType floatL"><em class="emspace">描</em>述</div>'
|
1813
|
|
string += '<div class="txtExp floatL"><input type="text" class="input-txt edu-txt patentDescp"></div>'
|
1814
|
|
string += '</div>'
|
1815
|
|
string += '<div class="edu date-box clearfix">'
|
1816
|
|
string += '<div class="txtType floatL"><em class="emspace">时</em>间</div>'
|
1817
|
|
string += '<div class="txtExp floatL">'
|
1818
|
|
string += '<input type="text" class="date-btn input-txt edu-txt honorYear" flag="1" value="">'
|
1819
|
|
string += '<div class="mr_calendar_ym clearfix" style="width: 180px; display: none;">'
|
1820
|
|
string += '<ul class="full_year">'
|
1821
|
|
string += '</ul>'
|
1822
|
|
string += '</div>'
|
1823
|
|
string += '</div>'
|
1824
|
|
string += '</div>'
|
1825
|
|
string += '<div class="btnbox">'
|
1826
|
|
string += '<input type="button" value="添加" class="infor-save btn">'
|
1827
|
|
string += '<input type="button" value="取消" class="close1 close2 btn">'
|
1828
|
|
string += '</div>'
|
1829
|
|
string += '</form>'
|
1830
|
|
string += '</div>'
|
1831
|
|
string += '</li>'
|
|
1086
|
var string ='<li class="listnone1" style="display:none;"><div class="modifybox" style="display:block;"><ul class="cmpFrmList">'
|
|
1087
|
string += '<li><span class="col-w-2 lableSpan"><span class="requiredcon">* </span>奖项名称:</span><div class="col-w-10">'
|
|
1088
|
string += '<input type="text" class="frmcontype honorName" placeholder="请填写奖项名称" /><input type="hidden" class="honorId"></div></li>'
|
|
1089
|
string += '<li><span class="col-w-2 lableSpan">项目时间:</span><div class="col-w-9"><form action="" class="col-w-12" name="formT">'
|
|
1090
|
string +='<div class="col-w-5" style="position:relative"><input type="text" class="date-btn frmcontype honorYear" flag="1" placeholder="请选择获奖时间" />'
|
|
1091
|
string +='<div class="mr_calendar_ym clearfix"><ul class="full_year"></ul></div></div>'
|
|
1092
|
string +='</form></div></li>'
|
|
1093
|
string += '<li><span class="col-w-2 lableSpan">获奖描述:</span><div class="col-w-10">'
|
|
1094
|
string += '<div class="msgContbox"><textarea class="frmcontype honorDescp" placeholder="请填写获奖描述"></textarea></div></div></li>'
|
|
1095
|
string +='<li class="saveBtn"><span class="col-w-2"> </span><div class="col-w-10">'
|
|
1096
|
string +='<button type="button" class="frmcontype btnModel saveGo">保存</button>'
|
|
1097
|
string +='<button type="button" class="frmcontype btnModel btnCancel cancelO">取消</button></div></li>'
|
|
1098
|
string +='</ul></div><li>';
|
1832
|
1099
|
$("" + select + "").prepend(string);
|
1833
|
|
}
|
1834
|
|
//专利添加
|
1835
|
|
$("#honorAdd").on("click", function() {
|
1836
|
|
$("#honorShow").find(".listnone1").toggle(100);
|
1837
|
|
});
|
1838
|
|
$("#honorShow").on("click", ".close1", function() {
|
1839
|
|
$("#honorShow").find(".listnone1").toggle(100);
|
1840
|
|
});
|
1841
|
|
$("#honorShow").on("click", "em", function() {
|
1842
|
|
$(this).parent().parent().hide();
|
1843
|
|
$(this).parent().parent().siblings().show();
|
1844
|
|
//$(this).parent().parent().children(".")
|
1845
|
|
});
|
1846
|
|
$("#honorShow").on("click", ".btnCancel", function() {
|
1847
|
|
$(this).parents(".modifybox").hide();
|
1848
|
|
$(this).parents(".modifybox").siblings().show();
|
1849
|
|
|
1850
|
|
});
|
1851
|
|
|
|
1100
|
}
|
|
1101
|
var honorThis=""
|
1852
|
1102
|
$("#honorShow").on("click", ".fontLink", function() {
|
1853
|
|
var deuId = $(this).parents(".txtExpForm").find(".honorId").val();
|
1854
|
|
delHonor(deuId);
|
|
1103
|
honorThis = $(this).parents(".modifybox").find(".honorId").val();
|
|
1104
|
$.MsgBox.Confirm("提示", "确认删除该荣誉奖项?",delHonor);
|
1855
|
1105
|
});
|
1856
|
|
//荣誉及奖项 ,对添加的专利删除
|
1857
|
|
var delHonor = function(data) {
|
|
1106
|
var delHonor = function() {//荣誉及奖项 ,对添加的专利删除
|
1858
|
1107
|
$.ajax({
|
1859
|
|
"url": "/ajax/honor/" + data,
|
|
1108
|
"url": "/ajax/honor/" + honorThis,
|
1860
|
1109
|
"type": "DELETE",
|
1861
|
1110
|
"success": function($data) {
|
1862
|
1111
|
if($data.success) {
|
|
@ -1867,107 +1116,91 @@ $(function() {
|
1867
|
1116
|
}
|
1868
|
1117
|
});
|
1869
|
1118
|
} else {
|
1870
|
|
alert($data.msg);
|
|
1119
|
$.MsgBox.Alert("提示", $data.msg);
|
1871
|
1120
|
}
|
1872
|
1121
|
}
|
1873
|
1122
|
});
|
1874
|
1123
|
}
|
1875
|
|
|
1876
|
|
//function getProfessorData(){
|
1877
|
|
// $.get("/ajax/professor/info/" + userid, function($data) {
|
1878
|
|
// if ($data.success) {
|
1879
|
|
//
|
1880
|
|
// }
|
1881
|
|
// });
|
1882
|
|
//}
|
1883
|
|
//getProfessorData()
|
1884
|
|
|
1885
|
1124
|
//荣誉及奖项保存
|
1886
|
|
$("#honorShow").on("click", ".infor-save", function() {
|
1887
|
|
var length = trim($(this).parents(".txtExpForm").find(".honorName").val());
|
1888
|
|
if(!length) {
|
1889
|
|
$.MsgBox.Alert("消息", "标题不能为空");
|
1890
|
|
return;
|
1891
|
|
}
|
1892
|
|
var $data = {};
|
1893
|
|
var $id = $(this).parents(".txtExpForm").find(".honorId").val();
|
1894
|
|
if($id) {
|
1895
|
|
$data.id = $id;
|
1896
|
|
}
|
1897
|
|
$data.professorId = userid;
|
1898
|
|
$data.year = $(this).parents(".txtExpForm").find(".honorYear").val();
|
1899
|
|
$data.name = $(this).parents(".txtExpForm").find(".honorName").val();
|
1900
|
|
$data.descp = $(this).parents(".txtExpForm").find(".patentDescp").val();
|
1901
|
|
//console.log($data.descp);
|
1902
|
|
$.ajax({
|
1903
|
|
"url": "../ajax/honor",
|
1904
|
|
"type": $id ? "PUT" : "POST",
|
1905
|
|
"data": $id ? JSON.stringify($data) : $data,
|
1906
|
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
1907
|
|
"success": function($data) {
|
1908
|
|
if($data.success) {
|
1909
|
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
1910
|
|
if($data.success) {
|
1911
|
|
$("#honorShow").empty("");
|
1912
|
|
honorShow($data.data.honors);
|
1913
|
|
yearAdd();
|
1914
|
|
$(".stopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1915
|
|
$(".StopMonth").siblings(".mr_calendar_ym ").find(".mr_year").prepend("<li class='ymli'>至今</li>");
|
1916
|
|
}
|
1917
|
|
});
|
1918
|
|
} else {
|
1919
|
|
$.MsgBox.Alert("message", $data.msg);
|
1920
|
|
}
|
|
1125
|
$("#honorShow").on("click", ".saveGo", function() {
|
|
1126
|
var length = trim($(this).parents(".modifybox").find(".honorName").val());
|
|
1127
|
var lengthDescp = trim($(this).parents(".modifybox").find(".honorDescp").val());
|
|
1128
|
|
|
1129
|
if(!length) { $.MsgBox.Alert("提示", "请填写奖项名称");return;}
|
|
1130
|
if(length.length>50){$.MsgBox.Alert("提示", "奖项名称不得超过50个字");return;}
|
|
1131
|
if(lengthDescp.length>200){$.MsgBox.Alert("提示", "获奖描述不得超过200个字");return;}
|
|
1132
|
var $data = {};
|
|
1133
|
var $id = $(this).parents(".modifybox").find(".honorId").val();
|
|
1134
|
if($id) { $data.id = $id;}
|
|
1135
|
$data.professorId = userid;
|
|
1136
|
$data.year = $(this).parents(".modifybox").find(".honorYear").val();
|
|
1137
|
$data.name = $(this).parents(".modifybox").find(".honorName").val();
|
|
1138
|
$data.descp = $(this).parents(".modifybox").find(".honorDescp").val();
|
|
1139
|
console.log($data.descp);
|
|
1140
|
$.ajax({
|
|
1141
|
"url": "../ajax/honor",
|
|
1142
|
"type": $id ? "PUT" : "POST",
|
|
1143
|
"data": $id ? JSON.stringify($data) : $data,
|
|
1144
|
"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
|
|
1145
|
"success": function($data) {
|
|
1146
|
if($data.success) {
|
|
1147
|
$.get("/ajax/professor/info/" + userid, function($data) {
|
|
1148
|
if($data.success) {
|
|
1149
|
$("#honorShow").empty("");
|
|
1150
|
honorShow($data.data.honors);
|
|
1151
|
yearAdd();
|
|
1152
|
}
|
|
1153
|
});
|
|
1154
|
} else {
|
|
1155
|
$.MsgBox.Alert("提示", $data.msg);
|
1921
|
1156
|
}
|
1922
|
|
});
|
1923
|
|
})
|
1924
|
|
|
1925
|
|
//到至今选中复选框的操作
|
1926
|
|
/*$(".present").click(function(){
|
1927
|
|
var date = $(".present").index(this);
|
1928
|
|
$(".datebox").eq(date).find(".ago").remove();
|
1929
|
|
$(".datebox").eq(date).css("width","326px");
|
1930
|
|
})*/
|
1931
|
|
$(".present").change(function() {
|
1932
|
|
if($(".present").is(":checked")) {
|
1933
|
|
$(this).parent().parent().find('.ago').hide();
|
1934
|
|
$(this).parent().parent().find('.inputno').hide();
|
1935
|
|
|
1936
|
|
} else {
|
1937
|
|
|
1938
|
|
$(this).parent().parent().find('.ago').show();
|
1939
|
|
$(this).parent().parent().find('.inputno').show();
|
1940
|
1157
|
}
|
1941
|
|
})
|
1942
|
|
|
1943
|
|
/*ģ��Selectѡ���*/
|
1944
|
|
$(".input_select").click(function() {
|
1945
|
|
var ul = $(this).next();
|
1946
|
|
if(ul.css("display") == "none") {
|
1947
|
|
ul.slideDown("fast");
|
1948
|
|
} else {
|
1949
|
|
ul.slideUp("fast");
|
|
1158
|
});
|
|
1159
|
})
|
|
1160
|
//////////////////荣誉奖项增删改查相关结束///////////////
|
|
1161
|
|
|
1162
|
//////////////////相关操作按钮///////////////
|
|
1163
|
//获取点击那个编辑
|
|
1164
|
$("#container .edit").click(function() {
|
|
1165
|
var edit = $(".edit").index(this);
|
|
1166
|
$(".coninfocon").eq(edit).hide();
|
|
1167
|
$(".modifybox").eq(edit).show();
|
|
1168
|
if(edit == 0){
|
|
1169
|
$(".head-left").css("top","30px");
|
|
1170
|
}else{
|
|
1171
|
$(".head-left").css("top","");
|
1950
|
1172
|
}
|
|
1173
|
//点击取消的操作
|
|
1174
|
$(".btnCancel").click(function() {
|
|
1175
|
$(".modifybox").eq(edit).hide();
|
|
1176
|
$(".coninfocon").eq(edit).show();
|
|
1177
|
});
|
1951
|
1178
|
});
|
1952
|
|
|
1953
|
|
$(".divselect ul li a").click(function() {
|
1954
|
|
var txt = $(this).text();
|
1955
|
|
$(".divselect .input_select").val(txt);
|
1956
|
|
var value = $(this).attr("rel");
|
1957
|
|
$(".divselect ul").hide();
|
1958
|
|
|
|
1179
|
$(".addedit").on("click", function() {//点击添加按钮
|
|
1180
|
$(this).parents(".coninfobox").find(".listnone1").toggle(100);
|
|
1181
|
$(this).parents(".coninfobox").find(".showBx").show();
|
|
1182
|
$(this).parents(".coninfobox").find(".showBx + .modifybox").hide();
|
1959
|
1183
|
});
|
1960
|
|
$("#aclick").on("click", function() {
|
1961
|
|
exit();
|
|
1184
|
$(".coninfobox").on("click", ".cancelO", function() {//添加模块的取消
|
|
1185
|
$(this).parents(".listnone1").toggle(100);
|
|
1186
|
});
|
|
1187
|
$(".coninfobox").on("click", ".exitlist", function() {//编辑列表模块
|
|
1188
|
$(this).parents(".showBx").hide().siblings(".modifybox").show();
|
|
1189
|
$(this).parents("li").siblings().find(".showBx").show().siblings(".modifybox").hide();
|
|
1190
|
});
|
|
1191
|
$(".coninfobox").on("click", ".cancelList", function() {//编辑各个列表中的取消
|
|
1192
|
$(this).parents(".modifybox").hide();
|
|
1193
|
$(this).parents(".modifybox").siblings(".showBx").show();
|
1962
|
1194
|
});
|
|
1195
|
//点击查看自己的主页
|
|
1196
|
$("#showMyself").click(function(){
|
|
1197
|
$(this).attr("href","userInforShow.html?professorId=" + userid);
|
|
1198
|
})
|
|
1199
|
|
|
1200
|
function trim(str) { //删除左右两端的空格
|
|
1201
|
return str.replace(/(^\s*)|(\s*$)/g, "");
|
|
1202
|
}
|
1963
|
1203
|
})
|
1964
|
1204
|
|
1965
|
|
function exit() {
|
1966
|
|
$.cookie('userid', null);
|
1967
|
|
$.cookie('userAuth', null);
|
1968
|
|
location.href = "login.html"
|
1969
|
|
}
|
1970
|
1205
|
|
1971
|
|
//获取数据填充页面
|
1972
|
1206
|
|
1973
|
|
/*����*/
|