index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div>
  3. <el-drawer
  4. title="我是标题"
  5. :visible.sync="drawer"
  6. :with-header="false"
  7. direction="rtl"
  8. size="600px"
  9. append-to-body
  10. @close="closeDrawer">
  11. <div>
  12. <router-view/>
  13. </div>
  14. </el-drawer>
  15. <normalLayout class="normal-card" @onRefresh="getSubmitEditAction">
  16. <div slot="content" class="container">
  17. <time-select @timeChange="timeChange" @clearSelect="clearSelect" v-if="tool.checkAuth($route.name,'read')"></time-select>
  18. <list :list="oneData" type="more" v-if="tool.checkAuth($route.name,'read')"></list>
  19. <!--分页-->
  20. <pagination :total="total" :pageSize="param.content.pageSize" :currentPage="param.content.pageNumber" @pageChange="pageChange">
  21. </pagination>
  22. </div>
  23. </normalLayout>
  24. </div>
  25. </template>
  26. <script>
  27. import {mapGetters} from 'vuex'
  28. import Pagination from '@/components/pagination/Pagination'
  29. import SelectPanl from '@/SManagement/submitedit_one/components/SelectPanl'
  30. import TimeSelect from '@/SManagement/submitedit_one/components/TimeSelect'
  31. import list from '@/SManagement/submitedit_one/components/list'
  32. export default {
  33. name: 'index',
  34. data () {
  35. return {
  36. param: {
  37. "id":20221102094702,
  38. "content": {
  39. "nocache":true,
  40. "onceonly":0,
  41. "pageNumber": 1,
  42. "pageSize": 4,
  43. "where":{
  44. "begdate":"",
  45. "enddate":""
  46. }
  47. }
  48. },
  49. oneData:[],
  50. total: 0,
  51. drawer:false
  52. }
  53. },
  54. components: {
  55. Pagination,
  56. SelectPanl,
  57. list,
  58. TimeSelect
  59. },
  60. computed: {
  61. ...mapGetters({
  62. DrawerShow:'DrawerShow'
  63. })
  64. },
  65. watch: {
  66. $route (val) {
  67. if (val.path == '/submitedit_more') {
  68. this.getSubmitEditAction()
  69. }
  70. },
  71. DrawerShow (val) {
  72. val ? this.drawer = true : this.drawer = false
  73. }
  74. },
  75. created () {
  76. this.getSubmitEditAction()
  77. },
  78. methods: {
  79. closeDrawer () {
  80. this.$store.dispatch('DrawerShowChange',false)
  81. this.$router.back()
  82. },
  83. //获取所有一事一报
  84. async getSubmitEditAction () {
  85. let res = await this.$api.requested(this.param)
  86. this.oneData = res.data
  87. this.total = res.total
  88. },
  89. pageChange (n) {
  90. this.param.content.pageNumber = n
  91. this.getSubmitEditAction()
  92. },
  93. timeChange(time) {
  94. this.param.content.where.begdate = time[0]
  95. this.param.content.where.enddate = time[1]
  96. this.param.content.pageNumber = 1
  97. this.getSubmitEditAction()
  98. },
  99. clearSelect() {
  100. this.param.content.where.begdate = ''
  101. this.param.content.where.enddate = ''
  102. this.param.content.pageNumber = 1
  103. this.getSubmitEditAction()
  104. }
  105. },
  106. };
  107. </script>
  108. <style scoped>
  109. * {
  110. box-sizing: border-box;
  111. }
  112. .container {
  113. min-height: calc(100vh - 200px);
  114. }
  115. .normal-card {
  116. min-height: calc(100vh - 136px);
  117. padding: 0 20px 30px 10px;
  118. position: relative;
  119. }
  120. .el-pagination {
  121. position: absolute;
  122. right: 16px;
  123. bottom: 0;
  124. }
  125. /deep/.el-empty {
  126. position: absolute;
  127. left: 50%;
  128. top: 50%;
  129. transform: translate(-50%,-50%);
  130. }
  131. </style>