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
86db5220
Commit
86db5220
authored
May 17, 2023
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openFormPlayer - добавлена кнопка активации если маршрут по документу не запущен
parent
16c4792a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
constructor/scripts/openFormPlayer/openFormPlayer.js
constructor/scripts/openFormPlayer/openFormPlayer.js
+40
-4
No files found.
constructor/scripts/openFormPlayer/openFormPlayer.js
View file @
86db5220
const
getContentFromForm
=
async
(
uuid
,
parentContainer
)
=>
{
const
getContentFromForm
=
async
(
uuid
,
run
,
parentContainer
)
=>
{
const
container
=
$
(
'
<div>
'
,
{
style
:
'
width: 100%; overflow: hidden;
'
});
if
(
parentContainer
)
{
container
.
css
(
'
height
'
,
'
100%
'
);
...
...
@@ -13,7 +13,12 @@ const getContentFromForm = async (uuid, parentContainer) => {
const
buttonSave
=
$
(
'
<span class="material-icons wf-icons" style="display: none;">save</span>
'
);
const
buttonPrint
=
$
(
'
<span class="material-icons wf-icons">print</span>
'
);
const
buttonEditable
=
$
(
'
<span class="material-icons wf-icons">edit</span>
'
);
const
buttonActivate
=
$
(
'
<button>
'
,
{
class
:
"
uk-button uk-button-primary uk-button-small uk-hidden
"
});
if
(
run
)
{
buttonActivate
.
text
(
run
.
label
);
buttonActivate
.
removeClass
(
'
uk-hidden
'
);
}
player
.
view
.
container
.
css
({
'
background
'
:
'
#fff
'
});
playerContainer
.
append
(
player
.
view
.
container
);
...
...
@@ -27,7 +32,34 @@ const getContentFromForm = async (uuid, parentContainer) => {
}
else
{
player
.
saveFormData
(
result
=>
{
showMessage
(
i18n
.
tr
(
'
Данные сохранены
'
),
'
success
'
);
appAPI
.
modifyDoc
(
player
.
model
.
asfDataId
);
if
(
!
run
)
appAPI
.
modifyDoc
(
player
.
model
.
asfDataId
);
Cons
.
hideLoader
();
});
}
});
buttonActivate
.
on
(
'
click
'
,
e
=>
{
Cons
.
showLoader
();
if
(
!
player
.
model
.
isValid
())
{
showMessage
(
i18n
.
tr
(
'
Заполните обязательные поля
'
),
'
error
'
);
Cons
.
hideLoader
();
}
else
{
player
.
saveFormData
(
async
result
=>
{
await
appAPI
.
activateDoc
(
player
.
model
.
asfDataId
);
showMessage
(
i18n
.
tr
(
'
Данные сохранены
'
),
'
success
'
);
editable
=
false
;
player
.
view
.
setEditable
(
editable
);
buttonEditable
.
text
(
'
edit
'
);
buttonPrint
.
show
();
if
(
player
.
model
.
hasChanges
)
{
buttonSave
.
show
();
}
else
{
buttonSave
.
hide
();
}
buttonActivate
.
addClass
(
'
uk-hidden
'
);
Cons
.
hideLoader
();
});
}
...
...
@@ -60,7 +92,7 @@ const getContentFromForm = async (uuid, parentContainer) => {
});
buttonsPanel
.
append
(
$
(
'
<div>
'
).
append
(
buttonSave
,
buttonPrint
),
$
(
'
<div>
'
).
append
(
buttonSave
,
buttonPrint
,
buttonActivate
),
$
(
'
<div>
'
).
append
(
buttonEditable
)
);
...
...
@@ -70,8 +102,12 @@ const getContentFromForm = async (uuid, parentContainer) => {
this
.
openFormPlayer
=
async
(
uuid
,
parentContainer
=
null
,
closeDialogHandler
)
=>
{
Cons
.
showLoader
();
const
{
container
:
body
,
player
}
=
await
getContentFromForm
(
uuid
,
parentContainer
);
const
documentID
=
await
AS
.
FORMS
.
ApiUtils
.
getDocumentIdentifier
(
uuid
);
const
docActions
=
await
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
`rest/api/docflow/document_actions?documentID=
${
documentID
}
&locale=
${
AS
.
OPTIONS
.
locale
}
`
);
const
run
=
docActions
.
find
(
x
=>
x
.
operation
==
'
RUN
'
);
const
meaning
=
await
appAPI
.
getDocMeaningContent
(
uuid
)
||
'
Документ
'
;
const
{
container
:
body
,
player
}
=
await
getContentFromForm
(
uuid
,
run
,
parentContainer
);
if
(
parentContainer
)
{
parentContainer
.
empty
();
...
...
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