style(测试用例): 交互优化
--bug=1015088 --user=吕梦园 https://www.tapd.cn/55049933/prong/stories/view/1155049933001015088
This commit is contained in:
parent
22d5791c3b
commit
ce6a740367
|
@ -1,11 +1,22 @@
|
|||
<template>
|
||||
<a-select v-model="value" multiple allow-search allow-clear :options="options" :field-names="fieldNames" />
|
||||
<a-select
|
||||
v-model="value"
|
||||
:placeholder="t('system.project.resourcePoolPlaceholder')"
|
||||
multiple
|
||||
allow-search
|
||||
allow-clear
|
||||
:options="options"
|
||||
:field-names="fieldNames"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watchEffect } from 'vue';
|
||||
|
||||
import { getPoolOptionsByOrg, getPoolOptionsByOrgOrSystem } from '@/api/modules/setting/organizationAndProject';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const options = ref([]);
|
||||
const fieldNames = { value: 'id', label: 'name' };
|
||||
|
|
|
@ -149,10 +149,15 @@
|
|||
reset();
|
||||
};
|
||||
|
||||
const emitConfirm = () => emits('confirm', { ...form.value, id: props.nodeId }, handleCancel);
|
||||
const handleConfirm = () => {
|
||||
if (!formRef.value) {
|
||||
emitConfirm();
|
||||
return;
|
||||
}
|
||||
formRef.value?.validate((errors) => {
|
||||
if (!errors) {
|
||||
emits('confirm', { ...form.value, id: props.nodeId }, handleCancel);
|
||||
emitConfirm();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
field="name"
|
||||
:label="t('apiTestManagement.apiName')"
|
||||
class="mb-[16px] w-[60%]"
|
||||
asterisk-position="end"
|
||||
:rules="[{ required: true, message: t('apiTestManagement.apiNameRequired') }]"
|
||||
>
|
||||
<a-input
|
||||
|
@ -16,10 +17,10 @@
|
|||
@change="handleActiveApiChange"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('common.desc')" class="mb-[16px] w-[60%]">
|
||||
<a-form-item asterisk-position="end" :label="t('common.desc')" class="mb-[16px] w-[60%]">
|
||||
<a-textarea v-model:model-value="requestVModel.description" :max-length="1000" @change="handleActiveApiChange" />
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('apiTestManagement.belongModule')" class="mb-[16px] w-[436px]">
|
||||
<a-form-item asterisk-position="end" :label="t('apiTestManagement.belongModule')" class="mb-[16px] w-[436px]">
|
||||
<a-tree-select
|
||||
v-model:modelValue="requestVModel.moduleId"
|
||||
:data="props.selectTree as ModuleTreeNode[]"
|
||||
|
@ -45,10 +46,10 @@
|
|||
</template>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('common.tag')" class="mb-[16px] w-[436px]">
|
||||
<a-form-item asterisk-position="end" :label="t('common.tag')" class="mb-[16px] w-[436px]">
|
||||
<MsTagsInput v-model:model-value="requestVModel.tags" @change="handleActiveApiChange" />
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('apiTestManagement.apiStatus')" class="mb-[16px] w-[240px]">
|
||||
<a-form-item asterisk-position="end" :label="t('apiTestManagement.apiStatus')" class="mb-[16px] w-[240px]">
|
||||
<a-select
|
||||
v-model:model-value="requestVModel.status"
|
||||
:placeholder="t('common.pleaseSelect')"
|
||||
|
|
|
@ -556,7 +556,8 @@
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return featureCaseStore.countMap[key] > 99 ? '99+' : `${featureCaseStore.countMap[key]}` || '';
|
||||
const count = featureCaseStore.countMap[key] ?? 0;
|
||||
return featureCaseStore.countMap[key] > 99 ? '99+' : `${count > 0 ? count : ''}`;
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
|
@ -106,8 +106,8 @@
|
|||
<template v-if="keyword.trim() === ''" #empty>
|
||||
<div class="flex w-full items-center justify-center p-[8px] text-[var(--color-text-4)]">
|
||||
{{ t('caseManagement.caseReview.tableNoData') }}
|
||||
<MsButton v-permission="['FUNCTIONAL_CASE:READ+ADD']" class="ml-[8px]" @click="createCase">
|
||||
{{ t('caseManagement.caseReview.crateCase') }}
|
||||
<MsButton v-permission="['FUNCTIONAL_CASE:READ+ADD']" class="ml-[8px]" @click="emit('link')">
|
||||
{{ t('caseManagement.featureCase.linkCase') }}
|
||||
</MsButton>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -317,7 +317,7 @@
|
|||
offspringIds: string[]; // 当前选中节点的所有子节点id
|
||||
moduleTree: ModuleTreeNode[];
|
||||
}>();
|
||||
const emit = defineEmits(['init', 'refresh']);
|
||||
const emit = defineEmits(['init', 'refresh', 'link']);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
@ -837,15 +837,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
function createCase() {
|
||||
router.push({
|
||||
name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL,
|
||||
query: {
|
||||
reviewId: route.query.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const [, memberRes] = await Promise.all([
|
||||
initReviewers(),
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
</template>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item field="type" :label="t('caseManagement.caseReview.type')">
|
||||
<a-radio-group v-model:modelValue="reviewForm.type" :disabled="isEdit">
|
||||
<a-form-item v-if="!isEdit" field="type" :label="t('caseManagement.caseReview.type')">
|
||||
<a-radio-group v-model:modelValue="reviewForm.type">
|
||||
<a-radio value="SINGLE">
|
||||
<div class="flex items-center">
|
||||
{{ t('caseManagement.caseReview.single') }}
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
:module-tree="moduleTree"
|
||||
@init="initModulesCount"
|
||||
@refresh="handleRefresh"
|
||||
@link="associateDrawerVisible = true"
|
||||
></CaseTable>
|
||||
</template>
|
||||
</MsSplitBox>
|
||||
|
|
|
@ -75,6 +75,8 @@ export default {
|
|||
'system.project.createProjectSuccess': 'Create project success',
|
||||
'system.project.updateProjectSuccess': 'Update project success',
|
||||
'system.project.resourcePool': 'Resource pool',
|
||||
'system.project.resourcePoolPlaceholder':
|
||||
'Please select the execution machine for interface testing, supporting multiple selections',
|
||||
'system.project.removeName': 'Confirm remove the {name}',
|
||||
'system.project.descriptionPlaceholder': 'Please describe the project.',
|
||||
'system.project.enterProject': 'Enter project',
|
||||
|
|
|
@ -69,6 +69,7 @@ export default {
|
|||
'system.project.createProjectSuccess': '创建项目成功',
|
||||
'system.project.updateProjectSuccess': '更新项目成功',
|
||||
'system.project.resourcePool': '资源池',
|
||||
'system.project.resourcePoolPlaceholder': '请选择接口测试的执行机,支持多选',
|
||||
'system.project.removeName': '确认移除 {name} 这个用户吗?',
|
||||
'system.project.descriptionPlaceholder': '请对该项目进行描述',
|
||||
'system.project.enterProject': '进入项目',
|
||||
|
|
Loading…
Reference in New Issue