Noverify.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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='FamilyName' label='设备族'></el-table-column>
  7. <el-table-column header-align='center' align='center' prop='FmId' label='本地编码' width='250'></el-table-column>
  8. <el-table-column header-align='center' align='center' prop='FmName' label='本地名称'></el-table-column>
  9. <el-table-column header-align='center' align='center' prop='FmName' label='所在元空间'></el-table-column>
  10. <el-table-column header-align='center' align='center' prop='FmName' label='对应设备类'></el-table-column>
  11. <el-table-column header-align='center' align='center' prop='bimXY' label='BIM模型中坐标'></el-table-column>
  12. <el-table-column header-align='center' align='center' prop='PointName' label='操作' width='220'>
  13. <template slot-scope='scope'>
  14. <el-button type='primary' plain size='mini' @click='look(scope.row)'>查看</el-button>
  15. <el-button type='primary' plain size='mini' @click='post(scope.row)'>岗位</el-button>
  16. <el-button type='danger' plain size='mini' @click='del(scope.row)'>删除</el-button>
  17. </template>
  18. </el-table-column>
  19. </el-table>
  20. <base-pagination class='data-table-pagination' :currentPages='pageNum' :total='total' @pageChanged='pageChanged'></base-pagination>
  21. <saga-dialog ref='dialog' :iframeSrc='iframeSrc'></saga-dialog>
  22. </div>
  23. </template>
  24. <script>
  25. import { mapGetters } from 'vuex'
  26. import SagaDialog from './Frame'
  27. //api
  28. import {
  29. getErrAssets, //获取异常资产type不同不同tab
  30. delErrAssets,
  31. getSpaceId
  32. } from '@/api/scan/request'
  33. export default {
  34. name: 'noverify',
  35. data() {
  36. return {
  37. loading: false,
  38. tableData: [],
  39. total: 0,
  40. pageNum: 1,
  41. pageSize: 10,
  42. iframeSrc: ''
  43. }
  44. },
  45. props: {
  46. buildVlaue: {
  47. default: ''
  48. },
  49. floorsObj: {
  50. default: {}
  51. }
  52. },
  53. components: {
  54. SagaDialog
  55. },
  56. computed: {
  57. ...mapGetters('peojMess', ['projectId', 'userId', 'secret'])
  58. },
  59. methods: {
  60. look(row) {
  61. this.iframeSrc =
  62. process.env.BASE_URL +
  63. ':8889/#/details?perjectId=' +
  64. this.projectId +
  65. '&secret=' +
  66. this.secret +
  67. '&FmId=' +
  68. row.FmId +
  69. '&type=1&code=' +
  70. row.Family
  71. this.$refs['dialog'].show()
  72. },
  73. post(row) {
  74. this.iframeSrc =
  75. process.env.BASE_URL +
  76. ':8889/#/details?perjectId=' +
  77. this.projectId +
  78. '&secret=' +
  79. this.secret +
  80. '&FmId=' +
  81. row.FmId +
  82. '&type=1&code=' +
  83. row.Family
  84. this.$refs['dialog'].show()
  85. },
  86. del(row) {
  87. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  88. confirmButtonText: '确定',
  89. cancelButtonText: '取消',
  90. type: 'warning'
  91. })
  92. .then(() => {
  93. let param = {
  94. ProjId: this.projectId,
  95. UserId: this.userId
  96. }
  97. let paramList = [row.FmId]
  98. delErrAssets(param, paramList).then(result => {
  99. if (result.data.Result == 'success') {
  100. this.getAsset()
  101. this.$message({
  102. message: '删除成功',
  103. type: 'success'
  104. })
  105. }
  106. })
  107. })
  108. .catch(() => {
  109. this.$message({
  110. type: 'info',
  111. message: '已取消删除'
  112. })
  113. })
  114. },
  115. pageChanged(page, size) {
  116. this.pageNum = page
  117. this.pageSize = size
  118. this.getAsset()
  119. },
  120. getAsset() {
  121. this.loading = true
  122. let param = {
  123. BuildId: this.buildVlaue || undefined,
  124. PageNum: this.pageNum,
  125. PageSize: this.pageSize,
  126. Type: 4,
  127. ProjId: this.projectId,
  128. UserId: this.userId,
  129. CodeType: 1
  130. }
  131. getErrAssets(param).then(res => {
  132. // this.tableData = list
  133. if (res.data.Result == 'success') {
  134. this.loading = false
  135. let list = res.data.FmList
  136. list.forEach((ele, index) => {
  137. ele.floorName = this.floorsObj[ele.FloorId] || '--'
  138. ele.bimXY = (ele.X || '空') + ',' + (ele.Y || '空')
  139. })
  140. this.total = res.data.Count
  141. this.tableData = list
  142. // this.getSpaceId()
  143. }
  144. })
  145. },
  146. getSpaceId() {
  147. let param = {},
  148. idArr = [],
  149. i = 0,
  150. dataArr = this.tableData
  151. for (; i < dataArr.length; i++) {
  152. if (dataArr[i].EquipmentId) {
  153. idArr.push({
  154. from_id: dataArr[i].EquipmentId,
  155. graph_id: 'GtEquipinSpace001',
  156. rel_type: '1'
  157. })
  158. }
  159. }
  160. param = {
  161. perjectId: this.projectId,
  162. secret: this.secret,
  163. list: idArr
  164. }
  165. getSpaceId(param).then(res => {
  166. let data = res.data,
  167. spaceArr = [],
  168. j = 0
  169. if (data.Result == 'success') {
  170. for (; j < data.Content.length; j++) {
  171. console.log('space**********')
  172. console.log(data.Content)
  173. // if (data.Content[j].Count != 0) {
  174. // spaceArr.push({
  175. // id: data.Content[j].Content[0].to_id
  176. // })
  177. // dataArr.map(item => {
  178. // if (item.EquipmentId == data.Content[j].Content[0].from_id) {
  179. // item.spaceId = data.Content[j].Content[0].to_id
  180. // }
  181. // return item
  182. // })
  183. // }
  184. }
  185. console.log(dataArr, 'dataArr')
  186. // this.getSpaceName(spaceArr)
  187. } else {
  188. }
  189. })
  190. }
  191. },
  192. watch: {
  193. buildVlaue() {
  194. this.getAsset()
  195. }
  196. }
  197. }
  198. </script>
  199. <style scoped lang='less'>
  200. </style>