container.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="container">
  3. <el-button
  4. size="small"
  5. type="default"
  6. @click="addFloor"
  7. style="margin: 10px 11px;"
  8. >添加楼层
  9. </el-button>
  10. <div class="table">
  11. <el-table
  12. :data="tableData"
  13. style="width: 100%"
  14. height="100%"
  15. v-loading="loading"
  16. :header-cell-style="headerStyle"
  17. >
  18. <el-table-column label="楼层本地名">
  19. <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
  20. </el-table-column>
  21. <el-table-column label="楼层顺序号">
  22. <template slot-scope="scope">{{scope.row.FloorSequenceID}}</template>
  23. </el-table-column>
  24. <el-table-column label="楼层信息">
  25. <template slot-scope="scope">
  26. <el-button
  27. size="mini"
  28. @click="editFloorData(scope.row)"
  29. plain
  30. icon="el-icon-edit-outline"
  31. ></el-button>
  32. </template>
  33. </el-table-column>
  34. <el-table-column
  35. prop="Datasource"
  36. label="平面图"
  37. >
  38. <template
  39. slot-scope="scope">
  40. <p
  41. v-if="scope.row.Sign > 0"
  42. class="cursor"
  43. @click="childCheckDrawImg(scope.row,2)"
  44. >
  45. <el-badge is-dot>
  46. <i class="iconfont icon-floorplan"/>
  47. </el-badge>
  48. 平面图重复
  49. </p>
  50. <p
  51. class="cursor"
  52. v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false"
  53. @click="childCheckDrawImg(scope.row,1)"
  54. >
  55. <i class="iconfont icon-floorplan"/>
  56. 查看平面图
  57. </p>
  58. <p
  59. class="cursor"
  60. v-else
  61. @click="childCheckDrawImg(scope.row,3)"
  62. >
  63. <i class="iconfont icon-nopicture"/>
  64. 暂无平面图
  65. </p>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. prop="SubTypeName"
  70. label="楼层贯通关系"
  71. >
  72. <template slot-scope="scope">
  73. <span style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
  74. <el-button
  75. size="mini"
  76. @click="changeConnection(scope.row)"
  77. plain
  78. icon="el-icon-edit-outline"
  79. />
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. prop="action"
  84. label="操作">
  85. <template slot-scope="scope">
  86. <el-button
  87. size="mini"
  88. @click="handleDelete(scope.row)"
  89. type="danger"
  90. plain
  91. icon="el-icon-delete"
  92. />
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. </div>
  97. <!-- 添加-修改楼层 -->
  98. <addFloor
  99. :title="floorTitle"
  100. ref="addFloorDialog"
  101. :curBuildId="curBuildId"
  102. :curFloorId="curFloorId"
  103. />
  104. <!-- 添加贯通关系弹窗 -->
  105. <addConnectivity
  106. ref="addConnectivity"
  107. />
  108. <!-- 删除建筑-删除楼层 -->
  109. <el-dialog
  110. title="提示"
  111. :visible.sync="delDialogVis"
  112. width="20%"
  113. @close="handleClose"
  114. id="messageDialog"
  115. >
  116. <div>确定要删除该{{delText}}?</div>
  117. <span
  118. slot="footer"
  119. class="dialog-footer"
  120. >
  121. <el-button
  122. size="small"
  123. @click="delDialogVis=false"
  124. >取消</el-button>
  125. <el-button
  126. size="small"
  127. type="primary"
  128. @click="confirmDelete"
  129. >确认</el-button>
  130. </span>
  131. </el-dialog>
  132. </div>
  133. </template>
  134. <script>
  135. import addFloor from "@/views/ready/buildfloor/addFloor/index";
  136. import addConnectivity from "./addConnectivity";
  137. export default {
  138. name: "container",
  139. props: ['tableData', 'curBuildId'],
  140. data() {
  141. return {
  142. floorTitle: "添加楼层",
  143. curFloorId: "", //当前选中的楼层id
  144. headerStyle: {
  145. backgroundColor: "#d9d9d9",
  146. color: "#2b2b2b",
  147. lineHeight: "30px"
  148. },
  149. loading: false, //列表loading
  150. delText: "楼层",
  151. delDialogVis: false,
  152. }
  153. },
  154. components: {addFloor, addConnectivity},
  155. methods: {
  156. addFloor() {
  157. this.curFloorId = "";
  158. this.$refs.addFloorDialog.showDialog();
  159. },
  160. // 修改楼层贯通关系
  161. changeConnection(row) {
  162. this.$refs.addConnectivity.showDialog();
  163. this.$refs.addConnectivity.floor = row;
  164. },
  165. // 修改楼层信息
  166. editFloorData(floor) {
  167. this.floorTitle = "编辑楼层信息";
  168. this.curFloorId = floor.FloorID;
  169. this.$refs.addFloorDialog.showDialog(floor);
  170. },
  171. //delete floor
  172. handleDelete(floor) {
  173. this.delText = "楼层";
  174. this.delDialogVis = true;
  175. this.curFloorId = floor.FloorID;
  176. },
  177. // 确认删除(删除建筑-楼层公用)
  178. confirmDelete() {
  179. this.delDialogVis = false;
  180. this.$listeners.confirmDel()
  181. },
  182. //确认删除弹窗关闭
  183. handleClose() {
  184. },
  185. // 查看平面图
  186. childCheckDrawImg(row, index) {
  187. this.$listeners.checkDrawImg(row, index)
  188. }
  189. }
  190. }
  191. </script>
  192. <style scoped lang="less">
  193. .container {
  194. height: 100%;
  195. .table {
  196. height: 100%;
  197. }
  198. .cursor{
  199. cursor: pointer;
  200. }
  201. }
  202. </style>