recruit.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. $(function() {
  2. //公共属性
  3. var constant={};
  4. var common={};
  5. import('./constant.js').then(model=>{
  6. constant=model.default
  7. console.log(constant)
  8. jobFairScreenData()
  9. })
  10. function jobFairScreenData(){
  11. var jobFairId=1;
  12. $.post(constant.serverUrl+"jobFairScreenData",{
  13. jobFairId:jobFairId
  14. },function(data,status){
  15. console.log(data,status)
  16. $(".data-jobFair-name").text(data.data.jobFair.name)
  17. $(".data-jobFair-name-start-end").text("开始日期:"+data.data.jobFair.startTime+" 至 "+data.data.jobFair.endTime)
  18. $(".data-jobFair-introduce").text(data.data.jobFair.introduce)
  19. if(data.data.jobFair.videoUrl){
  20. $(".jobFair-img").remove()
  21. $(".jobFair-video").show()
  22. $(".jobFair-video").attr("src",data.data.jobFair.videoUrl);
  23. }else if(data.data.jobFair.imgUrls){
  24. $(".jobFair-video").remove()
  25. $(".jobFair-img").show()
  26. $(".jobFair-img").attr("src",data.data.jobFair.imgUrls);
  27. }else{
  28. $(".jobFair-video").remove()
  29. $(".jobFair-img").remove()
  30. }
  31. $(".data-jobFairCompanyList-length").text(data.data.jobFairCompanyList.length)
  32. $(".data-recruitmentNum").text(data.data.recruitmentNum)
  33. $(".data-totalNum").text(data.data.totalNum)
  34. $(".data-recruitsNum").text(data.data.recruitsNum)
  35. $(".data-todayNum").text(data.data.todayNum)
  36. $(".data-resumeNum").text(data.data.resumeNum)
  37. for(var i in data.data.jobFairCompanyList){
  38. var obj=data.data.jobFairCompanyList[i];
  39. $(".data-jobFairCompanyList").append("<tr> <td>"+obj.companyName+"</td> <td>"+obj.recruitmentNums+"</td> <td>"+obj.num+"</td></tr>")
  40. }
  41. })
  42. }
  43. function createBar2() {
  44. var chartDom = document.getElementById('main2');
  45. var myChart = echarts.init(chartDom);
  46. var option;
  47. option = {
  48. legend: {
  49. top:300,
  50. left:20,
  51. textStyle:{
  52. fontSize: 16,
  53. color: '#fff',
  54. },
  55. data: ['入场人数', '浏览人数', '投递人数']
  56. },
  57. color: [
  58. '#4e6eac',
  59. '#6895f7',
  60. '#8aadf9',
  61. ],
  62. xAxis: { show: false },
  63. yAxis: { show: false, type: 'category', inverse: true, min: 0, max: 6 },
  64. series: [
  65. {
  66. type: 'funnel',
  67. minSize: 50,
  68. maxSize: '100%',
  69. left: '4%',
  70. top: 0,
  71. bottom: 50,
  72. gap: 2,
  73. label: {
  74. position: 'inside',
  75. fontFamily: 'Microsoft YaHei',
  76. fontSize: 16,
  77. color: '#fff',
  78. formatter: '{c}%',
  79. rich: { xx: { padding: [6, 0] } }
  80. },
  81. data: [
  82. { value: 100, name: '入场人数' },
  83. { value: 80, name: '浏览人数' },
  84. { value: 20, name: '投递人数' },
  85. ]
  86. },
  87. ]
  88. };
  89. option && myChart.setOption(option);
  90. }
  91. function createBar3() {
  92. var chartDom = document.getElementById('main3');
  93. var myChart = echarts.init(chartDom);
  94. var option;
  95. option = {
  96. tooltip: {
  97. trigger: 'axis'
  98. },
  99. grid:{
  100. x:50,y:30,x2:40,y2:30,
  101. },
  102. textStyle: {
  103. color: '#cccccc',
  104. fontSize: 20
  105. },
  106. xAxis: {
  107. type: 'category',
  108. boundaryGap: false,
  109. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Sun2',]
  110. },
  111. yAxis: {
  112. type: 'value',
  113. },
  114. series: [
  115. {
  116. data: [null,120, 932, 901, 934, 1290, 1330, 1320],
  117. type: 'line',
  118. areaStyle: {}
  119. }
  120. ]
  121. };
  122. option && myChart.setOption(option);
  123. }
  124. function createBar4() {
  125. var chartDom = document.getElementById('main4');
  126. var myChart = echarts.init(chartDom);
  127. var option;
  128. option = {
  129. textStyle: {
  130. color: '#cccccc',
  131. fontSize: 20
  132. },
  133. grid: {
  134. left: '3%',
  135. right: '4%',
  136. bottom: '3%',
  137. containLabel: true
  138. },
  139. xAxis: {
  140. type: 'category',
  141. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  142. },
  143. yAxis: {
  144. type: 'value'
  145. },
  146. series: [
  147. {
  148. data: [120, 200, 150, 80, 70, 110, 130],
  149. type: 'bar'
  150. }
  151. ]
  152. };
  153. option && myChart.setOption(option);
  154. }
  155. function createBar1(title, data, clickEvent) {
  156. var chartDom = document.getElementById('main1');
  157. var myChart = echarts.init(chartDom);
  158. var option;
  159. option = {
  160. title:[
  161. {
  162. text: '求职者性别分布',
  163. left:'8%',//居中显示
  164. top:'80%',//底部显示
  165. textStyle: {
  166. color: '#cccccc',
  167. fontSize: 20
  168. }
  169. },
  170. {
  171. text: '求职者年龄分布',
  172. left:'43%',//居中显示
  173. top:'80%',//底部显示
  174. textStyle: {
  175. color: '#cccccc',
  176. fontSize: 20
  177. }
  178. },
  179. {
  180. text: '求职者学历分布',
  181. left:'73%',//居中显示
  182. top:'80%',//底部显示
  183. textStyle: {
  184. color: '#cccccc',
  185. fontSize: 20
  186. }
  187. }],
  188. dataset: [
  189. {
  190. source: [
  191. ['Product', 'Sales', 'Price', 'Year'],
  192. ['啊大', 123, 32, 2011],
  193. ['中砂', 231, 14, 2011],
  194. ['豆腐', 235, 5, 2011],
  195. ['米有', 341, 25, 2011],
  196. ['碧霞', 122, 29, 2011],
  197. ['啊大', 143, 30, 2012],
  198. ['中砂', 201, 19, 2012],
  199. ['豆腐', 255, 7, 2012],
  200. ['米有', 241, 27, 2012],
  201. ['碧霞', 102, 34, 2012],
  202. ['啊大', 153, 28, 2013],
  203. ['中砂', 181, 21, 2013],
  204. ['豆腐', 395, 4, 2013],
  205. ['米有', 281, 31, 2013],
  206. ['碧霞', 92, 39, 2013],
  207. ['啊大', 223, 29, 2014],
  208. ['中砂', 211, 17, 2014],
  209. ['豆腐', 345, 3, 2014],
  210. ['米有', 211, 35, 2014],
  211. ['碧霞', 72, 24, 2014]
  212. ]
  213. },
  214. {
  215. transform: {
  216. type: 'filter',
  217. config: { dimension: 'Year', value: 2011 }
  218. }
  219. },
  220. {
  221. transform: {
  222. type: 'filter',
  223. config: { dimension: 'Year', value: 2012 }
  224. }
  225. },
  226. {
  227. transform: {
  228. type: 'filter',
  229. config: { dimension: 'Year', value: 2013 }
  230. }
  231. }
  232. ],
  233. series: [
  234. {
  235. type: 'pie',
  236. label: {
  237. normal: {
  238. textStyle : {
  239. color: '#cccccc',
  240. fontSize : '12px'
  241. },
  242. },
  243. },
  244. radius:[40, 60],
  245. datasetIndex: 1
  246. },
  247. {
  248. label: {
  249. normal: {
  250. textStyle : {
  251. color: '#cccccc',
  252. fontSize : '12px'
  253. },
  254. },
  255. },
  256. type: 'pie',
  257. radius:[40, 60],
  258. datasetIndex: 2
  259. },
  260. {
  261. label: {
  262. normal: {
  263. textStyle : {
  264. color: '#cccccc',
  265. fontSize : '12px'
  266. },
  267. },
  268. },
  269. type: 'pie',
  270. radius:[40, 60],
  271. datasetIndex: 3
  272. }
  273. ],
  274. // Optional. Only for responsive layout:
  275. media: [
  276. {
  277. query: { minAspectRatio: 1 },
  278. option: {
  279. series: [
  280. { center: ['18%', '50%'] },
  281. { center: ['50%', '50%'] },
  282. { center: ['82%', '50%'] }
  283. ]
  284. }
  285. },
  286. {
  287. option: {
  288. series: [
  289. { center: ['50%', '25%'] },
  290. { center: ['50%', '50%'] },
  291. { center: ['50%', '75%'] }
  292. ]
  293. }
  294. }
  295. ]
  296. };
  297. option && myChart.setOption(option);
  298. }
  299. createBar1();
  300. createBar2();
  301. createBar3();
  302. createBar4();
  303. })