commit
b4f146f7b7
@ -30,6 +30,10 @@ export default {
|
|||||||
monitor: {
|
monitor: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
taskCount: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -46,17 +50,18 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
getTaskProgress().then(res => {
|
||||||
|
this.dataList = res.data
|
||||||
|
this.$emit('update:task-count', this.dataList.length > 0)
|
||||||
|
})
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
data(val) {
|
data(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.dataList = val
|
this.dataList = val
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
getTaskProgress().then(res => {
|
|
||||||
this.dataList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
message(msg) {
|
message(msg) {
|
||||||
if (this.monitor && msg.event === 'msg/taskCountChange') {
|
if (this.monitor && msg.event === 'msg/taskCountChange') {
|
||||||
this.dataList = msg.data
|
this.dataList = msg.data
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
width="600"
|
width="600"
|
||||||
trigger="hover">
|
trigger="hover">
|
||||||
<TaskProgress/>
|
<TaskProgress :task-count.sync="taskCount"/>
|
||||||
<div slot="reference" class="right-content-button" v-show="showTaskProgress > 0">
|
<div slot="reference" class="right-content-button" v-show="showTaskProgress > 0 || taskCount > 0">
|
||||||
<svg-icon icon-class="gengxinjindu" :class="progressExecuting ? 'rotate' : ''"></svg-icon>
|
<svg-icon icon-class="gengxinjindu" :class="progressExecuting ? 'rotate' : ''"></svg-icon>
|
||||||
{{ $t('app.taskProgress') }}
|
{{ $t('app.taskProgress') }}
|
||||||
</div>
|
</div>
|
||||||
@ -76,6 +76,7 @@ export default {
|
|||||||
imageUrl: `${process.env.VUE_APP_BASE_API}/view/thumbnail?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}&id=`,
|
imageUrl: `${process.env.VUE_APP_BASE_API}/view/thumbnail?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}&id=`,
|
||||||
defaultAvatar: require('../../assets/img/default-avatar.png'),
|
defaultAvatar: require('../../assets/img/default-avatar.png'),
|
||||||
showTaskProgress: false,
|
showTaskProgress: false,
|
||||||
|
taskCount: 0,
|
||||||
progressExecuting: false,
|
progressExecuting: false,
|
||||||
delayedHidden: null
|
delayedHidden: null
|
||||||
}
|
}
|
||||||
@ -120,11 +121,12 @@ export default {
|
|||||||
if (msg.event === 'msg/taskCountChange') {
|
if (msg.event === 'msg/taskCountChange') {
|
||||||
this.taskCountChange(msg.data.length)
|
this.taskCountChange(msg.data.length)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
taskCount(count) {
|
||||||
|
this.progressExecuting = count > 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelect(key, keyPath) {
|
|
||||||
},
|
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user