diff --git a/dashboard/src/components/platform/AddNewPlatform.vue b/dashboard/src/components/platform/AddNewPlatform.vue index b837eef0d..751bbd20c 100644 --- a/dashboard/src/components/platform/AddNewPlatform.vue +++ b/dashboard/src/components/platform/AddNewPlatform.vue @@ -1,5 +1,5 @@ - + @@ -145,32 +145,38 @@ 添加路由规则 - + {{ isEditingRoutes ? 'mdi-eye' : 'mdi-pencil' }} {{ isEditingRoutes ? '查看' : '编辑' }} - + no-data-text="该平台暂无路由规则,将使用默认配置文件" hide-default-footer :items-per-page="-1" class="mt-2" + variant="outlined"> + - + {{ getMessageTypeLabel(item.messageType) }} : - + {{ item.sessionId === '*' ? '全部会话' : item.sessionId }} - + {{ getConfigName(item.configId) }} @@ -180,7 +186,8 @@ mdi-arrow-up - + mdi-arrow-down @@ -191,7 +198,8 @@ - *消息下发时,根据会话来源按顺序从上到下匹配首个符合条件的配置文件。使用 * 表示匹配所有。使用 /sid 指令获取会话 ID。 + *消息下发时,根据会话来源按顺序从上到下匹配首个符合条件的配置文件。使用 * 表示匹配所有。使用 /sid 指令获取会话 + ID。全部不匹配时将使用默认配置文件。 @@ -674,7 +682,7 @@ export default { const newConfigId = createRes.data.data.conf_id; console.log(`成功创建新配置文件 ${configName},ID: ${newConfigId}`); - + return newConfigId; } catch (err) { console.error('创建新配置文件失败:', err); @@ -754,7 +762,7 @@ export default { } this.platformRoutes = routes; - + // 如果没有路由,添加一个默认的空路由供用户编辑 if (this.platformRoutes.length === 0) { this.platformRoutes.push({ @@ -833,7 +841,7 @@ export default { const messageType = route.messageType === '*' ? '*' : route.messageType; const sessionId = route.sessionId === '*' ? '*' : route.sessionId; const newUmop = `${platformId}:${messageType}:${sessionId}`; - + if (route.configId) { fullRoutingTable[newUmop] = route.configId; } @@ -882,16 +890,17 @@ export default { toggleShowConfigSection() { this.showConfigSection = false; this.showConfigSection = true; + }, + + prepareData() { + this.getConfigInfoList(); + this.getConfigForPreview(this.selectedAbConfId); + if (this.updatingMode && this.updatingPlatformConfig && this.updatingPlatformConfig.id) { + this.getPlatformConfigs(this.updatingPlatformConfig.id); + } } }, - mounted() { - this.getConfigInfoList(); - this.getConfigForPreview(this.selectedAbConfId); - if (this.updatingMode && this.updatingPlatformConfig && this.updatingPlatformConfig.id) { - this.getPlatformConfigs(this.updatingPlatformConfig.id); - } - } }