Skip to content

Commit

Permalink
Merge branch 'master' of github.com:szuprefix/vue-django
Browse files Browse the repository at this point in the history
  • Loading branch information
szuprefix committed Jun 12, 2021
2 parents 91797d5 + 7e10a98 commit 6bf6a19
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
15 changes: 11 additions & 4 deletions src/components/mobile/Tabbar.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<template>
<tabbar v-show="show" style="position: fixed;" v-on="$listeners">
<tabbar-item :show-dot="t.showDot" :selected="t.link === $route.fullPath" :badge="t.badge" v-for="t in tabItems" :link="t.link" :key="t.name">
<i slot="icon" :class="`iconfont icon-${t.icon}`"></i>
<span slot="label">{{t.label}}</span>
<tabbar v-show="show" style="position: fixed;" v-bind="[$attrs]" v-on="$listeners">
<tabbar-item :show-dot="t.showDot" :selected="t.link === $route.fullPath" :badge="t.badge" v-for="t in tabItems"
:link="t.link" :key="t.name">
<template #icon>
<component v-if="t.iconComponent" :is="t.iconComponent" v-bind="[t]"></component>
<i :class="t.iconClass || `iconfont icon-${t.icon}`"></i>
</template>
<template #label>
<component v-if="t.labelComponent" :is="t.labelComponent" v-bind="[t]"></component>
<span :class="$attrs.labelClass" v-else>{{t.label}}</span>
</template>
</tabbar-item>
</tabbar>
</template>
Expand Down
5 changes: 4 additions & 1 deletion src/components/mobile/model/Cells.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<template>
<div>
<group :title="group.title" v-for="group in groups" :key="group.title">
<group v-bind="[$attrs, $props]" :title="group.title" v-for="group in groups" :key="group.title">
<cell :title="c.name" :is-link="true" :link="getLink(c)" v-for="c, i in group.cells"
:key="c.id">
<template slot="icon" v-if="$scopedSlots.icon">
<slot name="icon" :data="c"></slot>
</template>
<template v-if="$scopedSlots.title" v-slot:title="scope">
<slot name="title" :data="c"></slot>
</template>
</cell>
</group>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/components/mobile/model/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<template v-if="$scopedSlots.icon" v-slot:icon="scope">
<slot name="icon" v-bind="scope"></slot>
</template>
<template v-if="$scopedSlots.title" v-slot:title="scope">
<slot name="title" v-bind="scope"></slot>
</template>
</cells>
</slot>
<load-more :tip="tip" :show-loading="loading" v-if="currentPageSize < count"></load-more>
Expand Down
13 changes: 9 additions & 4 deletions src/components/mobile/model/Relations.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<div>
<tab v-model="tab" :animate="false">
<tab-item :active-class="`active-${i%4+1}`" :badge-label="badges[a.name]" v-for="a, i in tabItems" :key="a.name">{{a.label}}</tab-item>
<tab-item :active-class="`active-${i%4+1}`" :badge-label="badges[a.name]" v-for="a, i in tabItems"
:key="a.name">{{a.label}}
</tab-item>
</tab>
<component :is="tabItems[tab].component" :owner="owner" v-bind="[$attrs, tabItems[tab]]"
v-if="loaded"></component>
Expand Down Expand Up @@ -40,9 +42,11 @@
a.component = a.component || `${a.name.replace('.', '/')}/components/List`
if (a.getAsyncInfo) {
a.getAsyncInfo().then(info => {
this.badges[a.name] = info.badge
this.badges={...this.badges}
this.$emit('syncinfo', info)
if (info) {
this.badges[a.name] = info.badge
this.badges = {...this.badges}
this.$emit('syncinfo', info)
}
})
}
return a
Expand Down Expand Up @@ -88,6 +92,7 @@
color: rgb(55, 174, 252) !important;
border-color: rgb(55, 174, 252) !important;
}
.active-4 {
color: darkorange !important;
border-color: darkorange !important;
Expand Down
13 changes: 11 additions & 2 deletions src/utils/dailylog.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import axios from 'axios'
import Qs from 'qs'
import {parseTime} from './filters'
let INTERVAL = 5
function DailyLog () {
function DailyLog() {
let a = {
m: {},
saveTime: undefined,
Expand Down Expand Up @@ -41,7 +41,7 @@ export default DailyLog()
// }
// })

export function Performance (app, model, ownerId, target, interval) {
export function Performance(app, model, ownerId, target, interval) {
let qd = {app, model, owner_id: ownerId}
return {
data: {
Expand Down Expand Up @@ -85,3 +85,12 @@ export function Performance (app, model, ownerId, target, interval) {
}
}
}

export function userOnlineTimeCounter(callBack) {
let seconds = 30
function action () {
axios.post(`/dailylog/user/count/`, {metics: 'online_time', delta: seconds}).then(callBack)
}
action()
setInterval(action, seconds * 1000)
}

0 comments on commit 6bf6a19

Please sign in to comment.