Просмотр исходного кода

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

傅行帆 5 лет назад
Родитель
Сommit
d05bcc8884

+ 47
- 8
src/pages/carouselFigure/advertisingList.jsx Просмотреть файл

49
       render: (image) => <img src={image} className={styles.imgSmall} />,
49
       render: (image) => <img src={image} className={styles.imgSmall} />,
50
     },
50
     },
51
     {
51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+    },
63
+    {
64
+      title: '关联内容类型',
53
       dataIndex: 'contentType',
65
       dataIndex: 'contentType',
54
       key: 'contentType',
66
       key: 'contentType',
55
       align: 'center',
67
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
68
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '' }</span>
57
     },
69
     },
58
     // {
70
     // {
59
     //   title: '发布位置',
71
     //   title: '发布位置',
74
       dataIndex: 'status',
86
       dataIndex: 'status',
75
       key: 'status',
87
       key: 'status',
76
       align: 'center',
88
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
89
+      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
78
     },
90
     },
79
     {
91
     {
80
       title: '操作',
92
       title: '操作',
84
       render: (x,row) => (
96
       render: (x,row) => (
85
         <>
97
         <>
86
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
98
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
99
+            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
101
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89
           </AuthButton>
102
           </AuthButton>
90
         </>
103
         </>
91
       )
104
       )
110
         });
123
         });
111
   }
124
   }
112
   
125
   
126
+  //删除
127
+const deleteCarouse = (contentId) => () =>{
128
+  Modal.confirm({
129
+    title: '确认删除此数据?',
130
+    okText: '确定',
131
+    cancelText: '取消',
132
+    onOk() {
133
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
134
+            message.info('操作成功!')
135
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
136
+        }).catch((err) => {
137
+            console.log(err)
138
+            message.info(err.msg || err.message)
139
+        })
140
+    },
141
+  });
142
+}
143
+
113
 //   停用启用
144
 //   停用启用
114
   const changeStatus = (row) => () => {
145
   const changeStatus = (row) => () => {
115
       console.log(row)
146
       console.log(row)
175
 
206
 
176
     <>
207
     <>
177
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
208
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
209
+      <Form.Item>
210
+          {getFieldDecorator('cityId')(
211
+             <SelectCity />,
212
+          )}
213
+        </Form.Item>
178
         <Form.Item>
214
         <Form.Item>
179
           {getFieldDecorator('buildingId')(
215
           {getFieldDecorator('buildingId')(
180
             <BuildSelect />,
216
             <BuildSelect />,
186
               <Option value="activity">活动</Option>
222
               <Option value="activity">活动</Option>
187
               <Option value="project">项目</Option>
223
               <Option value="project">项目</Option>
188
               <Option value="news">资讯</Option>
224
               <Option value="news">资讯</Option>
189
-              <Option value="other">其他</Option>
225
+              <Option value="help">助力</Option>
226
+              <Option value="group">拼团</Option>
227
+              <Option value="h5">H5</Option>
228
+              <Option value="">无</Option>
190
             </Select>,
229
             </Select>,
191
           )}
230
           )}
192
         </Form.Item>
231
         </Form.Item>
201
         <Form.Item>
240
         <Form.Item>
202
           {getFieldDecorator('status')(
241
           {getFieldDecorator('status')(
203
             <Select style={{ width: '180px' }} placeholder="状态">
242
             <Select style={{ width: '180px' }} placeholder="状态">
204
-              <Option value="1">启用</Option>
205
-              <Option value="0">停用</Option>
243
+              <Option value="1">已上架</Option>
244
+              <Option value="0">已下架</Option>
206
             </Select>,
245
             </Select>,
207
           )}
246
           )}
208
         </Form.Item>
247
         </Form.Item>

+ 47
- 7
src/pages/carouselFigure/carouselFigureList.jsx Просмотреть файл

49
       render: (x, row) => <img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} />,
49
       render: (x, row) => <img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} />,
50
     },
50
     },
51
     {
51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+    },
63
+    {
64
+      title: '关联内容类型',
53
       dataIndex: 'contentType',
65
       dataIndex: 'contentType',
54
       key: 'contentType',
66
       key: 'contentType',
55
       align: 'center',
67
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
68
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '' }</span>
57
     },
69
     },
58
     {
70
     {
59
       title: '发布位置',
71
       title: '发布位置',
74
       dataIndex: 'status',
86
       dataIndex: 'status',
75
       key: 'status',
87
       key: 'status',
76
       align: 'center',
88
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
89
+      render: (status)=> <><span>{status == 1 ? '已上架' : '已下架'}</span></>
78
     },
90
     },
79
     {
91
     {
80
       title: '操作',
92
       title: '操作',
84
       render: (x,row) => (
96
       render: (x,row) => (
85
         <>
97
         <>
86
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
98
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
99
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer'}} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
101
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89
           </AuthButton>
102
           </AuthButton>
90
         </>
103
         </>
91
       )
104
       )
110
         });
123
         });
111
   }
124
   }
112
   
125
   
126
+//删除
127
+const deleteCarouse = (contentId) => () =>{
128
+  Modal.confirm({
129
+    title: '确认删除此数据?',
130
+    okText: '确定',
131
+    cancelText: '取消',
132
+    onOk() {
133
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
134
+            message.info('操作成功!')
135
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
136
+        }).catch((err) => {
137
+            console.log(err)
138
+            message.info(err.msg || err.message)
139
+        })
140
+    },
141
+  });
142
+}
143
+
113
 //   停用启用
144
 //   停用启用
114
   const changeStatus = (row) => () => {
145
   const changeStatus = (row) => () => {
115
       console.log(row)
146
       console.log(row)
174
 
205
 
175
     <>
206
     <>
176
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
207
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
208
+        <Form.Item>
209
+          {getFieldDecorator('cityId')(
210
+             <SelectCity />,
211
+          )}
212
+        </Form.Item>
177
         <Form.Item>
213
         <Form.Item>
178
           {getFieldDecorator('buildingId')(
214
           {getFieldDecorator('buildingId')(
179
             <BuildSelect />,
215
             <BuildSelect />,
185
               <Option value="activity">活动</Option>
221
               <Option value="activity">活动</Option>
186
               <Option value="project">项目</Option>
222
               <Option value="project">项目</Option>
187
               <Option value="news">资讯</Option>
223
               <Option value="news">资讯</Option>
224
+              <Option value="help">助力</Option>
225
+              <Option value="group">拼团</Option>
226
+              <Option value="h5">H5</Option>
227
+              <Option value="">无</Option>
188
               {/* <Option value="other">其他</Option> */}
228
               {/* <Option value="other">其他</Option> */}
189
             </Select>,
229
             </Select>,
190
           )}
230
           )}
200
         <Form.Item>
240
         <Form.Item>
201
           {getFieldDecorator('status')(
241
           {getFieldDecorator('status')(
202
             <Select style={{ width: '180px' }} placeholder="状态">
242
             <Select style={{ width: '180px' }} placeholder="状态">
203
-              <Option value="1">启用</Option>
204
-              <Option value="0">停用</Option>
243
+              <Option value="1">已上架</Option>
244
+              <Option value="0">已下架</Option>
205
             </Select>,
245
             </Select>,
206
           )}
246
           )}
207
         </Form.Item>
247
         </Form.Item>

+ 5
- 0
src/services/apis.js Просмотреть файл

587
       method: 'PUT',
587
       method: 'PUT',
588
       action: 'admin.extendContent.id.put',
588
       action: 'admin.extendContent.id.put',
589
     },
589
     },
590
+    deleteExtendContent: {
591
+      url: `${prefix}/extendContentDelete/:id`,
592
+      method: 'PUT',
593
+      action: 'admin.extendContent.id.put',
594
+    },
590
     getExtendContent: {
595
     getExtendContent: {
591
       url: `${prefix}/extendContent/:id`,
596
       url: `${prefix}/extendContent/:id`,
592
       method: 'GET',
597
       method: 'GET',