index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!--
  2. revit空间管理
  3. -->
  4. <template>
  5. <div id="graphy">
  6. <div class="graphy-left">
  7. <graphy-tree v-if="show" :param="param" @change="getPoint"></graphy-tree>
  8. </div>
  9. <div class="graphy-main">
  10. <graphy-canvas v-if="show" :param="param" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
  11. </div>
  12. <div class="graphy-right">
  13. <graphy-tabs v-show="show"
  14. ref="tabs"
  15. :pointParam="pointParam"
  16. @setFalg="setFalg"
  17. @getLocation="getLocation"
  18. @getPointList="sendPointList"
  19. ></graphy-tabs>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. //接口
  25. import graphyTree from "./graphyTree";
  26. import graphyTabs from "./graphyTabs";
  27. import graphyCanvas from "./graphyCanvas";
  28. import {mapGetters, mapActions} from 'vuex';
  29. import {getPT} from "@/api/scan/request"; //获取点位坐标
  30. import Handsontable from "handsontable-pro"
  31. import 'handsontable-pro/dist/handsontable.full.css'
  32. import zhCN from 'handsontable-pro/languages/zh-CN';
  33. export default {
  34. components: {
  35. graphyTree,
  36. graphyTabs,
  37. graphyCanvas
  38. },
  39. data() {
  40. return {
  41. param: {
  42. ProjId: this.projectId, //项目id
  43. UserId: this.userId //用户id
  44. },
  45. pointParam: {
  46. //point请求参数
  47. ProjId: this.projectId, //项目id
  48. UserId: this.userId, //用户id
  49. fllorName: ""
  50. },
  51. map: null,
  52. pointId: null,
  53. show:false,
  54. };
  55. },
  56. mounted() {
  57. this.changeValue()
  58. },
  59. computed: {
  60. ...mapGetters("peojMess", [
  61. "projectId",
  62. "userId",
  63. "secret"
  64. ])
  65. },
  66. methods: {
  67. changeValue(){
  68. this.$set(this.param,'ProjId',this.projectId)
  69. console.log(this.param)
  70. this.$set(this.param,'UserId',this.userId)
  71. this.$set(this.pointParam,'ProjId',this.projectId)
  72. this.$set(this.pointParam,'UserId',this.userId)
  73. console.log(this.pointParam)
  74. this.show = true
  75. },
  76. getPoint(data) {
  77. this.pointParam.FloorId = data.code;
  78. this.pointParam.fllorName = data.name;
  79. this.$refs.tabs.reset(this.pointParam, data.map);
  80. if (this.map != data.map) {
  81. this.map = data.map;
  82. this.$refs.canvas.getData(data);
  83. } else {
  84. return;
  85. }
  86. },
  87. //获取到点位标签坐标
  88. sendPointList(list) {
  89. if (list && list.length && list[0].Id == this.pointId) {
  90. this.$refs.canvas.doPoint(list);
  91. } else {
  92. if (list.length) {
  93. this.pointId = list[0].Id;
  94. this.$refs.canvas.doPoint(list);
  95. } else {
  96. this.$refs.canvas.doPoint([]);
  97. }
  98. }
  99. },
  100. //插旗setFalg
  101. setFalg(item) {
  102. this.$refs.canvas.addPoint(item);
  103. },
  104. //定位getLocation
  105. getLocation(item) {
  106. this.$refs.canvas.locationGraphy({ X: item.X, Y: item.Y * -1 });
  107. },
  108. //重新获取点位信息resetPoint
  109. resetPoint() {
  110. this.$refs.tabs.reset(this.pointParam, true);
  111. },
  112. //查看详情
  113. getDetails(item) {
  114. this.$refs.tabs.getDetails(item);
  115. }
  116. }
  117. };
  118. </script>
  119. <style lang="less" scoped>
  120. #graphy {
  121. position: relative;
  122. .graphy-left {
  123. width: 200px;
  124. height: 100%;
  125. position: absolute;
  126. overflow-y: auto;
  127. left: 0;
  128. top: 0;
  129. bottom: 0;
  130. border-right: 1px solid #ccc;
  131. }
  132. .graphy-main {
  133. position: absolute;
  134. left: 200px;
  135. top: 0;
  136. right: 400px;
  137. bottom: 0;
  138. overflow: auto;
  139. }
  140. .graphy-right {
  141. position: absolute;
  142. right: 0;
  143. width: 400px;
  144. top: 0;
  145. bottom: 0;
  146. border-left: 1px solid #ccc;
  147. overflow: hidden;
  148. }
  149. }
  150. </style>