|
@@ -1,32 +1,116 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
- <p>通知通告</p>
|
|
|
|
|
|
+ <el-col :span="24" class="style">
|
|
|
|
+ <el-col :span="24" class="top">
|
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="down">
|
|
|
|
+ <el-col :span="24" class="search">
|
|
|
|
+ <van-search v-model="name" @search="search" placeholder="请输入信息标题" />
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="data">
|
|
|
|
+ <list :list="list"></list>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import NavBar from '@/layout/common/topInfo.vue';
|
|
|
|
+import list from './parts/list.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions: journcolumn } = createNamespacedHelpers('journcolumn');
|
|
|
|
+const { mapActions: journnews } = createNamespacedHelpers('journnews');
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
},
|
|
},
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
- components: {},
|
|
|
|
|
|
+ components: {
|
|
|
|
+ NavBar,
|
|
|
|
+ list,
|
|
|
|
+ },
|
|
data: function() {
|
|
data: function() {
|
|
- return {};
|
|
|
|
|
|
+ return {
|
|
|
|
+ // 头部标题
|
|
|
|
+ title: '',
|
|
|
|
+ // meta为true
|
|
|
|
+ isleftarrow: '',
|
|
|
|
+ // 返回
|
|
|
|
+ navShow: true,
|
|
|
|
+ active: 0,
|
|
|
|
+ // 栏目列表
|
|
|
|
+ columnList: [],
|
|
|
|
+ // 查询
|
|
|
|
+ name: '',
|
|
|
|
+ list: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ await this.searchColumn();
|
|
|
|
+ await this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...journcolumn(['query', 'delete', 'update', 'create']),
|
|
|
|
+ ...journnews({ newQuery: 'query' }),
|
|
|
|
+ async search({ ...info } = {}) {
|
|
|
|
+ let column = this.columnList.find(i => i.site == 'tztg');
|
|
|
|
+ if (column) {
|
|
|
|
+ if (this.name) info.title = this.name;
|
|
|
|
+ const res = await this.newQuery({ column_id: column.id, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 查询栏目
|
|
|
|
+ async searchColumn() {
|
|
|
|
+ const res = await this.query();
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `columnList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
- methods: {},
|
|
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ this.title = this.$route.meta.title;
|
|
|
|
+ this.isleftarrow = this.$route.meta.isleftarrow;
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
watch: {},
|
|
watch: {},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.style {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #f9fafc;
|
|
|
|
+ .top {
|
|
|
|
+ height: 40px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+ .down {
|
|
|
|
+ .search {
|
|
|
|
+ position: fixed;
|
|
|
|
+ width: 100%;
|
|
|
|
+ z-index: 999;
|
|
|
|
+ }
|
|
|
|
+ .data {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ top: 95px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|