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
de1ae6bd
Commit
de1ae6bd
authored
Aug 31, 2026
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openDocument - открыте реглинков
parent
1393fd51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
8 deletions
+42
-8
constructor/scripts/openDocument/openDocument.js
constructor/scripts/openDocument/openDocument.js
+42
-8
No files found.
constructor/scripts/openDocument/openDocument.js
View file @
de1ae6bd
...
...
@@ -69,25 +69,31 @@ const canEditFile = async (documentID) => {
});
}
const
getFileModels
=
player
=>
{
const
result
=
[];
const
filteredModels
=
player
=>
{
const
fileModels
=
[];
const
reglinkModels
=
[];
player
.
model
.
models
[
0
].
modelBlocks
[
0
].
forEach
(
block
=>
{
if
(
block
.
asfProperty
.
type
===
"
file
"
)
result
.
push
(
block
);
if
(
block
.
asfProperty
.
type
===
"
file
"
)
fileModels
.
push
(
block
);
if
(
block
.
asfProperty
.
type
===
"
reglink
"
)
reglinkModels
.
push
(
block
);
if
(
block
.
asfProperty
.
type
===
"
table
"
)
{
if
(
block
.
modelBlocks
.
length
>
0
)
{
block
.
modelBlocks
.
forEach
(
row
=>
{
row
.
forEach
(
tableBlock
=>
{
if
(
tableBlock
.
asfProperty
.
type
===
"
file
"
)
result
.
push
(
tableBlock
);
if
(
tableBlock
.
asfProperty
.
type
===
"
file
"
)
fileModels
.
push
(
tableBlock
);
if
(
tableBlock
.
asfProperty
.
type
===
"
reglink
"
)
reglinkModels
.
push
(
tableBlock
);
});
});
}
}
});
return
result
;
return
{
fileModels
,
reglinkModels
};
}
const
initOpenFilesInForm
=
player
=>
{
const
fileModels
=
getFile
Models
(
player
);
const
overrideComponentMethods
=
player
=>
{
const
{
fileModels
,
reglinkModels
}
=
filtered
Models
(
player
);
fileModels
.
forEach
(
fileModel
=>
{
const
props
=
fileModel
.
asfProperty
;
...
...
@@ -111,7 +117,33 @@ const initOpenFilesInForm = player => {
file
.
open
();
});
}
});
reglinkModels
.
forEach
(
reglinkModel
=>
{
const
props
=
reglinkModel
.
asfProperty
;
const
tmpView
=
player
.
view
.
getViewWithId
(
props
.
id
,
props
.
ownerTableId
,
props
.
tableBlockIndex
);
//отключаем все стандартные события
setTimeout
(()
=>
{
player
.
view
.
container
.
find
(
`[data-asformid="reglink.label.
${
props
.
id
}
"]`
).
off
();
reglinkModel
.
on
(
'
valueChange
'
,
()
=>
{
player
.
view
.
container
.
find
(
`[data-asformid="reglink.label.
${
props
.
id
}
"]`
).
off
();
return
null
;
});
},
100
);
//вешаем свое событие
if
(
tmpView
)
{
tmpView
.
container
.
off
().
on
(
'
click
'
,
()
=>
{
if
(
!
reglinkModel
.
value
||
reglinkModel
.
value
==
''
)
return
;
const
eventParam
=
{
type
:
'
document
'
,
documentID
:
reglinkModel
.
value
,
editable
:
false
};
$
(
'
#root-panel
'
).
trigger
({
type
:
'
custom_open_document
'
,
eventParam
});
});
}
});
}
...
...
@@ -1294,6 +1326,8 @@ class ARMDocumentButtons {
this
.
_doc
.
editable
=
!
this
.
_doc
.
editable
;
this
.
_doc
.
formPlayer
.
view
.
setEditable
(
this
.
_doc
.
editable
);
this
.
changcheButtons
();
overrideComponentMethods
(
this
.
_doc
.
formPlayer
);
}
save
(
e
){
...
...
@@ -1765,7 +1799,7 @@ class ARMDocument {
formPanel
.
append
(
playerContainer
,
footer
);
setTimeout
(()
=>
{
initOpenFilesInForm
(
this
.
_doc
.
formPlayer
);
overrideComponentMethods
(
this
.
_doc
.
formPlayer
);
if
(
this
.
_doc
.
matchingParam
)
initMatching
(
this
.
_doc
);
},
1000
);
...
...
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