|
@@ -32,7 +32,7 @@
|
|
<span>{{ columnName }}</span>
|
|
<span>{{ columnName }}</span>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="list">
|
|
<el-col :span="24" class="list">
|
|
- <newsList :list="list" :total="total" @detailBtn="detailBtn"></newsList>
|
|
|
|
|
|
+ <newsList :list="list" :total="total" @detailBtn="detailBtn" @searchList="searchList"></newsList>
|
|
</el-col>
|
|
</el-col>
|
|
</span>
|
|
</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
@@ -58,6 +58,7 @@ import foot from '@/layout/common/foot.vue';
|
|
import newsList from './parts/newsList.vue';
|
|
import newsList from './parts/newsList.vue';
|
|
import newsDetail from './parts/newsDetail.vue';
|
|
import newsDetail from './parts/newsDetail.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions: news } = createNamespacedHelpers('news');
|
|
export default {
|
|
export default {
|
|
name: 'listDetail',
|
|
name: 'listDetail',
|
|
props: {},
|
|
props: {},
|
|
@@ -89,51 +90,110 @@ export default {
|
|
// 总数
|
|
// 总数
|
|
total: 10,
|
|
total: 10,
|
|
// 详情
|
|
// 详情
|
|
- details: {
|
|
|
|
- title: '信息标题',
|
|
|
|
- source: '信息部',
|
|
|
|
- date: '2020-02-02',
|
|
|
|
- content: '信息内容',
|
|
|
|
- },
|
|
|
|
|
|
+ details: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.changeColumn();
|
|
this.changeColumn();
|
|
|
|
+ if (this.id) {
|
|
|
|
+ this.searchInfo();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...news({ newsQuery: 'query', newsFetch: 'fetch' }),
|
|
// 选择栏目
|
|
// 选择栏目
|
|
- changeColumn() {
|
|
|
|
|
|
+ async changeColumn({ skip = 0, limit = 14, status = 2, ...info } = {}) {
|
|
if (this.col_name == '图片新闻') {
|
|
if (this.col_name == '图片新闻') {
|
|
this.menuIndex = 0;
|
|
this.menuIndex = 0;
|
|
this.columnName = this.col_name;
|
|
this.columnName = this.col_name;
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.$set(this, `displays`, this.display);
|
|
this.$set(this, `displays`, this.display);
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '图片新闻' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
} else if (this.col_name == '党建工作') {
|
|
} else if (this.col_name == '党建工作') {
|
|
this.menuIndex = 1;
|
|
this.menuIndex = 1;
|
|
this.columnName = this.col_name;
|
|
this.columnName = this.col_name;
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.$set(this, `displays`, this.display);
|
|
this.$set(this, `displays`, this.display);
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '党建工作' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
} else if (this.col_name == '学习园地') {
|
|
} else if (this.col_name == '学习园地') {
|
|
this.menuIndex = 2;
|
|
this.menuIndex = 2;
|
|
this.columnName = this.col_name;
|
|
this.columnName = this.col_name;
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.$set(this, `displays`, this.display);
|
|
this.$set(this, `displays`, this.display);
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '学习园地' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
} else if (this.col_name == '党风廉政') {
|
|
} else if (this.col_name == '党风廉政') {
|
|
this.menuIndex = 3;
|
|
this.menuIndex = 3;
|
|
this.columnName = this.col_name;
|
|
this.columnName = this.col_name;
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.$set(this, `displays`, this.display);
|
|
this.$set(this, `displays`, this.display);
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '党风廉政' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 点击选择菜单
|
|
// 点击选择菜单
|
|
- changeMenu(name, index) {
|
|
|
|
|
|
+ async changeMenu(name, index) {
|
|
this.menuIndex = index;
|
|
this.menuIndex = index;
|
|
this.columnName = name;
|
|
this.columnName = name;
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.menuColor = 'rgb(5,73,130)';
|
|
this.$set(this, `displays`, 0);
|
|
this.$set(this, `displays`, 0);
|
|
|
|
+ this.searchList();
|
|
|
|
+ },
|
|
|
|
+ // 点击选择查询列表
|
|
|
|
+ async searchList({ skip = 0, limit = 14, status = 2, ...info } = {}) {
|
|
|
|
+ if (this.columnName == '图片新闻') {
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '图片新闻' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ } else if (this.columnName == '党建工作') {
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '党建工作' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ } else if (this.columnName == '学习园地') {
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '学习园地' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ } else if (this.columnName == '党风廉政') {
|
|
|
|
+ let res = await this.newsQuery({ skip, limit, status, col_name: '党风廉政' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 详情
|
|
|
|
+ async searchInfo(id) {
|
|
|
|
+ let res = await this.newsFetch(this.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `details`, res.data);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 点击详情
|
|
// 点击详情
|
|
- detailBtn(id) {
|
|
|
|
|
|
+ async detailBtn(id) {
|
|
|
|
+ let res = await this.newsFetch(id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `details`, res.data);
|
|
|
|
+ }
|
|
this.$set(this, `displays`, 1);
|
|
this.$set(this, `displays`, 1);
|
|
},
|
|
},
|
|
},
|
|
},
|