Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
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
ReactWeb5
wisdom-components
Commits
3de2d1f0
Commit
3de2d1f0
authored
Mar 20, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 功能跳转方法
parent
7a9988a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+5
-3
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+4
-1
utils.js
...es/extend-components/EC_ConfigurationView/src/js/utils.js
+21
-0
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
3de2d1f0
...
...
@@ -13,7 +13,7 @@ import TopRotatingTool from './js/RotatingTool';
import
BarLink
from
'./js/BarLink'
;
import
WaterFlowControlView
from
'./js/WaterFlowControlView'
;
import
{
getSketchPadList
,
getSketchPadContent
,
getPointAddress
,
getHistoryInfo
}
from
'./apis'
;
import
{
deepCopy
,
hexToRgba
,
textStyle
,
querySkipUrl
}
from
'./js/utils'
;
import
{
deepCopy
,
hexToRgba
,
textStyle
,
querySkipUrl
,
isJson
}
from
'./js/utils'
;
import
'./index.less'
;
const
goJS
=
go
.
GraphObject
.
make
;
...
...
@@ -794,12 +794,14 @@ const ConfigurationView = (props) => {
};
/** **************************************跳转方法****************************************** */
const menuJumpMethod = (
node
) => {
const menuJumpMethod = (
data
) => {
const opRule = JSON.parse(data.opRule);
const widget = opRule && opRule.widget ? opRule.widget : '';
const params =
opRule && opRule.params ? (isJson(opRule.params) && JSON.parse(opRule.params)) || {} : {};
const list = querySkipUrl(globalConfig?.widgets || [], widget);
if (!list || !widget) return false;
window.history.pushState(
{}
, null, `/civbase/${list.product || '
civweb4
'}/${list.url}`);
window.history.pushState(
params
, null, `/civbase/${list.product || '
civweb4
'}/${list.url}`);
};
/** **************************************历史模态渲染****************************************** */
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
3de2d1f0
...
...
@@ -33,6 +33,7 @@ import {
hexSwitch
,
textStyle
,
querySkipUrl
,
isJson
,
}
from
'./js/utils'
;
import
'./index.less'
;
...
...
@@ -1177,9 +1178,11 @@ const ConfigurationView = (props) => {
const menuJumpMethod = (data) => {
const opRule = JSON.parse(data.opRule);
const widget = opRule && opRule.widget ? opRule.widget : '';
const params =
opRule && opRule.params ? (isJson(opRule.params) && JSON.parse(opRule.params)) || {} : {};
const list = querySkipUrl(globalConfig?.widgets || [], widget);
if (!list || !widget) return false;
window.history.pushState(
{}
, null, `/civbase/${list.product || '
civweb4
'}/${list.url}`);
window.history.pushState(
params
, null, `/civbase/${list.product || '
civweb4
'}/${list.url}`);
};
/** **************************************跳转方法****************************************** */
...
...
packages/extend-components/EC_ConfigurationView/src/js/utils.js
View file @
3de2d1f0
...
...
@@ -98,3 +98,24 @@ export const querySkipUrl = (data, id) => {
}
return
res
;
};
// 判断是否是json
export
const
isJson
=
(
text
)
=>
{
if
(
/^
[\]
,:{}
\s]
*$/
.
test
(
text
.
replace
(
/
\\[
"
\\/
bfnrtu
]
/g
,
'@'
)
.
replace
(
/"
[^
"
\\\n\r]
*"|true|false|null|-
?\d
+
(?:\.\d
*
)?(?:[
eE
][
+-
]?\d
+
)?
/g
,
']'
)
.
replace
(
/
(?:
^|:|,
)(?:\s
*
\[)
+/g
,
''
),
)
)
{
try
{
JSON
.
parse
(
text
);
}
catch
(
e
)
{
return
false
;
}
return
true
;
}
else
{
return
false
;
}
};
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