fix(缺陷管理): 更新交互和一直转圈bug修复

This commit is contained in:
xinxin.wu 2024-04-16 17:13:20 +08:00 committed by Craftsman
parent f9cef1c518
commit 0023824099
1 changed files with 74 additions and 61 deletions

View File

@ -144,65 +144,65 @@
</div>
</template>
<template #second>
<a-spin :loading="rightLoading" class="w-full">
<!-- 所属平台一致, 详情展示 -->
<div v-if="props.currentPlatform === detailInfo.platform" class="rightWrapper h-full p-[24px]">
<!-- 自定义字段开始 -->
<div class="inline-block w-full break-words">
<a-skeleton v-if="loading" class="w-full" :loading="loading" :animation="true">
<a-space direction="vertical" class="w-[100%]" size="large">
<a-skeleton-line :rows="14" :line-height="30" :line-spacing="30" />
</a-space>
</a-skeleton>
<div v-if="!loading" class="mb-4 font-medium">
<strong>
{{ t('bugManagement.detail.basicInfo') }}
</strong>
</div>
<MsFormCreate
v-if="!loading"
ref="formCreateRef"
v-model:form-item="formItem"
v-model:api="fApi"
:form-rule="formRules"
class="w-full"
:option="options"
@change="handelFormCreateChange"
/>
<!-- 自定义字段结束 -->
<div
v-if="!isPlatformDefaultTemplate && hasAnyPermission(['PROJECT_BUG:READ+UPDATE']) && !loading"
class="baseItem"
>
<a-form
:model="{}"
:label-col-props="{
span: 9,
}"
:wrapper-col-props="{
span: 15,
}"
label-align="left"
content-class="tags-class"
>
<a-form-item field="tags" :label="t('system.orgTemplate.tags')">
<MsTagsInput
v-model:model-value="tags"
:disabled="!hasAnyPermission(['PROJECT_BUG:READ+UPDATE'])"
@blur="changeTag"
/>
</a-form-item>
</a-form>
</div>
<!-- <a-spin :loading="rightLoading" class="w-full"> -->
<!-- 所属平台一致, 详情展示 -->
<div v-if="props.currentPlatform === detailInfo.platform" class="rightWrapper h-full p-[24px]">
<!-- 自定义字段开始 -->
<div class="inline-block w-full break-words">
<a-skeleton v-if="rightLoading" class="w-full" :loading="rightLoading" :animation="true">
<a-space direction="vertical" class="w-[100%]" size="large">
<a-skeleton-line :rows="14" :line-height="30" :line-spacing="30" />
</a-space>
</a-skeleton>
<div v-if="!rightLoading" class="mb-4 font-medium">
<strong>
{{ t('bugManagement.detail.basicInfo') }}
</strong>
</div>
<MsFormCreate
v-if="!rightLoading"
ref="formCreateRef"
v-model:form-item="formItem"
v-model:api="fApi"
:form-rule="formRules"
class="w-full"
:option="options"
@change="handelFormCreateChange"
/>
<!-- 自定义字段结束 -->
<div
v-if="!isPlatformDefaultTemplate && hasAnyPermission(['PROJECT_BUG:READ+UPDATE']) && !loading"
class="baseItem"
>
<a-form
:model="{}"
:label-col-props="{
span: 9,
}"
:wrapper-col-props="{
span: 15,
}"
label-align="left"
content-class="tags-class"
>
<a-form-item field="tags" :label="t('system.orgTemplate.tags')">
<MsTagsInput
v-model:model-value="tags"
:disabled="!hasAnyPermission(['PROJECT_BUG:READ+UPDATE'])"
@blur="changeTag"
/>
</a-form-item>
</a-form>
</div>
</div>
<!-- 内置基础信息结束 -->
</div>
<!-- 所属平台不一致, 详情不展示, 展示空面板 -->
<div v-else>
<a-empty> {{ $t('messageBox.noContent') }} </a-empty>
</div>
</a-spin>
<!-- 内置基础信息结束 -->
</div>
<!-- 所属平台不一致, 详情不展示, 展示空面板 -->
<div v-else>
<a-empty> {{ $t('messageBox.noContent') }} </a-empty>
</div>
<!-- </a-spin> -->
</template>
</MsSplitBox>
</div>
@ -562,15 +562,28 @@
});
}
/**
* 单独更新字段
*/
async function updateFieldHandler() {
try {
rightLoading.value = true;
await bugDetailTabRef.value?.handleSave();
rightLoading.value = false;
} catch (error) {
console.log(error);
} finally {
rightLoading.value = false;
}
}
const handelFormCreateChange = debounce(() => {
rightLoading.value = true;
bugDetailTabRef.value?.handleSave();
updateFieldHandler();
}, 300);
const changeTag = debounce(() => {
detailInfo.value.tags = tags.value;
rightLoading.value = true;
bugDetailTabRef.value?.handleSave();
updateFieldHandler();
}, 300);
//