HomePage.vue
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<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>