Commit 5ffb7eb4 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update _RCC.js - ход выполнения в виде дерева + серым цветом не начавшиеся этапы

parent b65ea849
...@@ -121,29 +121,37 @@ const getDocflowTable = htmlStr => { ...@@ -121,29 +121,37 @@ const getDocflowTable = htmlStr => {
const parseHistory = data => { const parseHistory = data => {
const result = []; const result = [];
const f = d => { const getSpan = (text, started, isPadding) => {
d.forEach(x => { if(!text || text == '') return '';
const span = $('<span>');
span.text(text);
if(!started) span.css('color', '#aaa');
if(isPadding) span.css('padding-left', `${isPadding*15}px`);
return span;
}
const f = (d, funcIndex) => {
d.forEach((x, i) => {
const t = []; const t = [];
const {showInHistory, elementType, name, started, finished, comment, userName, authorName, finishedUser, subProcesses} = x; const {showInHistory, name, started, finished, comment, userName, authorName, finishedUser, subProcesses} = x;
if(showInHistory) { if(showInHistory) {
if(elementType > 0) { t.push(getSpan(name, started, funcIndex));
t.push(`<span style="padding-left: ${elementType * 5}px;">${name}</span>`); t.push(getSpan(userName, started));
} else { t.push(getSpan(authorName, started));
t.push(name); t.push(getSpan(started ? AS.FORMS.DateUtils.formatDate(new Date(started), '${dd}.${mm}.${yy} ${HH}:${MM}') : '', started));
} t.push(getSpan(finished ? AS.FORMS.DateUtils.formatDate(new Date(finished), '${dd}.${mm}.${yy} ${HH}:${MM}') : '', started));
t.push(userName || ''); t.push(getSpan(finishedUser, started));
t.push(authorName || ''); t.push(getSpan(comment, started));
t.push(started ? UTILS.customFormatDate(UTILS.formatDate(new Date(started), true)) : '');
t.push(finished ? UTILS.customFormatDate(UTILS.formatDate(new Date(finished), true)) : '');
t.push(finishedUser || '');
t.push(comment || '');
result.push(t); result.push(t);
if(subProcesses && subProcesses.length) f(subProcesses, funcIndex + 1);
} }
if(subProcesses && subProcesses.length) f(subProcesses);
}); });
} }
f(data); f(data, 0);
return result; return result;
} }
......
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