dingxin 5 年 前
コミット
a554f73db2

+ 1
- 1
config/config.js ファイルの表示

479
 
479
 
480
   proxy: {
480
   proxy: {
481
     '/api/': {
481
     '/api/': {
482
-      target: 'http://192.168.0.11:8080/',
482
+      target: 'http://192.168.0.84:8080/',
483
       changeOrigin: true,
483
       changeOrigin: true,
484
       // pathRewrite: { '^/server': '' },
484
       // pathRewrite: { '^/server': '' },
485
     },
485
     },

+ 1
- 0
package.json ファイルの表示

55
     "path-to-regexp": "^3.0.0",
55
     "path-to-regexp": "^3.0.0",
56
     "qs": "^6.7.0",
56
     "qs": "^6.7.0",
57
     "react": "^16.8.6",
57
     "react": "^16.8.6",
58
+    "react-amap": "^1.2.8",
58
     "react-copy-to-clipboard": "^5.0.1",
59
     "react-copy-to-clipboard": "^5.0.1",
59
     "react-document-title": "^2.0.3",
60
     "react-document-title": "^2.0.3",
60
     "react-dom": "^16.8.6",
61
     "react-dom": "^16.8.6",

+ 18
- 0
src/app.js ファイルの表示

1
+// (function (doc, win) {
2
+//   var docEl = doc.documentElement,
3
+//     resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize',
4
+//     recalc = function () {
5
+//       var clientWidth = docEl.clientWidth;
6
+//       if (!clientWidth) return;
7
+//       if (clientWidth >= 750) {
8
+//         docEl.style.fontSize = '100px';
9
+//       } else {
10
+//         docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
11
+//       }
12
+//     };
13
+
14
+//   if (!doc.addEventListener) return;
15
+//   win.addEventListener(resizeEvt, recalc, false);
16
+//   doc.addEventListener('DOMContentLoaded', recalc, false);
17
+// })(document, window);
18
+
1
 export const dva = {
19
 export const dva = {
2
   config: {
20
   config: {
3
     onError(e) {
21
     onError(e) {

+ 15
- 2
src/components/SelectButton/BuildSelect.jsx ファイルの表示

1
-import React, { useState, useEffect } from 'react';
1
+import React, { useState, useEffect, useRef } from 'react';
2
 import { Select } from 'antd';
2
 import { Select } from 'antd';
3
 
3
 
4
 import request from '../../utils/request'
4
 import request from '../../utils/request'
5
 
5
 
6
 const { Option } = Select;
6
 const { Option } = Select;
7
 
7
 
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
8
 /**
16
 /**
9
  *
17
  *
10
  *
18
  *
13
  */
21
  */
14
 const BuildingSelect = (props) => {
22
 const BuildingSelect = (props) => {
15
   const [ data, setData ] = useState([])
23
   const [ data, setData ] = useState([])
16
-  const [ value, setValue ] = useState(props.value)
24
+  const [ value, setValue ] = useState('')
25
+  const preProps = usePrevious(props)
26
+  
27
+  if ((!preProps || !preProps.value) && props.value && !value) {
28
+    setValue(props.value)
29
+  }
17
 
30
 
18
   useEffect(() => {
31
   useEffect(() => {
19
     getCityList();
32
     getCityList();

+ 4
- 1
src/global.less ファイルの表示

79
 .ant-menu-vertical-left .ant-menu-submenu-title,
79
 .ant-menu-vertical-left .ant-menu-submenu-title,
80
 .ant-menu-vertical-right .ant-menu-submenu-title,
80
 .ant-menu-vertical-right .ant-menu-submenu-title,
81
 .ant-menu-inline .ant-menu-submenu-title,
81
 .ant-menu-inline .ant-menu-submenu-title,
82
-.ant-input ,.ant-btn{
82
+.ant-input ,.ant-btn,.ant-select,.ant-table,.ant-form-item,.ant-form label,.ant-tabs-nav-container {
83
   font-size: 16px;
83
   font-size: 16px;
84
 }
84
 }
85
+.ant-row.ant-form-item .ant-form-item-label.ant-col-sm-3{
86
+  min-width: 100px;
87
+}
85
 .ant-breadcrumb{
88
 .ant-breadcrumb{
86
   font-size: 16px;
89
   font-size: 16px;
87
   .anticon {
90
   .anticon {

+ 1
- 1
src/models/login.js ファイルの表示

50
     *logout(_, { put, call }) {
50
     *logout(_, { put, call }) {
51
       const { redirect } = getPageQuery(); // redirect
51
       const { redirect } = getPageQuery(); // redirect
52
 
52
 
53
-      yield call(signout, { logout: true });
53
+      yield call(signout);
54
 
54
 
55
       if (window.location.pathname !== '/user/login' && !redirect) {
55
       if (window.location.pathname !== '/user/login' && !redirect) {
56
         yield put(
56
         yield put(

+ 1
- 1
src/pages/activity/editActivity.jsx ファイルの表示

245
               textOverflow: 'ellipsis'
245
               textOverflow: 'ellipsis'
246
             }}>{inputValue ? inputValue : '海报标题'}</p>
246
             }}>{inputValue ? inputValue : '海报标题'}</p>
247
 
247
 
248
-            <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
248
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
249
             <p style={{
249
             <p style={{
250
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
250
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
251
               display: '-webkit-box', lineClamp: '3', height: '76px',
251
               display: '-webkit-box', lineClamp: '3', height: '76px',

+ 20
- 0
src/pages/building/list/add/components/amap.jsx ファイルの表示

1
+import React from 'react';
2
+import ReactDOM from 'react-dom';
3
+import { Map } from 'react-amap';
4
+
5
+class Amap extends React.Component {
6
+  constructor(props) {
7
+    super(props)
8
+    this.state = { coordinates: [] }
9
+  }
10
+
11
+  render() {
12
+    return (
13
+      <div style={{ width: '100%', height: '400px' }}>
14
+        <Map amapkey="f0d1d4f82432504003ebf46e5e36ff03"/>
15
+      </div>
16
+    )
17
+  }
18
+}
19
+
20
+export default Amap

+ 4
- 2
src/pages/building/list/add/components/base.jsx ファイルの表示

9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
11
 import TagGroup from './tags'
11
 import TagGroup from './tags'
12
+import Amap from './amap'
12
 import BudildingProjectType from './buildingProjectType'
13
 import BudildingProjectType from './buildingProjectType'
13
 
14
 
14
 const { Option } = Select
15
 const { Option } = Select
79
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
80
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
80
     request({ ...api, data: { ...data } }).then(() => {
81
     request({ ...api, data: { ...data } }).then(() => {
81
       openNotificationWithIcon('success', '操作成功')
82
       openNotificationWithIcon('success', '操作成功')
83
+      router.go(-1)
82
     }).catch(err => {
84
     }).catch(err => {
83
       openNotificationWithIcon('error', err.message)
85
       openNotificationWithIcon('error', err.message)
84
     })
86
     })
104
           <Form.Item label="均价" hasFeedback>
106
           <Form.Item label="均价" hasFeedback>
105
             {getFieldDecorator('price')(<Input />)}
107
             {getFieldDecorator('price')(<Input />)}
106
           </Form.Item>
108
           </Form.Item>
107
-          <Form.Item label="开盘时间" hasFeedback>
109
+          <Form.Item label="开盘时间"  hasFeedback>
108
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
110
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
109
           </Form.Item>
111
           </Form.Item>
110
           <Form.Item label="电话" hasFeedback>
112
           <Form.Item label="电话" hasFeedback>
176
             {getFieldDecorator('coordinate')(<Input disabled />)}
178
             {getFieldDecorator('coordinate')(<Input disabled />)}
177
           </Form.Item>
179
           </Form.Item>
178
           <Form.Item label="地图位置" hasFeedback>
180
           <Form.Item label="地图位置" hasFeedback>
179
-            {(<Input />)}
181
+            {(<Amap />)}
180
           </Form.Item>
182
           </Form.Item>
181
           <Form.Item label="周边交通" hasFeedback>
183
           <Form.Item label="周边交通" hasFeedback>
182
             {getFieldDecorator('buildingTransport')(
184
             {getFieldDecorator('buildingTransport')(

+ 57
- 74
src/pages/building/list/add/components/buildingProjectType.jsx ファイルの表示

51
 
51
 
52
     return (
52
     return (
53
       <>
53
       <>
54
-        <div>
55
-          <Row>
56
-            <Col span={8}>{ this.props.type.buildingTypeName || ''}</Col>
57
-            <Col span={1}>
58
-              <Button type="link" icon="close" onClick={() => this.close()} />
59
-            </Col>
60
-          </Row>
61
-          <Row>
62
-            <Col span={12}>
63
-              <Form {...formItemLayout}>
64
-                <Form.Item label="类型编号" style={{ display: 'none' }}>
65
-                  {getFieldDecorator('buildingTypeId')(<Input disabled />)}
66
-                </Form.Item>
67
-                <Form.Item label="状态" style={{ display: 'none' }}>
68
-                  {getFieldDecorator('status')(<Input disabled />)}
69
-                </Form.Item>
70
-                <Form.Item label="价格">
71
-                  {getFieldDecorator('price')(<Input type="number" placeholder="元/㎡" onChange={e => this.onChange(e, 'price')}/>)}
72
-                </Form.Item>
73
-                <Form.Item label="装修标准">
74
-                  {getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')}/>)}
75
-                </Form.Item>
76
-                <Form.Item label="产权年限">
77
-                  {getFieldDecorator('rightsYear')(<Input onChange={e => this.onChange(e, 'rightsYear')}/>)}
78
-                </Form.Item>
79
-              </Form>
80
-            </Col>
81
-          </Row>
82
-        </div>
54
+        <Col span={11} style={{
55
+          position: 'relative',
56
+          border: '1px solid #eee',
57
+          borderRadius: '4px',
58
+          marginTop:'16px'
59
+        }}>
60
+
61
+          <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
62
+
63
+          <Form {...formItemLayout} style={{ padding: '10px 0px 10px 10px' }}>
64
+            <Form.Item label="类型编号" style={{ display: 'none' }}>
65
+              {getFieldDecorator('buildingTypeId')(<Input disabled />)}
66
+            </Form.Item>
67
+            <Form.Item label="状态" style={{ display: 'none' }}>
68
+              {getFieldDecorator('status')(<Input disabled />)}
69
+            </Form.Item>
70
+            <Form.Item label="价格">
71
+              {getFieldDecorator('price')(<Input type="number" placeholder="元/㎡" onChange={e => this.onChange(e, 'price')} />)}
72
+            </Form.Item>
73
+            <Form.Item label="装修标准">
74
+              {getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')} />)}
75
+            </Form.Item>
76
+            <Form.Item label="产权年限">
77
+              {getFieldDecorator('rightsYear')(<Input onChange={e => this.onChange(e, 'rightsYear')} />)}
78
+            </Form.Item>
79
+          </Form>
80
+        </Col>
83
       </>
81
       </>
84
     )
82
     )
85
   }
83
   }
119
   }
117
   }
120
 
118
 
121
   onSuccess = (values, item) => {
119
   onSuccess = (values, item) => {
122
-    console.log('values: ', values)
123
-    console.log('data: ', this.state.data, 'item: ', item)
124
     const newData = this.getNewProjectType(values)
120
     const newData = this.getNewProjectType(values)
125
-    console.log('newData: ', newData)
126
     this.setState({ data: newData })
121
     this.setState({ data: newData })
127
     if (typeof this.props.onChange === 'function') {
122
     if (typeof this.props.onChange === 'function') {
128
       this.props.onChange(newData)
123
       this.props.onChange(newData)
130
   }
125
   }
131
 
126
 
132
   onCheckboxChange = checkedValues => {
127
   onCheckboxChange = checkedValues => {
133
-      const checked = (`${checkedValues}` || '').split(',')
134
-      const { projectType } = this.state
135
-      const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
128
+    // console.log('checkedValues: ', checkedValues)
129
+    const checked = (`${checkedValues}` || '').split(',')
130
+    const { projectType } = this.state
131
+    const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
136
 
132
 
137
-      // 这里会把值替换掉
138
-
139
-      const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, price: '', decoration: '', rightsYear: '', status: '1' }))
140
-      const updateProjectDate = this.updateProjectType(checkedValues)
141
-      console.log('updateProjectDate: ', updateProjectDate)
142
-      this.setState({ data: updateProjectDate })
133
+    const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, price: '', decoration: '', rightsYear: '', status: '1' }))
134
+    const updateProjectDate = this.updateProjectType(tempDate)
135
+    console.log('updateProjectDate: ', updateProjectDate)
136
+    this.setState({ data: updateProjectDate })
143
   }
137
   }
144
 
138
 
145
   onClose = e => {
139
   onClose = e => {
146
     const { data } = this.state
140
     const { data } = this.state
147
     const buildingType = data.filter(item => e.buildingTypeId !== item.buildingTypeId)
141
     const buildingType = data.filter(item => e.buildingTypeId !== item.buildingTypeId)
148
-    console.log('buildingType: ', buildingType)
149
     this.setState({ data: buildingType })
142
     this.setState({ data: buildingType })
150
     this.setState({ defaultCheckboxValue: buildingType.map(item => item.buildingTypeId) })
143
     this.setState({ defaultCheckboxValue: buildingType.map(item => item.buildingTypeId) })
151
   }
144
   }
153
   getNewProjectType = values => {
146
   getNewProjectType = values => {
154
     const data = []
147
     const data = []
155
     this.state.data.map(item => {
148
     this.state.data.map(item => {
156
-      console.log('item: ', item)
157
       if (item.buildingTypeId === values.buildingTypeId) {
149
       if (item.buildingTypeId === values.buildingTypeId) {
158
         data.push(values)
150
         data.push(values)
159
       } else {
151
       } else {
165
   }
157
   }
166
 
158
 
167
   updateProjectType = values => {
159
   updateProjectType = values => {
168
-    const data = []
169
-    this.state.data.map(item => {
170
-      values.map(va => {
171
-        if (item.buildingTypeId === va.buildingTypeId) {
172
-          data.push(va)
173
-        } else {
174
-          data.push(item)
175
-        }
176
-      })
177
-    })
160
+    // 获取所有复选框选中的id
161
+    const valueIdArray = values.map(item => item.buildingTypeId)
162
+    // console.log('valueIdArray: ', valueIdArray)
178
 
163
 
179
-    return data
164
+    // 获取 data 中已经赋值的数据  交集
165
+    const valueData = this.state.data.filter(item => valueIdArray.includes(item.buildingTypeId))
166
+    // console.log('valueData: ', valueData)
167
+
168
+    // 获取 非 data中数据(也就是没有赋值),交集
169
+    const trueValueArr = valueData.map(item => item.buildingTypeId)
170
+    const trueValueData = values.filter(item => !trueValueArr.includes(item.buildingTypeId))
171
+
172
+    // console.log('trueValueData: ', trueValueData)
173
+
174
+    // 把两个 数组的值,合并返回
175
+    return valueData.concat(trueValueData)
180
   }
176
   }
181
 
177
 
182
   getList = params => {
178
   getList = params => {
196
       tempData = value
192
       tempData = value
197
       tempCheckboxValue = tempData.map(item => item.buildingTypeId)
193
       tempCheckboxValue = tempData.map(item => item.buildingTypeId)
198
       this.setState({ defaultCheckboxValue: tempCheckboxValue })
194
       this.setState({ defaultCheckboxValue: tempCheckboxValue })
199
-      this.setState({ data: tempData }, () => {
200
-        console.log("state: ", this.state.data)
201
-      })
202
-
203
-      console.log("tempData: ", tempData, "tempCheckboxValue: ", tempCheckboxValue, "value: ", value)
195
+      this.setState({ data: tempData })
204
     }
196
     }
205
   }
197
   }
206
 
198
 
228
     this.getList({ pageNum: 1, pageSize: 999 })
220
     this.getList({ pageNum: 1, pageSize: 999 })
229
   }
221
   }
230
 
222
 
231
-  render () {
232
-
233
-    // let tempData = []
234
-    // let tempCheckboxValue = []
235
-    // const { value } = this.props
236
-    // if (value !== undefined && value !== null) {
237
-    //   tempData = value
238
-    // } else {
239
-    //   tempData = this.state.data
240
-    // }
241
-
242
-    // tempCheckboxValue = tempData.map(item => item.buildingTypeId)
223
+  render() {
243
     return (
224
     return (
244
       <>
225
       <>
245
         <Button type="primary" icon="plus" size="large" onClick={() => this.showMadel()} />
226
         <Button type="primary" icon="plus" size="large" onClick={() => this.showMadel()} />
251
         >
232
         >
252
           <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
233
           <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
253
         </Modal>
234
         </Modal>
254
-        {
255
-          this.state.data.map(item => <WrappedTypeForm type={item} key={item.id} onSuccess={(e) => this.onSuccess(e, item)} onClose={(e) => this.onClose(e)} />)
256
-        }
235
+        <Row type="flex" justify="space-between">
236
+          {
237
+            this.state.data.map(item => <WrappedTypeForm type={item} key={item.id} onSuccess={(e) => this.onSuccess(e, item)} onClose={(e) => this.onClose(e)} />)
238
+          }
239
+        </Row>
257
       </>
240
       </>
258
     )
241
     )
259
   }
242
   }

+ 10
- 1
src/pages/building/list/add/components/imageSet.jsx ファイルの表示

61
     })
61
     })
62
   }
62
   }
63
 
63
 
64
+  /**
65
+   *回调事件
66
+   *
67
+   */
68
+  function onModalChange() {
69
+    getList()
70
+    setVisibleData({ visible: false, apartmentId: '', buildingId: '' })
71
+  }
72
+
64
   /**
73
   /**
65
    *打开编辑页
74
    *打开编辑页
66
    *
75
    *
138
 
147
 
139
       {/* 编辑页 */}
148
       {/* 编辑页 */}
140
       {/*  onSuccess是子组件传递事件信息  */}
149
       {/*  onSuccess是子组件传递事件信息  */}
141
-      <ModalImage visibleData={visibleData} key={1} onSuccess={getList}/>
150
+      <ModalImage visibleData={visibleData} key={1} onSuccess={() => onModalChange()}/>
142
     </>
151
     </>
143
   )
152
   )
144
 }
153
 }

+ 6
- 5
src/pages/building/list/add/components/modalImage.jsx ファイルの表示

5
 import apis from '../../../../../services/apis';
5
 import apis from '../../../../../services/apis';
6
 import Styles from '../style.less';
6
 import Styles from '../style.less';
7
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
7
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
8
+import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
8
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
 
10
 
10
 
11
 
61
   // }
62
   // }
62
 
63
 
63
   componentDidUpdate(preProps, preState) {
64
   componentDidUpdate(preProps, preState) {
64
-    console.log(this.props.visibleData)
65
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
65
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
66
+      console.log(this.props.visibleData)
66
       this.getById()
67
       this.getById()
67
       this.setState({ visibleData: this.props.visibleData });
68
       this.setState({ visibleData: this.props.visibleData });
68
     }
69
     }
91
 
92
 
92
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
93
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
93
       // res.img = res.buildingImgList.map((item, _) => item.url)
94
       // res.img = res.buildingImgList.map((item, _) => item.url)
94
-      res.img = res.buildingImgList[0].url
95
+      res.img = res.buildingImgList.map(item => item.url)
95
       this.props.form.setFieldsValue(res)
96
       this.props.form.setFieldsValue(res)
96
     }).catch(err => {
97
     }).catch(err => {
97
      this.openNotificationWithIcon('error', err)
98
      this.openNotificationWithIcon('error', err)
118
 
119
 
119
   submitData(data) {
120
   submitData(data) {
120
     // TODO 这里应该是要支持多图,但是封装的控件没有
121
     // TODO 这里应该是要支持多图,但是封装的控件没有
121
-    data.img = [{ imgType: 'aparment', url: data.img, orderNo: 1 }]
122
+    data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
122
     data.buildingId = this.props.visibleData.buildingId;
123
     data.buildingId = this.props.visibleData.buildingId;
123
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
124
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
124
 
125
 
131
       // onSuccess() 是自定义
132
       // onSuccess() 是自定义
132
       this.props.onSuccess()
133
       this.props.onSuccess()
133
 
134
 
134
-      this.handleCancel()
135
+      // this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } }, () => console.log('回调:', this.state.visibleData))
135
     }).catch(err => {
136
     }).catch(err => {
136
       // eslint-disable-next-line no-unused-expressions
137
       // eslint-disable-next-line no-unused-expressions
137
       this.openNotificationWithIcon('error', err)
138
       this.openNotificationWithIcon('error', err)
186
               </Form.Item>
187
               </Form.Item>
187
               <Form.Item label="图片">
188
               <Form.Item label="图片">
188
               {getFieldDecorator('img')(
189
               {getFieldDecorator('img')(
189
-                <ImageUpload />,
190
+                <ImageListUpload />,
190
               )}
191
               )}
191
               </Form.Item>
192
               </Form.Item>
192
               <Form.Item label="面积">
193
               <Form.Item label="面积">

+ 129
- 0
src/pages/building/list/add/components/poster.jsx ファイルの表示

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../../components/XForm';
8
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../../utils/request'
10
+import PosterBottom from '../../../../../assets/bottom.png'
11
+import yinhao from '../../../../../assets/yinhao.png'
12
+import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
+import poster1 from '../../../../../assets/poster1.png';
14
+import poster2 from '../../../../../assets/poster2.png';
15
+import Styles from '../style.less';
16
+
17
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
18
+const { TextArea } = Input;
19
+
20
+const Poster = props => {
21
+  const [inputValue, changeInput] = useState('')
22
+  const [textAreaValue, changeTextArea] = useState('')
23
+  const [imgValue, changeImg] = useState('')
24
+  const [posterId, setPosterId] = useState('')
25
+
26
+  const { buildingId } = props.building
27
+
28
+  if (buildingId) {
29
+    // eslint-disable-next-line react-hooks/rules-of-hooks
30
+    useEffect(() => {
31
+      request({
32
+        url: '/api/admin/poster',
33
+        method: 'GET',
34
+        params: { targetId: buildingId, targetType: 'building' },
35
+      }).then(data => {
36
+        console.log(data, '2222')
37
+        if (data.length > 0) {
38
+          setPosterId(data[0].posterId)
39
+          changeImg(data[0].posterImg)
40
+          changeTextArea(data[0].posterDescription)
41
+          changeInput(data[0].posterTitle)
42
+        }
43
+      }).catch(err => {
44
+        message.info(err.msg || err.message)
45
+      })
46
+    }, [])
47
+  }
48
+
49
+  const submitPoster = () => {
50
+    if (buildingId) {
51
+      if (posterId) {
52
+        request({
53
+          url: `/api/admin/poster/${posterId}`,
54
+          method: 'PUT',
55
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
56
+        }).then(() => {
57
+          message.info('保存成功')
58
+        }).catch(err => {
59
+          message.info(err.msg || err.message)
60
+        })
61
+      } else {
62
+        request({
63
+          url: '/api/admin/poster',
64
+          method: 'POST',
65
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
66
+        }).then(data => {
67
+          setPosterId(data.posterId)
68
+          message.info('保存成功')
69
+        }).catch(err => {
70
+          message.info(err.msg || err.message)
71
+        })
72
+      }
73
+    } else {
74
+      message.warn('请先保存基本信息数据')
75
+    }
76
+  }
77
+
78
+  return <div>
79
+    <div style={{ display: 'flex' }}>
80
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
81
+        <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
82
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
83
+
84
+          <p className={Styles.tagLabel}><span>全朝南</span><span>品牌开发商</span><span>轨交房</span></p>
85
+          <p style={{
86
+            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
87
+            display: '-webkit-box', lineClamp: '3', height: '36px',lineHeight:'36px',
88
+            WebkitLineClamp: '1',
89
+            WebkitBoxOrient: 'vertical',
90
+            overflow: 'hidden',
91
+            textOverflow: 'ellipsis',
92
+          }}>{inputValue || '海报标题'}</p>
93
+          <p style={{ color: '#999',padding:' 0 20px' }}>约<span style={{ color: '#fd0d0c', fontSize: '24px',marginLeft:'6px' }}>41505</span><span style={{ color: '#fd0d0c', fontSize: '20px' }}>元/m²</span></p>
94
+
95
+          <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
96
+          <p style={{
97
+            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
98
+            display: '-webkit-box', lineClamp: '3', height: '76px',
99
+            WebkitLineClamp: '3',
100
+            WebkitBoxOrient: 'vertical',
101
+            overflow: 'hidden',
102
+            textOverflow: 'ellipsis',
103
+          }}>{textAreaValue || '海报描述'}</p>
104
+          <img src={PosterBottom} style={{ width: '100%' }} alt="" />
105
+        </div>
106
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
107
+      </div>
108
+      <div >
109
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
110
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
111
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
112
+        </div>
113
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
114
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
115
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
116
+        </div>
117
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
118
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
119
+          <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
120
+        </div>
121
+
122
+      </div>
123
+    </div>
124
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
125
+    <Button onClick={() => router.go(-1)}>取消</Button>
126
+  </div>
127
+}
128
+
129
+export default Poster

+ 97
- 0
src/pages/building/list/add/components/share.jsx ファイルの表示

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../../components/XForm';
8
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../../utils/request'
10
+import PosterBottom from '../../../../../assets/bottom.png'
11
+import yinhao from '../../../../../assets/yinhao.png'
12
+import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
+import logo from '../../../../../assets/logo.png';
14
+import touxiang from '../../../../../assets/touxiang.jpg';
15
+import poster1 from '../../../../../assets/poster1.png';
16
+import poster2 from '../../../../../assets/poster2.png';
17
+
18
+const Share = props => {
19
+  const [inputValue, changeInput] = useState('')
20
+  const [imgValue, changeImg] = useState('')
21
+  const [shareContentId, setShareContentId] = useState('')
22
+
23
+  const { buildingId } = props.building
24
+  if (buildingId) {
25
+    // eslint-disable-next-line react-hooks/rules-of-hooks
26
+    useEffect(() => {
27
+      request({
28
+        url: '/api/admin/shareContent',
29
+        method: 'GET',
30
+        params: { targetId: buildingId, targetType: 'building' },
31
+      }).then(data => {
32
+        if (data.length > 0) {
33
+          setShareContentId(data[0].shareContentId)
34
+          changeImg(data[0].shareContentImg)
35
+          changeInput(data[0].shareContentTitle)
36
+        }
37
+      }).catch(err => {
38
+        message.info(err.msg || err.message)
39
+      })
40
+    }, [])
41
+  }
42
+
43
+  const submitShare = () => {
44
+    if (buildingId) {
45
+      if (shareContentId) {
46
+        request({
47
+          url: `/api/admin/shareContent/${shareContentId}`,
48
+          method: 'PUT',
49
+          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
50
+        }).then(data => {
51
+          message.info('保存成功')
52
+        }).catch(err => {
53
+          message.info(err.msg || err.message)
54
+        })
55
+       } else {
56
+        request({
57
+          url: '/api/admin/shareContent',
58
+          method: 'POST',
59
+          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
60
+        }).then(data => {
61
+          setShareContentId(data.shareContentId)
62
+          message.info('保存成功')
63
+        }).catch(err => {
64
+          message.info(err.msg || err.message)
65
+        })
66
+       }
67
+     } else {
68
+      message.warn('请先保存基本信息数据')
69
+     }
70
+  }
71
+
72
+  return <div style={{ padding: '20px' }}>
73
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
74
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
75
+      <div>
76
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
77
+          <img src={logo} style={{ width: '22px', marginRight: '10px' }} />
78
+          知与行互动
79
+        </p>
80
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
81
+        <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
82
+      </div>
83
+    </div>
84
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
85
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
86
+      <Input placeholder="请输入海报标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
87
+    </div>
88
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
89
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
90
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
91
+    </div>
92
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
93
+    <Button onClick={() => router.go(-1)}>取消</Button>
94
+  </div>
95
+}
96
+
97
+export default Share

+ 42
- 15
src/pages/building/list/add/index.jsx ファイルの表示

12
 import TagGroup from './components/tags'
12
 import TagGroup from './components/tags'
13
 import Base from './components/base'
13
 import Base from './components/base'
14
 import ImageSet from './components/imageSet'
14
 import ImageSet from './components/imageSet'
15
+import Poster from './components/poster'
16
+import Share from './components/share'
15
 
17
 
16
 
18
 
17
 const { Option } = Select
19
 const { Option } = Select
29
 };
31
 };
30
 
32
 
31
 function AddBuilding(props) {
33
 function AddBuilding(props) {
32
-  function tabsCallback(key) {
33
-    console.log(key);
34
+
35
+  const [tab, setTab] = useState('base')
36
+
37
+  function tabsCallback(e) {
38
+    console.log(e);
39
+    setTab(e.target.value)
34
   }
40
   }
35
 
41
 
36
-  console.log(props.location)
42
+  // console.log(props.location)
37
 
43
 
38
   return (
44
   return (
39
-    <Tabs defaultActiveKey="1" onChange={tabsCallback}>
40
-      <TabPane tab="基本信息" key="1">
41
-        <Base building={{ buildingId: props.location.query && props.location.query.id }} />
42
-      </TabPane>
43
-      {
44
-        props.location.query.id &&
45
-        <TabPane tab="图片" key="2">
46
-          {/* '159fd19bb973b6972c10fbebf07ddeb1' */}
47
-          <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />
48
-        </TabPane>
49
-      }
50
-    </Tabs>
45
+    <>
46
+      <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
47
+        <Radio.Button value="base">基本信息</Radio.Button>
48
+        {
49
+          props.location.query.id &&
50
+          (
51
+            <>
52
+              <Radio.Button value="image">图片</Radio.Button>
53
+              <Radio.Button value="poster">海报图片</Radio.Button>
54
+              <Radio.Button value="share">分享设置</Radio.Button>
55
+            </>
56
+          )
57
+        }
58
+      </Radio.Group>
59
+      <div style={{ marginTop: '20px' }}>
60
+        { tab === 'base' && <Base building={{ buildingId: props.location.query && props.location.query.id }} /> }
61
+        { props.location.query.id && (tab === 'image' && <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />)}
62
+        { props.location.query.id && (tab === 'poster' && <Poster building={{ buildingId: props.location.query && props.location.query.id }} />)}
63
+        { props.location.query.id && (tab === 'share' && <Share building={{ buildingId: props.location.query && props.location.query.id }} />)}
64
+      </div>
65
+    </>
66
+    // <Tabs defaultActiveKey="1" onChange={tabsCallback}>
67
+    //   <TabPane tab="基本信息" key="1">
68
+    //     <Base building={{ buildingId: props.location.query && props.location.query.id }} />
69
+    //   </TabPane>
70
+    //   {
71
+    //     props.location.query.id &&
72
+    //     <TabPane tab="图片" key="2">
73
+    //       {/* '159fd19bb973b6972c10fbebf07ddeb1' */}
74
+    //       <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />
75
+    //     </TabPane>
76
+    //   }
77
+    // </Tabs>
51
   )
78
   )
52
 }
79
 }
53
 
80
 

+ 20
- 0
src/pages/building/list/add/style.less ファイルの表示

1
+.tagLabel{
2
+  padding: 14px 20px 0 20px;
3
+  margin: 0 0 5px 0;
4
+  span{
5
+    padding: 2px 8px;
6
+    font-size: 10px;
7
+    background-color: #e1f7eb;
8
+    color: #3de180;
9
+    border-radius: 2px;
10
+    margin-right: 10px;
11
+  }
12
+  span:nth-child(3n+2){
13
+    color: #72a0d1;
14
+    background-color: #eaeff5;
15
+  }
16
+  span:nth-child(3n+3){
17
+    color: #ff5858;
18
+    background-color: #fff0f1;
19
+  }
20
+}

+ 4
- 4
src/pages/building/type/index.jsx ファイルの表示

20
       title: '类型名称',
20
       title: '类型名称',
21
       dataIndex: 'buildingTypeName',
21
       dataIndex: 'buildingTypeName',
22
       key: 'buildingTypeName',
22
       key: 'buildingTypeName',
23
-      render: (_, record) => <Tag color="blue" onClick={() => toEdi(record.buildingTypeId)}>{ record.buildingTypeName }</Tag>,
23
+      render: (_, record) => <Tag color="blue" onClick={() => toEdi(record.buildingTypeId)}>{record.buildingTypeName}</Tag>,
24
     },
24
     },
25
     {
25
     {
26
       title: '创建时间',
26
       title: '创建时间',
35
       render: (_, record) => (
35
       render: (_, record) => (
36
         <span onClick={() => deleteType(record)}>
36
         <span onClick={() => deleteType(record)}>
37
           <span style={{
37
           <span style={{
38
-              color: '#FF4A4A', right: '0',
38
+            color: '#FF4A4A', right: '0',
39
           }} >
39
           }} >
40
-              删除
40
+            删除
41
           <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
41
           <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
42
           </span>
42
           </span>
43
         </span>
43
         </span>
97
   return (
97
   return (
98
     <>
98
     <>
99
       <Button type="danger" onClick={() => toEdi()}>新增类型</Button>
99
       <Button type="danger" onClick={() => toEdi()}>新增类型</Button>
100
-      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false}/>
100
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} />
101
       {/* 分页 */}
101
       {/* 分页 */}
102
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
102
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
103
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={onChange} />
103
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={onChange} />

+ 31
- 31
src/pages/staff/list/StaffList.jsx ファイルの表示

29
  */
29
  */
30
 const CartBody = (props) => {
30
 const CartBody = (props) => {
31
   const { data } = props
31
   const { data } = props
32
-    
32
+
33
   const confirm = () => {
33
   const confirm = () => {
34
     Modal.confirm({
34
     Modal.confirm({
35
       title: '确认停用该角色?',
35
       title: '确认停用该角色?',
36
       okText: '确认',
36
       okText: '确认',
37
       cancelText: '取消',
37
       cancelText: '取消',
38
-      onOk () {
38
+      onOk() {
39
         console.log('OK');
39
         console.log('OK');
40
       },
40
       },
41
-      onCancel () {
41
+      onCancel() {
42
         console.log('Cancel');
42
         console.log('Cancel');
43
       },
43
       },
44
     });
44
     });
49
       <div>
49
       <div>
50
 
50
 
51
         <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
51
         <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
52
-        <span className={Styles.ediText} style={{ marginLeft: '20px' }} onClick={toEditStaff(data.userId)}>
52
+        <Button type="link" style={{ marginLeft: '10px', color: '#FF925C', fontSize: '18px' }} onClick={toEditStaff(data.userId)}>
53
           编辑
53
           编辑
54
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
55
-        </span>
56
-        <span className={Styles.ediText} style={{ marginLeft: '50px' }} onClick={confirm}>
54
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
55
+        </Button>
56
+        <Button type="link" style={{ fontSize: '18px', color: '#cacaca', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
57
           停用
57
           停用
58
-                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
59
-        </span>
58
+                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
59
+        </Button>
60
+        <Button type="link" style={{ fontSize: '18px', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
61
+          启用
62
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
63
+        </Button>
60
 
64
 
61
       </div>
65
       </div>
62
       <div>
66
       <div>
69
           }
73
           }
70
         </span>
74
         </span>
71
 
75
 
72
-        <p className={Styles.cardText} style={{ width: '300px' }}>
73
-          <span>姓名:{data.userName}</span>
74
-
75
-          <span style={{ float: "right" }}>状态:{data.status === '1' ? '启用' : '停用'}</span>
76
-
76
+        <p className={Styles.cardText} >姓名 : {data.userName}
77
         </p>
77
         </p>
78
-        <p className={Styles.cardText} style={{ width: '300px' }}>
79
-          <span>电话:{data.phone}</span>
78
+        <p className={Styles.statusText} > 状态 : {data.status === '1' ? '启用' : '停用'} </p>
79
+        <p className={Styles.phoneText} >
80
+          电话 : {data.phone}
80
         </p>
81
         </p>
81
       </div>
82
       </div>
82
 
83
 
86
 
87
 
87
 
88
 
88
 const header = (props) => {
89
 const header = (props) => {
89
-  const [tempData,setTempData] = useState([])
90
+  const [tempData, setTempData] = useState([])
90
   useEffect(() => {
91
   useEffect(() => {
91
     getList({ pageNum: 1, pageSize: 10 });
92
     getList({ pageNum: 1, pageSize: 10 });
92
-  },[])
93
+  }, [])
93
 
94
 
94
   const getList = (params) => {
95
   const getList = (params) => {
95
     request({
96
     request({
97
       method: 'GET',
98
       method: 'GET',
98
       params: { ...params },
99
       params: { ...params },
99
     }).then((data) => {
100
     }).then((data) => {
100
-        console.log(data,"listData")
101
-        setTempData(data.records)
101
+      console.log(data, "listData")
102
+      setTempData(data.records)
102
     })
103
     })
103
   }
104
   }
104
 
105
 
108
   }
109
   }
109
 
110
 
110
   // 提交事件
111
   // 提交事件
111
-const handleSubmit = (e, props) => {
112
-  e.preventDefault();
113
-  props.form.validateFields((err, values) => {
114
-    if (!err) {
115
-      console.log('提交数据: ', values)
116
-      getList({ pageNum: 1, pageSize: 10, ...values })
117
-    }
118
-  });
119
-}
112
+  const handleSubmit = (e, props) => {
113
+    e.preventDefault();
114
+    props.form.validateFields((err, values) => {
115
+      if (!err) {
116
+        console.log('提交数据: ', values)
117
+        getList({ pageNum: 1, pageSize: 10, ...values })
118
+      }
119
+    });
120
+  }
120
 
121
 
121
   const { getFieldDecorator } = props.form
122
   const { getFieldDecorator } = props.form
122
   return (
123
   return (
156
           </Button>
157
           </Button>
157
         </Form.Item>
158
         </Form.Item>
158
       </Form>
159
       </Form>
159
-      <Button type="danger" className={styles.addBtn} onClick={toEditStaff()}>新增</Button>
160
-
160
+      <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
161
       <Row style={{ padding: ' 0 10px' }}>
161
       <Row style={{ padding: ' 0 10px' }}>
162
         {
162
         {
163
           tempData.map((item, index) => (
163
           tempData.map((item, index) => (

+ 3
- 11
src/pages/staff/list/editStaff.jsx ファイルの表示

26
   const [userData, setUserData] = useState({})
26
   const [userData, setUserData] = useState({})
27
   const [tagData, setTagData] = useState([])
27
   const [tagData, setTagData] = useState([])
28
 
28
 
29
-  console.log(userData,"user----》")
30
-
31
   const getTagList = () => {
29
   const getTagList = () => {
32
     request({
30
     request({
33
       url: '/api/admin/taTags',
31
       url: '/api/admin/taTags',
61
   }
59
   }
62
 
60
 
63
   const handleSubmit = val => {
61
   const handleSubmit = val => {
64
-    window.console.log('submit data --->', val)
65
     if(userId){
62
     if(userId){
66
       request({
63
       request({
67
         url: '/api/admin/taUser/' + userId,
64
         url: '/api/admin/taUser/' + userId,
148
       label: '授权项目',
145
       label: '授权项目',
149
       name: 'buildingId',
146
       name: 'buildingId',
150
       render: <BuildSelect />,
147
       render: <BuildSelect />,
151
-      value: userData.buildingId,
152
-      rules: [
153
-        { required: true, message: '请选择所属项目' },
154
-      ],
148
+      value: userData.buildingId
155
     },
149
     },
156
     {
150
     {
157
       label: '图片',
151
       label: '图片',
180
     },
174
     },
181
   ]
175
   ]
182
 
176
 
183
-  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
184
-
185
-
186
-
177
+  console.log('--------->', fields)
187
 
178
 
179
+  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
188
 }
180
 }
189
 
181
 
190
 
182
 

+ 22
- 30
src/pages/staff/list/style.less ファイルの表示

11
   border: 1px solid #dbdbdb;
11
   border: 1px solid #dbdbdb;
12
 }
12
 }
13
 
13
 
14
-.addButton {
15
-  // background: #50be00;
16
-  border-radius: 4px;
17
-  border: 0px;
18
-  margin: 10px 0px;
19
-}
20
 
14
 
21
 .card {
15
 .card {
22
-  width: 348px;
16
+  min-width: 330px;
17
+  margin-right: 2vw;
23
   height: 244px;
18
   height: 244px;
24
   background: rgba(255, 255, 255, 1);
19
   background: rgba(255, 255, 255, 1);
25
   box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
20
   box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
26
   border-radius: 12px;
21
   border-radius: 12px;
27
   margin-bottom: 40px;
22
   margin-bottom: 40px;
28
-
23
+  position: relative;
29
 }
24
 }
30
 
25
 
31
-.cardText {
32
 
26
 
33
-  height: 28px;
27
+.cardText {
34
   font-size: 20px;
28
   font-size: 20px;
35
-  font-weight: 400;
36
   color: rgba(102, 102, 102, 1);
29
   color: rgba(102, 102, 102, 1);
37
-  line-height: 28px;
38
-  margin-top: 10px;
39
-  margin-bottom: 0;
40
-
30
+  position: absolute;
31
+  bottom:36px;
32
+}
33
+.statusText {
34
+  font-size: 20px;
35
+  color: rgba(102, 102, 102, 1);
36
+  position: absolute;
37
+  bottom:36px;
38
+  right: 20px;
39
+}
40
+.phoneText{
41
+  font-size: 20px;
42
+  color: rgba(102, 102, 102, 1);
43
+  position: absolute;
44
+  bottom:0px;
41
 }
45
 }
42
 
46
 
43
 .cardItem {
47
 .cardItem {
49
   align-items: center;
53
   align-items: center;
50
 }
54
 }
51
 
55
 
52
-.ediText {
53
-  width: 36px;
54
-  height: 25px;
55
-  font-size: 18px;
56
-
57
-  font-weight: 400;
58
-  color: rgba(255, 146, 92, 1);
59
-  line-height: 25px;
60
-
61
-}
62
 
56
 
63
 .cardTag {
57
 .cardTag {
64
-  height: 18px;
65
   font-size: 10px;
58
   font-size: 10px;
66
-  // background: #fdce22;
67
   border-radius: 4px;
59
   border-radius: 4px;
68
   color: #ffffff;
60
   color: #ffffff;
69
-  line-height: 14px;
61
+  line-height: 16px;
70
   margin-top: 10px;
62
   margin-top: 10px;
71
   padding: 1px 3px;
63
   padding: 1px 3px;
64
+
72
 }
65
 }
73
 
66
 
74
 .title {
67
 .title {
76
   width: 84px;
69
   width: 84px;
77
   justify-content: space-between;
70
   justify-content: space-between;
78
   text-align: justify;
71
   text-align: justify;
79
-  text-align-last: justify
72
+  text-align-last: justify;
80
 }
73
 }
81
 
74
 
82
 
75
 
83
 .roletext {
76
 .roletext {
84
   font-size: 20px;
77
   font-size: 20px;
85
-
86
   font-weight: 400;
78
   font-weight: 400;
87
   color: rgba(51, 51, 51, 1);
79
   color: rgba(51, 51, 51, 1);
88
   line-height: 28px;
80
   line-height: 28px;

+ 2
- 0
src/services/apis.js ファイルの表示

19
     signin: {
19
     signin: {
20
       method: 'POST',
20
       method: 'POST',
21
       url: `${prefix}/taUser/signin`,
21
       url: `${prefix}/taUser/signin`,
22
+      login: true
22
     },
23
     },
23
     signout: {
24
     signout: {
24
       method: 'POST',
25
       method: 'POST',
25
       url: `${prefix}/taUser/signout`,
26
       url: `${prefix}/taUser/signout`,
27
+      logout: true
26
     },
28
     },
27
   },
29
   },
28
   building: {
30
   building: {

+ 1
- 1
src/utils/mixStr.js ファイルの表示

12
   return str.repeat(Math.floor(len / orginLen)) + str.substr(0, len % orginLen)
12
   return str.repeat(Math.floor(len / orginLen)) + str.substr(0, len % orginLen)
13
 }
13
 }
14
 
14
 
15
-const mixChars = window.navigator.userAgent + (new Date).toUTCString().replace(/\d{2}:\d{2}:\d{2}/, '')
15
+const mixChars = window.navigator.userAgent // + (new Date).toUTCString().replace(/\d{2}:\d{2}:\d{2}/, '')
16
 
16
 
17
 const strXOR = (str, mix) => {
17
 const strXOR = (str, mix) => {
18
   if (!str) return str
18
   if (!str) return str

+ 4
- 3
src/utils/request.js ファイルの表示

33
 }
33
 }
34
 
34
 
35
 request.interceptors.request.use((url, options) => {
35
 request.interceptors.request.use((url, options) => {
36
-  const { urlData, headers = {}, logout = false, data, ...opts } = options
36
+  const { urlData, headers = {}, logout = false, login = false, data, ...opts } = options
37
   const apiURL = urlData ? replaceURLParams(url, urlData) : url
37
   const apiURL = urlData ? replaceURLParams(url, urlData) : url
38
   const token = mixStr(window.localStorage.getItem('test-foobar'))
38
   const token = mixStr(window.localStorage.getItem('test-foobar'))
39
-  const authHeader = token ? { Authorization: `Bearer ${token}` } : {}
40
 
39
 
41
-  if (logout) {
40
+  if (login || logout) {
42
     window.localStorage.removeItem('test-foobar')
41
     window.localStorage.removeItem('test-foobar')
43
   }
42
   }
44
 
43
 
44
+  const authHeader = !login ? { Authorization: `Bearer ${token}` } : {}
45
+
45
   return (
46
   return (
46
     {
47
     {
47
       url: apiURL,
48
       url: apiURL,