You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

141 lines
3.1 KiB

  1. <template>
  2. <view class="page">
  3. <view class="mainpage" :class="sideOpen ? 'show' : ''" style="padding-top: 40px;">
  4. <!-- <l-customlist-banner></l-customlist-banner> -->
  5. <view class="records">共 {{ records }} 条数据</view>
  6. <l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="data">
  7. <l-customlist :tips="loadState" showTips>
  8. <view></view>
  9. <view class="pageBox customlist-item" showDelete="true" v-for="(item, ind) in data" :key="item.ALTId">
  10. <view class="">
  11. <text>课程:</text>
  12. {{ item.LessonName }}【{{ item.LessonNo }}】
  13. </view>
  14. <view class="">
  15. <text>总课时:</text>
  16. {{ item.lessoncount }}
  17. </view>
  18. <view class="">
  19. <text>系数:</text>
  20. {{ item.coefficient }}
  21. </view>
  22. <view class="">
  23. <text>工作量:</text>
  24. {{ item.lessoncount }}
  25. </view>
  26. </view>
  27. </l-customlist>
  28. </l-scroll-list>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. user: null,
  37. data: [],
  38. total: 1,
  39. records: 0,
  40. ready: false,
  41. page: 1,
  42. rows: 10,
  43. multipleData: null,
  44. sideOpen: false,
  45. loadState: '向下翻以加载更多'
  46. };
  47. },
  48. methods: {
  49. init() {
  50. // 拉取加载列表和数据源
  51. Promise.all([() => {}]);
  52. var _this = this;
  53. this.user = this.GET_GLOBAL('loginUser');
  54. this.fetchList();
  55. this.ready = true;
  56. },
  57. // 拉取列表
  58. async fetchList() {
  59. if (this.page > this.total) {
  60. return;
  61. }
  62. let _this = this;
  63. let _postParam = {
  64. pagination: {
  65. rows: _this.rows,
  66. page: _this.page,
  67. sidx: 'LessonNo',
  68. sord: 'asc'
  69. },
  70. queryJson: '{}'
  71. };
  72. _this.LOADING('加载数据中…')
  73. _this.HTTP_GET('learun/EducationalAdministration/TeacherWorkload/pagelist', _postParam, '加载数据时出错').then(res => {
  74. _this.HIDE_LOADING();
  75. // console.log(res);
  76. this.data = this.data.concat(res.rows);
  77. _this.total = res.total;
  78. _this.records = res.records;
  79. this.page = res.page + 1;
  80. this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多';
  81. console.log(_this.data);
  82. });
  83. },
  84. // 列表下拉
  85. pullDown() {
  86. this.refreshList().then(() => {
  87. this.$refs.data.stopPullDown();
  88. });
  89. },
  90. async refreshList() {
  91. this.page = 1;
  92. this.total = 1;
  93. this.data = [];
  94. this.fetchList();
  95. }
  96. },
  97. created() {
  98. this.init();
  99. }
  100. };
  101. </script>
  102. <style lang="less" scoped>
  103. @import '~@/common/css/sidepage.less';
  104. @import '~@/common/css/customlist.less';
  105. .page {
  106. background-color: #fff;
  107. }
  108. .page-content {
  109. margin-top: 39px;
  110. }
  111. .records {
  112. color: #8f8f94;
  113. background: #ffffff;
  114. padding: 10px 12px;
  115. width: 100%;
  116. vertical-align: middle;
  117. border-bottom: 0.5px solid #ddd;
  118. position: fixed;
  119. top: var(--window-top);
  120. z-index: 1024;
  121. border-bottom: 0.5px solid #ddd;
  122. height: 40px;
  123. width: 100%;
  124. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  125. // background: #f1f1f1;
  126. }
  127. .pageBox {
  128. // margin-top: 34px;
  129. padding: 5px 15px;
  130. line-height: 24px;
  131. border-bottom: 5px solid #f5f5f5;
  132. color: #333;
  133. }
  134. .pageBox text{
  135. margin-right: 5px;
  136. }
  137. </style>