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
20137a97
Commit
20137a97
authored
Aug 04, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 组态增加源数据
parent
97b89ce9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
169 additions
and
3 deletions
+169
-3
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+118
-1
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+51
-2
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
20137a97
...
...
@@ -762,7 +762,7 @@ const ConfigurationView = (props) => {
nameTypeList: sensors.map((item) => {
const listType = statisticType.find((arr) => {
return arr.name === item;
})
})
;
return {
name: item,
type: listType?.type || '
Sub
',
...
...
@@ -1607,6 +1607,123 @@ const ConfigurationView = (props) => {
),
);
// 数据源模型定义
myDiagram.nodeTemplateMap.add(
'dataSource',
goJS(
go.Node,
'Auto',
nodeStyle(),
'Spot',
{ locationSpot: go.Spot.Center, zOrder: 3, cursor: 'default', visible: false },
new go.Binding('zOrder', 'zOrder').makeTwoWay(),
new go.Binding('cursor', 'cursor').makeTwoWay(),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('angle').makeTwoWay(),
goJS(
go.Shape,
'RoundedRectanglePlus',
{ name: 'SHAPE', strokeWidth: 10, stroke: '#000000', parameter1: 0 },
new go.Binding('fill', 'fillColor').makeTwoWay(),
new go.Binding('stroke').makeTwoWay(),
new go.Binding('strokeWidth').makeTwoWay(),
new go.Binding('parameter1', 'radius').makeTwoWay(),
new go.Binding('desiredSize', 'size', go.Size.parse).makeTwoWay(go.Size.stringify),
),
goJS(
go.TextBlock,
textStyle(),
{
maxSize: new go.Size(NaN, NaN),
minSize: new go.Size(NaN, 1),
wrap: go.TextBlock.WrapFit,
textAlign: 'center',
editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
},
new go.Binding('text').makeTwoWay(),
new go.Binding('font', 'fontStyle'),
new go.Binding('stroke', 'fontStroke').makeTwoWay(),
new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'),
),
),
);
// 源数据模型定义
myDiagram.nodeTemplateMap.add(
'dataCase',
goJS(
go.Node,
'Auto',
nodeStyle(),
'Spot',
{ locationSpot: go.Spot.Center, zOrder: 3, cursor: 'default' },
new go.Binding('zOrder', 'zOrder').makeTwoWay(),
new go.Binding('cursor', 'cursor').makeTwoWay(),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('angle').makeTwoWay(),
roleVisibleBinding(), // 绑定角色可见
goJS(
go.Shape,
'RoundedRectanglePlus',
{ name: 'SHAPE', strokeWidth: 10, stroke: '#000000', parameter1: 0 },
new go.Binding('fill', 'fillColor').makeTwoWay(),
new go.Binding('stroke').makeTwoWay(),
new go.Binding('strokeWidth').makeTwoWay(),
new go.Binding('parameter1', 'radius').makeTwoWay(),
new go.Binding('desiredSize', 'size', go.Size.parse).makeTwoWay(go.Size.stringify),
),
goJS(
go.TextBlock,
textStyle(),
{
// margin: 5,
maxSize: new go.Size(NaN, NaN),
minSize: new go.Size(NaN, 1),
wrap: go.TextBlock.WrapFit,
textAlign: 'center',
editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
},
new go.Binding('text').makeTwoWay(),
new go.Binding('font', 'fontStyle'),
new go.Binding('stroke', 'fontStroke').makeTwoWay(),
new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'),
),
{
click(e, node) {
const { data } = node;
const list = bindData.find((item) => {
return item.name === data.stationName;
});
if (!list) return false;
switch (data.opType) {
case '画板跳转': // 图片模型
drawBoardMethod(data);
break;
case '功能跳转': // 功能模型
menuJumpMethod(data);
break;
case '视频查看': // 视频查看
videoScanMethod(data);
break;
case '自定义交互': // 自定义交互
customBack(data);
break;
default:
break;
}
},
},
),
);
// 名称定义
myDiagram.nodeTemplateMap.add(
'nameCase',
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
20137a97
...
...
@@ -969,7 +969,11 @@ const ConfigurationView = (props) => {
const script = item && item.filter ? item.filter : '';
const value = new Function('
data
', script)(data);
const node = myDiagram.model.findNodeDataForKey(item.key);
myDiagram.model.setDataProperty(node, '
showVal
', value || '
--
');
myDiagram.model.setDataProperty(
node,
'
showVal
',
typeof value !== '
undefined
' ? value : '
--
',
);
} catch (err) {}
});
};
...
...
@@ -2007,7 +2011,52 @@ const ConfigurationView = (props) => {
),
);
// 源数据模型
// 数据源模型定义
myDiagram.nodeTemplateMap.add(
'dataSource',
goJS(
go.Node,
'Auto',
nodeStyle(),
'Spot',
{ locationSpot: go.Spot.Center, zOrder: 3, cursor: 'default', visible: false },
new go.Binding('zOrder', 'zOrder').makeTwoWay(),
new go.Binding('cursor', 'cursor').makeTwoWay(),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('angle').makeTwoWay(),
goJS(
go.Shape,
'RoundedRectanglePlus',
{ name: 'SHAPE', strokeWidth: 10, stroke: '#000000', parameter1: 0 },
new go.Binding('fill', 'fillColor').makeTwoWay(),
new go.Binding('stroke').makeTwoWay(),
new go.Binding('strokeWidth').makeTwoWay(),
new go.Binding('parameter1', 'radius').makeTwoWay(),
new go.Binding('desiredSize', 'size', go.Size.parse).makeTwoWay(go.Size.stringify),
),
goJS(
go.TextBlock,
textStyle(),
{
maxSize: new go.Size(NaN, NaN),
minSize: new go.Size(NaN, 1),
wrap: go.TextBlock.WrapFit,
textAlign: 'center',
editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
},
new go.Binding('text').makeTwoWay(),
new go.Binding('font', 'fontStyle'),
new go.Binding('stroke', 'fontStroke').makeTwoWay(),
new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'),
),
),
);
// 源数据模型定义
myDiagram.nodeTemplateMap.add(
'dataCase',
goJS(
...
...
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