Skip to content

Commit 33bc39c

Browse files
yoiteyouCYan1203
andauthored
add confirm for delete (#1293)
* Draft MR * fix(navbar): add confirm for delete --------- Co-authored-by: niuran <[email protected]>
1 parent b370d89 commit 33bc39c

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

frontend/src/components/navbar/Navbar.vue

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -571,15 +571,25 @@
571571
</div>
572572
<div class="flex items-center justify-end gap-[16px]">
573573
<CsgButton
574-
:disabled="!selectAll || selectedItems.length==0"
574+
:disabled="buttonsDisabled"
575575
class="btn btn-link-color btn-md"
576576
@click="allRead()"
577577
:name="$t('navbar.allRead')" />
578-
<CsgButton
579-
:disabled="!selectAll || selectedItems.length==0"
580-
class="btn btn-link-color btn-md"
581-
@click="allClear()"
582-
:name="$t('navbar.allClear')" />
578+
<el-popconfirm
579+
class="box-item"
580+
:title="$t('navbar.clearTip')"
581+
placement="bottom"
582+
width="200"
583+
:confirm-button-text="$t('all.confirm')"
584+
:cancel-button-text="$t('all.cancel')"
585+
@confirm="allClear()">
586+
<template #reference>
587+
<CsgButton
588+
:disabled="buttonsDisabled"
589+
class="btn btn-link-color btn-md"
590+
:name="$t('navbar.allClear')" />
591+
</template>
592+
</el-popconfirm>
583593
</div>
584594
</div>
585595
</div>
@@ -897,6 +907,9 @@
897907
},
898908
releaseHistoryUrl() {
899909
return 'https://opencsg.com/docs/releasenote/csghub_ee_history'
910+
},
911+
buttonsDisabled() {
912+
return !this.selectAll && this.selectedItems.length === 0
900913
}
901914
},
902915
methods: {
@@ -1380,4 +1393,4 @@
13801393
background-color: #d0d5dd;
13811394
border-radius: 3px;
13821395
}
1383-
</style>
1396+
</style>

frontend/src/locales/en_js/navbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ export const navbar = {
6464
allClear:'Achieve',
6565
checkAll:'Select All',
6666
releaseVersion: 'Version',
67+
clearTip:'Clearing all selected messages?',
6768
}

frontend/src/locales/zh_hant_js/navbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ export const navbar = {
130130
allClear:'清除選中',
131131
checkAll:'選擇全部',
132132
releaseVersion: '當前版本',
133+
clearTip:'確認清空您選中的所有消息?',
133134
}

frontend/src/locales/zh_js/navbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ export const navbar = {
6464
allRead:'标为已读',
6565
allClear:'清除选中',
6666
releaseVersion: '当前版本',
67+
clearTip:'确认清空您选中的所有消息?',
6768
}

0 commit comments

Comments
 (0)