import { getOrganizationList } from '/@/api/system/system';
import { FormSchema } from '/@/components/Form';
import { ColEx } from '/@/components/Form/src/types';
import { useGridLayout } from '/@/hooks/component/useGridLayout';
import { copyTransFun } from '/@/utils/fnUtils';

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '看板名称',
    component: 'Input',
    // colProps: { span: 10 },
    colProps: useGridLayout(2, 3, 4) as unknown as ColEx,
  },
  {
    field: 'organizationId',
    component: 'ApiTreeSelect',
    label: '组织',
    // colProps: { span: 10 },
    colProps: useGridLayout(2, 3, 4) as unknown as ColEx,
    componentProps() {
      return {
        placeholder: '请选择组织',
        api: async () => {
          const data = await getOrganizationList();
          copyTransFun(data as any as any[]);
          return data;
        },
        getPopupContainer: () => document.body,
      };
    },
  },
];
