魏超 vor 5 Jahren
Ursprung
Commit
1c9f02efb6
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5
    1
      src/pages/eContract/businessConfig/list.jsx

+ 5
- 1
src/pages/eContract/businessConfig/list.jsx Datei anzeigen

@@ -19,6 +19,7 @@ const header = props => {
19 19
   const [data, setData] = useState({})
20 20
   const [demend, setDemend] = useState({})
21 21
   const [contractBusinessList, setContractBusinessList] = useState([])
22
+  const [contractBusinessIndexList, setContractBusinessIndexList] = useState([])
22 23
   const [batchDel, setBatchDel] = useState({visable:false,demandIds:''})
23 24
   const [addDemand, setAddDemand] = useState({visable:false})
24 25
 
@@ -124,9 +125,10 @@ const header = props => {
124 125
   ];
125 126
   
126 127
   const rowSelection = {
128
+    selectedRowKeys: contractBusinessIndexList,
127 129
     onChange: (selectedRowKeys, selectedRows) => {
128
-      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
129 130
       setContractBusinessList(selectedRows)
131
+      setContractBusinessIndexList(selectedRowKeys)
130 132
     },
131 133
   };
132 134
 
@@ -163,6 +165,7 @@ const header = props => {
163 165
   }
164 166
 
165 167
   function batchDelTaContractBusiness(){
168
+    console.log(contractBusinessList)
166 169
     if (contractBusinessList.length <= 0){
167 170
       message.info('请至少选择一条数据')
168 171
       return;
@@ -174,6 +177,7 @@ const header = props => {
174 177
       onOk () {
175 178
         request({ ...apis.taEcontract.batchDelTaContractBusiness, data: {contractBusinessList} }).then((data) => {
176 179
           message.info('操作成功!')
180
+          setContractBusinessIndexList([])
177 181
           getList({ pageNum: 1, pageSize: 10 })
178 182
         }).catch((err) => {
179 183
           console.log('111111', err)