index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <template>
  2. <div id="home">
  3. <el-row :span="24" class="tit">
  4. <h4>企业工作台</h4>
  5. </el-row>
  6. <el-row class="homeMain">
  7. <el-col class="homeEnr">
  8. <div style="font-size:20px;">
  9. 校招
  10. </div>
  11. <ul class="homeEnrUl">
  12. <li>
  13. <a href="">
  14. <span>
  15. <em class="number number_s">{{ totalRow }}</em>
  16. <strong class="title">入驻学校</strong>
  17. </span>
  18. </a>
  19. </li>
  20. </ul>
  21. </el-col>
  22. <el-col class="homeRec">
  23. <div style="font-size:20px;">
  24. 招聘
  25. </div>
  26. <ul class="homeEnrUl homeRecUl">
  27. <li>
  28. <a href="">
  29. <span>
  30. <em class="number number_s">{{ totalRowPost }}</em>
  31. <strong class="title">招聘职位数</strong>
  32. </span>
  33. </a>
  34. </li>
  35. <!-- <li>
  36. <a href="">
  37. <span>
  38. <em class="number number_s">60</em>
  39. <strong class="title">职位阅读数</strong>
  40. </span>
  41. </a>
  42. </li> -->
  43. <li>
  44. <a href="">
  45. <span>
  46. <em class="number number_s">{{ totalRowResume }}</em>
  47. <strong class="title">接受简历数</strong>
  48. </span>
  49. </a>
  50. </li>
  51. <!-- <li>
  52. <a href="">
  53. <span>
  54. <em class="number number_s">4</em>
  55. <strong class="title">企业人才库</strong>
  56. </span>
  57. </a>
  58. </li> -->
  59. <li>
  60. <a href="">
  61. <span>
  62. <em class="number number_s">{{ totalGuanzhu }}</em>
  63. <strong class="title">关注数</strong>
  64. </span>
  65. </a>
  66. </li>
  67. </ul>
  68. </el-col>
  69. </el-row>
  70. <el-row class="homeMessage" style="margin-bottom:1rem;">
  71. <el-col class="homeResTop">
  72. <h4>待办事项</h4>
  73. <a href=""></a>
  74. </el-col>
  75. <ul class="homeMessageMain">
  76. <el-table :data="noticeList" border :max-height="200">
  77. <el-table-column width="800">
  78. <template slot-scope="scoped">
  79. {{ scoped.row.name }} {{ scoped.row.content }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center">
  83. <template slot-scope="scoped">
  84. <el-link type="primary" @click="handleDelete(scoped.row.id)">[不再提示]</el-link>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. </ul>
  89. </el-row>
  90. <el-row class="homeRes">
  91. <el-col class="homeResTop">
  92. <h4>最新简历</h4>
  93. <a href="">换一换</a>
  94. </el-col>
  95. <ul class="homeResMain">
  96. <li v-for="(item, index) in resumeList" :key="index" :type="item.type" @click="checkResume(item.id)">
  97. <el-col class="homeResMainImg">
  98. <img :src="item.avatar_url" style="max-height: 120px" width="100" height="100" />
  99. </el-col>
  100. <el-col class="homeResMainTit">
  101. <p class="text-owt">
  102. <span>{{ item.info.xm }}</span>
  103. <span>{{ item.info.xb }}</span>
  104. <span> {{ item.info.xl }}</span>
  105. <span>{{ item.info.yx }}</span>
  106. </p>
  107. <p class="text-owt">
  108. 专业:<span>{{ item.info.zy }}</span>
  109. </p>
  110. <p class="text-owt">
  111. 求职意向:<span>{{ item.expect.job }}</span>
  112. <span>{{ item.expect.city }}</span>
  113. <span> {{ item.expect.salary }}</span>
  114. </p>
  115. </el-col>
  116. </li>
  117. </ul>
  118. </el-row>
  119. <el-row class="homeMessage" style="margin-bottom:1rem">
  120. <el-col class="homeResTop">
  121. <h4>系统消息</h4>
  122. <a href=""></a>
  123. </el-col>
  124. <ul class="homeMessageMain">
  125. <li v-for="(tag, index) in resumeListSys" :key="index" :type="tag.type">
  126. <el-col class="MessageMainTit text-owt">
  127. {{ tag.message }}
  128. </el-col>
  129. <el-col class="MessageMainDay text-owt">
  130. {{ tag.day }}
  131. </el-col>
  132. </li>
  133. </ul>
  134. </el-row>
  135. <el-dialog title="简历详情" center :visible.sync="resumeDialog" :fullscreen="true">
  136. <resumes :info="info"></resumes>
  137. </el-dialog>
  138. </div>
  139. </template>
  140. <script>
  141. import resumes from '@publics/src/views/resume.vue';
  142. import { mapActions, mapState } from 'vuex';
  143. export default {
  144. name: 'home',
  145. components: {
  146. resumes,
  147. },
  148. data: () => ({
  149. resumeDialog: false,
  150. resumeList: [],
  151. totalRow: 0,
  152. totalRowPost: 0,
  153. totalRowResume: 0,
  154. totalGuanzhu: 0,
  155. resumeListSys: [],
  156. info: {},
  157. noticeList: [],
  158. }),
  159. created() {
  160. this.search();
  161. this.getNoticeList();
  162. },
  163. computed: {
  164. ...mapState(['user']),
  165. },
  166. methods: {
  167. ...mapActions(['resumesOperation', 'lettersOperation', 'corpSchInfo', 'postOperation', 'stucorpOperation', 'noticeOperation']),
  168. async search(searchInfo) {
  169. //1直接拿着参数发送请求
  170. let result = await this.lettersOperation({ type: 'list', data: { corpname: this.user.corpname } });
  171. if (`${result.errcode}` === '0') {
  172. //给this=>vue的实例下在中的list属性,赋予result.data的值
  173. this.$set(this, `totalRowResume`, result.total);
  174. } else {
  175. this.$message.error(result.errmsg ? result.errmsg : 'error');
  176. }
  177. result = await this.stucorpOperation({ type: 'list', data: { corpid: this.user.corpid } });
  178. if (`${result.errcode}` === '0') {
  179. //给this=>vue的实例下在中的list属性,赋予result.data的值
  180. this.$set(this, `totalGuanzhu`, result.total);
  181. } else {
  182. this.$message.error(result.errmsg ? result.errmsg : 'error');
  183. }
  184. result = await this.resumesOperation({ type: 'list', data: { ...searchInfo, year: new Date().getFullYear() } });
  185. if (`${result.errcode}` === '0') {
  186. let arr = [];
  187. result.data.forEach(async val => {
  188. let result = await this.resumesOperation({ type: 'search', data: { id: val.id } });
  189. let object = { ...val, avatar_url: result.data.avatar_url };
  190. // let object = { ...val, list: result.data };
  191. arr.push(object);
  192. });
  193. //给this=>vue的实例下在中的list属性,赋予result.data的值
  194. this.$set(this, `resumeList`, arr);
  195. } else {
  196. this.$message.error(result.errmsg ? result.errmsg : 'error');
  197. }
  198. result = await this.corpSchInfo({ type: 'list', data: { corpid: this.user.corpid } });
  199. if (`${result.errcode}` === '0') {
  200. this.$set(this, `totalRow`, result.data.length);
  201. } else {
  202. this.$message.error(result.errmsg ? result.errmsg : 'error');
  203. }
  204. result = await this.postOperation({ type: 'list', data: { corpid: this.user.corpid } });
  205. if (`${result.errcode}` === '0') {
  206. this.$set(this, `totalRowPost`, result.total);
  207. } else {
  208. this.$message.error(result.errmsg ? result.errmsg : 'error');
  209. }
  210. },
  211. async checkResume(id) {
  212. let result = await this.resumesOperation({ type: 'search', data: { id: id } });
  213. if (`${result.errcode}` === '0') {
  214. this.$set(this, `info`, result.data);
  215. this.resumeDialog = true;
  216. }
  217. },
  218. async getNoticeList() {
  219. let result = await this.noticeOperation({ type: 'list', data: { userid: this.user.corpid, type: 1 } });
  220. if (`${result.errcode}` === '0') {
  221. this.$set(this, `noticeList`, result.data ? result.data : []);
  222. }
  223. },
  224. async noticeDelete(id) {
  225. let result = await this.noticeOperation({ type: 'delete', data: { id: id } });
  226. if (`${result.errcode}` === '0') {
  227. this.getNoticeList();
  228. }
  229. },
  230. },
  231. };
  232. </script>
  233. <style lang="less" scoped>
  234. /deep/.el-dialog__body {
  235. padding: 0;
  236. }
  237. /deep/.has-gutter {
  238. display: none;
  239. }
  240. .tit h4 {
  241. color: #333;
  242. font-size: 15px;
  243. font-weight: 500;
  244. margin: 0;
  245. margin: 20px 0;
  246. }
  247. ul {
  248. margin: 0;
  249. padding: 0;
  250. }
  251. li {
  252. list-style: none;
  253. }
  254. a {
  255. text-decoration: none;
  256. }
  257. p {
  258. margin: 0;
  259. padding: 0;
  260. }
  261. h4 {
  262. margin: 0;
  263. }
  264. .text-owt {
  265. overflow: hidden;
  266. white-space: nowrap;
  267. text-overflow: ellipsis;
  268. }
  269. .homeMain {
  270. float: left;
  271. width: 100%;
  272. height: 140px;
  273. }
  274. .homeEnr {
  275. text-align: center;
  276. width: 18%;
  277. display: inline-block;
  278. background-color: #7cbae5;
  279. border: 1px solid #6eb0dd;
  280. color: #fff;
  281. margin-right: 19px;
  282. }
  283. .homeEnrUl {
  284. overflow: hidden;
  285. display: block;
  286. padding: 0;
  287. padding-bottom: 26px;
  288. margin: 0;
  289. }
  290. .homeEnrUl li {
  291. float: left;
  292. display: block;
  293. color: #fff;
  294. width: 100%;
  295. height: 75px;
  296. }
  297. .homeRecUl li {
  298. float: left;
  299. display: block;
  300. color: #fff;
  301. width: 20%;
  302. height: 75px;
  303. }
  304. .homeEnrUl li a {
  305. color: #fff;
  306. }
  307. .homeEnrUl li a span {
  308. display: block;
  309. border-left: 1px solid #6fa7ce;
  310. }
  311. .homeRecUl li a span {
  312. display: block;
  313. border-left: 1px solid #57c78b;
  314. }
  315. .homeEnrUl li a span .number {
  316. margin-left: 5px;
  317. font-weight: 400;
  318. font-style: normal;
  319. vertical-align: middle;
  320. font-size: 35px;
  321. line-height: 60px;
  322. }
  323. .homeEnrUl li a span .number_s {
  324. font-size: 16px;
  325. }
  326. .homeEnrUl li a span .title {
  327. display: block;
  328. font-weight: 400;
  329. font-style: normal;
  330. font-size: 16px;
  331. letter-spacing: 2px;
  332. margin-top: -10px;
  333. }
  334. .homeRec {
  335. text-align: center;
  336. width: 79%;
  337. display: inline-block;
  338. background-color: #60d295;
  339. border: 1px solid #60d295;
  340. color: #fff;
  341. margin-bottom: 15px;
  342. }
  343. .homeRes {
  344. float: left;
  345. width: 100%;
  346. border: 1px solid #ccc;
  347. margin: 0 0 20px 0;
  348. }
  349. .homeResTop {
  350. width: 100%;
  351. height: 39px;
  352. background: #f4f5fa;
  353. border-bottom: 1px solid #ccc;
  354. }
  355. .homeResTop h4 {
  356. float: left;
  357. width: 50%;
  358. padding: 10px;
  359. font-size: 14px;
  360. color: #333;
  361. font-weight: 500;
  362. }
  363. .homeResTop a {
  364. float: right;
  365. text-align: right;
  366. width: 45%;
  367. padding: 10px;
  368. font-size: 14px;
  369. color: #337ab7;
  370. }
  371. .homeResTop a:hover {
  372. color: #23527c;
  373. text-decoration: underline;
  374. }
  375. .homeResMain {
  376. float: left;
  377. width: 100%;
  378. height: 387px;
  379. overflow: hidden;
  380. }
  381. .homeResMain li {
  382. float: left;
  383. width: 452px;
  384. height: 87px;
  385. padding: 20px 8px 20px 20px;
  386. color: #333;
  387. font-size: 14px;
  388. background: #fff;
  389. border-top: 1px solid #ccc;
  390. border-bottom: 1px solid #ccc;
  391. }
  392. .homeResMain li:hover {
  393. background: #f5f5f5;
  394. }
  395. .homeResMainImg {
  396. float: left;
  397. width: 80px;
  398. height: 80px;
  399. border-radius: 90px;
  400. }
  401. .homeResMainImg img {
  402. border-radius: 90px;
  403. }
  404. .homeResMainTit {
  405. float: left;
  406. width: 350px;
  407. height: 88px;
  408. padding: 0 0 0 30px;
  409. }
  410. .homeResMainTit p {
  411. font-size: 16px;
  412. color: #333;
  413. line-height: 27px;
  414. }
  415. .homeResMainTit p span {
  416. padding: 0 10px 0 0;
  417. }
  418. .homeMessage {
  419. float: left;
  420. width: 100%;
  421. border: 1px solid #ccc;
  422. }
  423. .homeMessageMain {
  424. float: left;
  425. width: 100%;
  426. height: 246px;
  427. overflow: hidden;
  428. }
  429. .homeMessageMain li {
  430. float: left;
  431. width: 100%;
  432. height: 39px;
  433. border-top: 1px solid #ccc;
  434. border-bottom: 1px solid #ccc;
  435. background: #fff;
  436. }
  437. .homeMessageMain li:hover {
  438. background: #f5f5f5;
  439. }
  440. .homeMessageMain li .MessageMainTit {
  441. float: left;
  442. width: 763px;
  443. height: 39px;
  444. padding: 10px;
  445. font-size: 14px;
  446. color: #333;
  447. font-weight: 500;
  448. }
  449. .homeMessageMain li .MessageMainDay {
  450. float: right;
  451. width: 140px;
  452. padding: 10px;
  453. font-size: 14px;
  454. color: #999;
  455. font-weight: 500;
  456. }
  457. </style>