zmdms-webui 2.6.6 → 2.6.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.
|
@@ -215,14 +215,15 @@ var DynamicDrawer = function (props, ref) {
|
|
|
215
215
|
});
|
|
216
216
|
newDynamicList[pIndex].children = changeCList;
|
|
217
217
|
// 联动父元素
|
|
218
|
-
|
|
219
|
-
changeCList.
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
// const allChildrenChecked =
|
|
219
|
+
// changeCList.length > 0 && changeCList.every((child) => child.checked);
|
|
220
|
+
var someChildrenChecked = changeCList.some(function (child) { return child.checked; });
|
|
221
|
+
if (someChildrenChecked) {
|
|
222
|
+
// 只要有子元素选中,父元素就应该是 checked = true
|
|
222
223
|
newDynamicList[pIndex].checked = true;
|
|
223
224
|
}
|
|
224
225
|
else {
|
|
225
|
-
//
|
|
226
|
+
// 所有子元素都不选中,父元素才取消选中
|
|
226
227
|
newDynamicList[pIndex].checked = false;
|
|
227
228
|
}
|
|
228
229
|
setTempDynamicList(sortDynamicListByType(newDynamicList));
|