祁鹏飞 3 месяцев назад
Родитель
Сommit
5d62e19488
1 измененных файлов с 1 добавлено и 15 удалено
  1. 1 15
      src/components/ruleConditionContainer/index.vue

+ 1 - 15
src/components/ruleConditionContainer/index.vue

@@ -182,22 +182,8 @@ const licenseNoSelect = (e, item) => {
   }
 }
 
-const checkAll = ref(false)
-const indeterminate = ref(false)
-watch(() => props.rulesAttrList, (val) => {
-  if (val.length === 0) {
-    checkAll.value = false
-    indeterminate.value = false
-  } else if (val.length === cities.value.length) {
-    checkAll.value = true
-    indeterminate.value = false
-  } else {
-    indeterminate.value = true
-  }
-})
-
+/** 处理全选/取消全选操作,根据选中状态设置当前项的所有子选项。选中时将字典标签映射为值数组(车辆类型取 code,其余取 name),取消选中时清空数组,同时重置半选状态 */
 const handleCheckAll = (item, index: number, val: boolean) => {
-
   item.indeterminate = false
   if (val) {
     item.minArray = item.dictLabal.map((_) => _.attrName == '车辆类型' ? _.code : _.name)