fix: 修复消息管理未读切换已读问题&统一修改替换下拉树无法检索问题
This commit is contained in:
parent
90d20de060
commit
e8124a7d75
|
@ -88,6 +88,9 @@ export function queryMessageHistoryCount(data: historyQueryParams) {
|
||||||
export function getMessageReadAll(resourceType?: string) {
|
export function getMessageReadAll(resourceType?: string) {
|
||||||
return MSR.get<number>({ url: '/notification/read/all', params: { resourceType } });
|
return MSR.get<number>({ url: '/notification/read/all', params: { resourceType } });
|
||||||
}
|
}
|
||||||
|
export function getMessageRead(id: number) {
|
||||||
|
return MSR.get<number>({ url: `/notification/read/${id}` });
|
||||||
|
}
|
||||||
|
|
||||||
export function getMessageUnReadCount(projectId: string) {
|
export function getMessageUnReadCount(projectId: string) {
|
||||||
return MSR.get<number>({ url: '/notification/un-read', params: projectId }, { ignoreCancelToken: true });
|
return MSR.get<number>({ url: '/notification/un-read', params: projectId }, { ignoreCancelToken: true });
|
||||||
|
|
|
@ -56,4 +56,5 @@ export const ReportShareScenarioUrlGetDetail = '/test-plan/report/share/detail/s
|
||||||
// 测试计划-报告明细-场景报告
|
// 测试计划-报告明细-场景报告
|
||||||
export const ReportScenarioUrl = '/test-plan/api/scenario/report/get';
|
export const ReportScenarioUrl = '/test-plan/api/scenario/report/get';
|
||||||
export const ReportDetailScenarioUrl = '/test-plan/api/scenario/report/get/detail';
|
export const ReportDetailScenarioUrl = '/test-plan/api/scenario/report/get/detail';
|
||||||
|
// 测试计划-报告-报告富文本预览压缩图
|
||||||
|
export const ReportPlanPreviewImageUrl = '/test-plan/report/preview/md';
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
threshold: 200,
|
threshold: 200,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
allow-search
|
allow-search
|
||||||
>
|
>
|
||||||
<template #tree-slot-title="node">
|
<template #tree-slot-title="node">
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { ModuleTreeNode, TransferFileParams } from '@/models/common';
|
import { ModuleTreeNode, TransferFileParams } from '@/models/common';
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="ms-message-item">
|
<div v-else class="ms-message-item" @click.stop="setReadMessage(item)">
|
||||||
<MSAvatar v-if="item.avatar" :avatar="item.avatar" :word="item.userName" />
|
<MSAvatar v-if="item.avatar" :avatar="item.avatar" :word="item.userName" />
|
||||||
<div class="ml-[8px] flex flex-col">
|
<div class="ml-[8px] flex flex-col">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
@ -183,6 +183,7 @@
|
||||||
import MsList from '@/components/pure/ms-list/index.vue';
|
import MsList from '@/components/pure/ms-list/index.vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
getMessageRead,
|
||||||
getMessageReadAll,
|
getMessageReadAll,
|
||||||
MessageHistoryItem,
|
MessageHistoryItem,
|
||||||
OptionItem,
|
OptionItem,
|
||||||
|
@ -268,7 +269,7 @@
|
||||||
current: pageNation.value.current || 1,
|
current: pageNation.value.current || 1,
|
||||||
pageSize: pageNation.value.pageSize,
|
pageSize: pageNation.value.pageSize,
|
||||||
});
|
});
|
||||||
res.list.forEach((item) => messageHistoryList.value.push(item));
|
messageHistoryList.value = res.list || [];
|
||||||
pageNation.value.total = res.total;
|
pageNation.value.total = res.total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,6 +436,18 @@
|
||||||
await loadMessageHistoryList(position.value, currentResourceType.value);
|
await loadMessageHistoryList(position.value, currentResourceType.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setReadMessage(item: MessageHistoryItem) {
|
||||||
|
if (item.status === 'READ') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await getMessageRead(item.id);
|
||||||
|
loadMessageHistoryList(position.value, currentResourceType.value);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { cloneDeep } from 'lodash-es';
|
||||||
import JSEncrypt from 'jsencrypt';
|
import JSEncrypt from 'jsencrypt';
|
||||||
|
|
||||||
import { BatchActionQueryParams, MsTableColumnData } from '@/components/pure/ms-table/type';
|
import { BatchActionQueryParams, MsTableColumnData } from '@/components/pure/ms-table/type';
|
||||||
|
import type { MsTreeNodeData } from '@/components/business/ms-tree/types';
|
||||||
|
|
||||||
import { BugEditCustomField, CustomFieldItem } from '@/models/bug-management';
|
import { BugEditCustomField, CustomFieldItem } from '@/models/bug-management';
|
||||||
|
|
||||||
|
@ -1043,3 +1044,12 @@ export function formatDuration(ms: number) {
|
||||||
|
|
||||||
export const operationWidth = (enWidth: number, zhWidth: number) =>
|
export const operationWidth = (enWidth: number, zhWidth: number) =>
|
||||||
localStorage.getItem('MS-locale') === 'en-US' ? enWidth : zhWidth;
|
localStorage.getItem('MS-locale') === 'en-US' ? enWidth : zhWidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉树查询检索
|
||||||
|
* @param searchValue 搜索关键字
|
||||||
|
* @param nodeData 树节点
|
||||||
|
*/
|
||||||
|
export function filterTreeNode(searchValue: string, nodeData: MsTreeNodeData, nameKey = 'name') {
|
||||||
|
return nodeData[nameKey].toLowerCase().includes(searchValue.toLowerCase());
|
||||||
|
}
|
||||||
|
|
|
@ -354,6 +354,7 @@
|
||||||
threshold: 200,
|
threshold: 200,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
allow-search
|
allow-search
|
||||||
>
|
>
|
||||||
<template #tree-slot-title="node">
|
<template #tree-slot-title="node">
|
||||||
|
@ -451,7 +452,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { filterTree, getGenerateId, parseQueryParams } from '@/utils';
|
import { filterTree, filterTreeNode, getGenerateId, parseQueryParams } from '@/utils';
|
||||||
import { scrollIntoView } from '@/utils/dom';
|
import { scrollIntoView } from '@/utils/dom';
|
||||||
import { registerCatchSaveShortcut, removeCatchSaveShortcut } from '@/utils/event';
|
import { registerCatchSaveShortcut, removeCatchSaveShortcut } from '@/utils/event';
|
||||||
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
|
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
<a-form-item :label="t('apiTestDebug.requestModule')" class="mb-0">
|
<a-form-item :label="t('apiTestDebug.requestModule')" class="mb-0">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
v-model:modelValue="saveModalForm.moduleId"
|
v-model:modelValue="saveModalForm.moduleId"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
:data="apiModuleTree"
|
:data="apiModuleTree"
|
||||||
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
||||||
:tree-props="{
|
:tree-props="{
|
||||||
|
@ -72,6 +73,7 @@
|
||||||
import { addCase, addDefinition, getModuleTreeOnlyModules } from '@/api/modules/api-test/management';
|
import { addCase, addDefinition, getModuleTreeOnlyModules } from '@/api/modules/api-test/management';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { AddApiCaseParams } from '@/models/apiTest/management';
|
import { AddApiCaseParams } from '@/models/apiTest/management';
|
||||||
import { RequestCaseStatus, RequestDefinitionStatus } from '@/enums/apiEnum';
|
import { RequestCaseStatus, RequestDefinitionStatus } from '@/enums/apiEnum';
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
:draggable="false"
|
:draggable="false"
|
||||||
allow-search
|
allow-search
|
||||||
allow-clear
|
allow-clear
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
>
|
>
|
||||||
<template #tree-slot-title="node">
|
<template #tree-slot-title="node">
|
||||||
<a-tooltip :content="`${node.name}`" position="tl">
|
<a-tooltip :content="`${node.name}`" position="tl">
|
||||||
|
@ -252,6 +253,7 @@
|
||||||
class="w-[500px]"
|
class="w-[500px]"
|
||||||
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
||||||
allow-search
|
allow-search
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
>
|
>
|
||||||
<template #tree-slot-title="node">
|
<template #tree-slot-title="node">
|
||||||
<a-tooltip :content="`${node.name}`" position="tl">
|
<a-tooltip :content="`${node.name}`" position="tl">
|
||||||
|
@ -361,7 +363,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { filterTree, TreeNode } from '@/utils';
|
import { filterTree, filterTreeNode, TreeNode } from '@/utils';
|
||||||
|
|
||||||
import type { ImportApiDefinitionParams, ImportApiDefinitionRequest } from '@/models/apiTest/management';
|
import type { ImportApiDefinitionParams, ImportApiDefinitionRequest } from '@/models/apiTest/management';
|
||||||
import type { ModuleTreeNode } from '@/models/common';
|
import type { ModuleTreeNode } from '@/models/common';
|
||||||
|
|
|
@ -115,11 +115,12 @@
|
||||||
import { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
|
import { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
import { RequestDefinitionStatus } from '@/enums/apiEnum';
|
import { RequestDefinitionStatus } from '@/enums/apiEnum';
|
||||||
|
|
||||||
import type { FormInstance, TreeNodeData } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
selectTree?: ModuleTreeNode[];
|
selectTree?: ModuleTreeNode[];
|
||||||
|
@ -136,10 +137,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterTreeNode(searchValue: string, nodeData: TreeNodeData) {
|
|
||||||
return (nodeData as ModuleTreeNode).name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
formRef,
|
formRef,
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
threshold: 200,
|
threshold: 200,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
allow-search
|
allow-search
|
||||||
@change="() => emit('change')"
|
@change="() => emit('change')"
|
||||||
>
|
>
|
||||||
|
@ -99,6 +100,7 @@
|
||||||
import apiStatus from '@/views/api-test/components/apiStatus.vue';
|
import apiStatus from '@/views/api-test/components/apiStatus.vue';
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { Scenario, ScenarioDetail } from '@/models/apiTest/scenario';
|
import { Scenario, ScenarioDetail } from '@/models/apiTest/scenario';
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
|
|
|
@ -106,6 +106,7 @@
|
||||||
key: 'id',
|
key: 'id',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
:tree-props="{
|
:tree-props="{
|
||||||
virtualListProps: {
|
virtualListProps: {
|
||||||
height: 200,
|
height: 200,
|
||||||
|
@ -357,7 +358,7 @@
|
||||||
import { useAppStore, useTableStore } from '@/store';
|
import { useAppStore, useTableStore } from '@/store';
|
||||||
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
||||||
import useMinderStore from '@/store/modules/components/minder-editor';
|
import useMinderStore from '@/store/modules/components/minder-editor';
|
||||||
import { characterLimit, findNodeByKey, findNodePathByKey, mapTree } from '@/utils';
|
import { characterLimit, filterTreeNode, findNodeByKey, findNodePathByKey, mapTree } from '@/utils';
|
||||||
import { hasAnyPermission } from '@/utils/permission';
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
@ -876,11 +877,11 @@
|
||||||
|
|
||||||
async function initTableParams() {
|
async function initTableParams() {
|
||||||
let moduleIds: string[] = [];
|
let moduleIds: string[] = [];
|
||||||
if (props.activeFolder && props.activeFolder !== 'all') {
|
if (props.activeFolder) {
|
||||||
moduleIds = [props.activeFolder];
|
const activeModuleIds = props.activeFolder === 'all' ? [] : [props.activeFolder];
|
||||||
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_TABLE);
|
const getAllChildren = await tableStore.getSubShow(TableKeyEnum.CASE_MANAGEMENT_TABLE);
|
||||||
if (getAllChildren) {
|
if (getAllChildren) {
|
||||||
moduleIds = [props.activeFolder, ...props.offspringIds];
|
moduleIds = [...activeModuleIds, ...props.offspringIds];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -919,10 +920,6 @@
|
||||||
tableSelected.value = selectArr;
|
tableSelected.value = selectArr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterTreeNode(searchValue: string, nodeValue: TreeNodeData) {
|
|
||||||
return (nodeValue as ModuleTreeNode).name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const caseLevelFields = ref<Record<string, any>>({});
|
const caseLevelFields = ref<Record<string, any>>({});
|
||||||
|
|
||||||
const caseLevelList = computed(() => {
|
const caseLevelList = computed(() => {
|
||||||
|
|
|
@ -201,6 +201,7 @@
|
||||||
height: 200,
|
height: 200,
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
>
|
>
|
||||||
<template #tree-slot-title="node">
|
<template #tree-slot-title="node">
|
||||||
<a-tooltip :content="`${node.name}`" position="tl">
|
<a-tooltip :content="`${node.name}`" position="tl">
|
||||||
|
@ -287,7 +288,7 @@
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { downloadByteFile, getGenerateId } from '@/utils';
|
import { downloadByteFile, filterTreeNode, getGenerateId } from '@/utils';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AssociatedList,
|
AssociatedList,
|
||||||
|
|
|
@ -228,11 +228,6 @@
|
||||||
try {
|
try {
|
||||||
await deleteCaseModuleTree(node.id);
|
await deleteCaseModuleTree(node.id);
|
||||||
initModules();
|
initModules();
|
||||||
if (selectedNodeKeys.value[0] === node.id) {
|
|
||||||
selectedNodeKeys.value = ['all'];
|
|
||||||
emits('update:selectedKeys', selectedNodeKeys.value);
|
|
||||||
emits('caseNodeSelect', selectedNodeKeys.value, []);
|
|
||||||
}
|
|
||||||
emits('deleteNode');
|
emits('deleteNode');
|
||||||
Message.success(t('caseManagement.featureCase.deleteSuccess'));
|
Message.success(t('caseManagement.featureCase.deleteSuccess'));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -443,7 +443,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteNode() {
|
function deleteNode() {
|
||||||
caseTableRef.value.initData();
|
nextTick(() => {
|
||||||
|
if (activeFolder.value !== 'all') {
|
||||||
|
setActiveFolder('all');
|
||||||
|
} else {
|
||||||
|
caseTableRef.value?.initData();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function dragUpdate() {
|
function dragUpdate() {
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
*/
|
*/
|
||||||
import { onBeforeMount } from 'vue';
|
import { onBeforeMount } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { Message, SelectOptionData, TreeNodeData } from '@arco-design/web-vue';
|
import { Message, SelectOptionData } from '@arco-design/web-vue';
|
||||||
|
|
||||||
import MsAvatar from '@/components/pure/ms-avatar/index.vue';
|
import MsAvatar from '@/components/pure/ms-avatar/index.vue';
|
||||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||||
|
@ -225,9 +225,9 @@
|
||||||
} from '@/api/modules/case-management/caseReview';
|
} from '@/api/modules/case-management/caseReview';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import type { BaseAssociateCaseRequest, ReviewPassRule } from '@/models/caseManagement/caseReview';
|
import type { BaseAssociateCaseRequest, ReviewPassRule } from '@/models/caseManagement/caseReview';
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
|
||||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||||
|
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
|
@ -311,10 +311,6 @@
|
||||||
selectedAssociateCasesParams.value = { ...param };
|
selectedAssociateCasesParams.value = { ...param };
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterTreeNode(searchValue: string, nodeValue: TreeNodeData) {
|
|
||||||
return (nodeValue as ModuleTreeNode).name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearSelectedCases() {
|
function clearSelectedCases() {
|
||||||
selectedAssociateCasesParams.value = {
|
selectedAssociateCasesParams.value = {
|
||||||
excludeIds: [],
|
excludeIds: [],
|
||||||
|
|
|
@ -128,12 +128,13 @@
|
||||||
:data="envTree"
|
:data="envTree"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:tree-checkable="true"
|
:tree-checkable="true"
|
||||||
:allow-search="true"
|
allow-search
|
||||||
:field-names="{
|
:field-names="{
|
||||||
title: 'name',
|
title: 'name',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
}"
|
}"
|
||||||
|
:filter-tree-node="filterTreeNode"
|
||||||
tree-checked-strategy="child"
|
tree-checked-strategy="child"
|
||||||
:tree-props="{
|
:tree-props="{
|
||||||
virtualListProps: {
|
virtualListProps: {
|
||||||
|
@ -232,7 +233,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import useProjectEnvStore from '@/store/modules/setting/useProjectEnvStore';
|
import useProjectEnvStore from '@/store/modules/setting/useProjectEnvStore';
|
||||||
import { getGenerateId } from '@/utils';
|
import { filterTreeNode, getGenerateId } from '@/utils';
|
||||||
|
|
||||||
import type { ModuleTreeNode } from '@/models/common';
|
import type { ModuleTreeNode } from '@/models/common';
|
||||||
import { HttpForm } from '@/models/projectManagement/environmental';
|
import { HttpForm } from '@/models/projectManagement/environmental';
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
v-model:raw="innerSummary.summary"
|
v-model:raw="innerSummary.summary"
|
||||||
v-model:filedIds="innerSummary.richTextTmpFileIds"
|
v-model:filedIds="innerSummary.richTextTmpFileIds"
|
||||||
:upload-image="handleUploadImage"
|
:upload-image="handleUploadImage"
|
||||||
:preview-url="PreviewEditorImageUrl"
|
:preview-url="ReportPlanPreviewImageUrl"
|
||||||
class="mt-[8px] w-full"
|
class="mt-[8px] w-full"
|
||||||
:editable="!!shareId"
|
:editable="!!shareId"
|
||||||
/>
|
/>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
import MsFormItemSub from '@/components/business/ms-form-item-sub/index.vue';
|
import MsFormItemSub from '@/components/business/ms-form-item-sub/index.vue';
|
||||||
|
|
||||||
import { editorUploadFile } from '@/api/modules/test-plan/report';
|
import { editorUploadFile } from '@/api/modules/test-plan/report';
|
||||||
import { PreviewEditorImageUrl } from '@/api/requrls/case-management/featureCase';
|
import { ReportPlanPreviewImageUrl } from '@/api/requrls/test-plan/report';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { hasAnyPermission } from '@/utils/permission';
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
|
|
|
@ -208,11 +208,6 @@
|
||||||
try {
|
try {
|
||||||
await deletePlanModuleTree(node.id);
|
await deletePlanModuleTree(node.id);
|
||||||
initModules();
|
initModules();
|
||||||
if (selectedNodeKeys.value[0] === node.id) {
|
|
||||||
selectedNodeKeys.value = ['all'];
|
|
||||||
emits('update:selectedKeys', selectedNodeKeys.value);
|
|
||||||
emits('planTreeNodeSelect', selectedNodeKeys.value, []);
|
|
||||||
}
|
|
||||||
emits('deleteNode');
|
emits('deleteNode');
|
||||||
Message.success(t('common.deleteSuccess'));
|
Message.success(t('common.deleteSuccess'));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -359,15 +354,6 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.activeFolder,
|
|
||||||
(val) => {
|
|
||||||
if (val === 'all') {
|
|
||||||
initModules();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化模块文件数量
|
* 初始化模块文件数量
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { FormInstance, Message, SelectOptionData, TreeNodeData, ValidatedError } from '@arco-design/web-vue';
|
import { FormInstance, Message, SelectOptionData, ValidatedError } from '@arco-design/web-vue';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@
|
||||||
} from '@/api/modules/test-plan/testPlan';
|
} from '@/api/modules/test-plan/testPlan';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
import type { AddTestPlanParams, SwitchListModel } from '@/models/testPlan/testPlan';
|
import type { AddTestPlanParams, SwitchListModel } from '@/models/testPlan/testPlan';
|
||||||
|
@ -203,10 +204,6 @@
|
||||||
};
|
};
|
||||||
const form = ref<AddTestPlanParams>(cloneDeep(initForm));
|
const form = ref<AddTestPlanParams>(cloneDeep(initForm));
|
||||||
|
|
||||||
function filterTreeNode(searchValue: string, nodeData: TreeNodeData) {
|
|
||||||
return (nodeData as ModuleTreeNode).name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tempRange = ref<(Date | string | number)[]>(['00:00:00', '00:00:00']);
|
const tempRange = ref<(Date | string | number)[]>(['00:00:00', '00:00:00']);
|
||||||
|
|
||||||
function makeLessNumbers(value: number, isSecond = false) {
|
function makeLessNumbers(value: number, isSecond = false) {
|
||||||
|
|
|
@ -228,12 +228,9 @@
|
||||||
*/
|
*/
|
||||||
const rootModulesName = ref<string[]>([]);
|
const rootModulesName = ref<string[]>([]);
|
||||||
const folderTree = ref<ModuleTreeNode[]>([]);
|
const folderTree = ref<ModuleTreeNode[]>([]);
|
||||||
function setRootModules(treeNode: ModuleTreeNode[], isSetDefaultKey: boolean) {
|
function setRootModules(treeNode: ModuleTreeNode[]) {
|
||||||
folderTree.value = treeNode;
|
folderTree.value = treeNode;
|
||||||
rootModulesName.value = treeNode.map((e) => e.name);
|
rootModulesName.value = treeNode.map((e) => e.name);
|
||||||
if (isSetDefaultKey) {
|
|
||||||
activeFolder.value = 'all';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const showPlanDrawer = ref<boolean>(false);
|
const showPlanDrawer = ref<boolean>(false);
|
||||||
|
@ -274,7 +271,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteNode() {
|
function deleteNode() {
|
||||||
planTableRef.value?.fetchData();
|
nextTick(() => {
|
||||||
|
if (activeFolder.value !== 'all') {
|
||||||
|
setActiveFolder('all');
|
||||||
|
} else {
|
||||||
|
planTableRef.value?.fetchData();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTestPlan(type: string) {
|
function createTestPlan(type: string) {
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { FormInstance, Message, TreeNodeData } from '@arco-design/web-vue';
|
import { FormInstance, Message } from '@arco-design/web-vue';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
import MsTagsInput from '@/components/pure/ms-tags-input/index.vue';
|
import MsTagsInput from '@/components/pure/ms-tags-input/index.vue';
|
||||||
|
@ -69,6 +69,7 @@
|
||||||
import { addTestPlan, getTestPlanDetail, updateTestPlan } from '@/api/modules/test-plan/testPlan';
|
import { addTestPlan, getTestPlanDetail, updateTestPlan } from '@/api/modules/test-plan/testPlan';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import { filterTreeNode } from '@/utils';
|
||||||
|
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
import type { AddTestPlanParams } from '@/models/testPlan/testPlan';
|
import type { AddTestPlanParams } from '@/models/testPlan/testPlan';
|
||||||
|
@ -167,10 +168,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterTreeNode(searchValue: string, nodeData: TreeNodeData) {
|
|
||||||
return (nodeData as ModuleTreeNode).name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const okText = computed(() => {
|
const okText = computed(() => {
|
||||||
return props.planGroupId ? t('common.update') : t('common.create');
|
return props.planGroupId ? t('common.update') : t('common.create');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue