Nofind.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="page-table-template" style='display: flex;flex-direction: column;flex-grow: 1;flex-shrink: 1;'>
  3. <div class='data-table'>
  4. <el-table :data='tableData' style='width: 100%;' v-loading='loading' height="100%">
  5. <el-table-column header-align='center' align='center' prop='BuildName' label='建筑' width="150"></el-table-column>、
  6. <el-table-column header-align='center' align='center' prop='floorName' label='楼层' width="80"></el-table-column>
  7. <el-table-column header-align='center' align='center' prop='PointName' label='点位标签名称'>
  8. <template slot-scope='scope'>
  9. <span>{{scope.row.PointName || '--'}}</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column header-align='center' align='center' prop='FamilyName' label='设备族'></el-table-column>
  13. <el-table-column header-align='center' align='center' label='本地编码' width='250'>
  14. <template slot-scope='scope'>
  15. <span>{{scope.row.Infos.EquipLocalID || scope.row.Infos.EquipID || '--'}}</span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column header-align='center' align='center' prop='FmName' label='本地名称'></el-table-column>
  19. <el-table-column header-align='center' align='center' prop='PointName' label='操作' width='150'>
  20. <template slot-scope='scope'>
  21. <el-button type='primary' plain size='mini' @click='look(scope.row)'>查看</el-button>
  22. <el-button type='danger' plain size='mini' @click='del(scope.row)'>删除</el-button>
  23. </template>
  24. </el-table-column>
  25. </el-table>
  26. </div>
  27. <base-pagination class='data-table-pagination' style="text-align:right;" :currentPages='pageNum' :total='total' @pageChanged='pageChanged'></base-pagination>
  28. <saga-dialog ref='dialog' :iframeSrc='iframeSrc'></saga-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import { mapGetters } from 'vuex'
  33. import SagaDialog from './Frame'
  34. //api
  35. import {
  36. getErrAssets, //获取异常资产type不同不同tab
  37. delErrAssets
  38. } from '@/api/scan/request'
  39. export default {
  40. name: 'nofind',
  41. data() {
  42. return {
  43. loading: false,
  44. tableData: [],
  45. total: 0,
  46. pageNum: 1,
  47. pageSize: 50,
  48. iframeSrc: ''
  49. }
  50. },
  51. props: {
  52. buildVlaue: {
  53. default: ''
  54. },
  55. floorsObj: {
  56. default: {}
  57. }
  58. },
  59. components: {
  60. SagaDialog
  61. },
  62. computed: {
  63. ...mapGetters('layout', ['projectId', 'userId', 'secret'])
  64. },
  65. methods: {
  66. look(row) {
  67. this.iframeSrc =
  68. process.env.BASE_URL +
  69. ':8889/#/details?perjectId=' +
  70. this.projectId +
  71. '&secret=' +
  72. this.secret +
  73. '&FmId=' +
  74. row.FmId +
  75. '&type=1&code=' +
  76. row.Family
  77. this.$refs['dialog'].show()
  78. },
  79. del(row) {
  80. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  81. confirmButtonText: '确定',
  82. cancelButtonText: '取消',
  83. type: 'warning'
  84. })
  85. .then(() => {
  86. let param = {
  87. ProjId: this.projectId,
  88. UserId: this.userId
  89. }
  90. let paramList = [row.FmId]
  91. delErrAssets(param, paramList).then(result => {
  92. if (result.data.Result == 'success') {
  93. this.getAsset()
  94. this.$message({
  95. message: '删除成功',
  96. type: 'success'
  97. })
  98. }
  99. })
  100. })
  101. .catch(() => {
  102. this.$message({
  103. type: 'info',
  104. message: '已取消删除'
  105. })
  106. })
  107. },
  108. pageChanged(page, size) {
  109. this.pageNum = page
  110. this.pageSize = size
  111. this.getAsset()
  112. },
  113. getAsset() {
  114. this.loading = true
  115. let param = {
  116. BuildId: this.buildVlaue || undefined,
  117. PageNum: this.pageNum,
  118. PageSize: this.pageSize,
  119. Type: 1,
  120. ProjId: this.projectId,
  121. UserId: this.userId
  122. }
  123. getErrAssets(param).then(res => {
  124. if (res.data.Result == 'success') {
  125. this.loading = false
  126. let list = res.data.FmList
  127. list.forEach((ele, index) => {
  128. ele.floorName = this.floorsObj[ele.FloorId] || '--'
  129. })
  130. this.tableData = list
  131. this.total = res.data.Count
  132. }
  133. })
  134. }
  135. },
  136. watch: {
  137. buildVlaue() {
  138. this.getAsset()
  139. }
  140. }
  141. }
  142. </script>
  143. <style scoped lang='less'>
  144. </style>