新增resultUrl执行传参
This commit is contained in:
@@ -83,9 +83,11 @@
|
||||
<el-pagination
|
||||
@current-change="handleImagePageChange"
|
||||
v-model:current-page="imagePage"
|
||||
:page-size="imagePageSize"
|
||||
layout="total, prev, pager, next"
|
||||
v-model:page-size="imagePageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="imageTotal"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
@@ -178,9 +180,11 @@
|
||||
<el-pagination
|
||||
@current-change="handleVideoPageChange"
|
||||
v-model:current-page="videoPage"
|
||||
:page-size="videoPageSize"
|
||||
layout="total, prev, pager, next"
|
||||
v-model:page-size="videoPageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="videoTotal"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
@@ -721,9 +725,8 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.ads-compliance-tencent {
|
||||
padding: 24px;
|
||||
background: #f5f7fa;
|
||||
min-height: calc(100vh - 60px);
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.main-card {
|
||||
@@ -755,7 +758,10 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
padding: 20px 0;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: calc(100vh - 280px);
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
@@ -805,6 +811,9 @@ onMounted(() => {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #ebeef5;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.table-wrapper :deep(.el-table) {
|
||||
@@ -866,8 +875,11 @@ onMounted(() => {
|
||||
|
||||
.pagination-container {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
flex-shrink: 0;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.media-preview {
|
||||
|
||||
@@ -890,12 +890,14 @@ const buildTreeNodes = (tree: ExecutionTreeItem[]): TreeNode[] =>
|
||||
label: f.flowName || '未命名工作流',
|
||||
nodeType: 'contentType',
|
||||
workflowId: f.Id,
|
||||
sessionId: f.sessionId, // 添加 sessionId
|
||||
sessionId: f.sessionId,
|
||||
children: (f.items || []).map((item, ii) => ({
|
||||
id: `item-${di}-${fi}-${ii}`,
|
||||
label: item.label || `作品${ii + 1}`,
|
||||
nodeType: 'title',
|
||||
fileUrl: item.content, // 直接在作品层添加 fileUrl
|
||||
fileUrl: item.content,
|
||||
workflowId: f.Id,
|
||||
sessionId: f.sessionId,
|
||||
})),
|
||||
})),
|
||||
}));
|
||||
@@ -1377,6 +1379,7 @@ const sendMessage = async () => {
|
||||
skillName: selectedCreationSkill.value?.name,
|
||||
flowName: currentWorkflowForCreation.value.flowName || currentWorkflowForCreation.value.flowTemplateName, // 工作流名称
|
||||
fileUrl: fileUrls, // 添加文件 URL 数组
|
||||
resultUrl: currentWorkflowForCreation.value.resultUrl || '', // 添加结果节点 URL
|
||||
};
|
||||
|
||||
// 5. 调用执行接口(不再使用 FormData,直接传 JSON)
|
||||
@@ -1439,7 +1442,7 @@ const getFieldClass = (type: string) => {
|
||||
};
|
||||
// 处理树节点点击
|
||||
const handleTreeNodeClick = async (data: TreeNode) => {
|
||||
// 只处理工作流节点(contentType)
|
||||
// 处理工作流节点(contentType)
|
||||
if (data.nodeType === 'contentType' && data.workflowId) {
|
||||
// 管理员权限检查:管理员只能编辑,不能进入创作模式
|
||||
if (isSuperAdmin.value) {
|
||||
@@ -1519,6 +1522,83 @@ const handleTreeNodeClick = async (data: TreeNode) => {
|
||||
// 后端错误会自动显示
|
||||
}
|
||||
}
|
||||
|
||||
// 处理结果节点(title)
|
||||
if (data.nodeType === 'title' && data.workflowId && data.fileUrl) {
|
||||
// 管理员权限检查:管理员只能编辑,不能进入创作模式
|
||||
if (isSuperAdmin.value) {
|
||||
ElMessage.warning('管理员只能查看和编辑工作流,不能进入创作模式');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 从工作空间进入,使用 execution/get 接口获取执行详情
|
||||
const res = await getExecutionDetail(String(data.workflowId));
|
||||
if (res.data) {
|
||||
// 设置当前会话的 sessionId(从工作空间进入)
|
||||
currentSessionId.value = data.sessionId || null;
|
||||
// 标记为从工作空间进入
|
||||
isFromWorkspace.value = true;
|
||||
|
||||
// 拼接当前点击结果节点的完整 URL
|
||||
const prefix = res.data.imgAddressPrefix || '';
|
||||
let resultUrl = '';
|
||||
if (data.fileUrl.startsWith('http://') || data.fileUrl.startsWith('https://')) {
|
||||
resultUrl = data.fileUrl;
|
||||
} else {
|
||||
resultUrl = prefix ? `${prefix}${data.fileUrl}` : data.fileUrl;
|
||||
}
|
||||
|
||||
// 只传递当前点击结果的 URL
|
||||
const fileUrls: string[] = [resultUrl];
|
||||
res.data.fileUrls = fileUrls;
|
||||
res.data.resultUrl = resultUrl;
|
||||
|
||||
// 切换到创作模式
|
||||
isCreationMode.value = true;
|
||||
currentWorkflowForCreation.value = res.data;
|
||||
|
||||
// 初始化创作表单的值
|
||||
Object.keys(creationFormValues).forEach((key) => delete creationFormValues[key]);
|
||||
|
||||
// 根据 nodeInputParams 初始化表单默认值
|
||||
if (res.data.nodeInputParams && Array.isArray(res.data.nodeInputParams)) {
|
||||
res.data.nodeInputParams.forEach((node: any) => {
|
||||
// 从节点根级别的 formConfig 读取
|
||||
if (node.formConfig && Array.isArray(node.formConfig)) {
|
||||
node.formConfig.forEach((field: any) => {
|
||||
const fieldKey = `${node.id}_${field.label}`;
|
||||
// 根据字段类型转换值
|
||||
if (field.type === 'number') {
|
||||
creationFormValues[fieldKey] = field.value ? Number(field.value) : null;
|
||||
} else if (field.type === 'switch') {
|
||||
creationFormValues[fieldKey] = Boolean(field.value);
|
||||
} else {
|
||||
creationFormValues[fieldKey] = field.value || '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化其他配置字段(从 config 中读取)
|
||||
if (node.config) {
|
||||
Object.keys(node.config).forEach((key) => {
|
||||
if (!['nodeCode', 'width', 'height', 'x', 'y', 'formConfig', 'inputSource', 'fieldMetadata', 'selectedModel'].includes(key)) {
|
||||
const fieldKey = `${node.id}_${key}`;
|
||||
creationFormValues[fieldKey] = node.config[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ElMessage.success(`已进入创作模式`);
|
||||
} else {
|
||||
ElMessage.warning('该工作流没有内容');
|
||||
}
|
||||
} catch (error) {
|
||||
// 后端错误会自动显示
|
||||
}
|
||||
}
|
||||
};
|
||||
// 预览节点
|
||||
const previewNode = (d: TreeNode) => {
|
||||
|
||||
Reference in New Issue
Block a user