wujingjing
2024-12-16 10ab6a46af767c69c290e9baf07079910e282a4e
src/components/vue-flow/VueFlowHelper.ts
@@ -87,7 +87,54 @@
               },
            ];
            break;
         case NodeType.Code:
            data = {
               ...data,
               description: '自定义需要执行的代码。',
               [VueFlowConstant.GROUP_PARAMS_KEY]: [
                  {
                     name: '入参',
                     [VueFlowConstant.PARAMS_KEY]: [
                        {
                           key: 'code_input',
                           type: 'code_input',
                           required: true,
                           value: [
                              { key: 'arg1', type: 'input', label: '', value: '' },
                              { key: 'arg2', type: 'input', label: '', value: '' },
                           ],
                        },
                     ],
                  },
                  {
                     name: '执行代码',
                     [VueFlowConstant.PARAMS_KEY]: [
                        {
                           key: 'code',
                           type: 'code',
                           required: true,
                           value: 'const main = (arg1, arg2) =>{\n  return {\n    result1: arg1,\n    result2: arg2\n  }\n}',
                        },
                     ],
                  },
                  {
                     name: '出参',
                     [VueFlowConstant.PARAMS_KEY]: [
                        {
                           key: 'code_output',
                           type: 'code_output',
                           // global: 'code:value.map(el => ({ label: el.key, value: el.key }))',
                           required: true,
                           value: [
                              { key: 'result1', type: 'string' },
                              { key: 'result2', type: 'string' },
                           ],
                        },
                     ],
                  },
               ],
            };
            break;
         case NodeType.Agent:
            data[VueFlowConstant.GROUP_PARAMS_KEY] = [
               {