portal html css js resource

paperModify.js 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. $(document).ready(function() {
  2. loginStatus(); //判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var paperId = GetQueryString("paperId");
  5. getPaperMe();
  6. hotKey(".oinput");//
  7. /*删除标签*/
  8. $("body").on("click", ".closeThis", function() {
  9. if($(this).parent().length < 5) {
  10. $(this).parents(".keyResult").siblings("div").show();
  11. }
  12. $(this).parent().remove();
  13. })
  14. //论文发布
  15. $("#release").on("click",function(){
  16. $.MsgBox.Confirm("提示","确认发布该论文?",paperUpdate);
  17. })
  18. //删除论文
  19. $("#delete").on("click",function(){
  20. $.MsgBox.Confirm("提示","确认删除该论文?",paperDelet);
  21. })
  22. /*获取论文信息*/
  23. function getPaperMe() {
  24. $.ajax({
  25. "url": "/ajax/ppaper/qo",
  26. "type": "GET",
  27. "success": function(data) {
  28. console.log(data);
  29. if(data.success) {
  30. paperHtml(data.data);
  31. getPaperAuthors(data.data.id);
  32. var paperName = data.data.name + "-科袖网";
  33. document.title = paperName;
  34. }
  35. },
  36. "data": {
  37. "id": paperId
  38. },
  39. dataType: "json",
  40. 'error': function() {
  41. $.MsgBox.Alert('提示', '服务器连接超时!');
  42. }
  43. });
  44. }
  45. /*获取论文作者信息*/
  46. function getPaperAuthors(stritrm) {
  47. $.ajax({
  48. "url": "/ajax/ppaper/authors",
  49. "type": "GET",
  50. "success": function(data) {
  51. console.log(data);
  52. if(data.success) {
  53. if(data.data.length>0){
  54. for(var i=0;i<data.data.length;i++){
  55. var authTy="",authTit="",baseInfo="",imgbg="../images/default-photo.jpg";
  56. if(data.data[i].professorId.substring(0, 1) != "#"){
  57. $.ajax({
  58. type:"get",
  59. url:"/ajax/professor/editBaseInfo/" + data.data[i].professorId,
  60. async:true,
  61. success:function($proData){
  62. console.log($proData)
  63. if($proData.success){
  64. var showPro = $proData.data;
  65. if(showPro.hasHeadImage == 1) {
  66. imgbg = "/images/head/" + showPro.id + "_l.jpg";
  67. } else {
  68. imgbg = "../images/default-photo.jpg";
  69. }
  70. //认证
  71. var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
  72. authTy = oSty.sty;
  73. authTit = oSty.title;
  74. var title = showPro.title || "";
  75. var orgName = showPro.orgName || "";
  76. var office = showPro.office || "";
  77. if(orgName!=""){
  78. if(title != "") {
  79. baseInfo = title + "," + orgName;
  80. }else{
  81. if(office!=""){
  82. baseInfo = office + "," + orgName;
  83. }else{
  84. baseInfo = orgName;
  85. }
  86. }
  87. }else{
  88. if(title != "") {
  89. baseInfo = title;
  90. }else{
  91. if(office!=""){
  92. baseInfo = office;
  93. }else{
  94. baseInfo = "";
  95. }
  96. }
  97. }
  98. var str="";
  99. str +='<li class="flexCenter" data-id="'+ showPro.id +'">'
  100. str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
  101. str +='<div class="madiaInfo" style="margin-top:-8px">'
  102. str +='<p class="ellipsisSty"><span class="h1Font">'+ showPro.name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
  103. str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
  104. str +='</div></li>';
  105. var $str=$(str);
  106. $("#aboutAuthors").append($str);
  107. }
  108. }
  109. })
  110. }else{
  111. var str="";
  112. str +='<li class="flexCenter" data-id="'+ data.data[i].professorId +'">'
  113. str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
  114. str +='<div class="madiaInfo">'
  115. str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span></p>'
  116. str +='</div></li>';
  117. var $str=$(str);
  118. $("#aboutAuthors").append($str);
  119. }
  120. }
  121. }
  122. }
  123. },
  124. "data": {
  125. "id": stritrm
  126. },
  127. dataType: "json",
  128. 'error': function() {
  129. $.MsgBox.Alert('提示', '服务器连接超时!');
  130. }
  131. });
  132. }
  133. /*处理论文html代码*/
  134. function paperHtml($da) {
  135. $("#paperName").text($da.name); //名字
  136. $("#pageView").text($da.pageViews); //浏览量
  137. $("#paperAbstract").text($da.summary); //摘要内容
  138. if(!$da.cn4periodical){
  139. $da.cn4periodical=""
  140. }
  141. if(!$da.en4periodical){
  142. $da.en4periodical=""
  143. }
  144. if(!$da.cn4periodical && !$da.en4periodical){
  145. $("#paperJournal").parents("li").hide();
  146. }else{
  147. $("#paperJournal").text($da.cn4periodical +" " + $da.en4periodical);
  148. }
  149. if(!$da.pubDay){
  150. $("#paperVolume").parents("li").hide();
  151. }else{
  152. $("#paperVolume").text($da.pubDay);
  153. }
  154. if($da.keywords != undefined && $da.keywords.length != 0 ){
  155. var subs = new Array();
  156. if($da.keywords.indexOf(',')){
  157. subs = $da.keywords.split(',');
  158. }else{
  159. subs[0] = $da.keywords;
  160. }
  161. if(subs.length>0){
  162. for (var i = 0; i < subs.length; i++)
  163. {
  164. $("#paperSList").append('<li>'+ subs[i] +'<div class="closeThis"></div></li>');
  165. };
  166. }
  167. if( $("#paperSList").find("li").length >= 5) {
  168. $("#paperSList").parents(".keyResult").siblings("div.col-w-12").hide();
  169. }
  170. }
  171. }
  172. /*论文添加*/
  173. function paperUpdate(){
  174. $.ajax({
  175. "url" : "/ajax/ppaper/kw",
  176. "type" : "post" ,
  177. "dataType" : "json",
  178. "data" :{
  179. "id":paperId,
  180. "keywords":captiureSubInd("paperSList li")
  181. },
  182. "traditional": true, //传数组必须加这个
  183. "success" : function(data) {
  184. console.log(data);
  185. if (data.success){
  186. $.MsgBox.Alert("提示","论文发表成功!",function paperList(){
  187. location.href = "paperList.html";
  188. });
  189. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  190. } else {
  191. $.MsgBox.Alert("提示", "论文发表失败!");
  192. }
  193. },
  194. "error":function(){
  195. $.MsgBox.Alert('提示','链接服务器超时')
  196. }
  197. });
  198. }
  199. //组合关键字
  200. function captiureSubInd(subIndu) {
  201. var industrys = $("#" + subIndu + "");
  202. var industryAll = "";
  203. if(industrys.size() > 0) {
  204. for(var i = 0; i < industrys.size(); i++) {
  205. industryAll += industrys[i].innerText;
  206. industryAll += ',';
  207. };
  208. industryAll = industryAll.substring(0, industryAll.length - 1);
  209. }
  210. return industryAll;
  211. }
  212. /*论文删除*/
  213. function paperDelet() {
  214. $.ajax({
  215. "url" : "/ajax/ppaper/cAss",
  216. "type" : "POST",
  217. "dataType" : "json",
  218. "data": {
  219. "id": paperId,
  220. "uid":userid
  221. },
  222. "success" : function($data) {
  223. if ($data.success) {
  224. location.href = "paperList.html";
  225. }
  226. },
  227. "error":function(){
  228. $.MsgBox.Alert('提示','链接服务器超时')
  229. }
  230. })
  231. }
  232. //纠错反馈
  233. $(".feedBack").click(function(){
  234. $(".feedbackBox").fadeToggle();
  235. })
  236. $(".closeBack").click(function(){
  237. $(".feedbackBox").fadeToggle();
  238. })
  239. $(".correctBlock").on("keyup",".correctCon",function(){
  240. var cntCon=$(this).val();
  241. if(cntCon.length>0){
  242. $(this).siblings(".correctSubmit").attr("disabled",false);
  243. }else{
  244. $(this).siblings(".correctSubmit").attr("disabled",true);
  245. }
  246. })
  247. $(".correctSubmit").on("click",function(){
  248. var cntCon=$(this).siblings(".correctCon").val();
  249. var cntUser="";
  250. if(userid && userid != null && userid != "null") {
  251. cntUser = userid;
  252. }
  253. if(cntCon.length>500){
  254. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  255. return;
  256. }else{
  257. $.ajax({
  258. "url": "/ajax/feedback/error/paper",
  259. "type": "POST",
  260. "dataType": "json",
  261. "async": true,
  262. "data": {
  263. "id": paperId,
  264. "cnt":cntCon,
  265. "user":cntUser
  266. },
  267. "success": function(data) {
  268. if(data.success) {
  269. backSuccessed();
  270. }
  271. },
  272. "error": function() {
  273. $.MsgBox.Alert('提示', '链接服务器超时')
  274. }
  275. });
  276. }
  277. })
  278. })