config.data.ts 1.2 KB
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { findDictItemByCode } from '/@/api/system/dict';

export const columns: BasicColumn[] = [
  {
    title: '场景联动名称',
    dataIndex: 'name',
  },
  {
    title: '触发方式',
    // dataIndex: 'name',
    width: 200,
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 200,
  },
  {
    title: '描述',
    dataIndex: 'description',
    width: 180,
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'configName',
    label: '场景联动名称',
    required: true,
    component: 'Input',
  },
  {
    field: 'messageType',
    label: '所属组织',
    required: true,
    component: 'ApiSelect',
    componentProps: {
      api: findDictItemByCode,
      params: {
        dictCode: 'message_type',
      },
      labelField: 'itemText',
      valueField: 'itemValue',
    },
  },
  {
    field: 'no1',
    label: '触发器',
    required: true,
    component: 'Input',
  },
  {
    field: 'no2',
    label: '执行条件',
    required: true,
    component: 'Input',
  },
  {
    field: 'no3',
    label: '执行动作',
    required: true,
    component: 'Input',
  },
];