list.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div id="policy">
  3. <rencailist-detail
  4. @handleCurrentChange="handleCurrentChange"
  5. :contentList="contentList"
  6. :total="total"
  7. :columnName="columnName"
  8. @fetch="fetchInfo"
  9. :display="display"
  10. :policyInfo="policyInfo"
  11. ></rencailist-detail>
  12. </div>
  13. </template>
  14. <script>
  15. import rencailistDetail from '@/components/personnel/rencailistDetail.vue';
  16. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  17. import _ from 'loadsh';
  18. const { mapActions: talentExperts } = createNamespacedHelpers('talentExperts');
  19. export default {
  20. name: 'policy',
  21. props: {},
  22. components: {
  23. rencailistDetail,
  24. },
  25. data: () => ({
  26. policyInfo: {},
  27. display: 'list',
  28. columnName: '',
  29. contentList: [],
  30. total: 1,
  31. skip: '',
  32. tableData: {},
  33. }),
  34. async created() {
  35. this.search();
  36. },
  37. computed: {
  38. ...mapState(['user']),
  39. },
  40. methods: {
  41. ...talentExperts({ list: 'query', fetch: 'fetch' }),
  42. async search({ skip = 0, limit = 10 } = {}) {
  43. skip = this.skip;
  44. const res = await this.list({ skip, limit });
  45. console.log(res.data);
  46. console.log(res.data);
  47. for (const val of res.data) {
  48. if (val.totaltype == 0) {
  49. }
  50. }
  51. this.$set(this, `contentList`, res.data);
  52. this.$set(this, `total`, res.total);
  53. },
  54. async fetchInfo(id) {
  55. this.$router.push({ path: '/personnel/rencai', query: { id: id } });
  56. },
  57. async handleCurrentChange({ skip, limit, currentPage }) {
  58. this.$set(this, `skip`, skip);
  59. this.search();
  60. },
  61. },
  62. };
  63. </script>
  64. <style lang="scss" scoped></style>