Skip to content

Commit

Permalink
fix: 修改遗留中高级bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fit2cloudwxx authored and liuruibin committed Jun 13, 2024
1 parent 0d06dbd commit 86cbd0e
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
allow-clear
:max-length="255"
/>
<a-tooltip :content="isExpandAll ? t('apiScenario.collapseAll') : t('apiScenario.expandAllStep')">
<a-tooltip :content="isExpandAll ? t('common.collapseAll') : t('common.expandAll')">
<a-button
type="outline"
class="expand-btn arco-btn-outline--secondary"
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/pure/ms-rich-text/MsRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
raw?: string;
uploadImage?: (file: File) => Promise<any>;
maxHeight?: string;
autoHeight?: boolean;
filedIds?: string[];
commentIds?: string[];
wrapperClass?: string;
Expand All @@ -96,6 +97,7 @@
uploadImage: undefined,
placeholder: 'editor.placeholder',
draggable: false,
autoHeight: true,
}
);
Expand Down Expand Up @@ -438,7 +440,7 @@
const contentStyles = computed(() => {
return {
maxHeight: props.maxHeight || '200px',
maxHeight: props.autoHeight ? '800px' : props.maxHeight || '260px',
overflow: 'auto',
};
});
Expand Down Expand Up @@ -520,7 +522,7 @@
@apply relative overflow-hidden;
:deep(.halo-rich-text-editor .ProseMirror) {
padding: 16px !important;
height: 130px;
min-height: 130px;
p:first-child {
margin-top: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pure/ms-split-box/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}>(),
{
size: '300px',
min: '250px',
min: '300px',
max: 0.5,
direction: 'horizontal',
expandDirection: 'left',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/modules/case/featureCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const useFeatureCaseStore = defineStore('featureCase', {
// 设置选择moduleId
setModuleId(currentModuleId: string[]) {
if (['all', 'recycle'].includes(currentModuleId[0])) {
this.moduleId = ['root'];
this.moduleId = [];
} else {
this.moduleId = currentModuleId;
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/views/bug-management/components/bugDetailTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
{{ t('bugManagement.edit.content') }}
</strong>
</div>
<div class="mb-4 mt-[16px]" :class="{ 'max-h-[260px]': contentEditAble }">
<div class="mb-4 mt-[16px]">
<MsRichText
v-if="contentEditAble"
v-model:raw="form.description"
v-model:filed-ids="descriptionFileIds"
:disabled="!contentEditAble"
:placeholder="t('editor.placeholder')"
:upload-image="handleUploadImage"
:auto-height="false"
:preview-url="EditorPreviewFileUrl"
/>
<div v-else v-dompurify-html="form?.description || '-'" class="markdown-body"></div>
Expand All @@ -43,12 +44,13 @@
<h1 class="header-title">
<strong>{{ item.fieldName }}</strong>
</h1>
<div class="mb-4 mt-[16px]" :class="{ 'max-h-[260px]': contentEditAble }">
<div class="mb-4 mt-[16px]">
<MsRichText
v-if="contentEditAble"
v-model:raw="item.defaultValue"
v-model:filed-ids="descriptionFileIdMap[item.fieldId]"
:disabled="!contentEditAble"
:auto-height="false"
:placeholder="t('editor.placeholder')"
:upload-image="handleUploadImage"
:preview-url="EditorPreviewFileUrl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,10 @@
async function initTableParams() {
let moduleIds: string[] = [];
if (props.activeFolder && props.activeFolder !== 'all') {
moduleIds = [...featureCaseStore.moduleId];
moduleIds = [props.activeFolder];
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_TABLE);
if (getAllChildren) {
moduleIds = [...featureCaseStore.moduleId, ...props.offspringIds];
moduleIds = [props.activeFolder, ...props.offspringIds];
}
}
Expand Down Expand Up @@ -1054,7 +1054,7 @@
const moduleNamePath = computed(() => {
return props.activeFolder === 'all'
? t('caseManagement.featureCase.allCase')
: findNodeByKey<Record<string, any>>(caseTreeData.value, featureCaseStore.moduleId[0], 'id')?.name;
: findNodeByKey<Record<string, any>>(caseTreeData.value, props.activeFolder, 'id')?.name;
});
// 获取对应模块name
function getModules(moduleIds: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,20 @@
});
featureCaseStore.setModulesTree(caseTree.value);
featureCaseStore.setModuleId(['all']);
if (isSetDefaultKey) {
selectedNodeKeys.value = [caseTree.value[0].id];
const offspringIds: string[] = [];
mapTree(caseTree.value[0].children || [], (e) => {
offspringIds.push(e.id);
return e;
});
emits('caseNodeSelect', selectedNodeKeys.value, offspringIds);
}
emits(
'init',
caseTree.value.map((e) => e.name),
isSetDefaultKey
caseTree.value.map((e) => e.name)
);
} catch (error) {
// eslint-disable-next-line no-console
Expand All @@ -214,7 +221,11 @@
try {
await deleteCaseModuleTree(node.id);
Message.success(t('caseManagement.featureCase.deleteSuccess'));
initModules(true);
emits(
'init',
caseTree.value.map((e) => e.name),
true
);
} catch (error) {
console.log(error);
}
Expand Down Expand Up @@ -369,15 +380,6 @@
};
});
watch(
() => props.activeFolder,
(val) => {
if (val === 'all') {
initModules();
}
}
);
/**
* 初始化模块文件数量
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
v-if="validateResultInfo.successCount"
type="text"
class="ml-[8px]"
:disabled="props.importLoading"
:loading="props.importLoading"
@click="confirmImport"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@
* 设置根模块名称列表
* @param names 根模块名称列表
*/
function setRootModules(names: string[], isSetDefaultKey: boolean) {
function setRootModules(names: string[], isDelete = false) {
rootModulesName.value = names;
if (isSetDefaultKey) {
activeFolder.value = 'all';
if (isDelete) {
caseTreeRef.value?.initModules(true);
caseTableRef.value?.initData();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
v-model:raw="dialogForm.reason"
v-model:commentIds="dialogForm.commentIds"
:upload-image="handleUploadImage"
:auto-height="false"
:preview-url="PreviewEditorImageUrl"
class="w-full"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
v-model:raw="caseResultForm.reason"
v-model:commentIds="caseResultForm.commentIds"
v-model:filed-ids="caseResultForm.fileList"
:auto-height="false"
:upload-image="handleUploadImage"
:preview-url="PreviewEditorImageUrl"
class="w-full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
@change="enableAllJar"
></a-switch>
{{ t('project.fileManagement.enableAll') }}
<a-tooltip :content="t('project.fileManagement.uploadTip')">
<a-tooltip position="tr" :content="t('project.fileManagement.uploadTip')">
<MsIcon type="icon-icon-maybe_outlined" class="cursor-pointer hover:text-[rgb(var(--primary-5))]" />
</a-tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,9 @@
allow-clear
/>
<span class="absolute right-0 top-1 flex items-center">
<span class="float-left cursor-pointer text-[rgb(var(--primary-5))]" @click="openGithub">{{
<MsButton class="!mx-0 text-[rgb(var(--primary-5))]" @click="openGithub">{{
t('system.plugin.getPlugin')
}}</span>
<a-tooltip position="bottom">
<span class="float-right ml-1 mt-[2px]">
<IconQuestionCircle
class="h-[16px] w-[16px] text-[--color-text-4] hover:text-[rgb(var(--primary-5))]"
/>
</span>
<template #content>
<span @click="openGithub">{{ t('system.plugin.infoTip') }}</span>
</template>
</a-tooltip>
}}</MsButton>
</span>
</a-form-item>
<a-form-item
Expand Down Expand Up @@ -248,7 +238,7 @@
});
function openGithub() {
window.open('https://github.com/metersphere');
window.open('https://metersphere.io/docs/v3.x/plugin/');
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
'system.plugin.selectOrganizeTip': 'Please Choose Organization',
'system.plugin.selectOrganization': 'Choose Organization',
'system.plugin.infoTip': 'Jump to the Github download plug-in',
'system.plugin.getPlugin': 'Gets the open source plug-in',
'system.plugin.getPlugin': 'Get more plugins',
'system.plugin.afterSecond': 'Return to the list of plug-ins after the second',
'system.plugin.uploadSuccess': 'Upload Success!',
'system.plugin.uploadSuccessAfter': 'After successful upload, must arrive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {
'system.plugin.selectOrganizeTip': '请选择组织',
'system.plugin.selectOrganization': '选择组织',
'system.plugin.infoTip': '跳转至 GitHub 下载插件',
'system.plugin.getPlugin': '获取开源插件',
'system.plugin.getPlugin': '获取更多插件',
'system.plugin.afterSecond': '秒后回到插件列表',
'system.plugin.uploadSuccess': '上传成功!',
'system.plugin.uploadSuccessAfter': '上传成功后,须到',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
v-model:filedIds="form.planCommentFileIds"
:upload-image="handleUploadImage"
:preview-url="PreviewEditorImageUrl"
:auto-height="false"
class="w-full"
:placeholder="
props.isDblclickPlaceholder
Expand Down

0 comments on commit 86cbd0e

Please sign in to comment.