Commit 26f7d817 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

канбан-доска - массовые действия

parent 58bc7b18
...@@ -469,7 +469,30 @@ const KanbanBoard = { ...@@ -469,7 +469,30 @@ const KanbanBoard = {
} }
}, },
createMenuActions: function(massActions){
const {containerID, items} = massActions;
const menuContainer = $('<div uk-dropdown="mode: click">');
const nav = $('<ul>', {class: 'uk-nav uk-dropdown-nav'});
menuContainer.append(nav);
$(`#${containerID}`).append(menuContainer);
items.forEach(item => {
const {name, handler, className = ''} = item;
const navItem = $(`<li class="action-menu-item uk-disabled ${className}"><a href="#">${name}</a></li>`);
nav.append(navItem);
navItem.on('click', e => {
handler(this.selectedItems, () => {
this.reset();
this.render();
});
});
});
},
reset: function(){ reset: function(){
this.selectedItems = [];
this.columns.forEach(column => column.currentPage = 0); this.columns.forEach(column => column.currentPage = 0);
}, },
...@@ -484,7 +507,8 @@ const KanbanBoard = { ...@@ -484,7 +507,8 @@ const KanbanBoard = {
fieldDict, fieldDict,
countInPart = 5, countInPart = 5,
sum, sum,
searchString = null searchString = null,
massActions
} = params; } = params;
if(!registryCode) throw new Error(`Не передан параметр registryCode`); if(!registryCode) throw new Error(`Не передан параметр registryCode`);
...@@ -520,6 +544,8 @@ const KanbanBoard = { ...@@ -520,6 +544,8 @@ const KanbanBoard = {
const saveParam = sessionStorage.getItem(`filterParam_${Cons.getCurrentPage().code}_${AS.OPTIONS.currentUser.userid}`); const saveParam = sessionStorage.getItem(`filterParam_${Cons.getCurrentPage().code}_${AS.OPTIONS.currentUser.userid}`);
if(!saveParam) this.render(); if(!saveParam) this.render();
if(massActions) this.createMenuActions(massActions);
Cons.hideLoader(); Cons.hideLoader();
} else { } else {
throw new Error(`Не найдено реестра с кодом: ${registryCode}`); throw new Error(`Не найдено реестра с кодом: ${registryCode}`);
......
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