notice-pop-list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div class="notice-pop-list">
  3. <ul class="npl-box">
  4. <li v-for="(item, index) in listData" :key="index" @click="gotoDetail(item)">
  5. <div class="nplb-l">
  6. <div class="nplb-type">【通知】</div>
  7. <div class="nplb-icon"></div>
  8. <div class="nplb-title">
  9. {{ item.title }}
  10. </div>
  11. </div>
  12. <div class="nplb-r">
  13. {{ item.sendTime }}
  14. </div>
  15. </li>
  16. </ul>
  17. <el-pagination
  18. background
  19. class="smp-pagination"
  20. layout="prev, pager, next"
  21. :pager-count="5"
  22. :page-size="pagingConfig.perPageNum"
  23. :total="pagingConfig.totalNum"
  24. @current-change="pagingChange"
  25. >
  26. </el-pagination>
  27. <el-dialog
  28. title="详情"
  29. :visible.sync="dialogVisible"
  30. width="30%"
  31. :modal-append-to-body="true"
  32. :append-to-body="true">
  33. <div class="npl-detail">
  34. <div class="npld-summary">{{detail}}</div>
  35. </div>
  36. </el-dialog>
  37. </div>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. // config: {
  43. // default () {
  44. // return {}
  45. // }
  46. // }
  47. },
  48. data () {
  49. return {
  50. didNum: '',
  51. listData: [],
  52. url: 'http://124.225.17.80:8146/odae/clue/supervisionTask/pressTaskList',
  53. pagingConfig: {
  54. perPageNum: 10,
  55. totalNum: 0,
  56. currentPage: 1
  57. },
  58. dialogVisible: false,
  59. detail: {}
  60. }
  61. },
  62. mounted () {
  63. // this.getData()
  64. },
  65. methods: {
  66. getData () {
  67. this.getList(this.didNum)
  68. },
  69. getList () {
  70. this.$http.get(
  71. '/sys/notice/list'
  72. ).then(({ data: res }) => {
  73. if (res.code !== 0) {
  74. return this.$message.error(res.msg)
  75. }
  76. this.setData(res.noticeList)
  77. }).catch(() => {
  78. })
  79. },
  80. pagingChange (num) {
  81. this.pagingConfig.currentPage += 1
  82. this.getData()
  83. },
  84. setData (d) {
  85. this.listData = d.map((e) => {
  86. return {
  87. ...e
  88. }
  89. })
  90. // this.listData
  91. },
  92. gotoDetail (item) {
  93. this.getDetail(item)
  94. // this.dialogVisible = true
  95. // this.detail = item
  96. // console.log(item.id)
  97. // if (this.didNum === 0) {
  98. // this.pressRead(item)
  99. // }
  100. },
  101. getDetail (item) {
  102. this.$http.get(
  103. '/sys/notice/detail',
  104. {
  105. params: {
  106. id: item.id
  107. }
  108. }
  109. ).then(({ data: res }) => {
  110. if (res.code !== 0) {
  111. return this.$message.error(res.msg)
  112. }
  113. this.dialogVisible = true
  114. this.detail = res.detail
  115. }).catch(() => {})
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .smp-list-time {
  122. // padding: 0!important;
  123. }
  124. </style>