Nofind.vue 5.2 KB

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