Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
e097918d
Commit
e097918d
authored
Mar 20, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型基线变更提醒
parent
dcdbd6f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
4 deletions
+51
-4
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+42
-3
index.jsx
src/view/Manage/Model/index.jsx
+1
-1
No files found.
src/model/datamodel.js
View file @
e097918d
...
@@ -632,6 +632,10 @@ export function* joinBranch(payload) {
...
@@ -632,6 +632,10 @@ export function* joinBranch(payload) {
return
yield
call
(
datamodelerService
.
joinBranch
,
payload
)
return
yield
call
(
datamodelerService
.
joinBranch
,
payload
)
}
}
export
function
*
behindAlarmInBranch
(
payload
)
{
return
yield
call
(
datamodelerService
.
behindAlarmInBranch
,
payload
)
}
export
function
*
getCooperationUsers
()
{
export
function
*
getCooperationUsers
()
{
return
yield
call
(
datamodelerService
.
getCooperationUsers
)
return
yield
call
(
datamodelerService
.
getCooperationUsers
)
}
}
...
...
src/service/datamodeler.js
View file @
e097918d
...
@@ -579,6 +579,10 @@ export function joinBranch(payload) {
...
@@ -579,6 +579,10 @@ export function joinBranch(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/joinEasyDataModelerDataModel"
,
payload
)
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/joinEasyDataModelerDataModel"
,
payload
)
}
}
export
function
behindAlarmInBranch
(
payload
)
{
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/easyDataModelerDataModelBehindAlarmInBranch"
,
payload
)
}
/*approval*/
/*approval*/
export
function
getApprovalUsers
(
payload
)
{
export
function
getApprovalUsers
(
payload
)
{
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
e097918d
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
"react"
;
import
{
Tooltip
,
Modal
,
Table
,
Typography
}
from
'antd'
;
import
{
Tooltip
,
Modal
,
Table
,
Typography
,
Button
,
Space
}
from
'antd'
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
ExclamationCircleFilled
}
from
'@ant-design/icons'
;
import
DataGrid
,
{
defaultPageSize
}
from
'../../VirtualTable'
;
import
DataGrid
,
{
defaultPageSize
}
from
'../../VirtualTable'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
...
@@ -142,6 +143,7 @@ const ModelTable = (props) => {
...
@@ -142,6 +143,7 @@ const ModelTable = (props) => {
const [ currentItem, setCurrentItem ] = useState(null);
const [ currentItem, setCurrentItem ] = useState(null);
const [ scrollRowIndex, setScrollRowIndex ] = useState();
const [ scrollRowIndex, setScrollRowIndex ] = useState();
const [resoureTagMap, setResourceTagMap] = useState();
const [resoureTagMap, setResourceTagMap] = useState();
const [behindAlramData, setBehindAlarmData] = useState();
const expandedDataMapRef = useRef(new Map());
const expandedDataMapRef = useRef(new Map());
const shouldScrollRef = useRef(false);
const shouldScrollRef = useRef(false);
...
@@ -173,7 +175,16 @@ const ModelTable = (props) => {
...
@@ -173,7 +175,16 @@ const ModelTable = (props) => {
sortable: true,
sortable: true,
resizable: true,
resizable: true,
formatter(props) {
formatter(props) {
return (<ModelNameColumn text={props.row.name} record={props.row} detailItem={detailItem} />);
return (
<div className='flex' style={{ alignItems: 'center' }}>
{
view === 'branch' && (behindAlramData??[]).indexOf(props.row.id)!== -1 && <Tooltip title='基线模型有变更'>
<Button size='small' type='text' icon={<ExclamationCircleFilled className='pointer' style={{ fontSize: 18, color: '#E94848' }} />} />
</Tooltip>
}
<ModelNameColumn text={props.row.name} record={props.row} detailItem={detailItem} />
</div>
);
}
}
},
},
{
{
...
@@ -297,7 +308,7 @@ const ModelTable = (props) => {
...
@@ -297,7 +308,7 @@ const ModelTable = (props) => {
return newCols;
return newCols;
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [visibleColNames, resoureTagMap, view])
}, [visibleColNames, resoureTagMap, view
, behindAlramData
])
const summarySelectedCount = useMemo(() => {
const summarySelectedCount = useMemo(() => {
let newSelectedRowKeys = Array.from(new Set([...selectedRowKeys, ...expandedSelectedRowKeys]));
let newSelectedRowKeys = Array.from(new Set([...selectedRowKeys, ...expandedSelectedRowKeys]));
...
@@ -367,6 +378,22 @@ const ModelTable = (props) => {
...
@@ -367,6 +378,22 @@ const ModelTable = (props) => {
}, [anchorTimestamp])
}, [anchorTimestamp])
useEffect(() => {
useEffect(() => {
if (view === 'branch' && catalogId) {
getBehindAlarmInBranch();
const interval = setInterval(() => {
getBehindAlarmInBranch();
}, 60*1000);
return () => {
clearInterval(interval);
}
} else {
setBehindAlarmData()
}
}, [view, catalogId])
useEffect(() => {
if (shouldScrollRef.current && gridRef.current && offset!==null && (data||[]).length>0) {
if (shouldScrollRef.current && gridRef.current && offset!==null && (data||[]).length>0) {
setScrollRowIndex(offset);
setScrollRowIndex(offset);
setTimeout(() => {
setTimeout(() => {
...
@@ -399,6 +426,18 @@ const ModelTable = (props) => {
...
@@ -399,6 +426,18 @@ const ModelTable = (props) => {
}
}
}, [data, tagSelectOptions, resoureTagMap])
}, [data, tagSelectOptions, resoureTagMap])
const getBehindAlarmInBranch = () => {
dispatch({
type: 'datamodel.behindAlarmInBranch',
payload: {
id: catalogId,
},
callback: (data) => {
setBehindAlarmData(data)
}
})
}
const getResourceTag = () => {
const getResourceTag = () => {
const ids = (data??[]).map(item => item.id);
const ids = (data??[]).map(item => item.id);
if (ids.length > 0) {
if (ids.length > 0) {
...
...
src/view/Manage/Model/index.jsx
View file @
e097918d
...
@@ -215,7 +215,7 @@ class Model extends React.Component {
...
@@ -215,7 +215,7 @@ class Model extends React.Component {
}
}
onViewChange
=
(
value
)
=>
{
onViewChange
=
(
value
)
=>
{
this
.
setState
({
currentView
:
value
});
this
.
setState
({
currentView
:
value
,
catalogId
:
''
});
}
}
onModelStateChange
=
(
value
)
=>
{
onModelStateChange
=
(
value
)
=>
{
...
...
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