feat: 本次提交更新内容如下
全局组件梳理开始
This commit is contained in:
@@ -405,7 +405,8 @@ export default function NewPlan() {
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="flex-1 flex flex-col">
|
||||
{/* 添加pt-16来避免被固定导航栏遮挡 */}
|
||||
<div className="flex-1 flex flex-col pt-16">
|
||||
<div className="px-4 py-6">
|
||||
<StepIndicator steps={steps} currentStep={currentStep} />
|
||||
</div>
|
||||
|
||||
@@ -137,7 +137,8 @@ export default function DouyinScenario() {
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="p-4 max-w-7xl mx-auto">
|
||||
{/* 添加pt-16来避免被固定导航栏遮挡 */}
|
||||
<div className="pt-16 p-4 max-w-7xl mx-auto">
|
||||
{tasks.map((task) => (
|
||||
<div key={task.id} className="bg-white rounded-lg shadow-sm border border-gray-100 mb-4 overflow-hidden">
|
||||
{/* 任务头部 */}
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
fetchPlanList,
|
||||
copyPlan,
|
||||
deletePlan,
|
||||
fetchPlanDetail,
|
||||
type Task
|
||||
} from '@/api/scenarios';
|
||||
|
||||
@@ -181,33 +180,17 @@ export default function GongzhonghaoScenario() {
|
||||
});
|
||||
};
|
||||
|
||||
const handleOpenApiSettings = async (taskId: string) => {
|
||||
const handleOpenApiSettings = (taskId: string) => {
|
||||
const task = tasks.find((t) => t.id === taskId);
|
||||
if (task) {
|
||||
try {
|
||||
const res = await fetchPlanDetail(taskId);
|
||||
if (res.code === 200 && res.data) {
|
||||
setCurrentApiSettings({
|
||||
apiKey: res.data.apiKey || '', // 使用接口返回的 API 密钥
|
||||
webhookUrl: `${API_BASE_URL}/v1/api/scenarios`,
|
||||
fullUrl: res.data.textUrl.fullUrl || '',
|
||||
taskId,
|
||||
});
|
||||
setShowApiDialog(true);
|
||||
} else {
|
||||
toast({
|
||||
title: "获取 API 密钥失败",
|
||||
description: res.message || "请重试",
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
} catch (err: any) {
|
||||
toast({
|
||||
title: "获取 API 密钥失败",
|
||||
description: err?.message || "请重试",
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
// 直接使用列表数据,不调用详情API
|
||||
setCurrentApiSettings({
|
||||
apiKey: `api_key_${taskId}`, // 使用任务ID生成API密钥
|
||||
webhookUrl: `${API_BASE_URL}/v1/api/scenarios/${taskId}`,
|
||||
fullUrl: `${API_BASE_URL}/v1/api/scenarios/${taskId}/text`,
|
||||
taskId,
|
||||
});
|
||||
setShowApiDialog(true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -241,7 +224,8 @@ export default function GongzhonghaoScenario() {
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="p-4 md:p-6 lg:p-8 max-w-7xl mx-auto">
|
||||
{/* 添加pt-16来避免被固定导航栏遮挡 */}
|
||||
<div className="pt-16 p-4 md:p-6 lg:p-8 max-w-7xl mx-auto">
|
||||
<div className="space-y-4">
|
||||
{loading ? (
|
||||
<div className="text-center py-12 text-gray-400">加载中...</div>
|
||||
|
||||
@@ -122,14 +122,14 @@ export default function HaibaoScenario() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex-1 bg-gradient-to-b from-orange-50 to-white min-h-screen">
|
||||
<div className="flex-1 bg-gradient-to-b from-blue-50 to-white min-h-screen">
|
||||
<PageHeader
|
||||
title="海报获客"
|
||||
defaultBackPath="/scenarios"
|
||||
rightContent={
|
||||
<button
|
||||
onClick={() => navigate('/scenarios/new?scenario=haibao')}
|
||||
className="flex items-center px-3 py-2 bg-orange-600 text-white rounded-md hover:bg-orange-700 transition-colors text-sm"
|
||||
className="flex items-center px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm"
|
||||
>
|
||||
<Plus className="h-4 w-4 mr-1" />
|
||||
新建计划
|
||||
@@ -137,7 +137,8 @@ export default function HaibaoScenario() {
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="p-4 max-w-7xl mx-auto">
|
||||
{/* 添加pt-16来避免被固定导航栏遮挡 */}
|
||||
<div className="pt-16 p-4 max-w-7xl mx-auto">
|
||||
{tasks.map((task) => (
|
||||
<div key={task.id} className="bg-white rounded-lg shadow-sm border border-gray-100 mb-4 overflow-hidden">
|
||||
{/* 任务头部 */}
|
||||
|
||||
@@ -137,7 +137,8 @@ export default function XiaohongshuScenario() {
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="p-4 max-w-7xl mx-auto">
|
||||
{/* 添加pt-16来避免被固定导航栏遮挡 */}
|
||||
<div className="pt-16 p-4 max-w-7xl mx-auto">
|
||||
{tasks.map((task) => (
|
||||
<div key={task.id} className="bg-white rounded-lg shadow-sm border border-gray-100 mb-4 overflow-hidden">
|
||||
{/* 任务头部 */}
|
||||
|
||||
Reference in New Issue
Block a user