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 v-if="props.isShowAvatar" class="mr-3 inline-block"> <MsAvatar avatar="word"></MsAvatar></div>
<div class="w-full items-center"> <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"> <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]"> <div class="mt-4 flex flex-row justify-end gap-[12px]">
<a-button @click="cancelClick">{{ t('common.cancel') }}</a-button> <a-button @click="cancelClick">{{ t('common.cancel') }}</a-button>
<a-button type="primary" :disabled="!currentContent" @click="publish">{{ t('common.publish') }}</a-button> <a-button type="primary" :disabled="!currentContent" @click="publish">{{ t('common.publish') }}</a-button>
@ -56,6 +66,23 @@
currentContent.value = ''; currentContent.value = '';
emit('cancel'); 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> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -6,5 +6,5 @@ export default {
'ms.comment.delete': 'Delete', 'ms.comment.delete': 'Delete',
'ms.comment.deleteConfirm': 'Are you sure you want to delete this comment?', '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.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.delete': '删除',
'ms.comment.deleteConfirm': '确认删除该评论吗?', 'ms.comment.deleteConfirm': '确认删除该评论吗?',
'ms.comment.deleteContent': '删除后,评论无法回复,请谨慎操作', 'ms.comment.deleteContent': '删除后,评论无法回复,请谨慎操作',
'ms.comment.enterPlaceHolderTip': '请输入评论,回车结束', 'ms.comment.enterPlaceHolderTip': '请输入评论,⌘ + Enter 结束',
}; };

View File

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

View File

@ -8,4 +8,5 @@ export default {
'editor.extensions.image.medium_size': 'medium size', 'editor.extensions.image.medium_size': 'medium size',
'editor.extensions.image.large_size': 'large size', 'editor.extensions.image.large_size': 'large size',
'editor.extensions.image.open_link': 'open link', '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.large_size': '大尺寸',
'editor.extensions.image.restore_size': '大尺寸', 'editor.extensions.image.restore_size': '大尺寸',
'editor.extensions.image.open_link': '打开链接', 'editor.extensions.image.open_link': '打开链接',
'editor.placeholder': '请输入内容',
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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