fix(项目管理): 修复环境管理显示设置统一和显示设置关闭后不展示

This commit is contained in:
xinxin.wu 2024-04-16 19:28:31 +08:00 committed by Craftsman
parent b8a6bcbb6b
commit b3cd1fb950
8 changed files with 38 additions and 8 deletions

View File

@ -59,6 +59,7 @@ export enum TableKeyEnum {
PROJECT_MANAGEMENT_ENV_ALL_PARAM = 'projectManagementEnvAllParam', PROJECT_MANAGEMENT_ENV_ALL_PARAM = 'projectManagementEnvAllParam',
PROJECT_MANAGEMENT_ENV_ENV_PARAM = 'projectManagementEnvEnvParam', PROJECT_MANAGEMENT_ENV_ENV_PARAM = 'projectManagementEnvEnvParam',
PROJECT_MANAGEMENT_ENV_ENV_HTTP = 'projectManagementEnvEnvHttp', PROJECT_MANAGEMENT_ENV_ENV_HTTP = 'projectManagementEnvEnvHttp',
PROJECT_MANAGEMENT_ENV_ENV_DATASTORES = 'projectManagementEnvEnvDataSource',
PROJECT_MANAGEMENT_ENV_ALL_PARAM_HEADER = 'projectManagementEnvAllParamHeader', PROJECT_MANAGEMENT_ENV_ALL_PARAM_HEADER = 'projectManagementEnvAllParamHeader',
PROJECT_MANAGEMENT_ENV_ALL_PARAM_VARIABLE = 'projectManagementEnvAllParamVariable', PROJECT_MANAGEMENT_ENV_ALL_PARAM_VARIABLE = 'projectManagementEnvAllParamVariable',
TEST_PLAN_ALL_TABLE = 'testPlanAllTable', TEST_PLAN_ALL_TABLE = 'testPlanAllTable',

View File

@ -515,6 +515,7 @@
function changeShowType(val: string | number | boolean) { function changeShowType(val: string | number | boolean) {
showType.value = val as ReportShowType; showType.value = val as ReportShowType;
resetSelector();
initData(); initData();
} }

View File

@ -100,6 +100,7 @@
function searchStep() { function searchStep() {
const splitLevel = props.keyWords.split('-'); const splitLevel = props.keyWords.split('-');
const stepTypeStatus = splitLevel[1]; const stepTypeStatus = splitLevel[1];
expandedKeys.value = [];
const search = (_data: ScenarioItemType[]) => { const search = (_data: ScenarioItemType[]) => {
const result: ScenarioItemType[] = []; const result: ScenarioItemType[] = [];
_data.forEach((item) => { _data.forEach((item) => {

View File

@ -136,6 +136,15 @@
hasChange.value = true; hasChange.value = true;
}; };
watch(
() => props.visible,
(value) => {
if (value) {
hasChange.value = false;
}
}
);
onBeforeMount(() => { onBeforeMount(() => {
loadTab(); loadTab();
}); });

View File

@ -139,7 +139,7 @@
{ {
value: EnvTabTypeEnum.ENVIRONMENT_SETTING, value: EnvTabTypeEnum.ENVIRONMENT_SETTING,
label: t('project.environmental.displaySetting'), label: t('project.environmental.displaySetting'),
canHide: false, canHide: true,
isShow: true, isShow: true,
}, },
]; ];

View File

@ -25,12 +25,12 @@
}}</span></a-divider }}</span></a-divider
> >
<VueDraggable <VueDraggable
v-model="couldCloseColumn" v-model="couldCloseColumnExcludeSetting"
class="ms-assertion-body-left" class="ms-assertion-body-left"
ghost-class="ghost" ghost-class="ghost"
handle=".column-drag-item" handle=".column-drag-item"
> >
<div v-for="element in couldCloseColumn" :key="element.value" class="column-drag-item"> <div v-for="element in couldCloseColumnExcludeSetting" :key="element.value" class="column-drag-item">
<div class="flex w-[90%] items-center"> <div class="flex w-[90%] items-center">
<span class="ml-[8px]">{{ t(element.label) }}</span> <span class="ml-[8px]">{{ t(element.label) }}</span>
</div> </div>
@ -73,10 +73,14 @@
const loadColumn = async () => { const loadColumn = async () => {
const res = (await store.getContentTabList()) || []; const res = (await store.getContentTabList()) || [];
nonCloseColumn.value = res.filter((item) => !item.canHide && item.value !== 'SETTING'); nonCloseColumn.value = res.filter((item) => !item.canHide);
couldCloseColumn.value = res.filter((item) => item.canHide); couldCloseColumn.value = res.filter((item) => item.canHide);
}; };
const couldCloseColumnExcludeSetting = computed(() => {
return couldCloseColumn.value.filter((item) => item.canHide && item.value !== 'SETTING');
});
const handleReset = () => { const handleReset = () => {
loadColumn(); loadColumn();
hasChange.value = false; hasChange.value = false;
@ -86,6 +90,15 @@
hasChange.value = true; hasChange.value = true;
}; };
watch(
() => innerVisible.value,
(value) => {
if (value) {
hasChange.value = false;
}
}
);
onBeforeMount(() => { onBeforeMount(() => {
loadColumn(); loadColumn();
}); });
@ -115,7 +128,7 @@
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 8px 12px 8px 36px; padding: 8px 12px 8px 16px;
&:hover { &:hover {
border-radius: 6px; border-radius: 6px;
background: var(--color-text-n9); background: var(--color-text-n9);

View File

@ -87,8 +87,9 @@
title: 'project.environmental.database.name', title: 'project.environmental.database.name',
dataIndex: 'dataSource', dataIndex: 'dataSource',
showTooltip: true, showTooltip: true,
showDrag: true, showDrag: false,
showInTable: true, showInTable: true,
columnSelectorDisabled: true,
}, },
{ {
title: 'project.environmental.database.driver', title: 'project.environmental.database.driver',
@ -142,7 +143,6 @@
showPagination: false, showPagination: false,
heightUsed: 590, heightUsed: 590,
showMode: false, showMode: false,
isSimpleSetting: true,
}); });
const moreActionList: ActionsItem[] = [ const moreActionList: ActionsItem[] = [

View File

@ -124,6 +124,7 @@
import type { ModuleTreeNode } from '@/models/common'; import type { ModuleTreeNode } from '@/models/common';
import type { CommonParams } from '@/models/projectManagement/environmental'; import type { CommonParams } from '@/models/projectManagement/environmental';
import { HttpForm } from '@/models/projectManagement/environmental'; import { HttpForm } from '@/models/projectManagement/environmental';
import { TableKeyEnum } from '@/enums/tableEnum';
const appStore = useAppStore(); const appStore = useAppStore();
const { t } = useI18n(); const { t } = useI18n();
@ -139,6 +140,8 @@
dataIndex: 'url', dataIndex: 'url',
slotName: 'url', slotName: 'url',
showTooltip: true, showTooltip: true,
showDrag: false,
columnSelectorDisabled: true,
}, },
{ {
title: 'project.environmental.http.desc', title: 'project.environmental.http.desc',
@ -167,12 +170,14 @@
width: 170, width: 170,
}, },
]; ];
await tableStore.initColumn(TableKeyEnum.PROJECT_MANAGEMENT_ENV_ENV_DATASTORES, columns);
const { propsRes, propsEvent } = useTable(undefined, { const { propsRes, propsEvent } = useTable(undefined, {
tableKey: TableKeyEnum.PROJECT_MANAGEMENT_ENV_ENV_DATASTORES,
columns, columns,
scroll: { x: '100%' }, scroll: { x: '100%' },
selectable: false, selectable: false,
noDisable: true, noDisable: true,
showSetting: false, showSetting: true,
showPagination: false, showPagination: false,
enableDrag: true, enableDrag: true,
showMode: false, showMode: false,