portal html css js resource

cmp-workspaces.js 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. $(document).ready(function() {
  2. var id = $.cookie('orgId');
  3. /*企业信息*/
  4. function companyInformation() {
  5. $.ajax({
  6. url: "/ajax/org/" + id,
  7. type: "GET",
  8. timeout: 10000,
  9. dataType: "json",
  10. beforeSend: function() {},
  11. success: function(data, textState) {
  12. if(data.success) {
  13. var $data = data.data;
  14. var otext, oguimo;
  15. console.log(data);
  16. if($data.authStatus != 3) {
  17. $("#photoClass").addClass("authicon-com-no")
  18. $("#photoClass").attr("title", "未认证企业");
  19. $("#authOk").hide();
  20. } else {
  21. $("#photoClass").addClass("authicon-com-ok");
  22. $("#authBad").hide();
  23. $("#photoClass").attr("title", "认证企业");
  24. }
  25. $(".h1Font").find("span").text($data.name);
  26. if($data.hasOrgLogo) {
  27. $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg");
  28. } else {
  29. $("#oimg").attr("src", "../images/default-icon.jpg");
  30. }
  31. if($data.orgUrl) {
  32. $("#inteAddress").val($data.orgUrl);
  33. }
  34. if($data.city) {
  35. $("#ocity").text($data.city);
  36. }
  37. if($data.orgType) {
  38. switch($data.orgType) {
  39. case '2':
  40. otext = "国有企业";
  41. break;
  42. case '3':
  43. otext = "上市企业";
  44. break;
  45. case '4':
  46. otext = "合资企业";
  47. break;
  48. case '5':
  49. otext = "私人企业";
  50. break;
  51. case '6':
  52. otext = "外资企业";
  53. break;
  54. default:
  55. otext = "初创企业";
  56. break;
  57. }
  58. $("#cmpBasic").append("<span>" + otext + "</span>")
  59. }
  60. if($data.orgSize) {
  61. switch($data.orgSize) {
  62. case '1':
  63. oguimo = "50人以内";
  64. break;
  65. case '2':
  66. oguimo = "50-100人";
  67. break;
  68. case '3':
  69. oguimo = "100-200人";
  70. break;
  71. case '4':
  72. oguimo = "200-500人";
  73. break;
  74. case '5':
  75. oguimo = "500-1000人";
  76. break;
  77. default:
  78. oguimo = "1000人以上";
  79. break;
  80. }
  81. $("#cmpBasic").append("<span>" + oguimo + "</span>")
  82. }
  83. if($data.foundTime) {
  84. var oTime = timeGeshi($data.foundTime);
  85. $("#cmpBasic").append("<span>" + oTime + "</span>")
  86. }
  87. }
  88. },
  89. error: function(XMLHttpRequest, textStats, errorThrown) {
  90. $.MsgBox.Alert('提示', '服务器请求失败')
  91. }
  92. })
  93. }
  94. /*时间格式转换*/
  95. function timeGeshi(otm) {
  96. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  97. return otme;
  98. }
  99. companyInformation();
  100. /*获取所有的企业认证用户*/
  101. function companyUser() {
  102. $.ajax({
  103. url: "/ajax/professor/qaOrgAuth",
  104. type: "GET",
  105. timeout: 10000,
  106. dataType: "json",
  107. data: {
  108. "orgId": id,
  109. "orgAuth": 1
  110. },
  111. beforeSend: function() {},
  112. success: function(data, textState) {
  113. if(data.success) {
  114. console.log(data);
  115. var $info = data.data;
  116. userHtml($info);
  117. }
  118. },
  119. error: function(XMLHttpRequest, textStats, errorThrown) {
  120. $.MsgBox.Alert('提示', '服务器请求失败')
  121. }
  122. })
  123. }
  124. companyUser();
  125. function userHtml(arr) {
  126. for(var i = 0; i < arr.length; i++) {
  127. var tiof = "",
  128. img;
  129. if(arr[i].hasHeadImage) {
  130. img = "/images/head/" + arr[i].id + "_l.jpg";
  131. } else {
  132. img = "../images/default-photo.jpg"
  133. }
  134. var oString = '<dd>'
  135. oString += '<div style="width: 60px;">'
  136. oString += '<img class="headRadius" src="' + img + '" width="100%" />'
  137. oString += '<div class="h4Font"><span>' + arr[i].name + '</span></div></div></dd>'
  138. $("#userList").append(oString);
  139. }
  140. }
  141. /*企业需求*/
  142. function companyDemand() {
  143. $.ajax({
  144. url: "/ajax/demand/pqOrg",
  145. type: "GET",
  146. timeout: 10000,
  147. dataType: "json",
  148. data: {
  149. "orgId": id,
  150. "demandStatus": 1,
  151. 'pageSize': 3
  152. },
  153. beforeSend: function() {},
  154. success: function(data, textState) {
  155. if(data.success) {
  156. console.log(data);
  157. var $info = data.data.data;
  158. companyDemandHtml($info);
  159. }
  160. },
  161. error: function(XMLHttpRequest, textStats, errorThrown) {
  162. $.MsgBox.Alert('提示', '服务器请求失败')
  163. }
  164. })
  165. }
  166. /*企业需求html*/
  167. function companyDemandHtml(arr) {
  168. for(var i = 0; i < arr.length; i++) {
  169. var tiof = "",
  170. img, oTime;
  171. if(arr[i].professor.hasHeadImage) {
  172. img = "/images/head/" + arr[i].professor.id + "_l.jpg";
  173. } else {
  174. img = "../images/default-photo.jpg"
  175. }
  176. if(arr[i].demandAim == 1) {
  177. tiof = "技术咨询";
  178. } else if(arr[i].demandAim == 2) {
  179. tiof = "寻找资源";
  180. } else if(arr[i].demandAim == 3) {
  181. tiof = "其他需求";
  182. }
  183. if(arr[i].createTime) {
  184. oTime = arr[i].createTime.substring(0, 4) + '年' + arr[i].createTime.substring(4, 6) + "月" + arr[i].createTime.substring(6, 8) + "日 " + arr[i].createTime.substring(8, 10) + ":" + arr[i].createTime.substring(10, 12)
  185. }
  186. var ostring = '<li>'
  187. ostring += '<div class="leftlogo floatL">'
  188. ostring += '<img class="headRadius" src="' + img + '" />'
  189. ostring += '<div class="h4Font"><span>' + arr[i].professor.name + '</span></div></div>'
  190. ostring += '<div class="rightinfo floatL">'
  191. ostring += '<p class="h3Font fontweight ellipsisSty">' + arr[i].demandTitle + '</p>'
  192. ostring += '<p class="h5Font"><span>' + tiof + '</span>-<span>' + oTime + '</span></p></div></li>'
  193. $(".needUlist").append(ostring);
  194. }
  195. }
  196. companyDemand();
  197. })