<template>
  <div>
    <el-container>
      <el-aside width="180px">
        <service-shop-menu></service-shop-menu>
      </el-aside>
      <el-main>
        <service-list :filterNames="filterNames" :name="name" :url="url" :urlFilter="urlFilter"></service-list>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import ServiceShopMenu from "@/components/service-list/service_shop_menu";
import ServiceList from "@/components/service-list/service_list";
export default {
  components: {
    ServiceShopMenu,
    ServiceList
  },
  data: () => ({
    urlFilter: "",
    url: "",
    name: "",
    filterNames: []
  }),
  mounted() {
    this.getVal(this.$route.path);
  },
  methods: {
    getVal(val) {
      let uri = val.substring(6);
      uri = uri.substring(0, uri.indexOf("/"));
      switch (uri) {
        case "data_service_list":
          this.name = "数据服务";
          this.urlFilter = "5";
          this.url = "/shop/sjfwDetail";
          this.filterNames = ["数据服务类型", "服务领域", "数据来源机构"];
          break;
        case "space_time_service_list":
          this.name = "时空服务";
          this.urlFilter = "6";
          this.url = "/shop/skfwDetail";
          this.filterNames = ["时空服务类型", "服务领域", "服务来源组织"];
          break;
        case "video_service_list":
          this.name = "视频服务";
          this.urlFilter = "7";
          this.url = "";
          this.filterNames = [];
          break;
        case "perception_service_list":
          this.name = "感知服务";
          this.urlFilter = "10";
          this.url = "";
          this.filterNames = [];
          break;
        case "comprehensive_app_list":
          this.name = "综合应用";
          this.urlFilter = "21";
          this.url = "/shop/zhfwDetail";
          this.filterNames = ["服务类型", "服务领域", "服务来源组织"];
          break;
        case "app_store_list":
          this.name = "应用商店";
          this.urlFilter = "app";
          this.url = "/shop/yysdDetail";
          this.filterNames = ["应用类型", "应用领域", "应用来源机构"];
          break;
        default:
          this.name = "";
          this.urlFilter = "";
          this.url = "";
          this.filterNames = [];
          break;
      }
    }
  },
  watch: {
    "$route.path": {
      handler(val) {
        this.getVal(val);
      }
    }
  }
};
</script>
<style scoped>
</style>