<template>
  <div>
    <el-cascader
      v-model="selectOption"
      :options="options"
      @change="handleChange"
      filterable
    ></el-cascader>
  </div>
</template>

<script>
import { menuSelectApps } from "@/api/report";

export default {
  props: {
    value: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      options: [],
      selectOption: ["全部", ""]
    };
  },
  created() {
    this.APIMenuSelectApps(); // 获取应用
  },
  methods: {
    APIMenuSelectApps() {
      let params = {
        platformId: 5,
        menuCode: "game.Overview",
        belongGroup: true
      };
      menuSelectApps(params).then(res => {
        this.options = res.result.data;
        this.options[0].children[0].value = ""; //投放归因查询全部不传即可
      });
    },

    /* 将级联数据 发射出去 */
    handleChange() {
      this.$emit("update:value", this.selectOption[1]);
    }
  }
};
</script>

<style></style>
