slectBdc.vue 1.08 KB
<template>
  <dialogBox title="查询权利信息" width="85%" :isButton="false" @closeDialog="closeDialog" v-model="myValue">
    <component :is="editItem" @closeDialog="closeDialog" :key="key" />
  </dialogBox>
</template>
<script>
import { mapGetters } from 'vuex'
import { queueDjywmc } from './slectBdcdata.js'
export default {
  props: {
    value: { type: Boolean, default: true }
  },
  data () {
    return {
      key: 0,
      editItem: '',
      myValue: this.value
    }
  },
  computed: {
    ...mapGetters(['djywbm'])
  },
  watch: {
    value (val) {
      this.myValue = val
      this.key++
    },
    djywbm (val) {
      let dd = queueDjywmc(val)
      this.editItem = this.loadView(dd)
    }
  },
  methods: {
    loadView (view) {
      return r => require.ensure([], () => r(require(`./components/${view}.vue`)))
    },
    closeDialog () {
      this.$emit("input", false)
    }
  }
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";

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