mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 03:03:41 +00:00
perf: 优化查看汇报详情loading
This commit is contained in:
parent
d96e9f4daa
commit
6f7f29118f
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="report-detail">
|
<div class="report-detail">
|
||||||
<div class="report-title">{{ data.title }}</div>
|
<div class="report-title">
|
||||||
|
{{ data.title }}
|
||||||
|
<Icon v-if="loadIng > 0" type="ios-loading" class="icon-loading"></Icon>
|
||||||
|
</div>
|
||||||
<div class="report-detail-context">
|
<div class="report-detail-context">
|
||||||
<Form class="report-form" label-width="auto" inline>
|
<Form class="report-form" label-width="auto" inline>
|
||||||
<FormItem :label="$L('汇报人')">
|
<FormItem :label="$L('汇报人')">
|
||||||
@ -10,7 +13,8 @@
|
|||||||
{{ data.created_at }}
|
{{ data.created_at }}
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem :label="$L('汇报对象')">
|
<FormItem :label="$L('汇报对象')">
|
||||||
<UserAvatar v-for="(item, key) in data.receives_user" :key="key" :userid="item.userid" :size="28"/>
|
<template v-if="data.receives_user.length === 0">-</template>
|
||||||
|
<UserAvatar v-else v-for="(item, key) in data.receives_user" :key="key" :userid="item.userid" :size="28"/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<Form class="report-form" label-width="auto">
|
<Form class="report-form" label-width="auto">
|
||||||
@ -30,6 +34,11 @@ export default {
|
|||||||
default: {},
|
default: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loadIng: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'data.id': {
|
'data.id': {
|
||||||
handler(id) {
|
handler(id) {
|
||||||
@ -40,6 +49,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendRead() {
|
sendRead() {
|
||||||
|
this.loadIng++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'report/read',
|
url: 'report/read',
|
||||||
data: {
|
data: {
|
||||||
@ -49,6 +59,8 @@ export default {
|
|||||||
//
|
//
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
//
|
//
|
||||||
|
}).finally(_ => {
|
||||||
|
this.loadIng--;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user