versionMessage.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="versionMessage">
  3. <div class="title">窍笔撰写辅助软件历史更新记录</div>
  4. <div class="infinite-list-wrapper">
  5. <ul
  6. class="list"
  7. v-infinite-scroll="load"
  8. infinite-scroll-disabled="disabled">
  9. <li v-for="item in versionList" :key="item.id" class="list-item">
  10. <div class="num">版本号:{{ item.versionNum }}</div>
  11. <div class="time">更新日期:{{ item.publishTime }}</div>
  12. <div class="remark">
  13. <div>更新要点</div>
  14. <div v-if="item.remark">{{ item.remark }}</div>
  15. <div v-else class="wu">无</div>
  16. </div>
  17. </li>
  18. </ul>
  19. <p v-if="loading">加载中...</p>
  20. <p v-if="noMore">没有更多了</p>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. components: {},
  27. props: {},
  28. data () {
  29. return {
  30. versionList: [],
  31. queryParams:{
  32. current:0,
  33. size:10,
  34. status: "3"
  35. },
  36. loading: false,
  37. noMore:false
  38. }
  39. },
  40. watch: {},
  41. computed: {
  42. disabled () {
  43. return this.loading || this.noMore
  44. }
  45. },
  46. mounted() {},
  47. methods: {
  48. load () {
  49. this.loading = true
  50. this.queryParams.current += 1
  51. this.$api.getVersionList(this.queryParams).then(response=>{
  52. if(response.code == 200){
  53. this.versionList.push(...response.data.records)
  54. if(this.versionList.length == response.data.total){
  55. this.noMore = true
  56. }
  57. this.loading = false
  58. }
  59. }).catch(error=>{
  60. this.loading = false
  61. })
  62. }
  63. },
  64. };
  65. </script>
  66. <style lang="scss" scoped>
  67. .versionMessage{
  68. width: 50%;
  69. height: calc(100% - 30px);
  70. margin: auto;
  71. display: flex;
  72. align-items: center;
  73. flex-direction: column;
  74. box-shadow: 0 0 10px rgb(102, 102, 102);
  75. border-radius: 8px;
  76. padding: 10px 15px;
  77. text-align: left;
  78. .title{
  79. font-size: 18px;
  80. font-weight: bold;
  81. width: 100%;
  82. }
  83. .infinite-list-wrapper{
  84. width: 100%;
  85. overflow:auto;
  86. height: calc(100vh - 280px);
  87. div{
  88. padding: 5px 0;
  89. font-weight: bold;
  90. }
  91. .num{
  92. color:red;
  93. }
  94. .wu{
  95. color: rgb(170, 163, 163);
  96. font-size: 15px;
  97. font-weight: normal;
  98. }
  99. }
  100. }
  101. </style>