NoMap.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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%' border 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='300'>
  20. <template slot-scope='scope'>
  21. <el-button type='primary' plain size='mini' @click='look(scope.row)'>&nbsp;&nbsp;&nbsp;查看&nbsp;&nbsp;&nbsp;</el-button>
  22. <el-button type='primary' plain size='mini' @click='add(scope.row)'>添加岗位</el-button>
  23. <el-button type='danger' plain size='mini' @click='del(scope.row)'>&nbsp;&nbsp;&nbsp;删除&nbsp;&nbsp;&nbsp;</el-button>
  24. </template>
  25. </el-table-column>
  26. </el-table>
  27. </div>
  28. <base-pagination class='data-table-pagination' style="text-align:right;" :currentPages='pageNum' :total='total' @pageChanged='pageChanged'></base-pagination>
  29. <!-- component -->
  30. <saga-dialog ref='dialog' :iframeSrc='iframeSrc'></saga-dialog>
  31. <saga-station ref='station' :options='options' :itemObj='itemObj' @refresh='refresh'></saga-station>
  32. </div>
  33. </template>
  34. <script>
  35. import { mapGetters } from 'vuex'
  36. import SagaDialog from './Frame'
  37. import SagaStation from './Station'
  38. //api
  39. import {
  40. getErrAssets, //获取异常资产type不同不同tab
  41. delErrAssets
  42. } from '@/api/scan/request'
  43. export default {
  44. name: 'nomap',
  45. data() {
  46. return {
  47. loading: false,
  48. tableData: [],
  49. total: 0,
  50. pageNum: 1,
  51. pageSize: 50,
  52. iframeSrc: '',
  53. options: [],
  54. itemObj:{}
  55. }
  56. },
  57. props: {
  58. buildVlaue: {
  59. default: ''
  60. },
  61. floorsObj: {
  62. default: {}
  63. },
  64. allFamilyObj: {
  65. default: {}
  66. }
  67. },
  68. components: {
  69. SagaDialog,
  70. SagaStation
  71. },
  72. computed: {
  73. ...mapGetters('layout', ['projectId', 'userId', 'secret'])
  74. },
  75. methods: {
  76. look(row) {
  77. this.iframeSrc =
  78. process.env.BASE_URL +
  79. ':8889/#/details?perjectId=' +
  80. this.projectId +
  81. '&secret=' +
  82. this.secret +
  83. '&FmId=' +
  84. row.FmId +
  85. '&type=1&code=' +
  86. row.Family
  87. this.$refs['dialog'].show()
  88. },
  89. add(row) {
  90. this.options = this.allFamilyObj[row.Family].content
  91. this.itemObj = row
  92. this.$refs['station'].show()
  93. },
  94. del(row) {
  95. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  96. confirmButtonText: '确定',
  97. cancelButtonText: '取消',
  98. type: 'warning'
  99. })
  100. .then(() => {
  101. let param = {
  102. ProjId: this.projectId,
  103. UserId: this.userId
  104. }
  105. let paramList = [row.FmId]
  106. delErrAssets(param, paramList).then(result => {
  107. if (result.data.Result == 'success') {
  108. this.getAsset()
  109. this.$message({
  110. message: '删除成功',
  111. type: 'success'
  112. })
  113. }
  114. })
  115. })
  116. .catch(() => {
  117. this.$message({
  118. type: 'info',
  119. message: '已取消删除'
  120. })
  121. })
  122. },
  123. refresh() {
  124. this.getAsset()
  125. },
  126. pageChanged(page, size) {
  127. this.pageNum = page
  128. this.pageSize = size
  129. this.getAsset()
  130. },
  131. getAsset() {
  132. this.loading = true
  133. let param = {
  134. BuildId: this.buildVlaue || undefined,
  135. PageNum: this.pageNum,
  136. PageSize: this.pageSize,
  137. Type: 3,
  138. ProjId: this.projectId,
  139. UserId: this.userId
  140. }
  141. getErrAssets(param).then(res => {
  142. if (res.data.Result == 'success') {
  143. this.loading = false
  144. let list = res.data.FmList
  145. list.forEach((ele, index) => {
  146. ele.floorName = this.floorsObj[ele.FloorId] || '--'
  147. })
  148. this.tableData = list
  149. this.total = res.data.Count
  150. console.log("nomap")
  151. console.log(this.tableData)
  152. }
  153. })
  154. }
  155. },
  156. watch: {
  157. buildVlaue() {
  158. this.getAsset()
  159. }
  160. }
  161. }
  162. </script>
  163. <style scoped lang='less'>
  164. </style>