basicConfiguration.ts 1.37 KB
import { getOrganizationList } from '/@/api/system/system';
import { FormSchema } from '/@/components/Form';

export const basicSchema: FormSchema[] = [
  {
    field: 'name',
    label: '组件名称',
    component: 'Input',
  },
  {
    field: 'remake',
    label: '组件备注',
    component: 'InputTextArea',
  },
];

export const dataSourceSchema: FormSchema[] = [
  {
    field: 'org',
    component: 'ApiTreeSelect',
    label: '组织',
    colProps: { span: 6 },
    componentProps() {
      return {
        placeholder: '请选择组织',
        api: async () => {
          const data = await getOrganizationList();
          return data;
        },

        onChange() {},
      };
    },
  },
  {
    field: 'device',
    component: 'Select',
    label: '设备',
    colProps: { span: 5 },
    componentProps: {
      placeholder: '请选择设备',
    },
  },
  {
    field: 'attr',
    component: 'Select',
    label: '属性',
    colProps: { span: 5 },
    componentProps: {
      placeholder: '请选择属性',
    },
  },
  {
    field: 'deviceRename',
    component: 'Input',
    label: '设备',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '设备重命名',
    },
  },
  {
    field: 'attrRename',
    component: 'Input',
    label: '属性',
    colProps: { span: 4 },
    componentProps: {
      placeholder: '属性重命名',
    },
  },
];