wujingjing
2025-03-21 f78e1bd0772608c7cd59264ab94f87ef94012c0b
工作流
已修改4个文件
31 ■■■■ 文件已修改
customer_list/yw/static/config/globalConfig.test.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/n8n/index.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/MainCanvas.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/N8nNode.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
customer_list/yw/static/config/globalConfig.test.js
@@ -9,6 +9,8 @@
    WebApiUrl: {
        MainUrl: 'https://widev.cpolar.top/ai_dev/',
        // MainUrl: 'http://192.168.1.58:8080/',
        // MainUrl: 'http://192.168.1.41:8080/',
        AuthUrl: 'http://47.100.245.85:8190/',
    },
src/api/n8n/index.ts
@@ -10,14 +10,12 @@
};
export const GetN8nWorkflowList = async (params, req: any = request) => {
    const res = await req({
        url: '/n8n/connectionN8nList',
    return await req({
        url: '/n8n/get_n8n_name_list',
        method: 'POST',
        data: params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
    return convertJson(res);
};
src/components/vue-flow/MainCanvas.vue
@@ -132,7 +132,7 @@
    const res = await GetN8nWorkflowList({
        active: true,
    });
    n8nWorkflowList.value = res.values?.data ?? [];
    n8nWorkflowList.value = res?.data ?? [];
};
const nodeTypes = {};
src/components/vue-flow/ui/nodes/N8nNode.vue
@@ -20,7 +20,7 @@
                        v-model="workflow.params[0].value.value"
                        @change="workflowValueChange"
                    >
                        <el-option v-for="item in workflowList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                        <el-option v-for="item in workflowList" :key="item.id" :value="item.id" :label="item.flow_name"></el-option>
                    </el-select>
                </el-form-item>
            </FieldLayout>
@@ -91,28 +91,15 @@
const workflowValueChange = (value: string) => {
    const flow = getFlowByID(value);
    const nodes = flow.nodes;
    const webhookNode = nodes.find((item) => item.type === 'n8n-nodes-base.webhook');
    flowInput.value.params[0].value = [];
    if (!webhookNode) {
        return;
    }
    // Get path parameter from webhook node
    const path = webhookNode?.parameters?.path;
    if (path) {
        // Parse path parameters from path string
        const pathParams = path.match(/\/:([^\/]+)/g)?.map((p) => p.substring(2)) || [];
        flowInput.value.params[0].value = pathParams.map((item) => {
    flowInput.value.params[0].value =
        flow.parameters?.map((item) => {
            return {
                key: item,
                type: 'macro',
                label: '',
                value: '',
            };
        });
        // Update input parameters with path params
    }
        }) ?? [];
};
const emit = defineEmits<{
    (e: 'register', data: { validateForm: () => Promise<{ isValid: boolean; invalidFields?: any }> }): void;