teukkk 2024-05-22 18:25:14 +08:00 committed by Craftsman
parent 93af7780c2
commit 70fcf72a21
6 changed files with 31 additions and 26 deletions

View File

@ -203,7 +203,7 @@
:name="item.slotName"
v-bind="{ record, rowIndex, column, dataIndex: item.dataIndex, columnConfig: item }"
>
{{ record[item.dataIndex as string] || (attrs.emptyDataShowLine ? '-' : '') }}
{{ getDisplayValue(record[item.dataIndex as string]) }}
</slot>
</template>
</div>
@ -374,6 +374,15 @@
const isEnter = ref<boolean>(false);
const { rowKey }: Partial<MsTableProps<any>> = attrs;
// 0
function getDisplayValue(value: any) {
if (value === '' || value === null || value === undefined || Number.isNaN(value)) {
return attrs.emptyDataShowLine ? '-' : '';
}
return value;
}
//
const currentSpanMethod = ({
rowIndex,

View File

@ -63,7 +63,7 @@
</MsButton>
<a-divider v-permission="['PROJECT_TEST_PLAN:READ+ASSOCIATION']" direction="vertical" :margin="8"></a-divider>
<MsPopconfirm
:title="t('testPlan.featureCase.disassociateTip', { name: record.name })"
:title="t('testPlan.featureCase.disassociateTip', { name: characterLimit(record.name) })"
:sub-title-tip="t('testPlan.featureCase.disassociateTipContent')"
:ok-text="t('common.confirm')"
:loading="disassociateLoading"
@ -191,6 +191,7 @@
import useModal from '@/hooks/useModal';
import useTableStore from '@/hooks/useTableStore';
import useAppStore from '@/store/modules/app';
import { characterLimit } from '@/utils';
import { hasAnyPermission } from '@/utils/permission';
import { ReviewUserItem } from '@/models/caseManagement/caseReview';

View File

@ -13,6 +13,13 @@
<div class="folder-name">{{ t('caseManagement.caseReview.allCases') }}</div>
<div class="folder-count">({{ allCount }})</div>
</div>
<a-tooltip
:content="isExpandAll ? t('testPlan.testPlanIndex.collapseAll') : t('testPlan.testPlanIndex.expandAll')"
>
<MsButton type="icon" status="secondary" class="!mr-0 p-[4px]" position="top" @click="expandHandler">
<MsIcon :type="isExpandAll ? 'icon-icon_folder_collapse1' : 'icon-icon_folder_expansion1'" />
</MsButton>
</a-tooltip>
</div>
<a-divider class="my-[8px]" />
<a-spin class="min-h-[200px] w-full" :loading="loading">
@ -51,6 +58,7 @@
import { useRoute } from 'vue-router';
import { useVModel } from '@vueuse/core';
import MsButton from '@/components/pure/ms-button/index.vue';
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import MsTree from '@/components/business/ms-tree/index.vue';
import type { MsTreeNodeData } from '@/components/business/ms-tree/types';
@ -63,7 +71,6 @@
const props = defineProps<{
modulesCount?: Record<string, number>; //
isExpandAll?: boolean; //
selectedKeys: string[]; // key
}>();
const emit = defineEmits<{
@ -85,14 +92,10 @@
const activeFolder = ref<string>('all');
const allCount = ref(0);
const isExpandAll = ref(props.isExpandAll);
watch(
() => props.isExpandAll,
(val) => {
isExpandAll.value = val;
}
);
const isExpandAll = ref(false);
function expandHandler() {
isExpandAll.value = !isExpandAll.value;
}
function getFolderClass(id: string) {
return activeFolder.value === id ? 'folder-text folder-text--active' : 'folder-text';

View File

@ -1,12 +1,6 @@
<template>
<ExecuteForm v-model:form="form" is-dblclick-placeholder class="execute-form" />
<a-button
type="primary"
class="mt-[12px]"
:disabled="submitDisabled"
:loading="submitLoading"
@click="() => submit()"
>
<a-button type="primary" class="mt-[12px]" :loading="submitLoading" @click="() => submit()">
{{ t('caseManagement.caseReview.commitResult') }}
</a-button>
<a-modal
@ -17,7 +11,6 @@
body-class="p-0"
:width="800"
:cancel-button-props="{ disabled: submitLoading }"
:ok-button-props="{ disabled: submitDisabled }"
:ok-loading="submitLoading"
:ok-text="t('caseManagement.caseReview.commitResult')"
@before-ok="submit"
@ -27,7 +20,7 @@
</template>
<script setup lang="ts">
import { computed, ref } from 'vue';
import { ref } from 'vue';
import { useEventListener } from '@vueuse/core';
import { Message } from '@arco-design/web-vue';
@ -60,11 +53,6 @@
const modalVisible = ref(false);
const submitLoading = ref(false);
const submitDisabled = computed(
() =>
form.value.lastExecResult !== 'SUCCESS' &&
(form.value.content === '' || form.value.content?.trim() === '<p style=""></p>')
);
//
onMounted(() => {

View File

@ -395,6 +395,7 @@
if (activeId.value !== item.id) {
activeCaseId.value = item.caseId;
activeId.value = item.id;
activeTab.value = 'detail';
}
}

View File

@ -99,7 +99,7 @@
v-if="activeTab === 'featureCase'"
ref="featureCaseRef"
:repeat-case="detail.repeatCase"
@refresh="getStatistics"
@refresh="initDetail"
/>
<!-- TODO 先不上 -->
<!-- <BugManagement v-if="activeTab === 'defectList'" :plan-id="detail.id" /> -->
@ -314,6 +314,7 @@
//
async function handleGenerateReport() {
try {
loading.value = true;
await generateReport({
projectId: appStore.currentProjectId,
testPlanId: detail.value.id as string,
@ -322,6 +323,8 @@
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
loading.value = false;
}
}