diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue index 2f1ad32eb7..d4f0c60795 100644 --- a/frontend/src/components/pure/ms-table/base-table.vue +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -71,7 +71,7 @@ class="ml-[4px]" :options="item.filterConfig.options" :multiple="(item.filterConfig.multiple as boolean)" - @handle-confirm="(v) => handleFilterConfirm(v, item.dataIndex as string)" + @handle-confirm="(v) => handleFilterConfirm(v, item.dataIndex as string, item.filterConfig?.multiple || false,item.isCustomParam || false)" /> @@ -274,7 +274,7 @@ (e: 'sorterChange', value: { [key: string]: string }): void; (e: 'expand', record: TableData): void | Promise; (e: 'clearSelector'): void; - (e: 'filterChange', dataIndex: string, value: (string | number)[]): void; + (e: 'filterChange', dataIndex: string, value: (string | number)[], multiple: boolean, isCustomParam: boolean): void; }>(); const attrs = useAttrs(); // 全选按钮-总条数 @@ -476,8 +476,13 @@ columnSelectorVisible.value = true; }; - const handleFilterConfirm = (value: (string | number)[], dataIndex: string) => { - emit('filterChange', dataIndex, value); + const handleFilterConfirm = ( + value: (string | number)[], + dataIndex: string, + multiple: boolean, + isCustomParam: boolean + ) => { + emit('filterChange', dataIndex, value, multiple, isCustomParam); }; onMounted(async () => { diff --git a/frontend/src/components/pure/ms-table/type.ts b/frontend/src/components/pure/ms-table/type.ts index f262b23d0a..1d6b1298e9 100644 --- a/frontend/src/components/pure/ms-table/type.ts +++ b/frontend/src/components/pure/ms-table/type.ts @@ -49,6 +49,8 @@ export interface MsTableColumnData extends TableColumnData { filterConfig?: MsTableColumnFilterConfig; // 列选择的title columnTitle?: string; + // 是否是自定义字段 + isCustomParam?: boolean; } export type MsTableErrorStatus = boolean | 'error' | 'empty'; diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts index 092f8a9f87..793e849ab0 100644 --- a/frontend/src/components/pure/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -329,9 +329,18 @@ export default function useTableProps( }, // 筛选触发 - filterChange: (dataIndex: string, filteredValues: (string | number)[]) => { + filterChange: ( + dataIndex: string, + filteredValues: (string | number)[], + multiple: boolean, + isCustomParma: boolean + ) => { if (filteredValues.length > 0) { - filterItem.value = { [dataIndex]: filteredValues }; + if (isCustomParma) { + filterItem.value = { [`custom_${multiple ? 'multiple' : 'single'}_${dataIndex}`]: filteredValues }; + } else { + filterItem.value = { [dataIndex]: filteredValues }; + } } else { filterItem.value = {}; } diff --git a/frontend/src/locale/en-US/common.ts b/frontend/src/locale/en-US/common.ts index 6b0930e14b..6b49250fa8 100644 --- a/frontend/src/locale/en-US/common.ts +++ b/frontend/src/locale/en-US/common.ts @@ -66,6 +66,7 @@ export default { 'common.batchModify': 'Batch Edit', 'common.batchAdd': 'Batch Add', 'common.pleaseSelect': 'please choose', + 'common.pleaseInput': 'Please input', 'common.quickAddMember': 'Quickly add members', 'common.filter': 'Filter', 'common.export': 'Export', diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 07ee6e2891..ef0169539e 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -28,7 +28,6 @@ export default { 'common.updateFailed': '更新失败', 'common.deleteConfirm': '确认删除?', 'common.deleteConfirmTitle': '确认删除 {name} 吗', - 'common.deleteConfirmContent': '删除后,MeterSphere 创建的缺陷进入回收站;第三方平台同步的缺陷将不做回收', 'common.deleteSuccess': '删除成功', 'common.deleteFailed': '删除失败', 'common.addSuccess': '添加成功', @@ -68,6 +67,7 @@ export default { 'common.tagPlaceholder': '添加标签回车结束', 'common.batchModify': '批量修改', 'common.batchAdd': '批量添加', + 'common.pleaseInput': '请输入', 'common.pleaseSelect': '请选择', 'common.quickAddMember': '快速添加成员', 'common.export': '导出', diff --git a/frontend/src/store/modules/setting/useProjectEnvStore.ts b/frontend/src/store/modules/setting/useProjectEnvStore.ts index 5466f0a356..8a00101887 100644 --- a/frontend/src/store/modules/setting/useProjectEnvStore.ts +++ b/frontend/src/store/modules/setting/useProjectEnvStore.ts @@ -9,13 +9,23 @@ const useProjectEnvStore = defineStore( const httpNoWarning = ref(true); const getCurrentId = computed(() => currentId.value); const getHttpNoWarning = computed(() => httpNoWarning.value); + + const getDatabaseList = computed(() => [{ id: 1, name: 'test' }]); function setCurrentId(id: string | number) { currentId.value = id; } function setHttpNoWarning(noWarning: boolean) { httpNoWarning.value = noWarning; } - return { getCurrentId, currentId, httpNoWarning, setCurrentId, setHttpNoWarning, getHttpNoWarning }; + return { + getCurrentId, + currentId, + httpNoWarning, + setCurrentId, + setHttpNoWarning, + getHttpNoWarning, + getDatabaseList, + }; }, { persist: { diff --git a/frontend/src/views/project-management/environmental/components/envParams/DatabaseTab.vue b/frontend/src/views/project-management/environmental/components/envParams/DatabaseTab.vue index a7b4987b14..aa908232e5 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/DatabaseTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/DatabaseTab.vue @@ -1,13 +1,177 @@ - - + diff --git a/frontend/src/views/project-management/environmental/components/envParams/HostTab.vue b/frontend/src/views/project-management/environmental/components/envParams/HostTab.vue index a7b4987b14..5f64a2d96d 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/HostTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/HostTab.vue @@ -1,13 +1,63 @@ diff --git a/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue b/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue index 0ca7ab781b..5c75e039a3 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue @@ -39,7 +39,7 @@ - + diff --git a/frontend/src/views/project-management/environmental/locale/en-US.ts b/frontend/src/views/project-management/environmental/locale/en-US.ts index c18dad04cb..64d8cc8e09 100644 --- a/frontend/src/views/project-management/environmental/locale/en-US.ts +++ b/frontend/src/views/project-management/environmental/locale/en-US.ts @@ -1,3 +1,76 @@ export default { - 'project.environmental.title': 'Environmental Management', + 'project.environmental.project': 'Project', + 'project.environmental.projectGroup': 'Project Group', + 'project.environmental.searchHolder': 'Please enter the environment name', + 'project.environmental.allParam': 'All Parameters', + 'project.environmental.env': 'Environment', + 'project.environmental.envListIsNull': 'No data, please click "+" above to create an environment', + 'project.environmental.requestHeader': 'Request Header', + 'project.environmental.allParams': 'All Parameters', + 'project.environmental.mustContain': 'Must Contain', + 'project.environmental.searchParamsHolder': 'Search by name or tag', + 'project.environmental.paramName': 'Parameter Name', + 'project.environmental.paramType': 'Type', + 'project.environmental.paramTypeTooltip': 'json: only supports UI testing', + 'project.environmental.paramValue': 'Parameter Value', + 'project.environmental.tag': 'Tag', + 'project.environmental.desc': 'Description', + 'project.environmental.envName': 'Environment Name', + 'project.environmental.envParams': 'Environment Variables', + 'project.environmental.envNamePlaceholder': 'Please enter the environment name', + 'project.environmental.envNameRequired': 'Environment name cannot be empty', + 'project.environmental.database': 'Database', + 'project.environmental.pre': 'Pre', + 'project.environmental.post': 'Post', + 'project.environmental.host': 'Host', + 'project.environmental.assert': 'Assertion', + 'project.environmental.displaySetting': 'Display Setting', + 'project.environmental.httpTitle': 'When multiple enable conditions are met, match in order from top to bottom', + 'project.environmental.httpNoWarning': 'No warning', + 'project.environmental.addHttp': 'Add HTTP', + 'project.environmental.http.linkTimeOut': 'Link Timeout (ms):', + 'project.environmental.http.timeTimeOut': 'Timeout Time (ms):', + 'project.environmental.http.authType': 'Authentication Type:', + 'project.environmental.http.host': 'Host', + 'project.environmental.http.desc': 'Description', + 'project.environmental.http.applyScope': 'Apply Scope', + 'project.environmental.http.enableScope': 'Enable Scope', + 'project.environmental.http.value': 'Value', + 'project.environmental.http.add': 'Add HTTP', + 'project.environmental.http.hostName': 'Host Name', + 'project.environmental.http.hostNameRequired': 'Host name is required', + 'project.environmental.http.hostNamePlaceholder': 'For example: http://127.0.0.1', + 'project.environmental.http.applyModule': 'Apply Module', + 'project.environmental.http.enableCondition': 'Enable Condition', + 'project.environmental.http.none': 'None', + 'project.environmental.http.module': 'Module', + 'project.environmental.http.path': 'Path', + 'project.environmental.http.apiModuleSelect': 'Select API Test Module', + 'project.environmental.http.uiModuleSelect': 'Select UI Test Module', + 'project.environmental.http.pathRequired': 'Path is required', + 'project.environmental.database.addDatabase': 'Add Database', + 'project.environmental.database.updateDatabase': 'Update Database {name}', + 'project.environmental.database.name': 'Database Name', + 'project.environmental.database.nameIsRequire': 'Database name cannot be empty', + 'project.environmental.database.namePlaceholder': 'Please enter the database name', + 'project.environmental.database.driver': 'Driver', + 'project.environmental.database.username': 'Username', + 'project.environmental.database.password': 'Password', + 'project.environmental.database.usernameIsRequire': 'Username cannot be empty', + 'project.environmental.database.poolMax': 'Max Connections', + 'project.environmental.database.timeout': 'Timeout (ms)', + 'project.environmental.database.url': 'Database Connection URL', + 'project.environmental.database.urlExtra': 'To execute multiple SQL statements, configure allowMultiQueries=true', + 'project.environmental.database.urlIsRequire': 'Database connection URL is required', + 'project.environmental.database.testConnection': 'Test Connection', + 'project.environmental.host.config': 'Host Configuration', + 'project.environmental.host.ip': 'IP', + 'project.environmental.host.ipPlaceholder': 'Please enter the IP address', + 'project.environmental.host.ipIsRequire': 'IP address cannot be empty', + 'project.environmental.host.ipNotRepeat': 'IP address cannot be repeated', + 'project.environmental.host.hostName': 'Host Name', + 'project.environmental.host.hostNameIsRequire': 'Host name cannot be empty', + 'project.environmental.host.hostNamePlaceholder': 'Please enter the host name', + 'project.environmental.host.desc': 'Description', + 'project.environmental.host.descPlaceholder': 'Please enter the description', }; diff --git a/frontend/src/views/project-management/environmental/locale/zh-CN.ts b/frontend/src/views/project-management/environmental/locale/zh-CN.ts index 42aadb5629..02ad0803b5 100644 --- a/frontend/src/views/project-management/environmental/locale/zh-CN.ts +++ b/frontend/src/views/project-management/environmental/locale/zh-CN.ts @@ -49,4 +49,29 @@ export default { 'project.environmental.http.apiModuleSelect': '接口模块选择', 'project.environmental.http.uiModuleSelect': '选择UI测试模块', 'project.environmental.http.pathRequired': '路径必填', + 'project.environmental.database.addDatabase': '添加数据源', + 'project.environmental.database.updateDatabase': '更新数据源{name}', + 'project.environmental.database.name': '数据源名称', + 'project.environmental.database.nameIsRequire': '数据源名称不能为空', + 'project.environmental.database.namePlaceholder': '请输入数据源名称', + 'project.environmental.database.driver': '驱动', + 'project.environmental.database.username': '用户名', + 'project.environmental.database.password': '密码', + 'project.environmental.database.usernameIsRequire': '用户名不能为空', + 'project.environmental.database.poolMax': '最大链接数', + 'project.environmental.database.timeout': '超时时间 (ms)', + 'project.environmental.database.url': '数据库连接 URL', + 'project.environmental.database.urlExtra': '执行多条 SQL 语句需配置 allowMultiQueries=true', + 'project.environmental.database.urlIsRequire': '数据库连接 URL 必填', + 'project.environmental.database.testConnection': '测试连接', + 'project.environmental.host.config': 'Host 配置', + 'project.environmental.host.ip': 'IP', + 'project.environmental.host.ipPlaceholder': '请输入 IP 地址', + 'project.environmental.host.ipIsRequire': 'IP 地址不能为空', + 'project.environmental.host.ipNotRepeat': 'IP 地址不能重复', + 'project.environmental.host.hostName': '域名', + 'project.environmental.host.hostNameIsRequire': '域名不能为空', + 'project.environmental.host.hostNamePlaceholder': '请输入域名', + 'project.environmental.host.desc': '描述', + 'project.environmental.host.descPlaceholder': '请输入描述', }; diff --git a/frontend/src/views/setting/organization/project/orgProject.vue b/frontend/src/views/setting/organization/project/orgProject.vue index ac206f54c2..7944148429 100644 --- a/frontend/src/views/setting/organization/project/orgProject.vue +++ b/frontend/src/views/setting/organization/project/orgProject.vue @@ -108,6 +108,19 @@ dataIndex: 'num', width: 100, showTooltip: true, + filterConfig: { + multiple: false, + options: [ + { + label: t('common.all'), + value: 'all', + }, + { + label: t('common.only'), + value: 'only', + }, + ], + }, }, { title: 'system.organization.name', @@ -115,6 +128,19 @@ editType: ColumnEditTypeEnum.INPUT, dataIndex: 'name', showTooltip: true, + filterConfig: { + multiple: false, + options: [ + { + label: t('common.all'), + value: 'all', + }, + { + label: t('common.only'), + value: 'only', + }, + ], + }, }, { title: 'system.organization.member',