portal html css js resource

paperModify.js 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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:-4px">'
  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 = strToAry($da.keywords)
  156. if(subs.length>0){
  157. for (var i = 0; i < subs.length; i++)
  158. {
  159. $("#paperSList").append('<li>'+ subs[i] +'<div class="closeThis"></div></li>');
  160. };
  161. }
  162. if( $("#paperSList").find("li").length >= 5) {
  163. $("#paperSList").parents(".keyResult").siblings("div.col-w-12").hide();
  164. }
  165. }
  166. }
  167. /*论文添加*/
  168. function paperUpdate(){
  169. $.ajax({
  170. "url" : "/ajax/ppaper/kw",
  171. "type" : "post" ,
  172. "dataType" : "json",
  173. "data" :{
  174. "id":paperId,
  175. "keywords":captiureSubInd("paperSList li")
  176. },
  177. "traditional": true, //传数组必须加这个
  178. "success" : function(data) {
  179. console.log(data);
  180. if (data.success){
  181. $.MsgBox.Alert("提示","论文发表成功!",function paperList(){
  182. location.href = "paperList.html";
  183. });
  184. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  185. } else {
  186. $.MsgBox.Alert("提示", "论文发表失败!");
  187. }
  188. },
  189. "error":function(){
  190. $.MsgBox.Alert('提示','链接服务器超时')
  191. }
  192. });
  193. }
  194. //组合关键字
  195. function captiureSubInd(subIndu) {
  196. var industrys = $("#" + subIndu + "");
  197. var industryAll = "";
  198. if(industrys.size() > 0) {
  199. for(var i = 0; i < industrys.size(); i++) {
  200. industryAll += industrys[i].innerText.trim();
  201. industryAll += ',';
  202. };
  203. industryAll = industryAll.substring(0, industryAll.length - 1);
  204. }
  205. return industryAll;
  206. }
  207. /*论文删除*/
  208. function paperDelet() {
  209. $.ajax({
  210. "url" : "/ajax/ppaper/cAss",
  211. "type" : "POST",
  212. "dataType" : "json",
  213. "data": {
  214. "id": paperId,
  215. "uid":userid
  216. },
  217. "success" : function($data) {
  218. if ($data.success) {
  219. location.href = "paperList.html";
  220. }
  221. },
  222. "error":function(){
  223. $.MsgBox.Alert('提示','链接服务器超时')
  224. }
  225. })
  226. }
  227. //纠错反馈
  228. $(".feedBack").click(function(){
  229. $(".feedbackBox").fadeToggle();
  230. })
  231. $(".closeBack").click(function(){
  232. $(".feedbackBox").fadeToggle();
  233. })
  234. $(".correctBlock").on("keyup",".correctCon",function(){
  235. var cntCon=$(this).val();
  236. if(cntCon.length>0){
  237. $(this).siblings(".correctSubmit").attr("disabled",false);
  238. }else{
  239. $(this).siblings(".correctSubmit").attr("disabled",true);
  240. }
  241. })
  242. $(".correctSubmit").on("click",function(){
  243. var cntCon=$(this).siblings(".correctCon").val();
  244. var cntUser="";
  245. if(userid && userid != null && userid != "null") {
  246. cntUser = userid;
  247. }
  248. if(cntCon.length>500){
  249. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  250. return;
  251. }else{
  252. $.ajax({
  253. "url": "/ajax/feedback/error/paper",
  254. "type": "POST",
  255. "dataType": "json",
  256. "async": true,
  257. "data": {
  258. "id": paperId,
  259. "cnt":cntCon,
  260. "user":cntUser
  261. },
  262. "success": function(data) {
  263. if(data.success) {
  264. backSuccessed();
  265. }
  266. },
  267. "error": function() {
  268. $.MsgBox.Alert('提示', '链接服务器超时')
  269. }
  270. });
  271. }
  272. })
  273. })