|
@@ -2,12 +2,14 @@
|
|
|
<div id="policy">
|
|
|
<policy-detail
|
|
|
:info="info"
|
|
|
- :zongheList="zongheList"
|
|
|
+ :liebiaoList="liebiaoList"
|
|
|
+ :display="display"
|
|
|
+ :columnName="columnName"
|
|
|
:contentList="contentList"
|
|
|
:total="total"
|
|
|
- :columnName="columnName"
|
|
|
- :liebiaoList="liebiaoList"
|
|
|
+ :policyInfo="policyInfo"
|
|
|
@clickLists="submit"
|
|
|
+ @fetch="fetchInfo"
|
|
|
></policy-detail>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -15,6 +17,7 @@
|
|
|
<script>
|
|
|
import policyDetail from '@/components/policy/policy.vue';
|
|
|
import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+import _ from 'loadsh';
|
|
|
const { mapActions: mapSite } = createNamespacedHelpers('site');
|
|
|
const { mapActions: mappolicyColumn } = createNamespacedHelpers('policyColumn');
|
|
|
const { mapActions: mappolicyNews } = createNamespacedHelpers('policyNews');
|
|
@@ -26,23 +29,25 @@ export default {
|
|
|
policyDetail,
|
|
|
},
|
|
|
data: () => ({
|
|
|
- liebiaoList: [],
|
|
|
info: {},
|
|
|
- zongheList: {},
|
|
|
+ liebiaoList: [],
|
|
|
+ display: 'list',
|
|
|
+ columnName: '',
|
|
|
contentList: [],
|
|
|
total: 1,
|
|
|
leftId: '',
|
|
|
- columnName: '',
|
|
|
+ policyInfo: {},
|
|
|
}),
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
this.searchSite();
|
|
|
- this.policyColumn();
|
|
|
+ await this.policyColumn();
|
|
|
+ await this.defaultColumn();
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
...mapSite(['showInfo']),
|
|
|
...mappolicyColumn({ policyColumns: 'query', policyfetch: 'fetch' }),
|
|
|
- ...mappolicyNews({ policyNew: 'query' }),
|
|
|
+ ...mappolicyNews({ policyNew: 'query', newsFetch: 'fetch' }),
|
|
|
// 查询站点信息
|
|
|
async searchSite() {
|
|
|
let res = await this.showInfo();
|
|
@@ -61,6 +66,7 @@ export default {
|
|
|
},
|
|
|
submit({ id }) {
|
|
|
this.$set(this, `leftId`, id);
|
|
|
+ this.display = 'list';
|
|
|
this.searchRight();
|
|
|
},
|
|
|
async searchRight({ skip = 0, limit = 10, column_id } = {}) {
|
|
@@ -75,6 +81,21 @@ export default {
|
|
|
this.$set(this, `columnName`, val.column_name);
|
|
|
}
|
|
|
},
|
|
|
+ async defaultColumn() {
|
|
|
+ if (!(this.liebiaoList.length > 0)) return;
|
|
|
+ let id = _.get(this.liebiaoList[0], 'id', false);
|
|
|
+ if (!id) return;
|
|
|
+ this.submit({ id });
|
|
|
+ },
|
|
|
+ async fetchInfo(id) {
|
|
|
+ this.display = 'detail';
|
|
|
+ const res = await this.newsFetch(id);
|
|
|
+ // for (const val of res.data) {
|
|
|
+ // }
|
|
|
+ this.$set(this, `policyInfo`, res.data);
|
|
|
+ console.log(res.data);
|
|
|
+ // 查询详情,赋值
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|