diff --git a/frontend/src/api/modules/project-management/menuManagement.ts b/frontend/src/api/modules/project-management/menuManagement.ts index 61e18ef5aa..61383fe216 100644 --- a/frontend/src/api/modules/project-management/menuManagement.ts +++ b/frontend/src/api/modules/project-management/menuManagement.ts @@ -3,6 +3,7 @@ import * as Url from '@/api/requrls/project-management/menuManagement'; import { TableQueryParams } from '@/models/common'; import type { + FakeTableListItem, MenuTableConfigItem, MenuTableListItem, MenuTableListParams, @@ -106,6 +107,35 @@ export function getPlatformOptions(organizationId: string, type: MenuEnum) { return MSR.get({ url: `${Url.getPlatformOptionUrlByCase}${organizationId}` }); } +/** + * 缺陷同步保存 + * @param data 缺陷同步配置项 + * @param projectId 项目ID + * @returns + */ export function postSaveDefectSync(data: MenuTableConfigItem, projectId: string) { return MSR.post({ url: `${Url.postSyncBugConfigUrl}${projectId}`, data }); } + +// 误报规则列表查询 +export function postFakeTableList(data: TableQueryParams) { + return MSR.post({ url: `${Url.postFakeTableUrl}`, data }); +} +// 误报规则新增 +export function postAddFake(data: any) { + return MSR.post({ url: Url.postFakeTableAddUrl, data }); +} +// 误报规则更新 +export function postUpdateFake(data: any) { + return MSR.post({ url: Url.postFakeTableUpdateUrl, data }); +} + +// 误报规则启用禁用 +export function postUpdateEnableFake(data: any) { + return MSR.post({ url: Url.postFakeTableEnableUrl, data }); +} + +// 误报规则删除 +export function getDeleteFake(data: any) { + return MSR.get({ url: Url.getFakeTableDeleteUrl, data }); +} diff --git a/frontend/src/api/requrls/project-management/menuManagement.ts b/frontend/src/api/requrls/project-management/menuManagement.ts index 0e8558c974..9b6cac11c4 100644 --- a/frontend/src/api/requrls/project-management/menuManagement.ts +++ b/frontend/src/api/requrls/project-management/menuManagement.ts @@ -8,3 +8,13 @@ export const getPlatformOptionUrlByBug = '/project/application/bug/platform/'; export const getPlatformOptionUrlByCase = '/project/application/case/platform/'; // 缺陷管理-同步缺陷配置 export const postSyncBugConfigUrl = '/project/application/update/bug/sync/'; +// 误报规则列表查询 +export const postFakeTableUrl = '/fake/error/list'; +// 误报规则列表删除 +export const getFakeTableDeleteUrl = '/fake/error/delete'; +// 误报规则列表新增 +export const postFakeTableAddUrl = '/fake/error/add'; +// 误报规则列表更改 +export const postFakeTableUpdateUrl = '/fake/error/update'; +// 误报规则列表启用或禁用 +export const postFakeTableEnableUrl = '/fake/error/update/enable'; diff --git a/frontend/src/components/business/ms-batch-form/index.vue b/frontend/src/components/business/ms-batch-form/index.vue index 2d9433d2e7..64e7fa624b 100644 --- a/frontend/src/components/business/ms-batch-form/index.vue +++ b/frontend/src/components/business/ms-batch-form/index.vue @@ -38,6 +38,8 @@ asterisk-position="end" :hide-asterisk="model.hideAsterisk" :hide-label="model.hideLabel" + :content-flex="model.type !== 'multiple'" + :merge-props="model.type !== 'multiple'" > + + +
+ + + + +
+
+ +
import { ref, unref, watchEffect } from 'vue'; + import MsTagsInput from '@/components/pure/ms-tags-input/index.vue'; + import { useI18n } from '@/hooks/useI18n'; import { scrollIntoView } from '@/utils/dom'; @@ -112,6 +170,7 @@ defaultVals?: any[]; // 当外层是编辑状态时,可传入已填充的数据 isShowDrag: boolean; // 是否可以拖拽 formWidth?: string; // 自定义表单区域宽度 + showEnable?: boolean; // 是否显示启用禁用switch状态 }>(), { maxHeight: '30vh', diff --git a/frontend/src/components/business/ms-batch-form/types.ts b/frontend/src/components/business/ms-batch-form/types.ts index f60fbdb8df..f349f966fd 100644 --- a/frontend/src/components/business/ms-batch-form/types.ts +++ b/frontend/src/components/business/ms-batch-form/types.ts @@ -1,6 +1,6 @@ -import { FieldRule } from '@arco-design/web-vue'; +import { FieldRule, SelectFieldNames, SelectOptionData, SelectOptionGroup } from '@arco-design/web-vue'; -export type FormItemType = 'input' | 'select' | 'inputNumber'; +export type FormItemType = 'input' | 'select' | 'inputNumber' | 'tagInput' | 'multiple' | 'switch'; export type FormMode = 'create' | 'edit'; export type ValueType = 'Array' | 'string'; // 自定义检验器,为了传入动态渲染的表单项下标 @@ -19,6 +19,11 @@ export interface FormItemModel { maxLength?: number; hideAsterisk?: boolean; hideLabel?: boolean; + children?: FormItemModel[]; + options?: (string | number | boolean | SelectOptionData | SelectOptionGroup)[]; // select option 选项 + filedNames?: SelectFieldNames; // select option 选项字段名 + className?: string; // 自定义样式 + defaultValue?: string | string[] | number | number[] | boolean; // 默认值 } declare const _default: import('vue').DefineComponent< diff --git a/frontend/src/components/business/ms-user-group-comp/addUserModal.vue b/frontend/src/components/business/ms-user-group-comp/addUserModal.vue index 3b19adc46c..f1a15a2064 100644 --- a/frontend/src/components/business/ms-user-group-comp/addUserModal.vue +++ b/frontend/src/components/business/ms-user-group-comp/addUserModal.vue @@ -15,7 +15,7 @@ :label="t('system.userGroup.user')" :rules="[{ required: true, message: t('system.userGroup.pleaseSelectUser') }]" > - +
diff --git a/frontend/src/components/business/ms-user-selector/index.vue b/frontend/src/components/business/ms-user-selector/index.vue index 8fd229fd40..6dedfe4ef0 100644 --- a/frontend/src/components/business/ms-user-selector/index.vue +++ b/frontend/src/components/business/ms-user-selector/index.vue @@ -40,7 +40,7 @@ const props = withDefaults( defineProps<{ - value: string[] | string; // 选中的值 + modelValue: string[] | string; // 选中的值 disabled?: boolean; // 是否禁用 disabledKey?: string; // 禁用的key valueKey?: string; // value的key @@ -61,17 +61,16 @@ ); const emit = defineEmits<{ - (e: 'update:value', value: string[]): void; + (e: 'update:modelValue', value: string[]): void; }>(); const { t } = useI18n(); const allOptions = ref([]); - const currentOptions = ref([]); const currentLoadParams = ref>(props.loadOptionParams || {}); const loading = ref(false); const currentValue = computed(() => { - return currentOptions.value.filter((item) => props.value.includes(item.id)) || []; + return allOptions.value.filter((item) => props.modelValue.includes(item.id)) || []; }); const loadList = async () => { @@ -128,13 +127,11 @@ value: string | number | boolean | Record | (string | number | boolean | Record)[] ) => { const tmpArr = Array.isArray(value) ? value : [value]; - currentOptions.value = tmpArr; const { valueKey } = props; emit( - 'update:value', + 'update:modelValue', tmpArr.map((item) => item[valueKey]) ); - debouncedSearch(''); }; onMounted(async () => { diff --git a/frontend/src/enums/routeEnum.ts b/frontend/src/enums/routeEnum.ts index 6071b654cf..ef17510e21 100644 --- a/frontend/src/enums/routeEnum.ts +++ b/frontend/src/enums/routeEnum.ts @@ -28,6 +28,7 @@ export enum ProjectManagementRouteEnum { PROJECT_MANAGEMENT_PERMISSION_VERSION = 'projectManagementPermissionVersion', PROJECT_MANAGEMENT_PERMISSION_USER_GROUP = 'projectManagementPermissionUserGroup', PROJECT_MANAGEMENT_PERMISSION_MEMBER = 'projectManagementPermissionMember', + PROJECT_MANAGEMENT_MENU_MANAGEMENT_ERROR_REPORT_RULE = 'projectManagementMenuManagementErrorReportRule', } export enum TestPlanRouteEnum { diff --git a/frontend/src/enums/tableEnum.ts b/frontend/src/enums/tableEnum.ts index c2537fc182..4d5110dec6 100644 --- a/frontend/src/enums/tableEnum.ts +++ b/frontend/src/enums/tableEnum.ts @@ -23,6 +23,7 @@ export enum TableKeyEnum { FILE_MANAGEMENT_FILE = 'fileManagementFile', FILE_MANAGEMENT_CASE = 'fileManagementCase', FILE_MANAGEMENT_VERSION = 'fileManagementVersion', + PROJECT_MANAGEMENT_MENU_FALSE_ALERT = 'projectManagementMenuFalseAlert', } // 具有特殊功能的列 diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 3aec39daf1..be52d9cb88 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -62,4 +62,5 @@ export default { 'common.allSelect': '全选', 'common.setting': '设置', 'common.resetDefault': '恢复默认', + 'common.tagPlaceholder': '添加标签回车结束', }; diff --git a/frontend/src/models/projectManagement/menuManagement.ts b/frontend/src/models/projectManagement/menuManagement.ts index 5a4385fc30..bd42e682c5 100644 --- a/frontend/src/models/projectManagement/menuManagement.ts +++ b/frontend/src/models/projectManagement/menuManagement.ts @@ -25,3 +25,12 @@ export type SelectValue = | boolean | Record | (string | number | boolean | Record)[]; + +export interface FakeTableListItem { + name: string; + enable: boolean; + label: string[]; + rule: string; + creator: string; + updateDate: string; +} diff --git a/frontend/src/models/setting/system/orgAndProject.ts b/frontend/src/models/setting/system/orgAndProject.ts index 8aaa1b6445..94cc4f02ed 100644 --- a/frontend/src/models/setting/system/orgAndProject.ts +++ b/frontend/src/models/setting/system/orgAndProject.ts @@ -6,7 +6,7 @@ export interface CreateOrUpdateSystemOrgParams { id?: string; name: string; description: string; - memberIds: string[]; + userIds: string[]; } export interface CreateOrUpdateSystemProjectParams { id?: string; diff --git a/frontend/src/router/routes/modules/projectManagement.ts b/frontend/src/router/routes/modules/projectManagement.ts index 452bcbc28e..5c54c50e8a 100644 --- a/frontend/src/router/routes/modules/projectManagement.ts +++ b/frontend/src/router/routes/modules/projectManagement.ts @@ -143,6 +143,29 @@ const ProjectManagement: AppRouteRecordRaw = { isTopMenu: true, }, }, + // 菜单管理-误报规则 + { + path: 'errorReportRule', + name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_MENU_MANAGEMENT_ERROR_REPORT_RULE, + component: () => + import('@/views/project-management/projectAndPermission/menuManagement/components/falseAlermRule.vue'), + meta: { + locale: 'project.menu.far', + roles: ['*'], + breadcrumbs: [ + { + name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_PERMISSION_MENU_MANAGEMENT, + locale: 'project.permission.menuManagement', + }, + { + name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_MENU_MANAGEMENT_ERROR_REPORT_RULE, + locale: 'menu.projectManagement.menuManagementErrorReportRule', + editTag: 'id', + editLocale: 'project.menu.far', + }, + ], + }, + }, ], }; diff --git a/frontend/src/views/project-management/projectAndPermission/member/components/addMemberModal.vue b/frontend/src/views/project-management/projectAndPermission/member/components/addMemberModal.vue index cdf0a3ec99..1228e7987c 100644 --- a/frontend/src/views/project-management/projectAndPermission/member/components/addMemberModal.vue +++ b/frontend/src/views/project-management/projectAndPermission/member/components/addMemberModal.vue @@ -16,7 +16,7 @@ :rules="[{ required: true, message: t('project.member.selectMemberEmptyTip') }]" > + +
+ {{ t('project.menu.addFalseAlertRules') }} + +
+ + + +
+ + + + + + + + diff --git a/frontend/src/views/project-management/projectAndPermission/menuManagement/locale/zh-CN.ts b/frontend/src/views/project-management/projectAndPermission/menuManagement/locale/zh-CN.ts index b89d9fc17d..7a6294f15a 100644 --- a/frontend/src/views/project-management/projectAndPermission/menuManagement/locale/zh-CN.ts +++ b/frontend/src/views/project-management/projectAndPermission/menuManagement/locale/zh-CN.ts @@ -62,4 +62,14 @@ export default { 'project.menu.howGetJiraKey': '如何获取JIRA 项目 key ', 'project.menu.preview': '预览', 'project.menu.pleaseInputJiraKey': '请输入 JIRA 项目 key', + 'project.menu.addFalseAlertRules': '新增误报规则', + 'project.menu.nameSearch': '通过名称搜索', + 'project.menu.rule.name': '名称', + 'project.menu.rule.enable': '状态', + 'project.menu.rule.label': '标签', + 'project.menu.rule.rule': '规则', + 'project.menu.rule.creator': '创建人', + 'project.menu.rule.updateTime': '更新时间', + 'project.menu.rule.operation': '操作', + 'project.menu.rule.ruleName': '规则名称', }; diff --git a/frontend/src/views/project-management/projectAndPermission/menuManagement/menuManagement.vue b/frontend/src/views/project-management/projectAndPermission/menuManagement/menuManagement.vue index 04363e073f..8782e72c62 100644 --- a/frontend/src/views/project-management/projectAndPermission/menuManagement/menuManagement.vue +++ b/frontend/src/views/project-management/projectAndPermission/menuManagement/menuManagement.vue @@ -120,7 +120,7 @@
-
{{ t('project.menu.far') }}
+
{{ t('project.menu.far') }}
@@ -310,6 +310,7 @@ /** * @description 项目管理-项目与权限-菜单管理 */ + import { useRouter } from 'vue-router'; import { Message, TableData } from '@arco-design/web-vue'; import MsIcon from '@/components/pure/ms-icon-font/index.vue'; @@ -331,8 +332,10 @@ import { MenuTableConfigItem, PoolOption, SelectValue } from '@/models/projectManagement/menuManagement'; import { MenuEnum } from '@/enums/commonEnum'; + import { ProjectManagementRouteEnum } from '@/enums/routeEnum'; const appStore = useAppStore(); + const router = useRouter(); const currentProjectId = computed(() => appStore.currentProjectId); const { t } = useI18n(); const defectDrawerVisible = ref(false); @@ -587,6 +590,10 @@ const showDefectDrawer = () => { defectDrawerVisible.value = true; }; + // 跳转到误报规则列表页 + const pushFar = () => { + router.push({ name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_MENU_MANAGEMENT_ERROR_REPORT_RULE }); + }; onMounted(() => { setLoadListParams({ projectId: currentProjectId.value }); diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue index 4a52cfe16c..141d4a7a40 100644 --- a/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/addUserModal.vue @@ -16,7 +16,7 @@ :rules="[{ required: true, message: t('system.organization.addMemberRequired') }]" > @@ -78,9 +78,9 @@ (e: 'submit'): void; }>(); - const form = reactive<{ name: string; memberIds: string[]; description: string }>({ + const form = reactive<{ name: string; userIds: string[]; description: string }>({ name: '', - memberIds: [], + userIds: [], description: '', }); @@ -125,7 +125,7 @@ watchEffect(() => { if (props.currentOrganization) { form.name = props.currentOrganization.name; - form.memberIds = props.currentOrganization.memberIds; + form.userIds = props.currentOrganization.userIds; form.description = props.currentOrganization.description; } }); diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue index aa625dcb00..9a2e606c77 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue @@ -45,7 +45,7 @@ diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue index d18ba9a5d4..ae8ca80fa5 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/addUserModal.vue @@ -16,7 +16,7 @@ :rules="[{ required: true, message: t('system.organization.addMemberRequired') }]" > item.id) || [], + userIds: record.orgAdmins.map((item: any) => item.id) || [], }; };