mixins.blade.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @include('public.admin.box-item')
  2. <style>
  3. [v-cloak]{display: none;}
  4. body{
  5. background-color: #eff3f6;
  6. }
  7. .all{
  8. margin-bottom: 80px;
  9. }
  10. .fixed {
  11. width: calc(100% - 250px);
  12. padding: 7px;
  13. padding-top: 10px;
  14. position: fixed;
  15. bottom: 0px;
  16. z-index: 199;
  17. box-sizing: border-box;
  18. box-shadow: 0px -1px 10px rgb(0 0 0 / 10%);
  19. margin-left: -14px;
  20. background-color: #fff;
  21. border-radius: 20px 20px 0 0;
  22. }
  23. .fixed_box {
  24. height: 60px;
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. }
  29. .el-table td, .el-table th.is-leaf{
  30. text-align: center;
  31. }
  32. </style>
  33. <script>
  34. let tableMixins = {
  35. el:"#app",
  36. delimiters: ['[[', ']]'],
  37. data(){
  38. return {
  39. tablePage: 1,
  40. tablePageSizes:[10,20,30],
  41. tableTotal: 0,
  42. tablePageSize: 10,
  43. tableData: [],
  44. searchInfo: {},
  45. tableLoading:false,
  46. last_page:"",
  47. }
  48. },
  49. created(){
  50. this.getTableData();
  51. },
  52. methods:{
  53. getTableData(json){
  54. if(this.last_page == this.tablePage){
  55. this.$message.error("已经是最后一页了");
  56. return false;
  57. }
  58. this.tableLoading = true;
  59. this.$http.post(this.tableUrl, {data:json || {}}).then(({data:{result,msg,data}})=>{
  60. this.tableLoading = false;
  61. if (result == 1) {
  62. this.tableTotal = data.total;
  63. this.last_page = data.last_page;
  64. this.tableData = data.data;
  65. }else{
  66. this.$message.error(msg || "");
  67. }
  68. })
  69. },
  70. tablePageFun(){
  71. let search = this.search || {};
  72. search.page = this.tablePage;
  73. return search;
  74. },
  75. searchVal(){
  76. this.last_page = "";
  77. this.tablePage = 1;
  78. this.getTableData(this.tablePageFun());
  79. },
  80. handleSizeChange(val){
  81. console.log("duoshanye",val);
  82. },
  83. handleCurrentChange(val){
  84. this.tablePage = val;
  85. this.getTableData(this.tablePageFun());
  86. },
  87. }
  88. }
  89. </script>