Showing
1 changed file
with
4 additions
and
3 deletions
... | ... | @@ -81,12 +81,12 @@ |
81 | 81 | const dataSource = ref<ProfileRecord[]>([]); |
82 | 82 | |
83 | 83 | const getSelectAllFlag = computed(() => { |
84 | - return unref(dataSource).every((item) => item.checked); | |
84 | + return unref(dataSource).every((item) => item.checked || item.default); | |
85 | 85 | }); |
86 | 86 | |
87 | 87 | const getCheckedRecord = computed(() => { |
88 | 88 | return unref(dataSource) |
89 | - .filter((item) => item.checked) | |
89 | + .filter((item) => item.checked && !item.default) | |
90 | 90 | .map((item) => item.id); |
91 | 91 | }); |
92 | 92 | |
... | ... | @@ -117,6 +117,7 @@ |
117 | 117 | }; |
118 | 118 | |
119 | 119 | const handleCheckCard = (item: ProfileRecord) => { |
120 | + if (item.default) return; | |
120 | 121 | item.checked = !item.checked; |
121 | 122 | }; |
122 | 123 | |
... | ... | @@ -124,7 +125,7 @@ |
124 | 125 | dataSource.value = unref(dataSource).map((item) => { |
125 | 126 | return { |
126 | 127 | ...item, |
127 | - checked: !unref(getSelectAllFlag), | |
128 | + checked: !item.default ? !unref(getSelectAllFlag) : false, | |
128 | 129 | }; |
129 | 130 | }); |
130 | 131 | }; | ... | ... |