list.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { NodeConnectionTypes, type INodeType, type INodeDataBaseSchema } from '../Interface'
  2. export type ListData = INodeDataBaseSchema & {
  3. /**
  4. * 提取配置
  5. */
  6. extract_by: {
  7. enabled: boolean
  8. serial: string
  9. }
  10. /**
  11. * 过滤配置
  12. */
  13. filter_by: {
  14. enabled: boolean
  15. conditions: Array<{
  16. comparison_operator:
  17. | 'contains'
  18. | 'not_contains'
  19. | 'start_with'
  20. | 'end_with'
  21. | 'is'
  22. | 'is_not'
  23. | 'empty'
  24. | 'not_empty'
  25. | '='
  26. | '!='
  27. | '>'
  28. | '<'
  29. | '≥'
  30. | '≤'
  31. | 'all_of'
  32. left_value: string
  33. right_value: string
  34. right_value_list: string[]
  35. varType:
  36. | 'string'
  37. | 'number'
  38. | 'boolean'
  39. | 'object'
  40. | 'array[string]'
  41. | 'array[number]'
  42. | 'array[boolean]'
  43. | 'array[object]'
  44. }>
  45. }
  46. limit: {
  47. enabled: boolean
  48. size: number
  49. }
  50. order_by: {
  51. key: string
  52. value: 'asc' | 'desc' | ''
  53. }
  54. }
  55. export const listNode: INodeType = {
  56. version: ['1'],
  57. displayName: '列表操作',
  58. name: 'list',
  59. description: '列表操作节点',
  60. group: '数据处理',
  61. icon: 'lucide:list',
  62. iconColor: '#9373ee',
  63. inputs: [NodeConnectionTypes.main],
  64. outputs: [NodeConnectionTypes.main],
  65. // 业务数据
  66. schema: {
  67. appAgentId: '',
  68. parentId: '',
  69. position: {
  70. x: 20,
  71. y: 30
  72. },
  73. width: 96,
  74. height: 96,
  75. selected: false,
  76. nodeType: 'list',
  77. zIndex: 1,
  78. data: {}
  79. }
  80. }