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
dd9aa4db
Commit
dd9aa4db
authored
May 29, 2025
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openDocument.js - добавлено просмотр и актуализация версии данных по форме
parent
097c4429
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
1 deletion
+84
-1
constructor/scripts/openDocument/openDocument.js
constructor/scripts/openDocument/openDocument.js
+84
-1
No files found.
constructor/scripts/openDocument/openDocument.js
View file @
dd9aa4db
const
getDialogParam
=
()
=>
{
const
minWidth
=
500
;
const
minHeight
=
200
;
const
maxWidth
=
$
(
document
).
width
()
*
0.9
;
const
maxHeight
=
$
(
document
).
height
()
*
0.9
;
const
width
=
$
(
document
).
width
()
*
0.8
;
const
height
=
$
(
document
).
height
()
*
0.8
;
return
{
minWidth
,
minHeight
,
maxWidth
,
maxHeight
,
width
,
height
};
}
const
createDialog
=
(
dialogTitle
,
body
)
=>
{
const
{
minWidth
,
minHeight
,
maxWidth
,
maxHeight
,
width
,
height
}
=
getDialogParam
();
const
dialog
=
$
(
'
<div>
'
);
dialog
.
dialog
({
modal
:
true
,
title
:
dialogTitle
,
width
:
width
,
height
:
height
,
minWidth
:
minWidth
,
minHeight
:
minHeight
,
maxWidth
:
maxWidth
,
maxHeight
:
maxHeight
,
resizable
:
true
,
show
:
{
effect
:
'
fade
'
,
duration
:
300
},
hide
:
{
effect
:
'
fade
'
,
duration
:
300
}
});
dialog
.
on
(
'
dialogclose
'
,
()
=>
{
dialog
.
remove
();
});
dialog
.
append
(
body
);
return
dialog
;
}
const
getFileModels
=
player
=>
{
const
getFileModels
=
player
=>
{
const
result
=
[];
const
result
=
[];
player
.
model
.
models
[
0
].
modelBlocks
[
0
].
forEach
(
block
=>
{
player
.
model
.
models
[
0
].
modelBlocks
[
0
].
forEach
(
block
=>
{
...
@@ -1393,15 +1431,58 @@ class ARMDocument {
...
@@ -1393,15 +1431,58 @@ class ARMDocument {
const
lastTd
=
$
(
'
<td>
'
);
const
lastTd
=
$
(
'
<td>
'
);
const
buttonViewVersion
=
$
(
'
<button>
'
,
{
class
:
'
uk-button uk-button-default uk-button-small button-switch pressed
'
});
const
buttonDownloadVersion
=
$
(
'
<button>
'
,
{
class
:
'
uk-button uk-button-default uk-button-small button-switch pressed
'
});
const
buttonDownloadVersion
=
$
(
'
<button>
'
,
{
class
:
'
uk-button uk-button-default uk-button-small button-switch pressed
'
});
const
buttonSetVersionCurrent
=
$
(
'
<button>
'
,
{
class
:
'
uk-button uk-button-default uk-button-small button-switch pressed
'
});
buttonViewVersion
.
text
(
i18n
.
tr
(
'
Просмотр
'
));
buttonDownloadVersion
.
text
(
i18n
.
tr
(
'
Скачать
'
));
buttonDownloadVersion
.
text
(
i18n
.
tr
(
'
Скачать
'
));
buttonSetVersionCurrent
.
text
(
i18n
.
tr
(
'
Сделать актуальной
'
));
buttonViewVersion
.
on
(
'
click
'
,
async
e
=>
{
e
.
preventDefault
();
e
.
target
.
blur
();
const
versionAsfData
=
await
appAPI
.
getFile
(
item
.
identifier
,
'
json
'
);
const
versionFormPlayer
=
UTILS
.
getSynergyPlayer
(
versionAsfData
.
uuid
,
false
,
versionAsfData
.
version
);
createDialog
(
i18n
.
tr
(
'
Просмотр
'
),
versionFormPlayer
.
view
.
container
);
});
buttonDownloadVersion
.
on
(
'
click
'
,
e
=>
{
buttonDownloadVersion
.
on
(
'
click
'
,
e
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
target
.
blur
();
e
.
target
.
blur
();
UTILS
.
fileDownload
(
`
${
fullName
}
.asfdocx`
,
item
.
identifier
);
UTILS
.
fileDownload
(
`
${
fullName
}
.asfdocx`
,
item
.
identifier
);
});
});
lastTd
.
append
(
buttonDownloadVersion
);
buttonSetVersionCurrent
.
on
(
'
click
'
,
async
e
=>
{
e
.
preventDefault
();
e
.
target
.
blur
();
Cons
.
showLoader
();
try
{
const
versionAsfData
=
await
appAPI
.
getFile
(
item
.
identifier
,
'
json
'
);
const
newAsfData
=
versionAsfData
.
data
.
filter
(
x
=>
x
.
type
!=
'
label
'
);
const
mergeResult
=
await
appAPI
.
mergeFormData
({
uuid
:
this
.
_doc
.
dataUUID
,
data
:
newAsfData
});
if
(
!
mergeResult
)
throw
new
Error
(
'
Произошла ошибка актуализации версии данных
'
);
if
(
mergeResult
.
errorCode
!=
0
&&
mergeResult
.
hasOwnProperty
(
'
errorMessage
'
))
throw
new
Error
(
mergeResult
.
errorMessage
);
this
.
_doc
.
formPlayer
.
showFormData
(
null
,
null
,
this
.
_doc
.
dataUUID
,
null
);
const
table
=
await
this
.
getFileVersions
();
this
.
_doc
.
panels
.
formVersionContent
.
empty
().
append
(
table
);
Cons
.
hideLoader
();
}
catch
(
err
)
{
Cons
.
hideLoader
();
UIkit
.
notification
.
closeAll
();
showMessage
(
i18n
.
tr
(
err
.
message
),
'
error
'
);
}
});
lastTd
.
append
(
buttonViewVersion
,
buttonDownloadVersion
,
buttonSetVersionCurrent
);
tr
.
append
(
lastTd
);
tr
.
append
(
lastTd
);
});
});
}
}
...
@@ -1420,6 +1501,8 @@ class ARMDocument {
...
@@ -1420,6 +1501,8 @@ class ARMDocument {
const
table
=
await
this
.
getFileVersions
();
const
table
=
await
this
.
getFileVersions
();
content
.
append
(
table
);
content
.
append
(
table
);
this
.
_doc
.
panels
.
formVersionContent
=
content
;
return
{
container
,
button
,
content
};
return
{
container
,
button
,
content
};
}
}
...
...
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