38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
export default {
|
|
enableBatch() {
|
|
const me = this;
|
|
const ids = me.get('controller.model.data').filter(i => i.checked).map(i => i.id);
|
|
ids.length && me.get('dialog').confirm('确认启用选中项吗?', () => {
|
|
me.get('service').ajaxPost('enable-batch', {
|
|
ids: ids.join(',')
|
|
}).then(() => {
|
|
me.refresh();
|
|
me.get('message').alert('启用成功');
|
|
});
|
|
});
|
|
},
|
|
disableBatch() {
|
|
const me = this;
|
|
const ids = me.get('controller.model.data').filter(i => i.checked).map(i => i.id);
|
|
ids.length && me.get('dialog').confirm('确认禁用选中项吗?', () => {
|
|
me.get('service').ajaxPost('disable-batch', {
|
|
ids: ids.join(',')
|
|
}).then(() => {
|
|
me.refresh();
|
|
me.get('message').alert('禁用成功');
|
|
});
|
|
});
|
|
},
|
|
removeBatch() {
|
|
const me = this;
|
|
const ids = me.get('controller.model.data').filter(i => i.checked).map(i => i.id);
|
|
ids.length && me.get('dialog').confirm('确认删除选中项吗?', () => {
|
|
me.get('service').ajaxPost('remove-batch', {
|
|
ids: ids.join(',')
|
|
}).then(() => {
|
|
me.refresh();
|
|
me.get('message').alert('删除成功');
|
|
});
|
|
});
|
|
}
|
|
} |