list.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div id="list">
  3. <el-row>
  4. <el-col :span="1"><i class="el-icon-s-home"></i></el-col>
  5. <el-col :span="23" style="margin-top:0.3rem">
  6. <el-breadcrumb separator=">">
  7. <el-breadcrumb-item :to="{ path: '/' }"><span style="color:#666666">网站首页</span></el-breadcrumb-item>
  8. <el-breadcrumb-item>
  9. <a href="/"><span style="color:#666666">招聘信息</span></a>
  10. </el-breadcrumb-item>
  11. <el-breadcrumb-item><span style="color:#999999">岗位</span></el-breadcrumb-item>
  12. </el-breadcrumb>
  13. </el-col>
  14. </el-row>
  15. <el-row>
  16. <el-col :span="10" style="margin-top: 1rem; width:50%">
  17. <el-input size="mini" placeholder="请输入企业名称" v-model="searchInfo.corpname" @keyup.enter.native="search()">
  18. <el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
  19. </el-input>
  20. </el-col>
  21. </el-row>
  22. <el-row class="rowstyle" v-for="(item, index) in list" :key="index">
  23. <el-col :span="3">
  24. <div class="block"><el-avatar shape="square" :size="75" :src="squareUrl"></el-avatar></div>
  25. </el-col>
  26. <el-col :span="10" class="info">
  27. <el-row>
  28. <el-col :span="24">
  29. <el-link class="title" @click="$router.push({ path: '/jobs/detail', query: { id: item.id } })">
  30. {{ item.job_name }}
  31. </el-link>
  32. </el-col>
  33. <el-col class="money" :span="24">{{ item.salary.text }}</el-col>
  34. <el-col class="word" :span="24">
  35. <span>{{ item.city }}/{{ item.xl_req }}/{{ item.job_number }}人</span>
  36. </el-col>
  37. </el-row>
  38. </el-col>
  39. <el-col :span="11" class="info">
  40. <el-row>
  41. <el-col class="word" :span="24">{{ item.corpname }}</el-col>
  42. <el-col class="word" :span="24">{{ item.category }}</el-col>
  43. <el-col class="word" :span="24">
  44. {{ item.end_date }}
  45. </el-col>
  46. </el-row>
  47. </el-col>
  48. </el-row>
  49. <el-row style="margin-top:1rem;" type="flex" justify="end">
  50. <el-pagination @current-change="search" :current-page="currentPage" :page-size="$limit" layout="total, prev, pager, next, jumper" :total="totalRow">
  51. </el-pagination>
  52. </el-row>
  53. </div>
  54. </template>
  55. <script>
  56. import { mapActions, mapState } from 'vuex';
  57. export default {
  58. name: 'list',
  59. props: {},
  60. components: {},
  61. data: () => ({
  62. squareUrl: '',
  63. searchInfo: {},
  64. currentPage: 1,
  65. totalRow: 0,
  66. list: [],
  67. type: '',
  68. }),
  69. created() {
  70. this.search();
  71. },
  72. computed: {},
  73. methods: {
  74. ...mapActions(['postOperation']),
  75. async search(page) {
  76. let skip = 0;
  77. if (page) {
  78. skip = (page - 1) * this.$limit;
  79. }
  80. let newData = { skip: skip, limit: this.$limit, ...this.searchInfo }; //schid: 99991,
  81. this.type === 'official' ? (newData['is_practice'] = 0) : (newData['is_practice'] = 1);
  82. let result = await this.postOperation({ type: 'list', data: newData });
  83. if (`${result.errcode}` === '0') {
  84. //给this=>vue的实例下在中的list属性,赋予result.data的值
  85. this.$set(this, `list`, result.data);
  86. this.$set(this, `totalRow`, result.total);
  87. } else {
  88. this.$message.error(result.errmsg ? result.errmsg : 'error');
  89. }
  90. },
  91. },
  92. beforeRouteUpdate(to, from, next) {
  93. this.$set(this, `type`, to.params.type);
  94. this.search();
  95. next();
  96. },
  97. };
  98. </script>
  99. <style lang="less" scoped>
  100. .rowstyle {
  101. border-bottom-style: solid;
  102. border-width: 1px;
  103. border-color: #ebeef5;
  104. font-size: small;
  105. padding: 1rem 0;
  106. .el-col {
  107. margin-top: 0.5rem;
  108. }
  109. .info {
  110. .title {
  111. font-size: 1rem;
  112. color: #850000;
  113. }
  114. .money {
  115. font-size: 0.9rem;
  116. color: #f40;
  117. }
  118. .word {
  119. font-size: 0.85rem;
  120. color: #666666;
  121. }
  122. }
  123. }
  124. </style>