fix(缺陷管理): 修复复制后不能跳转编辑和创建

This commit is contained in:
RubyLiu 2024-02-20 11:45:25 +08:00 committed by 刘瑞斌
parent aeb6486e68
commit 282f6493d9
4 changed files with 48 additions and 23 deletions

View File

@ -1,7 +1,14 @@
<template>
<div>
<div>
<a-radio-group v-model:model-value="innerParams.type" type="button" size="small">
<a-radio v-for="item of responseRadios" :key="item.value" :value="item.value">
{{ t(item.label) }}
</a-radio>
</a-radio-group>
</div>
<paramsTable
v-model:params="innerParams"
v-model:params="innerParams.responseHeader"
:selectable="false"
:columns="columns"
:scroll="{ minWidth: '700px' }"
@ -17,15 +24,18 @@
import { statusCodeOptions } from '@/components/pure/ms-advance-filter/index';
import paramsTable, { type ParamTableColumn } from '@/views/api-test/components/paramTable.vue';
import { useI18n } from '@/hooks/useI18n';
interface Param {
[key: string]: any;
}
const innerParams = defineModel<Param[]>('modelValue', { default: [] });
const innerParams = defineModel<Param>('modelValue', { default: { type: 'jsonPath' } });
const emit = defineEmits<{
(e: 'change'): void; //
}>();
const { t } = useI18n();
const defaultParamItem = {
responseHeader: '',
@ -49,6 +59,14 @@
{ label: 'If-Modified-Since', value: 'ifModifiedSince' },
];
const responseRadios = [
{ label: 'ms.assertion.jsonPath', value: 'jsonPath' },
{ label: 'ms.assertion.xpath', value: 'xPath' },
{ label: 'ms.assertion.document', value: 'document' },
{ label: 'ms.assertion.regular', value: 'regular' },
{ label: 'ms.assertion.script', value: 'script' },
];
const columns: ParamTableColumn[] = [
{
title: 'ms.assertion.responseHeader', //

View File

@ -1,3 +1,8 @@
export default {
'ms.assertion.button': 'Assertion',
'ms.assertion.jsonPath': 'JSONPath',
'ms.assertion.xpath': 'XPath',
'ms.assertion.document': 'Document',
'ms.assertion.regular': 'Regular',
'ms.assertion.script': 'Script',
};

View File

@ -5,9 +5,13 @@ export default {
'ms.assertion.responseBody': '响应体',
'ms.assertion.responseTime': '响应时间',
'ms.assertion.param': '变量',
'ms.assertion.script': '脚本',
'ms.assertion.noValidation': '不校验',
'ms.assertion.matchCondition': '匹配条件',
'ms.assertion.matchValue': '匹配值',
'ms.assertion.variableName': '变量名',
'ms.assertion.jsonPath': 'JSONPath',
'ms.assertion.xpath': 'XPath',
'ms.assertion.document': '文档',
'ms.assertion.regular': '正则',
'ms.assertion.script': '脚本',
};

View File

@ -5,7 +5,7 @@
<div class="flex justify-center"><svg-icon :width="'60px'" :height="'60px'" :name="'success'" /></div>
<div class="mb-2 mt-6 text-[20px] font-medium"> {{ t('common.addSuccess') }} </div>
<div
><span class="mr-1 text-[rgb(var(--primary-5))]">{{ countDown }}</span
><span class="mr-1 text-[rgb(var(--primary-5))]">{{ timer }}</span
><span class="text-[var(--color-text-4)]">{{ t('bugManagement.success.countDownTip') }}</span></div
>
<div class="my-6">
@ -56,6 +56,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useIntervalFn } from '@vueuse/core';
import MsCard from '@/components/pure/ms-card/index.vue';
import MsCardList from '@/components/business/ms-card-list/index.vue';
@ -80,21 +81,21 @@
]);
const isNextTip = ref<boolean>(false);
const countDown = ref<number>(15);
const timer = ref<any>(null);
function setCountdown() {
timer.value = setInterval(() => {
if (countDown.value > 1) {
--countDown.value;
} else {
clearInterval(timer.value);
const timer = ref(15); //
const { pause, resume } = useIntervalFn(() => {
timer.value--;
}, 1000);
//
pause();
// timer 0
watch(timer, () => {
if (timer.value === 0) {
pause();
router.push({
name: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
});
}
}, 1000);
timer.value = 15;
}
});
function isDoNotShowAgainChecked() {
if (isNextTip.value) {
@ -104,7 +105,6 @@
//
function backCaseList() {
clearInterval(timer.value);
router.push({
name: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
});
@ -112,14 +112,12 @@
//
function continueCreate() {
clearInterval(timer.value);
router.push({
name: BugManagementRouteEnum.BUG_MANAGEMENT_DETAIL,
});
}
function goDetail() {
clearInterval(timer.value);
router.push({
name: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
query: route.query,
@ -142,7 +140,7 @@
);
onMounted(() => {
setCountdown();
resume();
});
</script>