addConnectivity.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="730px" id="messageDialog">
  3. <el-row>
  4. <div style="line-height:32px;">添加与{{floor.FloorLocalName}}层有贯通关系的楼层 : </div>
  5. <div style="width:70%">
  6. <bfCascader ref="bfCascader" :FloorID="floor.FloorID"></bfCascader>
  7. </div>
  8. </el-row>
  9. <span slot="footer" class="dialog-footer">
  10. <el-button size="small" @click="connectDialogVis=false">取消</el-button>
  11. <el-button size="small" type="primary" @click="save">确认</el-button>
  12. </span>
  13. </el-dialog>
  14. </template>
  15. <script>
  16. import bfCascader from '@/components/ready/buildfloor/buildfloorCascader'
  17. import { createRelationInFloor } from "@/api/scan/request";
  18. export default {
  19. data() {
  20. return {
  21. buildName: '',
  22. connectDialogVis: false,
  23. floor: {}
  24. }
  25. },
  26. components: {
  27. bfCascader
  28. },
  29. methods: {
  30. showDialog() {
  31. this.connectDialogVis = true
  32. this.$nextTick(() => {
  33. this.$refs.bfCascader.getCascader()
  34. let arr = this.floor.FloorThroughList || [];
  35. let value = []
  36. if (arr.length) {
  37. arr.map(t => {
  38. value.push([t.BuildID, t.FloorID])
  39. })
  40. }
  41. this.$refs.bfCascader.value = value
  42. })
  43. },
  44. save() {
  45. let arr = this.$refs.bfCascader.value;
  46. let param = {
  47. FloorId: this.floor.FloorID,
  48. FloorOtherIdList: []
  49. }
  50. arr.map(t => {
  51. param.FloorOtherIdList.push(t[1])
  52. })
  53. createRelationInFloor(param, res => {
  54. this.connectDialogVis = false;
  55. this.$message.success('关联成功');
  56. this.$emit('refresh')
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="less" scoped>
  63. #messageDialog {
  64. .el-row{
  65. height: 50px;
  66. max-height: 200px;
  67. overflow-y: auto;
  68. overflow-x: hidden;
  69. }
  70. .el-row > div {
  71. float: left;
  72. }
  73. .el-row > div + div {
  74. margin-left: 10px;
  75. }
  76. /deep/ .el-input__inner {
  77. vertical-align: baseline;
  78. }
  79. }
  80. </style>