|
@@ -1,6 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="flexWrap" style="align-items: flex-start">
|
3
|
|
-
|
|
3
|
+ {{testList.list}}
|
4
|
4
|
<div class="panel" >
|
5
|
5
|
<div class="title">{{title||'-'}}</div>
|
6
|
6
|
<div class="content">
|
|
@@ -8,7 +8,7 @@
|
8
|
8
|
<el-checkbox v-model="isAllCheck" size="default" @change="val=>allEvent(val)">全选</el-checkbox>
|
9
|
9
|
</div>
|
10
|
10
|
<div class="cItem" v-for="(item,itemIdx) in opionsList" :class="itemIdx == acIdx ? 'active' : ''" @click.stop="ItemClickShowSubEvent(itemIdx,item)">
|
11
|
|
- <el-checkbox v-model="item.isCheck" size="default" @change="ItemClickEvent(itemIdx,item)">{{item.name}}</el-checkbox>
|
|
11
|
+ <el-checkbox v-model="item.isCheck" size="default" @change="val=>ItemClickEvent(itemIdx,item)">{{item.name}}</el-checkbox>
|
12
|
12
|
<el-icon class="lMarauto" color="#606266" :size="14" v-if="item.child&&item.child.length>0"><i-ep-ArrowRight/></el-icon>
|
13
|
13
|
</div>
|
14
|
14
|
</div>
|
|
@@ -17,62 +17,35 @@
|
17
|
17
|
<template v-if="pageInfo.subOpions&&pageInfo.subOpions.length>0">
|
18
|
18
|
<SubList title="选项" :list="pageInfo.subOpions"
|
19
|
19
|
:subId="pageInfo.subId"
|
20
|
|
- @setParentItemCheck="setParentItemCheckEvent"
|
21
|
|
- @echoVal="echoEvent"></SubList>
|
|
20
|
+ @setParentItemCheck="setParentItemCheckEvent"></SubList>
|
22
|
21
|
</template>
|
23
|
22
|
|
24
|
23
|
|
25
|
|
-<!--
|
26
|
|
- <div class="panel">
|
27
|
|
- <div class="title c-000 f12">已选<span>({{pageInfo.chooseOpions&&pageInfo.chooseOpions.length}})</span></div>
|
28
|
|
- <div class="content">
|
29
|
|
- <template v-for="(item,idx) in pageInfo.chooseOpions">
|
30
|
|
- <div class="cItem active tMar8" v-if="item.isCheck">
|
31
|
|
- {{item.name}}
|
32
|
|
- <el-icon class="lMarauto" color="#606266" :size="14" @click="deleEvent(item)"><i-ep-Close/></el-icon>
|
33
|
|
- </div>
|
34
|
|
- <template v-else>
|
35
|
|
- <template v-for="sub in item.child">
|
36
|
|
- <div class="cItem active tMar8" v-if="sub.isCheck">
|
37
|
|
- {{sub.name}}
|
38
|
|
- <el-icon class="lMarauto" color="#606266" :size="14" @click="sub.isCheck = false"><i-ep-Close/></el-icon>
|
39
|
|
- </div>
|
40
|
|
- </template>
|
41
|
|
- </template>
|
42
|
|
- </template>
|
43
|
|
- </div>
|
44
|
|
- </div>
|
45
|
|
--->
|
46
|
|
-
|
47
|
|
-<!-- 写到已选-->
|
48
|
24
|
<div class="panel">
|
49
|
|
- <div class="title c-000 f12">已选<span>({{pageInfo.chooseOpions&&pageInfo.chooseOpions.length}})</span></div>
|
|
25
|
+ <div class="title c-000 f12">已选<span>({{chooseNum}})</span></div>
|
50
|
26
|
<div class="content">
|
51
|
27
|
<template v-for="(item,idx) in opionsList">
|
52
|
28
|
<div class="cItem active tMar8" v-if="item.isCheck">
|
53
|
|
- {{item.name}}
|
|
29
|
+ {{item.name}}-{{item.id}}}
|
54
|
30
|
<el-icon class="lMarauto" color="#606266" :size="14" @click="deleEvent(item)"><i-ep-Close/></el-icon>
|
55
|
31
|
</div>
|
56
|
32
|
<template v-else>
|
57
|
33
|
<template v-for="sub in item.child">
|
58
|
|
- <div class="cItem active tMar8" v-if="sub.isCheck">
|
59
|
|
- {{sub.name}}
|
60
|
|
- <el-icon class="lMarauto" color="#606266" :size="14" @click="sub.isCheck = false"><i-ep-Close/></el-icon>
|
61
|
|
- </div>
|
|
34
|
+ <SubChooseItem :ITEM="sub"></SubChooseItem>
|
62
|
35
|
</template>
|
63
|
36
|
</template>
|
64
|
37
|
</template>
|
65
|
38
|
</div>
|
66
|
39
|
</div>
|
|
40
|
+
|
|
41
|
+
|
67
|
42
|
</div>
|
68
|
43
|
</template>
|
69
|
44
|
<script setup lang="ts">
|
70
|
|
-import {cascaderTs} from "@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/cascader";
|
71
|
|
-import {computed, defineEmits, defineProps, withDefaults} from "vue";
|
72
|
|
-
|
73
|
|
-const emit = defineEmits<{
|
74
|
|
- (event: "echoVal", val: any): void;
|
75
|
|
-}>();
|
|
45
|
+import SubChooseItem from '@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChooseItem.vue'
|
|
46
|
+import {cascaderTs} from "@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index";
|
|
47
|
+import {subChooseTs} from "@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChoose";
|
|
48
|
+import {computed, defineProps, withDefaults, watch, reactive} from "vue";
|
76
|
49
|
|
77
|
50
|
|
78
|
51
|
const props = withDefaults(defineProps<{
|
|
@@ -85,20 +58,90 @@ const props = withDefaults(defineProps<{
|
85
|
58
|
subId:''
|
86
|
59
|
})
|
87
|
60
|
|
|
61
|
+
|
|
62
|
+//已选的个数
|
|
63
|
+const chooseNum = computed(()=>{
|
|
64
|
+ let num:number = 0
|
|
65
|
+ opionsList.value.forEach(item=>{
|
|
66
|
+ if(item.isCheck){
|
|
67
|
+ num+=1
|
|
68
|
+ }else{
|
|
69
|
+ if(item.child&&item.child.length>0){
|
|
70
|
+ item.child.forEach(sub=>{
|
|
71
|
+ if(sub.isCheck){
|
|
72
|
+ num+=1
|
|
73
|
+ }else{
|
|
74
|
+ if(sub.child&&sub.child.length>0){
|
|
75
|
+ sub.child.forEach(sun=>{
|
|
76
|
+ if(sun.isCheck){
|
|
77
|
+ num+=1
|
|
78
|
+ }else{
|
|
79
|
+ if(sun.child&&sun.child.length>0){
|
|
80
|
+ sun.child.forEach(cSun=>{
|
|
81
|
+ if(cSun.isCheck){
|
|
82
|
+ num+=1
|
|
83
|
+ }
|
|
84
|
+ })
|
|
85
|
+ }
|
|
86
|
+ }
|
|
87
|
+ })
|
|
88
|
+ }
|
|
89
|
+ }
|
|
90
|
+ })
|
|
91
|
+ }
|
|
92
|
+ }
|
|
93
|
+ })
|
|
94
|
+ return num
|
|
95
|
+})
|
|
96
|
+
|
|
97
|
+const subChooseNum = (arr:any,numProp:number) => {
|
|
98
|
+ if(arr&&arr.length>0){
|
|
99
|
+ arr.forEach(sub=>{
|
|
100
|
+ if(sub.isCheck){
|
|
101
|
+ numProp+=1
|
|
102
|
+ }else{
|
|
103
|
+ if(sub.child&&sub.child.length>0){
|
|
104
|
+ subChooseNum(sub.child,numProp)
|
|
105
|
+ }
|
|
106
|
+ }
|
|
107
|
+ })
|
|
108
|
+ }
|
|
109
|
+ return numProp
|
|
110
|
+}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
88
|
115
|
const {
|
89
|
116
|
acIdx,
|
90
|
117
|
isAllCheck,
|
91
|
118
|
pageInfo,
|
92
|
|
- chooseNum,
|
93
|
|
- addToChooseList,
|
94
|
119
|
opionsList,
|
95
|
120
|
allEvent,
|
|
121
|
+ updateKey,
|
96
|
122
|
ItemClickShowSubEvent,
|
97
|
123
|
ItemClickEvent,
|
98
|
|
- echoEvent,
|
99
|
|
- deleEvent,
|
100
|
124
|
setParentItemCheckEvent
|
101
|
|
-} = cascaderTs(props,emit)
|
|
125
|
+} = cascaderTs(props)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+const {deleEvent} = subChooseTs()
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+// const testList = reactive<any>({
|
|
132
|
+// list:[]
|
|
133
|
+// })
|
|
134
|
+// //获取选中的集合
|
|
135
|
+// const get_chooseItem = (item:any)=>{
|
|
136
|
+// if(item.isCheck){
|
|
137
|
+// // pageInfo.chooseIds.push(item.id)
|
|
138
|
+// testList.list.push(item.id)
|
|
139
|
+// }else{
|
|
140
|
+// if(item.child&&item.child.length>0){
|
|
141
|
+// get_chooseItem(item.child)
|
|
142
|
+// }
|
|
143
|
+// }
|
|
144
|
+// }
|
102
|
145
|
|
103
|
146
|
</script>
|
104
|
147
|
<style lang="scss" scoped>
|