index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="normal-card">
  3. <search @searchActive="searchActive" @clearData="clearData" v-if="tool.checkAuth($route.name,'read')"></search>
  4. <div class="content">
  5. <list :list="list" v-if="tool.checkAuth($route.name,'read')"></list>
  6. <div class="page">
  7. <pagination :total="total"
  8. :pageSize="param.content.pageSize"
  9. :currentPage="param.content.pageNumber"
  10. @pageChange="pageChange">
  11. </pagination>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import Pagination from '@/components/pagination/Pagination'
  18. import List from '@/SManagement/notice/compoents/list'
  19. import search from '@/components/search/index'
  20. export default {
  21. name: "Index",
  22. data() {
  23. return {
  24. param:{
  25. "accesstoken": "2686aade24d20b15bbaa177dc35e638c",
  26. "classname": "saletool.notice.notice",
  27. "method": "queryNoticeList",
  28. "content": {
  29. "nocache": true,
  30. "pageNumber": 1,
  31. "pageSize": 10,
  32. "where":{
  33. "condition":""
  34. }
  35. }
  36. },
  37. searchTitle: '',
  38. list:[],
  39. total:0,
  40. currentPage:0,
  41. };
  42. },
  43. components: {
  44. Pagination,
  45. List,
  46. search,
  47. },
  48. created() {
  49. this.getNoticeData()
  50. },
  51. mounted() {},
  52. methods: {
  53. //获取通告列表
  54. getNoticeData() {
  55. this.$api.requested(this.param).then(res =>{
  56. this.list = res.data
  57. this.total = res.total
  58. })
  59. },
  60. pageChange(val) {
  61. this.param.content.pageNumber = val
  62. this.getNoticeData()
  63. },
  64. searchActive(data) {
  65. if(!data) return
  66. this.param.content.where.condition = data.trim()
  67. this.$api.requested(this.param).then(res =>{
  68. this.list = res.data
  69. this.total = res.total
  70. })
  71. },
  72. clearData() {
  73. this.param.content.where.condition = ''
  74. this.getNoticeData()
  75. },
  76. }
  77. };
  78. </script>
  79. <style scoped>
  80. *{
  81. box-sizing: border-box;
  82. }
  83. .normal-card {
  84. min-height: 100%;
  85. padding: 20px 0 50px 30px;
  86. font-family: PingFang SC-Regular;
  87. }
  88. .normal-card .search {
  89. width: 320px;
  90. height: 36px;
  91. }
  92. .el-pagination {
  93. position: absolute;
  94. right: 16px;
  95. bottom: 0;
  96. }
  97. </style>