李志伟 3 年之前
父節點
當前提交
c3348cd76c
共有 2 個檔案被更改,包括 89 行新增89 行删除
  1. 44
    44
      src/pages/org/org/Edit/components/AdminPage.jsx
  2. 45
    45
      src/pages/org/org/Edit/components/BasicPage.jsx

+ 44
- 44
src/pages/org/org/Edit/components/AdminPage.jsx 查看文件

@@ -3,7 +3,7 @@ import { Form, Input, Button, message } from 'antd';
3 3
 import md5 from 'md5';
4 4
 import { saveOrgUser, getOrgAdminDetail } from '@/services/org';
5 5
 
6
-export default (props)=>{
6
+export default (props) => {
7 7
   const { id } = props;
8 8
   const [adminForm] = Form.useForm();
9 9
   const [adminFormData, setAdminFormData] = useState()
@@ -36,49 +36,49 @@ export default (props)=>{
36 36
   }, [id])
37 37
   return (
38 38
     <div style={{ maxWidth: '600px' }}>
39
-            <Form
40
-              form={adminForm}
41
-              labelCol={{ span: 8 }}
42
-              wrapperCol={{ span: 16 }}
43
-              initialValues={adminFormData}
44
-              onFinish={onAdminFinish}
45
-            >
46
-              <Form.Item
47
-                label="姓名"
48
-                name="userName"
49
-                rules={[{ required: true, message: '请填写管理员姓名!' }]}
50
-              >
51
-                <Input />
52
-              </Form.Item>
53
-              <Form.Item
54
-                label="手机号"
55
-                name="phone"
56
-                rules={[{ required: true, message: '请填写手机号!' }]}
57
-              >
58
-                <Input maxLength={11} />
59
-              </Form.Item>
60
-              <Form.Item
61
-                label="登录账号"
62
-                name="loginName"
63
-                rules={[{ required: true, message: '请填写登录账号!' }]}
64
-              >
65
-                <Input />
66
-              </Form.Item>
67
-              <Form.Item
68
-                label="密码"
69
-                name="password"
70
-                rules={[{ required: true, message: '请填写密码!' }]}
71
-              >
72
-                <Input />
73
-              </Form.Item>
74
-              <Form.Item label=' ' colon={false} >
75
-                <Button type="primary" htmlType="submit" loading={adminLoading}>
76
-                  保存
77
-                </Button>
78
-                <Button style={{ marginLeft: '32px' }} onClick={() => { history.go(-1); }}>返回</Button>
79
-              </Form.Item>
80
-            </Form>
81
-          </div>
39
+      <Form
40
+        form={adminForm}
41
+        labelCol={{ span: 8 }}
42
+        wrapperCol={{ span: 16 }}
43
+        initialValues={adminFormData}
44
+        onFinish={onAdminFinish}
45
+      >
46
+        <Form.Item
47
+          label="姓名"
48
+          name="userName"
49
+          rules={[{ required: true, message: '请填写管理员姓名!' }]}
50
+        >
51
+          <Input />
52
+        </Form.Item>
53
+        <Form.Item
54
+          label="手机号"
55
+          name="phone"
56
+          rules={[{ required: true, message: '请填写手机号!' }]}
57
+        >
58
+          <Input maxLength={11} />
59
+        </Form.Item>
60
+        <Form.Item
61
+          label="登录账号"
62
+          name="loginName"
63
+          rules={[{ required: true, message: '请填写登录账号!' }]}
64
+        >
65
+          <Input />
66
+        </Form.Item>
67
+        <Form.Item
68
+          label="密码"
69
+          name="password"
70
+          rules={[{ required: true, message: '请填写密码!' }]}
71
+        >
72
+          <Input />
73
+        </Form.Item>
74
+        <Form.Item label=' ' colon={false} >
75
+          <Button type="primary" htmlType="submit" loading={adminLoading}>
76
+            保存
77
+          </Button>
78
+          <Button style={{ marginLeft: '32px' }} onClick={() => { history.go(-1); }}>返回</Button>
79
+        </Form.Item>
80
+      </Form>
81
+    </div>
82 82
 
83 83
   )
84 84
 }

+ 45
- 45
src/pages/org/org/Edit/components/BasicPage.jsx 查看文件

@@ -19,7 +19,7 @@ export default (props) => {
19 19
       qrcodeRef.current.download();
20 20
     }
21 21
   }, [])
22
-  
22
+
23 23
   const onFinish = (values) => {
24 24
     setLoading(true)
25 25
     if (id) {
@@ -49,50 +49,50 @@ export default (props) => {
49 49
       })
50 50
     }
51 51
   }, [id])
52
-  return(
52
+  return (
53 53
     <div style={{ maxWidth: '600px' }}>
54
-            <Form
55
-              name="basic"
56
-              form={form}
57
-              labelCol={{ span: 8 }}
58
-              wrapperCol={{ span: 16 }}
59
-              initialValues={formData}
60
-              onFinish={onFinish}
61
-              onFinishFailed={onFinishFailed}
62
-              autoComplete="off"
63
-            >
64
-              <Form.Item
65
-                label="企业名称"
66
-                name="orgName"
67
-                rules={[{ required: true, message: '请填写企业名称!' }]}
68
-              >
69
-                <Input  readOnly={formData?.canEditName}/>
70
-              </Form.Item>
71
-              <Form.Item
72
-                label="权重"
73
-                name="weight"
74
-                rules={[{ required: true, message: '请填写企业权重!' }]}
75
-              >
76
-                <Input type='number' min='0' />
77
-              </Form.Item>
78
-              {
79
-                id && <Form.Item label=' ' colon={false} wrapperCol={{ offset: 3 }}>
80
-                  <QRCode ref={qrcodeRef} border width={200} content={qrcodeText} title={formData?.orgName} fileName={formData?.orgName} />
81
-                </Form.Item>
82
-              }
83
-              <Form.Item label=' ' colon={false} >
84
-                <Button type="primary" htmlType="submit" loading={loading}>
85
-                  保存
86
-                </Button>
87
-                {id &&
88
-                  <Button style={{ marginLeft: '32px' }} onClick={downloadQrcode} >
89
-                    下载二维码
90
-                  </Button>
91
-                }
92
-                <Button style={{ marginLeft: '32px' }} onClick={() => { history.go(-1); }} >返回</Button>
93
-              </Form.Item>
94
-            </Form>
95
-          </div>
96
-        
54
+      <Form
55
+        name="basic"
56
+        form={form}
57
+        labelCol={{ span: 8 }}
58
+        wrapperCol={{ span: 16 }}
59
+        initialValues={formData}
60
+        onFinish={onFinish}
61
+        onFinishFailed={onFinishFailed}
62
+        autoComplete="off"
63
+      >
64
+        <Form.Item
65
+          label="企业名称"
66
+          name="orgName"
67
+          rules={[{ required: true, message: '请填写企业名称!' }]}
68
+        >
69
+          <Input readOnly={formData?.canEditName} />
70
+        </Form.Item>
71
+        <Form.Item
72
+          label="权重"
73
+          name="weight"
74
+          rules={[{ required: true, message: '请填写企业权重!' }]}
75
+        >
76
+          <Input type='number' min='0' />
77
+        </Form.Item>
78
+        {
79
+          id && <Form.Item label=' ' colon={false} wrapperCol={{ offset: 3 }}>
80
+            <QRCode ref={qrcodeRef} border width={200} content={qrcodeText} title={formData?.orgName} fileName={formData?.orgName} />
81
+          </Form.Item>
82
+        }
83
+        <Form.Item label=' ' colon={false} >
84
+          <Button type="primary" htmlType="submit" loading={loading}>
85
+            保存
86
+          </Button>
87
+          {id &&
88
+            <Button style={{ marginLeft: '32px' }} onClick={downloadQrcode} >
89
+              下载二维码
90
+            </Button>
91
+          }
92
+          <Button style={{ marginLeft: '32px' }} onClick={() => { history.go(-1); }} >返回</Button>
93
+        </Form.Item>
94
+      </Form>
95
+    </div>
96
+
97 97
   )
98 98
 }