xieyunhui 2 лет назад
Родитель
Сommit
c3a11ea022
1 измененных файлов с 8 добавлено и 18 удалено
  1. 8 18
      pages/creatingSituations/components/conditionCard.vue

+ 8 - 18
pages/creatingSituations/components/conditionCard.vue

@@ -4,25 +4,13 @@
 		<view class="title">请选择追踪条件(可多选)</view>
 		<view class="container">
 			<view class="card" v-for="(data,index) in list" :key="index">
-				<view class="mark">{{`${index+1}/${list.length}`}}</view>
-				<!-- <view class="cardInner" v-if="item.initialize == 1" v-for="item in data.child">
-					<view :class="[item.required == 1?'cardTitle required':'cardTitle']">{{item.name?item.name:''}}</view>
-					<view :class="[item.child.length>2?'tabWrap multi':'tabWrap']">
-						<view :class="[selectedIds.includes(val.id)?'tab on':'tab']" v-for="val in item.child"
-							@click="tabClickHandle(val,index,item.multiple,item.child,item)">
-							<image v-if="selectedIds.includes(val.id)&&item.child.length>2"
-								src="../../../static/activedGou_white.png" class="bottomMark" mode=""></image>
-							{{val.name}}
-						</view>
-					</view>
-				</view> -->
-
+				<view class="mark">{{`${index+1}/${list.length}`}}</view>	
 				<view class="cardInner" v-for="(item,key) in childContainer[index].list" :key="key">
 					<view :class="[item.required == 1?'cardTitle required':'cardTitle']">{{item.name?item.name:''}}
 					</view>
 					<view :class="[item.child.length>2?'tabWrap multi':'tabWrap']">
-						<view :class="[selectedIds.includes(val.id)?'tab on':'tab']" v-for="(val,index) in item.child"
-						:key="index"
+						<view :class="[selectedIds.includes(val.id)?'tab on':'tab']" v-for="(val,a) in item.child"
+						:key="a"
 							@click="tabClickHandle(val,index,item.multiple,item.child,item)">
 							<image v-if="selectedIds.includes(val.id)&&item.child.length>2"
 								src="../../../static/activedGou_white.png" class="bottomMark" mode=""></image>
@@ -253,7 +241,8 @@
 
 				if (item.subOptions) {
 					//subOptionId 关联子选项id,subOptions是否有关联子级选项
-
+            
+					
 					const childs = this.list[index].child.filter(d => d.id == item.subOptionId);
 					const needDeleteChilds = parts.filter(e => e.id != item.id); //获取同层级需要取消高亮的tab
 					const needDeleteChildIds = needDeleteChilds.map(f => f.id);
@@ -262,8 +251,9 @@
 
 					const filtedChildContainer = this.childContainer[index].list.filter(g => !(needDeleteChildIds.includes(
 						g.id)));
-
-					const positionIndex = filtedChildContainer.findIndex(a => a.id == childs[0].id);
+                    
+					
+					const positionIndex = childs.length>0?filtedChildContainer.findIndex(a => a.id == childs[0].id):-1;
 
 					if (isMulti == 1) {
 						//单选