Blame view

src/views/lpb/index.vue 16.3 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2024-03-08 08:50:28
5
-->
任超 committed
6
<template>
yangwei committed
7 8 9 10 11 12 13 14 15 16
  <div class="edit">
    <el-tabs type="card" v-model="activeName">
      <el-tab-pane label="楼盘页面" name="first"></el-tab-pane>
      <el-tab-pane label="单元列表页面" name="second"></el-tab-pane>
    </el-tabs>
    <div
      class="tab-content"
      v-if="activeName == 'first'"
      ref="tabContent"
      :style="{ height: lpbContentHight + 'px' }"
17
      v-show="bjztFlag">
yangwei committed
18
      <!-- 楼盘表主体 -->
19 20
      <div class="lp-overview"
        :style="{ width: lpbContentwidth + 'px','margin-right': formData.onlyShow ? '10px' : 0 }">
yangwei committed
21 22
        <lpbContent
          ref="lpbContent"
23
          v-if="formData.bsm"
yangwei committed
24
          :zrzbsm="formData.bsm"
25
          :scyclx="formData.scyclx"
yangwei committed
26
          :onlyShow="formData.onlyShow"
27
          :showSave="formData.showSave"
yangwei committed
28
          :unitData="formData.unitData"
29
          :sqywInfo="formData"
30
          :key="time"></lpbContent>
31
        <el-empty v-else description="暂无楼盘表"></el-empty>
yangwei committed
32 33
      </div>
      <!-- 右侧图例 -->
34
      <div class="lp-legend" v-if="formData.onlyShow && formData.bsm">
yangwei committed
35 36 37 38 39 40 41
        <div class="handleCol">
          <div class="btn" @click="legendToggle">
            <i v-show="!legendToggleFlag" class="el-icon-d-arrow-left"></i>
            <i v-show="legendToggleFlag" class="el-icon-d-arrow-right"></i>
          </div>
          <div
            :class="selectedZt == 'dyzt' ? 'dyzt selectedZt' : 'dyzt'"
42
            @click="selectedZt = 'dyzt'">
yangwei committed
43 44 45 46
            <span>单元状态</span>
          </div>
          <div
            :class="selectedZt == 'fwxz' ? 'fwxz selectedZt' : 'fwxz'"
47
            @click="selectedZt = 'fwxz'">
yangwei committed
48 49 50 51
            <span>房屋性质</span>
          </div>
          <div
            :class="selectedZt == 'fwyt' ? 'fwyt selectedZt' : 'fwyt'"
52
            @click="selectedZt = 'fwyt'">
yangwei committed
53 54 55 56
            <span>房屋用途</span>
          </div>
          <div
            :class="selectedZt == 'qsx' ? 'qsx selectedZt' : 'qsx'"
57
            @click="selectedZt = 'qsx'">
yangwei committed
58 59 60 61 62
            <span>缺失项</span>
          </div>
        </div>
        <div
          class="legendTable-wrap"
63
          :style="{ width: legendToggleFlag ? '200px' : '0' }">
yangwei committed
64 65 66 67 68
          <table
            class="legendTable"
            v-show="selectedZt == 'dyzt'"
            cellspacing="1"
            cellpadding="1"
69
            border="1">
yangwei committed
70 71 72 73 74 75 76 77 78
            <tr>
              <th>状态</th>
              <th>套数</th>
              <th>面积</th>
            </tr>
            <tr
              v-for="(item, index) in dyztList"
              :key="index"
              class="cp"
79
              @click="handleChoosedH(item.bsms, item.color)">
yangwei committed
80 81 82
              <td>
                <i
                  class="fa fa-circle"
83
                  :style="{ backgroundColor: item.color }"></i>{{ item.name }}
yangwei committed
84 85 86 87 88
              </td>
              <td>{{ item.ts }}</td>
              <td>{{ item.mj }}</td>
            </tr>
          </table>
任超 committed
89

yangwei committed
90 91 92 93 94
          <table
            class="legendTable"
            v-show="selectedZt == 'fwxz'"
            cellspacing="1"
            cellpadding="1"
95
            border="1">
yangwei committed
96 97 98 99 100 101 102 103 104
            <tr>
              <th>性质</th>
              <th>套数</th>
              <th>面积</th>
            </tr>
            <tr
              v-for="(item, index) in fwxzList"
              :key="index"
              class="cp"
105
              @click="handleChoosedH(item.bsms, item.color)">
yangwei committed
106 107 108
              <td>
                <i
                  class="fa fa-circle"
109
                  :style="{ backgroundColor: item.color }"></i>{{ item.name }}
yangwei committed
110 111 112 113 114 115 116 117
              </td>
              <td>{{ item.ts }}</td>
              <td>{{ item.mj }}</td>
            </tr>
            <tr v-show="fwxzList.length < 1">
              <td colspan="3" class="tac">暂无数据</td>
            </tr>
          </table>
任超 committed
118

yangwei committed
119 120 121 122 123
          <table
            class="legendTable"
            v-show="selectedZt == 'fwyt'"
            cellspacing="1"
            cellpadding="1"
124
            border="1">
yangwei committed
125 126 127 128 129 130 131 132 133
            <tr>
              <th>用途</th>
              <th>套数</th>
              <th>面积</th>
            </tr>
            <tr
              v-for="(item, index) in fwytList"
              :key="index"
              class="cp"
134
              @click="handleChoosedH(item.bsms, item.color)">
yangwei committed
135 136 137
              <td>
                <i
                  class="fa fa-circle"
138
                  :style="{ backgroundColor: item.color }"></i>{{ item.name }}
yangwei committed
139 140 141 142 143 144 145 146
              </td>
              <td>{{ item.ts }}</td>
              <td>{{ item.mj }}</td>
            </tr>
            <tr v-show="fwytList.length < 1">
              <td colspan="3" class="tac">暂无数据</td>
            </tr>
          </table>
任超 committed
147

yangwei committed
148 149 150 151 152
          <table
            class="legendTable"
            v-show="selectedZt == 'qsx'"
            cellspacing="1"
            cellpadding="1"
153
            border="1">
yangwei committed
154 155 156 157 158 159 160 161 162
            <tr>
              <th>数据缺失项</th>
              <th>套数</th>
              <th>面积</th>
            </tr>
            <tr
              v-for="(item, index) in qsxList"
              :key="index"
              class="cp"
163
              @click="handleChoosedH(item.bsms, item.color)">
yangwei committed
164 165 166
              <td>
                <i
                  class="fa fa-circle"
167
                  :style="{ backgroundColor: item.color }"></i>{{ item.name }}
yangwei committed
168 169 170 171 172 173 174 175 176 177 178
              </td>
              <td>{{ item.ts }}</td>
              <td>0</td>
            </tr>
            <tr v-show="qsxList.length < 1">
              <td colspan="3" class="tac">暂无数据</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
179
    <!--    单元列表页面-->
180 181 182
    <div :style="{ height: lpbContentHight + 'px' }" v-else>
      <selectZrzH :sqywInfo="formData" />
    </div>
yangwei committed
183
  </div>
任超 committed
184 185 186
</template>

<script>
187 188 189 190 191 192 193 194
  import lpbContent from "./lpbContent/index";
  import selectZrzH from "../ywbl/ywsq/components/selectZrzH";
  import { getLpbFwytAndQlxz, getLpbQsxtj, getLpbTj } from "@/api/lpcx.js";
  export default {
    name: "lpb",
    props: {
      formData: {
        type: Object,
yangwei committed
195 196 197
        default: () => {
          return {}
        }
198
      },
yangwei committed
199
    },
200 201 202
    components: {
      lpbContent,
      selectZrzH,
yangwei committed
203
    },
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
    data () {
      return {
        activeName: "first",
        bsms: [],
        dialogVisible: false,
        scyclx: "0", //1是实测  0是预测
        menuType: "",
        selectedZt: "dyzt", //图例选中项,默认选中单元状态
        dyztList: [
          {
            name: "未确权",
            color: "#83AAFE",
            ts: "12",
            mj: "1633",
          },
          {
            name: "已确权",
            color: "#6EDEE1",
            ts: "22",
            mj: "3109",
          },
          {
            name: "已备案",
            color: "#8ADC88",
            ts: "3",
            mj: "409",
          },
          {
            name: "预抵押",
            color: "#F2AD67",
            ts: "11",
            mj: "1466",
          },
          {
            name: "在建抵押",
            color: "#F191C8",
            ts: "13",
            mj: "1792",
          },
          {
            name: "抵押",
            color: "#FF8282",
            ts: "14",
            mj: "13",
          },
          {
            name: "查封",
            color: "#D7CECF",
            ts: "9",
            mj: "1436",
          },
          {
            name: "异议",
            color: "#D4A3EB",
            ts: "34",
            mj: "4342",
          },
          {
            name: "限制",
            color: "#A5A3FB",
            ts: "2",
            mj: "285",
          },
        ],
        fwxzList: [],
        fwytList: [],
        qsxList: [],
        legendToggleFlag: false,
        lpbContentHight: "",
        lpbContentwidth: "",
        time: "",
        dyztBsmList: {}, //单元状态bsmList
        bjztFlag: true,
        qsztList: [],
      };
yangwei committed
279
    },
280 281 282
    created () {
      window.addEventListener("resize", this.getHeight);
      this.getHeight();
yangwei committed
283
    },
284 285 286 287 288 289 290 291 292 293 294 295 296
    mounted () {
      //获取各项单元状态的户bsm
      this.getDyztBsmList();
      //获取房屋用途统计数据
      this.getLpbFwytAndQlxz();
      // 楼盘表绘制区域宽度计算:楼盘表区域宽度-图例宽度34-滚动条宽度6
      setTimeout(() => {
        this.lpbContentwidth =
          (document.documentElement.clientWidth || document.body.clientWidth) -
          340 -
          34 -
          6;
      }, 100);
yangwei committed
297
    },
298 299 300 301 302 303 304 305 306 307 308 309 310
    methods: {
      /* handleTabClick(event){
        if(event.name=="first"){
          this.$router.push({
            path:"/lpb/index",
          })
        }else if(event.name=="second"){
          this.$router.push({
          path:"/ywbl/ywsq/components/selectAllHInfo",
          })
        }
        },*/
      //获取高度计算lpb内容区高度
yuanbo committed
311 312 313 314
      /**
       * @description: 获取高度计算lpb内容区高度
       * @author: renchao
       */
315 316 317 318
      getHeight () {
        this.lpbContentHight = window.innerHeight - 190;
      },
      //图例的展开收起
yuanbo committed
319 320 321 322
      /**
       * @description: 图例的展开收起
       * @author: renchao
       */
323 324 325 326
      legendToggle () {
        this.legendToggleFlag = !this.legendToggleFlag;
      },
      //切换房屋状态
yuanbo committed
327 328 329 330 331 332
      /**
       * @description: 切换房屋状态
       * @param {*} bsms
       * @param {*} color
       * @author: renchao
       */
333 334 335 336
      handleChoosedH (bsms, color) {
        this.$refs.lpbContent.changeChoosed(bsms, color);
      },
      //获取各项单元状态统计数据
yuanbo committed
337 338 339 340
      /**
       * @description: 获取各项单元状态统计数据
       * @author: renchao
       */
341 342 343 344 345 346 347
      getDyztBsmList () {
        getLpbTj(this.formData.bsm).then((res) => {
          if (res.code === 200) {
            this.dyztList = res.result;
            this.dyztList.splice(1, 0, this.dyztList[8]);
            this.dyztList.pop();
            this.dyztList.forEach((item) => {
yangwei committed
348
              item.ts = item.bsms.length;
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
              switch (item.name) {
                case "Qqzt":
                  item.color = "#6EDEE1";
                  item.name = "已确权";
                  break;
                case "Wqqzt":
                  item.color = "#83AAFE";
                  item.name = "未确权";
                  break;
                case "Bazt":
                  item.color = "#8ADC88";
                  item.name = "已备案";
                  break;
                case "Ydyzt":
                  item.color = "#F2AD67";
                  item.name = "预抵押";
                  break;
                case "Zjgcdyzt":
                  item.color = "#F191C8";
                  item.name = "在建抵押";
                  break;
                case "Dyzt":
                  item.color = "#FF8282";
                  item.name = "抵押";
                  break;
                case "Cfzt":
                  item.color = "#D7CECF";
                  item.name = "查封";
                  break;
                case "Yyzt":
                  item.color = "#D4A3EB";
                  item.name = "异议";
                  break;
                case "Xzzt":
                  item.color = "#A5A3FB";
                  item.name = "限制";
                  break;
                default:
                  break;
              }
yangwei committed
389 390
            });
          }
391 392 393
        });
      },
      // 获取房屋用途和房屋性质及缺失项统计数据
yuanbo committed
394 395 396 397
      /**
       * @description: 获取房屋用途和房屋性质及缺失项统计数据
       * @author: renchao
       */
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
      getLpbFwytAndQlxz () {
        getLpbFwytAndQlxz(this.formData.bsm).then((res) => {
          if (res.code === 200) {
            // this.fwytList = res.result
            this.fwytList = res.result.fwyt;
            this.fwxzList = res.result.qlxz;
            if (this.fwytList.length > 0) {
              this.fwytList.forEach((item) => {
                item.color = "#2591FD";
                item.ts = item.bsms.length;
              });
            }
            if (this.fwxzList.length > 0) {
              this.fwxzList.forEach((item) => {
                item.color = "#2591FD";
                item.ts = item.bsms.length;
              });
            }
yangwei committed
416
          }
417
        });
yangwei committed
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
        // getLpbQsxtj(this.formData.bsm).then((res) => {
        //   if (res.code === 200) {
        //     this.qsxList = [
        //       {
        //         name: "坐落",
        //         bsms: res.result.zl.bsms,
        //         color: "#2591FD",
        //         ts: res.result.zl.bsms.length,
        //       },
        //       {
        //         name: "分层分户图",
        //         bsms: res.result.fcfht.bsms,
        //         color: "#2591FD",
        //         ts: res.result.fcfht.bsms.length,
        //       },
        //       {
        //         name: "室号",
        //         bsms: res.result.shbw.bsms,
        //         color: "#2591FD",
        //         ts: res.result.shbw.bsms.length,
        //       },
        //     ];
        //   }
        // });
442
      },
yangwei committed
443
    },
444 445 446
    computed: {},
    destroyed () {
      window.removeEventListener("resize", this.getHeight);
yangwei committed
447
    },
448 449 450 451 452 453 454 455 456 457 458 459
    watch: {
      //树结构和图例伸缩时修改楼盘表主要内容区宽度
      legendToggleFlag (n) {
        if (n) {
          this.lpbContentwidth -= 204;
        } else {
          this.lpbContentwidth += 204;
        }
      },
      selectedZt (n) {
        this.legendToggleFlag = true;
      },
yangwei committed
460
    },
461
  };
任超 committed
462 463
</script>
<style scoped lang="scss">
464 465 466 467 468 469 470 471 472 473 474 475 476 477
  table {
    border-width: 0;
    border-collapse: collapse;
    border-spacing: 0;
  }
  .edit {
    height: 100%;
    .tab-content {
      border: 1px solid #dedede;
      border-left: 0;
      background-color: #ffffff;
      display: flex;
      &::-webkit-scrollbar {
        width: 1px;
yangwei committed
478
      }
479
      .lp-tree {
yangwei committed
480
        height: 100%;
481 482 483 484 485 486
        overflow: hidden;
        transition: 0.5s;
        .treeData {
          margin-top: 20px;
          margin-left: 26px;
          float: left;
yangwei committed
487 488
        }
      }
489 490 491 492 493 494 495
      .w0 {
        width: 0;
      }
      .w260 {
        width: 260px;
      }
      .lp-overview {
yangwei committed
496
        transition: 0.5s;
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
        flex: 1;
        border: 1px solid rgb(236, 236, 236);
        border-top: 0;
        border-bottom: 0;
        box-sizing: border-box;
      }

      .lp-legend {
        transition: 0.5s;
        height: 100%;
        font-size: 14px;
        .handleCol {
          width: 34px;
          float: right;
          height: 100%;
          .btn {
            cursor: pointer;
yangwei committed
514 515
            height: 40px;
            line-height: 40px;
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
            text-align: center;
            background-color: #5a78de;
            color: #fff;
            border-bottom: 1px solid #e6e6e6;
          }
          .dyzt,
          .fwxz,
          .fwyt,
          .qsx {
            height: 122px;
          }
          .dyzt,
          .fwxz,
          .fwyt,
          .qsx {
            cursor: pointer;
            border-bottom: 1px solid #e6e6e6;
            border-left: 1px solid #e6e6e6;
            span {
              text-align: center;
              height: 100%;
              -webkit-writing-mode: vertical-rl;
              writing-mode: vertical-rl;
              line-height: 34px;
              letter-spacing: 2px;
yangwei committed
541
            }
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
          }
          .selectedZt {
            // background-color: #5A78DE;
            color: #3d59c4;
          }
        }
        .legendTable-wrap {
          transition: 0.5s;
          float: right;
          overflow: hidden;
          .legendTable {
            margin-top: -1px;
            .fa-circle {
              display: inline-block;
              width: 12px;
              height: 12px;
              border-radius: 50%;
              vertical-align: middle;
              margin-right: 4px;
yangwei committed
561
            }
562
            tr {
yangwei committed
563
              height: 40px;
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583
              line-height: 40px;
              border-color: #d8e0ea !important;
              th:first-child {
                width: 80px;
              }
              th {
                width: 60px;
                height: 40px;
                white-space: nowrap;
                background-color: #eceef2;
              }
              td {
                height: 40px;
                text-align: center;
                white-space: nowrap;
              }
              td:first-child {
                text-align: left;
                text-indent: 2px;
              }
yangwei committed
584 585 586 587 588 589
            }
          }
        }
      }
    }
  }
任超 committed
590
</style>