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
f5857191
Commit
f5857191
authored
Jun 06, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 组态增加表格组件
parent
c8ee806a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
241 additions
and
3 deletions
+241
-3
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+126
-3
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+115
-0
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
f5857191
...
...
@@ -13,7 +13,15 @@ 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
,
isJson
,
stationData
}
from
'./js/utils'
;
import
{
deepCopy
,
hexToRgba
,
textStyle
,
querySkipUrl
,
isJson
,
stationData
,
isNumber
,
}
from
'./js/utils'
;
import
'./index.less'
;
const
goJS
=
go
.
GraphObject
.
make
;
...
...
@@ -287,7 +295,7 @@ const ConfigurationView = (props) => {
break
;
}
}
catch
(
err
)
{
console
.
log
(
err
);
//
console.log(err);
}
};
...
...
@@ -311,7 +319,7 @@ const ConfigurationView = (props) => {
break
;
}
}
catch
(
err
)
{
console
.
log
(
err
);
//
console.log(err);
}
};
...
...
@@ -1023,6 +1031,121 @@ const ConfigurationView = (props) => {
),
);
// 表格节点定义
myDiagram.nodeTemplateMap.add(
'tableCase',
goJS(
go.Node,
'Auto',
{ locationSpot: go.Spot.Center, zOrder: 1 },
new go.Binding('zOrder', 'zOrder').makeTwoWay(),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('angle').makeTwoWay(),
goJS(
go.Shape,
{
fill: 'white',
strokeWidth: 1,
stroke: '#808080',
},
new go.Binding('stroke').makeTwoWay(),
new go.Binding('strokeWidth').makeTwoWay(),
),
goJS(
go.Panel,
'Table',
{
padding: 0,
defaultRowSeparatorStroke: '#808080',
defaultColumnSeparatorStroke: '#808080',
defaultRowSeparatorStrokeWidth: 1,
defaultColumnSeparatorStrokeWidth: 1,
background: '#ffffff',
// defaultSeparatorPadding: new go.Margin(18, 0, 8, 0),
},
new go.Binding('background', 'fillColor').makeTwoWay(),
new go.Binding('defaultRowSeparatorStroke', 'stroke').makeTwoWay(),
new go.Binding('defaultRowSeparatorStrokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('defaultColumnSeparatorStroke', 'stroke').makeTwoWay(),
new go.Binding('defaultColumnSeparatorStrokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('itemArray', 'content').makeTwoWay(),
{
// 表内容
defaultAlignment: go.Spot.Left,
itemTemplate: goJS(
go.Panel,
'TableRow',
new go.Binding('itemArray', 'columns').makeTwoWay(),
{
itemTemplate: goJS(
go.Panel, // each of which as "attr" and "text" properties
'Spot',
{ background: 'transparent', alignment: go.Spot.Center },
new go.Binding('column').makeTwoWay(),
new go.Binding('columnSpan', 'cSpan').makeTwoWay(),
new go.Binding('rowSpan', 'rSpan').makeTwoWay(),
new go.Binding('padding', 'padding', function (v) {
if (v && isNumber(v)) return v;
const padding = v ? v.split(',') : null;
return padding
? new go.Margin(
padding[0] * 1 || 0,
padding[1] * 1 || 0,
padding[2] * 1 || 0,
padding[3] * 1 || 0,
)
: 0;
}).makeTwoWay(),
goJS(
go.Shape,
'RoundedRectanglePlus',
{
name: 'SHAPE',
fill: 'transparent',
stroke: '#ffffff',
strokeWidth: 0,
parameter1: 0,
},
new go.Binding('fill', 'background').makeTwoWay(),
new go.Binding('parameter1', 'radius').makeTwoWay(),
new go.Binding('stroke', 'stroke').makeTwoWay(),
new go.Binding('strokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('width').makeTwoWay(),
new go.Binding('height').makeTwoWay(),
),
goJS(
go.TextBlock,
textStyle(),
{ editable: true },
{
// margin: new go.Margin(2, 10, 10, 2),
wrap: go.TextBlock.WrapFit,
textAlign: 'center',
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
},
new go.Binding('text').makeTwoWay(),
new go.Binding('font', 'style').makeTwoWay(),
new go.Binding('stroke', 'color').makeTwoWay(),
new go.Binding('textAlign', 'align').makeTwoWay(),
// new go.Binding('textSize', 'width', function(v) {
// return new go.Size(v, NaN);
// }),
new go.Binding('maxSize', 'width', function (v) {
return new go.Size(v, NaN);
}).makeTwoWay(),
new go.Binding('minSize', 'width', function (v) {
return new go.Size(v, NaN);
}).makeTwoWay(),
),
),
},
),
},
),
),
);
// img节点定义
myDiagram.nodeTemplateMap.add(
'imgCase',
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
f5857191
...
...
@@ -1538,6 +1538,121 @@ const ConfigurationView = (props) => {
),
);
// 表格节点定义
myDiagram.nodeTemplateMap.add(
'tableCase',
goJS(
go.Node,
'Auto',
{ locationSpot: go.Spot.Center, zOrder: 1 },
new go.Binding('zOrder', 'zOrder').makeTwoWay(),
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('angle').makeTwoWay(),
goJS(
go.Shape,
{
fill: 'white',
strokeWidth: 1,
stroke: '#808080',
},
new go.Binding('stroke').makeTwoWay(),
new go.Binding('strokeWidth').makeTwoWay(),
),
goJS(
go.Panel,
'Table',
{
padding: 0,
defaultRowSeparatorStroke: '#808080',
defaultColumnSeparatorStroke: '#808080',
defaultRowSeparatorStrokeWidth: 1,
defaultColumnSeparatorStrokeWidth: 1,
background: '#ffffff',
// defaultSeparatorPadding: new go.Margin(18, 0, 8, 0),
},
new go.Binding('background', 'fillColor').makeTwoWay(),
new go.Binding('defaultRowSeparatorStroke', 'stroke').makeTwoWay(),
new go.Binding('defaultRowSeparatorStrokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('defaultColumnSeparatorStroke', 'stroke').makeTwoWay(),
new go.Binding('defaultColumnSeparatorStrokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('itemArray', 'content').makeTwoWay(),
{
// 表内容
defaultAlignment: go.Spot.Left,
itemTemplate: goJS(
go.Panel,
'TableRow',
new go.Binding('itemArray', 'columns').makeTwoWay(),
{
itemTemplate: goJS(
go.Panel, // each of which as "attr" and "text" properties
'Spot',
{ background: 'transparent', alignment: go.Spot.Center },
new go.Binding('column').makeTwoWay(),
new go.Binding('columnSpan', 'cSpan').makeTwoWay(),
new go.Binding('rowSpan', 'rSpan').makeTwoWay(),
new go.Binding('padding', 'padding', function (v) {
if (v && isNumber(v)) return v;
const padding = v ? v.split(',') : null;
return padding
? new go.Margin(
padding[0] * 1 || 0,
padding[1] * 1 || 0,
padding[2] * 1 || 0,
padding[3] * 1 || 0,
)
: 0;
}).makeTwoWay(),
goJS(
go.Shape,
'RoundedRectanglePlus',
{
name: 'SHAPE',
fill: 'transparent',
stroke: '#ffffff',
strokeWidth: 0,
parameter1: 0,
},
new go.Binding('fill', 'background').makeTwoWay(),
new go.Binding('parameter1', 'radius').makeTwoWay(),
new go.Binding('stroke', 'stroke').makeTwoWay(),
new go.Binding('strokeWidth', 'strokeWidth').makeTwoWay(),
new go.Binding('width').makeTwoWay(),
new go.Binding('height').makeTwoWay(),
),
goJS(
go.TextBlock,
textStyle(),
{ editable: true },
{
// margin: new go.Margin(2, 10, 10, 2),
wrap: go.TextBlock.WrapFit,
textAlign: 'center',
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
},
new go.Binding('text').makeTwoWay(),
new go.Binding('font', 'style').makeTwoWay(),
new go.Binding('stroke', 'color').makeTwoWay(),
new go.Binding('textAlign', 'align').makeTwoWay(),
// new go.Binding('textSize', 'width', function(v) {
// return new go.Size(v, NaN);
// }),
new go.Binding('maxSize', 'width', function (v) {
return new go.Size(v, NaN);
}).makeTwoWay(),
new go.Binding('minSize', 'width', function (v) {
return new go.Size(v, NaN);
}).makeTwoWay(),
),
),
},
),
},
),
),
);
// img节点定义
myDiagram.nodeTemplateMap.add(
'imgCase',
...
...
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