perf: 优化查看汇报详情loading

This commit is contained in:
kuaifan 2023-01-31 14:08:09 +08:00
parent d96e9f4daa
commit 6f7f29118f

View File

@ -1,6 +1,9 @@
<template>
<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">
<Form class="report-form" label-width="auto" inline>
<FormItem :label="$L('汇报人')">
@ -10,7 +13,8 @@
{{ data.created_at }}
</FormItem>
<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>
</Form>
<Form class="report-form" label-width="auto">
@ -30,6 +34,11 @@ export default {
default: {},
}
},
data() {
return {
loadIng: 0,
}
},
watch: {
'data.id': {
handler(id) {
@ -40,6 +49,7 @@ export default {
},
methods: {
sendRead() {
this.loadIng++;
this.$store.dispatch("call", {
url: 'report/read',
data: {
@ -49,6 +59,8 @@ export default {
//
}).catch(() => {
//
}).finally(_ => {
this.loadIng--;
});
},
}