fix(测试计划): 修复测试计划详情执行弹窗和切换优先级问题
This commit is contained in:
parent
4ba7ee7dfc
commit
474d7e2930
|
@ -494,7 +494,9 @@
|
||||||
Message.success(t('caseManagement.featureCase.editSuccess'));
|
Message.success(t('caseManagement.featureCase.editSuccess'));
|
||||||
detailInfo.value.name = titleName.value;
|
detailInfo.value.name = titleName.value;
|
||||||
isEditTitle.value = false;
|
isEditTitle.value = false;
|
||||||
|
nextTick(() => {
|
||||||
updateSuccess();
|
updateSuccess();
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item field="content" asterisk-position="end" class="mb-0">
|
<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
|
<a-textarea
|
||||||
v-if="props.isDblclickPlaceholder && !achievedForm"
|
v-if="props.isDblclickPlaceholder && !achievedForm"
|
||||||
v-model="form.content"
|
v-model="form.content"
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
:auto-size="{ minRows: 1 }"
|
:auto-size="{ minRows: 1 }"
|
||||||
style="resize: vertical"
|
style="resize: vertical"
|
||||||
:max-length="1000"
|
:max-length="1000"
|
||||||
@click="achievedForm = true"
|
|
||||||
/>
|
/>
|
||||||
<MsRichText
|
<MsRichText
|
||||||
v-if="!props.isDblclickPlaceholder || achievedForm"
|
v-if="!props.isDblclickPlaceholder || achievedForm"
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
v-model:form="form"
|
v-model:form="form"
|
||||||
is-dblclick-placeholder
|
is-dblclick-placeholder
|
||||||
class="execute-form"
|
class="execute-form"
|
||||||
@dblclick="dblclickHandler"
|
@dblclick="dblOrClickHandler"
|
||||||
|
@click="dblOrClickHandler"
|
||||||
>
|
>
|
||||||
<template #headerRight>
|
<template #headerRight>
|
||||||
<slot name="headerRight"></slot>
|
<slot name="headerRight"></slot>
|
||||||
|
@ -64,6 +65,7 @@
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'done', status: LastExecuteResults, content: string): void;
|
(e: 'done', status: LastExecuteResults, content: string): void;
|
||||||
|
(e: 'dblclick'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -74,14 +76,52 @@
|
||||||
|
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const submitLoading = 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(() => {
|
nextTick(() => {
|
||||||
const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content');
|
const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content');
|
||||||
useEventListener(editorContent, 'dblclick', () => {
|
const textareaContent = document.querySelector('.execute-form')?.querySelector('.textarea-input');
|
||||||
modalVisible.value = true;
|
|
||||||
dialogForm.value = cloneDeep(form.value);
|
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) {
|
function cancel(e: Event) {
|
||||||
// 点击取消/关闭,弹窗关闭,富文本内容都清空;点击空白处,弹窗关闭,将弹窗内容填入下面富文本内容里
|
// 点击取消/关闭,弹窗关闭,富文本内容都清空;点击空白处,弹窗关闭,将弹窗内容填入下面富文本内容里
|
||||||
if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) {
|
if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) {
|
||||||
|
|
Loading…
Reference in New Issue