Browse Source

列表详情修改

master
song 3 years ago
parent
commit
be80cff0e9
  1. 2
      src/components/LeftNav/LeftNav.vue
  2. 4
      src/views/CompanyProfile/CompanyProfile.vue
  3. 4
      src/views/NewPages/NewPages.vue
  4. 10
      src/views/OtherPages/Department.vue
  5. 49
      src/views/OtherPages/Information.vue
  6. 4
      src/views/OtherPages/NoticeNotice.vue
  7. 4
      src/views/OtherPages/PartyBuilding.vue
  8. 5
      src/views/OtherPages/PilePages.vue
  9. 4
      src/views/OtherPages/SafeProduction.vue
  10. 76
      src/views/OtherPages/System.vue

2
src/components/LeftNav/LeftNav.vue

@ -65,7 +65,7 @@ export default {
if (!url) {
if (this.code && code !== this.code) {
this.$router.push({ query: { code: childCode } });
this.$emit('chanegCode', code);
this.$emit('changeCode', code);
this.childCode = code;
} else if (code === this.code) {
const path = window.location.href.split('?')

4
src/views/CompanyProfile/CompanyProfile.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -93,7 +93,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
},
resetData() {

4
src/views/NewPages/NewPages.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -217,7 +217,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
this.introId = '';
},

10
src/views/OtherPages/Department.vue

@ -3,11 +3,11 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<template v-if="code.length === 6 && (code.split('')[5] === '4' || code.split('')[5] === '6')">
<template v-if="code.length === 6 && (code.split('')[5] === '4' || code.split('')[5] === '6' || code.split('')[5] === '7' || code.split('')[5] === '8')">
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" />
</template>
<RichText v-else :rich-obj="content" />
@ -656,7 +656,7 @@ export default {
if (this.$route.path === this.list.url) {
this.code = val;
this.getDetault(val);
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6')) {
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6' || this.code.split('')[5] === '7' || this.code.split('')[5] === '8')) {
this.getContentData(this.code);
} else {
this.getData(this.code);
@ -667,7 +667,7 @@ export default {
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6')) {
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6' || this.code.split('')[5] === '7' || this.code.split('')[5] === '8')) {
this.getContentData(this.code);
} else {
this.getData(this.code);
@ -725,7 +725,7 @@ export default {
this.pageNum = pageNum;
this.getContentData();
},
chanegCode(code) {
changeCode(code) {
this.code = code;
},
changeYear(year, code) {

49
src/views/OtherPages/Information.vue

@ -3,11 +3,14 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<RichText :rich-obj="content" />
<template v-if="code.length === 6 && (code.split('')[5] === '4' || code.split('')[5] === '6' || code.split('')[5] === '7' || code.split('')[5] === '8')">
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" />
</template>
<RichText v-else :rich-obj="content" />
</div>
</div>
</div>
@ -20,9 +23,10 @@ import { mapActions } from 'vuex';
import LeftNav from '@/components/LeftNav/LeftNav.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
export default {
components: { LeftNav, RichText, Location },
components: { LeftNav, RichText, Location, ListPage },
data() {
return {
code: '0601',
@ -97,6 +101,8 @@ export default {
},
],
},
year: '2022',
pageNum: 1,
content: {},
};
},
@ -105,17 +111,25 @@ export default {
if (this.$route.path === this.list.url) {
this.code = val;
this.getDetault(val);
if (this.code.length === 6 && ((this.code === '060101' || this.code === '060503'))) {
this.getContentData(this.code);
} else {
this.getData(this.code);
}
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.code.length === 6 && ((this.code === '060101' || this.code === '060503'))) {
this.getContentData(this.code);
} else {
this.getData(this.code);
}
},
methods: {
...mapActions('home', ['getDetail']),
...mapActions('home', ['getDetail', 'getContent']),
//
getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) {
@ -144,12 +158,35 @@ export default {
this.content = data || {};
} catch (error) {}
},
async getContentData() {
try {
const params = {
showPage: this.code,
year: this.year,
showType: 0,
pageNum: this.pageNum,
pageSize: 10,
};
const data = await this.getContent(params);
console.log('data: ', data);
} catch (error) {}
},
resetData() {
this.getData();
this.pageNum = 1;
this.getContentData();
},
chanegCode(code) {
getNumData(pageNum) {
console.log('pageNum: ', pageNum);
this.pageNum = pageNum;
this.getContentData();
},
changeCode(code) {
this.code = code;
},
changeYear(year, code) {
this.year = year;
this.getContentData(code);
},
},
};
</script>

4
src/views/OtherPages/NoticeNotice.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -125,7 +125,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
this.introId = '';
},

4
src/views/OtherPages/PartyBuilding.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -129,7 +129,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
this.introId = '';
},

5
src/views/OtherPages/PilePages.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -93,7 +93,6 @@ export default {
pageSize: 10,
};
const data = await this.getContent(param);
console.log('data: ', data);
this.content = data;
} catch (error) {}
},
@ -114,7 +113,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
this.introId = '';
},

4
src/views/OtherPages/SafeProduction.vue

@ -3,7 +3,7 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
@ -128,7 +128,7 @@ export default {
console.error('error: ', error);
}
},
chanegCode(code) {
changeCode(code) {
this.code = code;
this.introId = '';
},

76
src/views/OtherPages/System.vue

@ -3,11 +3,14 @@
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" />
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<RichText :rich-obj="content" />
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
@ -18,11 +21,12 @@
<script>
import { mapActions } from 'vuex';
import LeftNav from '@/components/LeftNav/LeftNav.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, RichText, Location },
components: { LeftNav, ListPage, Relevant, Location },
data() {
return {
code: '0801',
@ -65,7 +69,11 @@ export default {
},
],
},
year: '2022',
content: {},
pageNum: 1,
introId: '',
introContent: {},
};
},
watch: {
@ -73,17 +81,22 @@ export default {
if (this.$route.path === this.list.url) {
this.code = val;
this.getDetault(val);
this.getData(this.code);
this.getContentData(this.code);
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
this.getData(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
}
this.getContentData();
},
methods: {
...mapActions('home', ['getDetail']),
...mapActions('home', ['getContent', 'getDetail']),
//
getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) {
@ -92,22 +105,49 @@ export default {
}
}
},
async getData(showPage) {
resetData() {
this.pageNum = 1;
this.getContentData();
},
changeCode(code) {
this.code = code;
},
changeYear(year) {
this.year = year;
this.getContentData();
},
getData(pageNum) {
this.pageNum = pageNum;
this.getContentData();
},
async getContentData() {
try {
const param = {
showPage,
introId: '',
showPage: this.code,
year: this.year,
showType: '0',
pageNum: this.pageNum,
pageSize: 10,
};
const data = await this.getDetail(param);
this.content = data || {};
const data = await this.getContent(param);
this.content = data;
} catch (error) {}
},
resetData() {
this.pageNum = 1;
this.getData(this.code);
},
chanegCode(code) {
this.code = code;
//
async getIntroContent() {
try {
const param = {
showPage: '',
introId: this.introId,
};
const data = await this.getDetail(param);
this.introContent = data || {};
} catch (error) {
console.error('error: ', error);
}
},
},
};

Loading…
Cancel
Save