祁鹏飞 4 месяцев назад
Родитель
Сommit
eacea47bc0
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      src/components/ruleCondition/index.vue

+ 9 - 4
src/components/ruleCondition/index.vue

@@ -93,6 +93,12 @@ watch(()=>props.attrIdList, () => {
     })
     attrName.value = ''
     ruleAttr()  //清空搜索框内容 获取完整数据
+  }
+
+})
+
+// 设置已选数据
+const setCheckedData=()=>{
     attractivelist.value = props.attrIdList;//获取编辑数据
     const matchedid = matchDataByIds(attractivelist.value);//
     const matchedinfo = matchDataByInfos(attractivelist.value)
@@ -106,10 +112,7 @@ watch(()=>props.attrIdList, () => {
     checked['SearchDataStore'] = attractivelist.value?.map(item => {
         return item.attrName
     })
-  }
-
-})
-
+}
 const save = () => {
   const mergedData = [
     ...checkeddata.VehicleInformation,
@@ -283,6 +286,8 @@ const ruleAttr = (id='') => {
       dataStore.InsuranceInformation = res.data.InsuranceInformation ? processArray(res.data.InsuranceInformation) : [];
       dataStore.InsuranceCostFactor = res.data.InsuranceCostFactor ? processArray(res.data.InsuranceCostFactor) : [];
       dataStore.SearchDataStore = [...dataStore.VehicleInformation, ...dataStore.VehicleOwnerInformation, ...dataStore.PolicyholderInformation, ...dataStore.InsuredInformation, ...dataStore.InsuranceInformation, ...dataStore.InsuranceCostFactor ]
+      setCheckedData()
+
     }
   });
 }