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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
47 deletions
+78
-47
constructor/components/записи реестра/записи реестра.js
constructor/components/записи реестра/записи реестра.js
+78
-47
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,18 +370,26 @@ const registryTable = {
...
@@ -370,18 +370,26 @@ const registryTable = {
},
},
createBody
:
function
()
{
createBody
:
function
()
{
rest
.
synergyGet
(
this
.
getUrl
(),
data
=>
{
try
{
this
.
tBody
.
empty
();
this
.
updateRigths
();
if
(
data
.
errorCode
&&
data
.
errorCode
!=
0
)
{
if
(
!
this
.
allRights
.
includes
(
"
rr_list
"
))
throw
new
Error
(
`Нет прав на просмотр данного реестра`
);
Paginator
.
rows
=
0
;
}
else
{
rest
.
synergyGet
(
this
.
getUrl
(),
data
=>
{
data
.
result
.
forEach
(
item
=>
this
.
tBody
.
append
(
this
.
createRow
(
item
)));
this
.
tBody
.
empty
();
Paginator
.
rows
=
data
.
recordsCount
;
if
(
data
.
errorCode
&&
data
.
errorCode
!=
0
)
{
}
Paginator
.
rows
=
0
;
this
.
calcSum
();
}
else
{
Paginator
.
update
();
data
.
result
.
forEach
(
item
=>
this
.
tBody
.
append
(
this
.
createRow
(
item
)));
tableContainer
.
scrollTop
(
0
);
Paginator
.
rows
=
data
.
recordsCount
;
});
}
this
.
calcSum
();
Paginator
.
update
();
tableContainer
.
scrollTop
(
0
);
});
}
catch
(
err
)
{
console
.
log
(
'
ERROR registryList createBody
'
,
err
);
showMessage
(
err
.
message
,
'
error
'
);
}
},
},
resetHeaderLabel
:
function
(){
resetHeaderLabel
:
function
(){
...
@@ -553,39 +561,66 @@ const registryTable = {
...
@@ -553,39 +561,66 @@ 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
){
this
.
reset
();
try
{
const
registryList
=
await
getRegistryList
();
this
.
reset
();
const
info
=
await
appAPI
.
getRegistryInfo
(
params
.
registryCode
);
const
registryList
=
await
getRegistryList
();
const
info
=
await
appAPI
.
getRegistryInfo
(
params
.
registryCode
);
this
.
registryInfo
=
info
;
this
.
heads
=
info
.
columns
.
filter
(
item
=>
item
.
visible
!=
'
0
'
)
if
(
!
info
||
(
info
.
hasOwnProperty
(
'
rights
'
)
&&
info
.
rights
==
"
no
"
))
throw
new
Error
(
`Нет прав на просмотр данного реестра`
);
.
sort
((
a
,
b
)
=>
{
if
(
a
.
order
==
0
)
return
0
;
return
a
.
order
-
b
.
order
;
})
.
map
(
item
=>
{
return
{
label
:
item
.
label
,
columnID
:
item
.
columnID
}
});
this
.
registryID
=
info
.
registryID
;
this
.
registryInfo
=
info
;
this
.
registryName
=
info
.
name
;
this
.
heads
=
info
.
columns
.
filter
(
item
=>
item
.
visible
!=
'
0
'
)
this
.
registryCode
=
params
.
registryCode
;
.
sort
((
a
,
b
)
=>
{
this
.
allRights
=
registryList
.
find
(
x
=>
x
.
registryCode
==
this
.
registryCode
).
rights
;
if
(
a
.
order
==
0
)
return
0
;
this
.
formCode
=
info
.
formCode
;
return
a
.
order
-
b
.
order
;
})
.
map
(
item
=>
{
return
{
label
:
item
.
label
,
columnID
:
item
.
columnID
}
});
if
(
params
.
filterCode
)
this
.
filterCode
=
params
.
filterCode
;
this
.
registryID
=
info
.
registryID
;
if
(
params
.
searchString
)
this
.
searchString
=
params
.
searchString
;
this
.
registryName
=
info
.
name
;
this
.
registryCode
=
params
.
registryCode
;
this
.
registryRights
=
registryList
.
find
(
x
=>
x
.
registryCode
==
this
.
registryCode
).
rights
;
this
.
registryFilters
=
await
appAPI
.
getRegistryFilters
(
this
.
registryCode
);
this
.
formCode
=
info
.
formCode
;
if
(
params
.
massActions
)
this
.
createMenuActions
(
params
.
massActions
);
if
(
this
.
registryFilters
&&
this
.
registryFilters
.
hasOwnProperty
(
'
errorCode
'
)
&&
this
.
registryFilters
.
errorCode
!=
0
)
throw
new
Error
(
this
.
registryFilters
.
errorMessage
);
if
(
params
.
hasOwnProperty
(
'
sum
'
)
&&
params
.
sum
)
{
if
(
params
.
filterCode
)
this
.
filterCode
=
params
.
filterCode
;
this
.
sum
=
params
.
sum
;
if
(
params
.
searchString
)
this
.
searchString
=
params
.
searchString
;
fire
({
type
:
'
change_label
'
,
text
:
localizedText
(
'
0
'
,
'
0
'
,
'
0
'
,
'
0
'
)},
this
.
sum
.
resultLabel
);
}
if
(
params
.
massActions
)
this
.
createMenuActions
(
params
.
massActions
);
this
.
createHeader
();
if
(
params
.
hasOwnProperty
(
'
sum
'
)
&&
params
.
sum
)
{
Paginator
.
init
();
this
.
sum
=
params
.
sum
;
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
();
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