selectBdc.vue 1.42 KB
<!--
 * @Description: 选择不动产单元号
 * @Autor: renchao
 * @LastEditTime: 2023-05-18 10:59:48
-->
<template>
  <component :is="router" :sqywInfo="formData.sqywInfo" :isJump="formData.isJump ? formData.isJump : false"
    @updateDialog="updateDialog" />
</template>
<script>
  import { queueDjywmc } from "./javascript/slectBdcdata.js";
  export default {
    props: {
      formData: {
        type: Object,
        default: () => { }
      }
    },
    data () {
      return {
        title: "",
        router: ""
      }
    },
    mounted () {
      if (this.formData?.sqywInfo?.djywbm || this.formData?.djywbm) {
        let view = queueDjywmc(this.formData?.sqywInfo?.djywbm || this.formData?.djywbm,this.formData?.sqywInfo?.nodecode || this.formData?.nodecode);
        this.router = this.loadView(view);
      } else {
        let view = queueDjywmc(this.$route.query?.sqywbm);
        this.router = this.loadView(view);
      }
    },
    methods: {
      loadView (view) {
        console.log(view, 'view');
        return (r) =>
          require.ensure([], () => r(require(`./components/${view}.vue`)));
      },
      updateDialog () {
        this.$popupCacel()
        this.$emit("updateDialog", true)
      }
    }
  }
</script>
<style scoped lang="scss">
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";

  /deep/.submit_button {
    text-align: center;
    padding: 10px;
    margin: 10px;
  }
</style>