|
|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useEffect } from 'react';
|
|
|
+import React, { useEffect, useState } from 'react';
|
|
|
import { Form, Input, Button, Select, DatePicker, InputNumber, Switch, Upload, message } from 'antd';
|
|
|
import { UploadOutlined } from '@ant-design/icons';
|
|
|
import moment from 'moment';
|
|
|
@@ -7,6 +7,14 @@ const { Option } = Select;
|
|
|
|
|
|
const MemberForm = ({ onSubmit, initialValues }) => {
|
|
|
const [form] = Form.useForm();
|
|
|
+ const [servicePositions, setServicePositions] = useState([
|
|
|
+ '主日学老师',
|
|
|
+ '敬拜团成员',
|
|
|
+ '接待员',
|
|
|
+ '财务',
|
|
|
+ '音控',
|
|
|
+ '祷告组长'
|
|
|
+ ]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (initialValues) {
|
|
|
@@ -49,6 +57,12 @@ const MemberForm = ({ onSubmit, initialValues }) => {
|
|
|
return isJpgOrPng && isLt2M;
|
|
|
};
|
|
|
|
|
|
+ const handleServicePositionChange = (value) => {
|
|
|
+ if (value && !servicePositions.includes(value)) {
|
|
|
+ setServicePositions([...servicePositions, value]);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<Form
|
|
|
form={form}
|
|
|
@@ -123,7 +137,16 @@ const MemberForm = ({ onSubmit, initialValues }) => {
|
|
|
name="servicePosition"
|
|
|
label="服侍岗位"
|
|
|
>
|
|
|
- <Input />
|
|
|
+ <Select
|
|
|
+ mode="tags"
|
|
|
+ style={{ width: '100%' }}
|
|
|
+ placeholder="请选择或输入服侍岗位"
|
|
|
+ onChange={handleServicePositionChange}
|
|
|
+ >
|
|
|
+ {servicePositions.map(position => (
|
|
|
+ <Option key={position} value={position}>{position}</Option>
|
|
|
+ ))}
|
|
|
+ </Select>
|
|
|
</Form.Item>
|
|
|
<Form.Item
|
|
|
name="photo"
|