|
@@ -6,14 +6,14 @@
|
|
<el-col :span="16" class="one_1">
|
|
<el-col :span="16" class="one_1">
|
|
<el-carousel height="500px">
|
|
<el-carousel height="500px">
|
|
<el-carousel-item v-for="(item, index) in bannerList" :key="index">
|
|
<el-carousel-item v-for="(item, index) in bannerList" :key="index">
|
|
- <el-image class="image" :src="item.url"></el-image>
|
|
|
|
|
|
+ <el-image class="image" :src="item.img_url && item.img_url.length > 0 ? item.img_url[0].url : ''"></el-image>
|
|
</el-carousel-item>
|
|
</el-carousel-item>
|
|
</el-carousel>
|
|
</el-carousel>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8" class="one_2">
|
|
<el-col :span="8" class="one_2">
|
|
<el-col :span="24" class="newsList" v-for="(item, index) in newsList" :key="index">
|
|
<el-col :span="24" class="newsList" v-for="(item, index) in newsList" :key="index">
|
|
<el-col :span="24" class="title textOver">{{ item.title }}</el-col>
|
|
<el-col :span="24" class="title textOver">{{ item.title }}</el-col>
|
|
- <el-col :span="24" class="date">{{ item.date }}</el-col>
|
|
|
|
|
|
+ <el-col :span="24" class="date">{{ item.create_time }}</el-col>
|
|
<el-col :span="24" class="brief">{{ item.brief }}</el-col>
|
|
<el-col :span="24" class="brief">{{ item.brief }}</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -28,13 +28,13 @@
|
|
<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">
|
|
<el-col :span="2" class="date">
|
|
<el-col :span="2" class="date">
|
|
<p>
|
|
<p>
|
|
- <span>{{ getDate(item.date, 'day') }}</span>
|
|
|
|
- <span>{{ getDate(item.date, 'year') }}</span>
|
|
|
|
|
|
+ <span>{{ getDate(item.create_time, 'day') }}</span>
|
|
|
|
+ <span>{{ getDate(item.create_time, 'year') }}</span>
|
|
</p>
|
|
</p>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="2" class="info">
|
|
<el-col :span="2" class="info">
|
|
- <el-col :span="24" class="title">{{ item.name }}</el-col>
|
|
|
|
- <el-col :span="24" class="brief">{{ item.path || '暂无' }}</el-col>
|
|
|
|
|
|
+ <el-col :span="24" class="title">{{ item.title }}</el-col>
|
|
|
|
+ <el-col :span="24" class="brief">{{ item.brief || '暂无' }}</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="page">
|
|
<el-col :span="24" class="page">
|
|
@@ -49,9 +49,9 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
-const { mapActions } = createNamespacedHelpers('program');
|
|
|
|
|
|
+const { mapActions: banner } = createNamespacedHelpers('banner');
|
|
|
|
+const { mapActions: news } = createNamespacedHelpers('news');
|
|
const moment = require('moment');
|
|
const moment = require('moment');
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
@@ -59,42 +59,23 @@ export default {
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
// 轮播图
|
|
// 轮播图
|
|
- bannerList: [{ url: require('@a/news_1.jpg') }],
|
|
|
|
|
|
+ bannerList: [],
|
|
// 新闻
|
|
// 新闻
|
|
- newsList: [
|
|
|
|
- {
|
|
|
|
- title: '软件定义一切 下一个数据中心模式?',
|
|
|
|
- date: '2023-02-02',
|
|
|
|
- brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '软件定义一切 下一个数据中心模式?',
|
|
|
|
- date: '2023-02-02',
|
|
|
|
- brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '软件定义一切 下一个数据中心模式?',
|
|
|
|
- date: '2023-02-02',
|
|
|
|
- brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '软件定义一切 下一个数据中心模式?',
|
|
|
|
- date: '2023-02-02',
|
|
|
|
- brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ newsList: [],
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
limit: 6,
|
|
limit: 6,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ this.searchOther();
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['query']),
|
|
|
|
|
|
+ ...banner({ bQuery: 'query' }),
|
|
|
|
+ ...news({ nQuery: 'query' }),
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
- let res = await this.query({ skip, limit, ...info });
|
|
|
|
|
|
+ let res = await this.nQuery({ skip, limit, ...info });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, `list`, res.data);
|
|
this.$set(this, `list`, res.data);
|
|
this.$set(this, `total`, res.total);
|
|
this.$set(this, `total`, res.total);
|
|
@@ -112,6 +93,19 @@ export default {
|
|
else '暂无';
|
|
else '暂无';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async searchOther() {
|
|
|
|
+ let res;
|
|
|
|
+ // 轮播图
|
|
|
|
+ res = await this.bQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `bannerList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ // 新闻
|
|
|
|
+ res = await this.nQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `newsList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|