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
3b85ee95
Commit
3b85ee95
authored
Jun 04, 2025
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
компонент РКК документа (_RCC.js) - добавлена проверка подписи
parent
8633bf79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
16 deletions
+153
-16
constructor/scripts/RCC/_RCC.js
constructor/scripts/RCC/_RCC.js
+153
-16
No files found.
constructor/scripts/RCC/_RCC.js
View file @
3b85ee95
...
@@ -228,6 +228,103 @@ const parseChildDocuments = async (childDocuments, parentDocID) => {
...
@@ -228,6 +228,103 @@ const parseChildDocuments = async (childDocuments, parentDocID) => {
return
result
;
return
result
;
}
}
const
renderKeyInfo
=
async
(
eventClick
,
certID
,
documentID
)
=>
{
const
signinfo
=
await
appAPI
.
testSigns
(
certID
,
documentID
);
const
allInfoCert
=
JSON
.
parse
(
signinfo
.
allInfoCert
);
const
content
=
$
(
'
<div>
'
,
{
class
:
'
key-info-overlay
'
});
const
dialog
=
$
(
'
<div>
'
,
{
class
:
'
key-info-dialog
'
});
const
table
=
$
(
'
<table>
'
,
{
style
:
"
font-size: small;
"
});
const
tBody
=
$
(
'
<tbody>
'
);
for
(
const
key
in
allInfoCert
)
{
if
(
key
!=
"
CERT
"
)
{
const
keyTd
=
$
(
"
<td align='right' style='margin: 2px; padding: 6px; font-weight: bold'>
"
).
text
(
key
.
replace
(
/KEY_/g
,
""
));
const
valueTd
=
$
(
"
<td style='padding: 6px'>
"
).
text
(
allInfoCert
[
key
]);
tBody
.
append
(
$
(
"
<tr>
"
).
append
(
keyTd
,
valueTd
));
}
}
content
.
on
(
'
click
'
,
e
=>
{
if
(
$
(
e
.
target
).
hasClass
(
'
key-info-overlay
'
))
content
.
remove
();
});
content
.
css
({
'
position
'
:
'
absolute
'
,
'
left
'
:
'
0
'
,
'
top
'
:
'
0
'
,
'
width
'
:
'
100%
'
,
'
height
'
:
'
100vh
'
,
'
z-index
'
:
'
1000
'
});
dialog
.
css
({
'
position
'
:
'
relative
'
,
'
left
'
:
`
${
eventClick
.
clientX
+
eventClick
.
offsetX
}
px`
,
'
top
'
:
`
${
eventClick
.
clientY
+
eventClick
.
offsetY
}
px`
,
'
width
'
:
'
max-content
'
,
'
max-width
'
:
'
600px
'
,
'
height
'
:
'
auto
'
,
'
border
'
:
'
1px solid #C3D9FF
'
,
'
background
'
:
'
#fff
'
});
table
.
append
(
tBody
);
dialog
.
append
(
table
);
content
.
append
(
dialog
);
$
(
'
body
'
).
append
(
content
);
}
const
parseSignList
=
(
documentID
,
data
)
=>
{
const
result
=
[];
data
.
forEach
((
item
,
i
)
=>
{
const
t
=
[];
let
keyExpiryDate
=
item
.
keyExpiryDate
.
split
(
'
.
'
);
keyExpiryDate
=
`
${
keyExpiryDate
[
1
]}
-
${
keyExpiryDate
[
0
]}
-
${
keyExpiryDate
[
2
]}
`
;
keyExpiryDate
=
new
Date
(
keyExpiryDate
)
>
new
Date
();
const
button
=
$
(
`<a href="" uk-icon="icon: info"></a>`
);
const
span
=
$
(
'
<span>
'
,
{
style
:
"
display: flex; justify-content: space-between;
"
});
span
.
append
(
item
.
nameOgrInfo
,
button
);
button
.
on
(
'
click
'
,
e
=>
{
e
.
preventDefault
();
renderKeyInfo
(
e
,
item
.
certID
,
documentID
);
});
const
fieldKeyExpiryDate
=
$
(
'
<span>
'
);
if
(
keyExpiryDate
)
{
fieldKeyExpiryDate
.
text
(
i18n
.
tr
(
'
Подпись верна
'
));
fieldKeyExpiryDate
.
css
(
'
color
'
,
'
rgb(12, 213, 112)
'
);
}
else
{
fieldKeyExpiryDate
.
text
(
i18n
.
tr
(
'
Публичный ключ устарел
'
));
fieldKeyExpiryDate
.
css
(
'
color
'
,
'
rgb(222, 225, 8)
'
);
}
t
.
push
(
item
.
name
);
t
.
push
(
item
.
date
);
t
.
push
(
span
);
t
.
push
(
`
${
item
.
keyReleaseDate
}
-
${
item
.
keyExpiryDate
}
`
);
t
.
push
(
fieldKeyExpiryDate
);
result
.
push
(
t
);
});
return
result
;
}
const
getSignListTable
=
(
documentID
,
data
)
=>
{
if
(
!
data
||
!
data
.
length
)
return
null
;
const
content
=
$
(
'
<div>
'
);
const
headers
=
[
i18n
.
tr
(
'
ФИО подписавшего
'
),
i18n
.
tr
(
'
Дата подписи
'
),
i18n
.
tr
(
'
Имя, организация на сертификате
'
),
i18n
.
tr
(
'
Срок действия сертификата
'
),
i18n
.
tr
(
'
Результат проверки
'
)];
const
rows
=
parseSignList
(
documentID
,
data
);
const
{
table
}
=
Components
.
createTable
({
headers
,
rows
},
[
'
rcc-table
'
,
'
uk-table-small
'
,
'
uk-table-responsive
'
]);
content
.
append
(
table
);
return
content
;
}
const
getDocHistoryTable
=
data
=>
{
const
getDocHistoryTable
=
data
=>
{
if
(
!
data
||
!
data
.
length
)
return
null
;
if
(
!
data
||
!
data
.
length
)
return
null
;
const
content
=
$
(
'
<div>
'
);
const
content
=
$
(
'
<div>
'
);
...
@@ -365,6 +462,22 @@ this._RCC = class {
...
@@ -365,6 +462,22 @@ this._RCC = class {
});
});
}
}
checkEDSSigns
(){
const
content
=
getSignListTable
(
this
.
documentID
,
this
.
signList
.
formPlayerSigns
);
$
(
content
).
dialog
({
modal
:
true
,
width
:
850
,
height
:
500
,
resizable
:
true
,
title
:
i18n
.
tr
(
"
Проверить ЭЦП
"
),
show
:
{
effect
:
'
fade
'
,
duration
:
500
},
hide
:
{
effect
:
'
fade
'
,
duration
:
500
},
close
:
function
()
{
$
(
this
).
remove
();
}
});
}
async
render
()
{
async
render
()
{
const
rccContainer
=
$
(
'
<div>
'
,
{
class
:
'
rcc_container
'
});
const
rccContainer
=
$
(
'
<div>
'
,
{
class
:
'
rcc_container
'
});
const
rccData
=
$
(
'
<div>
'
,
{
class
:
'
rcc_data
'
});
const
rccData
=
$
(
'
<div>
'
,
{
class
:
'
rcc_data
'
});
...
@@ -411,10 +524,20 @@ this._RCC = class {
...
@@ -411,10 +524,20 @@ this._RCC = class {
// подписи
// подписи
const
signListContent
=
getSignListContent
(
this
.
signList
.
signs
);
const
signListContent
=
getSignListContent
(
this
.
signList
.
signs
);
if
(
signListContent
)
accordionItems
.
push
({
if
(
signListContent
)
{
accordionItems
.
push
({
title
:
i18n
.
tr
(
"
Лист подписей
"
),
title
:
i18n
.
tr
(
"
Лист подписей
"
),
content
:
signListContent
content
:
signListContent
});
});
if
(
this
.
signList
.
hasOwnProperty
(
'
formPlayerSigns
'
)
&&
this
.
signList
.
formPlayerSigns
&&
this
.
signList
.
formPlayerSigns
.
length
)
{
const
checkSignButton
=
$
(
'
<button>
'
,
{
class
:
"
uk-button uk-button-default uk-button-small
"
});
checkSignButton
.
text
(
i18n
.
tr
(
'
Проверить ЭЦП
'
));
signListContent
.
prepend
(
checkSignButton
);
checkSignButton
.
on
(
'
click
'
,
e
=>
{
this
.
checkEDSSigns
();
});
}
}
// утверждения
// утверждения
const
approvalListContent
=
getOtherListContent
(
this
.
signList
.
approval
);
const
approvalListContent
=
getOtherListContent
(
this
.
signList
.
approval
);
...
@@ -450,18 +573,32 @@ this._RCC = class {
...
@@ -450,18 +573,32 @@ this._RCC = class {
}
}
async
init
(){
async
init
(){
Cons
.
showLoader
();
this
.
parentContainer
.
empty
();
try
{
this
.
documentID
=
this
.
docInfo
.
documentID
;
this
.
documentID
=
this
.
docInfo
.
documentID
;
this
.
doctypes
=
await
appAPI
.
getDoctypes
();
this
.
doctypes
=
await
appAPI
.
getDoctypes
();
this
.
docRCC
=
await
appAPI
.
getDocumentRCC
(
this
.
documentID
);
this
.
docRCC
=
await
appAPI
.
getDocumentRCC
(
this
.
documentID
);
this
.
documentHistory
=
await
appAPI
.
getDocumentHistory
(
this
.
documentID
);
//ход выполнения
this
.
documentHistory
=
await
appAPI
.
getDocumentHistory
(
this
.
documentID
);
//ход выполнения
this
.
docChanges
=
await
appAPI
.
getDocChanges
(
this
.
documentID
);
//Изменения в документе
this
.
docChanges
=
await
appAPI
.
getDocChanges
(
this
.
documentID
);
//Изменения в документе
this
.
childDocuments
=
await
appAPI
.
getChildDocuments
(
this
.
documentID
);
// Дочерние документы
this
.
signList
.
signs
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
-
1
);
// подписи
this
.
signList
.
signs
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
-
1
);
// подписи
this
.
signList
.
approval
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
1
);
// утверждения
this
.
signList
.
approval
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
1
);
// утверждения
this
.
signList
.
agreement
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
0
);
// согласования
this
.
signList
.
agreement
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
0
);
// согласования
this
.
signList
.
acquaintance
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
2
);
// ознакомления
this
.
signList
.
acquaintance
=
await
appAPI
.
getSignListXML
(
this
.
documentID
,
2
);
// ознакомления
this
.
childDocuments
=
await
appAPI
.
getChildDocuments
(
this
.
documentID
);
// Дочерние документы
if
(
this
.
docInfo
.
asfDataID
)
{
this
.
signList
.
formPlayerSigns
=
await
appAPI
.
formPlayerGetSigns
(
this
.
docInfo
.
asfDataID
,
-
1
);
// подписи
}
this
.
render
();
this
.
render
();
Cons
.
hideLoader
();
}
catch
(
err
)
{
Cons
.
hideLoader
();
console
.
log
(
'
ERROR _RCC:
'
,
err
.
message
);
showMessage
(
i18n
.
tr
(
err
.
message
),
'
error
'
);
}
}
}
}
}
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