portal html css js resource

cmp-workspaces.js 5.7KB

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