portal html css js resource

cmp-workspaces.js 5.8KB

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