周立森 5 anni fa
parent
commit
203373893d
2 ha cambiato i file con 234 aggiunte e 11 eliminazioni
  1. 226
    10
      src/pages/staff/list/editRole.jsx
  2. 8
    1
      src/pages/staff/list/editStaff.jsx

+ 226
- 10
src/pages/staff/list/editRole.jsx Vedi File

@@ -1,8 +1,15 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Select } from 'antd';
1
+import React, { useState } from 'react';
2
+
3
+import { Checkbox, Row, Col, Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, DatePicker, Select, Form, Alert, Card } from 'antd';
3 4
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 5
 import styles from '../../style/GoodsList.less';
6
+import XForm, { FieldTypes } from '../../../components/XForm';
7
+import Wangedit from '../../../components/Wangedit/Wangedit'
8
+import channels from './channelList.less';
9
+
10
+import Tagss from '../components/Tagss.jsx';
5 11
 
12
+const { TextArea } = Input;
6 13
 
7 14
 
8 15
 /**
@@ -11,17 +18,226 @@ import styles from '../../style/GoodsList.less';
11 18
  * @param {*} props
12 19
  * @returns
13 20
  */
21
+const Edit = (props) => {
22
+
23
+
24
+
25
+  // const [tab, changeTab] = useState('basic')
26
+
27
+  const Permission = [
28
+    '项目管理',
29
+    '员工管理',
30
+    '客户管理',
31
+    '系统管理',
32
+    '渠道管理',
33
+    '轮播图管理',
34
+    '资讯管理',
35
+    '活动管理',
36
+    '积分商城',
37
+    '首页数据',
38
+  ]
39
+
40
+  // const Basic = (props) => {
41
+
42
+  //   const dataSource = [
43
+
44
+
45
+  //     {
46
+  //       name: '员工管理',
47
+  //       per: [
48
+  //         '111111',
49
+  //         '22222',
50
+  //         '33333',
51
+  //       ]
52
+  //     },
53
+  //     {
54
+  //       name: '角色管理',
55
+  //       per: [
56
+  //         '444',
57
+  //         '555',
58
+  //         '666',
59
+  //       ]
60
+  //     },
61
+  //   ];
62
+
63
+  //   const columns = [
64
+  //     // {
65
+  //     //   title: '商品图片',
66
+  //     //   dataIndex: 'img',
67
+  //     //   key: 'img',
68
+  //     //   align: 'center',
69
+
70
+  //     //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
71
+  //     // },
72
+  //     {
73
+  //       title: '员工管理',
74
+  //       dataIndex: 'name',
75
+  //       key: 'name',
76
+  //       align: 'left',
77
+  //       render: text => <a>{text}</a>,
78
+  //     },
79
+
80
+  //     {
81
+  //       // title: '操作  ',
82
+  //       dataIndex: 'status',
83
+  //       key: 'per',
84
+  //       align: 'left',
85
+  //       render: () => <>
86
+  //         {/* {pre.map((item,index)=>(
87
+  //       <Checkbox>{item[index]}</Checkbox>
88
+
89
+
90
+  //               ))} */}
91
+  //       </>,
92
+  //     },
93
+  //   ];
94
+  //   return <Table dataSource={dataSource} columns={columns} />
95
+
96
+
97
+
98
+
99
+  // }
100
+  // const [Card] = useState('Poster')
101
+
102
+  const Poster = (props) => {
103
+
104
+    const dataSource = [
105
+
106
+
107
+      {
108
+        name: '员工管理',
109
+        per: [
110
+          '111111',
111
+          '22222',
112
+          '33333',
113
+        ]
114
+      },
115
+      {
116
+        name: '角色管理',
117
+        per: [
118
+          '444',
119
+          '555',
120
+          '666',
121
+        ]
122
+      },
123
+    ];
124
+
125
+
126
+    const gridStyle1 = {
127
+      width: '20%',
128
+      textAlign: 'left',
129
+    };
130
+    const gridStyle2 = {
131
+      width: '80%',
132
+      textAlign: 'left',
133
+    };
14 134
 
135
+{/* <Checkbox>{Permission[index]}</Checkbox> */}
136
+    return <>
137
+      <div style={{}}>
15 138
 
16
-function header(props) {
17
-  const { getFieldDecorator } = props.form
18
-  return (
139
+        {Permission.map((item, index) => (
19 140
 
20
-    <>
21
-     <div>编辑角色</div>
141
+
142
+          <Card title={<Checkbox>{Permission[index]}</Checkbox>} bordered={true} style={{ width: '100%' }}>
143
+            
144
+              {dataSource.map((items, indexs) => (
145
+              <>
146
+                <Card.Grid style={gridStyle1}><Checkbox>{items.name}</Checkbox></Card.Grid>
147
+                
148
+                <Card.Grid style={gridStyle2}>
149
+                {items.per.map((itemss,indexss) =>(
150
+                  <Checkbox>{items.per[indexss]}</Checkbox>
151
+                ))}
152
+                </Card.Grid>
153
+                </>
154
+            ))}
155
+            
156
+          </Card>
157
+
158
+
159
+
160
+        ))}
161
+      </div>
22 162
     </>
23
-  )
163
+  }
164
+
165
+  const Share = (props) => {
166
+    return <div>Share</div>
167
+  }
168
+
169
+
170
+
171
+
172
+  const fields = [
173
+    {
174
+      label: '角色名称',
175
+      name: 'roleName',
176
+      type: FieldTypes.Text,
177
+      // placeholder: '名称',
178
+      value: ''
179
+    },
180
+
181
+
182
+
183
+    {
184
+      label: '简介',
185
+      name: 'roleIntroduction',
186
+      render: <TextArea className={channels.inpuitTxt} ></TextArea>,
187
+      value: ''
188
+
189
+    },
190
+
191
+    {
192
+      label: '菜单权限',
193
+      name: 'rolePermission',
194
+      render:
195
+        <>
196
+          <div>
197
+
198
+            <Poster />
199
+
200
+            {/* <Radio.Group value={tab} defaultValue="1" buttonStyle="solid">
201
+             
202
+        <Checkbox>Checkbox</Checkbox>
203
+                {Permission.map((item,index)=>(
204
+                  <Radio.Button style={BottonStyle} value="{index}">{Permission[index]}</Radio.Button>
205
+                 
206
+                ))}
207
+            </Radio.Group>
208
+          
209
+          </div>
210
+          <div>
211
+             
212
+          <Table dataSource={Permission[index]} columns={columns} />
213
+           
214
+             */}
215
+          </div>
216
+        </>,
217
+
218
+    }
219
+    // {
220
+    //   label: '状态',
221
+    //   name: 'roleState',
222
+    //   render: <Radio.Group>
223
+    //     <Radio.Button style={{background:'#f0f0f0'}} value="a">禁用</Radio.Button>
224
+    //     <Radio.Button style={{background:'#f0f0f0',color:'#ff7e48'}} value="b">启用</Radio.Button>
225
+    //   </Radio.Group>,
226
+    //   value: 'b'
227
+    // },
228
+
229
+  ]
230
+
231
+  const handleSubmit = val => {
232
+    window.console.log('submit data --->', val)
233
+  }
234
+  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
235
+
236
+
237
+
238
+
24 239
 }
25
-const WrappedHeader = Form.create({ name: 'header' })(header);
26 240
 
27
-export default WrappedHeader
241
+
242
+
243
+export default Edit

+ 8
- 1
src/pages/staff/list/editStaff.jsx Vedi File

@@ -21,6 +21,13 @@ const { TextArea } = Input;
21 21
 const Edit = (props) => {
22 22
 
23 23
   const fields = [
24
+    {
25
+      label: '名称',
26
+      name: 'staffName',
27
+      type: FieldTypes.Text,
28
+      // placeholder: '名称',
29
+      value: ''
30
+    },
24 31
     {
25 32
       label: '公司',
26 33
       name: 'staffCompany',
@@ -114,7 +121,7 @@ const Edit = (props) => {
114 121
   const handleSubmit = val => {
115 122
     window.console.log('submit data --->', val)
116 123
   }
117
-  return <XForm onSubmit={handleSubmit} fields={fields} offset={8}></XForm>
124
+  return <XForm onSubmit={handleSubmit} fields={fields} push={8}></XForm>
118 125
 
119 126
 
120 127