HomePage.vue 2 KB
<template>
  <div class="HomePage">
    <Header />
    <div class="content">
      <div class="navs">
        <Menu />
      </div>
      <div class="table-box">
        <div class="search">
          <div class="ipt-box">
            <el-input
              placeholder="请输入应用名称,运营主体名称进行查询"
              v-model="searchKeyword"
              @input="iptKayWord"
            ></el-input>
            <el-button
              type="primary"
              @click="toSearchInfoList"
              style="height: 32px"
              >搜索</el-button
            >
          </div>
          <infoForm type="add" @reInit="toSearchInfoList">
            <el-button type="success">新增</el-button>
          </infoForm>
        </div>
        <div class="info">
          <router-view ref="info"></router-view>
        </div>
      </div>
      <div class="news">
        <News />
      </div>
    </div>
  </div>
</template>

<script>
import Header from "./components/Header";
import News from "./components/news/index.vue";
import Menu from "./components/Menu.vue";
import { mapState } from 'vuex';
export default {
  name: "HomePage",
  components: {
    Header,
    News,
    Menu,
  },
  data() {
    return {
      searchKeyword: '',
    };
  },
  created() {
  },
  mounted() {
  },
  watch: {
    // $route: {
    //   handler: function (route) {
    //     this.navList = this.$router.options.routes;
    //   },
    //   immediate: true,
    // },
  },
  computed: {
    ...mapState({
      searchKey: state => state.searchKey,
	  }),
  },
  methods: {
    iptKayWord(val) {
      this.$store.commit('SET_SEARCHKEY', val);
    },
    toSearchInfoList() {
      let keyword = this.$store.state.meta.searchKey;
      if(this.$route.path == '/baseSystemInfo/index.vue') {
        this.$refs.info.search();
      } else {
        this.$router.push({
          path: "/baseSystemInfo/index.vue",
        });
      }
    },
  },
};
</script>

<style scoped lang="scss">
@import "./homePage.scss";
</style>