Commit c234b9ae3cca79bd5bc2880cd1e6a6aa77efa368
Merge branch 'fix/DEFECT-1548' into 'main_dev'
fix: 修改默认产品时批量删除按钮隐藏 See merge request yunteng/thingskit-front!871
Showing
1 changed file
with
4 additions
and
3 deletions
| @@ -81,12 +81,12 @@ | @@ -81,12 +81,12 @@ | ||
| 81 | const dataSource = ref<ProfileRecord[]>([]); | 81 | const dataSource = ref<ProfileRecord[]>([]); |
| 82 | 82 | ||
| 83 | const getSelectAllFlag = computed(() => { | 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 | const getCheckedRecord = computed(() => { | 87 | const getCheckedRecord = computed(() => { |
| 88 | return unref(dataSource) | 88 | return unref(dataSource) |
| 89 | - .filter((item) => item.checked) | 89 | + .filter((item) => item.checked && !item.default) |
| 90 | .map((item) => item.id); | 90 | .map((item) => item.id); |
| 91 | }); | 91 | }); |
| 92 | 92 | ||
| @@ -117,6 +117,7 @@ | @@ -117,6 +117,7 @@ | ||
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | const handleCheckCard = (item: ProfileRecord) => { | 119 | const handleCheckCard = (item: ProfileRecord) => { |
| 120 | + if (item.default) return; | ||
| 120 | item.checked = !item.checked; | 121 | item.checked = !item.checked; |
| 121 | }; | 122 | }; |
| 122 | 123 | ||
| @@ -124,7 +125,7 @@ | @@ -124,7 +125,7 @@ | ||
| 124 | dataSource.value = unref(dataSource).map((item) => { | 125 | dataSource.value = unref(dataSource).map((item) => { |
| 125 | return { | 126 | return { |
| 126 | ...item, | 127 | ...item, |
| 127 | - checked: !unref(getSelectAllFlag), | 128 | + checked: !item.default ? !unref(getSelectAllFlag) : false, |
| 128 | }; | 129 | }; |
| 129 | }); | 130 | }); |
| 130 | }; | 131 | }; |