zlisen 3 years ago
parent
commit
9d5d227f52

+ 43
- 0
src/components/ImgPreview/index.jsx View File

1
+import React, { useState, useEffect } from 'react';
2
+import Carousel, { Modal, ModalGateway } from 'react-images';
3
+
4
+const Lightbox = (props) => {
5
+  const { images = [], open, onClose } = props;
6
+  const [modalIsOpen, setModalIsOpen] = useState(open)
7
+  useEffect(() => {
8
+    setModalIsOpen(open)
9
+  }, [images, open])
10
+
11
+  const toggleModal = () => {
12
+    setModalIsOpen(!modalIsOpen)
13
+    if (typeof onClose === 'function') {
14
+      onClose()
15
+    }
16
+
17
+  }
18
+  const styleInit = {
19
+    header: (base, state) => ({ //头部样式
20
+      position: 'absolute',
21
+      top: 90,
22
+      right: 90,
23
+      zIndex: 9999,
24
+    }),
25
+    view: (base, state) => ({
26
+      textAlign: 'center',
27
+      height: state.isFullscreen?'100%':600  //当点击全屏的时候图片样式
28
+    })
29
+  }
30
+  return (
31
+    <ModalGateway >
32
+      {modalIsOpen ? (
33
+        <Modal onClose={toggleModal} >
34
+          <Carousel views={images} styles={styleInit}/>
35
+        </Modal>
36
+      ) : null}
37
+    </ModalGateway>
38
+  );
39
+
40
+}
41
+
42
+
43
+export default Lightbox

+ 2
- 2
src/components/Poster/Form.jsx View File

20
 const updateData = fetch(apis.activity.updatePoster)
20
 const updateData = fetch(apis.activity.updatePoster)
21
 
21
 
22
 const PosterForm = (props) => {
22
 const PosterForm = (props) => {
23
-  const { form, targetId, targetType, rights } = props
23
+  const { form, targetId, targetType, rights,submitBtn=true } = props
24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
25
 
25
 
26
   const [formData, setFormData] = useState()
26
   const [formData, setFormData] = useState()
95
       </Form.Item>*/}
95
       </Form.Item>*/}
96
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
96
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
97
         <AuthButton name={rights}>
97
         <AuthButton name={rights}>
98
-          <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
98
+          {submitBtn&&<Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>}
99
         </AuthButton>
99
         </AuthButton>
100
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button>  */}
100
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button>  */}
101
       </Form.Item>
101
       </Form.Item>

+ 2
- 1
src/components/Poster/index.jsx View File

7
 const noop = x => x;
7
 const noop = x => x;
8
 
8
 
9
 export default (props) => {
9
 export default (props) => {
10
-  const { target, rights, onCancel = noop } = props
10
+  const { target, rights, onCancel = noop,submitBtn=true } = props
11
   const { id: targetId, type: targetType } = target
11
   const { id: targetId, type: targetType } = target
12
 
12
 
13
   const [posterImg, setPosterImg] = useState()
13
   const [posterImg, setPosterImg] = useState()
24
           rights={rights}
24
           rights={rights}
25
           onImageChange={setPosterImg}
25
           onImageChange={setPosterImg}
26
           onCancel={onCancel}
26
           onCancel={onCancel}
27
+          submitBtn={submitBtn}
27
         />
28
         />
28
       </div>
29
       </div>
29
     </div>
30
     </div>

+ 4
- 4
src/components/Share/index.jsx View File

19
 const updateData = fetch(apis.activity.updateShareContent)
19
 const updateData = fetch(apis.activity.updateShareContent)
20
 
20
 
21
 const ShareForm = (props) => {
21
 const ShareForm = (props) => {
22
-  const { target, form, rights } = props
22
+  const { target, form, rights,submitBtn=true } = props
23
   const { id: targetId, type: targetType } = target
23
   const { id: targetId, type: targetType } = target
24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
25
 
25
 
94
       })(<ImageUpload />)}
94
       })(<ImageUpload />)}
95
       </Form.Item>
95
       </Form.Item>
96
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
96
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
97
-        <AuthButton name={rights}>
98
-          <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
97
+      {submitBtn&&<><AuthButton name={rights}>
98
+         <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
99
         </AuthButton>
99
         </AuthButton>
100
-        <Button style={{marginLeft: '2em'}} onClick={onCancel}>清空</Button>
100
+        <Button style={{marginLeft: '2em'}} onClick={onCancel}>清空</Button></>}
101
       </Form.Item>
101
       </Form.Item>
102
     </Form>
102
     </Form>
103
   )
103
   )

+ 2
- 1
src/components/XForm/ImageListUpload.jsx View File

102
           fileList={fileList}
102
           fileList={fileList}
103
           onPreview={this.handlePreview}
103
           onPreview={this.handlePreview}
104
           onChange={this.handleChange}
104
           onChange={this.handleChange}
105
+          disabled={this.props.disabled}
105
           {...uploaderProps}
106
           {...uploaderProps}
106
           onSuccess={this.handleUploadSucess}
107
           onSuccess={this.handleUploadSucess}
107
         >
108
         >
108
           {/* unlimited 表示上传无限制数量 */}
109
           {/* unlimited 表示上传无限制数量 */}
109
           {(this.props.unlimited && uploadButton) ||
110
           {(this.props.unlimited && uploadButton) ||
110
-            ((fileList || images).length >= 8 ? null : uploadButton)}
111
+            ((fileList || images).length >= 100 ? null : uploadButton)}
111
         </Upload>
112
         </Upload>
112
         <Modal id={'ImageListUpload-preview'} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
113
         <Modal id={'ImageListUpload-preview'} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
113
           <img alt="example" style={{ width: '100%' }} src={getImgURL(previewImage)} />
114
           <img alt="example" style={{ width: '100%' }} src={getImgURL(previewImage)} />

+ 5
- 5
src/pages/building/Edit/AlbumList/List.jsx View File

6
 const { Panel } = Collapse;
6
 const { Panel } = Collapse;
7
 
7
 
8
 const ImageList = props => {
8
 const ImageList = props => {
9
-  const { data,updateImg } = props;
9
+  const { data,updateImg ,isPublish} = props;
10
   const [imageList, setImageList] = useState([]);
10
   const [imageList, setImageList] = useState([]);
11
 
11
 
12
   function getImgUrl() {
12
   function getImgUrl() {
28
     setImageList(getImgUrl());
28
     setImageList(getImgUrl());
29
   }, [data]);
29
   }, [data]);
30
 
30
 
31
-  return <ImageListUpload value={imageList} disabled onChange={onImageChange} unlimited={false} />;
31
+  return <ImageListUpload value={imageList} disabled={isPublish} onChange={onImageChange} unlimited={false} />;
32
 };
32
 };
33
 
33
 
34
 export default props => {
34
 export default props => {
35
-  const { dataList = [] } = props;
35
+  const { dataList = [] ,isPublish} = props;
36
 
36
 
37
   const Extra = item => (
37
   const Extra = item => (
38
     <>
38
     <>
58
     <Collapse defaultActiveKey={['0']} expandIconPosition="right" style={{ marginTop: '2em' }}>
58
     <Collapse defaultActiveKey={['0']} expandIconPosition="right" style={{ marginTop: '2em' }}>
59
       {dataList.map((row, index) => {
59
       {dataList.map((row, index) => {
60
         return (
60
         return (
61
-          <Panel header={row.apartmentName} key={index} extra={Extra(row)}>
62
-            <ImageList data={row} updateImg={props.updateImg}></ImageList>
61
+          <Panel header={row.apartmentName} key={index} extra={!isPublish&&Extra(row)}>
62
+            <ImageList data={row} updateImg={props.updateImg} isPublish={isPublish}></ImageList>
63
           </Panel>
63
           </Panel>
64
         );
64
         );
65
       })}
65
       })}

+ 7
- 26
src/pages/building/Edit/AlbumList/index.jsx View File

6
 import List from './List';
6
 import List from './List';
7
 import ModalForm from '../components/ModalForm';
7
 import ModalForm from '../components/ModalForm';
8
 
8
 
9
+
9
 export default props => {
10
 export default props => {
10
   const [visible, setVisible] = useState(false);
11
   const [visible, setVisible] = useState(false);
11
-  const { history } = props;
12
+  const { history,isPublish } = props;
12
   const { query } = history.location;
13
   const { query } = history.location;
13
   const { id } = query;
14
   const { id } = query;
14
 
15
 
19
   const [confirmLoading, setConfirmLoading] = useState(false);
20
   const [confirmLoading, setConfirmLoading] = useState(false);
20
   const albumRef = useRef();
21
   const albumRef = useRef();
21
 
22
 
23
+
24
+
22
   const getList = () => {
25
   const getList = () => {
23
     // const urlData = { id };
26
     // const urlData = { id };
24
     // const params = { apartmentType: 'apart' };
27
     // const params = { apartmentType: 'apart' };
66
   }
69
   }
67
 
70
 
68
   const updateApartment = data => {
71
   const updateApartment = data => {
69
-  // const values= {}
70
-
71
-    // setLoading(true);
72
-
73
     return request({
72
     return request({
74
       ...apis.building.buildingApartmentUpdate,
73
       ...apis.building.buildingApartmentUpdate,
75
-      // urlData: { id: data.apartmentId },
76
       data
74
       data
77
 
75
 
78
     })
76
     })
79
-    //   .then(() => {
80
-    //     console.log('删除成功');
81
-    //     message.success('删除成功');
82
-    //     getList();
83
-    //   })
84
-    //   .catch(err => {
85
-    //     console.log('删除失败');
86
-    //   });
87
-    // deleteData({ urlData })
88
-    //   .then(() => {
89
-    //     getList();
90
-    //     message.success('删除成功');
91
-    //     setLoading(false);
92
-    //   })
93
-    //   .catch(err => {
94
-    //     console.error(err.message || err);
95
-    //     setLoading(false);
96
-    //   });
97
   };
77
   };
98
 
78
 
99
   const handleSuccess = () => {
79
   const handleSuccess = () => {
137
     <div>
117
     <div>
138
       <div>
118
       <div>
139
         <AuthButton name="building.photo.add">
119
         <AuthButton name="building.photo.add">
140
-          <Button type="primary" onClick={() => setVisible(true)}>
120
+          {!isPublish&&<Button type="primary" onClick={() => setVisible(true)}>
141
             新增相册
121
             新增相册
142
-          </Button>
122
+          </Button>}
143
         </AuthButton>
123
         </AuthButton>
144
       </div>
124
       </div>
145
       <Form
125
       <Form
155
         onRename={onRename}
135
         onRename={onRename}
156
         onDelete={handleDelete}
136
         onDelete={handleDelete}
157
         updateImg={updateApartment}
137
         updateImg={updateApartment}
138
+        isPublish={isPublish}
158
       />
139
       />
159
       <Modal
140
       <Modal
160
         title="相册名称"
141
         title="相册名称"

+ 67
- 35
src/pages/building/Edit/Apartment/List.jsx View File

1
-import React from 'react'
2
-import { Button, Table, Popconfirm } from 'antd'
3
-import AuthButton from '@/components/AuthButton'
4
-import moment from 'moment'
5
-import { getImgURL } from '@/utils/image'
1
+import React, { useState } from 'react';
2
+import { Button, Table, Popconfirm, Modal } from 'antd';
3
+import AuthButton from '@/components/AuthButton';
4
+import moment from 'moment';
5
+import { getImgURL } from '@/utils/image';
6
+import ZmageImg from '@/components/ZmageImg/ZmageImg';
6
 // import ImgPreview from '@/components/ImgPreview'
7
 // import ImgPreview from '@/components/ImgPreview'
7
 
8
 
8
 const saleType = [
9
 const saleType = [
22
     id: 4,
23
     id: 4,
23
     name: '在租',
24
     name: '在租',
24
   },
25
   },
25
-]
26
+];
26
 
27
 
27
 const houseType = [
28
 const houseType = [
28
   {
29
   {
45
     id: 5,
46
     id: 5,
46
     name: '5室及以上',
47
     name: '5室及以上',
47
   },
48
   },
48
-]
49
+];
50
+
51
+export default props => {
52
+  const {isPublish} =props
53
+  const [visible, setVisible] = useState(false);
49
 
54
 
50
-export default (props) => {
51
   const columns = [
55
   const columns = [
52
     {
56
     {
53
       title: '户型名称',
57
       title: '户型名称',
58
       title: '销售状态',
62
       title: '销售状态',
59
       dataIndex: 'marketStatus',
63
       dataIndex: 'marketStatus',
60
       key: 'marketStatus',
64
       key: 'marketStatus',
61
-      render: (_, record) => <span>{(saleType.filter(x => x.id == record.marketStatus)[0] || {}).name}</span>,
65
+      render: (_, record) => (
66
+        <span>{(saleType.filter(x => x.id == record.marketStatus)[0] || {}).name}</span>
67
+      ),
62
     },
68
     },
63
     {
69
     {
64
       title: '户型',
70
       title: '户型',
65
       dataIndex: 'houseType',
71
       dataIndex: 'houseType',
66
       key: 'houseType',
72
       key: 'houseType',
67
-      render: (_, record) => <span>{(houseType.filter(x => x.id == record.houseType)[0] || {}).name}</span>,
73
+      render: (_, record) => (
74
+        <span>{(houseType.filter(x => x.id == record.houseType)[0] || {}).name}</span>
75
+      ),
68
     },
76
     },
69
     {
77
     {
70
       title: '面积',
78
       title: '面积',
71
       dataIndex: 'buildingArea',
79
       dataIndex: 'buildingArea',
72
       key: 'buildingArea',
80
       key: 'buildingArea',
73
-      render: (buildingArea, _) => <span>{`${buildingArea === 0 || buildingArea === null ? "-" : buildingArea + "m²"}`}</span>,
81
+      render: (buildingArea, _) => (
82
+        <span>{`${buildingArea === 0 || buildingArea === null ? '-' : buildingArea + 'm²'}`}</span>
83
+      ),
74
     },
84
     },
75
-    // {
76
-    //   title: '户型图',
77
-    //   dataIndex: 'buildingImgList',
78
-    //   key: 'buildingImgList',
79
-    //   render: (buildingImgList, _) =>  <ImgPreview images={[{ src:getImgURL(buildingImgList[0].url) }]}></ImgPreview>  ,
80
-    // },
81
-    // <Zmage src={getImgURL(buildingImgList[0].url)}   />
85
+    {
86
+      title: '户型图',
87
+      dataIndex: 'buildingImgList',
88
+      key: 'buildingImgList',
89
+      render: (buildingImgList, _) => (
90
+        <img
91
+          src={getImgURL(buildingImgList[0].url)}
92
+          onClick={() => setVisible(buildingImgList[0].url)}
93
+          width={128}
94
+          height={72}
95
+          style={{ borderRadius: '4px' }}
96
+          alt=""
97
+        />
98
+      ),
99
+    },
100
+
82
     {
101
     {
83
       title: '创建时间',
102
       title: '创建时间',
84
       dataIndex: 'createDate',
103
       dataIndex: 'createDate',
90
       dataIndex: 'apartmentId',
109
       dataIndex: 'apartmentId',
91
       key: 'apartmentId',
110
       key: 'apartmentId',
92
       render: (_, record) => (
111
       render: (_, record) => (
93
-        <>
112
+       !isPublish && <>
94
           <AuthButton name="building.houseType.edit">
113
           <AuthButton name="building.houseType.edit">
95
-            <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
114
+            <Button type="link" onClick={() => props.onEdit(record)}>
115
+              编辑
116
+            </Button>
96
           </AuthButton>
117
           </AuthButton>
97
           <AuthButton name="building.houseType.delete">
118
           <AuthButton name="building.houseType.delete">
98
-            <Popconfirm
99
-              title="确定要进行删除操作 ?"
100
-              onConfirm={() => props.onDelete(record)}
101
-            >
102
-              <Button type="link" style={{ color: 'red' }}>删除</Button>
119
+            <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
120
+              <Button type="link" style={{ color: 'red' }}>
121
+                删除
122
+              </Button>
103
             </Popconfirm>
123
             </Popconfirm>
104
           </AuthButton>
124
           </AuthButton>
105
         </>
125
         </>
106
       ),
126
       ),
107
     },
127
     },
108
-  ]
128
+  ];
109
 
129
 
110
   return (
130
   return (
111
-    <Table
112
-      loading={props.loading}
113
-      dataSource={props.dataSource}
114
-      columns={columns}
115
-      style={{marginTop: '1em', width: '100%'}}
116
-      rowKey="apartmentId"
117
-    />
118
-  )
119
-}
131
+    <>
132
+      <Table
133
+        loading={props.loading}
134
+        dataSource={props.dataSource}
135
+        columns={columns}
136
+        style={{ marginTop: '1em', width: '100%' }}
137
+        rowKey="apartmentId"
138
+      />
139
+      <Modal
140
+        visible={visible}
141
+        // onOk={handleOk}
142
+        onCancel={() => setVisible(false)}
143
+        footer={null}
144
+        bodyStyle={{ padding: '0' }}
145
+        destroyOnClose
146
+      >
147
+        <img src={getImgURL(visible)} width="100%" alt=""></img>
148
+      </Modal>
149
+    </>
150
+  );
151
+};

+ 5
- 4
src/pages/building/Edit/Apartment/index.jsx View File

5
 import Form from './Form'
5
 import Form from './Form'
6
 import List from './List'
6
 import List from './List'
7
 
7
 
8
+
8
 const fetchList = fetch(apis.building.buildingApartment)
9
 const fetchList = fetch(apis.building.buildingApartment)
9
 const deleteData = fetch(apis.building.buildingApartmentDelete)
10
 const deleteData = fetch(apis.building.buildingApartmentDelete)
10
 
11
 
11
 export default (props) => {
12
 export default (props) => {
12
-  const { history } = props;
13
+  const { history,isPublish } = props;
13
   const { query } = history.location;
14
   const { query } = history.location;
14
   const { id } = query;
15
   const { id } = query;
15
 
16
 
63
   return (
64
   return (
64
     <div>
65
     <div>
65
       <div>
66
       <div>
66
-        <AuthButton name="building.houseType.add">
67
+        {!isPublish&&<AuthButton name="building.houseType.add">
67
           <Button type="primary" onClick={() => handleEdit()}>新增户型</Button>
68
           <Button type="primary" onClick={() => handleEdit()}>新增户型</Button>
68
-        </AuthButton>
69
+        </AuthButton>}
69
       </div>
70
       </div>
70
       <Form buildingId={id} visible={visible} onCancel={() => setVisible(false)} formData={apartmentRef.current} onSuccess={handleSuccess} />
71
       <Form buildingId={id} visible={visible} onCancel={() => setVisible(false)} formData={apartmentRef.current} onSuccess={handleSuccess} />
71
-      <List loading={loading} dataSource={list} onEdit={handleEdit} onDelete={handleDelete} />
72
+      <List loading={loading} dataSource={list} onEdit={handleEdit} onDelete={handleDelete} isPublish={isPublish}/>
72
     </div>
73
     </div>
73
   )
74
   )
74
 }
75
 }

+ 8
- 3
src/pages/building/Edit/Basic/index.jsx View File

26
 const Item = Form.Item
26
 const Item = Form.Item
27
 
27
 
28
 const BuildingBasic = React.forwardRef((props, ref) => {
28
 const BuildingBasic = React.forwardRef((props, ref) => {
29
-  const { form, history, setMarketingCode,institutionIdChange, user } = props;
29
+  const { form, history, setMarketingCode,institutionIdChange, user ,isPublish,setIsPublish} = props;
30
   const { getFieldDecorator, getFieldValue, setFieldsValue } = form;
30
   const { getFieldDecorator, getFieldValue, setFieldsValue } = form;
31
   const { query } = history.location;
31
   const { query } = history.location;
32
   const { id } = query;
32
   const { id } = query;
45
     initPois,
45
     initPois,
46
     deletePoi,
46
     deletePoi,
47
   ] = usePois()
47
   ] = usePois()
48
+  // const [isPublish,initPublish] = useIsPublish()
48
 
49
 
49
   const updateLoading = (key) => (state) => setLoading({ ...loading, [key]: state })
50
   const updateLoading = (key) => (state) => setLoading({ ...loading, [key]: state })
50
   const updateFormLoading = updateLoading('form')
51
   const updateFormLoading = updateLoading('form')
51
 
52
 
52
   useQuery(id, updateFormLoading, (res) => {
53
   useQuery(id, updateFormLoading, (res) => {
54
+
53
     initPois(res.mapJson)
55
     initPois(res.mapJson)
54
     initArrounds(res)
56
     initArrounds(res)
55
     initForm(form, res)
57
     initForm(form, res)
56
     setMarketingCode(res.marketingCode)
58
     setMarketingCode(res.marketingCode)
57
     setCityId(res.cityId)
59
     setCityId(res.cityId)
58
     institutionIdChange(res.institutionId)
60
     institutionIdChange(res.institutionId)
61
+  
62
+
63
+    setIsPublish(res.status=== 1)
59
   })
64
   })
60
   
65
   
61
   // 视频文件上传前 回调
66
   // 视频文件上传前 回调
479
 
484
 
480
         <Form.Item label=" " colon={false}>
485
         <Form.Item label=" " colon={false}>
481
           <AuthButton name="building.detail.save">
486
           <AuthButton name="building.detail.save">
482
-            <Button style={{marginLeft: '6em'}} type="primary" htmlType="submit">
487
+            {!isPublish&&<Button style={{marginLeft: '6em'}} type="primary" htmlType="submit">
483
                 确定
488
                 确定
484
-            </Button>
489
+            </Button>}
485
           </AuthButton>
490
           </AuthButton>
486
           <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>
491
           <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>
487
               取消
492
               取消

+ 3
- 3
src/pages/building/Edit/Channel.jsx View File

12
 const getChannelDict = fetch(apis.channelList.getList)
12
 const getChannelDict = fetch(apis.channelList.getList)
13
 
13
 
14
 const ChannelForm = React.forwardRef((props, ref) => {
14
 const ChannelForm = React.forwardRef((props, ref) => {
15
-  const { form, history, user,institutionId } = props
15
+  const { form, history, user,institutionId,isPublish } = props
16
   const { getFieldDecorator, setFieldsValue, validateFields } = form
16
   const { getFieldDecorator, setFieldsValue, validateFields } = form
17
   const { query } = history.location;
17
   const { query } = history.location;
18
   const { id } = query;
18
   const { id } = query;
81
       {getFieldDecorator('remark', {})(<Input.TextArea row={4} />)}
81
       {getFieldDecorator('remark', {})(<Input.TextArea row={4} />)}
82
       </Form.Item>
82
       </Form.Item>
83
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
83
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
84
-        <AuthButton name="building.channel.save">
84
+       {!isPublish&& <AuthButton name="building.channel.save">
85
           <Button style={{marginLeft: '4em'}} loading={loading} type="primary" htmlType="submit">保存</Button>
85
           <Button style={{marginLeft: '4em'}} loading={loading} type="primary" htmlType="submit">保存</Button>
86
-        </AuthButton>
86
+        </AuthButton>}
87
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
87
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
88
       </Form.Item>
88
       </Form.Item>
89
     </Form>
89
     </Form>

+ 2
- 2
src/pages/building/Edit/News/List.jsx View File

4
 import moment from 'moment'
4
 import moment from 'moment'
5
 
5
 
6
 export default props => {
6
 export default props => {
7
-  const { data = {}, onChangePageNum,loading } = props;
7
+  const { data = {}, onChangePageNum,loading,isPublish } = props;
8
   const { records=[], total, current,size } = data;
8
   const { records=[], total, current,size } = data;
9
 
9
 
10
   const columns = [
10
   const columns = [
29
       dataIndex: 'apartmentId',
29
       dataIndex: 'apartmentId',
30
       key: 'apartmentId',
30
       key: 'apartmentId',
31
       render: (_, record) => (
31
       render: (_, record) => (
32
-        <>
32
+       !isPublish&& <>
33
           <AuthButton name="building.dynamic.edit">
33
           <AuthButton name="building.dynamic.edit">
34
             <Button type="link" onClick={() => props.onEdit(record)}>
34
             <Button type="link" onClick={() => props.onEdit(record)}>
35
               编辑
35
               编辑

+ 4
- 4
src/pages/building/Edit/News/index.jsx View File

8
 import apis from '@/services/apis';
8
 import apis from '@/services/apis';
9
 
9
 
10
 export default props => {
10
 export default props => {
11
-  const { history } = props;
11
+  const { history,isPublish } = props;
12
   const { query } = history.location;
12
   const { query } = history.location;
13
   const { id } = query;
13
   const { id } = query;
14
 
14
 
72
   return (
72
   return (
73
     <div>
73
     <div>
74
       <div>
74
       <div>
75
-        <AuthButton name="building.dynamic.add">
75
+        {!isPublish&&<AuthButton name="building.dynamic.add">
76
           <Button type="primary" onClick={() => setVisible({visible:true})}>
76
           <Button type="primary" onClick={() => setVisible({visible:true})}>
77
             新增动态
77
             新增动态
78
           </Button>
78
           </Button>
79
-        </AuthButton>
79
+        </AuthButton>}
80
       </div>
80
       </div>
81
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess} />
81
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess} />
82
-      <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>
82
+      <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit} isPublish={isPublish}/>
83
     </div>
83
     </div>
84
   );
84
   );
85
 };
85
 };

+ 3
- 3
src/pages/building/Edit/OnSiteService.jsx View File

9
 const { Text } = Typography;
9
 const { Text } = Typography;
10
 
10
 
11
 export default props => {
11
 export default props => {
12
-  const { history,marketingCode } = props;
12
+  const { history,marketingCode,isPublish } = props;
13
   const { query } = history.location;
13
   const { query } = history.location;
14
   const { id } = query;
14
   const { id } = query;
15
 
15
 
97
       key: 'action',
97
       key: 'action',
98
       render: (_, row) => (
98
       render: (_, row) => (
99
         <AuthButton name="building.marketing.delete">
99
         <AuthButton name="building.marketing.delete">
100
-          <Popconfirm title="确认执行取消操作?" onConfirm={() => handleCancel(row)}>
100
+         {!isPublish&& <Popconfirm title="确认执行取消操作?" onConfirm={() => handleCancel(row)}>
101
             <a href="#" style={{ color: 'red' }}>
101
             <a href="#" style={{ color: 'red' }}>
102
               取消绑定
102
               取消绑定
103
             </a>
103
             </a>
104
-          </Popconfirm>
104
+          </Popconfirm>}
105
         </AuthButton>
105
         </AuthButton>
106
       ),
106
       ),
107
     },
107
     },

+ 3
- 3
src/pages/building/Edit/Panorama/List.jsx View File

6
 import AuthButton from '@/components/AuthButton'
6
 import AuthButton from '@/components/AuthButton'
7
 
7
 
8
 export default props => {
8
 export default props => {
9
-  const { data,loading } = props;
9
+  const { data,loading,isPublish } = props;
10
 
10
 
11
   const columns = [
11
   const columns = [
12
     {
12
     {
43
       key: 'apartmentId',
43
       key: 'apartmentId',
44
       render: (_, record) => (
44
       render: (_, record) => (
45
         <AuthButton name="building.panorama.delete">
45
         <AuthButton name="building.panorama.delete">
46
-          <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
46
+          {!isPublish&&<Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
47
             <Button type="link" style={{ color: 'red' }}>
47
             <Button type="link" style={{ color: 'red' }}>
48
               删除
48
               删除
49
             </Button>
49
             </Button>
50
-          </Popconfirm>
50
+          </Popconfirm>}
51
         </AuthButton>
51
         </AuthButton>
52
       ),
52
       ),
53
     },
53
     },

+ 4
- 4
src/pages/building/Edit/Panorama/index.jsx View File

7
 import List from './List';
7
 import List from './List';
8
 
8
 
9
 export default props => {
9
 export default props => {
10
-  const { history } = props;
10
+  const { history ,isPublish} = props;
11
   const { query } = history.location;
11
   const { query } = history.location;
12
   const { id } = query;
12
   const { id } = query;
13
   const [loading, setLoading] = useState(false);
13
   const [loading, setLoading] = useState(false);
73
   return (
73
   return (
74
     <div>
74
     <div>
75
       <div>
75
       <div>
76
-        <AuthButton name="building.panorama.add">
76
+       {!isPublish&& <AuthButton name="building.panorama.add">
77
           <Button type="primary" onClick={() => setVisible(true)}>
77
           <Button type="primary" onClick={() => setVisible(true)}>
78
             新增全景
78
             新增全景
79
           </Button>
79
           </Button>
80
-        </AuthButton>
80
+        </AuthButton>}
81
       </div>
81
       </div>
82
       <Form
82
       <Form
83
         visible={visible}
83
         visible={visible}
86
         onCancel={() => setVisible(false)}
86
         onCancel={() => setVisible(false)}
87
         onSuccess={onSuccess}
87
         onSuccess={onSuccess}
88
       />
88
       />
89
-      <List data={data} loading={loading} onDelete={onDelete} />
89
+      <List data={data} loading={loading} onDelete={onDelete} isPublish={isPublish} />
90
     </div>
90
     </div>
91
   );
91
   );
92
 };
92
 };

+ 21
- 3
src/pages/building/Edit/SpecialRoom/List.jsx View File

7
 import AuthButton from '@/components/AuthButton'
7
 import AuthButton from '@/components/AuthButton'
8
 
8
 
9
 export default (props) => {
9
 export default (props) => {
10
-  const { data = {}, onChangePageNum,loading } = props;
10
+  const { data = {}, onChangePageNum,loading,isPublish } = props;
11
   const { records=[], total, current,size } = data;
11
   const { records=[], total, current,size } = data;
12
   
12
   
13
   const columns = [
13
   const columns = [
39
       key: 'endTime',
39
       key: 'endTime',
40
       render: (_, record) => <span>{moment(record.endTime).format('YYYY-MM-DD')}</span>,
40
       render: (_, record) => <span>{moment(record.endTime).format('YYYY-MM-DD')}</span>,
41
     },
41
     },
42
+    {
43
+      title: '原始价',
44
+      dataIndex: 'originalPrice',
45
+      key: 'originalPrice',
46
+      render: (t) => <span>{`${t || ' -- '} 元`}</span>,
47
+    },
48
+    {
49
+      title: '现价',
50
+      dataIndex: 'currentPrice',
51
+      key: 'currentPrice',
52
+      render: (t) => <span>{`${t || ' -- '} 元`}</span>,
53
+    },
54
+    {
55
+      title: '节省价',
56
+      dataIndex: 'thriftPrice',
57
+      key: 'thriftPrice',
58
+      render: (t) => <span>{`${t || ' -- '} 元`}</span>,
59
+    },
42
     {
60
     {
43
       title: '操作',
61
       title: '操作',
44
       dataIndex: 'apartmentId',
62
       dataIndex: 'apartmentId',
45
       key: 'apartmentId',
63
       key: 'apartmentId',
46
       render: (_, record) => (
64
       render: (_, record) => (
47
-        <>
65
+        !isPublish&& <>
48
           <AuthButton name="building.special.edit">
66
           <AuthButton name="building.special.edit">
49
             <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
67
             <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
50
           </AuthButton>
68
           </AuthButton>
61
     },
79
     },
62
   ]
80
   ]
63
 
81
 
64
-  return (
82
+  return ( 
65
     <Table
83
     <Table
66
     columns={columns}
84
     columns={columns}
67
     dataSource={records}
85
     dataSource={records}

+ 4
- 4
src/pages/building/Edit/SpecialRoom/index.jsx View File

8
 
8
 
9
 export default (props) => {
9
 export default (props) => {
10
 
10
 
11
-  const { history } = props;
11
+  const { history,isPublish } = props;
12
   const { query } = history.location;
12
   const { query } = history.location;
13
   const { id } = query;
13
   const { id } = query;
14
 
14
 
70
   return (
70
   return (
71
     <div>
71
     <div>
72
       <div>
72
       <div>
73
-        <AuthButton name="building.special.add">
73
+        {!isPublish&&<AuthButton name="building.special.add">
74
           <Button type="primary" onClick={() => setVisible({visible:true})}>新增特价房</Button>
74
           <Button type="primary" onClick={() => setVisible({visible:true})}>新增特价房</Button>
75
-        </AuthButton>
75
+        </AuthButton>}
76
       </div>
76
       </div>
77
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess}  />
77
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess}  />
78
-      <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>
78
+      <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit} isPublish={isPublish}/>
79
     </div>
79
     </div>
80
   )
80
   )
81
 }
81
 }

+ 11
- 10
src/pages/building/Edit/index.jsx View File

20
   const { id } = query
20
   const { id } = query
21
   const [institutionId,setInstitutionId] = useState()
21
   const [institutionId,setInstitutionId] = useState()
22
   const [marketingCode,setMarketingCode] = useState('')
22
   const [marketingCode,setMarketingCode] = useState('')
23
+  const [isPublish,setIsPublish] = useState(false)
23
   const target = { id, type: 'building' }
24
   const target = { id, type: 'building' }
24
 
25
 
25
   return (
26
   return (
27
       <Tabs defaultActiveKey="1">
28
       <Tabs defaultActiveKey="1">
28
         <TabPane tab="基础信息" key="1">
29
         <TabPane tab="基础信息" key="1">
29
           <div className={styles['tab-wrapper']} style={{maxWidth: 1000}}>
30
           <div className={styles['tab-wrapper']} style={{maxWidth: 1000}}>
30
-            <Basic {...props}  setMarketingCode={(e)=>setMarketingCode(e)} institutionIdChange={(e)=>setInstitutionId(e)}/>
31
+            <Basic {...props}  setMarketingCode={(e)=>setMarketingCode(e)} institutionIdChange={(e)=>setInstitutionId(e)} isPublish={isPublish} setIsPublish={(e)=>setIsPublish(e)}/>
31
           </div>
32
           </div>
32
         </TabPane>
33
         </TabPane>
33
         <TabPane tab="户型设置" key="2">
34
         <TabPane tab="户型设置" key="2">
34
           <div className={styles['tab-wrapper']}>
35
           <div className={styles['tab-wrapper']}>
35
-            <Apartment {...props} />
36
+            <Apartment {...props} isPublish={isPublish}/>
36
           </div>
37
           </div>
37
         </TabPane>
38
         </TabPane>
38
         <TabPane tab="项目相册" key="3">
39
         <TabPane tab="项目相册" key="3">
39
           <div className={styles['tab-wrapper']}>
40
           <div className={styles['tab-wrapper']}>
40
-            <AlbumList {...props} />
41
+            <AlbumList {...props} isPublish={isPublish}/>
41
           </div>
42
           </div>
42
         </TabPane>
43
         </TabPane>
43
         <TabPane tab="全景照片" key="4">
44
         <TabPane tab="全景照片" key="4">
44
           <div className={styles['tab-wrapper']}>
45
           <div className={styles['tab-wrapper']}>
45
-            <Panorama {...props} />
46
+            <Panorama {...props} isPublish={isPublish} />
46
           </div>
47
           </div>
47
         </TabPane>
48
         </TabPane>
48
         <TabPane tab="项目动态" key="8">
49
         <TabPane tab="项目动态" key="8">
49
           <div className={styles['tab-wrapper']}>
50
           <div className={styles['tab-wrapper']}>
50
-            <News {...props} />
51
+            <News {...props} isPublish={isPublish}/>
51
           </div>
52
           </div>
52
         </TabPane>
53
         </TabPane>
53
         <TabPane tab="特价房源" key="9">
54
         <TabPane tab="特价房源" key="9">
54
           <div className={styles['tab-wrapper']}>
55
           <div className={styles['tab-wrapper']}>
55
-            <SpecialRoom {...props} />
56
+            <SpecialRoom {...props} isPublish={isPublish}/>
56
           </div>
57
           </div>
57
         </TabPane>
58
         </TabPane>
58
         <TabPane tab="渠道设置" key="7">
59
         <TabPane tab="渠道设置" key="7">
59
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
60
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
60
-            <Channel {...props} institutionId={institutionId} />
61
+            <Channel {...props} institutionId={institutionId} isPublish={isPublish}/>
61
           </div>
62
           </div>
62
         </TabPane>
63
         </TabPane>
63
         <TabPane tab="驻场设置" key="10">
64
         <TabPane tab="驻场设置" key="10">
64
           <div className={styles['tab-wrapper']} style={{maxWidth: '1200px'}}>
65
           <div className={styles['tab-wrapper']} style={{maxWidth: '1200px'}}>
65
-            <OnSiteService {...props} marketingCode={marketingCode}/>
66
+            <OnSiteService {...props} marketingCode={marketingCode} isPublish={isPublish}/>
66
           </div>
67
           </div>
67
         </TabPane>
68
         </TabPane>
68
         <TabPane tab="海报图片" key="5">
69
         <TabPane tab="海报图片" key="5">
69
-          <Poster target={target} rights="building.poster.save" {...props} />
70
+          <Poster target={target} rights="building.poster.save" {...props} submitBtn={!isPublish}  />
70
         </TabPane>
71
         </TabPane>
71
         <TabPane tab="分享设置" key="6">
72
         <TabPane tab="分享设置" key="6">
72
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
73
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
73
-            <Share target={target} rights="building.share.save" {...props} />
74
+            <Share target={target} rights="building.share.save" {...props} submitBtn={!isPublish} />
74
           </div>
75
           </div>
75
         </TabPane>
76
         </TabPane>
76
       </Tabs>
77
       </Tabs>