|
@@ -8,8 +8,8 @@
|
|
|
<p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">{{ item.name }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col v-if="menuIndex == '0'" :span="19" class="info">
|
|
|
- <el-col class="leftInfo">
|
|
|
+ <el-col :span="19" class="info">
|
|
|
+ <el-col v-if="menuIndex == '0'" class="leftInfo">
|
|
|
<el-col :span="24" class="leftTop">
|
|
|
<span>|</span> <span>{{ menuName }}</span>
|
|
|
</el-col>
|
|
@@ -21,21 +21,7 @@
|
|
|
</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col class="page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page.sync="currentPage"
|
|
|
- :page-size="10"
|
|
|
- layout="total,prev, pager, next, jumper"
|
|
|
- :total="1000"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col v-if="menuIndex == '1'" :span="19" class="info">
|
|
|
- <el-col class="leftInfo">
|
|
|
+ <el-col v-if="menuIndex == '1'" class="leftInfo">
|
|
|
<el-col :span="24" class="leftTop">
|
|
|
<span>|</span> <span>{{ menuName }}</span>
|
|
|
</el-col>
|
|
@@ -46,21 +32,7 @@
|
|
|
</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col class="page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page.sync="currentPage"
|
|
|
- :page-size="10"
|
|
|
- layout="total,prev, pager, next, jumper"
|
|
|
- :total="1000"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col v-if="menuIndex == '2'" :span="19" class="info">
|
|
|
- <el-col class="leftInfo">
|
|
|
+ <el-col v-if="menuIndex == '2'" class="leftInfo">
|
|
|
<el-col :span="24" class="leftTop">
|
|
|
<span>|</span> <span>{{ menuName }}</span>
|
|
|
</el-col>
|
|
@@ -71,21 +43,7 @@
|
|
|
</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col class="page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page.sync="currentPage"
|
|
|
- :page-size="10"
|
|
|
- layout="total,prev, pager, next, jumper"
|
|
|
- :total="1000"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
- <el-col v-if="menuIndex == '3'" :span="19" class="info">
|
|
|
- <el-col class="leftInfo">
|
|
|
+ <el-col v-if="menuIndex == '3'" class="leftInfo">
|
|
|
<el-col :span="24" class="leftTop">
|
|
|
<span>|</span> <span>{{ menuName }}</span>
|
|
|
</el-col>
|
|
@@ -103,9 +61,9 @@
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page.sync="currentPage"
|
|
|
- :page-size="10"
|
|
|
+ :page-size="pageSize"
|
|
|
layout="total,prev, pager, next, jumper"
|
|
|
- :total="1000"
|
|
|
+ :total="pageTotal"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</el-col>
|
|
@@ -115,6 +73,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import _ from 'lodash';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: news } = createNamespacedHelpers('news');
|
|
|
export default {
|
|
|
name: 'list',
|
|
|
props: {},
|
|
@@ -126,6 +87,8 @@ export default {
|
|
|
menuName: '专题研讨',
|
|
|
menuColor: 'rgb(254, 149, 14)',
|
|
|
currentPage: 1,
|
|
|
+ pageSize: 0,
|
|
|
+ pageTotal: 0,
|
|
|
zhuantiList: [
|
|
|
{
|
|
|
publish_time: '2020-05-01',
|
|
@@ -183,6 +146,7 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
+ ...news(['query']),
|
|
|
async searchList({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
if (this.$route.query.column_name == '专题研讨') {
|
|
|
this.changeMenu(this.$route.query.column_name, 0);
|
|
@@ -194,12 +158,32 @@ export default {
|
|
|
this.changeMenu(this.$route.query.column_name, 3);
|
|
|
}
|
|
|
},
|
|
|
- changeMenu(name, index) {
|
|
|
- console.log(name);
|
|
|
- console.log(index);
|
|
|
+ async changeMenu(name, index) {
|
|
|
this.menuIndex = index;
|
|
|
this.menuColor = 'rgb(254, 149, 14)';
|
|
|
this.menuName = name;
|
|
|
+ console.log(name);
|
|
|
+ this.initList({ name });
|
|
|
+ },
|
|
|
+ async initList({ name, skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let res = [];
|
|
|
+ console.log(name);
|
|
|
+ if (name == '专题研讨') {
|
|
|
+ res = await this.query({ skip, limit, column_name: '专题研讨', ...info });
|
|
|
+ this.$set(this, `zhuantiList`, res.data);
|
|
|
+ } else if (name == '技术问答') {
|
|
|
+ res = await this.query({ skip, limit, column_name: '技术问答', ...info });
|
|
|
+ this.$set(this, `jishuList`, res.data);
|
|
|
+ } else if (name == '行业研究') {
|
|
|
+ res = await this.query({ skip, limit, column_name: '行业研究', ...info });
|
|
|
+ this.$set(this, `hangyeList`, res.data);
|
|
|
+ } else if (name == '教育培训') {
|
|
|
+ res = await this.query({ skip, limit, column_name: '教育培训', ...info });
|
|
|
+ this.$set(this, `jiaoyuList`, res.data);
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+
|
|
|
+ this.$set(this, `pageTotal`, res.total);
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
console.log(`每页 ${val} 条`);
|