Commit 620b501e authored by antoor's avatar antoor

Update the del-shell features

更新删除数据功能
parent c5442207
...@@ -18,7 +18,6 @@ class ContextMenu { ...@@ -18,7 +18,6 @@ class ContextMenu {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
constructor(data, event, id, ids) { constructor(data, event, id, ids) {
console.log('data=', data);
let selectedData = !id || ids.length !== 1; let selectedData = !id || ids.length !== 1;
let selectedMultiData = !id; let selectedMultiData = !id;
...@@ -243,7 +242,23 @@ class ContextMenu { ...@@ -243,7 +242,23 @@ class ContextMenu {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
delData(ids) { delData(ids) {
layer.confirm(
LANG['list']['del']['confirm'](ids.length), {
icon: 2, shift: 6,
title: `<i class="fa fa-trash"></i> ${LANG['list']['del']['title']}`
}, (_) => {
layer.close(_);
const ret = antSword['ipcRenderer'].sendSync('shell-del', ids);
if (typeof(ret) === 'number') {
toastr.success(LANG['list']['del']['success'](ret), LANG_T['success']);
// 更新UI
antSword.modules.shellmanager.reloadData({
category: antSword.modules.shellmanager.category.sidebar.getActiveItem()
});
}else{
toastr.error(LANG['list']['del']['error'](ret.toString()), LANG_T['error']);
}
});
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment