index.vue 2.2 KB

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