fix(缺陷管理): 缺陷列表详情抽屉问题修复

This commit is contained in:
baiqi 2024-07-23 16:29:49 +08:00 committed by Craftsman
parent d69fefcfd9
commit 28535c078d
2 changed files with 5 additions and 7 deletions

View File

@ -257,6 +257,7 @@
const rightLoading = ref(false); const rightLoading = ref(false);
const detailLoading = ref(false); const detailLoading = ref(false);
const activeTab = ref<string>('detail'); const activeTab = ref<string>('detail');
const currentDetailId = ref(props.detailId);
const commentInputRef = ref<InstanceType<typeof CommentInput>>(); const commentInputRef = ref<InstanceType<typeof CommentInput>>();
const commentInputIsActive = computed(() => commentInputRef.value?.isActive); const commentInputIsActive = computed(() => commentInputRef.value?.isActive);
@ -311,6 +312,7 @@
}; };
// TODO:: Record<string, any> // TODO:: Record<string, any>
async function loadedBug(detail: BugEditFormObject) { async function loadedBug(detail: BugEditFormObject) {
currentDetailId.value = detail.id;
// //
isPlatformDefaultTemplate.value = detail.platformDefault; isPlatformDefaultTemplate.value = detail.platformDefault;
// loading // loading
@ -350,7 +352,6 @@
} else if (item.type === 'INT' || item.type === 'FLOAT') { } else if (item.type === 'INT' || item.type === 'FLOAT') {
tmpObj[item.id] = Number(item.value); tmpObj[item.id] = Number(item.value);
} else if (item.type === 'CASCADER') { } else if (item.type === 'CASCADER') {
console.log(item.value === '');
if (item.value !== '') { if (item.value !== '') {
const arr = JSON.parse(item.value); const arr = JSON.parse(item.value);
if (arr && arr instanceof Array && arr.length > 0) { if (arr && arr instanceof Array && arr.length > 0) {
@ -407,7 +408,7 @@
const editLoading = ref<boolean>(false); const editLoading = ref<boolean>(false);
async function getDetail() { async function getDetail() {
const res = await getBugDetail(props.detailId); const res = await getBugDetail(currentDetailId.value);
loadedBug(res); loadedBug(res);
} }
@ -479,13 +480,13 @@
followLoading.value = true; followLoading.value = true;
try { try {
await followBug(detailInfo.value.id, detailInfo.value.followFlag); await followBug(detailInfo.value.id, detailInfo.value.followFlag);
updateSuccess();
Message.success( Message.success(
detailInfo.value.followFlag detailInfo.value.followFlag
? t('caseManagement.featureCase.cancelFollowSuccess') ? t('caseManagement.featureCase.cancelFollowSuccess')
: t('caseManagement.featureCase.followSuccess') : t('caseManagement.featureCase.followSuccess')
); );
detailInfo.value.followFlag = !detailInfo.value.followFlag; detailInfo.value.followFlag = !detailInfo.value.followFlag;
emit('submit');
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(error); console.log(error);
@ -509,7 +510,7 @@
}; };
await deleteSingleBug(params); await deleteSingleBug(params);
Message.success(t('common.deleteSuccess')); Message.success(t('common.deleteSuccess'));
updateSuccess(); emit('submit');
if (!props.pagination && !props.tableData) { if (!props.pagination && !props.tableData) {
showDrawerVisible.value = false; showDrawerVisible.value = false;
} else { } else {

View File

@ -196,7 +196,6 @@
import useModal from '@/hooks/useModal'; import useModal from '@/hooks/useModal';
import router from '@/router'; import router from '@/router';
import { useAppStore, useTableStore } from '@/store'; import { useAppStore, useTableStore } from '@/store';
import useLicenseStore from '@/store/modules/setting/license';
import { customFieldDataToTableData, customFieldToColumns, downloadByteFile } from '@/utils'; import { customFieldDataToTableData, customFieldToColumns, downloadByteFile } from '@/utils';
import { hasAnyPermission } from '@/utils/permission'; import { hasAnyPermission } from '@/utils/permission';
@ -231,8 +230,6 @@
const batchEditVisible = ref(false); const batchEditVisible = ref(false);
const keyword = ref(''); const keyword = ref('');
const filterResult = ref<FilterResult>({ accordBelow: 'AND', combine: {} }); const filterResult = ref<FilterResult>({ accordBelow: 'AND', combine: {} });
const licenseStore = useLicenseStore();
const isXpack = computed(() => licenseStore.hasLicense());
const { openDeleteModal } = useModal(); const { openDeleteModal } = useModal();
const route = useRoute(); const route = useRoute();
const severityFilterOptions = ref<BugOptionItem[]>([]); const severityFilterOptions = ref<BugOptionItem[]>([]);