selectBdc.vue 1.24 KB
<!--
 * @Description: 
 * @Autor: renchao
 * @LastEditTime: 2023-04-17 16:06:24
-->
<template>
  <component :is="router" :sqywInfo="formData.sqywInfo" :isJump="formData.isJump ? formData.isJump : false"
    @updateDialog="updateDialog" />
</template>
<script>
import { queueDjywmc } from "./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.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>