UpdateStatView.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="common-layout">
  3. <el-container>
  4. <el-header
  5. style="height: 250px; background-color: rgba(255,0,0,50%); display: flex; flex-direction: column; justify-content: center; align-items: center;">
  6. <div class="demo-image" style="text-align: center;"> <!-- 注意这里添加了 text-align: center; 但对于块级元素这不是必需的 -->
  7. <img src="../assets/pji-logo.jpg" alt="" style="max-width: 100%; height: auto;">
  8. <!-- 推荐使用 max-width 保持图片比例 -->
  9. </div>
  10. </el-header>
  11. <el-main style="background-color:white;">
  12. <el-breadcrumb separator="/" style="margin-bottom: 10px;">
  13. <el-breadcrumb-item :to="{ path: '/' }">主页</el-breadcrumb-item>
  14. <el-breadcrumb-item>地图更新统计</el-breadcrumb-item>
  15. </el-breadcrumb>
  16. <div class="topbar">
  17. <el-form style=" background-color: rgba(0,0,0,0%);" :inline="true" :model="queryLine"
  18. class="demo-form-inline">
  19. <el-form-item label="设备名称">
  20. <el-input v-model="queryLine.equipmentName" placeholder="请输入设备名称" clearable/>
  21. </el-form-item>
  22. <el-form-item label="设备类型">
  23. <el-input v-model="queryLine.equipmentTypeName" placeholder="请输入设备类型" clearable/>
  24. </el-form-item>
  25. <div style="float: right">
  26. <el-form-item >
  27. <el-button type="danger" @click="onSubmit">查询</el-button>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button type="danger" @click="onSubmit">重置</el-button>
  31. </el-form-item>
  32. </div>
  33. </el-form>
  34. </div>
  35. <el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="tableData"
  36. fixed ref="multipleTableRef" :cell-style="{ textAlign: 'center'}" :header-cell-style="{ textAlign: 'center'}">
  37. <el-table-column type="selection" width="55"/>
  38. <el-table-column prop="equipmentName" label="设备名称"/>
  39. <el-table-column prop="equipmentTypeName" label="设备类型"/>
  40. <el-table-column prop="mapId" label="地图id"/>
  41. <el-table-column prop="originalPgm" label="原始pgm"/>
  42. <el-table-column prop="updateTime" label="地图更新时间"/>
  43. <el-table-column prop="cumulativeUpdateRate" label="累积地图更新率"/>
  44. <el-table-column prop="currentPgm" label="当前pgm"/>
  45. </el-table>
  46. <p></p> <!--空行-->
  47. <el-pagination
  48. v-model:current-page="currentPage"
  49. v-model:page-size="pageSize"
  50. :page-sizes="[10]"
  51. :small="small"
  52. :disabled="disabled"
  53. :background="true"
  54. layout="total, sizes, prev, pager, next, jumper"
  55. :total="total"
  56. @size-change="handleSizeChange"
  57. @current-change="handleCurrentChange"
  58. />
  59. <!-- <el-pagination background layout="prev, pager, next" :total="1000"/>-->
  60. </el-main>
  61. <!-- <el-footer style="background-color: rgba(255,0,0,99%)">国家智能网联汽车创新中心</el-footer>-->
  62. </el-container>
  63. </div>
  64. </template>
  65. <script lang="ts" setup>
  66. import {onBeforeMount, reactive, ref} from "vue";
  67. import axios from "axios";
  68. import {ElTable} from "element-plus";
  69. const multipleTableRef = ref<InstanceType<typeof ElTable>>
  70. const queryLine = reactive({
  71. dataName: '',
  72. equipmentName: '',
  73. equipmentTypeName: '',
  74. })
  75. const onSubmit = () => {
  76. page()
  77. }
  78. let total = ref(0)
  79. let tableData = ref([]);
  80. onBeforeMount(() => {
  81. page()
  82. })
  83. function page() {
  84. axios.get('http://1.202.169.139:8081/open/scene/list?equipmentType=YI_DAO_JI_QI_REN&page=' + currentPage.value + '&size=' + pageSize.value,
  85. {
  86. headers: {
  87. "Authorization": "4773hd92ysj54paflw2jem3onyhywxt2"
  88. }
  89. }
  90. ).then(function (response) {
  91. tableData.value = response.data.data.content
  92. total.value = response.data.data.totalElements
  93. // total.value = tableData.value.length
  94. // console.log(tableData);
  95. // console.log(response.data.data);
  96. }).catch(function (error) {
  97. console.log(error);
  98. });
  99. }
  100. const currentPage = ref(1)
  101. const pageSize = ref(10)
  102. const small = ref(false)
  103. const disabled = ref(false)
  104. const handleSizeChange = (val: number) => {
  105. pageSize.value = val
  106. page()
  107. if (tableData.value.length == 0) {
  108. page()
  109. }
  110. }
  111. const handleCurrentChange = (val: number) => {
  112. currentPage.value = val
  113. page()
  114. }
  115. </script>
  116. <style scoped>
  117. .demo-pagination-block + .demo-pagination-block {
  118. margin-top: 10px;
  119. }
  120. .demo-pagination-block .demonstration {
  121. margin-bottom: 16px;
  122. }
  123. .demo-form-inline .el-input {
  124. --el-input-width: 200px;
  125. }
  126. .demo-form-inline .el-select {
  127. --el-select-width: 400px;
  128. }
  129. .demo-image .block {
  130. padding: 30px 0;
  131. text-align: center;
  132. border-right: solid 1px var(--el-border-color);
  133. display: inline-block;
  134. width: 20%;
  135. box-sizing: border-box;
  136. vertical-align: top;
  137. }
  138. .demo-image .block:last-child {
  139. border-right: none;
  140. }
  141. .demo-image .demonstration {
  142. display: block;
  143. color: var(--el-text-color-secondary);
  144. font-size: 14px;
  145. margin-bottom: 20px;
  146. }
  147. .topbar {
  148. margin-bottom: 15px;
  149. }
  150. /* 假设 .el-pager__item 是分页按钮的类名,这可能需要你根据实际的 Element UI 版本和源码进行调整 */
  151. .el-pager__item {
  152. background-color: rgba(255, 0, 0, 50%) !important; /* 修改背景色 */
  153. color: #fff; /* 可能需要修改文本颜色以在红色背景上可见 */
  154. border-color: transparent; /* 如果需要,修改边框颜色 */
  155. }
  156. /* 修改当前选中页码的按钮样式 */
  157. .el-pager__item.is-active {
  158. background-color: rgba(255, 0, 0, 70%) !important; /* 选中时的背景色 */
  159. color: #fff; /* 选中时的文本颜色 */
  160. }
  161. </style>