fix(脑图): 脑图紧急 bug 修复
This commit is contained in:
parent
2d7d462c57
commit
081776445f
|
@ -62,6 +62,7 @@
|
||||||
|
|
||||||
import { OptionsFieldId } from '@/models/caseManagement/featureCase';
|
import { OptionsFieldId } from '@/models/caseManagement/featureCase';
|
||||||
|
|
||||||
|
import { initFormCreate } from '@/views/case-management/caseManagementFeature/components/utils';
|
||||||
import { Api } from '@form-create/arco-design';
|
import { Api } from '@form-create/arco-design';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -200,6 +201,8 @@
|
||||||
() => props.activeCase.id,
|
() => props.activeCase.id,
|
||||||
() => {
|
() => {
|
||||||
baseInfoForm.value.name = props.activeCase.name;
|
baseInfoForm.value.name = props.activeCase.name;
|
||||||
|
baseInfoForm.value.tags = props.activeCase.tags || [];
|
||||||
|
formRules.value = initFormCreate(props.activeCase.customFields || [], ['FUNCTIONAL_CASE:READ+UPDATE']);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
@action="handleAction"
|
@action="handleAction"
|
||||||
@before-exec-command="handleBeforeExecCommand"
|
@before-exec-command="handleBeforeExecCommand"
|
||||||
@save="handleMinderSave"
|
@save="handleMinderSave"
|
||||||
@float-menu-close="handleBaseInfoCancel"
|
|
||||||
>
|
>
|
||||||
<template #extractMenu>
|
<template #extractMenu>
|
||||||
<a-tooltip v-if="showDetailMenu" :content="t('common.detail')">
|
<a-tooltip v-if="showDetailMenu" :content="t('common.detail')">
|
||||||
|
@ -102,7 +101,7 @@
|
||||||
import { MinderEventName } from '@/enums/minderEnum';
|
import { MinderEventName } from '@/enums/minderEnum';
|
||||||
|
|
||||||
import useMinderBaseApi from './useMinderBaseApi';
|
import useMinderBaseApi from './useMinderBaseApi';
|
||||||
import { convertToFile, initFormCreate } from '@/views/case-management/caseManagementFeature/components/utils';
|
import { convertToFile } from '@/views/case-management/caseManagementFeature/components/utils';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
moduleId: string;
|
moduleId: string;
|
||||||
|
@ -159,13 +158,18 @@
|
||||||
/**
|
/**
|
||||||
* 初始化用例模块树
|
* 初始化用例模块树
|
||||||
*/
|
*/
|
||||||
async function initCaseTree() {
|
async function initCaseTree(notRemote = false) {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getCaseMinderTree({
|
let res: MinderJsonNode[];
|
||||||
|
if (notRemote) {
|
||||||
|
res = caseTree.value;
|
||||||
|
} else {
|
||||||
|
res = await getCaseMinderTree({
|
||||||
projectId: appStore.currentProjectId,
|
projectId: appStore.currentProjectId,
|
||||||
moduleId: '', // 始终加载全部,然后再进入对应的模块节点
|
moduleId: '', // 始终加载全部,然后再进入对应的模块节点
|
||||||
});
|
});
|
||||||
|
}
|
||||||
caseTree.value = mapTree<MinderJsonNode>(res, (e) => ({
|
caseTree.value = mapTree<MinderJsonNode>(res, (e) => ({
|
||||||
...e,
|
...e,
|
||||||
data: {
|
data: {
|
||||||
|
@ -227,8 +231,6 @@
|
||||||
const baseInfoRef = ref<InstanceType<typeof baseInfo>>();
|
const baseInfoRef = ref<InstanceType<typeof baseInfo>>();
|
||||||
const baseInfoLoading = ref(false);
|
const baseInfoLoading = ref(false);
|
||||||
|
|
||||||
const formRules = ref<FormItem[]>([]);
|
|
||||||
|
|
||||||
const extraVisible = ref<boolean>(false);
|
const extraVisible = ref<boolean>(false);
|
||||||
const activeCase = ref<Record<string, any>>({});
|
const activeCase = ref<Record<string, any>>({});
|
||||||
const extractContentTabList = computed(() => {
|
const extractContentTabList = computed(() => {
|
||||||
|
@ -304,7 +306,6 @@
|
||||||
return convertToFile(fileInfo);
|
return convertToFile(fileInfo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
formRules.value = initFormCreate(res.customFields, ['FUNCTIONAL_CASE:READ+UPDATE']);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -588,6 +589,7 @@
|
||||||
textDescription: textStep?.data?.text || '',
|
textDescription: textStep?.data?.text || '',
|
||||||
expectedResult: textStep?.children?.[0]?.data?.text || '',
|
expectedResult: textStep?.children?.[0]?.data?.text || '',
|
||||||
description: remarkNode?.data?.text || '',
|
description: remarkNode?.data?.text || '',
|
||||||
|
priority: node.data?.priority,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,7 +632,11 @@
|
||||||
} else if (node.data.resource?.includes(caseTag)) {
|
} else if (node.data.resource?.includes(caseTag)) {
|
||||||
// 处理用例节点
|
// 处理用例节点
|
||||||
const caseNodeInfo = getCaseNodeInfo(node as MinderJsonNode);
|
const caseNodeInfo = getCaseNodeInfo(node as MinderJsonNode);
|
||||||
const caseBaseInfo = baseInfoRef.value?.makeParams();
|
let caseBaseInfo;
|
||||||
|
if (activeCase.value.id === node.data.id) {
|
||||||
|
// 当前用例节点是打开的用例详情,获取用例详情数据
|
||||||
|
caseBaseInfo = baseInfoRef.value?.makeParams();
|
||||||
|
}
|
||||||
tempMinderParams.value.updateCaseList.push({
|
tempMinderParams.value.updateCaseList.push({
|
||||||
id: node.data.id,
|
id: node.data.id,
|
||||||
moduleId: parent?.data.id || '',
|
moduleId: parent?.data.id || '',
|
||||||
|
@ -694,7 +700,7 @@
|
||||||
watch(
|
watch(
|
||||||
() => featureCaseStore.modulesCount,
|
() => featureCaseStore.modulesCount,
|
||||||
() => {
|
() => {
|
||||||
initCaseTree();
|
initCaseTree(true);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|
|
@ -35,14 +35,15 @@ export default function useMinderBaseApi({ hasEditPermission }: { hasEditPermiss
|
||||||
function canShowFloatMenu() {
|
function canShowFloatMenu() {
|
||||||
if (window.minder) {
|
if (window.minder) {
|
||||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||||
if (node.data?.resource?.includes(caseTag)) {
|
if (!hasEditPermission) {
|
||||||
|
if (node?.data?.resource?.includes(caseTag)) {
|
||||||
|
// 没有编辑权限情况下,用例节点可展示浮动菜单(需要展示详情按钮)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!hasEditPermission) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const insertSiblingMenus = ref<InsertMenuItem[]>([]);
|
const insertSiblingMenus = ref<InsertMenuItem[]>([]);
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
</slot>
|
</slot>
|
||||||
<div class="flex flex-row gap-[12px]">
|
<div class="flex flex-row gap-[12px]">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:modelValue="innerKeyword"
|
v-model:modelValue="keyword"
|
||||||
size="small"
|
size="small"
|
||||||
:placeholder="props.searchPlaceholder"
|
:placeholder="props.searchPlaceholder"
|
||||||
class="w-[240px]"
|
class="w-[240px]"
|
||||||
allow-clear
|
allow-clear
|
||||||
@press-enter="emit('keywordSearch', innerKeyword, filterResult)"
|
@press-enter="emit('keywordSearch', keyword, filterResult)"
|
||||||
@search="emit('keywordSearch', innerKeyword, filterResult)"
|
@search="emit('keywordSearch', keyword, filterResult)"
|
||||||
@clear="handleClear"
|
@clear="handleClear"
|
||||||
></a-input-search>
|
></a-input-search>
|
||||||
<!-- <MsTag
|
<!-- <MsTag
|
||||||
|
@ -78,8 +78,6 @@
|
||||||
import MsTag from '../ms-tag/ms-tag.vue';
|
import MsTag from '../ms-tag/ms-tag.vue';
|
||||||
import FilterForm from './FilterForm.vue';
|
import FilterForm from './FilterForm.vue';
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
|
||||||
|
|
||||||
import { FilterFormItem, FilterResult } from './type';
|
import { FilterFormItem, FilterResult } from './type';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -92,14 +90,13 @@
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'keywordSearch', value: string | undefined, combine: FilterResult): void; // innerKeyword 搜索 TODO:可以去除,父组件通过 v-model:keyword 获取关键字
|
(e: 'keywordSearch', value: string | undefined, combine: FilterResult): void; // keyword 搜索 TODO:可以去除,父组件通过 v-model:keyword 获取关键字
|
||||||
(e: 'advSearch', value: FilterResult): void; // 高级搜索
|
(e: 'advSearch', value: FilterResult): void; // 高级搜索
|
||||||
(e: 'dataIndexChange', value: string): void; // 高级搜索选项变更
|
(e: 'dataIndexChange', value: string): void; // 高级搜索选项变更
|
||||||
(e: 'refresh', value: FilterResult): void;
|
(e: 'refresh', value: FilterResult): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const keyword = defineModel<string>('keyword', { default: '' });
|
||||||
const innerKeyword = defineModel<string>('keyword', { default: '' });
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const filterCount = ref(0);
|
const filterCount = ref(0);
|
||||||
const defaultFilterResult: FilterResult = { accordBelow: 'AND', combine: {} };
|
const defaultFilterResult: FilterResult = { accordBelow: 'AND', combine: {} };
|
||||||
|
@ -124,7 +121,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
innerKeyword.value = '';
|
keyword.value = '';
|
||||||
emit('keywordSearch', '', filterResult.value);
|
emit('keywordSearch', '', filterResult.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useMinderStore from '@/store/modules/components/minder-editor/index';
|
import useMinderStore from '@/store/modules/components/minder-editor/index';
|
||||||
import { MinderNodePosition } from '@/store/modules/components/minder-editor/types';
|
import { MinderNodePosition } from '@/store/modules/components/minder-editor/types';
|
||||||
import { getGenerateId, sleep } from '@/utils';
|
import { getGenerateId, sleep, traverseTree } from '@/utils';
|
||||||
|
|
||||||
import { MinderEventName } from '@/enums/minderEnum';
|
import { MinderEventName } from '@/enums/minderEnum';
|
||||||
|
|
||||||
|
@ -362,6 +362,23 @@
|
||||||
case 'paste':
|
case 'paste':
|
||||||
minderStore.dispatchEvent(MinderEventName.PASTE_NODE, undefined, undefined, undefined, selectedNodes);
|
minderStore.dispatchEvent(MinderEventName.PASTE_NODE, undefined, undefined, undefined, selectedNodes);
|
||||||
window.minder.execCommand('Paste');
|
window.minder.execCommand('Paste');
|
||||||
|
const pastedNode: MinderJsonNode = window.minder.getSelectedNode();
|
||||||
|
if (pastedNode) {
|
||||||
|
pastedNode.data = {
|
||||||
|
...pastedNode.data,
|
||||||
|
text: pastedNode.data?.text || '',
|
||||||
|
isNew: true,
|
||||||
|
id: getGenerateId(),
|
||||||
|
};
|
||||||
|
traverseTree(pastedNode.children || [], (node) => {
|
||||||
|
node.data = {
|
||||||
|
...node.data,
|
||||||
|
text: node.data?.text || '',
|
||||||
|
isNew: true,
|
||||||
|
id: getGenerateId(),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
minderStore.dispatchEvent(MinderEventName.DELETE_NODE, undefined, undefined, undefined, selectedNodes);
|
minderStore.dispatchEvent(MinderEventName.DELETE_NODE, undefined, undefined, undefined, selectedNodes);
|
||||||
|
|
|
@ -97,9 +97,9 @@
|
||||||
(val) => {
|
(val) => {
|
||||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||||
if (val && node) {
|
if (val && node) {
|
||||||
nextTick(() => {
|
setTimeout(() => {
|
||||||
window.minder.execCommand('camera', node, 100);
|
window.minder.execCommand('camera', node, 100);
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,6 +2,8 @@ import { defineStore } from 'pinia';
|
||||||
|
|
||||||
import type { MinderJsonNode } from '@/components/pure/ms-minder-editor/props';
|
import type { MinderJsonNode } from '@/components/pure/ms-minder-editor/props';
|
||||||
|
|
||||||
|
import { getGenerateId, mapTree } from '@/utils';
|
||||||
|
|
||||||
import { MinderEventName } from '@/enums/minderEnum';
|
import { MinderEventName } from '@/enums/minderEnum';
|
||||||
|
|
||||||
import { MinderNodePosition, MinderState } from './types';
|
import { MinderNodePosition, MinderState } from './types';
|
||||||
|
@ -60,7 +62,7 @@ const useMinderStore = defineStore('minder', {
|
||||||
this.mold = val;
|
this.mold = val;
|
||||||
},
|
},
|
||||||
setClipboard(nodes?: MinderJsonNode[]) {
|
setClipboard(nodes?: MinderJsonNode[]) {
|
||||||
this.clipboard = nodes || [];
|
this.clipboard = mapTree(nodes || [], (node) => ({ ...node, id: getGenerateId(), type: 'ADD' }));
|
||||||
},
|
},
|
||||||
setMinderUnsaved(val: boolean) {
|
setMinderUnsaved(val: boolean) {
|
||||||
this.minderUnsaved = val;
|
this.minderUnsaved = val;
|
||||||
|
|
|
@ -16,7 +16,13 @@
|
||||||
@refresh="fetchData()"
|
@refresh="fetchData()"
|
||||||
>
|
>
|
||||||
<template #right>
|
<template #right>
|
||||||
<a-radio-group v-model:model-value="showType" type="button" size="small" class="list-show-type">
|
<a-radio-group
|
||||||
|
v-model:model-value="showType"
|
||||||
|
type="button"
|
||||||
|
size="small"
|
||||||
|
class="list-show-type"
|
||||||
|
@change="handleShowTypeChange"
|
||||||
|
>
|
||||||
<a-radio value="list" class="show-type-icon !m-[2px]">
|
<a-radio value="list" class="show-type-icon !m-[2px]">
|
||||||
<MsIcon :size="14" type="icon-icon_view-list_outlined" />
|
<MsIcon :size="14" type="icon-icon_view-list_outlined" />
|
||||||
</a-radio>
|
</a-radio>
|
||||||
|
@ -413,6 +419,10 @@
|
||||||
},
|
},
|
||||||
hideCancel: false,
|
hideCancel: false,
|
||||||
});
|
});
|
||||||
|
} else if (val === 'minder') {
|
||||||
|
keyword.value = '';
|
||||||
|
// 切换到脑图刷新模块统计
|
||||||
|
emit('init', { moduleIds: [props.activeFolder], projectId: appStore.currentProjectId, pageSize: 10, current: 1 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue