fix(测试计划): 修复测试计划详情执行弹窗和切换优先级问题

This commit is contained in:
xinxin.wu 2024-10-21 12:03:23 +08:00 committed by Craftsman
parent 4ba7ee7dfc
commit 474d7e2930
3 changed files with 51 additions and 12 deletions

View File

@ -494,7 +494,9 @@
Message.success(t('caseManagement.featureCase.editSuccess'));
detailInfo.value.name = titleName.value;
isEditTitle.value = false;
updateSuccess();
nextTick(() => {
updateSuccess();
});
} catch (error) {
console.log(error);
} finally {

View File

@ -11,7 +11,7 @@
</div>
</a-form-item>
<a-form-item field="content" asterisk-position="end" class="mb-0">
<div class="flex w-full items-center">
<div class="textarea-input flex w-full items-center">
<a-textarea
v-if="props.isDblclickPlaceholder && !achievedForm"
v-model="form.content"
@ -20,7 +20,6 @@
:auto-size="{ minRows: 1 }"
style="resize: vertical"
:max-length="1000"
@click="achievedForm = true"
/>
<MsRichText
v-if="!props.isDblclickPlaceholder || achievedForm"

View File

@ -4,7 +4,8 @@
v-model:form="form"
is-dblclick-placeholder
class="execute-form"
@dblclick="dblclickHandler"
@dblclick="dblOrClickHandler"
@click="dblOrClickHandler"
>
<template #headerRight>
<slot name="headerRight"></slot>
@ -64,6 +65,7 @@
const emit = defineEmits<{
(e: 'done', status: LastExecuteResults, content: string): void;
(e: 'dblclick'): void;
}>();
const { t } = useI18n();
@ -74,14 +76,52 @@
const modalVisible = ref(false);
const submitLoading = ref(false);
//
function dblclickHandler() {
//
const achievedForm = ref<boolean>(props.isDefaultActivate);
const clickTimeout = ref<ReturnType<typeof setTimeout> | null>();
//
function handleDblClick() {
if (clickTimeout.value) {
clearTimeout(clickTimeout.value); //
clickTimeout.value = null;
}
modalVisible.value = true;
dialogForm.value = cloneDeep(form.value); //
}
//
function handleClick() {
if (clickTimeout.value) {
clearTimeout(clickTimeout.value);
}
clickTimeout.value = setTimeout(() => {
if (!achievedForm.value) {
achievedForm.value = true; //
}
clickTimeout.value = null;
}, 200);
}
function dblOrClickHandler() {
nextTick(() => {
const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content');
useEventListener(editorContent, 'dblclick', () => {
modalVisible.value = true;
dialogForm.value = cloneDeep(form.value);
});
const textareaContent = document.querySelector('.execute-form')?.querySelector('.textarea-input');
const bindEvents = (element: Element | null) => {
if (element) {
useEventListener(element, 'dblclick', handleDblClick);
useEventListener(element, 'click', handleClick);
}
};
if (editorContent) {
bindEvents(editorContent);
}
if (textareaContent) {
bindEvents(textareaContent);
}
});
}
@ -107,8 +147,6 @@
}
);
const achievedForm = ref<boolean>(props.isDefaultActivate);
function cancel(e: Event) {
// /
if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) {