|
@@ -42,6 +42,8 @@ import tpxw from '@/layout/kjzx/tpxw.vue';
|
|
|
import mtjj from '@/layout/kjzx/mtjj.vue';
|
|
|
import kjdt from '@/layout/kjzx/kjdt.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: concolumn } = createNamespacedHelpers('concolumn');
|
|
|
+const { mapActions: connews } = createNamespacedHelpers('connews');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -94,8 +96,33 @@ export default {
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...concolumn({ columnquery: 'query', columnfetch: 'fetch' }),
|
|
|
+ ...connews({ connewsquery: 'query', connewsfetch: 'fetch' }),
|
|
|
+ async search() {
|
|
|
+ let res = await this.columnquery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let tpxw = res.data.find(i => i.site == 'tpxw');
|
|
|
+ if (tpxw) {
|
|
|
+ let res = await this.connewsquery({ limit: 6, column_id: tpxw.id });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${tpxw.site}List`, res.data);
|
|
|
+ }
|
|
|
+ let kjdt = res.data.find(i => i.site == 'kjdt');
|
|
|
+ if (kjdt) {
|
|
|
+ let res = await this.connewsquery({ limit: 18, column_id: kjdt.id });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${kjdt.site}List`, res.data);
|
|
|
+ }
|
|
|
+ let mtjj = res.data.find(i => i.site == 'mtjj');
|
|
|
+ if (mtjj) {
|
|
|
+ let res = await this.connewsquery({ limit: 5, column_id: mtjj.id });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${mtjj.site}List`, res.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|