index.vue 2.02 KB
<template>
  <div class="integratedQuery">
    <div>
      <dee-search-box
        type-name="DxDocument"
        v-bind="configDetailsMap['searchBox'].configDetails"
        @searchEvent="searchEvent"
      />
    </div>
    <div>
      <dee-search-group type-name="DxDocument" :page-data="pageData" :config="{name: 'searchGroup'}" v-bind="configDetailsMap['searchGroup'].configDetails" @groupSearchEvent="groupSearchEvent" />
    </div>
  </div>
</template>

<script>
export default {
// import引入的组件需要注入到对象中才能使用
  components: {},

  props: {
    configDetailsMap: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },

  data() {
    // 这里存放数据
    return {
      pageData: {},
      loadPremed: false,
      permissions: null
    }
  },
  // 监听属性 类似于data概念
  computed: {
    typeKey() {
      if (
        !this.configDetailsMap ||
        !this.configDetailsMap['searchBox']) {
        return ''
      }
      return this.configDetailsMap['searchBox'].typeKey
    },
    layoutType() {
      if (
        !this.configDetailsMap ||
        !this.configDetailsMap['searchBox']) {
        return ''
      }
      return this.configDetailsMap['searchBox'].layoutType
    }
  },
  // 监控data中的数据变化
  watch: {
  },
  // 生命周期 - 创建完成(可以访问当前this实例)
  created() {

  },
  // 生命周期 - 挂载完成(可以访问DOM元素)
  mounted() {
    this.searchEvent()
  },
  activated() {
  },
  // 方法集合
  methods: {
    searchEvent(data) {
      this.pageData = {
        searchGroup: {
          load: data
        },
        table: {
          load: data
        }
      }
      this.$emit('searchEvent', { pageData: this.pageData, eventComName: 'deeSearchBox' })
    },
    groupSearchEvent(data) {
      this.pageData = {
        table: {
          load: data
        }
      }
      this.$emit('searchEvent', { pageData: this.pageData, eventComName: 'deeSearchGroup' })
    }
  }
}
</script>
<style lang='scss'>

</style>