config.data.ts 2.56 KB
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { getOrganizationList } from '/@/api/system/system';
import { copyTransFun } from '/@/utils/fnUtils';
// 表格列数据
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'username',
    width: 120,
  },
  {
    title: '所属组织',
    dataIndex: 'organizationId',
    width: 160,
  },
  {
    title: '手机',
    dataIndex: 'phone',
    width: 160,
  },
  {
    title: '邮箱',
    dataIndex: 'email',
    width: 160,
  },
  {
    title: '微信',
    dataIndex: 'wechat',
    width: 180,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 120,
  },
  {
    title: '添加人',
    dataIndex: 'addPeople',
    width: 180,
  },
  {
    title: '添加时间',
    dataIndex: 'createTime',
    width: 180,
  },
  {
    title: '更新时间',
    dataIndex: 'updateTime',
    width: 180,
  },
];

// 查询字段
export const searchFormSchema: FormSchema[] = [
  {
    field: 'username',
    label: '联系人姓名',
    component: 'Input',
    colProps: { span: 6 },
    componentProps: {
      placeholder: '请输入联系人姓名',
    },
  },
];

// 弹框配置项
export const formSchema: FormSchema[] = [
  {
    field: 'username',
    label: '联系人姓名',
    required: true,
    component: 'Input',
    componentProps: {
      placeholder: '请输入联系人姓名',
    },
  },
  {
    field: 'organizationId',
    label: '所属组织',
    component: 'ApiTreeSelect',
    componentProps: {
      api: async () => {
        const data = await getOrganizationList();
        copyTransFun(data as any as any[]);
        return data;
      },
    },
  },
  {
    field: 'phone',
    label: '手机号码',
    required: true,
    component: 'Input',
    componentProps: {
      placeholder: '请输入手机号码',
    },
  },
  {
    field: 'email',
    label: '邮箱',
    component: 'Input',
    componentProps: {
      placeholder: '请输入邮箱',
    },
  },
  {
    field: 'wechat',
    label: '微信',
    component: 'Input',
    componentProps: {
      placeholder: '请输入微信号',
    },
  },
  {
    field: 'addPeople',
    label: '添加人',
    component: 'Input',
    componentProps: {
      placeholder: '请输入添加人',
    },
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '',
    },
  },
  {
    field: 'id',
    label: '',
    component: 'Input',
    componentProps: {
      style: {
        display: 'none',
      },
    },
  },
];