lu-lowcode-package-form 0.10.6 → 0.10.7

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": "lu-lowcode-package-form",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
package/src/App.jsx CHANGED
@@ -174,61 +174,7 @@ function App() {
174
174
 
175
175
 
176
176
  <FormContainerWrapper cols={cols} className="" ref={formRef} >
177
- <Field.WithSingleSelect
178
- isRequired={true} ref={testRef}
179
- request={async (params) => {
180
- return { code: 0, data: { list: [{ label: '选项1', value: '1', tianchong2: { label: '选项2', value: '2'} ,tcinput1: "1111" , }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }] } }
181
- }}
182
- option_label="label"
183
- option_value="value"
184
- fillRules={[
185
- {
186
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
187
- "type": 0,
188
- "source": "tianchong2",
189
- "target": "tianchong2",
190
- "subRules": [
191
- ]
192
- },
193
- {
194
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
195
- "type": 0,
196
- "source": "tcinput1",
197
- "target": "tcinput1",
198
- "subRules": [
199
- ]
200
- },
201
-
202
- ]} label="测试填充1" __id="tianchong1" />
203
- <Field.WithSingleSelect
204
- isRequired={true} ref={testRef}
205
- request={async (params) => {
206
- return { code: 0, data: { list: [{ label: '选项1', value: '1', }, { label: '选项2', value: '2' ,tcinput1: "8989",tcinput2: "2222" }, { label: '选项3', value: '3' }] } }
207
- }}
208
- option_label="label"
209
- option_value="value"
210
- fillRules={[
211
- {
212
- "id": "636d3924-0298-4e9b-809a-16d4a10d7b29",
213
- "type": 0,
214
- "source": "tcinput1",
215
- "target": "tcinput1",
216
- "subRules": [
217
- ]
218
- },
219
- {
220
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b29",
221
- "type": 0,
222
- "source": "tcinput2",
223
- "target": "tcinput2",
224
- "subRules": [
225
- ]
226
- },
227
-
228
- ]} label="测试填充2" __id="tianchong2" />
229
- <Field.Input label="测试被填充1" __id="tcinput1" />
230
- <Field.Input label="测试被填充2" __id="tcinput2" />
231
-
177
+
232
178
  <Field.UserSelect label="选择用户" __id="userselect" defaultValue={[{ id: 1, username: "十天" }]} />
233
179
  <Layout.FormGroupTitle title={"基本信息"} />
234
180
  <Field.WithSingleSelect
@@ -286,8 +232,69 @@ function App() {
286
232
  <Layout.FormRow layout={'1'}>
287
233
  <Field.Number label="测试规则" isRequired={true} __id="ceshi_rule1" />
288
234
  </Layout.FormRow>
235
+
236
+
289
237
  <Layout.FormRow layout={'1'}>
290
238
  <Field.Table label="子表格" __id="table" >
239
+
240
+ <Field.WithSingleSelect
241
+ isRequired={true} ref={testRef}
242
+ request={async (params) => {
243
+ return { code: 0, data: { list: [{ label: '选项1', value: '1', tianchong2: { label: '选项2', value: '2'} ,tcinput1: "1111" , }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }] } }
244
+ }}
245
+ option_label="label"
246
+ option_value="value"
247
+ fillRules={[
248
+ {
249
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
250
+ "type": 0,
251
+ "source": "tianchong2",
252
+ "target": "tianchong2",
253
+ "subRules": [
254
+ ]
255
+ },
256
+ {
257
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
258
+ "type": 0,
259
+ "source": "tcinput1",
260
+ "target": "tcinput1",
261
+ "subRules": [
262
+ ]
263
+ },
264
+
265
+ ]} label="测试填充1" __id="tianchong1" />
266
+ <Field.WithSingleSelect
267
+ isRequired={true} ref={testRef}
268
+ request={async (params) => {
269
+ console.log("WithSingleSelect params", params)
270
+ if (!params?.label) return { code: 0, data: { list: [{ label: '选项1', value: '1', }] } }
271
+ await new Promise(resolve => setTimeout(resolve, 200))
272
+ return { code: 0, data: { list: [{ label: '选项1', value: '1', }, { label: '选项2', value: '2' ,tcinput1: "8989",tcinput2: "2222" }, { label: '选项3', value: '3' }] } }
273
+ }}
274
+ option_label="label"
275
+ option_value="value"
276
+ option_search="label"
277
+ fillRules={[
278
+ {
279
+ "id": "636d3924-0298-4e9b-809a-16d4a10d7b29",
280
+ "type": 0,
281
+ "source": "tcinput1",
282
+ "target": "tcinput1",
283
+ "subRules": [
284
+ ]
285
+ },
286
+ {
287
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b29",
288
+ "type": 0,
289
+ "source": "tcinput2",
290
+ "target": "tcinput2",
291
+ "subRules": [
292
+ ]
293
+ },
294
+
295
+ ]} label="测试填充2" __id="tianchong2" />
296
+ <Field.Input label="测试被填充1" __id="tcinput1" />
297
+ <Field.Input label="测试被填充2" __id="tcinput2" />
291
298
  <Field.Number label="税率(%)" __id="shuilv_table" withIds={[
292
299
  "shuilv"
293
300
  ]}
@@ -11,7 +11,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
11
11
  const [fetching, setFetching] = useState(false);
12
12
  useEffect(() => {
13
13
  // console.log("SearchSelect useEffect props", props)
14
- // console.log(`SearchSelect ${fieldName} value`, value)
14
+ console.log(`SearchSelect ${fieldName} value`, value)
15
15
  if (value && nOptions.length > 0) {
16
16
  let item = nOptions.find(item => item.value == value?.value || item.value == value)
17
17
  if (item && !isEqual(item, value)){
@@ -23,9 +23,19 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
23
23
  if (!item) loadSelectOptions()
24
24
  }
25
25
  },[value])
26
+ // useEffect(() => {
27
+ // initData(requestParams)
28
+ // }, [requestParams, fieldsValue])
29
+
30
+ // useEffect(() => {
31
+ // console.log("SearchSelect useEffect fieldsValue", fieldsValue)
32
+ // initData(requestParams)
33
+ // }, [fieldsValue])
34
+
26
35
  useEffect(() => {
36
+ console.log("SearchSelect useEffect requestParams", requestParams)
27
37
  initData(requestParams)
28
- }, [requestParams, fieldsValue])
38
+ }, [requestParams])
29
39
  // useEffect(() => {
30
40
  // console.log("WithSingleSelect useEffect fieldsValue",fieldsValue)
31
41
  // if(fieldsValue)
@@ -503,6 +503,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
503
503
  }
504
504
  }
505
505
  }
506
+
506
507
  return result;
507
508
  }}
508
509
  >