@bit-sun/business-component 1.1.15 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -76,6 +76,7 @@ const SearchSelect = (props: any) => {
76
76
  const [filterRows, setFilterRows] = useState([]); // 存放拼接后的一维数组的变量
77
77
  const [checkedAll, setCheckedAll] = useState(false)
78
78
  const [indeterminate, setIndeterminate] = useState(false)
79
+ const [tableFormParams, setTableFormParams] = useState({});
79
80
 
80
81
  // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
81
82
  const getData = (params={}, type=1) => {
@@ -209,7 +210,7 @@ const SearchSelect = (props: any) => {
209
210
  ctx?.form?.setFieldSource(sourceName, source)
210
211
  setItems(source)
211
212
  }
212
- setIsModalVisible(false);
213
+ handleCancel();
213
214
  };
214
215
 
215
216
  const formaData = (value) => {
@@ -223,6 +224,8 @@ const SearchSelect = (props: any) => {
223
224
  };
224
225
 
225
226
  const handleCancel = () => {
227
+ form.resetFields();
228
+ setTableFormParams({});
226
229
  setIsModalVisible(false);
227
230
  };
228
231
 
@@ -238,17 +241,18 @@ const SearchSelect = (props: any) => {
238
241
 
239
242
  const onSearchTable = () => {
240
243
  const params = form.getFieldsValue();
244
+ setTableFormParams(params);
241
245
  getData({ ...params, pageSize: tableInitPageSize }, 2)
242
246
  }
243
247
 
244
248
  const onResetTable = () => {
245
249
  form.resetFields();
250
+ setTableFormParams({});
246
251
  handleTableChange({ pageSize: tableInitPageSize, currentPage: 1 })
247
252
  }
248
253
 
249
254
  const handleTableChange = (pagination) => {
250
- const params = form.getFieldsValue();
251
- getData({ ...params, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
255
+ getData({ ...tableFormParams, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
252
256
  }
253
257
 
254
258
  const onChangeCheckAll = (e) => {