From 0b4bfe01eb80a4e52fdee4f1b8827b3b59bd4ab7 Mon Sep 17 00:00:00 2001 From: v_yjjiaoyu <1981190393@qq.com> Date: Wed, 5 Mar 2025 13:37:38 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E9=A1=B9=E7=9B=AE=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E7=9A=84=E5=8F=98=E9=87=8F=E8=AF=AD=E6=B3=95=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=92=8C=E9=A3=8E=E9=99=A9=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=20#11407=20#=20Reviewed,=20transaction=20id:=2032542?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/project-form.vue | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/frontend/devops-manage/src/components/project-form.vue b/src/frontend/devops-manage/src/components/project-form.vue index 6bcd6d7562d..43f3bf8c724 100644 --- a/src/frontend/devops-manage/src/components/project-form.vue +++ b/src/frontend/devops-manage/src/components/project-form.vue @@ -13,7 +13,7 @@ import { } from 'bkui-vue/lib/icon'; import IAMIframe from './IAM-Iframe'; import { useI18n } from 'vue-i18n'; -import { Message, Popover, InfoBox, Alert } from 'bkui-vue'; +import { Message, Popover, InfoBox, Alert, Button } from 'bkui-vue'; import http from '@/http/api'; import DialectPopoverTable from "@/components/dialectPopoverTable.vue"; import copyImg from "@/css/svg/copy.svg"; @@ -116,6 +116,7 @@ const pipelinePagination = ref({ count: 0, limit: 20, current: 1 }); const initPipelineDialect = ref(); const projectId = computed(() => projectData.value.englishName); const currentPipelineDialect = computed(() => projectData.value.properties.pipelineDialect); +const infoBoxRef = ref(); const getDepartment = async (type: string, id: any) => { deptLoading.value[type] = true; @@ -295,14 +296,10 @@ const beforeChange = () => { const isClassic = currentPipelineDialect.value !== 'CLASSIC'; const title = isClassic ? t('确认切换成“传统风格?') : t('确认切换成“制约风格?'); const content = isClassic ? changeClassic() : changeConstrained(); - - InfoBox({ + infoBoxRef.value = InfoBox({ type: 'warning', width: 640, title: title, - confirmText: t('确认切换'), - cancelText: t('取消'), - confirmButtonTheme: 'danger', content: h('div', [ content, h('div', { class: 'confirm-switch' }, [ @@ -329,18 +326,27 @@ const beforeChange = () => { }) ]) ]), - onConfirm: () => { - if (confirmSwitch.value === copyText) { - resolve(true); - } else { - resolve(false); - Message({ theme: 'error', message: t('请输入:我已明确变更风险且已确认变更无影响') }); - confirmSwitch.value = ''; - } - }, - onCancel: () => { - resolve(false); - }, + footer: () => h('div',{}, [ + h(Button, { + disabled: !confirmSwitch.value, + theme: 'danger' , + onClick() { + if (confirmSwitch.value === copyText) { + resolve(true); + } else { + resolve(false); + Message({ theme: 'error', message: t('请输入:我已明确变更风险且已确认变更无影响') }); + } + infoBoxRef.value.hide() + }, + }, t('确认切换')), + h(Button, { + onClick() { + resolve(false); + infoBoxRef.value.hide() + }, + }, t('取消')) + ]) }); } else { resolve(true);