overview.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="page-wrap">
  3. <el-row class="tool-bar">
  4. <el-col :span="12" class="left">
  5. <div class="content-title">
  6. 设备管理
  7. </div>
  8. </el-col>
  9. <el-col :span="12" class="right">
  10. <el-input v-model="conditions.goafDevName" class="search-input m-right-15" placeholder="请输入设备名称">
  11. <el-button slot="append" icon="el-icon-search" @click="getData()" />
  12. </el-input>
  13. </el-col>
  14. </el-row>
  15. <el-card class="statistics-wrap">
  16. <div slot="header" class="clearfix">
  17. <span>设备当前状态统计</span>
  18. </div>
  19. <div class="overview-status-wrap">
  20. <overview-status />
  21. </div>
  22. </el-card>
  23. <el-row class="m-top-15">
  24. <el-table v-loading="listLoading" class="page-table" border fit :data="dataList">
  25. <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
  26. <el-table-column prop="goafDevName" label="设备名称" />
  27. <el-table-column label="安装区域">
  28. <template v-slot="{row}">
  29. <span>{{ NumConvertLM(row.goafOrebelt) }}-{{ row.goafOrebody }}-{{ row.goafOreheight }}-{{ row.goafName }}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="goafDevLocation" label="安装地点" />
  33. <el-table-column prop="goafDevTypename" label="设备类型" />
  34. <el-table-column prop="goafDevGroupname" label="设备负责人部门" />
  35. <el-table-column prop="goafDevAccountName" label="设备责任人" />
  36. <el-table-column prop="goafAlarmThreshold" label="告警阈值 " />
  37. <el-table-column prop="goafInstallTime" label="安装时间" />
  38. </el-table>
  39. <div class="pagination-container" style="float:right;margin-right:40px;">
  40. <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
  41. </div>
  42. </el-row>
  43. </div>
  44. </template>
  45. <script>
  46. import { getSensor } from '@/api/goaf/sensor'
  47. import { Pagination } from '@/components'
  48. import { NumConvertLM } from '@/utils'
  49. import OverviewStatus from './components/OverviewStatus'
  50. export default {
  51. components: { Pagination, OverviewStatus },
  52. data() {
  53. return {
  54. dataList: [],
  55. total: 0,
  56. listLoading: false,
  57. conditions: {
  58. page: 1,
  59. limit: 10,
  60. goafDevName: ''
  61. }
  62. }
  63. },
  64. created() {
  65. this.getData()
  66. },
  67. methods: {
  68. // fetch data
  69. NumConvertLM,
  70. getData() {
  71. this.listLoading = true
  72. getSensor(this.conditions).then((resp) => {
  73. this.listLoading = false
  74. const { code, msg, data } = resp
  75. if (code === 0) {
  76. const start = (this.conditions.page - 1) * this.conditions.limit
  77. const end = this.conditions.page * this.conditions.limit
  78. const dataList = data.filter((item) => item.goafDevTypename.includes('传感器'))
  79. this.dataList = dataList.filter((item, index) => index >= start && index < end)
  80. this.total = dataList.length
  81. } else {
  82. this.$message.error(msg)
  83. }
  84. }).catch((error) => {
  85. console.log(error)
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .page-wrap{
  93. min-height:90vh;
  94. padding: 15px;
  95. background-color: #071A29;
  96. .statistics-wrap{
  97. background-color:#113144;
  98. margin-top:5px;
  99. .overview-status-wrap{
  100. width:500px;
  101. height:300px;
  102. }
  103. }
  104. }
  105. </style>