index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="uni-app">
  3. <view class="status-bar" />
  4. <view class="main-container">
  5. <wk-nav-bar title="公告" />
  6. <view class="move-area">
  7. <wk-scroll-view
  8. v-if="!refreshPage"
  9. :status="listStatus"
  10. class="list-scroll"
  11. @refresh="getList({}, true)"
  12. @loadmore="getList()">
  13. <notice-item
  14. v-for="(item, index) in listData"
  15. :key="index"
  16. :item-data="item" />
  17. </wk-scroll-view>
  18. </view>
  19. </view>
  20. <wk-drag-button
  21. v-if="showAddBtn"
  22. @click="handleAdd">
  23. <view class="wk-drag-btn">
  24. <text class="wk wk-plus icon" />
  25. </view>
  26. </wk-drag-button>
  27. </view>
  28. </template>
  29. <script>
  30. import {QueryList} from 'API/oa/notice'
  31. import NoticeItem from './components/noticeItem'
  32. import mainListMixins from '@/mixins/mainList.js'
  33. export default {
  34. name: 'NoticeIndex',
  35. components: {
  36. NoticeItem
  37. },
  38. mixins: [mainListMixins],
  39. data() {
  40. return {
  41. GetListFn: QueryList,
  42. refreshPage: false,
  43. }
  44. },
  45. computed: {
  46. showAddBtn() {
  47. return this.$auth('oa.announcement.save')
  48. }
  49. },
  50. onLoad() {
  51. this.getList()
  52. },
  53. onShow() {
  54. if (this.refreshPage) {
  55. this.refreshPage = false
  56. this.getList({}, true)
  57. }
  58. },
  59. methods: {
  60. handleAdd() {
  61. this.$Router.navigateTo('/pages_oa/notice/add')
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .main-container {
  68. display: flex;
  69. flex-direction: column;
  70. overflow: hidden;
  71. .move-area {
  72. width: 100%;
  73. flex: 1;
  74. padding: 20rpx 0;
  75. overflow: hidden;
  76. .list-scroll {
  77. width: 100%;
  78. height: 100%;
  79. .notice-item:last-child {
  80. ::v-deep .wk-list-item::after {
  81. display: none;
  82. }
  83. }
  84. }
  85. }
  86. }
  87. </style>