mealcenterlist.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>数据监控</title>
  8. <link rel="stylesheet" href="/static/js/node_modules/element-ui/lib/theme-chalk/index.css">
  9. <style>
  10. body,html,*{
  11. padding: 0px;
  12. margin: 0px;
  13. }
  14. body {
  15. /* 加载背景图 */
  16. background-image: url("/static/public/kjbg.jpg");
  17. /* 背景图垂直、水平均居中 */
  18. background-position: center center;
  19. /* 背景图不平铺 */
  20. background-repeat: no-repeat;
  21. /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
  22. background-attachment: fixed;
  23. /* 让背景图基于容器大小伸缩 */
  24. background-size: cover;
  25. /* 设置背景颜色,背景图加载过程中会显示背景色 */
  26. background-color: #5d9fbc;
  27. padding: 1em;
  28. }
  29. header{
  30. width: 100%;
  31. display: flex;
  32. flex-direction: row;
  33. gap:1em;
  34. }
  35. header .title{
  36. text-align: center;
  37. width: 100%;
  38. color: #fff;
  39. letter-spacing:1em;
  40. margin-bottom: 1em;
  41. }
  42. .el-table, .el-table__expanded-cell,.el-table th.el-table__cell{
  43. background-color: rgba(255, 255, 255, 0.4);
  44. color: #000;
  45. }
  46. .el-table tr{
  47. background:transparent ;
  48. color: #fff;
  49. }
  50. .el-table tr:hover{
  51. color: #000;
  52. }
  53. .el-pagination__total{
  54. color: #fff;
  55. }
  56. .el-pagination {
  57. display: flex;
  58. justify-content: center;
  59. }
  60. .block{
  61. margin-top: 1em;
  62. }
  63. .el-table__empty-text{
  64. color: #fff;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div id="app">
  70. <header class="">
  71. <h1 class="title">易益康养数据监控</h1>
  72. </header>
  73. <div>
  74. <el-table :data="tableData" style="width: 100%" :border="tableborder" :empty-text="emptytext">
  75. <el-table-column prop="name_center" label="日间照料中心名称" ></el-table-column>
  76. <el-table-column prop="mocount" label="套餐订单量"></el-table-column>
  77. <el-table-column prop="sacount" label="家政服务订单量"></el-table-column>
  78. <el-table-column prop="vcount" label="到访量"></el-table-column>
  79. <el-table-column prop="acount" label="常规业务量"></el-table-column>
  80. </el-table>
  81. <div class="block">
  82. <el-pagination
  83. @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage1"
  84. :page-sizes="pagesizes" :page-size="size"
  85. layout="sizes,total,prev, pager, next" :total="total"></el-pagination>
  86. </div>
  87. </div>
  88. </div>
  89. <script src="/static/js/vue.js"></script>
  90. <script src="/static/js/node_modules/element-ui/lib/index.js"></script>
  91. <script src="/static/js/jquery-3.4.1.min.js"></script>
  92. <script>
  93. var app = new Vue({
  94. el: '#app',
  95. data: {
  96. tableborder:false,
  97. tableData:[],
  98. total:0,
  99. currentPage1:1,
  100. size:10,
  101. pagesizes:[10, 50, 100, 150],
  102. emptytext:'加载中'
  103. },
  104. methods:{
  105. getlist(){
  106. var url="/index.php/api/statistics/getmealcenterlist";
  107. var that =this
  108. var param= {page:this.currentPage1,size:this.size}
  109. $.post(url,param,function(res){
  110. res= JSON.parse(res)
  111. //console.log(res)
  112. if(res.code!=200){
  113. that.$notify({
  114. title: '失败',
  115. message: res.msg,
  116. type: 'error'
  117. });
  118. }else{
  119. that.$notify({
  120. title: '成功',
  121. message: res.msg,
  122. type: 'success'
  123. });
  124. var data = res.data
  125. that.currentPage1=data.page
  126. that.size =data.size
  127. that.total =data.count
  128. that.tableData = data.list
  129. }
  130. },'json')
  131. },
  132. handleSizeChange(val){
  133. this.size = val
  134. this.currentPage1 =1
  135. this.getlist()
  136. },
  137. handleCurrentChange(val){
  138. this.currentPage1 = val
  139. this.getlist()
  140. },
  141. },
  142. created(){
  143. this.getlist()
  144. var intid = setInterval(()=>{this.getlist()},30000)
  145. //this.getlist()
  146. }
  147. })
  148. </script>
  149. </body>
  150. </html>