From d3902a51cacfee77ca4ceaabc22884c60a127a96 Mon Sep 17 00:00:00 2001 From: guqing <1484563614@qq.com> Date: Mon, 24 Feb 2025 11:08:43 +0800 Subject: [PATCH] fix: drawer title for slack setting --- .../component/AccessSettingDrawer.vue | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/ui/src/views/application/component/AccessSettingDrawer.vue b/ui/src/views/application/component/AccessSettingDrawer.vue index 7b6d8f68e..19edbd578 100644 --- a/ui/src/views/application/component/AccessSettingDrawer.vue +++ b/ui/src/views/application/component/AccessSettingDrawer.vue @@ -90,8 +90,8 @@ @@ -107,11 +107,13 @@ import { MsgError, MsgSuccess } from '@/utils/message' import { copyClick } from '@/utils/clipboard' import { t } from '@/locales' +type PlatformType = 'wechat' | 'dingtalk' | 'wecom' | 'feishu' | 'slack' + const formRef = ref() const visible = ref(false) const loading = ref(false) const dataLoaded = ref(false) -const configType = ref<'wechat' | 'dingtalk' | 'wecom' | 'feishu'>('wechat') +const configType = ref('wechat') const route = useRoute() const emit = defineEmits(['refresh']) const { @@ -137,7 +139,7 @@ const form = reactive({ callback_url: '' }, feishu: { app_id: '', app_secret: '', verification_token: '', callback_url: '' }, - slack: { signing_secret: '', bot_user_token: '', callback_url: '' } + slack: { signing_secret: '', bot_user_token: '', callback_url: '' } }) const rules = reactive<{ [propName: string]: any }>({ @@ -306,7 +308,13 @@ const configFields: { [propName: string]: { [propName: string]: any } } = { } } -const passwordFields = new Set(['app_secret', 'client_secret', 'secret']) +const passwordFields = new Set([ + 'app_secret', + 'client_secret', + 'secret', + 'bot_user_token', + 'signing_secret' +]) const drawerTitle = computed( () => @@ -314,8 +322,9 @@ const drawerTitle = computed( wechat: t('views.application.applicationAccess.wechatSetting.title'), dingtalk: t('views.application.applicationAccess.dingtalkSetting.title'), wecom: t('views.application.applicationAccess.wecomSetting.title'), - feishu: t('views.application.applicationAccess.larkSetting.title') - })[configType.value] + feishu: t('views.application.applicationAccess.larkSetting.title'), + slack: t('views.application.applicationAccess.slackSetting.title') + }[configType.value]) ) const infoTitle = computed( @@ -324,8 +333,9 @@ const infoTitle = computed( wechat: t('views.applicationOverview.appInfo.header'), dingtalk: t('views.applicationOverview.appInfo.header'), wecom: t('views.applicationOverview.appInfo.header'), - feishu: t('views.applicationOverview.appInfo.header') - })[configType.value] + feishu: t('views.applicationOverview.appInfo.header'), + slack: t('views.applicationOverview.appInfo.header') + }[configType.value]) ) const passwordVisible = reactive>( @@ -366,7 +376,7 @@ const submit = async () => { }) } -const open = async (id: string, type: 'wechat' | 'dingtalk' | 'wecom' | 'feishu') => { +const open = async (id: string, type: PlatformType) => { visible.value = true configType.value = type loading.value = true @@ -388,5 +398,3 @@ const open = async (id: string, type: 'wechat' | 'dingtalk' | 'wecom' | 'feishu' defineExpose({ open }) - -