fix(用例管理): 修改用例bug

This commit is contained in:
xinxin.wu 2024-02-29 14:19:35 +08:00 committed by 刘瑞斌
parent 367ab71336
commit e592811b76
13 changed files with 69 additions and 28 deletions

View File

@ -8,9 +8,19 @@
>
<div v-if="props.isShowAvatar" class="mr-3 inline-block"> <MsAvatar avatar="word"></MsAvatar></div>
<div class="w-full items-center">
<a-input v-if="!isActive" class="w-full hover:border-[rgb(var(--primary-5))]" @click="isActive = true"></a-input>
<a-input
v-if="!isActive"
:placeholder="t('ms.comment.enterPlaceHolderTip')"
class="w-full hover:border-[rgb(var(--primary-5))]"
@click="isActive = true"
></a-input>
<div v-else class="flex flex-col justify-between">
<MsRichText v-model:raw="currentContent" v-model:commentIds="commentIds" class="w-full" />
<MsRichText
v-model:raw="currentContent"
v-model:commentIds="commentIds"
class="w-full"
placeholder="ms.comment.enterPlaceHolderTip"
/>
<div class="mt-4 flex flex-row justify-end gap-[12px]">
<a-button @click="cancelClick">{{ t('common.cancel') }}</a-button>
<a-button type="primary" :disabled="!currentContent" @click="publish">{{ t('common.publish') }}</a-button>
@ -56,6 +66,23 @@
currentContent.value = '';
emit('cancel');
};
function handleGlobalKeyDown(event: any) {
if (event.key === 'Enter' && event.ctrlKey) {
if (currentContent.value.trim().length) {
emit('publish', currentContent.value);
isActive.value = false;
currentContent.value = '';
}
}
}
onMounted(() => {
window.addEventListener('keydown', handleGlobalKeyDown);
});
onBeforeUnmount(() => {
window.removeEventListener('keydown', handleGlobalKeyDown);
});
</script>
<style scoped lang="less">

View File

@ -6,5 +6,5 @@ export default {
'ms.comment.delete': 'Delete',
'ms.comment.deleteConfirm': 'Are you sure you want to delete this comment?',
'ms.comment.deleteContent': 'After deletion, the comment cannot be replied to. Please proceed with caution.',
'ms.comment.enterPlaceHolderTip': 'Please enter a comment and press Enter to finish.',
'ms.comment.enterPlaceHolderTip': 'Please enter a comment and press ⌘ + Enter to finish.',
};

View File

@ -6,5 +6,5 @@ export default {
'ms.comment.delete': '删除',
'ms.comment.deleteConfirm': '确认删除该评论吗?',
'ms.comment.deleteContent': '删除后,评论无法回复,请谨慎操作',
'ms.comment.enterPlaceHolderTip': '请输入评论,回车结束',
'ms.comment.enterPlaceHolderTip': '请输入评论,⌘ + Enter 结束',
};

View File

@ -95,10 +95,12 @@
filedIds?: string[];
commentIds?: string[];
wrapperClass?: string;
placeholder?: string;
}>(),
{
raw: '',
uploadImage: undefined,
placeholder: 'editor.placeholder',
}
);
@ -251,7 +253,7 @@
ExtensionSubscript,
ExtensionSuperscript,
ExtensionPlaceholder.configure({
placeholder: '输入 / 以选择输入类型',
placeholder: t(props.placeholder),
}),
ExtensionHighlight,
// ExtensionVideo,

View File

@ -8,4 +8,5 @@ export default {
'editor.extensions.image.medium_size': 'medium size',
'editor.extensions.image.large_size': 'large size',
'editor.extensions.image.open_link': 'open link',
'editor.placeholder': 'Please enter content',
};

View File

@ -9,4 +9,5 @@ export default {
'editor.extensions.image.large_size': '大尺寸',
'editor.extensions.image.restore_size': '大尺寸',
'editor.extensions.image.open_link': '打开链接',
'editor.placeholder': '请输入内容',
};

View File

@ -4,6 +4,7 @@ import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
const isSave = ref(false);
let isRouteIntercepted = false;
// 离开页面确认提示
export default function useLeaveUnSaveTip() {
@ -14,7 +15,8 @@ export default function useLeaveUnSaveTip() {
isSave.value = flag;
};
onBeforeRouteLeave((to, from, next) => {
if (to.path === from.path) {
if (to.path === from.path || isRouteIntercepted) {
next();
return;
}
@ -29,6 +31,7 @@ export default function useLeaveUnSaveTip() {
status: 'normal',
},
onBeforeOk: async () => {
isRouteIntercepted = true;
next();
},
hideCancel: false,

View File

@ -55,7 +55,7 @@ export default {
'common.revokeDelete': '撤销删除',
'common.revokeDeleteSuccess': '已撤销删除',
'common.unSaveLeaveTitle': '离开此页面?',
'common.unSaveLeaveContent': '系统可能不会保存你所做的更改',
'common.unSaveLeaveContent': '系统不会保存您所做的更改',
'common.leave': '离开',
'common.rename': '重命名',
'common.noData': '暂无数据',

View File

@ -191,7 +191,7 @@
:mouse-enter-delay="100"
mini
>
<div>{{ getTableFields(record.customFields, item as MsTableColumn) }}</div>
<div class="one-line-text">{{ getTableFields(record.customFields, item as MsTableColumn) }}</div>
</a-tooltip>
</template>
<!-- 渲染自定义字段结束 -->
@ -531,15 +531,15 @@
width: 200,
showDrag: true,
},
{
title: 'caseManagement.featureCase.tableColumnVersion',
slotName: 'versionName',
dataIndex: 'versionName',
width: 300,
showTooltip: true,
showInTable: true,
showDrag: true,
},
// {
// title: 'caseManagement.featureCase.tableColumnVersion',
// slotName: 'versionName',
// dataIndex: 'versionName',
// width: 300,
// showTooltip: true,
// showInTable: true,
// showDrag: true,
// },
{
title: 'caseManagement.featureCase.tableColumnModule',
slotName: 'moduleId',
@ -810,7 +810,6 @@
getCaseList,
{
tableKey: TableKeyEnum.CASE_MANAGEMENT_TABLE,
scroll: { x: scrollWidth.value },
selectable: true,
showJumpMethod: true,
showSetting: true,

View File

@ -21,6 +21,8 @@
:placeholder="t('caseManagement.featureCase.searchByNameAndId')"
allow-clear
class="mx-[8px] w-[240px]"
@search="searchList"
@press-enter="searchList"
></a-input-search
></div>
</div>
@ -56,6 +58,8 @@
import { TableKeyEnum } from '@/enums/tableEnum';
import debounce from 'lodash-es/debounce';
const { t } = useI18n();
const appStore = useAppStore();
@ -100,8 +104,8 @@
},
{
title: 'caseManagement.featureCase.defectState',
slotName: 'status',
dataIndex: 'status',
slotName: 'statusName',
dataIndex: 'statusName',
showInTable: true,
showTooltip: true,
width: 300,
@ -110,8 +114,8 @@
},
{
title: 'caseManagement.featureCase.defectSource',
slotName: 'defectSource',
dataIndex: 'defectSource',
slotName: 'source',
dataIndex: 'source',
showInTable: true,
showTooltip: true,
width: 200,
@ -163,6 +167,10 @@
loadList();
}
const searchList = debounce(() => {
getFetch();
}, 100);
watch(
() => props.visible,
(val) => {

View File

@ -155,8 +155,8 @@
},
{
title: 'caseManagement.featureCase.defectState',
slotName: 'defectState',
dataIndex: 'defectState',
slotName: 'statusName',
dataIndex: 'statusName',
showInTable: true,
showTooltip: true,
width: 200,
@ -174,8 +174,8 @@
},
{
title: 'caseManagement.featureCase.defectSource',
slotName: 'defectState',
dataIndex: 'defectState',
slotName: 'source',
dataIndex: 'source',
showInTable: true,
showTooltip: true,
width: 200,

View File

@ -155,7 +155,7 @@
showTooltip: true,
},
{
title: 'caseManagement.featureCase.tableColumnName',
title: 'caseManagement.featureCase.demandName',
slotName: 'demandName',
dataIndex: 'demandName',
width: 300,

View File

@ -85,7 +85,7 @@
showTooltip: true,
},
{
title: 'caseManagement.featureCase.tableColumnName',
title: 'caseManagement.featureCase.demandName',
slotName: 'demandName',
dataIndex: 'demandName',
width: 300,