123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625 |
- import { FormProps, BasicColumn } from '/@/components/Table';
- import { FormSchema } from '/@/components/Form/index';
- import { adapt } from '/@/utils/adapt';
- import moment from 'moment';
- const adaptWidth = adapt();
- export const columns: BasicColumn[] = [
- {
- title: 'ID',
- dataIndex: 'id',
- editComponentProps: {
- prefix: '$',
- },
- width: 100,
- sorter: true,
- },
- {
- title: '姓名',
- dataIndex: 'name',
- width: 130,
- sorter: true,
- },
- {
- title: '性别',
- dataIndex: 'gender',
- width: 130,
- customRender({ record }) {
- const options = ['男', '女'];
- return options[record.gender];
- },
- sorter: true,
- },
- {
- title: '籍贯',
- dataIndex: 'origin',
- width: 150,
- sorter: true,
- },
- {
- title: '出生年月',
- dataIndex: 'birthday',
- width: 200,
- customRender({ record }) {
- return moment(record.birthday).format('YYYY-MM-DD');
- },
- sorter: true,
- },
- {
- title: '党派',
- dataIndex: 'party',
- width: 150,
- customRender({ record }) {
- const options = ['无', '民革', '民盟', '民建', '民进', '农工', '致公党', '九三学社', '台盟'];
- return options[record.party];
- },
- sorter: true,
- },
- {
- title: '民族',
- dataIndex: 'nation',
- width: 160,
- sorter: true,
- },
- {
- title: '单位',
- dataIndex: 'company',
- width: 160,
- sorter: true,
- },
- {
- title: '人大职务',
- dataIndex: 'peopleJob',
- width: 160,
- sorter: true,
- },
- {
- title: '政协职务',
- dataIndex: 'cppccJob',
- width: 160,
- sorter: true,
- },
- {
- title: '社会职务',
- dataIndex: 'job',
- width: 160,
- sorter: true,
- },
- {
- title: '联系方式',
- dataIndex: 'mobile',
- width: 160,
- sorter: true,
- },
- ];
- export function getFormConfig(): Partial<FormProps> {
- return {
- labelWidth: 100,
- schemas: [
- {
- field: `id`,
- label: `ID`,
- component: 'Input',
- componentProps: {
- placeholder: 'ID',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `name`,
- label: `姓名`,
- component: 'Input',
- componentProps: {
- placeholder: '姓名',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `gender`,
- label: `性别`,
- component: 'Select',
- componentProps: {
- options: [
- {
- label: '男',
- value: 0,
- },
- {
- label: '女',
- value: 1,
- },
- ],
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `origin`,
- label: `籍贯`,
- component: 'Input',
- componentProps: {
- placeholder: '籍贯',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `birthday`,
- label: `出生年月`,
- component: 'DatePicker',
- componentProps: {
- placeholder: '出生年月',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `party`,
- label: `党派`,
- component: 'Select',
- componentProps: {
- options: [
- {
- label: '无',
- value: 0,
- },
- {
- label: '民革',
- value: 1,
- },
- {
- label: '民盟',
- value: 2,
- },
- {
- label: '民建',
- value: 3,
- },
- {
- label: '民进',
- value: 4,
- },
- {
- label: '农工',
- value: 5,
- },
- {
- label: '致公党',
- value: 6,
- },
- {
- label: '九三学社',
- value: 7,
- },
- {
- label: '台盟',
- value: 8,
- },
- ],
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `nation`,
- label: `民族`,
- component: 'Input',
- componentProps: {
- placeholder: '名族',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `company`,
- label: `单位`,
- component: 'Input',
- componentProps: {
- placeholder: '单位',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `peopleJob`,
- label: `人大职务`,
- component: 'Input',
- componentProps: {
- placeholder: '人大职务',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `cppccJob`,
- label: `政协职务`,
- component: 'Input',
- componentProps: {
- placeholder: '政协职务',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `job`,
- label: `社会职务`,
- component: 'Input',
- componentProps: {
- placeholder: '社会职务',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- {
- field: `mobile`,
- label: `联系方式`,
- component: 'Input',
- componentProps: {
- placeholder: '联系方式',
- },
- colProps: {
- xl: 12,
- xxl: 8,
- },
- },
- ],
- };
- }
- // =================popup================================
- export const schemas: FormSchema[] = [
- {
- field: 'name',
- component: 'Input',
- label: '姓名',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '姓名',
- },
- required: true,
- },
- {
- field: 'gender',
- component: 'Select',
- label: '性别',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '性别',
- options: [
- {
- label: '男',
- value: 0,
- },
- {
- label: '女',
- value: 1,
- },
- ],
- },
- required: true,
- },
- {
- field: 'birthday',
- component: 'DatePicker',
- label: '出生年月',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '出生年月',
- },
- required: true,
- },
- {
- field: 'origin',
- component: 'Input',
- label: '籍贯',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '籍贯',
- },
- required: true,
- },
- {
- field: 'birthplace',
- component: 'Input',
- label: '出生地',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '出生地',
- },
- required: true,
- },
- {
- field: 'cardNo',
- component: 'Input',
- label: '身份证号码',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '身份证号码',
- },
- required: true,
- },
- {
- field: 'nation',
- component: 'Input',
- label: '民族',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '民族',
- },
- required: true,
- },
- {
- field: 'party',
- label: '党派',
- component: 'Select',
- componentProps: {
- placeholder: '党派',
- options: [
- {
- label: '无',
- value: 0,
- },
- {
- label: '民革',
- value: 1,
- },
- {
- label: '民盟',
- value: 2,
- },
- {
- label: '民建',
- value: 3,
- },
- {
- label: '民进',
- value: 4,
- },
- {
- label: '农工',
- value: 5,
- },
- {
- label: '致公党',
- value: 6,
- },
- {
- label: '九三学社',
- value: 7,
- },
- {
- label: '台盟',
- value: 8,
- },
- ],
- },
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- required: true,
- },
- {
- field: 'edu',
- component: 'Input',
- label: '学历',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '学历',
- },
- required: true,
- },
- {
- field: 'title',
- component: 'Input',
- label: '职称',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '职称',
- },
- },
- {
- field: 'job',
- component: 'Input',
- label: '职务',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '职务',
- },
- required: true,
- },
- {
- field: 'address',
- component: 'Input',
- label: '地址',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '地址',
- },
- required: true,
- },
- {
- field: 'zipcode',
- component: 'Input',
- label: '邮编',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '邮编',
- },
- },
- {
- field: 'tel',
- component: 'Input',
- label: '电话',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '电话',
- },
- },
- {
- field: 'mobile',
- component: 'Input',
- label: '手机',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '手机',
- },
- required: true,
- },
- {
- field: 'old',
- component: 'Input',
- label: '办企业前工作单位',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '办企业前工作单位',
- },
- },
- {
- field: 'peopleJob',
- component: 'Input',
- label: '人大职务',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '人大职务',
- },
- },
- {
- field: 'cppccJob',
- component: 'Input',
- label: '政协职务',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '政协职务',
- },
- },
- {
- field: 'family',
- component: 'FamilyArrCom',
- label: '家庭主要成员',
- labelWidth: adaptWidth.labelWidth,
- colProps: {
- span: adaptWidth.elContainer,
- },
- defaultValue: [],
- componentProps: ({ formModel }) => {
- return {
- placeholder: '家庭主要成员',
- value: formModel.family,
- onChange: () => {},
- };
- },
- required: true,
- },
- {
- field: 'info',
- component: 'InputTextArea',
- label: '本人简历',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '本人简历',
- },
- },
- {
- field: 'company',
- component: 'Input',
- label: '所在单位',
- labelWidth: adaptWidth.labelWidth,
- defaultValue: '',
- colProps: {
- span: adaptWidth.elContainer,
- },
- componentProps: {
- placeholder: '所在单位',
- },
- required: true,
- },
- ];
|