NoMap.vue 5.7 KB

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