fix(全局): bugFix
This commit is contained in:
parent
af3a64689c
commit
0eadb3cb93
|
@ -23,7 +23,6 @@
|
||||||
import { SettingRouteEnum } from '@/enums/routeEnum';
|
import { SettingRouteEnum } from '@/enums/routeEnum';
|
||||||
|
|
||||||
import useMenuTree from './use-menu-tree';
|
import useMenuTree from './use-menu-tree';
|
||||||
import type { RouteMeta } from 'vue-router';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
emit: ['collapse'],
|
emit: ['collapse'],
|
||||||
|
@ -50,7 +49,8 @@
|
||||||
const openKeys = ref<string[]>([]);
|
const openKeys = ref<string[]>([]);
|
||||||
const selectedKey = ref<string[]>([]);
|
const selectedKey = ref<string[]>([]);
|
||||||
|
|
||||||
const goto = (item: RouteRecordRaw | null) => {
|
const goto = debounce(
|
||||||
|
(item: RouteRecordRaw | null) => {
|
||||||
if (item) {
|
if (item) {
|
||||||
// 如果菜单是外链
|
// 如果菜单是外链
|
||||||
if (regexUrl.test(item.path)) {
|
if (regexUrl.test(item.path)) {
|
||||||
|
@ -59,8 +59,10 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 已激活的菜单重复点击不处理
|
// 已激活的菜单重复点击不处理
|
||||||
const { hideInMenu, activeMenu } = item.meta as RouteMeta;
|
if (
|
||||||
if (route.name === item.name && !hideInMenu && !activeMenu) {
|
route.name === item.name ||
|
||||||
|
((route.name as string).includes(item.name as string) && route.meta?.hideChildrenInMenu)
|
||||||
|
) {
|
||||||
selectedKey.value = [item.name as string];
|
selectedKey.value = [item.name as string];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +82,10 @@
|
||||||
name: 'notFound',
|
name: 'notFound',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
500,
|
||||||
|
{ leading: true, trailing: false, maxWait: 500 }
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* 查找激活的菜单项
|
* 查找激活的菜单项
|
||||||
* @param target 目标菜单名
|
* @param target 目标菜单名
|
||||||
|
@ -407,7 +412,7 @@
|
||||||
// 渲染菜单项
|
// 渲染菜单项
|
||||||
const renderMenuItem = (element: RouteRecordRaw | null, icon: (() => any) | null) =>
|
const renderMenuItem = (element: RouteRecordRaw | null, icon: (() => any) | null) =>
|
||||||
element?.name === SettingRouteEnum.SETTING_ORGANIZATION ? (
|
element?.name === SettingRouteEnum.SETTING_ORGANIZATION ? (
|
||||||
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={debounce(() => goto(element), 100)}>
|
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={() => goto(element)}>
|
||||||
<div class="inline-flex w-[calc(100%-34px)] items-center justify-between !bg-transparent">
|
<div class="inline-flex w-[calc(100%-34px)] items-center justify-between !bg-transparent">
|
||||||
{collapsed.value ? (
|
{collapsed.value ? (
|
||||||
<div class="text-center text-[12px] leading-[16px]">
|
<div class="text-center text-[12px] leading-[16px]">
|
||||||
|
@ -436,7 +441,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
) : (
|
) : (
|
||||||
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={debounce(() => goto(element), 100)}>
|
<a-menu-item key={element?.name} v-slots={{ icon }} onClick={() => goto(element)}>
|
||||||
{collapsed.value ? (
|
{collapsed.value ? (
|
||||||
<div class="text-center text-[12px] leading-[16px]">
|
<div class="text-center text-[12px] leading-[16px]">
|
||||||
{t(element?.meta?.collapsedLocale || element?.meta?.locale || '')}
|
{t(element?.meta?.collapsedLocale || element?.meta?.locale || '')}
|
||||||
|
|
|
@ -1483,6 +1483,7 @@
|
||||||
Message.success(t('common.saveSuccess'));
|
Message.success(t('common.saveSuccess'));
|
||||||
handleSaveCaseCancel();
|
handleSaveCaseCancel();
|
||||||
saveCaseLoading.value = false;
|
saveCaseLoading.value = false;
|
||||||
|
done(true);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
|
|
@ -301,7 +301,9 @@
|
||||||
* @param isModule 是否是删除模块
|
* @param isModule 是否是删除模块
|
||||||
*/
|
*/
|
||||||
function handleDeleteApiFromModuleTree(id: string, isModule = false) {
|
function handleDeleteApiFromModuleTree(id: string, isModule = false) {
|
||||||
if (isModule) {
|
if (activeApiTab.value.id === 'all') {
|
||||||
|
apiRef.value?.refreshTable();
|
||||||
|
} else if (isModule) {
|
||||||
// 删除整个模块
|
// 删除整个模块
|
||||||
apiTabs.value = apiTabs.value.filter((item) => {
|
apiTabs.value = apiTabs.value.filter((item) => {
|
||||||
if (activeApiTab.value.id === item.id) {
|
if (activeApiTab.value.id === item.id) {
|
||||||
|
|
|
@ -33,11 +33,13 @@
|
||||||
</template>
|
</template>
|
||||||
<template #operation="{ record }">
|
<template #operation="{ record }">
|
||||||
<div class="flex flex-row flex-nowrap">
|
<div class="flex flex-row flex-nowrap">
|
||||||
<MsButton class="!mr-0" @click="handleRecover(record)">{{ t('bugManagement.recycle.recover') }}</MsButton>
|
<MsButton v-permission="['PROJECT_BUG:READ+DELETE']" class="!mr-0" @click="handleRecover(record)">
|
||||||
|
{{ t('bugManagement.recycle.recover') }}
|
||||||
|
</MsButton>
|
||||||
<a-divider direction="vertical" />
|
<a-divider direction="vertical" />
|
||||||
<MsButton class="!mr-0" @click="handleDelete(record)">{{
|
<MsButton v-permission="['PROJECT_BUG:READ+DELETE']" class="!mr-0" @click="handleDelete(record)">
|
||||||
t('bugManagement.recycle.permanentlyDelete')
|
{{ t('bugManagement.recycle.permanentlyDelete') }}
|
||||||
}}</MsButton>
|
</MsButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -307,7 +309,7 @@
|
||||||
{
|
{
|
||||||
eventTag: 'recover',
|
eventTag: 'recover',
|
||||||
label: t('bugManagement.recycle.recover'),
|
label: t('bugManagement.recycle.recover'),
|
||||||
permission: ['PROJECT_BUG:READ+UPDATE'],
|
permission: ['PROJECT_BUG:READ+DELETE'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
eventTag: 'delete',
|
eventTag: 'delete',
|
||||||
|
|
|
@ -134,7 +134,13 @@
|
||||||
modulesCount?: Record<string, number>; // 模块数量统计对象
|
modulesCount?: Record<string, number>; // 模块数量统计对象
|
||||||
isExpandAll?: boolean; // 是否展开所有节点
|
isExpandAll?: boolean; // 是否展开所有节点
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits(['init', 'folderNodeSelect', 'create']);
|
const emit = defineEmits<{
|
||||||
|
(e: 'init', data: ModuleTreeNode[], nodePathObj: Record<string, any>): void;
|
||||||
|
(e: 'folderNodeSelect', selectedKeys: string[], offspringIds: string[]): void;
|
||||||
|
(e: 'create'): void;
|
||||||
|
(e: 'nodeDelete'): void;
|
||||||
|
(e: 'nodeDrop'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -263,6 +269,7 @@
|
||||||
await deleteReviewModule(node.id);
|
await deleteReviewModule(node.id);
|
||||||
Message.success(t('caseManagement.caseReview.deleteSuccess'));
|
Message.success(t('caseManagement.caseReview.deleteSuccess'));
|
||||||
initModules(selectedKeys.value[0] === node.id);
|
initModules(selectedKeys.value[0] === node.id);
|
||||||
|
emit('nodeDelete');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -334,6 +341,7 @@
|
||||||
dropPosition,
|
dropPosition,
|
||||||
});
|
});
|
||||||
Message.success(t('caseManagement.caseReview.moduleMoveSuccess'));
|
Message.success(t('caseManagement.caseReview.moduleMoveSuccess'));
|
||||||
|
emit('nodeDrop');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
@ -502,7 +502,6 @@
|
||||||
];
|
];
|
||||||
const selectedModuleKeys = ref<string[]>([]);
|
const selectedModuleKeys = ref<string[]>([]);
|
||||||
const tableStore = useTableStore();
|
const tableStore = useTableStore();
|
||||||
await tableStore.initColumn(TableKeyEnum.CASE_MANAGEMENT_REVIEW, columns, 'drawer', true);
|
|
||||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, resetFilterParams } = useTable(
|
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, resetFilterParams } = useTable(
|
||||||
getReviewList,
|
getReviewList,
|
||||||
{
|
{
|
||||||
|
@ -769,6 +768,12 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
searchReview,
|
||||||
|
});
|
||||||
|
|
||||||
|
await tableStore.initColumn(TableKeyEnum.CASE_MANAGEMENT_REVIEW, columns, 'drawer', true);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -11,11 +11,14 @@
|
||||||
@folder-node-select="handleFolderNodeSelect"
|
@folder-node-select="handleFolderNodeSelect"
|
||||||
@init="initModuleTree"
|
@init="initModuleTree"
|
||||||
@create="goCreateReview"
|
@create="goCreateReview"
|
||||||
|
@node-delete="handleModuleTreeChange"
|
||||||
|
@node-drop="handleModuleTreeChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #second>
|
<template #second>
|
||||||
<ReviewTable
|
<ReviewTable
|
||||||
|
ref="reviewTableRef"
|
||||||
v-model:show-type="showType"
|
v-model:show-type="showType"
|
||||||
:active-folder="activeFolderId"
|
:active-folder="activeFolderId"
|
||||||
:module-tree="moduleTree"
|
:module-tree="moduleTree"
|
||||||
|
@ -41,14 +44,12 @@
|
||||||
import ReviewTable from './components/index/reviewTable.vue';
|
import ReviewTable from './components/index/reviewTable.vue';
|
||||||
|
|
||||||
import { reviewModuleCount } from '@/api/modules/case-management/caseReview';
|
import { reviewModuleCount } from '@/api/modules/case-management/caseReview';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
|
||||||
|
|
||||||
import { ReviewListQueryParams } from '@/models/caseManagement/caseReview';
|
import { ReviewListQueryParams } from '@/models/caseManagement/caseReview';
|
||||||
import { ModuleTreeNode } from '@/models/common';
|
import { ModuleTreeNode } from '@/models/common';
|
||||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
type ShowType = 'all' | 'reviewByMe' | 'createByMe';
|
type ShowType = 'all' | 'reviewByMe' | 'createByMe';
|
||||||
|
|
||||||
|
@ -60,6 +61,7 @@
|
||||||
const moduleTree = ref<ModuleTreeNode[]>([]);
|
const moduleTree = ref<ModuleTreeNode[]>([]);
|
||||||
const moduleTreePathMap = ref<Record<string, any>>({});
|
const moduleTreePathMap = ref<Record<string, any>>({});
|
||||||
const modulesCount = ref<Record<string, number>>({});
|
const modulesCount = ref<Record<string, number>>({});
|
||||||
|
const reviewTableRef = ref<InstanceType<typeof ReviewTable>>();
|
||||||
|
|
||||||
function initModuleTree(tree: ModuleTreeNode[], pathMap: Record<string, any>) {
|
function initModuleTree(tree: ModuleTreeNode[], pathMap: Record<string, any>) {
|
||||||
moduleTree.value = unref(tree);
|
moduleTree.value = unref(tree);
|
||||||
|
@ -81,6 +83,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleModuleTreeChange() {
|
||||||
|
reviewTableRef.value?.searchReview();
|
||||||
|
}
|
||||||
|
|
||||||
function goCreateReview() {
|
function goCreateReview() {
|
||||||
router.push({
|
router.push({
|
||||||
name: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_CREATE,
|
name: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_CREATE,
|
||||||
|
|
Loading…
Reference in New Issue