|
@@ -14,30 +14,50 @@
|
|
|
<el-col :span="18" class="listInfo">
|
|
|
<span v-if="display == 'list'">
|
|
|
<span v-if="menuIndex == 'kjzx'">
|
|
|
- <listindex :newsList="kjzxList" :total="kjzxtotal" :column_name="column_name"></listindex>
|
|
|
+ <listindex :newsList="kjzxList" :total="kjzxtotal" :column_name="column_name" @clickDetail="clickDetail"></listindex>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'gzdt'">
|
|
|
- <listindex :newsList="gzdtList" :total="gzdttotal" :column_name="column_name"></listindex>
|
|
|
+ <listindex :newsList="gzdtList" :total="gzdttotal" :column_name="column_name" @clickDetail="clickDetail"></listindex>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'tztg'">
|
|
|
- <listindex :newsList="tztgList" :total="tztgtotal" :column_name="column_name"></listindex>
|
|
|
+ <listindex :newsList="tztgList" :total="tztgtotal" :column_name="column_name" @clickDetail="clickDetail"></listindex>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'jsqy'">
|
|
|
- <listindex :newsList="jsqyList" :total="jsqytotal" :column_name="column_name"></listindex>
|
|
|
+ <listindex :newsList="jsqyList" :total="jsqytotal" :column_name="column_name" @clickDetail="clickDetail"></listindex>
|
|
|
</span>
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
<span v-if="menuIndex == 'kjzx'">
|
|
|
- 科技咨讯详情
|
|
|
+ <el-col :span="24" style="text-align:right;">
|
|
|
+ <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <detailinfo :info="info"></detailinfo>
|
|
|
+ </el-col>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'gzdt'">
|
|
|
- 工作动态详情
|
|
|
+ <el-col :span="24" style="text-align:right;">
|
|
|
+ <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <detailinfo :info="info"></detailinfo>
|
|
|
+ </el-col>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'tztg'">
|
|
|
- 通知通告详情
|
|
|
+ <el-col :span="24" style="text-align:right;">
|
|
|
+ <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <detailinfo :info="info"></detailinfo>
|
|
|
+ </el-col>
|
|
|
</span>
|
|
|
<span v-else-if="menuIndex == 'jsqy'">
|
|
|
- 技术前沿详情
|
|
|
+ <el-col :span="24" style="text-align:right;">
|
|
|
+ <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <detailinfo :info="info"></detailinfo>
|
|
|
+ </el-col>
|
|
|
</span>
|
|
|
</span>
|
|
|
</el-col>
|
|
@@ -49,7 +69,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import listindex from './list/index.vue';
|
|
|
+import listindex from './news/index.vue';
|
|
|
+import detailinfo from './news/detail.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: journcolumn } = createNamespacedHelpers('journcolumn');
|
|
|
const { mapActions: journnews } = createNamespacedHelpers('journnews');
|
|
@@ -61,6 +82,7 @@ export default {
|
|
|
props: {},
|
|
|
components: {
|
|
|
listindex,
|
|
|
+ detailinfo,
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
@@ -79,7 +101,10 @@ export default {
|
|
|
tztgtotal: 0,
|
|
|
jsqyList: [],
|
|
|
jsqytotal: 0,
|
|
|
+ // 栏目名称
|
|
|
column_name: '',
|
|
|
+ // 详情
|
|
|
+ info: {},
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -87,7 +112,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...journcolumn({ journcolumnQuery: 'query' }),
|
|
|
- ...journnews(['query', 'create', 'update', 'delete']),
|
|
|
+ ...journnews(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
// 查询栏目
|
|
|
async searchcol() {
|
|
|
let res = await this.journcolumnQuery();
|
|
@@ -100,7 +125,7 @@ export default {
|
|
|
if (this.id) {
|
|
|
// 查询详情
|
|
|
this.display = 'detail';
|
|
|
- this.searchDetail(column.title, this.id);
|
|
|
+ this.searchDetail(this.id);
|
|
|
} else {
|
|
|
// 查询列表
|
|
|
this.display = 'list';
|
|
@@ -129,8 +154,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 查询详情
|
|
|
- searchDetail() {
|
|
|
- console.log('查询详情');
|
|
|
+ async searchDetail(id) {
|
|
|
+ let res = await this.fetch(id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点击查看详情
|
|
|
+ clickDetail({ id }) {
|
|
|
+ this.display = 'detail';
|
|
|
+ this.searchDetail(id);
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -186,7 +219,7 @@ export default {
|
|
|
.listInfo {
|
|
|
float: right;
|
|
|
width: 78%;
|
|
|
- height: 685px;
|
|
|
+ min-height: 685px;
|
|
|
overflow: hidden;
|
|
|
box-shadow: 0 0 10px #2d64b3;
|
|
|
padding: 10px;
|