<template>
  <div>
    <el-dialog title="查询条件分析" :visible.sync="isShow" @open="beforeDialogOpen" class="index-query-dlg">
      <table cellpadding="5" cellspacing="0" v-loading="queryDetailLoading">
        <tbody>
          <tr>
            <td height="40" valign="middle">{{queryDtail}}</td>
          </tr>
        </tbody>
      </table>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: { show: Boolean, query: Object },
  data() {
    return {
      queryDtail: '', //   查询条件分析请求数据
      queryDetailLoading: false
    }
  },
  computed: {
    isShow: {
      get() {
        return this.show
      },
      set(val) {
        this.$emit('update:show', val)
      }
    }
  },
  methods: {
    beforeDialogOpen() {
      this.queryDtail = {}
      this.loadQueryDetail()
    },
    async loadQueryDetail() {
      this.queryDetailLoading = true
      try {
        let res = await axios.get('/ui/indexlist/querydetail', {
          params: this.query
        })
        this.queryDtail = res.data.data
      } catch (e) {
      }
      this.queryDetailLoading = false
    }
  }
}
</script>
<style>
.index-query-dlg .el-dialog{
  width:600px;
}
@media (max-width:480px){
  .index-query-dlg .el-dialog{
    width:96%;
  }
}
</style>
<style scoped>
.index-query-dlg{
  line-height:2;
}
</style>
