dingxin 5 anni fa
parent
commit
92027cfb76

+ 1
- 1
config/config.js Vedi File

@@ -440,7 +440,7 @@ export default {
440 440
 
441 441
   proxy: {
442 442
     '/api/': {
443
-      target: 'http://127.0.0.1:8080/',
443
+      target: 'http://192.168.0.84:8080/',
444 444
       changeOrigin: true,
445 445
       // pathRewrite: { '^/server': '' },
446 446
     },

+ 1
- 1
src/components/SelectButton/NewTypeSelect.jsx Vedi File

@@ -29,7 +29,7 @@ const NewsTypeSelect = (props) => {
29 29
   }
30 30
 
31 31
   return (
32
-      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择咨询类型" onChange={props.onChange}>
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择类型" onChange={props.onChange}>
33 33
           {data.map(type => (
34 34
             <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35 35
           ))}

+ 135
- 143
src/pages/news/list/NewsList.jsx Vedi File

@@ -63,7 +63,7 @@ function body(props) {
63 63
   }
64 64
 
65 65
   // 跳转到编辑资讯列表
66
-  const toEditList = (id) => ()  => {
66
+  const toEditList = (id) => () => {
67 67
     router.push({
68 68
       pathname: '/news/list/editNewsList',
69 69
       query: {
@@ -74,153 +74,145 @@ function body(props) {
74 74
 
75 75
 
76 76
 
77
-/**
78
- *卡片
79
- *
80
- * @returns
81
- */
82
-function CartBody(props) {
83
-  const { data } = props
84
-  console.log(data);
85
-  const cancelPage = () =>{
86
-    router.push({
87
-      pathname: '/news/list/NewsList',
88
-    });
89
-  }
90
-
91
-  //删除资讯
92
-  const changeNewsListStatus = (newsId) => () => {
93
-    Modal.confirm({
94
-      title: '确认删除该资讯?',
95
-      okText: '确认',
96
-      cancelText: '取消',
97
-      onOk() {
98
-        request({
99
-          url: '/api/admin/taNews/' + newsId,
100
-          method: 'DELETE',
101
-          // data: { ...row },
102
-        }).then((data) => {
103
-          message.info('操作成功!')
104
-          getList({ pageNum: 1, pageSize: 10 });
105
-        })
106
-      }
107
-    });
108
-  }
109
-
110
-  // 跳转到编辑资讯列表
111
-  const toEditList = (newsId) => ()  => {
112
-    router.push({
113
-      pathname: '/news/list/editNewsList',
114
-      query: {
115
-        newsId
116
-      },
117
-    });
118
-  } 
77
+  /**
78
+   *卡片
79
+   *
80
+   * @returns
81
+   */
82
+  function CartBody(props) {
83
+    const { data } = props
84
+    console.log(data);
85
+    const cancelPage = () => {
86
+      router.push({
87
+        pathname: '/news/list/NewsList',
88
+      });
89
+    }
119 90
 
120
-  function cancelRelease (newsId, newsStatus, buildingId,newsTypeId) {
121
-    console.log("newsId" + newsId + "status" + newsStatus);
122
-    if (newsStatus === 1){
91
+    //删除资讯
92
+    const changeNewsListStatus = (newsId) => () => {
123 93
       Modal.confirm({
124
-        title: '确认取消该资讯?',
94
+        title: '确认删除该资讯?',
125 95
         okText: '确认',
126 96
         cancelText: '取消',
127
-        onOk () {
97
+        onOk() {
128 98
           request({
129 99
             url: '/api/admin/taNews/' + newsId,
130
-            method: 'PUT',
131
-            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
100
+            method: 'DELETE',
101
+            // data: { ...row },
132 102
           }).then((data) => {
133 103
             message.info('操作成功!')
134 104
             getList({ pageNum: 1, pageSize: 10 });
135 105
           })
136
-        },
137
-        onCancel () {
138
-          console.log('Cancel');
139
-        },
106
+        }
140 107
       });
141
-    }else if (newsStatus === 0){
142
-      Modal.confirm({
143
-        title: '确认发布该资讯?',
144
-        okText: '确认',
145
-        cancelText: '取消',
146
-        onOk () {
147
-          request({
148
-            url: '/api/admin/taNews/' + newsId,
149
-            method: 'PUT',
150
-            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
151
-          }).then((data) => {
152
-            message.info('操作成功!')
153
-            getList({ pageNum: 1, pageSize: 10 });
154
-          })
155
-        },
156
-        onCancel () {
157
-          console.log('Cancel');
108
+    }
109
+
110
+    // 跳转到编辑资讯列表
111
+    const toEditList = (newsId) => () => {
112
+      router.push({
113
+        pathname: '/news/list/editNewsList',
114
+        query: {
115
+          newsId
158 116
         },
159 117
       });
160
-    }  
161
-  }
118
+    }
162 119
 
163
-  return (
164
-          <Card
165
-            hoverable
166
-            style={{ minWidth: '400px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
167
-            cover={<img alt="example" src={ data.newsImg } style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
168
-            bodyStyle={{ padding: '10px 20px' }}
169
-          >
170
-            <p className={Styles.cardText}>
171
-              <span className={Styles.title}>资讯类型</span>
172
-              <span >:{ data.newsType.newsTypeName }</span>
173
-              <span className={Styles.ediText} onClick={toEditList(data.newsId)}>
174
-                编辑
120
+    function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
121
+      console.log("newsId" + newsId + "status" + newsStatus);
122
+      if (newsStatus === 1) {
123
+        Modal.confirm({
124
+          title: '确认取消该资讯?',
125
+          okText: '确认',
126
+          cancelText: '取消',
127
+          onOk() {
128
+            request({
129
+              url: '/api/admin/taNews/' + newsId,
130
+              method: 'PUT',
131
+              data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId },
132
+            }).then((data) => {
133
+              message.info('操作成功!')
134
+              getList({ pageNum: 1, pageSize: 10 });
135
+            })
136
+          },
137
+          onCancel() {
138
+            console.log('Cancel');
139
+          },
140
+        });
141
+      } else if (newsStatus === 0) {
142
+        Modal.confirm({
143
+          title: '确认发布该资讯?',
144
+          okText: '确认',
145
+          cancelText: '取消',
146
+          onOk() {
147
+            request({
148
+              url: '/api/admin/taNews/' + newsId,
149
+              method: 'PUT',
150
+              data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId },
151
+            }).then((data) => {
152
+              message.info('操作成功!')
153
+              getList({ pageNum: 1, pageSize: 10 });
154
+            })
155
+          },
156
+          onCancel() {
157
+            console.log('Cancel');
158
+          },
159
+        });
160
+      }
161
+    }
162
+
163
+    return (
164
+      <Card
165
+        hoverable
166
+        style={{ height: '255px', minWidth: '640px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', position: 'relative' }}
167
+        cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '260px', height: '253px' }}></img>}
168
+        bodyStyle={{ padding: '10px 20px' }}
169
+      >
170
+        <span style={{ position: 'absolute', right: '20px', top: '20px', fontSize: '18px', color: '#FF7E48' }} onClick={toEditList(data.newsId)}>
171
+          编辑
175 172
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
176
-              </span>
177
-            </p>
178
-            <p className={Styles.cardText}>
179
-              <span className={Styles.title}>状态</span>
180
-              <span >:{ data.newsStatus == 0 ? "已发布" : "未发布" }</span>
181
-            </p>
182
-            <p className={Styles.cardItem}>
183
-              <span className={Styles.title}>阅读数量</span>
184
-              <span > :{ data.pvNum }</span>
185
-            </p>
186
-            <p className={Styles.cardItem}>
187
-              <span className={Styles.title}>转发数量</span>
188
-              <span>:{ data.shareNum }</span>
189
-            </p>
190
-            <p className={Styles.cardItem}>
191
-              <span className={Styles.title}>点赞数量</span>     
192
-              <span >:{ data.favorNum }</span>         
193
-            </p>
194
-            <p className={Styles.cardItem}>
195
-              <span className={Styles.title}>收藏数量</span>
196
-              <span >:{ data.saveNum }</span>
197
-            </p>
198
-            <p className={Styles.cardItem}>
199
-              <span className={Styles.title}>录入时间</span>
200
-              <span >:{ data.createDate }</span>
201
-            </p>
202
-            <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
203
-              {data.newsStatus === 0 ? 
204
-              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
205
-              取消发布
173
+        </span>
174
+        {data.newsStatus === 0 ?
175
+          <span style={{ position: 'absolute', left: '280px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={cancelRelease.bind(this, data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
176
+            取消发布
206 177
               <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
207
-              </span>:
208
-              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
209
-              发布
178
+          </span> :
179
+          <span style={{ position: 'absolute', left: '280px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={cancelRelease.bind(this, data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
180
+            发布
210 181
               <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
211
-              </span>
212
-              }
213
-              
214
-              <span style={{
215
-                color: '#FF4A4A', position: 'absolute', right: '0',
216
-              }} onClick={changeNewsListStatus(data.newsId)}>
217
-                删除
182
+          </span>
183
+        }
184
+
185
+        <span style={{ position: 'absolute', right: '20px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={changeNewsListStatus(data.newsId)}>
186
+          删除
218 187
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
219
-              </span>
220
-            </p>
221
-          </Card>
222
-  )
223
-}
188
+        </span>
189
+        <div style={{ position: 'absolute', left: '260px', top: '0px', padding: '20px' }}>
190
+          <p style={{
191
+            fontSize: '18px', color: '#333', fontWeight: '600', marginBottom: '10px', overflow: 'hidden',
192
+            textOverflow: 'ellipsis',
193
+            whiteSpace: 'nowrap',
194
+            width: '300px',
195
+          }}>{data.newsName}</p>
196
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
197
+            <span style={{ display: 'inline-block', width: '190px' }}>咨询类型:{data.newsType.newsTypeName}</span>
198
+            <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
199
+          </p>
200
+
201
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
202
+            <span style={{ display: 'inline-block', width: '190px' }}>阅读数量:{data.pvNum}</span>
203
+            <span>转发数量:{data.shareNum}</span>
204
+          </p>
205
+
206
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
207
+            <span style={{ display: 'inline-block', width: '190px' }}>点赞数量:{data.favorNum}</span>
208
+            <span>收藏数量:{data.saveNum}</span>
209
+          </p>
210
+
211
+          <p style={{ fontSize: '18px', color: '#999', marginBottom: '10px' }}>发布时间:{data.createDate}</p>
212
+        </div>
213
+      </Card>
214
+    )
215
+  }
224 216
 
225 217
 
226 218
   // Change 事件
@@ -232,7 +224,7 @@ function CartBody(props) {
232 224
   // 分页
233 225
   function onChange(pageNumber) {
234 226
     // eslint-disable-next-line react-hooks/rules-of-hooks
235
-      getList({ pageNum: pageNumber, pageSize: 6 })
227
+    getList({ pageNum: pageNumber, pageSize: 6 })
236 228
   }
237 229
 
238 230
   function getDate(value, dateString) {
@@ -246,27 +238,27 @@ function CartBody(props) {
246 238
 
247 239
         <Form.Item>
248 240
           {getFieldDecorator('cityId')(
249
-            <SelectCity />,  
241
+            <SelectCity />,
250 242
           )}
251 243
         </Form.Item>
252 244
         <Form.Item>
253 245
           {getFieldDecorator('buildingId')(
254
-              <BuildSelect />,
255
-            )}
246
+            <BuildSelect />,
247
+          )}
256 248
         </Form.Item>
257
-        <Form.Item>
249
+        {/* <Form.Item>
258 250
           {getFieldDecorator('title')(
259 251
             <Input
260 252
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
261 253
               placeholder="请输入标题"
262 254
             />,
263 255
           )}
264
-        </Form.Item>
256
+        </Form.Item> */}
265 257
         <Form.Item>
266 258
           {getFieldDecorator('newsTypeId')(
267 259
             <NewsTypeSelect />,
268 260
           )}
269
-        </Form.Item>       
261
+        </Form.Item>
270 262
         <Form.Item>
271 263
           {getFieldDecorator('newsStatus')(
272 264
             <Select style={{ width: '180px' }} placeholder="状态">
@@ -276,12 +268,12 @@ function CartBody(props) {
276 268
           )}
277 269
         </Form.Item>
278 270
         <Form.Item>
279
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
271
+          <Button type="primary" htmlType="submit" >
280 272
             搜索
281 273
           </Button>
282 274
         </Form.Item>
283 275
       </Form>
284
-      <Button type="primary" className={Styles.addButton} onClick={toEditList()}>
276
+      <Button type="danger" style={{ padding: '0 40px', margin: '20px 0' }} onClick={toEditList()}>
285 277
         新增
286 278
       </Button>
287 279
 
@@ -289,10 +281,10 @@ function CartBody(props) {
289 281
       <Row style={{ padding: ' 0 10px' }}>
290 282
         {
291 283
           dataSource.records.map((item, index) => (
292
-              <Col span={8}>
293
-                <CartBody data={item} key={item.buildingId}/>
294
-              </Col>
295
-            ))
284
+            <Col span={12}>
285
+              <CartBody data={item} key={item.buildingId} />
286
+            </Col>
287
+          ))
296 288
         }
297 289
       </Row>
298 290
       {/* 分页 */}

+ 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