|
@@ -14,7 +14,7 @@
|
|
|
<project-list class="m-40" @getMore="$router.push('/big_subscribe')"></project-list>
|
|
|
</div>
|
|
|
</forLayOut>
|
|
|
- <div class="flex-c-c float-side-group-for-right">
|
|
|
+ <div class="flex-c-c float-side-group-for-right" data-backside>
|
|
|
<float-side v-for="floatSide in getFloatList"
|
|
|
@toggle="toggleFloatSideShow" @more="goFloatSideMore" @info="goFloatSideInfo"
|
|
|
:float-side="floatSide" :key="floatSide.title">
|
|
@@ -32,6 +32,8 @@ import ProjectList from '@/components/push-list/ProjectList.vue'
|
|
|
import FloatSide from '@/components/home/FloatSide.vue'
|
|
|
import { getReportIndex, getReportStartTime, getSimpleFollowList } from '@/api/modules/'
|
|
|
import moment from 'moment'
|
|
|
+import 'moment/locale/zh-cn'
|
|
|
+moment.locale('zh-cn')
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
components: {
|
|
@@ -63,7 +65,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
text: '潜在竞争对手 合作伙伴挖掘',
|
|
|
- to: '/potential_cor_list/r'
|
|
|
+ to: '/potential_rival_list/r'
|
|
|
}
|
|
|
],
|
|
|
floatSideList: [
|
|
@@ -143,6 +145,15 @@ export default {
|
|
|
now: new Date().getTime()
|
|
|
},
|
|
|
formatFn: (time) => moment(time).format('YYYY'),
|
|
|
+ checkMaxFn: (endTime) => {
|
|
|
+ const nowDate = moment(endTime)
|
|
|
+ const maxData = moment()
|
|
|
+ let result = true
|
|
|
+ if (maxData.year() === nowDate.year() && maxData.month() === nowDate.month()) {
|
|
|
+ result = false
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ },
|
|
|
checkFn: (config) => {
|
|
|
const minDate = moment(config.params.min)
|
|
|
const nowDate = moment(config.params.now)
|
|
@@ -165,6 +176,15 @@ export default {
|
|
|
now: new Date().getTime()
|
|
|
},
|
|
|
formatFn: (time) => moment(time).format('YYYYMM'),
|
|
|
+ checkMaxFn: (endTime) => {
|
|
|
+ const nowDate = moment(endTime)
|
|
|
+ const maxData = moment()
|
|
|
+ let result = true
|
|
|
+ if (maxData.year() === nowDate.year() && maxData.month() === nowDate.month() && maxData.week() === nowDate.week()) {
|
|
|
+ result = false
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ },
|
|
|
checkFn: (config) => {
|
|
|
const minDate = moment(config.params.min)
|
|
|
const nowDate = moment(config.params.now)
|
|
@@ -194,9 +214,11 @@ export default {
|
|
|
start: v.startdate,
|
|
|
end: v.enddate
|
|
|
}
|
|
|
+ }).filter(v => {
|
|
|
+ return config.checkMaxFn(v.end * 1000)
|
|
|
}))
|
|
|
nowObj.list = nowList.slice(0, nowObj.maxLength)
|
|
|
- if (nowList.length < nowObj.maxLength) {
|
|
|
+ if (nowList.length !== 0 && nowList.length < nowObj.maxLength) {
|
|
|
const nowParams = config.checkFn(config)
|
|
|
if (nowParams) {
|
|
|
return this.getWeeksOrMonths(Object.assign({}, config, { params: nowParams }))
|
|
@@ -286,6 +308,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ const ClientHeight = $(window).height() / 100
|
|
|
+ let maxH = 2
|
|
|
+ if (ClientHeight > 8) {
|
|
|
+ maxH = 4
|
|
|
+ } else if (ClientHeight > 6) {
|
|
|
+ maxH = 3
|
|
|
+ }
|
|
|
+ this.floatSideList[0].maxLength = maxH
|
|
|
+ this.floatSideList[1].maxLength = maxH
|
|
|
+ this.floatSideList[2].maxLength = maxH + 1
|
|
|
if (this.checkAuthPower(12)) {
|
|
|
this.getSimpleFollowList()
|
|
|
}
|
|
@@ -359,10 +391,16 @@ export default {
|
|
|
@include diy-icon('home_#{$i}', 44, 44);
|
|
|
}
|
|
|
.float-side-group-for-right {
|
|
|
+ transition: all 0.75s;
|
|
|
position: fixed;
|
|
|
bottom: 20px;
|
|
|
right: 8px;
|
|
|
align-items: flex-end;
|
|
|
+ z-index: 667;
|
|
|
+ pointer-events: none;
|
|
|
+ * {
|
|
|
+ pointer-events: auto;
|
|
|
+ }
|
|
|
::v-deep .float-side-group + .float-side-group{
|
|
|
margin-top: 20px;
|
|
|
}
|