feat: add feishu and aliyunsms

This commit is contained in:
engigu
2025-12-17 21:51:21 +08:00
parent f520dbf746
commit 64f746a7ec
16 changed files with 537 additions and 165 deletions
@@ -194,12 +194,12 @@ onMounted(async () => {
</Button>
</DrawerTrigger>
<DrawerContent class="w-[800px] max-w-[90vw] mx-auto h-[90vh] max-h-[90vh]">
<DrawerHeader>
<DrawerContent class="w-[800px] max-w-[90vw] mx-auto flex flex-col max-h-[96vh]">
<DrawerHeader class="flex-shrink-0">
<DrawerTitle>新增发信渠道</DrawerTitle>
</DrawerHeader>
<div class="px-4 pb-4 overflow-y-auto">
<div class="flex-1 overflow-y-auto px-4 pb-4">
<AddWays v-model:open="isAddChannelDrawerOpen" @save="handleSaveChannel" />
</div>
</DrawerContent>
@@ -257,12 +257,12 @@ onMounted(async () => {
<!-- 编辑渠道Drawer -->
<Drawer v-model:open="isEditChannelDrawerOpen">
<DrawerContent class="w-[800px] max-w-[90vw] mx-auto h-[90vh] max-h-[90vh]">
<DrawerHeader>
<DrawerContent class="w-[800px] max-w-[90vw] mx-auto flex flex-col max-h-[96vh]">
<DrawerHeader class="flex-shrink-0">
<DrawerTitle>编辑发信渠道</DrawerTitle>
</DrawerHeader>
<div class="px-4 pb-4 overflow-y-auto">
<div class="flex-1 overflow-y-auto px-4 pb-4">
<EditWays v-model:open="isEditChannelDrawerOpen" :edit-data="editChannelData" @save="handleEditChannel" />
</div>
</DrawerContent>
@@ -251,10 +251,10 @@ const saveButtonText = computed(() => {
<div class="mb-6">
<label class="text-lg font-medium mb-3 block">渠道类型</label>
<!-- 编辑模式只展示当前渠道的简洁文本描述并保留群发标识 -->
<div v-if="props.mode === 'edit'" class="flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300">
<div>当前渠道{{ currentChannelConfig?.label || channelMode }}</div>
<span v-if="currentChannelConfig?.dynamicRecipient?.support" class="inline-block text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300">群发</span>
<!-- 编辑模式只展示当前渠道的简洁文本描述并保留"群发"标识 -->
<div v-if="props.mode === 'edit'" class="flex items-center gap-1.5 text-sm text-gray-700 dark:text-gray-300">
<span class="font-medium">{{ currentChannelConfig?.label || channelMode }}</span>
<span v-if="currentChannelConfig?.dynamicRecipient?.support" class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300">群发</span>
</div>
<!-- 新增模式保留原有的单选切换显示 -->
+14 -10
View File
@@ -212,17 +212,21 @@ const formatInsConfigDisplay = (row: any) => {
if (!row.config) {
return ""
}
if (["Email", "WeChatOFAccount"].includes(row.way_type)) {
let config = JSON.parse(row.config)
// 检查是否为动态接收者模式
if (config.allowMultiRecip === true) {
return "动态接收"
}
// 固定模式,显示接收者
return config.to_account || ""
} else {
return ""
let config = JSON.parse(row.config)
// 检查是否为动态接收者模式
if (config.allowMultiRecip === true) {
return "动态接收"
}
// 固定模式,根据 constant.js 配置动态获取接收者字段
const channelConfig = CONSTANT.WAYS_DATA.find((item: any) => item.type === row.way_type)
if (channelConfig?.dynamicRecipient?.support) {
const recipientField = channelConfig.dynamicRecipient.field
return config[recipientField] || ""
}
return ""
}
// 查询实例列表数据
@@ -20,8 +20,8 @@ const forwarded = useForwardPropsEmits(props, emits) as any
v-bind="forwarded"
:class="cn(
`group/drawer-content bg-background fixed z-50 flex h-auto flex-col`,
`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg`,
`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg`,
`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[96vh] data-[vaul-drawer-direction=top]:rounded-b-lg`,
`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[96vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg`,
`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm`,
`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm`,
props.class,