|
@@ -1,116 +0,0 @@
|
|
|
-<template>
|
|
|
- <div id="shujulist">
|
|
|
- <personnelqita-detail
|
|
|
- :info="info"
|
|
|
- :liebiaoList="liebiaoList"
|
|
|
- :display="display"
|
|
|
- :columnName="columnName"
|
|
|
- :contentList="contentList"
|
|
|
- :total="total"
|
|
|
- :columnTitle="columnTitle"
|
|
|
- :policyInfo="policyInfo"
|
|
|
- @clickLists="submit"
|
|
|
- @fetch="fetchInfo"
|
|
|
- @detail="clickDetail"
|
|
|
- @detailgz="clickDetailcm"
|
|
|
- :canmoData="canmoData"
|
|
|
- ></personnelqita-detail>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import personnelqitaDetail from '@/components/personnel/personnelqita.vue';
|
|
|
-import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
-import _ from 'loadsh';
|
|
|
-const { mapActions: mapSite } = createNamespacedHelpers('site');
|
|
|
-const { mapActions: mappolicyColumn } = createNamespacedHelpers('policiesColumn');
|
|
|
-const { mapActions: mappolicyNews } = createNamespacedHelpers('policiesjbxx');
|
|
|
-// policiesxinxi policiesxinxi
|
|
|
-export default {
|
|
|
- name: 'shujulist',
|
|
|
- props: {},
|
|
|
- components: { personnelqitaDetail },
|
|
|
- data: () => ({
|
|
|
- info: {},
|
|
|
- liebiaoList: [],
|
|
|
- canmoData: [],
|
|
|
- display: 'list',
|
|
|
- columnName: '',
|
|
|
- contentList: [],
|
|
|
- total: 1,
|
|
|
- leftId: '',
|
|
|
- columnTitle: '',
|
|
|
- policyInfo: {},
|
|
|
- }),
|
|
|
- async created() {
|
|
|
- this.searchSite();
|
|
|
- await this.policyColumn();
|
|
|
- await this.defaultColumn();
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- methods: {
|
|
|
- ...mapSite(['showInfo']),
|
|
|
- ...mappolicyColumn({ policyColumns: 'query', policyfetch: 'fetch' }),
|
|
|
- ...mappolicyNews({ policyNew: 'query', newsFetch: 'fetch' }),
|
|
|
- // 查询站点信息
|
|
|
- async searchSite() {
|
|
|
- let res = await this.showInfo();
|
|
|
- let object = JSON.parse(JSON.stringify(res.data));
|
|
|
- if (object) {
|
|
|
- this.$set(this, `info`, res.data);
|
|
|
- } else {
|
|
|
- this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
|
- }
|
|
|
- },
|
|
|
- async policyColumn({ ...info } = {}) {
|
|
|
- const res = await this.policyColumns({ ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `liebiaoList`, res.data);
|
|
|
- }
|
|
|
- },
|
|
|
- async searchInfojobs({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- const res = await this.policyNew({ skip, limit, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `canmoData`, res.data);
|
|
|
- }
|
|
|
- },
|
|
|
- submit({ id }) {
|
|
|
- this.$set(this, `leftId`, id);
|
|
|
- this.display = 'list';
|
|
|
- this.searchRight();
|
|
|
- },
|
|
|
- async searchRight({ skip = 0, limit = 10, column_id } = {}) {
|
|
|
- const res = await this.policyNew({ skip, limit, column_id: this.leftId });
|
|
|
- for (const val of res.data) {
|
|
|
- const result = await this.policyfetch(val.column_id);
|
|
|
- val.column_name = result.data.name;
|
|
|
- }
|
|
|
- this.$set(this, `contentList`, res.data);
|
|
|
- this.$set(this, `total`, res.data.length);
|
|
|
- for (const val of res.data) {
|
|
|
- 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);
|
|
|
- const result = await this.policyfetch(res.data.column_id);
|
|
|
- this.$set(this, `columnTitle`, result.data.name);
|
|
|
- this.$set(this, `policyInfo`, res.data);
|
|
|
- // 查询详情,赋值
|
|
|
- },
|
|
|
- clickDetailcm({ data }) {
|
|
|
- // 点击这个方法,跳转页面,并把id传过去,并用id查询详情
|
|
|
- this.$router.push({ path: '/personnel/personnelwork', query: { id: data.id } });
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped></style>
|