zhoulisen 5 gadus atpakaļ
vecāks
revīzija
7fecfe63ca

+ 7
- 4
src/pages/resource/openScreen/edit.jsx Parādīt failu

@@ -24,6 +24,9 @@ const header = props => {
24 24
     useEffect(() => {
25 25
 
26 26
         setVisible(false)
27
+        setsample({
28
+            sampleNme : ''
29
+        })
27 30
         if (noticeId) {
28 31
             console.log(noticeId, 'noticeId')
29 32
             getNewsData(noticeId)
@@ -261,10 +264,10 @@ const header = props => {
261 264
         },
262 265
         {
263 266
             label: '关联业务',
264
-            name: 'targetId',
267
+            name: 'targetName',
265 268
             // value: data.targetId,
266 269
             //   type: FieldTypes.Text,
267
-            render: <div onClick={e => handleShowModel(data.targetId)}>{sample.sampleName || '选择关联业务'}</div>,
270
+        render: <div onClick={e => handleShowModel(data.targetId)}>{sample.sampleName || '选择关联业务'}{console.log(sample,'13')}</div>,
268 271
         },
269 272
         {
270 273
             label: '发布状态',
@@ -282,7 +285,7 @@ const header = props => {
282 285
                 name: "已上架",
283 286
                 value: "1"
284 287
             },],
285
-            value: data.status === null ? null : data.status + "",
288
+            value: data.status === undefined ? null : data.status + "",
286 289
 
287 290
             rules: [
288 291
                 { required: true, message: '请选择有效发布状态' },
@@ -342,7 +345,7 @@ const header = props => {
342 345
 
343 346
     const cancelPage = () => {
344 347
         router.push({
345
-            pathname: '/resource/pathname',
348
+            pathname: '/resource/openScreen',
346 349
         });
347 350
     }
348 351
 

+ 19
- 10
src/pages/resource/openScreen/index.jsx Parādīt failu

@@ -46,7 +46,7 @@ function header(props) {
46 46
     const toDelBatch = rowData => () => {
47 47
         console.log(taNoticeList, 'taNoticeList')
48 48
         if (taNoticeList.length < 1) {
49
-            openNotificationWithIcon('error', '请先选择需要删除的批次')
49
+            // openNotificationWithIcon('error', '请先选择需要删除的批次')
50 50
             return
51 51
         }
52 52
 
@@ -58,19 +58,14 @@ function header(props) {
58 58
                 request({ ...apis.openScreen.delete, data: taNoticeList, }).then((data) => {
59 59
                   message.info("操作成功")
60 60
                   getList({ pageNum: 1, pageSize: 10 });
61
+               
62
+                //   setHouseIdList([])
61 63
                 }).catch((err) => {
62 64
                 })
63 65
             },
64 66
         });
65 67
     }
66 68
 
67
-    const rowSelection = {
68
-        onChange: (selectedRowKeys, selectedRows) => {
69
-            console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
70
-            setTaNoticeList(selectedRows)
71
-        },
72
-    };
73
-
74 69
     const changePageNum = pageNumber => {
75 70
         getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
76 71
     }
@@ -148,7 +143,21 @@ function header(props) {
148 143
         },
149 144
     ];
150 145
 
146
+    // const onSelectChange = (selectedRowKeys, selectedRows) => {
147
+    //     console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
148
+    //     setTaNoticeList(selectedRows)
149
+    //     // this.setState({ selectedRowKeys });
150
+    //   };
151
+
151 152
     const { getFieldDecorator } = props.form
153
+
154
+    const rowSelection = {
155
+        onChange: (selectedRowKeys, selectedRows) => {
156
+          console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
157
+          setTaNoticeList(selectedRows)
158
+        },
159
+      };
160
+ 
152 161
     return (
153 162
 
154 163
         <>
@@ -207,8 +216,8 @@ function header(props) {
207 216
 
208 217
                 <Button type="primary" className={styles.addBtn} onClick={toDelBatch()} style={{ marginLeft: '30px' }} >删除</Button>
209 218
 
210
-                <Table rowSelection={rowSelection} rowKey="taNoticeList" dataSource={data.records} columns={columns} pagination={false} />
211
-
219
+                <Table id='noticeTable' rowSelection={rowSelection} rowKey={r => r.noticeId} dataSource={data.records} columns={columns} pagination={false} />
220
+                {/* selectedRowKeys */}
212 221
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
213 222
                     <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} />
214 223
                 </div>