Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
1393fd51
Commit
1393fd51
authored
Aug 19, 2026
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix openDocument & DocumentAttachments - проерка прав на загрузку приложения
parent
c26e0ba3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
30 deletions
+79
-30
constructor/scripts/documentAttachments/documentAttachments.js
...ructor/scripts/documentAttachments/documentAttachments.js
+53
-5
constructor/scripts/openDocument/openDocument.js
constructor/scripts/openDocument/openDocument.js
+26
-25
No files found.
constructor/scripts/documentAttachments/documentAttachments.js
View file @
1393fd51
...
@@ -31,9 +31,26 @@ const canEditFile = async (documentID) => {
...
@@ -31,9 +31,26 @@ const canEditFile = async (documentID) => {
});
});
}
}
const
filterAgrProcesses
=
processes
=>
{
const
procCode
=
[
'
APPROVAL_ITEM
'
,
'
AGREEMENT_ITEM
'
,
'
ACQUAINTANCE_ITEM
'
];
const
result
=
[];
function
search
(
p
)
{
p
.
forEach
(
function
(
process
)
{
if
(
!
process
.
finished
&&
procCode
.
includes
(
process
.
typeID
))
{
result
.
push
(
process
);
}
if
(
process
.
subProcesses
.
length
>
0
)
search
(
process
.
subProcesses
);
});
}
search
(
processes
);
return
result
;
}
this
.
DocumentAttachments
=
class
{
this
.
DocumentAttachments
=
class
{
constructor
(
documentID
,
container
,
notEditable
=
false
){
constructor
(
_doc
,
container
,
notEditable
=
false
){
this
.
documentID
=
documentID
;
this
.
documentID
=
typeof
_doc
==
"
string
"
?
_doc
:
_doc
.
documentID
;
this
.
_doc
=
typeof
_doc
==
"
string
"
?
null
:
_doc
;
this
.
container
=
container
;
this
.
container
=
container
;
this
.
notEditable
=
notEditable
;
this
.
notEditable
=
notEditable
;
this
.
attachmentFilesCount
=
0
;
this
.
attachmentFilesCount
=
0
;
...
@@ -244,7 +261,7 @@ this.DocumentAttachments = class {
...
@@ -244,7 +261,7 @@ this.DocumentAttachments = class {
this
.
tabContainer
.
append
(
this
.
addFileButton
,
this
.
workflowTabs
);
this
.
tabContainer
.
append
(
this
.
addFileButton
,
this
.
workflowTabs
);
}
}
if
(
this
.
canEdit
==
"
false
"
)
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
if
(
!
this
.
canEdit
)
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
this
.
rootContainer
.
append
(
this
.
tabContainer
,
this
.
filesContainer
);
this
.
rootContainer
.
append
(
this
.
tabContainer
,
this
.
filesContainer
);
...
@@ -268,7 +285,7 @@ this.DocumentAttachments = class {
...
@@ -268,7 +285,7 @@ this.DocumentAttachments = class {
this
.
filesWorkContainer
.
removeClass
(
'
active
'
);
this
.
filesWorkContainer
.
removeClass
(
'
active
'
);
this
.
tabWorkContainer
.
removeClass
(
'
active
'
);
this
.
tabWorkContainer
.
removeClass
(
'
active
'
);
this
.
path
=
"
ase:attachmentContainer
"
;
this
.
path
=
"
ase:attachmentContainer
"
;
if
(
this
.
canEdit
==
"
false
"
)
{
if
(
!
this
.
canEdit
)
{
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
this
.
addFileButton
.
addClass
(
'
uk-disabled
'
);
}
else
{
}
else
{
this
.
addFileButton
.
removeClass
(
'
uk-disabled
'
);
this
.
addFileButton
.
removeClass
(
'
uk-disabled
'
);
...
@@ -341,9 +358,40 @@ this.DocumentAttachments = class {
...
@@ -341,9 +358,40 @@ this.DocumentAttachments = class {
return
ul
;
return
ul
;
}
}
async
canEdit
()
{
if
(
this
.
_doc
)
{
const
{
process
,
docInfo
,
workInfo
,
formPlayer
,
registryInfo
}
=
this
.
_doc
;
const
acqAgrProc
=
filterAgrProcesses
(
process
);
if
(
!
formPlayer
)
return
false
;
if
(
!
docInfo
)
return
false
;
if
(
docInfo
.
registered
==
"
true
"
)
return
false
;
if
(
registryInfo
.
rr_edit
!=
"
Y
"
)
return
false
;
if
(
this
.
_doc
.
canEdit
==
"
false
"
)
return
false
;
if
(
workInfo
)
{
const
{
actionID
,
has_subprocesses
,
parent_process
}
=
workInfo
;
const
procCode
=
[
'
approval-single
'
,
'
agreement-single
'
,
'
acquaintance-single
'
];
if
(
procCode
.
includes
(
parent_process
))
return
false
;
if
(
has_subprocesses
==
"
true
"
)
{
const
subworks
=
await
appAPI
.
getSubworks
(
actionID
);
const
filtered
=
subworks
.
filter
(
x
=>
procCode
.
includes
(
x
.
parent_process
));
if
(
filtered
.
length
)
return
false
;
}
}
return
true
;
}
else
{
if
(
this
.
canEditFile
==
"
false
"
)
return
false
;
return
true
;
}
}
async
init
(){
async
init
(){
const
res
=
await
appAPI
.
getDocumentAttachments
(
this
.
documentID
);
const
res
=
await
appAPI
.
getDocumentAttachments
(
this
.
documentID
);
this
.
canEdit
=
await
canEditFile
(
this
.
documentID
);
this
.
canEditFile
=
await
canEditFile
(
this
.
documentID
);
this
.
canEdit
=
await
this
.
canEdit
();
this
.
renderApp
();
this
.
renderApp
();
...
...
constructor/scripts/openDocument/openDocument.js
View file @
1393fd51
...
@@ -569,30 +569,31 @@ const finishWork = async (_doc) => {
...
@@ -569,30 +569,31 @@ const finishWork = async (_doc) => {
}
}
const
openDialogSelectSignType
=
handler
=>
{
const
openDialogSelectSignType
=
handler
=>
{
const
dialog
=
$
(
'
<div class="uk-flex-top" uk-modal>
'
);
handler
(
'
ncalayer
'
);
const
body
=
$
(
'
<div>
'
,
{
class
:
'
uk-modal-dialog uk-modal-body
'
});
// const dialog = $('<div class="uk-flex-top" uk-modal>');
const
header
=
$
(
`<h2 class="uk-modal-title">
${
i18n
.
tr
(
'
Выберите способ подписания
'
)}
</h2>`
);
// const body = $('<div>', {class: 'uk-modal-dialog uk-modal-body'});
// const header = $(`<h2 class="uk-modal-title">${i18n.tr('Выберите способ подписания')}</h2>`);
const
buttonEgov
=
$
(
`<button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom">
${
i18n
.
tr
(
'
Подписать через eGov mobile
'
)}
</button>`
);
const
buttonNcaLayer
=
$
(
`<button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom">
${
i18n
.
tr
(
'
Подписать через NCALayer
'
)}
</button>`
);
// const buttonEgov = $(`<button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom">${i18n.tr('Подписать через eGov mobile')}</button>`);
// const buttonNcaLayer = $(`<button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom">${i18n.tr('Подписать через NCALayer')}</button>`);
dialog
.
append
(
body
);
body
.
append
(
header
,
buttonEgov
,
buttonNcaLayer
);
// dialog.append(body);
// body.append(header, buttonEgov, buttonNcaLayer);
buttonEgov
.
on
(
'
click
'
,
e
=>
{
handler
(
'
egov
'
);
// buttonEgov.on('click', e => {
UIkit
.
modal
(
dialog
).
hide
();
// handler('egov');
});
// UIkit.modal(dialog).hide();
// });
buttonNcaLayer
.
on
(
'
click
'
,
e
=>
{
handler
(
'
ncalayer
'
);
// buttonNcaLayer.on('click', e => {
UIkit
.
modal
(
dialog
).
hide
();
// handler('ncalayer');
});
// UIkit.modal(dialog).hide();
// });
UIkit
.
modal
(
dialog
).
show
();
dialog
.
on
(
'
hidden
'
,
()
=>
{
// UIkit.modal(dialog).show();
dialog
.
remove
();
// dialog.on('hidden', () => {
});
// dialog.remove();
// });
}
}
const
signDocument
=
async
(
_doc
,
signButton
)
=>
{
const
signDocument
=
async
(
_doc
,
signButton
)
=>
{
...
@@ -1979,7 +1980,7 @@ class ARMDocument {
...
@@ -1979,7 +1980,7 @@ class ARMDocument {
new
DocumentComments
(
this
.
_doc
.
documentID
,
null
,
this
.
_doc
.
panels
.
commentsContainer
);
new
DocumentComments
(
this
.
_doc
.
documentID
,
null
,
this
.
_doc
.
panels
.
commentsContainer
);
}
}
new
DocumentAttachments
(
this
.
_doc
.
documentID
,
this
.
_doc
.
panels
.
attachmentContainer
);
new
DocumentAttachments
(
this
.
_doc
,
this
.
_doc
.
panels
.
attachmentContainer
);
this
.
addAttacmentListener
();
this
.
addAttacmentListener
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment