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
ef570214
Commit
ef570214
authored
Nov 21, 2023
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
записи реестра - добавлена проверка прав на фильтры
parent
f9ef354b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
9 deletions
+40
-9
constructor/components/записи реестра/записи реестра.js
constructor/components/записи реестра/записи реестра.js
+40
-9
No files found.
constructor/components/записи реестра/записи реестра.js
View file @
ef570214
...
@@ -262,7 +262,7 @@ const registryTable = {
...
@@ -262,7 +262,7 @@ const registryTable = {
openDocument
:
function
(
dataRow
,
updateData
=
false
)
{
openDocument
:
function
(
dataRow
,
updateData
=
false
)
{
Cons
.
setAppStore
({
dataRow
:
dataRow
});
Cons
.
setAppStore
({
dataRow
:
dataRow
});
if
(
this
.
allRights
.
in
dexOf
(
'
rr_read
'
)
!==
-
1
)
{
if
(
this
.
allRights
.
in
cludes
(
'
rr_read
'
)
||
this
.
allRights
.
includes
(
'
rr_edit
'
)
)
{
if
(
updateData
)
{
if
(
updateData
)
{
openFormPlayer
(
dataRow
.
dataUUID
,
null
,
()
=>
{
openFormPlayer
(
dataRow
.
dataUUID
,
null
,
()
=>
{
this
.
createBody
();
this
.
createBody
();
...
@@ -370,6 +370,10 @@ const registryTable = {
...
@@ -370,6 +370,10 @@ const registryTable = {
},
},
createBody
:
function
()
{
createBody
:
function
()
{
try
{
this
.
updateRigths
();
if
(
!
this
.
allRights
.
includes
(
"
rr_list
"
))
throw
new
Error
(
`Нет прав на просмотр данного реестра`
);
rest
.
synergyGet
(
this
.
getUrl
(),
data
=>
{
rest
.
synergyGet
(
this
.
getUrl
(),
data
=>
{
this
.
tBody
.
empty
();
this
.
tBody
.
empty
();
if
(
data
.
errorCode
&&
data
.
errorCode
!=
0
)
{
if
(
data
.
errorCode
&&
data
.
errorCode
!=
0
)
{
...
@@ -382,6 +386,10 @@ const registryTable = {
...
@@ -382,6 +386,10 @@ const registryTable = {
Paginator
.
update
();
Paginator
.
update
();
tableContainer
.
scrollTop
(
0
);
tableContainer
.
scrollTop
(
0
);
});
});
}
catch
(
err
)
{
console
.
log
(
'
ERROR registryList createBody
'
,
err
);
showMessage
(
err
.
message
,
'
error
'
);
}
},
},
resetHeaderLabel
:
function
(){
resetHeaderLabel
:
function
(){
...
@@ -553,11 +561,27 @@ const registryTable = {
...
@@ -553,11 +561,27 @@ const registryTable = {
}
}
},
},
updateRigths
:
function
(){
if
(
this
.
filterCode
)
{
const
selectFilter
=
this
.
registryFilters
.
find
(
x
=>
x
.
code
==
this
.
filterCode
);
if
(
selectFilter
)
{
this
.
allRights
=
[...
selectFilter
.
rights
];
}
else
{
this
.
allRights
=
[];
}
}
else
{
this
.
allRights
=
[...
this
.
registryRights
];
}
},
init
:
async
function
(
params
){
init
:
async
function
(
params
){
try
{
this
.
reset
();
this
.
reset
();
const
registryList
=
await
getRegistryList
();
const
registryList
=
await
getRegistryList
();
const
info
=
await
appAPI
.
getRegistryInfo
(
params
.
registryCode
);
const
info
=
await
appAPI
.
getRegistryInfo
(
params
.
registryCode
);
if
(
!
info
||
(
info
.
hasOwnProperty
(
'
rights
'
)
&&
info
.
rights
==
"
no
"
))
throw
new
Error
(
`Нет прав на просмотр данного реестра`
);
this
.
registryInfo
=
info
;
this
.
registryInfo
=
info
;
this
.
heads
=
info
.
columns
.
filter
(
item
=>
item
.
visible
!=
'
0
'
)
this
.
heads
=
info
.
columns
.
filter
(
item
=>
item
.
visible
!=
'
0
'
)
.
sort
((
a
,
b
)
=>
{
.
sort
((
a
,
b
)
=>
{
...
@@ -571,9 +595,12 @@ const registryTable = {
...
@@ -571,9 +595,12 @@ const registryTable = {
this
.
registryID
=
info
.
registryID
;
this
.
registryID
=
info
.
registryID
;
this
.
registryName
=
info
.
name
;
this
.
registryName
=
info
.
name
;
this
.
registryCode
=
params
.
registryCode
;
this
.
registryCode
=
params
.
registryCode
;
this
.
allRights
=
registryList
.
find
(
x
=>
x
.
registryCode
==
this
.
registryCode
).
rights
;
this
.
registryRights
=
registryList
.
find
(
x
=>
x
.
registryCode
==
this
.
registryCode
).
rights
;
this
.
registryFilters
=
await
appAPI
.
getRegistryFilters
(
this
.
registryCode
);
this
.
formCode
=
info
.
formCode
;
this
.
formCode
=
info
.
formCode
;
if
(
this
.
registryFilters
&&
this
.
registryFilters
.
hasOwnProperty
(
'
errorCode
'
)
&&
this
.
registryFilters
.
errorCode
!=
0
)
throw
new
Error
(
this
.
registryFilters
.
errorMessage
);
if
(
params
.
filterCode
)
this
.
filterCode
=
params
.
filterCode
;
if
(
params
.
filterCode
)
this
.
filterCode
=
params
.
filterCode
;
if
(
params
.
searchString
)
this
.
searchString
=
params
.
searchString
;
if
(
params
.
searchString
)
this
.
searchString
=
params
.
searchString
;
...
@@ -584,8 +611,16 @@ const registryTable = {
...
@@ -584,8 +611,16 @@ const registryTable = {
fire
({
type
:
'
change_label
'
,
text
:
localizedText
(
'
0
'
,
'
0
'
,
'
0
'
,
'
0
'
)},
this
.
sum
.
resultLabel
);
fire
({
type
:
'
change_label
'
,
text
:
localizedText
(
'
0
'
,
'
0
'
,
'
0
'
,
'
0
'
)},
this
.
sum
.
resultLabel
);
}
}
this
.
updateRigths
();
if
(
!
this
.
allRights
.
includes
(
"
rr_list
"
))
throw
new
Error
(
`Нет прав на просмотр данного реестра`
);
this
.
createHeader
();
this
.
createHeader
();
Paginator
.
init
();
Paginator
.
init
();
}
catch
(
err
)
{
Cons
.
hideLoader
();
console
.
log
(
'
ERROR init registry list
'
,
err
);
showMessage
(
err
.
message
,
'
error
'
);
}
}
}
}
}
...
@@ -598,13 +633,9 @@ compContainer.off()
...
@@ -598,13 +633,9 @@ compContainer.off()
if
(
!
registryTable
.
registryCode
)
return
;
if
(
!
registryTable
.
registryCode
)
return
;
if
(
Paginator
.
currentPage
!=
1
)
return
;
if
(
Paginator
.
currentPage
!=
1
)
return
;
if
(
e
.
hasOwnProperty
(
'
eventParam
'
))
{
if
(
e
.
hasOwnProperty
(
'
eventParam
'
))
{
let
param
=
e
.
eventParam
;
const
{
filterCode
=
null
,
filterSearchUrl
=
null
}
=
e
.
eventParam
;
if
(
param
.
hasOwnProperty
(
'
filterCode
'
))
{
if
(
filterCode
)
registryTable
.
filterCode
=
filterCode
;
registryTable
.
filterCode
=
param
.
filterCode
;
if
(
filterSearchUrl
)
registryTable
.
filterSearchUrl
=
filterSearchUrl
;
}
if
(
e
.
eventParam
.
hasOwnProperty
(
'
filterSearchUrl
'
))
{
registryTable
.
filterSearchUrl
=
null
;
}
}
}
Paginator
.
currentPage
=
1
;
Paginator
.
currentPage
=
1
;
registryTable
.
createBody
();
registryTable
.
createBody
();
...
...
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