fix(系统设置): 修复资源池并发限制缺陷&列表字段增加过滤类型

This commit is contained in:
xinxin.wu 2024-10-25 11:06:34 +08:00 committed by Craftsman
parent 81bb2d0c39
commit 1ee17c14bf
8 changed files with 71 additions and 5 deletions

View File

@ -63,6 +63,7 @@
class="flex-1" class="flex-1"
:placeholder="t(model.placeholder || '')" :placeholder="t(model.placeholder || '')"
:max-length="model.maxLength || 255" :max-length="model.maxLength || 255"
:disabled="model.disabled"
allow-clear allow-clear
@change="emit('change')" @change="emit('change')"
/> />
@ -71,6 +72,7 @@
v-model:model-value="element[model.field]" v-model:model-value="element[model.field]"
class="flex-1" class="flex-1"
type="textarea" type="textarea"
:disabled="model.disabled"
@change=" @change="
() => { () => {
formRef?.validateField(`list[${index}].${model.field}`); formRef?.validateField(`list[${index}].${model.field}`);
@ -89,6 +91,7 @@
:max="model.max || 9999999" :max="model.max || 9999999"
model-event="input" model-event="input"
allow-clear allow-clear
:disabled="model.disabled"
@change="emit('change')" @change="emit('change')"
/> />
<template #content> <template #content>
@ -109,6 +112,7 @@
unique-value unique-value
retain-input-value retain-input-value
:max-tag-count="2" :max-tag-count="2"
:disabled="model.disabled"
@change="emit('change')" @change="emit('change')"
/> />
<a-select <a-select
@ -117,6 +121,7 @@
class="flex-1" class="flex-1"
:placeholder="t(model.placeholder || '')" :placeholder="t(model.placeholder || '')"
:options="model.options" :options="model.options"
:disabled="model.disabled"
:field-names="model.filedNames" :field-names="model.filedNames"
@change="emit('change')" @change="emit('change')"
/> />
@ -139,6 +144,7 @@
:placeholder="t(child.placeholder || '')" :placeholder="t(child.placeholder || '')"
:max-length="child.maxLength || 255" :max-length="child.maxLength || 255"
allow-clear allow-clear
:disabled="child.disabled"
@change="emit('change')" @change="emit('change')"
/> />
<a-select <a-select
@ -147,6 +153,7 @@
:class="child.className" :class="child.className"
:placeholder="t(child.placeholder || '')" :placeholder="t(child.placeholder || '')"
:options="child.options" :options="child.options"
:disabled="child.disabled"
:field-names="child.filedNames" :field-names="child.filedNames"
@change="emit('change')" @change="emit('change')"
/> />
@ -155,6 +162,7 @@
v-model="element[child.field]" v-model="element[child.field]"
type="textarea" type="textarea"
:class="child.className" :class="child.className"
:disabled="child.disabled"
:placeholder="t(child.placeholder || '')" :placeholder="t(child.placeholder || '')"
:max-length="child.maxLength || 255" :max-length="child.maxLength || 255"
:title="child.title" :title="child.title"

View File

@ -26,5 +26,6 @@ export interface FormItemModel {
defaultValue?: string | string[] | number | number[] | boolean; // 默认值 defaultValue?: string | string[] | number | number[] | boolean; // 默认值
hasRedStar?: boolean; // 是否有红星 hasRedStar?: boolean; // 是否有红星
tooltip?: string; tooltip?: string;
disabled?: boolean;
[key: string]: any; [key: string]: any;
} }

View File

@ -35,7 +35,7 @@
<a-divider direction="vertical" :margin="4" class="!mx-2"></a-divider> <a-divider direction="vertical" :margin="4" class="!mx-2"></a-divider>
<template #content> <template #content>
<div class="max-w-[400px] items-center gap-[8px] text-[14px]"> <div class="max-w-[400px] items-center gap-[8px] text-[14px]">
<div class="text-[var(--color-text-4)]">{{ t('project.taskCenter.resourcePool') }}</div> <div class="mb-[4px] text-[var(--color-text-4)]">{{ t('report.detail.api.resourcePool') }}</div>
<div> {{ props.detail.poolName || '-' }}</div> <div> {{ props.detail.poolName || '-' }}</div>
</div> </div>
</template> </template>

View File

@ -75,4 +75,5 @@ export default {
'report.detail.api.scenarioSavedEnv': 'Scenario saved environment', 'report.detail.api.scenarioSavedEnv': 'Scenario saved environment',
'report.detail.api.noResponseContent': 'There is no response', 'report.detail.api.noResponseContent': 'There is no response',
'report.detail.api.placeHolderName': 'To search by name', 'report.detail.api.placeHolderName': 'To search by name',
'report.detail.api.resourcePool': 'Resource pool',
}; };

View File

@ -73,4 +73,5 @@ export default {
'report.detail.api.scenarioSavedEnv': '场景保存的环境', 'report.detail.api.scenarioSavedEnv': '场景保存的环境',
'report.detail.api.noResponseContent': '暂无响应内容', 'report.detail.api.noResponseContent': '暂无响应内容',
'report.detail.api.placeHolderName': '通过名称搜索', 'report.detail.api.placeHolderName': '通过名称搜索',
'report.detail.api.resourcePool': '资源池',
}; };

View File

@ -64,7 +64,9 @@
<template #result="{ record }"> <template #result="{ record }">
<ExecutionStatus v-if="record.result !== '-'" :status="record.result" :module-type="ReportEnum.API_REPORT" /> <ExecutionStatus v-if="record.result !== '-'" :status="record.result" :module-type="ReportEnum.API_REPORT" />
</template> </template>
<template #triggerMode="{ record }">
{{ t(executeMethodMap[record.triggerMode]) }}
</template>
<template #[FilterSlotNameEnum.API_TEST_CASE_API_REPORT_STATUS]="{ filterContent }"> <template #[FilterSlotNameEnum.API_TEST_CASE_API_REPORT_STATUS]="{ filterContent }">
<ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="filterContent.value" /> <ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="filterContent.value" />
</template> </template>
@ -98,6 +100,8 @@
import { TableKeyEnum } from '@/enums/tableEnum'; import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { executeMethodMap } from '@/views/taskCenter/component/config';
const { t } = useI18n(); const { t } = useI18n();
const tableStore = useTableStore(); const tableStore = useTableStore();
@ -160,15 +164,37 @@
options: ExecStatusList.value, options: ExecStatusList.value,
filterSlotName: FilterSlotNameEnum.TEST_PLAN_REPORT_EXEC_STATUS, filterSlotName: FilterSlotNameEnum.TEST_PLAN_REPORT_EXEC_STATUS,
}, },
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
showInTable: true, showInTable: true,
width: 200, width: 120,
showDrag: true,
},
{
title: 'ms.taskCenter.executeMethod',
dataIndex: 'triggerMode',
slotName: 'triggerMode',
width: 120,
filterConfig: {
options: Object.keys(executeMethodMap).map((key) => ({
label: t(executeMethodMap[key]),
value: key,
})),
filterSlotName: FilterSlotNameEnum.GLOBAL_TASK_CENTER_EXEC_METHOD,
},
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
showDrag: true, showDrag: true,
}, },
{ {
title: 'common.executionResult', title: 'common.executionResult',
slotName: 'result', slotName: 'result',
dataIndex: 'result', dataIndex: 'result',
width: 200, width: 120,
filterConfig: { filterConfig: {
options: statusList.value, options: statusList.value,
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_REPORT_STATUS, filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_REPORT_STATUS,

View File

@ -636,6 +636,7 @@
max: maxConcurrentNumber.value, max: maxConcurrentNumber.value,
tooltip: licenseStore.hasLicense() ? '' : t('system.resourcePool.concurrentNumberMinToolTip'), tooltip: licenseStore.hasLicense() ? '' : t('system.resourcePool.concurrentNumberMinToolTip'),
defaultValue: 10, defaultValue: 10,
disabled: !licenseStore.hasLicense(),
}, },
{ {
field: 'singleTaskConcurrentNumber', field: 'singleTaskConcurrentNumber',
@ -656,6 +657,7 @@
max: maxSingleTaskConcurrentNumber.value, max: maxSingleTaskConcurrentNumber.value,
tooltip: licenseStore.hasLicense() ? '' : t('system.resourcePool.singleConcurrentNumberMinToolTip'), tooltip: licenseStore.hasLicense() ? '' : t('system.resourcePool.singleConcurrentNumberMinToolTip'),
defaultValue: 3, defaultValue: 3,
disabled: !licenseStore.hasLicense(),
}, },
]); ]);

View File

@ -134,7 +134,7 @@
import type { Description } from '@/components/pure/ms-description/index.vue'; import type { Description } from '@/components/pure/ms-description/index.vue';
import MsDrawer from '@/components/pure/ms-drawer/index.vue'; import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import type { MsTableColumn } from '@/components/pure/ms-table/type'; import type { MsTableColumn, MsTableColumnFilterConfig } from '@/components/pure/ms-table/type';
import useTable from '@/components/pure/ms-table/useTable'; import useTable from '@/components/pure/ms-table/useTable';
import MsTag, { TagType, Theme } from '@/components/pure/ms-tag/ms-tag.vue'; import MsTag, { TagType, Theme } from '@/components/pure/ms-tag/ms-tag.vue';
import MsTrialAlert from '@/components/business/ms-trial-alert/index.vue'; import MsTrialAlert from '@/components/business/ms-trial-alert/index.vue';
@ -151,6 +151,7 @@
import type { ResourcePoolDetail, ResourcePoolItem } from '@/models/setting/resourcePool'; import type { ResourcePoolDetail, ResourcePoolItem } from '@/models/setting/resourcePool';
import { TableKeyEnum } from '@/enums/tableEnum'; import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterRemoteMethodsEnum } from '@/enums/tableFilterEnum';
const licenseStore = useLicenseStore(); const licenseStore = useLicenseStore();
const { t } = useI18n(); const { t } = useI18n();
@ -160,6 +161,19 @@
const hasOperationPoolPermission = computed(() => const hasOperationPoolPermission = computed(() =>
hasAnyPermission(['SYSTEM_TEST_RESOURCE_POOL:READ+UPDATE', 'SYSTEM_TEST_RESOURCE_POOL:READ+DELETE']) hasAnyPermission(['SYSTEM_TEST_RESOURCE_POOL:READ+UPDATE', 'SYSTEM_TEST_RESOURCE_POOL:READ+DELETE'])
); );
const filterConfig = computed<MsTableColumnFilterConfig>(() => {
if (licenseStore.hasLicense()) {
return {
mode: 'remote',
remoteMethod: FilterRemoteMethodsEnum.SYSTEM_ORGANIZATION_LIST,
placeholderText: t('common.pleaseSelect'),
};
}
return {
options: [],
};
});
const columns: MsTableColumn = [ const columns: MsTableColumn = [
{ {
title: 'system.resourcePool.tableColumnName', title: 'system.resourcePool.tableColumnName',
@ -186,6 +200,7 @@
showInTable: true, showInTable: true,
showDrag: true, showDrag: true,
isTag: true, isTag: true,
filterConfig: filterConfig.value,
isStringTag: true, isStringTag: true,
tagPrimary: 'default', tagPrimary: 'default',
}, },
@ -197,6 +212,18 @@
{ {
title: 'system.resourcePool.tableColumnType', title: 'system.resourcePool.tableColumnType',
dataIndex: 'type', dataIndex: 'type',
filterConfig: {
options: [
{
value: 'Node',
label: 'Node',
},
{
value: 'Kubernetes',
label: 'Kubernetes',
},
],
},
}, },
{ {
title: 'system.resourcePool.tableColumnCreateTime', title: 'system.resourcePool.tableColumnCreateTime',