|
@@ -3,7 +3,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main">
|
|
|
<el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
|
|
|
- <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detail(item)">
|
|
|
<el-col :span="24" class="title">
|
|
|
{{ item.title }}
|
|
|
</el-col>
|
|
@@ -17,9 +17,6 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col :span="24" class="foot">
|
|
|
- <page :limit="limit" :total="total" @search="search"></page>
|
|
|
- </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -27,80 +24,32 @@
|
|
|
|
|
|
<script>
|
|
|
const moment = require('moment');
|
|
|
-import page from '@/layout/common/page.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions: ExpertView } = createNamespacedHelpers('ExpertView');
|
|
|
export default {
|
|
|
name: 'expert',
|
|
|
- props: {},
|
|
|
- components: {
|
|
|
- page,
|
|
|
+ props: {
|
|
|
+ list: { type: Array },
|
|
|
},
|
|
|
+ components: {},
|
|
|
data: function () {
|
|
|
return {
|
|
|
clientHeight: '',
|
|
|
- list: [
|
|
|
- {
|
|
|
- title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
|
|
|
- origin: '信息来源',
|
|
|
- meta: {
|
|
|
- createdAt: '2021-01-01',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
|
|
|
- origin: '信息来源',
|
|
|
- meta: {
|
|
|
- createdAt: '2021-01-01',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
|
|
|
- origin: '信息来源',
|
|
|
- meta: {
|
|
|
- createdAt: '2021-01-01',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
|
|
|
- origin: '信息来源',
|
|
|
- meta: {
|
|
|
- createdAt: '2021-01-01',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题信息标题',
|
|
|
- origin: '信息来源',
|
|
|
- meta: {
|
|
|
- createdAt: '2021-01-01',
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- total: 0,
|
|
|
- limit: '10',
|
|
|
};
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.search();
|
|
|
- },
|
|
|
+ async created() {},
|
|
|
methods: {
|
|
|
- ...ExpertView(['query']),
|
|
|
- async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
|
- let res = await this.query({ skip, limit, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
- }
|
|
|
- },
|
|
|
getTime(data) {
|
|
|
return moment(_.get(data, 'meta.createdAt')).format('YYYY-MM-DD HH:mm:ss');
|
|
|
},
|
|
|
+ // 查看详情
|
|
|
+ detail(data) {
|
|
|
+ this.$router.push({ path: '/education/expertDetail', query: { id: data.id } });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 130;
|
|
|
this.$set(this, `clientHeight`, clientHeight);
|
|
|
},
|
|
|
-
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|
|
@@ -133,6 +82,12 @@ export default {
|
|
|
font-size: 15px;
|
|
|
font-weight: bold;
|
|
|
margin: 0 0 4px 0;
|
|
|
+ // overflow: hidden;
|
|
|
+ // text-overflow: ellipsis;
|
|
|
+ // -webkit-line-clamp: 2;
|
|
|
+ // word-break: break-all;
|
|
|
+ // display: -webkit-box;
|
|
|
+ // -webkit-box-orient: vertical;
|
|
|
}
|
|
|
.other {
|
|
|
p {
|