lu-lowcode-package-form 0.10.34 → 0.10.35

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.10.34",
3
+ "version": "0.10.35",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -71,18 +71,6 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
71
71
  const initData = async (params) => {
72
72
  let item = null
73
73
  const ruleParams = {}
74
- // if (Array.isArray(props?.filterRules)) {
75
- // // 验证关联表字段是否需要重新渲染
76
- // for (let rule of props?.filterRules) {
77
- // let ruleValue;
78
- // if (rule.value.parent === "")
79
- // ruleValue = fieldsValue?.[rule.value.field_key];
80
- // else
81
- // ruleValue = fieldsValue?.[rule.value.parent]?.[fieldName?.[1]]?.[rule.value.field_key];
82
- // if (ruleValue && ruleValue?.value) ruleValue = ruleValue.value;
83
- // ruleParams[rule.column.column_name] = ruleValue ?? "##norequest##";
84
- // }
85
- // }
86
74
  if (request && typeof request === 'function') {
87
75
  debounceFetchOptions(params, ruleParams)
88
76
  }
@@ -119,19 +119,18 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
119
119
  // 验证关联表字段是否需要重新渲染
120
120
  for (let rule of otherProps.filterRules) {
121
121
  let prevFieldValue, curFieldValue;
122
- if (rule?.valueType == "variable") {
123
- if ("parent" in rule?.value && rule.value.parent === "") {
124
- prevFieldValue = prevValues?.[rule.value.field_key];
125
- curFieldValue = curValues?.[rule.value.field_key];
126
- } else {
127
- prevFieldValue = prevValues?.[rule?.value?.parent]?.[field.name]?.[rule?.value?.field_key];
128
- curFieldValue = curValues?.[rule?.value?.parent]?.[field.name]?.[rule?.value?.field_key];
129
- }
122
+ if (rule.valueType != "variable") continue
123
+ if ("parent" in rule?.value && rule.value.parent === "") {
124
+ prevFieldValue = prevValues?.[rule.value.field_key];
125
+ curFieldValue = curValues?.[rule.value.field_key];
126
+ } else {
127
+ prevFieldValue = prevValues?.[rule?.value?.parent]?.[field.name]?.[rule?.value?.field_key];
128
+ curFieldValue = curValues?.[rule?.value?.parent]?.[field.name]?.[rule?.value?.field_key];
129
+ }
130
130
 
131
- if (prevFieldValue !== curFieldValue) {
132
- result = true;
133
- break;
134
- }
131
+ if (prevFieldValue !== curFieldValue) {
132
+ result = true;
133
+ break;
135
134
  }
136
135
  }
137
136
  }
@@ -500,7 +500,8 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
500
500
  ) {
501
501
  // 验证关联表字段是否需要重新渲染
502
502
  for (let rule of props.filterRules) {
503
- if (rule.value.parent != "") continue
503
+ if (rule.valueType != "variable") continue
504
+ if ("parent" in rule?.value && rule.value.parent != "") continue
504
505
  let prevFieldValue, curFieldValue;
505
506
 
506
507
  prevFieldValue = prevValues?.[rule.value.field_key];