|
@@ -704,9 +704,9 @@ BaseFormatPanel.prototype.installInputHandler = function ( |
|
@@ -704,9 +704,9 @@ BaseFormatPanel.prototype.installInputHandler = function ( |
704
|
new mxEventObject(
|
704
|
new mxEventObject(
|
705
|
"styleChanged",
|
705
|
"styleChanged",
|
706
|
"keys",
|
706
|
"keys",
|
707
|
- [ key ],
|
707
|
+ [key],
|
708
|
"values",
|
708
|
"values",
|
709
|
- [ value ],
|
709
|
+ [value],
|
710
|
"cells",
|
710
|
"cells",
|
711
|
cells,
|
711
|
cells,
|
712
|
),
|
712
|
),
|
|
@@ -1087,9 +1087,9 @@ BaseFormatPanel.prototype.createCellOption = function ( |
|
@@ -1087,9 +1087,9 @@ BaseFormatPanel.prototype.createCellOption = function ( |
1087
|
new mxEventObject(
|
1087
|
new mxEventObject(
|
1088
|
"styleChanged",
|
1088
|
"styleChanged",
|
1089
|
"keys",
|
1089
|
"keys",
|
1090
|
- [ key ],
|
1090
|
+ [key],
|
1091
|
"values",
|
1091
|
"values",
|
1092
|
- [ value ],
|
1092
|
+ [value],
|
1093
|
"cells",
|
1093
|
"cells",
|
1094
|
temp,
|
1094
|
temp,
|
1095
|
),
|
1095
|
),
|
|
@@ -1344,9 +1344,9 @@ BaseFormatPanel.prototype.createCellColorOption = function ( |
|
@@ -1344,9 +1344,9 @@ BaseFormatPanel.prototype.createCellColorOption = function ( |
1344
|
new mxEventObject(
|
1344
|
new mxEventObject(
|
1345
|
"styleChanged",
|
1345
|
"styleChanged",
|
1346
|
"keys",
|
1346
|
"keys",
|
1347
|
- [ colorKey ],
|
1347
|
+ [colorKey],
|
1348
|
"values",
|
1348
|
"values",
|
1349
|
- [ color ],
|
1349
|
+ [color],
|
1350
|
"cells",
|
1350
|
"cells",
|
1351
|
cells,
|
1351
|
cells,
|
1352
|
),
|
1352
|
),
|
|
@@ -1523,9 +1523,9 @@ BaseFormatPanel.prototype.createRelativeOption = function ( |
|
@@ -1523,9 +1523,9 @@ BaseFormatPanel.prototype.createRelativeOption = function ( |
1523
|
new mxEventObject(
|
1523
|
new mxEventObject(
|
1524
|
"styleChanged",
|
1524
|
"styleChanged",
|
1525
|
"keys",
|
1525
|
"keys",
|
1526
|
- [ key ],
|
1526
|
+ [key],
|
1527
|
"values",
|
1527
|
"values",
|
1528
|
- [ value ],
|
1528
|
+ [value],
|
1529
|
"cells",
|
1529
|
"cells",
|
1530
|
cells,
|
1530
|
cells,
|
1531
|
),
|
1531
|
),
|
|
@@ -1885,9 +1885,9 @@ ArrangePanel.prototype.addTable = function (div) { |
|
@@ -1885,9 +1885,9 @@ ArrangePanel.prototype.addTable = function (div) { |
1885
|
var count = 0;
|
1885
|
var count = 0;
|
1886
|
|
1886
|
|
1887
|
if (ss.mergeCell != null) {
|
1887
|
if (ss.mergeCell != null) {
|
1888
|
- count += this.addActions(div, [ "mergeCells" ]);
|
1888
|
+ count += this.addActions(div, ["mergeCells"]);
|
1889
|
} else if (ss.style["colspan"] > 1 || ss.style["rowspan"] > 1) {
|
1889
|
} else if (ss.style["colspan"] > 1 || ss.style["rowspan"] > 1) {
|
1890
|
- count += this.addActions(div, [ "unmergeCells" ]);
|
1890
|
+ count += this.addActions(div, ["unmergeCells"]);
|
1891
|
}
|
1891
|
}
|
1892
|
|
1892
|
|
1893
|
if (count > 0) {
|
1893
|
if (count > 0) {
|
|
@@ -1904,8 +1904,8 @@ ArrangePanel.prototype.addTable = function (div) { |
|
@@ -1904,8 +1904,8 @@ ArrangePanel.prototype.addTable = function (div) { |
1904
|
*
|
1904
|
*
|
1905
|
*/
|
1905
|
*/
|
1906
|
ArrangePanel.prototype.addLayerOps = function (div) {
|
1906
|
ArrangePanel.prototype.addLayerOps = function (div) {
|
1907
|
- this.addActions(div, [ "toFront", "toBack" ]);
|
|
|
1908
|
- this.addActions(div, [ "bringForward", "sendBackward" ]);
|
1907
|
+ this.addActions(div, ["toFront", "toBack"]);
|
|
|
1908
|
+ this.addActions(div, ["bringForward", "sendBackward"]);
|
1909
|
|
1909
|
|
1910
|
return div;
|
1910
|
return div;
|
1911
|
};
|
1911
|
};
|
|
@@ -1925,8 +1925,8 @@ ArrangePanel.prototype.addGroupOps = function (div) { |
|
@@ -1925,8 +1925,8 @@ ArrangePanel.prototype.addGroupOps = function (div) { |
1925
|
|
1925
|
|
1926
|
if (!ss.cell && !ss.row) {
|
1926
|
if (!ss.cell && !ss.row) {
|
1927
|
count +=
|
1927
|
count +=
|
1928
|
- this.addActions(div, [ "group", "ungroup", "copySize", "pasteSize" ]) +
|
|
|
1929
|
- this.addActions(div, [ "removeFromGroup" ]);
|
1928
|
+ this.addActions(div, ["group", "ungroup", "copySize", "pasteSize"]) +
|
|
|
1929
|
+ this.addActions(div, ["removeFromGroup"]);
|
1930
|
}
|
1930
|
}
|
1931
|
|
1931
|
|
1932
|
var copyBtn = null;
|
1932
|
var copyBtn = null;
|
|
@@ -2023,7 +2023,7 @@ ArrangePanel.prototype.addGroupOps = function (div) { |
|
@@ -2023,7 +2023,7 @@ ArrangePanel.prototype.addGroupOps = function (div) { |
2023
|
}
|
2023
|
}
|
2024
|
|
2024
|
|
2025
|
if (graph.getSelectionCount() == 1) {
|
2025
|
if (graph.getSelectionCount() == 1) {
|
2026
|
- count += this.addActions(div, [ "editData", "editLink" ]);
|
2026
|
+ count += this.addActions(div, ["editData", "editLink"]);
|
2027
|
}
|
2027
|
}
|
2028
|
|
2028
|
|
2029
|
if (count == 0) {
|
2029
|
if (count == 0) {
|
|
@@ -2103,12 +2103,12 @@ ArrangePanel.prototype.addAlign = function (div) { |
|
@@ -2103,12 +2103,12 @@ ArrangePanel.prototype.addAlign = function (div) { |
2103
|
stylePanel,
|
2103
|
stylePanel,
|
2104
|
);
|
2104
|
);
|
2105
|
|
2105
|
|
2106
|
- this.styleButtons([ left, center, right, top, middle, bottom ]);
|
2106
|
+ this.styleButtons([left, center, right, top, middle, bottom]);
|
2107
|
right.style.marginRight = "10px";
|
2107
|
right.style.marginRight = "10px";
|
2108
|
}
|
2108
|
}
|
2109
|
|
2109
|
|
2110
|
div.appendChild(stylePanel);
|
2110
|
div.appendChild(stylePanel);
|
2111
|
- this.addActions(div, [ "snapToGrid" ]);
|
2111
|
+ this.addActions(div, ["snapToGrid"]);
|
2112
|
|
2112
|
|
2113
|
return div;
|
2113
|
return div;
|
2114
|
};
|
2114
|
};
|
|
@@ -2797,9 +2797,9 @@ ArrangePanel.prototype.addEdgeGeometry = function (container) { |
|
@@ -2797,9 +2797,9 @@ ArrangePanel.prototype.addEdgeGeometry = function (container) { |
2797
|
new mxEventObject(
|
2797
|
new mxEventObject(
|
2798
|
"styleChanged",
|
2798
|
"styleChanged",
|
2799
|
"keys",
|
2799
|
"keys",
|
2800
|
- [ "width" ],
|
2800
|
+ ["width"],
|
2801
|
"values",
|
2801
|
"values",
|
2802
|
- [ value ],
|
2802
|
+ [value],
|
2803
|
"cells",
|
2803
|
"cells",
|
2804
|
cells,
|
2804
|
cells,
|
2805
|
),
|
2805
|
),
|
|
@@ -3030,7 +3030,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3030,7 +3030,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
3030
|
var stylePanel2 = stylePanel.cloneNode(false);
|
3030
|
var stylePanel2 = stylePanel.cloneNode(false);
|
3031
|
stylePanel2.style.marginLeft = "-3px";
|
3031
|
stylePanel2.style.marginLeft = "-3px";
|
3032
|
var fontStyleItems = this.editorUi.toolbar.addItems(
|
3032
|
var fontStyleItems = this.editorUi.toolbar.addItems(
|
3033
|
- [ "bold", "italic", "underline" ],
|
3033
|
+ ["bold", "italic", "underline"],
|
3034
|
stylePanel2,
|
3034
|
stylePanel2,
|
3035
|
true,
|
3035
|
true,
|
3036
|
);
|
3036
|
);
|
|
@@ -3057,7 +3057,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3057,7 +3057,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
3057
|
);
|
3057
|
);
|
3058
|
|
3058
|
|
3059
|
var verticalItem = this.editorUi.toolbar.addItems(
|
3059
|
var verticalItem = this.editorUi.toolbar.addItems(
|
3060
|
- [ "vertical" ],
|
3060
|
+ ["vertical"],
|
3061
|
stylePanel2,
|
3061
|
stylePanel2,
|
3062
|
true,
|
3062
|
true,
|
3063
|
)[0];
|
3063
|
)[0];
|
|
@@ -3065,7 +3065,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3065,7 +3065,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
3065
|
container.appendChild(stylePanel2);
|
3065
|
container.appendChild(stylePanel2);
|
3066
|
|
3066
|
|
3067
|
this.styleButtons(fontStyleItems);
|
3067
|
this.styleButtons(fontStyleItems);
|
3068
|
- this.styleButtons([ verticalItem ]);
|
3068
|
+ this.styleButtons([verticalItem]);
|
3069
|
|
3069
|
|
3070
|
var stylePanel3 = stylePanel.cloneNode(false);
|
3070
|
var stylePanel3 = stylePanel.cloneNode(false);
|
3071
|
stylePanel3.style.marginLeft = "-3px";
|
3071
|
stylePanel3.style.marginLeft = "-3px";
|
|
@@ -3088,9 +3088,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3088,9 +3088,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3088
|
new mxEventObject(
|
3088
|
new mxEventObject(
|
3089
|
"styleChanged",
|
3089
|
"styleChanged",
|
3090
|
"keys",
|
3090
|
"keys",
|
3091
|
- [ mxConstants.STYLE_ALIGN ],
|
3091
|
+ [mxConstants.STYLE_ALIGN],
|
3092
|
"values",
|
3092
|
"values",
|
3093
|
- [ mxConstants.ALIGN_LEFT ],
|
3093
|
+ [mxConstants.ALIGN_LEFT],
|
3094
|
"cells",
|
3094
|
"cells",
|
3095
|
ss.cells,
|
3095
|
ss.cells,
|
3096
|
),
|
3096
|
),
|
|
@@ -3098,8 +3098,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3098,8 +3098,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
3098
|
}
|
3098
|
}
|
3099
|
: callFn(
|
3099
|
: callFn(
|
3100
|
this.editorUi.menus.createStyleChangeFunction(
|
3100
|
this.editorUi.menus.createStyleChangeFunction(
|
3101
|
- [ mxConstants.STYLE_ALIGN ],
|
|
|
3102
|
- [ mxConstants.ALIGN_LEFT ],
|
3101
|
+ [mxConstants.STYLE_ALIGN],
|
|
|
3102
|
+ [mxConstants.ALIGN_LEFT],
|
3103
|
),
|
3103
|
),
|
3104
|
),
|
3104
|
),
|
3105
|
stylePanel3,
|
3105
|
stylePanel3,
|
|
@@ -3114,9 +3114,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3114,9 +3114,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3114
|
new mxEventObject(
|
3114
|
new mxEventObject(
|
3115
|
"styleChanged",
|
3115
|
"styleChanged",
|
3116
|
"keys",
|
3116
|
"keys",
|
3117
|
- [ mxConstants.STYLE_ALIGN ],
|
3117
|
+ [mxConstants.STYLE_ALIGN],
|
3118
|
"values",
|
3118
|
"values",
|
3119
|
- [ mxConstants.ALIGN_CENTER ],
|
3119
|
+ [mxConstants.ALIGN_CENTER],
|
3120
|
"cells",
|
3120
|
"cells",
|
3121
|
ss.cells,
|
3121
|
ss.cells,
|
3122
|
),
|
3122
|
),
|
|
@@ -3124,8 +3124,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3124,8 +3124,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
3124
|
}
|
3124
|
}
|
3125
|
: callFn(
|
3125
|
: callFn(
|
3126
|
this.editorUi.menus.createStyleChangeFunction(
|
3126
|
this.editorUi.menus.createStyleChangeFunction(
|
3127
|
- [ mxConstants.STYLE_ALIGN ],
|
|
|
3128
|
- [ mxConstants.ALIGN_CENTER ],
|
3127
|
+ [mxConstants.STYLE_ALIGN],
|
|
|
3128
|
+ [mxConstants.ALIGN_CENTER],
|
3129
|
),
|
3129
|
),
|
3130
|
),
|
3130
|
),
|
3131
|
stylePanel3,
|
3131
|
stylePanel3,
|
|
@@ -3140,9 +3140,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3140,9 +3140,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3140
|
new mxEventObject(
|
3140
|
new mxEventObject(
|
3141
|
"styleChanged",
|
3141
|
"styleChanged",
|
3142
|
"keys",
|
3142
|
"keys",
|
3143
|
- [ mxConstants.STYLE_ALIGN ],
|
3143
|
+ [mxConstants.STYLE_ALIGN],
|
3144
|
"values",
|
3144
|
"values",
|
3145
|
- [ mxConstants.ALIGN_RIGHT ],
|
3145
|
+ [mxConstants.ALIGN_RIGHT],
|
3146
|
"cells",
|
3146
|
"cells",
|
3147
|
ss.cells,
|
3147
|
ss.cells,
|
3148
|
),
|
3148
|
),
|
|
@@ -3150,14 +3150,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3150,14 +3150,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
3150
|
}
|
3150
|
}
|
3151
|
: callFn(
|
3151
|
: callFn(
|
3152
|
this.editorUi.menus.createStyleChangeFunction(
|
3152
|
this.editorUi.menus.createStyleChangeFunction(
|
3153
|
- [ mxConstants.STYLE_ALIGN ],
|
|
|
3154
|
- [ mxConstants.ALIGN_RIGHT ],
|
3153
|
+ [mxConstants.STYLE_ALIGN],
|
|
|
3154
|
+ [mxConstants.ALIGN_RIGHT],
|
3155
|
),
|
3155
|
),
|
3156
|
),
|
3156
|
),
|
3157
|
stylePanel3,
|
3157
|
stylePanel3,
|
3158
|
);
|
3158
|
);
|
3159
|
|
3159
|
|
3160
|
- this.styleButtons([ left, center, right ]);
|
3160
|
+ this.styleButtons([left, center, right]);
|
3161
|
|
3161
|
|
3162
|
// Quick hack for strikethrough
|
3162
|
// Quick hack for strikethrough
|
3163
|
// TODO: Add translations and toggle state
|
3163
|
// TODO: Add translations and toggle state
|
|
@@ -3170,14 +3170,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3170,14 +3170,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
3170
|
},
|
3170
|
},
|
3171
|
stylePanel2,
|
3171
|
stylePanel2,
|
3172
|
);
|
3172
|
);
|
3173
|
- this.styleButtons([ strike ]);
|
3173
|
+ this.styleButtons([strike]);
|
3174
|
|
3174
|
|
3175
|
strike.firstChild.style.background =
|
3175
|
strike.firstChild.style.background =
|
3176
|
"url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMFYweiIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBjbGlwLXBhdGg9InVybCgjYikiIGZpbGw9IiMwMTAxMDEiIGQ9Ik03LjI0IDguNzVjLS4yNi0uNDgtLjM5LTEuMDMtLjM5LTEuNjcgMC0uNjEuMTMtMS4xNi40LTEuNjcuMjYtLjUuNjMtLjkzIDEuMTEtMS4yOS40OC0uMzUgMS4wNS0uNjMgMS43LS44My42Ni0uMTkgMS4zOS0uMjkgMi4xOC0uMjkuODEgMCAxLjU0LjExIDIuMjEuMzQuNjYuMjIgMS4yMy41NCAxLjY5Ljk0LjQ3LjQuODMuODggMS4wOCAxLjQzLjI1LjU1LjM4IDEuMTUuMzggMS44MWgtMy4wMWMwLS4zMS0uMDUtLjU5LS4xNS0uODUtLjA5LS4yNy0uMjQtLjQ5LS40NC0uNjgtLjItLjE5LS40NS0uMzMtLjc1LS40NC0uMy0uMS0uNjYtLjE2LTEuMDYtLjE2LS4zOSAwLS43NC4wNC0xLjAzLjEzLS4yOS4wOS0uNTMuMjEtLjcyLjM2LS4xOS4xNi0uMzQuMzQtLjQ0LjU1LS4xLjIxLS4xNS40My0uMTUuNjYgMCAuNDguMjUuODguNzQgMS4yMS4zOC4yNS43Ny40OCAxLjQxLjdINy4zOWMtLjA1LS4wOC0uMTEtLjE3LS4xNS0uMjV6TTIxIDEydi0ySDN2Mmg5LjYyYy4xOC4wNy40LjE0LjU1LjIuMzcuMTcuNjYuMzQuODcuNTEuMjEuMTcuMzUuMzYuNDMuNTcuMDcuMi4xMS40My4xMS42OSAwIC4yMy0uMDUuNDUtLjE0LjY2LS4wOS4yLS4yMy4zOC0uNDIuNTMtLjE5LjE1LS40Mi4yNi0uNzEuMzUtLjI5LjA4LS42My4xMy0xLjAxLjEzLS40MyAwLS44My0uMDQtMS4xOC0uMTNzLS42Ni0uMjMtLjkxLS40MmMtLjI1LS4xOS0uNDUtLjQ0LS41OS0uNzUtLjE0LS4zMS0uMjUtLjc2LS4yNS0xLjIxSDYuNGMwIC41NS4wOCAxLjEzLjI0IDEuNTguMTYuNDUuMzcuODUuNjUgMS4yMS4yOC4zNS42LjY2Ljk4LjkyLjM3LjI2Ljc4LjQ4IDEuMjIuNjUuNDQuMTcuOS4zIDEuMzguMzkuNDguMDguOTYuMTMgMS40NC4xMy44IDAgMS41My0uMDkgMi4xOC0uMjhzMS4yMS0uNDUgMS42Ny0uNzljLjQ2LS4zNC44Mi0uNzcgMS4wNy0xLjI3cy4zOC0xLjA3LjM4LTEuNzFjMC0uNi0uMS0xLjE0LS4zMS0xLjYxLS4wNS0uMTEtLjExLS4yMy0uMTctLjMzSDIxeiIvPjwvc3ZnPg==)";
|
3176
|
"url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMFYweiIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBjbGlwLXBhdGg9InVybCgjYikiIGZpbGw9IiMwMTAxMDEiIGQ9Ik03LjI0IDguNzVjLS4yNi0uNDgtLjM5LTEuMDMtLjM5LTEuNjcgMC0uNjEuMTMtMS4xNi40LTEuNjcuMjYtLjUuNjMtLjkzIDEuMTEtMS4yOS40OC0uMzUgMS4wNS0uNjMgMS43LS44My42Ni0uMTkgMS4zOS0uMjkgMi4xOC0uMjkuODEgMCAxLjU0LjExIDIuMjEuMzQuNjYuMjIgMS4yMy41NCAxLjY5Ljk0LjQ3LjQuODMuODggMS4wOCAxLjQzLjI1LjU1LjM4IDEuMTUuMzggMS44MWgtMy4wMWMwLS4zMS0uMDUtLjU5LS4xNS0uODUtLjA5LS4yNy0uMjQtLjQ5LS40NC0uNjgtLjItLjE5LS40NS0uMzMtLjc1LS40NC0uMy0uMS0uNjYtLjE2LTEuMDYtLjE2LS4zOSAwLS43NC4wNC0xLjAzLjEzLS4yOS4wOS0uNTMuMjEtLjcyLjM2LS4xOS4xNi0uMzQuMzQtLjQ0LjU1LS4xLjIxLS4xNS40My0uMTUuNjYgMCAuNDguMjUuODguNzQgMS4yMS4zOC4yNS43Ny40OCAxLjQxLjdINy4zOWMtLjA1LS4wOC0uMTEtLjE3LS4xNS0uMjV6TTIxIDEydi0ySDN2Mmg5LjYyYy4xOC4wNy40LjE0LjU1LjIuMzcuMTcuNjYuMzQuODcuNTEuMjEuMTcuMzUuMzYuNDMuNTcuMDcuMi4xMS40My4xMS42OSAwIC4yMy0uMDUuNDUtLjE0LjY2LS4wOS4yLS4yMy4zOC0uNDIuNTMtLjE5LjE1LS40Mi4yNi0uNzEuMzUtLjI5LjA4LS42My4xMy0xLjAxLjEzLS40MyAwLS44My0uMDQtMS4xOC0uMTNzLS42Ni0uMjMtLjkxLS40MmMtLjI1LS4xOS0uNDUtLjQ0LS41OS0uNzUtLjE0LS4zMS0uMjUtLjc2LS4yNS0xLjIxSDYuNGMwIC41NS4wOCAxLjEzLjI0IDEuNTguMTYuNDUuMzcuODUuNjUgMS4yMS4yOC4zNS42LjY2Ljk4LjkyLjM3LjI2Ljc4LjQ4IDEuMjIuNjUuNDQuMTcuOS4zIDEuMzguMzkuNDguMDguOTYuMTMgMS40NC4xMy44IDAgMS41My0uMDkgMi4xOC0uMjhzMS4yMS0uNDUgMS42Ny0uNzljLjQ2LS4zNC44Mi0uNzcgMS4wNy0xLjI3cy4zOC0xLjA3LjM4LTEuNzFjMC0uNi0uMS0xLjE0LS4zMS0xLjYxLS4wNS0uMTEtLjExLS4yMy0uMTctLjMzSDIxeiIvPjwvc3ZnPg==)";
|
3177
|
strike.firstChild.style.backgroundPosition = "2px 2px";
|
3177
|
strike.firstChild.style.backgroundPosition = "2px 2px";
|
3178
|
strike.firstChild.style.backgroundSize = "18px 18px";
|
3178
|
strike.firstChild.style.backgroundSize = "18px 18px";
|
3179
|
|
3179
|
|
3180
|
- this.styleButtons([ strike ]);
|
3180
|
+ this.styleButtons([strike]);
|
3181
|
}
|
3181
|
}
|
3182
|
|
3182
|
|
3183
|
var top = this.editorUi.toolbar.addButton(
|
3183
|
var top = this.editorUi.toolbar.addButton(
|
|
@@ -3185,8 +3185,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3185,8 +3185,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
3185
|
mxResources.get("top"),
|
3185
|
mxResources.get("top"),
|
3186
|
callFn(
|
3186
|
callFn(
|
3187
|
this.editorUi.menus.createStyleChangeFunction(
|
3187
|
this.editorUi.menus.createStyleChangeFunction(
|
3188
|
- [ mxConstants.STYLE_VERTICAL_ALIGN ],
|
|
|
3189
|
- [ mxConstants.ALIGN_TOP ],
|
3188
|
+ [mxConstants.STYLE_VERTICAL_ALIGN],
|
|
|
3189
|
+ [mxConstants.ALIGN_TOP],
|
3190
|
),
|
3190
|
),
|
3191
|
),
|
3191
|
),
|
3192
|
stylePanel3,
|
3192
|
stylePanel3,
|
|
@@ -3196,8 +3196,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3196,8 +3196,8 @@ TextFormatPanel.prototype.addFont = function (container) { |
3196
|
mxResources.get("middle"),
|
3196
|
mxResources.get("middle"),
|
3197
|
callFn(
|
3197
|
callFn(
|
3198
|
this.editorUi.menus.createStyleChangeFunction(
|
3198
|
this.editorUi.menus.createStyleChangeFunction(
|
3199
|
- [ mxConstants.STYLE_VERTICAL_ALIGN ],
|
|
|
3200
|
- [ mxConstants.ALIGN_MIDDLE ],
|
3199
|
+ [mxConstants.STYLE_VERTICAL_ALIGN],
|
|
|
3200
|
+ [mxConstants.ALIGN_MIDDLE],
|
3201
|
),
|
3201
|
),
|
3202
|
),
|
3202
|
),
|
3203
|
stylePanel3,
|
3203
|
stylePanel3,
|
|
@@ -3207,14 +3207,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3207,14 +3207,14 @@ TextFormatPanel.prototype.addFont = function (container) { |
3207
|
mxResources.get("bottom"),
|
3207
|
mxResources.get("bottom"),
|
3208
|
callFn(
|
3208
|
callFn(
|
3209
|
this.editorUi.menus.createStyleChangeFunction(
|
3209
|
this.editorUi.menus.createStyleChangeFunction(
|
3210
|
- [ mxConstants.STYLE_VERTICAL_ALIGN ],
|
|
|
3211
|
- [ mxConstants.ALIGN_BOTTOM ],
|
3210
|
+ [mxConstants.STYLE_VERTICAL_ALIGN],
|
|
|
3211
|
+ [mxConstants.ALIGN_BOTTOM],
|
3212
|
),
|
3212
|
),
|
3213
|
),
|
3213
|
),
|
3214
|
stylePanel3,
|
3214
|
stylePanel3,
|
3215
|
);
|
3215
|
);
|
3216
|
|
3216
|
|
3217
|
- this.styleButtons([ top, middle, bottom ]);
|
3217
|
+ this.styleButtons([top, middle, bottom]);
|
3218
|
|
3218
|
|
3219
|
container.appendChild(stylePanel3);
|
3219
|
container.appendChild(stylePanel3);
|
3220
|
|
3220
|
|
|
@@ -3441,7 +3441,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3441,7 +3441,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
3441
|
|
3441
|
|
3442
|
// NOTE: For automatic we use the value null since automatic
|
3442
|
// NOTE: For automatic we use the value null since automatic
|
3443
|
// requires the text to be non formatted and non-wrapped
|
3443
|
// requires the text to be non formatted and non-wrapped
|
3444
|
- var dirs = [ "automatic", "leftToRight", "rightToLeft" ];
|
3444
|
+ var dirs = ["automatic", "leftToRight", "rightToLeft"];
|
3445
|
var dirSet = {
|
3445
|
var dirSet = {
|
3446
|
automatic: null,
|
3446
|
automatic: null,
|
3447
|
leftToRight: mxConstants.TEXT_DIRECTION_LTR,
|
3447
|
leftToRight: mxConstants.TEXT_DIRECTION_LTR,
|
|
@@ -3568,9 +3568,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3568,9 +3568,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3568
|
new mxEventObject(
|
3568
|
new mxEventObject(
|
3569
|
"styleChanged",
|
3569
|
"styleChanged",
|
3570
|
"keys",
|
3570
|
"keys",
|
3571
|
- [ mxConstants.STYLE_FONTSIZE ],
|
3571
|
+ [mxConstants.STYLE_FONTSIZE],
|
3572
|
"values",
|
3572
|
"values",
|
3573
|
- [ fontSize ],
|
3573
|
+ [fontSize],
|
3574
|
"cells",
|
3574
|
"cells",
|
3575
|
ss.cells,
|
3575
|
ss.cells,
|
3576
|
),
|
3576
|
),
|
|
@@ -3696,9 +3696,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3696,9 +3696,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3696
|
new mxEventObject(
|
3696
|
new mxEventObject(
|
3697
|
"styleChanged",
|
3697
|
"styleChanged",
|
3698
|
"keys",
|
3698
|
"keys",
|
3699
|
- [ mxConstants.STYLE_LABEL_BACKGROUNDCOLOR ],
|
3699
|
+ [mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],
|
3700
|
"values",
|
3700
|
"values",
|
3701
|
- [ color ],
|
3701
|
+ [color],
|
3702
|
"cells",
|
3702
|
"cells",
|
3703
|
ss.cells,
|
3703
|
ss.cells,
|
3704
|
),
|
3704
|
),
|
|
@@ -3775,9 +3775,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3775,9 +3775,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3775
|
new mxEventObject(
|
3775
|
new mxEventObject(
|
3776
|
"styleChanged",
|
3776
|
"styleChanged",
|
3777
|
"keys",
|
3777
|
"keys",
|
3778
|
- [ mxConstants.STYLE_FONTCOLOR ],
|
3778
|
+ [mxConstants.STYLE_FONTCOLOR],
|
3779
|
"values",
|
3779
|
"values",
|
3780
|
- [ color ],
|
3780
|
+ [color],
|
3781
|
"cells",
|
3781
|
"cells",
|
3782
|
ss.cells,
|
3782
|
ss.cells,
|
3783
|
),
|
3783
|
),
|
|
@@ -3829,9 +3829,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -3829,9 +3829,9 @@ TextFormatPanel.prototype.addFont = function (container) { |
3829
|
new mxEventObject(
|
3829
|
new mxEventObject(
|
3830
|
"styleChanged",
|
3830
|
"styleChanged",
|
3831
|
"keys",
|
3831
|
"keys",
|
3832
|
- [ mxConstants.STYLE_FONTCOLOR ],
|
3832
|
+ [mxConstants.STYLE_FONTCOLOR],
|
3833
|
"values",
|
3833
|
"values",
|
3834
|
- [ color ],
|
3834
|
+ [color],
|
3835
|
"cells",
|
3835
|
"cells",
|
3836
|
ss.cells,
|
3836
|
ss.cells,
|
3837
|
),
|
3837
|
),
|
|
@@ -4029,7 +4029,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -4029,7 +4029,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
4029
|
while (
|
4029
|
while (
|
4030
|
node != null &&
|
4030
|
node != null &&
|
4031
|
node.nodeType != mxConstants.NODETYPE_ELEMENT
|
4031
|
node.nodeType != mxConstants.NODETYPE_ELEMENT
|
4032
|
- ) {
|
4032
|
+ ) {
|
4033
|
node = node.parentNode;
|
4033
|
node = node.parentNode;
|
4034
|
}
|
4034
|
}
|
4035
|
|
4035
|
|
|
@@ -4083,7 +4083,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -4083,7 +4083,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
4083
|
var insertPanel = stylePanel.cloneNode(false);
|
4083
|
var insertPanel = stylePanel.cloneNode(false);
|
4084
|
insertPanel.style.paddingLeft = "0px";
|
4084
|
insertPanel.style.paddingLeft = "0px";
|
4085
|
var insertBtns = this.editorUi.toolbar.addItems(
|
4085
|
var insertBtns = this.editorUi.toolbar.addItems(
|
4086
|
- [ "link", "image" ],
|
4086
|
+ ["link", "image"],
|
4087
|
insertPanel,
|
4087
|
insertPanel,
|
4088
|
true,
|
4088
|
true,
|
4089
|
);
|
4089
|
);
|
|
@@ -4754,7 +4754,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
|
@@ -4754,7 +4754,7 @@ TextFormatPanel.prototype.addFont = function (container) { |
4754
|
tableCell =
|
4754
|
tableCell =
|
4755
|
currentTable == null
|
4755
|
currentTable == null
|
4756
|
? null
|
4756
|
? null
|
4757
|
- : graph.getParentByNames(node, [ "TD", "TH" ], currentTable);
|
4757
|
+ : graph.getParentByNames(node, ["TD", "TH"], currentTable);
|
4758
|
tableWrapper.style.display = currentTable != null ? "" : "none";
|
4758
|
tableWrapper.style.display = currentTable != null ? "" : "none";
|
4759
|
|
4759
|
|
4760
|
if (document.activeElement != input) {
|
4760
|
if (document.activeElement != input) {
|
|
@@ -4878,11 +4878,12 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -4878,11 +4878,12 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
4878
|
const graph = editor.graph;
|
4878
|
const graph = editor.graph;
|
4879
|
const ss = ui.getSelectionState();
|
4879
|
const ss = ui.getSelectionState();
|
4880
|
const vertices = ss.vertices || []
|
4880
|
const vertices = ss.vertices || []
|
4881
|
-
|
|
|
4882
|
- console.log(Sidebar.prototype)
|
4881
|
+ const sidebarInstance = ui.sidebar
|
4883
|
// console.log(this.editorUi)
|
4882
|
// console.log(this.editorUi)
|
4884
|
console.log(vertices)
|
4883
|
console.log(vertices)
|
|
|
4884
|
+ console.log(ui)
|
4885
|
|
4885
|
|
|
|
4886
|
+ const hasModifyNotSave = editor.status
|
4886
|
|
4887
|
|
4887
|
// console.log(vertices[0]?.get('bindType'))
|
4888
|
// console.log(vertices[0]?.get('bindType'))
|
4888
|
/**
|
4889
|
/**
|
|
@@ -4899,7 +4900,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -4899,7 +4900,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
4899
|
const graphId = vertices[0].id;
|
4900
|
const graphId = vertices[0].id;
|
4900
|
|
4901
|
|
4901
|
// 解构全局属性layui要用到的模块
|
4902
|
// 解构全局属性layui要用到的模块
|
4902
|
- const { layer, form, jquery: $ } = layui;
|
4903
|
+ const { layer, form, jquery: $, colorpicker, upload, element } = layui;
|
4903
|
|
4904
|
|
4904
|
const CONTAINER_FILTER = 'containerFilter'
|
4905
|
const CONTAINER_FILTER = 'containerFilter'
|
4905
|
$(container).addClass('layui-form').attr('lay-filter', CONTAINER_FILTER)
|
4906
|
$(container).addClass('layui-form').attr('lay-filter', CONTAINER_FILTER)
|
|
@@ -4941,13 +4942,25 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -4941,13 +4942,25 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
4941
|
let currentNodeData = null
|
4942
|
let currentNodeData = null
|
4942
|
|
4943
|
|
4943
|
/**
|
4944
|
/**
|
|
|
4945
|
+ * @description 保存页面信息
|
|
|
4946
|
+ */
|
|
|
4947
|
+ async function autoSaveGraphInfo() {
|
|
|
4948
|
+ if (!hasModifyNotSave) return
|
|
|
4949
|
+ ui.actions.get(
|
|
|
4950
|
+ (ui.currentFile.mode == null || !ui.currentFile.isEditable())
|
|
|
4951
|
+ ? 'saveAs'
|
|
|
4952
|
+ : 'save')
|
|
|
4953
|
+ .funct();
|
|
|
4954
|
+ }
|
|
|
4955
|
+
|
|
|
4956
|
+ /**
|
4944
|
* @description 获取弹出层绑定信息
|
4957
|
* @description 获取弹出层绑定信息
|
4945
|
- * @param {'DOWN' | 'UP' | 'SINGLE' | 'DOUBLE' | 'DISPLAY' | 'FLASH' | 'ROTATE'} type - 类型
|
4958
|
+ * @param {'DOWN' | 'UP' | 'SINGLE' | 'DOUBLE' | 'DISPLAY' | 'FLASH' | 'ROTATE' | 'IMAGE'} type - 类型
|
4946
|
* @param {'event' | 'act' } category - 类别
|
4959
|
* @param {'event' | 'act' } category - 类别
|
4947
|
*/
|
4960
|
*/
|
4948
|
function getLayerBindInfo(category, type) {
|
4961
|
function getLayerBindInfo(category, type) {
|
4949
|
if (currentNodeData) {
|
4962
|
if (currentNodeData) {
|
4950
|
- return currentNodeData[category]?.find(item => item.type === type)
|
4963
|
+ return currentNodeData[category]?.find(item => item.type === type) || {}
|
4951
|
}
|
4964
|
}
|
4952
|
return {}
|
4965
|
return {}
|
4953
|
}
|
4966
|
}
|
|
@@ -4956,6 +4969,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -4956,6 +4969,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
4956
|
ACT: 'act',
|
4969
|
ACT: 'act',
|
4957
|
EVENT: 'event',
|
4970
|
EVENT: 'event',
|
4958
|
DATA_SOURCE: 'dataSources',
|
4971
|
DATA_SOURCE: 'dataSources',
|
|
|
4972
|
+ FUNCTION: 'function',
|
4959
|
}
|
4973
|
}
|
4960
|
|
4974
|
|
4961
|
const enumInteractionType = {
|
4975
|
const enumInteractionType = {
|
|
@@ -4969,6 +4983,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -4969,6 +4983,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
4969
|
DISPLAY: 'DISPLAY',
|
4983
|
DISPLAY: 'DISPLAY',
|
4970
|
FLASH: 'FLASH',
|
4984
|
FLASH: 'FLASH',
|
4971
|
ROTATE: 'ROTATE',
|
4985
|
ROTATE: 'ROTATE',
|
|
|
4986
|
+ IMAGE: 'IMAGE',
|
4972
|
}
|
4987
|
}
|
4973
|
|
4988
|
|
4974
|
|
4989
|
|
|
@@ -5011,8 +5026,21 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5011,8 +5026,21 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5011
|
type: enumDynamicEffectType.ROTATE,
|
5026
|
type: enumDynamicEffectType.ROTATE,
|
5012
|
category: enumCategory.ACT,
|
5027
|
category: enumCategory.ACT,
|
5013
|
},
|
5028
|
},
|
|
|
5029
|
+ {
|
|
|
5030
|
+ label: '设置变量值图片',
|
|
|
5031
|
+ type: enumDynamicEffectType.IMAGE,
|
|
|
5032
|
+ category: enumCategory.ACT,
|
|
|
5033
|
+ },
|
5014
|
];
|
5034
|
];
|
5015
|
|
5035
|
|
|
|
5036
|
+ // const functionList = [
|
|
|
5037
|
+ // {
|
|
|
5038
|
+ // label: '设置变量值图片',
|
|
|
5039
|
+ // type: enumFunctionType.VAR_IMAGE,
|
|
|
5040
|
+ // category: enumCategory.FUNCTION,
|
|
|
5041
|
+ // },
|
|
|
5042
|
+ // ]
|
|
|
5043
|
+
|
5016
|
const enumDataSourceConst = {
|
5044
|
const enumDataSourceConst = {
|
5017
|
ORG_ID: 'orgId',
|
5045
|
ORG_ID: 'orgId',
|
5018
|
DEVICE_ID: 'deviceId',
|
5046
|
DEVICE_ID: 'deviceId',
|
|
@@ -5021,18 +5049,22 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5021,18 +5049,22 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5021
|
GATEWAY: 'GATEWAY',
|
5049
|
GATEWAY: 'GATEWAY',
|
5022
|
}
|
5050
|
}
|
5023
|
|
5051
|
|
5024
|
- let echoRefreshFn = null
|
5052
|
+ /**
|
|
|
5053
|
+ * @description 刷新页面
|
|
|
5054
|
+ */
|
|
|
5055
|
+ function echoRefreshFn() {
|
|
|
5056
|
+ }
|
5025
|
|
5057
|
|
5026
|
|
5058
|
|
5027
|
// 获取url的请求参数函数
|
5059
|
// 获取url的请求参数函数
|
5028
|
function getRequest() {
|
5060
|
function getRequest() {
|
5029
|
- var url = location.search; //获取url中"?"符后的字串
|
|
|
5030
|
- var theRequest = new Object();
|
5061
|
+ let url = location.search; //获取url中"?"符后的字串
|
|
|
5062
|
+ let theRequest = new Object();
|
5031
|
if (url.indexOf("?") != -1) {
|
5063
|
if (url.indexOf("?") != -1) {
|
5032
|
var str = url.substring(1);
|
5064
|
var str = url.substring(1);
|
5033
|
- strs = str.split("&");
|
|
|
5034
|
- for (var i = 0; i < strs.length; i++) {
|
|
|
5035
|
- theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
|
5065
|
+ string = str.split("&");
|
|
|
5066
|
+ for (var i = 0; i < string.length; i++) {
|
|
|
5067
|
+ theRequest[string[i].split("=")[0]] = decodeURI(string[i].split("=")[1]);
|
5036
|
}
|
5068
|
}
|
5037
|
}
|
5069
|
}
|
5038
|
return theRequest;
|
5070
|
return theRequest;
|
|
@@ -5064,6 +5096,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5064,6 +5096,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5064
|
createInteractionPanel()
|
5096
|
createInteractionPanel()
|
5065
|
createDynamicEffectPanel()
|
5097
|
createDynamicEffectPanel()
|
5066
|
createSubmitPanel()
|
5098
|
createSubmitPanel()
|
|
|
5099
|
+ UseLayUi.nextTick(() => form.render())
|
5067
|
}
|
5100
|
}
|
5068
|
|
5101
|
|
5069
|
initNode();
|
5102
|
initNode();
|
|
@@ -5074,36 +5107,11 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5074,36 +5107,11 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5074
|
*/
|
5107
|
*/
|
5075
|
async function getNodeBindInfo() {
|
5108
|
async function getNodeBindInfo() {
|
5076
|
const { id } = nodeInfo
|
5109
|
const { id } = nodeInfo
|
5077
|
- const [ err, res ] = await to(ConfigurationNodeApi.getConfigurationInfo('NODE', id))
|
5110
|
+ const [err, res] = await to(ConfigurationNodeApi.getConfigurationInfo('NODE', id))
|
5078
|
currentNodeData = res
|
5111
|
currentNodeData = res
|
5079
|
if (echoRefreshFn && typeof echoRefreshFn === 'function') echoRefreshFn()
|
5112
|
if (echoRefreshFn && typeof echoRefreshFn === 'function') echoRefreshFn()
|
5080
|
}
|
5113
|
}
|
5081
|
|
5114
|
|
5082
|
-
|
|
|
5083
|
- /**
|
|
|
5084
|
- * @description 生成数据交互面板
|
|
|
5085
|
- * @returns {Array}
|
|
|
5086
|
- */
|
|
|
5087
|
- function generateDataEventNode() {
|
|
|
5088
|
- const eventList = []
|
|
|
5089
|
- const eventNodeCls = 'interaction__container'
|
|
|
5090
|
- for (const item of interactionList) {
|
|
|
5091
|
- const checkbox = UseLayUi.createCheckBox({
|
|
|
5092
|
- dataSource: item,
|
|
|
5093
|
- layFilter: item.type,
|
|
|
5094
|
- valueField: 'type',
|
|
|
5095
|
- labelField: 'label',
|
|
|
5096
|
- })
|
|
|
5097
|
- const template = `
|
|
|
5098
|
- <div class="${ eventNodeCls }">
|
|
|
5099
|
- ${ checkbox }
|
|
|
5100
|
- <i id="${ item.type }"></i>
|
|
|
5101
|
- </div>`
|
|
|
5102
|
- eventList.push(template)
|
|
|
5103
|
- }
|
|
|
5104
|
- return eventList
|
|
|
5105
|
- }
|
|
|
5106
|
-
|
|
|
5107
|
/**
|
5115
|
/**
|
5108
|
* @description 生成操作节点
|
5116
|
* @description 生成操作节点
|
5109
|
* @param {object[]} list
|
5117
|
* @param {object[]} list
|
|
@@ -5114,14 +5122,14 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5114,14 +5122,14 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5114
|
for (const item of list) {
|
5122
|
for (const item of list) {
|
5115
|
const checkbox = UseLayUi.createCheckBox({
|
5123
|
const checkbox = UseLayUi.createCheckBox({
|
5116
|
dataSource: item,
|
5124
|
dataSource: item,
|
5117
|
- layFilter: item.checkboxName,
|
5125
|
+ layFilter: item.type,
|
5118
|
valueField: 'type',
|
5126
|
valueField: 'type',
|
5119
|
labelField: 'label',
|
5127
|
labelField: 'label',
|
5120
|
})
|
5128
|
})
|
5121
|
const template = `
|
5129
|
const template = `
|
5122
|
- <div class="${ eventNodeCls }">
|
|
|
5123
|
- ${ checkbox }
|
|
|
5124
|
- <i id="${ item.type }"></i>
|
5130
|
+ <div class="${eventNodeCls}">
|
|
|
5131
|
+ <div>${checkbox}</div>
|
|
|
5132
|
+ <i id="${item.type}"></i>
|
5125
|
</div>`
|
5133
|
</div>`
|
5126
|
eventList.push(template)
|
5134
|
eventList.push(template)
|
5127
|
}
|
5135
|
}
|
|
@@ -5132,230 +5140,293 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5132,230 +5140,293 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5132
|
/**
|
5140
|
/**
|
5133
|
* @description 创建数据源模块
|
5141
|
* @description 创建数据源模块
|
5134
|
*/
|
5142
|
*/
|
5135
|
- function createDataSourcePanel() {
|
|
|
5136
|
- const enumActionEl = {
|
|
|
5137
|
- ORG_EL: 'dataSourceOrg',
|
|
|
5138
|
- DEVICE_EL: 'dataSourceDevice',
|
|
|
5139
|
- SLAVE_DEVICE_EL: 'dataSourceSlaveDevice',
|
|
|
5140
|
- ATTR_EL: 'dataSourceAttr',
|
|
|
5141
|
- }
|
5143
|
+ // function createDataSourcePanel() {
|
|
|
5144
|
+ // const enumActionEl = {
|
|
|
5145
|
+ // ORG_EL: 'dataSourceOrg',
|
|
|
5146
|
+ // DEVICE_EL: 'dataSourceDevice',
|
|
|
5147
|
+ // SLAVE_DEVICE_EL: 'dataSourceSlaveDevice',
|
|
|
5148
|
+ // ATTR_EL: 'dataSourceAttr',
|
|
|
5149
|
+ // }
|
|
|
5150
|
+ //
|
|
|
5151
|
+ // const fragment = document.createDocumentFragment()
|
|
|
5152
|
+ // const defaultPanel = createPanel()
|
|
|
5153
|
+ // const title = createTitle('数据源')
|
|
|
5154
|
+ // let orgPanel, devicePanel, slaveDevicePanel, attrsPanel;
|
|
|
5155
|
+ // $(title).addClass('override__title--default')
|
|
|
5156
|
+ // $(defaultPanel).addClass('override__panel--default')
|
|
|
5157
|
+ //
|
|
|
5158
|
+ // /**
|
|
|
5159
|
+ // * @description 设备列表
|
|
|
5160
|
+ // */
|
|
|
5161
|
+ // let deviceList = []
|
|
|
5162
|
+ //
|
|
|
5163
|
+ //
|
|
|
5164
|
+ // /**
|
|
|
5165
|
+ // * @description 生成组织选择
|
|
|
5166
|
+ // */
|
|
|
5167
|
+ // async function generatorOrgTres() {
|
|
|
5168
|
+ // orgPanel = defaultPanel.cloneNode(false)
|
|
|
5169
|
+ // const orgContainer = `<div id="${ enumActionEl.ORG_EL }"></div>`
|
|
|
5170
|
+ // $(orgPanel).append(orgContainer)
|
|
|
5171
|
+ //
|
|
|
5172
|
+ // const [ err, res ] = await to(ConfigurationNodeApi.getOrgTree())
|
|
|
5173
|
+ // if (err) return
|
|
|
5174
|
+ // treeList = res
|
|
|
5175
|
+ //
|
|
|
5176
|
+ // UseLayUi.createTreeSelect({
|
|
|
5177
|
+ // elem: `#${ enumActionEl.ORG_EL }`,
|
|
|
5178
|
+ // layFilter: enumDataSourceConst.ORG_ID,
|
|
|
5179
|
+ // className: 'data-source__org--override',
|
|
|
5180
|
+ // label: '组织',
|
|
|
5181
|
+ // singleUsage: false,
|
|
|
5182
|
+ // treeProps: {
|
|
|
5183
|
+ // data: treeList,
|
|
|
5184
|
+ // onlyIconControl: true,
|
|
|
5185
|
+ // click(node) {
|
|
|
5186
|
+ // currentCheckedOrgNode = node.data.id
|
|
|
5187
|
+ // getDevicesByOrgId(node.data.id)
|
|
|
5188
|
+ // },
|
|
|
5189
|
+ // },
|
|
|
5190
|
+ // })
|
|
|
5191
|
+ // }
|
|
|
5192
|
+ //
|
|
|
5193
|
+ //
|
|
|
5194
|
+ // /**
|
|
|
5195
|
+ // * @description 生成设备选择器
|
|
|
5196
|
+ // */
|
|
|
5197
|
+ // function generatorDeviceSelect() {
|
|
|
5198
|
+ // devicePanel = defaultPanel.cloneNode(false)
|
|
|
5199
|
+ // const deviceSelect = UseLayUi.createSelect({
|
|
|
5200
|
+ // label: '设备',
|
|
|
5201
|
+ // layFilter: enumDataSourceConst.DEVICE_ID,
|
|
|
5202
|
+ // className: 'data-panel__select',
|
|
|
5203
|
+ // })
|
|
|
5204
|
+ // $(devicePanel).attr('id', enumActionEl.DEVICE_EL).append(deviceSelect)
|
|
|
5205
|
+ // }
|
|
|
5206
|
+ //
|
|
|
5207
|
+ // /**
|
|
|
5208
|
+ // * @description 生成从设备选择器
|
|
|
5209
|
+ // */
|
|
|
5210
|
+ // function generatorSlaveDevice() {
|
|
|
5211
|
+ // slaveDevicePanel = defaultPanel.cloneNode(false)
|
|
|
5212
|
+ // const slaveDeviceSelect = UseLayUi.createSelect({
|
|
|
5213
|
+ // label: '子设备',
|
|
|
5214
|
+ // layFilter: enumDataSourceConst.SLAVE_DEVICE_ID,
|
|
|
5215
|
+ // className: 'data-panel__select',
|
|
|
5216
|
+ // onClick(data) {
|
|
|
5217
|
+ // const { value } = data
|
|
|
5218
|
+ // getAttrByDeviceId(value)
|
|
|
5219
|
+ // },
|
|
|
5220
|
+ // })
|
|
|
5221
|
+ // $(slaveDevicePanel).css({ display: 'none' }).attr('id', enumActionEl.SLAVE_DEVICE_EL).append(slaveDeviceSelect)
|
|
|
5222
|
+ // }
|
|
|
5223
|
+ //
|
|
|
5224
|
+ // /**
|
|
|
5225
|
+ // * @description 生成属性选择器
|
|
|
5226
|
+ // */
|
|
|
5227
|
+ // function generatorAttrSelect() {
|
|
|
5228
|
+ // attrsPanel = defaultPanel.cloneNode(false)
|
|
|
5229
|
+ // const attrsSelect = UseLayUi.createSelect({
|
|
|
5230
|
+ // label: '属性',
|
|
|
5231
|
+ // layFilter: enumDataSourceConst.ATTR,
|
|
|
5232
|
+ // className: 'data-panel__select',
|
|
|
5233
|
+ // })
|
|
|
5234
|
+ // $(attrsPanel).attr('id', enumActionEl.ATTR_EL).append(attrsSelect)
|
|
|
5235
|
+ //
|
|
|
5236
|
+ // }
|
|
|
5237
|
+ //
|
|
|
5238
|
+ //
|
|
|
5239
|
+ // /**
|
|
|
5240
|
+ // * @description 根据组织ID获取设备
|
|
|
5241
|
+ // */
|
|
|
5242
|
+ // async function getDevicesByOrgId(organizationId) {
|
|
|
5243
|
+ // if (organizationId) {
|
|
|
5244
|
+ // const items = deviceList = await ConfigurationNodeApi.getMasterDevice(organizationId);
|
|
|
5245
|
+ // $(`#${ enumActionEl.DEVICE_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
5246
|
+ // form.render('select', CONTAINER_FILTER)
|
|
|
5247
|
+ // }
|
|
|
5248
|
+ // }
|
|
|
5249
|
+ //
|
|
|
5250
|
+ // /**
|
|
|
5251
|
+ // * @description 通过主设备ID获取从设备
|
|
|
5252
|
+ // */
|
|
|
5253
|
+ // async function getSlaveDeviceByMasterDeviceId(orgId, deviceId) {
|
|
|
5254
|
+ // if (deviceId && currentCheckedOrgNode) {
|
|
|
5255
|
+ // const items = await ConfigurationNodeApi.getSlaveDevice(orgId, deviceId);
|
|
|
5256
|
+ // $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
5257
|
+ // form.render('select', CONTAINER_FILTER)
|
|
|
5258
|
+ // }
|
|
|
5259
|
+ // }
|
|
|
5260
|
+ //
|
|
|
5261
|
+ // /**
|
|
|
5262
|
+ // * @description 根据设备ID获取属性
|
|
|
5263
|
+ // */
|
|
|
5264
|
+ // async function getAttrByDeviceId(tbDeviceId) {
|
|
|
5265
|
+ // if (tbDeviceId) {
|
|
|
5266
|
+ // const [ err, res ] = await to(ConfigurationNodeApi.getDeviceAttr(tbDeviceId))
|
|
|
5267
|
+ // $(`#${ enumActionEl.ATTR_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: res }))
|
|
|
5268
|
+ // form.render('select', CONTAINER_FILTER)
|
|
|
5269
|
+ // }
|
|
|
5270
|
+ // }
|
|
|
5271
|
+ //
|
|
|
5272
|
+ //
|
|
|
5273
|
+ // /**
|
|
|
5274
|
+ // * @description 数据回显
|
|
|
5275
|
+ // */
|
|
|
5276
|
+ // async function echoData() {
|
|
|
5277
|
+ //
|
|
|
5278
|
+ // echoRefreshFn = () => {
|
|
|
5279
|
+ // echoDataSource()
|
|
|
5280
|
+ // echoActionType()
|
|
|
5281
|
+ // form.render(null, CONTAINER_FILTER)
|
|
|
5282
|
+ // }
|
|
|
5283
|
+ //
|
|
|
5284
|
+ // await getNodeBindInfo()
|
|
|
5285
|
+ //
|
|
|
5286
|
+ //
|
|
|
5287
|
+ // function echoDataSource() {
|
|
|
5288
|
+ // const { dataSources = [] } = currentNodeData || {}
|
|
|
5289
|
+ // const [ dataSource = {} ] = dataSources
|
|
|
5290
|
+ // const { orgId, deviceId, slaveDeviceId, attr } = dataSource
|
|
|
5291
|
+ // const queue = []
|
|
|
5292
|
+ // if (orgId) {
|
|
|
5293
|
+ // currentCheckedOrgNode = orgId
|
|
|
5294
|
+ // queue.push(getDevicesByOrgId(orgId))
|
|
|
5295
|
+ // }
|
|
|
5296
|
+ // if (slaveDeviceId) {
|
|
|
5297
|
+ // queue.push(getSlaveDeviceByMasterDeviceId(orgId, deviceId))
|
|
|
5298
|
+ // $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'block' })
|
|
|
5299
|
+ // queue.push(getAttrByDeviceId(slaveDeviceId))
|
|
|
5300
|
+ // } else {
|
|
|
5301
|
+ // queue.push(getAttrByDeviceId(deviceId))
|
|
|
5302
|
+ // }
|
|
|
5303
|
+ // Promise.all(queue)
|
|
|
5304
|
+ // .finally(() => {
|
|
|
5305
|
+ // const orgNode = UseLayUi.findTreeObjectByField(treeList, currentCheckedOrgNode)
|
|
|
5306
|
+ // $(`#${ enumActionEl.ORG_EL } input[name="${ enumDataSourceConst.ORG_ID }"]`).parent().find('span').html(orgNode?.name)
|
|
|
5307
|
+ // form.val(CONTAINER_FILTER, {
|
|
|
5308
|
+ // orgId,
|
|
|
5309
|
+ // deviceId,
|
|
|
5310
|
+ // slaveDeviceId,
|
|
|
5311
|
+ // attr,
|
|
|
5312
|
+ // })
|
|
|
5313
|
+ // })
|
|
|
5314
|
+ // }
|
|
|
5315
|
+ //
|
|
|
5316
|
+ // async function echoActionType() {
|
|
|
5317
|
+ // const act = currentNodeData.act ?? []
|
|
|
5318
|
+ // const event = currentNodeData.event ?? []
|
|
|
5319
|
+ // const actionType = {}
|
|
|
5320
|
+ // for (const item of act) {
|
|
|
5321
|
+ // if (!item.condition || !item.condition?.length) {
|
|
|
5322
|
+ // $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', true)
|
|
|
5323
|
+ // } else {
|
|
|
5324
|
+ // $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', false)
|
|
|
5325
|
+ // }
|
|
|
5326
|
+ // actionType[item.type] = item.enabled
|
|
|
5327
|
+ // }
|
|
|
5328
|
+ // for (const item of event) {
|
|
|
5329
|
+ // if (!item.content) {
|
|
|
5330
|
+ // $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', true)
|
|
|
5331
|
+ // } else {
|
|
|
5332
|
+ // $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', false)
|
|
|
5333
|
+ // }
|
|
|
5334
|
+ // actionType[item.type] = item.enabled
|
|
|
5335
|
+ // }
|
|
|
5336
|
+ // form.val(CONTAINER_FILTER, actionType)
|
|
|
5337
|
+ // }
|
|
|
5338
|
+ // }
|
|
|
5339
|
+ //
|
|
|
5340
|
+ // function mount() {
|
|
|
5341
|
+ // generatorOrgTres()
|
|
|
5342
|
+ // generatorDeviceSelect()
|
|
|
5343
|
+ // generatorSlaveDevice()
|
|
|
5344
|
+ // generatorAttrSelect()
|
|
|
5345
|
+ // echoData()
|
|
|
5346
|
+ //
|
|
|
5347
|
+ // $(fragment).append(title).append(orgPanel).append(devicePanel).append(slaveDevicePanel).append(attrsPanel)
|
|
|
5348
|
+ //
|
|
|
5349
|
+ // $(container).append(fragment)
|
|
|
5350
|
+ //
|
|
|
5351
|
+ // }
|
|
|
5352
|
+ //
|
|
|
5353
|
+ // mount()
|
|
|
5354
|
+ //
|
|
|
5355
|
+ // }
|
5142
|
|
5356
|
|
|
|
5357
|
+ /**
|
|
|
5358
|
+ * @description 创建数据面板
|
|
|
5359
|
+ */
|
|
|
5360
|
+ function createDataSourcePanel() {
|
5143
|
const fragment = document.createDocumentFragment()
|
5361
|
const fragment = document.createDocumentFragment()
|
5144
|
const defaultPanel = createPanel()
|
5362
|
const defaultPanel = createPanel()
|
5145
|
const title = createTitle('数据源')
|
5363
|
const title = createTitle('数据源')
|
5146
|
- let orgPanel, devicePanel, slaveDevicePanel, attrsPanel;
|
|
|
5147
|
- $(title).addClass('override__title--default')
|
|
|
5148
|
$(defaultPanel).addClass('override__panel--default')
|
5364
|
$(defaultPanel).addClass('override__panel--default')
|
5149
|
-
|
|
|
5150
|
- /**
|
|
|
5151
|
- * @description 设备列表
|
|
|
5152
|
- */
|
|
|
5153
|
- let deviceList = []
|
|
|
5154
|
-
|
|
|
5155
|
-
|
|
|
5156
|
- /**
|
|
|
5157
|
- * @description 生成组织选择
|
|
|
5158
|
- */
|
|
|
5159
|
- async function generatorOrgTres() {
|
|
|
5160
|
- orgPanel = defaultPanel.cloneNode(false)
|
|
|
5161
|
- const orgContainer = `<div id="${ enumActionEl.ORG_EL }"></div>`
|
|
|
5162
|
- $(orgPanel).append(orgContainer)
|
|
|
5163
|
-
|
|
|
5164
|
- const [ err, res ] = await to(ConfigurationNodeApi.getOrgTree())
|
|
|
5165
|
- if (err) return
|
|
|
5166
|
- treeList = res
|
|
|
5167
|
-
|
|
|
5168
|
- UseLayUi.createTreeSelect({
|
|
|
5169
|
- elem: `#${ enumActionEl.ORG_EL }`,
|
|
|
5170
|
- layFilter: enumDataSourceConst.ORG_ID,
|
|
|
5171
|
- className: 'data-source__org--override',
|
|
|
5172
|
- label: '组织',
|
|
|
5173
|
- singleUsage: false,
|
|
|
5174
|
- treeProps: {
|
|
|
5175
|
- data: treeList,
|
|
|
5176
|
- onlyIconControl: true,
|
|
|
5177
|
- click(node) {
|
|
|
5178
|
- currentCheckedOrgNode = node.data.id
|
|
|
5179
|
- getDevicesByOrgId(node.data.id)
|
|
|
5180
|
- },
|
|
|
5181
|
- },
|
|
|
5182
|
- })
|
|
|
5183
|
- }
|
|
|
5184
|
-
|
|
|
5185
|
- /**
|
|
|
5186
|
- * @description 生成设备选择器
|
|
|
5187
|
- */
|
|
|
5188
|
- function generatorDeviceSelect() {
|
|
|
5189
|
- devicePanel = defaultPanel.cloneNode(false)
|
|
|
5190
|
- const deviceSelect = UseLayUi.createSelect({
|
|
|
5191
|
- label: '设备',
|
|
|
5192
|
- layFilter: enumDataSourceConst.DEVICE_ID,
|
|
|
5193
|
- className: 'data-panel__select',
|
|
|
5194
|
- onClick(data) {
|
|
|
5195
|
- const { value } = data
|
|
|
5196
|
- const selected = deviceList.find(item => item.id === value)
|
|
|
5197
|
- if (selected.deviceType === enumDataSourceConst.GATEWAY) {
|
|
|
5198
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'block' })
|
|
|
5199
|
- getSlaveDeviceByMasterDeviceId(currentCheckedOrgNode, selected.id)
|
|
|
5200
|
- } else {
|
|
|
5201
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'none' })
|
|
|
5202
|
- getAttrByDeviceId(selected.id)
|
|
|
5203
|
- }
|
|
|
5204
|
- },
|
|
|
5205
|
- })
|
|
|
5206
|
- $(devicePanel).attr('id', enumActionEl.DEVICE_EL).append(deviceSelect)
|
|
|
5207
|
- }
|
|
|
5208
|
-
|
|
|
5209
|
- /**
|
|
|
5210
|
- * @description 生成从设备选择器
|
|
|
5211
|
- */
|
|
|
5212
|
- function generatorSlaveDevice() {
|
|
|
5213
|
- slaveDevicePanel = defaultPanel.cloneNode(false)
|
|
|
5214
|
- const slaveDeviceSelect = UseLayUi.createSelect({
|
|
|
5215
|
- label: '子设备',
|
|
|
5216
|
- layFilter: enumDataSourceConst.SLAVE_DEVICE_ID,
|
|
|
5217
|
- className: 'data-panel__select',
|
|
|
5218
|
- onClick(data) {
|
|
|
5219
|
- const { value } = data
|
|
|
5220
|
- getAttrByDeviceId(value)
|
|
|
5221
|
- },
|
|
|
5222
|
- })
|
|
|
5223
|
- $(slaveDevicePanel).css({ display: 'none' }).attr('id', enumActionEl.SLAVE_DEVICE_EL).append(slaveDeviceSelect)
|
|
|
5224
|
- }
|
|
|
5225
|
-
|
|
|
5226
|
- /**
|
|
|
5227
|
- * @description 生成属性选择器
|
|
|
5228
|
- */
|
|
|
5229
|
- function generatorAttrSelect() {
|
|
|
5230
|
- attrsPanel = defaultPanel.cloneNode(false)
|
|
|
5231
|
- const attrsSelect = UseLayUi.createSelect({
|
|
|
5232
|
- label: '属性',
|
|
|
5233
|
- layFilter: enumDataSourceConst.ATTR,
|
|
|
5234
|
- className: 'data-panel__select',
|
|
|
5235
|
- })
|
|
|
5236
|
- $(attrsPanel).attr('id', enumActionEl.ATTR_EL).append(attrsSelect)
|
|
|
5237
|
-
|
|
|
5238
|
- }
|
|
|
5239
|
-
|
|
|
5240
|
-
|
|
|
5241
|
- /**
|
|
|
5242
|
- * @description 根据组织ID获取设备
|
|
|
5243
|
- */
|
|
|
5244
|
- async function getDevicesByOrgId(organizationId) {
|
|
|
5245
|
- if (organizationId) {
|
|
|
5246
|
- const items = deviceList = await ConfigurationNodeApi.getMasterDevice(organizationId);
|
|
|
5247
|
- $(`#${ enumActionEl.DEVICE_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
5248
|
- form.render('select', CONTAINER_FILTER)
|
|
|
5249
|
- }
|
|
|
5250
|
- }
|
|
|
5251
|
-
|
|
|
5252
|
- /**
|
|
|
5253
|
- * @description 通过主设备ID获取从设备
|
|
|
5254
|
- */
|
|
|
5255
|
- async function getSlaveDeviceByMasterDeviceId(orgId, deviceId) {
|
|
|
5256
|
- if (deviceId && currentCheckedOrgNode) {
|
|
|
5257
|
- const items = await ConfigurationNodeApi.getSlaveDevice(orgId, deviceId);
|
|
|
5258
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
5259
|
- form.render('select', CONTAINER_FILTER)
|
|
|
5260
|
- }
|
|
|
5261
|
- }
|
|
|
5262
|
-
|
|
|
5263
|
- /**
|
|
|
5264
|
- * @description 根据设备ID获取属性
|
|
|
5265
|
- */
|
|
|
5266
|
- async function getAttrByDeviceId(tbDeviceId) {
|
|
|
5267
|
- if (tbDeviceId) {
|
|
|
5268
|
- const [ err, res ] = await to(ConfigurationNodeApi.getDeviceAttr(tbDeviceId))
|
|
|
5269
|
- $(`#${ enumActionEl.ATTR_EL }`).find('select').html(UseLayUi.generateOptionTemplate({ dataSource: res }))
|
|
|
5270
|
- form.render('select', CONTAINER_FILTER)
|
|
|
5271
|
- }
|
|
|
5272
|
- }
|
5365
|
+ $(title).css({ padding: '6px 0 6px 6px' })
|
5273
|
|
5366
|
|
5274
|
|
5367
|
|
5275
|
- /**
|
|
|
5276
|
- * @description 数据回显
|
|
|
5277
|
- */
|
|
|
5278
|
- async function echoData() {
|
5368
|
+ async function mount() {
|
|
|
5369
|
+ const { component, echoDataSource } = generatorDataSourceComponent({ validate: false })
|
|
|
5370
|
+ $(fragment).append(title).append(component)
|
|
|
5371
|
+ $(container).append(fragment)
|
5279
|
|
5372
|
|
5280
|
- echoRefreshFn = () => {
|
|
|
5281
|
- echoDataSource()
|
5373
|
+ /**
|
|
|
5374
|
+ * @description 回显数据
|
|
|
5375
|
+ * @type {Function}
|
|
|
5376
|
+ */
|
|
|
5377
|
+ const refreshFn = echoRefreshFn
|
|
|
5378
|
+ echoRefreshFn = function () {
|
|
|
5379
|
+ refreshFn.apply(this)
|
|
|
5380
|
+ const { dataSources: [dataSource] = [] } = currentNodeData || {}
|
|
|
5381
|
+ echoDataSource(dataSource)
|
5282
|
echoActionType()
|
5382
|
echoActionType()
|
5283
|
form.render(null, CONTAINER_FILTER)
|
5383
|
form.render(null, CONTAINER_FILTER)
|
5284
|
}
|
5384
|
}
|
5285
|
|
5385
|
|
5286
|
await getNodeBindInfo()
|
5386
|
await getNodeBindInfo()
|
|
|
5387
|
+ }
|
5287
|
|
5388
|
|
5288
|
-
|
|
|
5289
|
- function echoDataSource() {
|
|
|
5290
|
- const { dataSources = [] } = currentNodeData || {}
|
|
|
5291
|
- const [ dataSource = {} ] = dataSources
|
|
|
5292
|
- const { orgId, deviceId, slaveDeviceId, attr } = dataSource
|
|
|
5293
|
- const queue = []
|
|
|
5294
|
- if (orgId) {
|
|
|
5295
|
- currentCheckedOrgNode = orgId
|
|
|
5296
|
- queue.push(getDevicesByOrgId(orgId))
|
|
|
5297
|
- }
|
|
|
5298
|
- if (slaveDeviceId) {
|
|
|
5299
|
- queue.push(getSlaveDeviceByMasterDeviceId(orgId, deviceId))
|
|
|
5300
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'block' })
|
|
|
5301
|
- queue.push(getAttrByDeviceId(slaveDeviceId))
|
5389
|
+ async function echoActionType() {
|
|
|
5390
|
+ const act = currentNodeData.act ?? []
|
|
|
5391
|
+ const event = currentNodeData.event ?? []
|
|
|
5392
|
+ const actionType = {}
|
|
|
5393
|
+ for (const item of act) {
|
|
|
5394
|
+ if (!item.condition || !item.condition?.length) {
|
|
|
5395
|
+ $(`.interaction__container input[name="${item.type}"]`).attr('disabled', true)
|
5302
|
} else {
|
5396
|
} else {
|
5303
|
- queue.push(getAttrByDeviceId(deviceId))
|
5397
|
+ $(`.interaction__container input[name="${item.type}"]`).attr('disabled', false)
|
5304
|
}
|
5398
|
}
|
5305
|
- Promise.all(queue)
|
|
|
5306
|
- .finally(() => {
|
|
|
5307
|
- const orgNode = UseLayUi.findTreeObjectByField(treeList, currentCheckedOrgNode)
|
|
|
5308
|
- $(`#${ enumActionEl.ORG_EL } input[name="${ enumDataSourceConst.ORG_ID }"]`).parent().find('span').html(orgNode?.name)
|
|
|
5309
|
- form.val(CONTAINER_FILTER, {
|
|
|
5310
|
- orgId,
|
|
|
5311
|
- deviceId,
|
|
|
5312
|
- slaveDeviceId,
|
|
|
5313
|
- attr,
|
|
|
5314
|
- })
|
|
|
5315
|
- })
|
5399
|
+ actionType[item.type] = item.enabled
|
5316
|
}
|
5400
|
}
|
5317
|
-
|
|
|
5318
|
- async function echoActionType() {
|
|
|
5319
|
- const act = currentNodeData.act ?? []
|
|
|
5320
|
- const event = currentNodeData.event ?? []
|
|
|
5321
|
- const actionType = {}
|
|
|
5322
|
- for (const item of act) {
|
|
|
5323
|
- if (!item.condition || !item.condition?.length) {
|
|
|
5324
|
- $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', true)
|
|
|
5325
|
- } else {
|
|
|
5326
|
- $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', false)
|
|
|
5327
|
- }
|
|
|
5328
|
- actionType[item.type] = item.enabled
|
|
|
5329
|
- }
|
|
|
5330
|
- for (const item of event) {
|
|
|
5331
|
- if (!item.content) {
|
|
|
5332
|
- $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', true)
|
|
|
5333
|
- } else {
|
|
|
5334
|
- $(`.interaction__container input[name="${ item.type }"]`).attr('disabled', false)
|
|
|
5335
|
- }
|
|
|
5336
|
- actionType[item.type] = item.enabled
|
5401
|
+ for (const item of event) {
|
|
|
5402
|
+ if (!item.content) {
|
|
|
5403
|
+ $(`.interaction__container input[name="${item.type}"]`).attr('disabled', true)
|
|
|
5404
|
+ } else {
|
|
|
5405
|
+ $(`.interaction__container input[name="${item.type}"]`).attr('disabled', false)
|
5337
|
}
|
5406
|
}
|
5338
|
- form.val(CONTAINER_FILTER, actionType)
|
5407
|
+ actionType[item.type] = item.enabled
|
5339
|
}
|
5408
|
}
|
5340
|
- }
|
|
|
5341
|
-
|
|
|
5342
|
- function mount() {
|
|
|
5343
|
- generatorOrgTres()
|
|
|
5344
|
- generatorDeviceSelect()
|
|
|
5345
|
- generatorSlaveDevice()
|
|
|
5346
|
- generatorAttrSelect()
|
|
|
5347
|
- echoData()
|
|
|
5348
|
-
|
|
|
5349
|
- $(fragment).append(title).append(orgPanel).append(devicePanel).append(slaveDevicePanel).append(attrsPanel)
|
|
|
5350
|
-
|
|
|
5351
|
- $(container).append(fragment)
|
|
|
5352
|
-
|
5409
|
+ form.val(CONTAINER_FILTER, actionType)
|
5353
|
}
|
5410
|
}
|
5354
|
|
5411
|
|
5355
|
mount()
|
5412
|
mount()
|
5356
|
-
|
|
|
5357
|
}
|
5413
|
}
|
5358
|
|
5414
|
|
|
|
5415
|
+ // /**
|
|
|
5416
|
+ // * @description 创建功能模块
|
|
|
5417
|
+ // */
|
|
|
5418
|
+ // function createFunctionPanel() {
|
|
|
5419
|
+ // const fragment = document.createDocumentFragment()
|
|
|
5420
|
+ // const title = createTitle('功能')
|
|
|
5421
|
+ // $(title).addClass('override__title--default')
|
|
|
5422
|
+ // fragment.append(title)
|
|
|
5423
|
+ // generateActionEventNode(functionList).forEach(item => {
|
|
|
5424
|
+ // const panel = createPanel()
|
|
|
5425
|
+ // $(panel).addClass('override__panel--default').append(item)
|
|
|
5426
|
+ // $(fragment).append(panel)
|
|
|
5427
|
+ // })
|
|
|
5428
|
+ // $(container).append(fragment)
|
|
|
5429
|
+ // }
|
5359
|
|
5430
|
|
5360
|
/**
|
5431
|
/**
|
5361
|
* @description 创建数据交互模块
|
5432
|
* @description 创建数据交互模块
|
|
@@ -5365,16 +5436,11 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5365,16 +5436,11 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5365
|
const title = createTitle('数据交互')
|
5436
|
const title = createTitle('数据交互')
|
5366
|
$(title).addClass('override__title--default')
|
5437
|
$(title).addClass('override__title--default')
|
5367
|
fragment.append(title)
|
5438
|
fragment.append(title)
|
5368
|
- generateDataEventNode().forEach(item => {
|
5439
|
+ generateActionEventNode(interactionList).forEach(item => {
|
5369
|
const panel = createPanel()
|
5440
|
const panel = createPanel()
|
5370
|
$(panel).addClass('override__panel--default').append(item)
|
5441
|
$(panel).addClass('override__panel--default').append(item)
|
5371
|
$(fragment).append(panel)
|
5442
|
$(fragment).append(panel)
|
5372
|
})
|
5443
|
})
|
5373
|
- // Object.keys(enumInteractionType).forEach(key => {
|
|
|
5374
|
- // form.on(`checkbox(${ key })`, event => {
|
|
|
5375
|
- // const isChecked = $(event.othis).hasClass('layui-form-checked')
|
|
|
5376
|
- // })
|
|
|
5377
|
- // })
|
|
|
5378
|
$(container).append(fragment)
|
5444
|
$(container).append(fragment)
|
5379
|
}
|
5445
|
}
|
5380
|
|
5446
|
|
|
@@ -5419,7 +5485,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5419,7 +5485,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5419
|
[enumDataSourceConst.ATTR]: field[enumDataSourceConst.ATTR],
|
5485
|
[enumDataSourceConst.ATTR]: field[enumDataSourceConst.ATTR],
|
5420
|
},
|
5486
|
},
|
5421
|
}
|
5487
|
}
|
5422
|
- const allType = [ ...interactionList, ...dynamicEffectList ]
|
5488
|
+ const allType = [...interactionList, ...dynamicEffectList]
|
5423
|
for (const item of allType) {
|
5489
|
for (const item of allType) {
|
5424
|
if (field[item.type] === ENABLED_FLAG) {
|
5490
|
if (field[item.type] === ENABLED_FLAG) {
|
5425
|
const enableItem = currentNodeData[item.category].find(each => each.type === item.type)
|
5491
|
const enableItem = currentNodeData[item.category].find(each => each.type === item.type)
|
|
@@ -5435,7 +5501,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5435,7 +5501,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5435
|
})
|
5501
|
})
|
5436
|
}
|
5502
|
}
|
5437
|
}
|
5503
|
}
|
5438
|
- const [ err, res ] = await to(ConfigurationNodeApi.updateNodeInfo(value))
|
5504
|
+ await to(autoSaveGraphInfo())
|
|
|
5505
|
+ const [err, res] = await to(ConfigurationNodeApi.updateNodeInfo(value))
|
5439
|
if (err) return
|
5506
|
if (err) return
|
5440
|
UseLayUi.successMsg()
|
5507
|
UseLayUi.successMsg()
|
5441
|
await getNodeBindInfo()
|
5508
|
await getNodeBindInfo()
|
|
@@ -5444,320 +5511,299 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5444,320 +5511,299 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5444
|
}
|
5511
|
}
|
5445
|
|
5512
|
|
5446
|
/**
|
5513
|
/**
|
5447
|
- * @description 处理数据交互 - down || up 按下与抬起
|
5514
|
+ * @description 处理设置变量图片
|
5448
|
*/
|
5515
|
*/
|
5449
|
- function handleDownOrUpEvent(event) {
|
|
|
5450
|
-
|
|
|
5451
|
- if (!currentCheckedOrgNode) {
|
|
|
5452
|
- layer.msg('请先选择组织')
|
|
|
5453
|
- return
|
|
|
5454
|
- }
|
|
|
5455
|
- // 事件类型
|
|
|
5456
|
- const enumEventType = {
|
|
|
5457
|
- DOWN: "按下",
|
|
|
5458
|
- UP: "抬起",
|
|
|
5459
|
- SINGLE: "单击",
|
|
|
5460
|
- DOUBLE: "双击",
|
|
|
5461
|
- };
|
5516
|
+ function handleSettingVarImage(event) {
|
5462
|
|
5517
|
|
5463
|
const enumActionEl = {
|
5518
|
const enumActionEl = {
|
5464
|
/**
|
5519
|
/**
|
5465
|
- * @description 表体节点
|
5520
|
+ * @description layer 保存按钮
|
5466
|
*/
|
5521
|
*/
|
5467
|
- DEVICE_DATA_BODY_EL: 'deviceDataTbody',
|
5522
|
+ LAYER_SUBMIT_FILTER: 'varImageLayerFilter',
|
5468
|
|
5523
|
|
5469
|
/**
|
5524
|
/**
|
5470
|
- * @description 删除行节点
|
5525
|
+ * @description 上传图片layer 按钮控制
|
5471
|
*/
|
5526
|
*/
|
5472
|
- DEL_ROW_EL: 'deleteRow',
|
5527
|
+ IMAGE_LAYER_FILTER: 'uploadImageLayerFilter',
|
5473
|
|
5528
|
|
5474
|
/**
|
5529
|
/**
|
5475
|
- * @description 增加行节点
|
5530
|
+ * @description 行控制
|
5476
|
*/
|
5531
|
*/
|
5477
|
- ADD_ROW_EL: 'addRow',
|
5532
|
+ ROW_FILTER: 'varImageTableRowFilter',
|
5478
|
|
5533
|
|
5479
|
/**
|
5534
|
/**
|
5480
|
- * @descripton
|
5535
|
+ * @description 颜色控制
|
5481
|
*/
|
5536
|
*/
|
5482
|
- ROW_FILTER: 'interactionRowFilter',
|
5537
|
+ COLOR_PICKER_FILTER: 'varImageTableColorPickerFilter',
|
5483
|
|
5538
|
|
5484
|
/**
|
5539
|
/**
|
5485
|
- * @description json editor
|
5540
|
+ * @description 最小值控制
|
5486
|
*/
|
5541
|
*/
|
5487
|
- EDITOR_JSON: 'editor__json-',
|
5542
|
+ MIN_FILTER: 'varImageTableMinFilter',
|
5488
|
|
5543
|
|
5489
|
/**
|
5544
|
/**
|
5490
|
- * @description 弹出层保存 filter
|
5545
|
+ * @description 最大值控制
|
5491
|
*/
|
5546
|
*/
|
5492
|
- LAYER_SUBMIT_FILTER: 'interactionLayerSubmit',
|
5547
|
+ MAX_FILTER: 'varImageTableMaxFilter',
|
5493
|
|
5548
|
|
5494
|
/**
|
5549
|
/**
|
5495
|
- * @description ace builder
|
5550
|
+ * @description 表体
|
5496
|
*/
|
5551
|
*/
|
5497
|
- JSON: 'ace__builder-json',
|
|
|
5498
|
- }
|
5552
|
+ TABLE_BODY_EL: 'variableImageTable',
|
5499
|
|
5553
|
|
|
|
5554
|
+ /**
|
|
|
5555
|
+ * @description 添加行控制
|
|
|
5556
|
+ */
|
|
|
5557
|
+ ADD_ROW_EL: 'variableImageTableAddRow',
|
5500
|
|
5558
|
|
5501
|
- /**
|
|
|
5502
|
- * @description 所有设备选项
|
|
|
5503
|
- * @type {*[]}
|
|
|
5504
|
- */
|
|
|
5505
|
- let allDeviceOptions = []
|
5559
|
+ /**
|
|
|
5560
|
+ * @description 设置图片控制
|
|
|
5561
|
+ */
|
|
|
5562
|
+ SET_IMG_EL: 'variableImageTableSetImgEl',
|
5506
|
|
5563
|
|
5507
|
- let addRowNumber = 0
|
5564
|
+ /**
|
|
|
5565
|
+ * @description 预览区域控制
|
|
|
5566
|
+ */
|
|
|
5567
|
+ PREVIEW_IMG_CONTAINER: 'img__container',
|
5508
|
|
5568
|
|
5509
|
- const getRowFilter = (rowNumber) => `${ enumActionEl.ROW_FILTER }${ rowNumber }`
|
5569
|
+ /**
|
|
|
5570
|
+ * @description 删除图片控制
|
|
|
5571
|
+ */
|
|
|
5572
|
+ DEL_PREVIEW_IMG: 'img__delete',
|
|
|
5573
|
+
|
|
|
5574
|
+ /**
|
|
|
5575
|
+ * @description 删除行控制
|
|
|
5576
|
+ */
|
|
|
5577
|
+ DEL_ROW_EL: 'variableImageTableDelRow',
|
|
|
5578
|
+
|
|
|
5579
|
+ /**
|
|
|
5580
|
+ * @description
|
|
|
5581
|
+ */
|
|
|
5582
|
+ DATA_SOURCE_COMP_EL: 'varImgDataSourceEl',
|
|
|
5583
|
+ }
|
5510
|
|
5584
|
|
5511
|
- /**
|
|
|
5512
|
- * @description 枚举常量
|
|
|
5513
|
- * @enum DEVICE
|
|
|
5514
|
- */
|
|
|
5515
|
const enumConst = {
|
5585
|
const enumConst = {
|
|
|
5586
|
+
|
5516
|
/**
|
5587
|
/**
|
5517
|
- * @description 设备
|
5588
|
+ * @description 最小值
|
5518
|
*/
|
5589
|
*/
|
5519
|
- DEVICE: 'deviceId',
|
5590
|
+ MIN: 'min',
|
|
|
5591
|
+
|
5520
|
/**
|
5592
|
/**
|
5521
|
- * @description 子设备
|
5593
|
+ * @description 最大值
|
5522
|
*/
|
5594
|
*/
|
5523
|
- SLAVE_DEVICE: 'slaveDeviceId',
|
5595
|
+ MAX: 'max',
|
|
|
5596
|
+
|
5524
|
/**
|
5597
|
/**
|
5525
|
- * @description 变量
|
5598
|
+ * @description 图片字段 key
|
5526
|
*/
|
5599
|
*/
|
5527
|
- ATTR: 'attr',
|
5600
|
+ IMAGE: 'image',
|
|
|
5601
|
+
|
5528
|
/**
|
5602
|
/**
|
5529
|
- * @description 下发值
|
5603
|
+ * @description 颜色
|
5530
|
*/
|
5604
|
*/
|
5531
|
- VALUE: 'value',
|
5605
|
+ COLOR: 'color',
|
5532
|
|
5606
|
|
5533
|
/**
|
5607
|
/**
|
5534
|
- * @description 方式
|
5608
|
+ * @description 图片来源
|
5535
|
*/
|
5609
|
*/
|
5536
|
- WAY: 'way',
|
5610
|
+ IMAGE_ORIGIN: 'imageOrigin',
|
|
|
5611
|
+
|
|
|
5612
|
+ /**
|
|
|
5613
|
+ * @description 图库图形类别
|
|
|
5614
|
+ */
|
|
|
5615
|
+ IMAGE_GALLERY_CATEGORY: 'category',
|
|
|
5616
|
+
|
|
|
5617
|
+ /**
|
|
|
5618
|
+ * @description 图表图形路径
|
|
|
5619
|
+ */
|
|
|
5620
|
+ IMAGE_GALLERY_IMAGE_PATH: 'imagePath',
|
5537
|
}
|
5621
|
}
|
5538
|
|
5622
|
|
5539
|
- const sendInstructionWay = {
|
|
|
5540
|
- ONE_WAR: 'oneway',
|
|
|
5541
|
- TWO_WAY: 'twoway',
|
5623
|
+ let addRowNumber = 0
|
|
|
5624
|
+
|
|
|
5625
|
+ let getDataSourceValue = () => {
|
5542
|
}
|
5626
|
}
|
5543
|
|
5627
|
|
|
|
5628
|
+ const getRowFilter = (rowNumber) => `${enumActionEl.ROW_FILTER}${rowNumber}`
|
|
|
5629
|
+
|
|
|
5630
|
+ const getColorPickerFilter = (rowNumber) => `${enumActionEl.COLOR_PICKER_FILTER}${rowNumber}`
|
|
|
5631
|
+
|
5544
|
/**
|
5632
|
/**
|
5545
|
- * @description 创建回显数据 查询出所有网关设备和直连设备
|
5633
|
+ * @description 监听表格中的事件
|
5546
|
*/
|
5634
|
*/
|
5547
|
- async function getMaterDevice() {
|
|
|
5548
|
- if (!currentCheckedOrgNode) return
|
|
|
5549
|
- const [ err, res ] = await to(ConfigurationNodeApi.getMasterDevice(currentCheckedOrgNode))
|
|
|
5550
|
- allDeviceOptions = res
|
|
|
5551
|
- }
|
|
|
5552
|
-
|
|
|
5553
|
- function createEditor(el, datum = {}) {
|
|
|
5554
|
- const editor = ace.edit(el, {
|
|
|
5555
|
- maxLines: 10, // 最大行数,超过会自动出现滚动条
|
|
|
5556
|
- minLines: 5, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小
|
|
|
5557
|
- fontSize: 14, // 编辑器内字体大小
|
|
|
5558
|
- tabSize: 2, // 制表符设置为 4 个空格大小
|
|
|
5559
|
- });
|
|
|
5560
|
- editor.session.setMode("ace/mode/json");
|
|
|
5561
|
- editor.getSession().on('change', (event, editor) => {
|
|
|
5562
|
- $(`#${ el }`).parent().find(`textarea[name="${ enumConst.VALUE }"]`).val(editor.getValue())
|
|
|
5563
|
- })
|
|
|
5564
|
- editor.setValue(datum[enumConst.VALUE] ? datum[enumConst.VALUE] : "{}")
|
|
|
5565
|
- }
|
|
|
5566
|
-
|
|
|
5567
|
- function addRecord(datum) {
|
|
|
5568
|
- const content = `
|
|
|
5569
|
- <tr class="layui-form" lay-filter="${ getRowFilter(addRowNumber) }">
|
|
|
5570
|
- <td>
|
|
|
5571
|
- <select name="${ enumConst.DEVICE }" lay-filter="${ enumConst.DEVICE }" lay-verType="tips" lay-verify="required"></select>
|
|
|
5572
|
- </td>
|
|
|
5573
|
- <td>
|
|
|
5574
|
- <select name="${ enumConst.SLAVE_DEVICE }" lay-filter="${ enumConst.SLAVE_DEVICE }" lay-verType="tips"></select>
|
|
|
5575
|
- </td>
|
|
|
5576
|
- <td>
|
|
|
5577
|
- <form action="" style="display: flex">
|
|
|
5578
|
- <div class="override__radio-default">
|
|
|
5579
|
- <input id="${ getRowFilter(addRowNumber) }${ sendInstructionWay.ONE_WAR }" type="radio" name="${ enumConst.WAY }" lay-ignore value="${ sendInstructionWay.ONE_WAR }" title="单向" checked="">
|
|
|
5580
|
- <label for="${ getRowFilter(addRowNumber) }${ sendInstructionWay.ONE_WAR }" class="override__radio-label">单向</label>
|
|
|
5581
|
- </div>
|
|
|
5582
|
- <div class="override__radio-default">
|
|
|
5583
|
- <input id="${ getRowFilter(addRowNumber) }${ sendInstructionWay.TWO_WAY }" type="radio" name="${ enumConst.WAY }" lay-ignore value="${ sendInstructionWay.TWO_WAY }" title="双向">
|
|
|
5584
|
- <label for="${ getRowFilter(addRowNumber) }${ sendInstructionWay.TWO_WAY }" class="override__radio-label">双向</label>
|
|
|
5585
|
- </div>
|
|
|
5586
|
- </form>
|
|
|
5587
|
- </td>
|
|
|
5588
|
- <td class="${ enumActionEl.JSON }">
|
|
|
5589
|
- <div style="width: 100%;height: 100%;">
|
|
|
5590
|
- <div id="${ enumActionEl.EDITOR_JSON }${ addRowNumber }"></div>
|
|
|
5591
|
- <textarea style="display: none" name="${ enumConst.VALUE }" placeholder="请输入命令" lay-verType="tips" class="layui-textarea"></textarea>
|
|
|
5592
|
- </div>
|
|
|
5593
|
- </td>
|
|
|
5594
|
- <td>
|
|
|
5595
|
- <button type="button" class="layui-btn layui-btn-primary layui-border-red ${ enumActionEl.DEL_ROW_EL }">删除</button>
|
|
|
5596
|
- </td>
|
|
|
5597
|
- </tr>
|
|
|
5598
|
- `
|
|
|
5599
|
- $(`#${ enumActionEl.DEVICE_DATA_BODY_EL }`).append(content)
|
|
|
5600
|
- setDeviceOptions(addRowNumber)
|
|
|
5601
|
- createEditor(`${ enumActionEl.EDITOR_JSON }${ addRowNumber }`, datum)
|
|
|
5602
|
- form.render('select', getRowFilter(addRowNumber))
|
|
|
5603
|
- addRowNumber++
|
|
|
5604
|
- }
|
|
|
5605
|
-
|
|
|
5606
|
- /**
|
|
|
5607
|
- * @description 更新变量选项
|
|
|
5608
|
- */
|
|
|
5609
|
- async function updateVariableOptions(data) {
|
|
|
5610
|
- if (!data.value) return
|
|
|
5611
|
- const [ err, res ] = await to(ConfigurationNodeApi.getDeviceAttr(data.value))
|
|
|
5612
|
- if (!res) return
|
|
|
5613
|
- const generateOption = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
5614
|
- $(data.elem).parents('tr').find(`select[name="${ enumConst.ATTR }"]`).html(generateOption)
|
|
|
5615
|
- form.render('select')
|
|
|
5616
|
- }
|
|
|
5617
|
-
|
|
|
5618
|
- /**
|
|
|
5619
|
- * @description 选择设备监听事件
|
|
|
5620
|
- */
|
|
|
5621
|
- function createSelectDeviceListenEvent() {
|
|
|
5622
|
- form.on(`select(${ enumConst.DEVICE })`, async (data) => {
|
|
|
5623
|
- const isGATEWAY = allDeviceOptions.find(item => item.id === data.value)?.deviceType === "GATEWAY"
|
|
|
5624
|
- // 网关设备请求子设备
|
|
|
5625
|
- if (isGATEWAY && data.value) {
|
|
|
5626
|
- const [ err, res ] = await to(ConfigurationNodeApi.getSlaveDevice(currentCheckedOrgNode, data.value))
|
|
|
5627
|
- if (!res) return
|
|
|
5628
|
- const generateOption = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
5629
|
- $(data.elem).parents('tr').find(`select[name="${ enumConst.SLAVE_DEVICE }"]`).html(generateOption)
|
|
|
5630
|
- }
|
|
|
5631
|
- // else {
|
|
|
5632
|
- // updateVariableOptions(data)
|
|
|
5633
|
- // }
|
|
|
5634
|
- form.render('select')
|
|
|
5635
|
- })
|
|
|
5636
|
- // form.on(`select(${ enumConst.SLAVE_DEVICE })`, (data) => {
|
|
|
5637
|
- // updateVariableOptions(data)
|
|
|
5638
|
- // })
|
5635
|
+ function generatorEventListen() {
|
|
|
5636
|
+ createInputListener()
|
|
|
5637
|
+ createAddRowEvent()
|
|
|
5638
|
+ createDelRowEvent()
|
|
|
5639
|
+ createSetImgEvent()
|
|
|
5640
|
+ createDelPreviewImgEvent()
|
5639
|
}
|
5641
|
}
|
5640
|
|
5642
|
|
5641
|
/**
|
5643
|
/**
|
5642
|
* @description 删除行
|
5644
|
* @description 删除行
|
5643
|
*/
|
5645
|
*/
|
5644
|
- function createDeleteRowListenEvent() {
|
|
|
5645
|
- $(`.${ enumActionEl.DEL_ROW_EL }`).click((event) => {
|
|
|
5646
|
- // $(event.target).parents('tr').find('editor')
|
5646
|
+ function createDelRowEvent() {
|
|
|
5647
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).on('click', `.${enumActionEl.DEL_ROW_EL}`, (event) => {
|
5647
|
$(event.target).parents('tr').remove()
|
5648
|
$(event.target).parents('tr').remove()
|
5648
|
})
|
5649
|
})
|
5649
|
}
|
5650
|
}
|
5650
|
|
5651
|
|
5651
|
/**
|
5652
|
/**
|
5652
|
- * @description 新增行
|
5653
|
+ * @description 添加行事件
|
5653
|
*/
|
5654
|
*/
|
5654
|
- function createAddRowListenEvent() {
|
|
|
5655
|
- $(`#${ enumActionEl.ADD_ROW_EL }`).click(() => {
|
5655
|
+ function createAddRowEvent() {
|
|
|
5656
|
+ $(`#${enumActionEl.ADD_ROW_EL}`).on('click', () => {
|
5656
|
addRecord()
|
5657
|
addRecord()
|
5657
|
- const generateOption = UseLayUi.generateOptionTemplate({ dataSource: allDeviceOptions })
|
|
|
5658
|
- $(`#${ enumActionEl.DEVICE_DATA_BODY_EL } tr`).last().find(`select[name="${ enumConst.DEVICE }"]`).html(generateOption)
|
|
|
5659
|
- createDeleteRowListenEvent()
|
|
|
5660
|
- form.render('select')
|
|
|
5661
|
})
|
5658
|
})
|
5662
|
}
|
5659
|
}
|
5663
|
|
5660
|
|
5664
|
/**
|
5661
|
/**
|
5665
|
- * @description 设置设备选项
|
5662
|
+ * @description 删除已选择的变量图片
|
5666
|
*/
|
5663
|
*/
|
5667
|
- function setDeviceOptions(row) {
|
|
|
5668
|
- const generateOption = UseLayUi.generateOptionTemplate({ dataSource: allDeviceOptions })
|
|
|
5669
|
- $(`#${ enumActionEl.DEVICE_DATA_BODY_EL } tr[lay-filter="${ getRowFilter(row) }"]`).find(`select[name="${ enumConst.DEVICE }"]`).html(generateOption)
|
5664
|
+ function createDelPreviewImgEvent() {
|
|
|
5665
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).on('click', `.${enumActionEl.DEL_PREVIEW_IMG}`, (event) => {
|
|
|
5666
|
+ $(event.target)
|
|
|
5667
|
+ .parents(`div.${enumActionEl.PREVIEW_IMG_CONTAINER}`).find('img').attr('src', '')
|
|
|
5668
|
+ const rowFilter = $(event.target).parents(`tr`).attr('lay-filter')
|
|
|
5669
|
+ form.val(rowFilter, {
|
|
|
5670
|
+ [enumConst.IMAGE_ORIGIN]: null,
|
|
|
5671
|
+ [enumConst.IMAGE_GALLERY_CATEGORY]: null,
|
|
|
5672
|
+ [enumConst.IMAGE_GALLERY_IMAGE_PATH]: null,
|
|
|
5673
|
+ })
|
|
|
5674
|
+ })
|
5670
|
}
|
5675
|
}
|
5671
|
|
5676
|
|
5672
|
/**
|
5677
|
/**
|
5673
|
- * @description 生成事件监听
|
5678
|
+ * @description 选择图片
|
5674
|
*/
|
5679
|
*/
|
5675
|
- function generatorEventListen() {
|
|
|
5676
|
- createSelectDeviceListenEvent()
|
|
|
5677
|
- createDeleteRowListenEvent()
|
|
|
5678
|
- createAddRowListenEvent()
|
5680
|
+ function createSetImgEvent() {
|
|
|
5681
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).on('click', `.${enumActionEl.SET_IMG_EL}`, (event) => {
|
|
|
5682
|
+ if ($(event.target).hasClass(enumActionEl.DEL_PREVIEW_IMG)) return
|
|
|
5683
|
+ const rowFilter = $(event.target).parents('tr').attr('lay-filter')
|
|
|
5684
|
+ // createUploadImgLayer(rowFilter)
|
|
|
5685
|
+ generatorUploadLayerComponent((imageState) => {
|
|
|
5686
|
+
|
|
|
5687
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`)
|
|
|
5688
|
+ .find(`tr[lay-filter="${rowFilter}"]`)
|
|
|
5689
|
+ .find('img').attr('src', imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH])
|
|
|
5690
|
+
|
|
|
5691
|
+ form.val(rowFilter, {
|
|
|
5692
|
+ [enumConst.IMAGE_ORIGIN]: imageState[enumConst.IMAGE_ORIGIN],
|
|
|
5693
|
+ [enumConst.IMAGE_GALLERY_CATEGORY]: imageState[enumConst.IMAGE_GALLERY_CATEGORY],
|
|
|
5694
|
+ [enumConst.IMAGE_GALLERY_IMAGE_PATH]: imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH],
|
|
|
5695
|
+ })
|
|
|
5696
|
+ })
|
|
|
5697
|
+ })
|
5679
|
}
|
5698
|
}
|
5680
|
|
5699
|
|
5681
|
/**
|
5700
|
/**
|
5682
|
- * @description 挂载选项 根据行号 key 挂载option
|
|
|
5683
|
- * @param row 行号
|
|
|
5684
|
- * @param key select name
|
|
|
5685
|
- * @param data 数据源
|
5701
|
+ * @description 创建输入验证
|
5686
|
*/
|
5702
|
*/
|
5687
|
- function mountSelectOptions(row, key, data) {
|
|
|
5688
|
- const generateOption = UseLayUi.generateOptionTemplate({ dataSource: data })
|
|
|
5689
|
- $(`#${ enumActionEl.DEVICE_DATA_BODY_EL }`).find(`tr[lay-filter="${ getRowFilter(row) }"] select[name="${ key }"]`).html(generateOption)
|
5703
|
+ function createInputListener() {
|
|
|
5704
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`)
|
|
|
5705
|
+ .on('input', `.${enumActionEl.MIN_FILTER}`, event => {
|
|
|
5706
|
+ const minVal = $(event.target).val()
|
|
|
5707
|
+ const maxVal = $(event.target).parents('tr').find(`input.${enumActionEl.MAX_FILTER}`).val()
|
|
|
5708
|
+ if (maxVal !== '' && Number(minVal) > Number(maxVal)) {
|
|
|
5709
|
+ layer.tips('输入值大于最大值', $(event.target), {
|
|
|
5710
|
+ tips: 1,
|
|
|
5711
|
+ });
|
|
|
5712
|
+ }
|
|
|
5713
|
+ })
|
|
|
5714
|
+ .on('input', `.${enumActionEl.MAX_FILTER}`, event => {
|
|
|
5715
|
+ const maxVal = $(event.target).val()
|
|
|
5716
|
+ const minVal = $(event.target).parents('tr').find(`input.${enumActionEl.MIN_FILTER}`).val()
|
|
|
5717
|
+ if (minVal !== '' && Number(maxVal) < Number(minVal)) {
|
|
|
5718
|
+ layer.tips('输入值小于最小值', $(event.target), {
|
|
|
5719
|
+ tips: 1,
|
|
|
5720
|
+ });
|
|
|
5721
|
+ }
|
|
|
5722
|
+ })
|
5690
|
}
|
5723
|
}
|
5691
|
|
5724
|
|
5692
|
/**
|
5725
|
/**
|
5693
|
- * @description 根据主设备ID获取从设备
|
5726
|
+ * @description 添加记录
|
5694
|
*/
|
5727
|
*/
|
5695
|
- async function getSlaveDeviceByMasterDevice(deviceId, row) {
|
|
|
5696
|
- const res = await ConfigurationNodeApi.getSlaveDevice(currentCheckedOrgNode, deviceId)
|
|
|
5697
|
- mountSelectOptions(row, enumConst.SLAVE_DEVICE, res)
|
5728
|
+ function addRecord() {
|
|
|
5729
|
+ const rowFormFilter = getRowFilter(addRowNumber)
|
|
|
5730
|
+ const content = `
|
|
|
5731
|
+ <tr class="layui-form" lay-filter="${rowFormFilter}">
|
|
|
5732
|
+ <td>
|
|
|
5733
|
+ <div class="layui-form-item">
|
|
|
5734
|
+ <input class="layui-input ${enumActionEl.MIN_FILTER}" autocomplete="off" type="number" name="${enumConst.MIN}" lay-filter="${enumConst.MIN}" lay-verType="tips" lay-verify="required" />
|
|
|
5735
|
+ </div>
|
|
|
5736
|
+ </td>
|
|
|
5737
|
+ <td>
|
|
|
5738
|
+ <div class="layui-form-item">
|
|
|
5739
|
+ <input class="layui-input ${enumActionEl.MAX_FILTER}"" autocomplete="off" type="number" name="${enumConst.MAX}" lay-filter="${enumConst.MAX}" lay-verType="tips" lay-verify="required" />
|
|
|
5740
|
+ </div>
|
|
|
5741
|
+ </td>
|
|
|
5742
|
+ <td>
|
|
|
5743
|
+ <div class="${enumActionEl.SET_IMG_EL}">
|
|
|
5744
|
+ <input name="${enumConst.IMAGE_GALLERY_CATEGORY}" type="text" style="display: none">
|
|
|
5745
|
+ <input name="${enumConst.IMAGE_GALLERY_IMAGE_PATH}" type="text" style="display: none">
|
|
|
5746
|
+ <input name="${enumConst.IMAGE_ORIGIN}" type="text" style="display: none">
|
|
|
5747
|
+ <div class="${enumActionEl.PREVIEW_IMG_CONTAINER}">
|
|
|
5748
|
+ <img src="" alt="">
|
|
|
5749
|
+ <div class="${enumActionEl.DEL_PREVIEW_IMG}">x</div>
|
|
|
5750
|
+ <div class="add__button">+</div>
|
|
|
5751
|
+ </div>
|
|
|
5752
|
+ </div>
|
|
|
5753
|
+ </td>
|
|
|
5754
|
+<!-- <td>-->
|
|
|
5755
|
+<!-- <div style="display: flex">-->
|
|
|
5756
|
+<!-- <input class="layui-input" style="border-width: 1px; border-right: none;" autocomplete="off" ype="number" name="${enumConst.COLOR}" lay-filter="${enumConst.COLOR}" lay-verType="tips" lay-verify="required" />-->
|
|
|
5757
|
+<!-- <div id="${getColorPickerFilter(addRowNumber)}"></div>-->
|
|
|
5758
|
+<!-- </div>-->
|
|
|
5759
|
+<!-- </td>-->
|
|
|
5760
|
+ <td style="text-align: center">
|
|
|
5761
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-red ${enumActionEl.DEL_ROW_EL}">删除</button>
|
|
|
5762
|
+ </td>
|
|
|
5763
|
+ </tr>
|
|
|
5764
|
+ `
|
|
|
5765
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).append(content)
|
|
|
5766
|
+ // colorpicker.render({
|
|
|
5767
|
+ // elem: $(`#${getColorPickerFilter(addRowNumber)}`),
|
|
|
5768
|
+ // done(color) {
|
|
|
5769
|
+ // $(`#${enumActionEl.TABLE_BODY_EL} tr[lay-filter="${rowFormFilter}"]`).find(`input[lay-filter="${enumConst.COLOR}"]`).val(color)
|
|
|
5770
|
+ // },
|
|
|
5771
|
+ // predefine: true,
|
|
|
5772
|
+ // });
|
|
|
5773
|
+ form.render()
|
|
|
5774
|
+ addRowNumber++
|
5698
|
}
|
5775
|
}
|
5699
|
|
5776
|
|
5700
|
- /**
|
|
|
5701
|
- * @description 根据设备ID获取设备属性
|
|
|
5702
|
- */
|
|
|
5703
|
- async function getDeviceAttrByDeviceId(deviceId, row) {
|
|
|
5704
|
- const res = await ConfigurationNodeApi.getDeviceAttr(deviceId)
|
|
|
5705
|
- mountSelectOptions(row, enumConst.ATTR, res)
|
|
|
5706
|
- }
|
|
|
5707
|
|
5777
|
|
5708
|
/**
|
5778
|
/**
|
5709
|
- * @description 回显表单数据
|
5779
|
+ * @description 回显数据
|
5710
|
*/
|
5780
|
*/
|
5711
|
function echoFormData(info) {
|
5781
|
function echoFormData(info) {
|
5712
|
- const { content: { data = [] } = {} } = info
|
|
|
5713
|
- data.forEach((datum, index) => echoEachData(datum, index))
|
5782
|
+ const { condition = [] } = info
|
|
|
5783
|
+ condition.forEach((item, index) => {
|
|
|
5784
|
+ addRecord()
|
|
|
5785
|
+ const rowFilter = getRowFilter(index)
|
|
|
5786
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).find(`tr[lay-filter="${rowFilter}"] .${enumActionEl.PREVIEW_IMG_CONTAINER}>img`).attr('src', item[enumConst.IMAGE_GALLERY_IMAGE_PATH])
|
|
|
5787
|
+ form.val(rowFilter, { ...item })
|
|
|
5788
|
+ })
|
5714
|
}
|
5789
|
}
|
5715
|
|
5790
|
|
5716
|
/**
|
5791
|
/**
|
5717
|
- * @description 回显每条数据
|
5792
|
+ * @description 验证最大最小值
|
|
|
5793
|
+ * @param tableData
|
|
|
5794
|
+ * @returns {boolean}
|
5718
|
*/
|
5795
|
*/
|
5719
|
- function echoEachData(datum = {}, row) {
|
|
|
5720
|
- addRecord(datum)
|
|
|
5721
|
- const deviceId = datum[enumConst.DEVICE]
|
|
|
5722
|
- const slaveDeviceId = datum[enumConst.SLAVE_DEVICE]
|
|
|
5723
|
- const queue = []
|
|
|
5724
|
-
|
|
|
5725
|
- if (slaveDeviceId) {
|
|
|
5726
|
- queue.push(() => getSlaveDeviceByMasterDevice(deviceId, row))
|
|
|
5727
|
- // queue.push(() => getDeviceAttrByDeviceId(slaveDeviceId, row))
|
|
|
5728
|
- }
|
|
|
5729
|
- // else {
|
|
|
5730
|
- // queue.push(() => getDeviceAttrByDeviceId(deviceId, row))
|
|
|
5731
|
- // }
|
|
|
5732
|
-
|
|
|
5733
|
- Promise
|
|
|
5734
|
- .all(queue.map(item => item()))
|
|
|
5735
|
- .finally(() => {
|
|
|
5736
|
- form.val(getRowFilter(row), datum)
|
|
|
5737
|
- })
|
|
|
5738
|
- }
|
|
|
5739
|
-
|
|
|
5740
|
- function isJson(string) {
|
|
|
5741
|
- if (typeof string === 'string') {
|
|
|
5742
|
- try {
|
|
|
5743
|
- const obj = JSON.parse(string)
|
|
|
5744
|
- if (typeof obj === 'object' && obj !== null) {
|
|
|
5745
|
- return true
|
|
|
5746
|
- }
|
|
|
5747
|
- } catch (e) {
|
|
|
5748
|
- return false
|
|
|
5749
|
- }
|
|
|
5750
|
- }
|
|
|
5751
|
- return false
|
|
|
5752
|
- }
|
|
|
5753
|
-
|
|
|
5754
|
function validate(tableData) {
|
5796
|
function validate(tableData) {
|
5755
|
let validateFlag = true
|
5797
|
let validateFlag = true
|
5756
|
for (let i = 0; i < tableData.length; i++) {
|
5798
|
for (let i = 0; i < tableData.length; i++) {
|
5757
|
- const { value } = tableData[i]
|
|
|
5758
|
- if (!isJson(value)) {
|
5799
|
+ const { min, max } = tableData[i]
|
|
|
5800
|
+ if (Number(min) > Number(max)) {
|
|
|
5801
|
+ validateFlag = false
|
|
|
5802
|
+ layer.tips('输入值大于最大值', $(`#${enumActionEl.TABLE_BODY_EL} tr`).eq(i).find(`input[name="${enumConst.MIN}"]`))
|
|
|
5803
|
+ break
|
|
|
5804
|
+ } else if (Number(max) < Number(min)) {
|
5759
|
validateFlag = false
|
5805
|
validateFlag = false
|
5760
|
- layer.tips('下发值不正确', $(`#${ enumActionEl.DEVICE_DATA_BODY_EL } tr`).eq(i).find(`td.${ enumActionEl.JSON }`), { tips: 1 })
|
5806
|
+ layer.tips('输入值小于最小值', $(`#${enumActionEl.TABLE_BODY_EL} tr`).eq(i).find(`input[name="${enumConst.MAX}"]`))
|
5761
|
break
|
5807
|
break
|
5762
|
}
|
5808
|
}
|
5763
|
}
|
5809
|
}
|
|
@@ -5765,85 +5811,60 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5765,85 +5811,60 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5765
|
}
|
5811
|
}
|
5766
|
|
5812
|
|
5767
|
/**
|
5813
|
/**
|
5768
|
- * @description 保存
|
5814
|
+ * @description
|
5769
|
*/
|
5815
|
*/
|
5770
|
async function submit(callback) {
|
5816
|
async function submit(callback) {
|
5771
|
const data = Array.from({ length: addRowNumber }).map((_, row) => form.val(getRowFilter(row))).filter(item => Object.keys(item).length)
|
5817
|
const data = Array.from({ length: addRowNumber }).map((_, row) => form.val(getRowFilter(row))).filter(item => Object.keys(item).length)
|
5772
|
if (!validate(data)) return
|
5818
|
if (!validate(data)) return
|
5773
|
- const formModal = {
|
5819
|
+ const formVal = getDataSourceValue()
|
|
|
5820
|
+ const formModel = {
|
5774
|
configurationId,
|
5821
|
configurationId,
|
5775
|
contentId: currentPageId.id,
|
5822
|
contentId: currentPageId.id,
|
|
|
5823
|
+ ...formVal,
|
5776
|
id: graphId,
|
5824
|
id: graphId,
|
5777
|
- content: {
|
|
|
5778
|
- data,
|
|
|
5779
|
- },
|
5825
|
+ condition: data,
|
5780
|
type: event.data.type,
|
5826
|
type: event.data.type,
|
5781
|
- };
|
|
|
5782
|
- const [ err, res ] = await to(ConfigurationNodeApi.updateNodeEvent(formModal))
|
5827
|
+ }
|
|
|
5828
|
+ await to(autoSaveGraphInfo())
|
|
|
5829
|
+ const [err, res] = await to(ConfigurationNodeApi.updateNodeAct(formModel))
|
5783
|
if (err) return
|
5830
|
if (err) return
|
5784
|
UseLayUi.successMsg()
|
5831
|
UseLayUi.successMsg()
|
5785
|
callback()
|
5832
|
callback()
|
5786
|
}
|
5833
|
}
|
5787
|
|
5834
|
|
5788
|
- /**
|
|
|
5789
|
- * @description 创建弹出层表单
|
|
|
5790
|
- * @param event
|
|
|
5791
|
- */
|
|
|
5792
|
function createLayerForm(type) {
|
5835
|
function createLayerForm(type) {
|
5793
|
const content = `
|
5836
|
const content = `
|
5794
|
- <form class="layui-form" lay-filter="formModal">
|
|
|
5795
|
- <div style="width:400px">
|
|
|
5796
|
- <div class="layui-form-item">
|
|
|
5797
|
- <label class="layui-form-label">事件</label>
|
|
|
5798
|
- <div class="layui-input-block">
|
|
|
5799
|
- <input type="text" name="event" class="layui-input" value="${ enumEventType[type] }" disabled>
|
|
|
5800
|
- </div>
|
|
|
5801
|
- </div>
|
|
|
5802
|
- <div class="layui-form-item">
|
|
|
5803
|
- <label class="layui-form-label">动作</label>
|
|
|
5804
|
- <div class="layui-input-block">
|
|
|
5805
|
- <select name="action" lay-verify="required">
|
|
|
5806
|
- <option value="0" selected>给变量赋值</option>
|
|
|
5807
|
- </select>
|
|
|
5808
|
- </div>
|
|
|
5809
|
- </div>
|
|
|
5810
|
- <div class="layui-form-item">
|
|
|
5811
|
- <label class="layui-form-label">类型</label>
|
|
|
5812
|
- <div class="layui-input-block">
|
|
|
5813
|
- <input type="radio" name="type" value="1" title="联网设备" checked>
|
|
|
5814
|
- <input type="radio" name="type" value="2" title="产品/场景" disabled>
|
|
|
5815
|
- </div>
|
|
|
5816
|
- </div>
|
|
|
5817
|
- </div>
|
|
|
5818
|
- </form>
|
|
|
5819
|
- <div class="override__table">
|
5837
|
+ <div style="width: 300px; padding: 20px 0 0 20px;" id="${enumActionEl.DATA_SOURCE_COMP_EL}"></div>
|
|
|
5838
|
+ <div class="override__table" style="padding: 0 20px">
|
5820
|
<table class="layui-table" >
|
5839
|
<table class="layui-table" >
|
5821
|
<thead>
|
5840
|
<thead>
|
5822
|
- <tr>
|
|
|
5823
|
- <th style="text-align:center">选择设备</th>
|
|
|
5824
|
- <th style="text-align:center">选择子设备</th>
|
|
|
5825
|
- <th style="text-align:center">单向 / 双向</th>
|
|
|
5826
|
- <th style="text-align:center">下发值</th>
|
|
|
5827
|
- <th style="text-align:center">操作</th>
|
|
|
5828
|
- </tr>
|
5841
|
+ <tr>
|
|
|
5842
|
+ <th style="text-align:center">最小值(<=)</th>
|
|
|
5843
|
+ <th style="text-align:center">最大值(>=)</th>
|
|
|
5844
|
+ <th style="text-align:center">对应图片</th>
|
|
|
5845
|
+<!-- <th style="text-align:center">对应的颜色</th>-->
|
|
|
5846
|
+ <th style="text-align:center">操作</th>
|
|
|
5847
|
+ </tr>
|
5829
|
</thead>
|
5848
|
</thead>
|
5830
|
- <tbody id="${ enumActionEl.DEVICE_DATA_BODY_EL }"></tbody>
|
5849
|
+ <tbody id="${enumActionEl.TABLE_BODY_EL}"></tbody>
|
5831
|
</table>
|
5850
|
</table>
|
5832
|
- <div style="display:flex;justify-content:center;">
|
|
|
5833
|
- <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="${ enumActionEl.ADD_ROW_EL }">添加一条</button>
|
|
|
5834
|
- </div>
|
|
|
5835
|
- </div>`
|
5851
|
+ </div>
|
|
|
5852
|
+ <div style="display:flex;justify-content:center;">
|
|
|
5853
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="${enumActionEl.ADD_ROW_EL}">添加一条</button>
|
|
|
5854
|
+ </div>
|
|
|
5855
|
+ `
|
5836
|
|
5856
|
|
5837
|
layer.open({
|
5857
|
layer.open({
|
5838
|
- title: '创建交互',
|
5858
|
+ title: '变量值图片功能',
|
|
|
5859
|
+ type: 1,
|
5839
|
content,
|
5860
|
content,
|
5840
|
skin: 'event-layer__override',
|
5861
|
skin: 'event-layer__override',
|
5841
|
- // area: ["1100px", "700px"],
|
|
|
5842
|
- area: '1200px',
|
|
|
5843
|
- btn: [ "保存", "取消" ],
|
|
|
5844
|
- shade: [ "0.7", "#fafafa" ],
|
5862
|
+ area: '700px',
|
|
|
5863
|
+ btn: ["保存", "取消"],
|
|
|
5864
|
+ shade: ["0.7", "#fafafa"],
|
|
|
5865
|
+ offset: '100px',
|
5845
|
yes(index) {
|
5866
|
yes(index) {
|
5846
|
- form.on(`submit(${ enumActionEl.LAYER_SUBMIT_FILTER })`, data => {
|
5867
|
+ form.on(`submit(${enumActionEl.LAYER_SUBMIT_FILTER})`, data => {
|
5847
|
submit(() => {
|
5868
|
submit(() => {
|
5848
|
layer.close(index)
|
5869
|
layer.close(index)
|
5849
|
getNodeBindInfo()
|
5870
|
getNodeBindInfo()
|
|
@@ -5858,15 +5879,18 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5858,15 +5879,18 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5858
|
'lay-submit': '',
|
5879
|
'lay-submit': '',
|
5859
|
'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
5880
|
'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
5860
|
})
|
5881
|
})
|
5861
|
- await getMaterDevice()
|
|
|
5862
|
- const info = getLayerBindInfo('event', type)
|
|
|
5863
|
- if (!info) {
|
5882
|
+ const { component, echoDataSource, getValue } = generatorDataSourceComponent()
|
|
|
5883
|
+ getDataSourceValue = getValue
|
|
|
5884
|
+ $(`#${enumActionEl.DATA_SOURCE_COMP_EL}`).append(component)
|
|
|
5885
|
+ const info = getLayerBindInfo('act', type)
|
|
|
5886
|
+ const { condition = [] } = info
|
|
|
5887
|
+ if (!condition.length) {
|
5864
|
addRecord()
|
5888
|
addRecord()
|
5865
|
} else {
|
5889
|
} else {
|
|
|
5890
|
+ echoDataSource(info)
|
5866
|
echoFormData(info)
|
5891
|
echoFormData(info)
|
5867
|
}
|
5892
|
}
|
5868
|
generatorEventListen()
|
5893
|
generatorEventListen()
|
5869
|
- form.render()
|
|
|
5870
|
},
|
5894
|
},
|
5871
|
})
|
5895
|
})
|
5872
|
}
|
5896
|
}
|
|
@@ -5875,10 +5899,15 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5875,10 +5899,15 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5875
|
}
|
5899
|
}
|
5876
|
|
5900
|
|
5877
|
/**
|
5901
|
/**
|
5878
|
- * @description 处理单击 or 双击事件
|
5902
|
+ * @description 处理数据交互 - down || up 按下与抬起
|
5879
|
*/
|
5903
|
*/
|
5880
|
- function handleClickOrDbClick(event) {
|
5904
|
+ function handleDownOrUpEvent(event) {
|
5881
|
|
5905
|
|
|
|
5906
|
+ // if (!currentCheckedOrgNode) {
|
|
|
5907
|
+ // layer.msg('请先选择组织')
|
|
|
5908
|
+ // return
|
|
|
5909
|
+ // }
|
|
|
5910
|
+ // 事件类型
|
5882
|
const enumEventType = {
|
5911
|
const enumEventType = {
|
5883
|
DOWN: "按下",
|
5912
|
DOWN: "按下",
|
5884
|
UP: "抬起",
|
5913
|
UP: "抬起",
|
|
@@ -5886,26 +5915,536 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5886,26 +5915,536 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5886
|
DOUBLE: "双击",
|
5915
|
DOUBLE: "双击",
|
5887
|
};
|
5916
|
};
|
5888
|
|
5917
|
|
5889
|
- /**
|
|
|
5890
|
- * @description
|
|
|
5891
|
- */
|
|
|
5892
|
- const enumConst = {
|
|
|
5893
|
- EVENT: 'event',
|
|
|
5894
|
- ACTION: 'actionType',
|
|
|
5895
|
- PAGE_VALUE: 'pageValue',
|
|
|
5896
|
- LINK_VALUE: 'linkValue',
|
|
|
5897
|
- }
|
5918
|
+ const enumActionEl = {
|
5898
|
|
5919
|
|
5899
|
- /**
|
|
|
5900
|
- * @description 动作类型
|
|
|
5901
|
- */
|
|
|
5902
|
- const enumActionType = {
|
|
|
5903
|
- PAGE: 'PAGE',
|
|
|
5904
|
- LINK: 'LINK',
|
|
|
5905
|
- PROPS: 'PROPS',
|
|
|
5906
|
- }
|
5920
|
+ /**
|
|
|
5921
|
+ * @description 表单控制 filter
|
|
|
5922
|
+ */
|
|
|
5923
|
+ FORM_FILTER: 'interactionFormFilter',
|
5907
|
|
5924
|
|
5908
|
- const enumGetValue = {
|
5925
|
+ /**
|
|
|
5926
|
+ * @description 表体节点
|
|
|
5927
|
+ */
|
|
|
5928
|
+ DEVICE_DATA_BODY_EL: 'deviceDataTbody',
|
|
|
5929
|
+
|
|
|
5930
|
+ /**
|
|
|
5931
|
+ * @description 删除行节点
|
|
|
5932
|
+ */
|
|
|
5933
|
+ DEL_ROW_EL: 'deleteRow',
|
|
|
5934
|
+
|
|
|
5935
|
+ /**
|
|
|
5936
|
+ * @description 增加行节点
|
|
|
5937
|
+ */
|
|
|
5938
|
+ ADD_ROW_EL: 'addRow',
|
|
|
5939
|
+
|
|
|
5940
|
+ /**
|
|
|
5941
|
+ * @descripton
|
|
|
5942
|
+ */
|
|
|
5943
|
+ ROW_FILTER: 'interactionRowFilter',
|
|
|
5944
|
+
|
|
|
5945
|
+ /**
|
|
|
5946
|
+ * @description json editor
|
|
|
5947
|
+ */
|
|
|
5948
|
+ EDITOR_JSON: 'editor__json-',
|
|
|
5949
|
+
|
|
|
5950
|
+ /**
|
|
|
5951
|
+ * @description 弹出层保存 filter
|
|
|
5952
|
+ */
|
|
|
5953
|
+ LAYER_SUBMIT_FILTER: 'interactionLayerSubmit',
|
|
|
5954
|
+
|
|
|
5955
|
+ /**
|
|
|
5956
|
+ * @description ace builder
|
|
|
5957
|
+ */
|
|
|
5958
|
+ JSON: 'ace__builder-json',
|
|
|
5959
|
+
|
|
|
5960
|
+ /**
|
|
|
5961
|
+ * @description 组织树节点
|
|
|
5962
|
+ */
|
|
|
5963
|
+ ORG_EL: 'interactionOrgTree',
|
|
|
5964
|
+ }
|
|
|
5965
|
+
|
|
|
5966
|
+
|
|
|
5967
|
+ /**
|
|
|
5968
|
+ * @description 所有设备选项
|
|
|
5969
|
+ * @type {{id: string, name: string, deviceType: string}[]}
|
|
|
5970
|
+ */
|
|
|
5971
|
+ let allDeviceOptions = []
|
|
|
5972
|
+
|
|
|
5973
|
+ let addRowNumber = 0
|
|
|
5974
|
+
|
|
|
5975
|
+ /**
|
|
|
5976
|
+ * @description 组织id
|
|
|
5977
|
+ * @type {null}
|
|
|
5978
|
+ */
|
|
|
5979
|
+ let orgId = null
|
|
|
5980
|
+
|
|
|
5981
|
+ const getRowFilter = (rowNumber) => `${enumActionEl.ROW_FILTER}${rowNumber}`
|
|
|
5982
|
+
|
|
|
5983
|
+ /**
|
|
|
5984
|
+ * @description 枚举常量
|
|
|
5985
|
+ * @enum DEVICE
|
|
|
5986
|
+ */
|
|
|
5987
|
+ const enumConst = {
|
|
|
5988
|
+ /**
|
|
|
5989
|
+ * @description 设备
|
|
|
5990
|
+ */
|
|
|
5991
|
+ DEVICE: 'deviceId',
|
|
|
5992
|
+ /**
|
|
|
5993
|
+ * @description 子设备
|
|
|
5994
|
+ */
|
|
|
5995
|
+ SLAVE_DEVICE: 'slaveDeviceId',
|
|
|
5996
|
+ /**
|
|
|
5997
|
+ * @description 变量
|
|
|
5998
|
+ */
|
|
|
5999
|
+ ATTR: 'attr',
|
|
|
6000
|
+ /**
|
|
|
6001
|
+ * @description 下发值
|
|
|
6002
|
+ */
|
|
|
6003
|
+ VALUE: 'value',
|
|
|
6004
|
+
|
|
|
6005
|
+ /**
|
|
|
6006
|
+ * @description 方式
|
|
|
6007
|
+ */
|
|
|
6008
|
+ WAY: 'way',
|
|
|
6009
|
+
|
|
|
6010
|
+ /**
|
|
|
6011
|
+ * @description 组织id
|
|
|
6012
|
+ */
|
|
|
6013
|
+ ORG_ID: 'orgId',
|
|
|
6014
|
+ }
|
|
|
6015
|
+
|
|
|
6016
|
+ const sendInstructionWay = {
|
|
|
6017
|
+ ONE_WAR: 'oneway',
|
|
|
6018
|
+ TWO_WAY: 'twoway',
|
|
|
6019
|
+ }
|
|
|
6020
|
+
|
|
|
6021
|
+ /**
|
|
|
6022
|
+ * @description 创建回显数据 查询出所有网关设备和直连设备
|
|
|
6023
|
+ */
|
|
|
6024
|
+ async function getMaterDevice() {
|
|
|
6025
|
+ if (!orgId) return
|
|
|
6026
|
+ const [err, res] = await to(ConfigurationNodeApi.getMasterDevice(orgId))
|
|
|
6027
|
+ allDeviceOptions = res
|
|
|
6028
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6029
|
+ $(`#${enumActionEl.DEVICE_DATA_BODY_EL}`).find(`select[name="${enumConst.DEVICE}"]`).html(generateOption)
|
|
|
6030
|
+ UseLayUi.nextTick(() => form.render('select'))
|
|
|
6031
|
+ }
|
|
|
6032
|
+
|
|
|
6033
|
+ /**
|
|
|
6034
|
+ * @description 创建JSON编辑器
|
|
|
6035
|
+ * @param el
|
|
|
6036
|
+ * @param datum
|
|
|
6037
|
+ */
|
|
|
6038
|
+ function createEditor(el, datum = {}) {
|
|
|
6039
|
+ const editor = ace.edit(el, {
|
|
|
6040
|
+ maxLines: 10, // 最大行数,超过会自动出现滚动条
|
|
|
6041
|
+ minLines: 5, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小
|
|
|
6042
|
+ fontSize: 14, // 编辑器内字体大小
|
|
|
6043
|
+ tabSize: 2, // 制表符设置为 4 个空格大小
|
|
|
6044
|
+ });
|
|
|
6045
|
+ editor.session.setMode("ace/mode/json");
|
|
|
6046
|
+ editor.getSession().on('change', (event, editor) => {
|
|
|
6047
|
+ $(`#${el}`).parent().find(`textarea[name="${enumConst.VALUE}"]`).val(editor.getValue())
|
|
|
6048
|
+ })
|
|
|
6049
|
+ editor.setValue(datum[enumConst.VALUE] ? datum[enumConst.VALUE] : "{}")
|
|
|
6050
|
+ }
|
|
|
6051
|
+
|
|
|
6052
|
+ /**
|
|
|
6053
|
+ * @description 创建组织树
|
|
|
6054
|
+ */
|
|
|
6055
|
+ function createOrgTreeSelect() {
|
|
|
6056
|
+ UseLayUi.createTreeSelect({
|
|
|
6057
|
+ elem: `#${enumActionEl.ORG_EL}`,
|
|
|
6058
|
+ layFilter: enumConst.ORG_ID,
|
|
|
6059
|
+ label: '组织',
|
|
|
6060
|
+ singleUsage: false,
|
|
|
6061
|
+ layVerify: 'required',
|
|
|
6062
|
+ layVerType: 'tips',
|
|
|
6063
|
+ treeProps: {
|
|
|
6064
|
+ data: treeList,
|
|
|
6065
|
+ onlyIconControl: true,
|
|
|
6066
|
+ click(node) {
|
|
|
6067
|
+ orgId = node.data.id
|
|
|
6068
|
+ getMaterDevice()
|
|
|
6069
|
+ },
|
|
|
6070
|
+ },
|
|
|
6071
|
+ })
|
|
|
6072
|
+ }
|
|
|
6073
|
+
|
|
|
6074
|
+ /**
|
|
|
6075
|
+ * @description 添加行
|
|
|
6076
|
+ * @param datum
|
|
|
6077
|
+ */
|
|
|
6078
|
+ function addRecord(datum) {
|
|
|
6079
|
+ const content = `
|
|
|
6080
|
+ <tr class="layui-form" lay-filter="${getRowFilter(addRowNumber)}">
|
|
|
6081
|
+ <td>
|
|
|
6082
|
+ <select name="${enumConst.DEVICE}" lay-filter="${enumConst.DEVICE}" lay-verType="tips" lay-verify="required"></select>
|
|
|
6083
|
+ </td>
|
|
|
6084
|
+ <td>
|
|
|
6085
|
+ <select name="${enumConst.SLAVE_DEVICE}" lay-filter="${enumConst.SLAVE_DEVICE}" lay-verType="tips"></select>
|
|
|
6086
|
+ </td>
|
|
|
6087
|
+ <td>
|
|
|
6088
|
+ <form action="" style="display: flex">
|
|
|
6089
|
+ <div class="override__radio-default">
|
|
|
6090
|
+ <input id="${getRowFilter(addRowNumber)}${sendInstructionWay.ONE_WAR}" type="radio" name="${enumConst.WAY}" lay-ignore value="${sendInstructionWay.ONE_WAR}" title="单向" checked="">
|
|
|
6091
|
+ <label for="${getRowFilter(addRowNumber)}${sendInstructionWay.ONE_WAR}" class="override__radio-label">单向</label>
|
|
|
6092
|
+ </div>
|
|
|
6093
|
+ <div class="override__radio-default">
|
|
|
6094
|
+ <input id="${getRowFilter(addRowNumber)}${sendInstructionWay.TWO_WAY}" type="radio" name="${enumConst.WAY}" lay-ignore value="${sendInstructionWay.TWO_WAY}" title="双向">
|
|
|
6095
|
+ <label for="${getRowFilter(addRowNumber)}${sendInstructionWay.TWO_WAY}" class="override__radio-label">双向</label>
|
|
|
6096
|
+ </div>
|
|
|
6097
|
+ </form>
|
|
|
6098
|
+ </td>
|
|
|
6099
|
+ <td class="${enumActionEl.JSON}">
|
|
|
6100
|
+ <div style="width: 100%;height: 100%;">
|
|
|
6101
|
+ <div id="${enumActionEl.EDITOR_JSON}${addRowNumber}"></div>
|
|
|
6102
|
+ <textarea style="display: none" name="${enumConst.VALUE}" placeholder="请输入命令" lay-verType="tips" class="layui-textarea"></textarea>
|
|
|
6103
|
+ </div>
|
|
|
6104
|
+ </td>
|
|
|
6105
|
+ <td>
|
|
|
6106
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-red ${enumActionEl.DEL_ROW_EL}">删除</button>
|
|
|
6107
|
+ </td>
|
|
|
6108
|
+ </tr>
|
|
|
6109
|
+ `
|
|
|
6110
|
+ $(`#${enumActionEl.DEVICE_DATA_BODY_EL}`).append(content)
|
|
|
6111
|
+ setDeviceOptions(addRowNumber)
|
|
|
6112
|
+ createEditor(`${enumActionEl.EDITOR_JSON}${addRowNumber}`, datum)
|
|
|
6113
|
+ form.render('select', getRowFilter(addRowNumber))
|
|
|
6114
|
+ addRowNumber++
|
|
|
6115
|
+ }
|
|
|
6116
|
+
|
|
|
6117
|
+ /**
|
|
|
6118
|
+ * @description 更新变量选项
|
|
|
6119
|
+ */
|
|
|
6120
|
+ async function updateVariableOptions(data) {
|
|
|
6121
|
+ if (!data.value) return
|
|
|
6122
|
+ const [err, res] = await to(ConfigurationNodeApi.getDeviceAttr(data.value))
|
|
|
6123
|
+ if (!res) return
|
|
|
6124
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6125
|
+ $(data.elem).parents('tr').find(`select[name="${enumConst.ATTR}"]`).html(generateOption)
|
|
|
6126
|
+ form.render('select')
|
|
|
6127
|
+ }
|
|
|
6128
|
+
|
|
|
6129
|
+ /**
|
|
|
6130
|
+ * @description 选择设备监听事件
|
|
|
6131
|
+ */
|
|
|
6132
|
+ function createSelectDeviceListenEvent() {
|
|
|
6133
|
+ form.on(`select(${enumConst.DEVICE})`, async (data) => {
|
|
|
6134
|
+ const filter = $(data.elem).parents('tr').attr('lay-filter')
|
|
|
6135
|
+ form.val(filter, {
|
|
|
6136
|
+ [enumConst.SLAVE_DEVICE]: null,
|
|
|
6137
|
+ })
|
|
|
6138
|
+ const isGATEWAY = allDeviceOptions.find(item => item.id === data.value)?.deviceType === "GATEWAY"
|
|
|
6139
|
+ // 网关设备请求子设备
|
|
|
6140
|
+ if (orgId && isGATEWAY && data.value) {
|
|
|
6141
|
+ const [err, res] = await to(ConfigurationNodeApi.getSlaveDevice(orgId, data.value))
|
|
|
6142
|
+ if (!res) return
|
|
|
6143
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6144
|
+ $(data.elem).parents('tr').find(`select[name="${enumConst.SLAVE_DEVICE}"]`).html(generateOption)
|
|
|
6145
|
+ }
|
|
|
6146
|
+ // else {
|
|
|
6147
|
+ // updateVariableOptions(data)
|
|
|
6148
|
+ // }
|
|
|
6149
|
+ UseLayUi.nextTick(() => form.render(`select`, filter))
|
|
|
6150
|
+ })
|
|
|
6151
|
+ // form.on(`select(${ enumConst.SLAVE_DEVICE })`, (data) => {
|
|
|
6152
|
+ // updateVariableOptions(data)
|
|
|
6153
|
+ // })
|
|
|
6154
|
+ }
|
|
|
6155
|
+
|
|
|
6156
|
+ /**
|
|
|
6157
|
+ * @description 删除行
|
|
|
6158
|
+ */
|
|
|
6159
|
+ function createDeleteRowListenEvent() {
|
|
|
6160
|
+ $(`.${enumActionEl.DEL_ROW_EL}`).on('click', (event) => {
|
|
|
6161
|
+ // $(event.target).parents('tr').find('editor')
|
|
|
6162
|
+ $(event.target).parents('tr').remove()
|
|
|
6163
|
+ })
|
|
|
6164
|
+ }
|
|
|
6165
|
+
|
|
|
6166
|
+ /**
|
|
|
6167
|
+ * @description 新增行
|
|
|
6168
|
+ */
|
|
|
6169
|
+ function createAddRowListenEvent() {
|
|
|
6170
|
+ $(`#${enumActionEl.ADD_ROW_EL}`).on('click', () => {
|
|
|
6171
|
+ addRecord()
|
|
|
6172
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: allDeviceOptions })
|
|
|
6173
|
+ $(`#${enumActionEl.DEVICE_DATA_BODY_EL} tr`).last().find(`select[name="${enumConst.DEVICE}"]`).html(generateOption)
|
|
|
6174
|
+ createDeleteRowListenEvent()
|
|
|
6175
|
+ form.render('select')
|
|
|
6176
|
+ })
|
|
|
6177
|
+ }
|
|
|
6178
|
+
|
|
|
6179
|
+ /**
|
|
|
6180
|
+ * @description 设置设备选项
|
|
|
6181
|
+ */
|
|
|
6182
|
+ function setDeviceOptions(row) {
|
|
|
6183
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: allDeviceOptions })
|
|
|
6184
|
+ $(`#${enumActionEl.DEVICE_DATA_BODY_EL} tr[lay-filter="${getRowFilter(row)}"]`).find(`select[name="${enumConst.DEVICE}"]`).html(generateOption)
|
|
|
6185
|
+ }
|
|
|
6186
|
+
|
|
|
6187
|
+ /**
|
|
|
6188
|
+ * @description 生成事件监听
|
|
|
6189
|
+ */
|
|
|
6190
|
+ function generatorEventListen() {
|
|
|
6191
|
+ createSelectDeviceListenEvent()
|
|
|
6192
|
+ createDeleteRowListenEvent()
|
|
|
6193
|
+ createAddRowListenEvent()
|
|
|
6194
|
+ }
|
|
|
6195
|
+
|
|
|
6196
|
+ /**
|
|
|
6197
|
+ * @description 挂载选项 根据行号 key 挂载option
|
|
|
6198
|
+ * @param row 行号
|
|
|
6199
|
+ * @param key select name
|
|
|
6200
|
+ * @param data 数据源
|
|
|
6201
|
+ */
|
|
|
6202
|
+ function mountSelectOptions(row, key, data) {
|
|
|
6203
|
+ const generateOption = UseLayUi.generateOptionTemplate({ dataSource: data })
|
|
|
6204
|
+ $(`#${enumActionEl.DEVICE_DATA_BODY_EL}`).find(`tr[lay-filter="${getRowFilter(row)}"] select[name="${key}"]`).html(generateOption)
|
|
|
6205
|
+ }
|
|
|
6206
|
+
|
|
|
6207
|
+ /**
|
|
|
6208
|
+ * @description 根据主设备ID获取从设备
|
|
|
6209
|
+ */
|
|
|
6210
|
+ async function getSlaveDeviceByMasterDevice(deviceId, row) {
|
|
|
6211
|
+ const res = await ConfigurationNodeApi.getSlaveDevice(orgId, deviceId)
|
|
|
6212
|
+ mountSelectOptions(row, enumConst.SLAVE_DEVICE, res)
|
|
|
6213
|
+ }
|
|
|
6214
|
+
|
|
|
6215
|
+ /**
|
|
|
6216
|
+ * @description 根据设备ID获取设备属性
|
|
|
6217
|
+ */
|
|
|
6218
|
+ async function getDeviceAttrByDeviceId(deviceId, row) {
|
|
|
6219
|
+ const res = await ConfigurationNodeApi.getDeviceAttr(deviceId)
|
|
|
6220
|
+ mountSelectOptions(row, enumConst.ATTR, res)
|
|
|
6221
|
+ }
|
|
|
6222
|
+
|
|
|
6223
|
+ /**
|
|
|
6224
|
+ * @description 回显表单数据
|
|
|
6225
|
+ */
|
|
|
6226
|
+ function echoFormData(info) {
|
|
|
6227
|
+ const { content: { data = [] } = {}, orgId } = info
|
|
|
6228
|
+ echoOrgTree(orgId)
|
|
|
6229
|
+ data.forEach((datum, index) => echoEachData(datum, index))
|
|
|
6230
|
+ }
|
|
|
6231
|
+
|
|
|
6232
|
+ /**
|
|
|
6233
|
+ * @description 回显组织树
|
|
|
6234
|
+ */
|
|
|
6235
|
+ function echoOrgTree(id) {
|
|
|
6236
|
+ const node = UseLayUi.findTreeObjectByField(treeList, id)
|
|
|
6237
|
+ $(`#${enumActionEl.ORG_EL}`).find(`input[name="${enumConst.ORG_ID}"]`).parent().find('span').html(node?.name)
|
|
|
6238
|
+ }
|
|
|
6239
|
+
|
|
|
6240
|
+ /**
|
|
|
6241
|
+ * @description 回显每条数据
|
|
|
6242
|
+ */
|
|
|
6243
|
+ function echoEachData(datum = {}, row) {
|
|
|
6244
|
+ addRecord(datum)
|
|
|
6245
|
+ const deviceId = datum[enumConst.DEVICE]
|
|
|
6246
|
+ const slaveDeviceId = datum[enumConst.SLAVE_DEVICE]
|
|
|
6247
|
+ const queue = []
|
|
|
6248
|
+
|
|
|
6249
|
+ if (slaveDeviceId) {
|
|
|
6250
|
+ queue.push(() => getSlaveDeviceByMasterDevice(deviceId, row))
|
|
|
6251
|
+ // queue.push(() => getDeviceAttrByDeviceId(slaveDeviceId, row))
|
|
|
6252
|
+ }
|
|
|
6253
|
+ // else {
|
|
|
6254
|
+ // queue.push(() => getDeviceAttrByDeviceId(deviceId, row))
|
|
|
6255
|
+ // }
|
|
|
6256
|
+
|
|
|
6257
|
+ Promise
|
|
|
6258
|
+ .all(queue.map(item => item()))
|
|
|
6259
|
+ .finally(() => {
|
|
|
6260
|
+ form.val(getRowFilter(row), datum)
|
|
|
6261
|
+ })
|
|
|
6262
|
+ }
|
|
|
6263
|
+
|
|
|
6264
|
+ function isJson(string) {
|
|
|
6265
|
+ if (typeof string === 'string') {
|
|
|
6266
|
+ try {
|
|
|
6267
|
+ const obj = JSON.parse(string)
|
|
|
6268
|
+ if (typeof obj === 'object' && obj !== null) {
|
|
|
6269
|
+ return true
|
|
|
6270
|
+ }
|
|
|
6271
|
+ } catch (e) {
|
|
|
6272
|
+ return false
|
|
|
6273
|
+ }
|
|
|
6274
|
+ }
|
|
|
6275
|
+ return false
|
|
|
6276
|
+ }
|
|
|
6277
|
+
|
|
|
6278
|
+ /**
|
|
|
6279
|
+ * @description 表单验证
|
|
|
6280
|
+ * @param tableData
|
|
|
6281
|
+ * @returns {boolean}
|
|
|
6282
|
+ */
|
|
|
6283
|
+ function validate(tableData) {
|
|
|
6284
|
+ let validateFlag = true
|
|
|
6285
|
+
|
|
|
6286
|
+ const formModel = form.val(enumActionEl.FORM_FILTER)
|
|
|
6287
|
+ if (!formModel[enumConst.ORG_ID]) return false
|
|
|
6288
|
+
|
|
|
6289
|
+ for (let i = 0; i < tableData.length; i++) {
|
|
|
6290
|
+ const { value } = tableData[i]
|
|
|
6291
|
+ if (!isJson(value)) {
|
|
|
6292
|
+ validateFlag = false
|
|
|
6293
|
+ layer.tips('下发值不正确', $(`#${enumActionEl.DEVICE_DATA_BODY_EL} tr`).eq(i).find(`td.${enumActionEl.JSON}`), { tips: 1 })
|
|
|
6294
|
+ break
|
|
|
6295
|
+ }
|
|
|
6296
|
+ }
|
|
|
6297
|
+ return validateFlag
|
|
|
6298
|
+ }
|
|
|
6299
|
+
|
|
|
6300
|
+ /**
|
|
|
6301
|
+ * @description 保存
|
|
|
6302
|
+ */
|
|
|
6303
|
+ async function submit(callback) {
|
|
|
6304
|
+ const data = Array.from({ length: addRowNumber }).map((_, row) => form.val(getRowFilter(row))).filter(item => Object.keys(item).length)
|
|
|
6305
|
+ if (!validate(data)) return
|
|
|
6306
|
+ const formModal = {
|
|
|
6307
|
+ configurationId,
|
|
|
6308
|
+ orgId,
|
|
|
6309
|
+ contentId: currentPageId.id,
|
|
|
6310
|
+ id: graphId,
|
|
|
6311
|
+ content: {
|
|
|
6312
|
+ data,
|
|
|
6313
|
+ },
|
|
|
6314
|
+ type: event.data.type,
|
|
|
6315
|
+ };
|
|
|
6316
|
+ await to(autoSaveGraphInfo())
|
|
|
6317
|
+ const [err, res] = await to(ConfigurationNodeApi.updateNodeEvent(formModal))
|
|
|
6318
|
+ if (err) return
|
|
|
6319
|
+ UseLayUi.successMsg()
|
|
|
6320
|
+ callback()
|
|
|
6321
|
+ }
|
|
|
6322
|
+
|
|
|
6323
|
+ /**
|
|
|
6324
|
+ * @description 创建弹出层表单
|
|
|
6325
|
+ * @param event
|
|
|
6326
|
+ */
|
|
|
6327
|
+ function createLayerForm(type) {
|
|
|
6328
|
+ const content = `
|
|
|
6329
|
+ <form class="layui-form" lay-filter="${enumActionEl.FORM_FILTER}">
|
|
|
6330
|
+ <div style="width:400px">
|
|
|
6331
|
+ <div class="layui-form-item">
|
|
|
6332
|
+ <label class="layui-form-label">事件</label>
|
|
|
6333
|
+ <div class="layui-input-block">
|
|
|
6334
|
+ <input type="text" name="event" class="layui-input" value="${enumEventType[type]}" disabled>
|
|
|
6335
|
+ </div>
|
|
|
6336
|
+ </div>
|
|
|
6337
|
+ <div class="layui-form-item">
|
|
|
6338
|
+ <label class="layui-form-label">动作</label>
|
|
|
6339
|
+ <div class="layui-input-block">
|
|
|
6340
|
+ <select name="action" lay-verify="required">
|
|
|
6341
|
+ <option value="0" selected>给变量赋值</option>
|
|
|
6342
|
+ </select>
|
|
|
6343
|
+ </div>
|
|
|
6344
|
+ </div>
|
|
|
6345
|
+ <div class="layui-form-item">
|
|
|
6346
|
+ <label class="layui-form-label">类型</label>
|
|
|
6347
|
+ <div class="layui-input-block">
|
|
|
6348
|
+ <input type="radio" name="type" value="1" title="联网设备" checked>
|
|
|
6349
|
+ <input type="radio" name="type" value="2" title="产品/场景" disabled>
|
|
|
6350
|
+ </div>
|
|
|
6351
|
+ </div>
|
|
|
6352
|
+ <div id="${enumActionEl.ORG_EL}"></div>
|
|
|
6353
|
+ </div>
|
|
|
6354
|
+ </form>
|
|
|
6355
|
+ <div class="override__table">
|
|
|
6356
|
+ <table class="layui-table" >
|
|
|
6357
|
+ <thead>
|
|
|
6358
|
+ <tr>
|
|
|
6359
|
+ <th style="text-align:center">选择设备</th>
|
|
|
6360
|
+ <th style="text-align:center">选择子设备</th>
|
|
|
6361
|
+ <th style="text-align:center">单向 / 双向</th>
|
|
|
6362
|
+ <th style="text-align:center">下发值</th>
|
|
|
6363
|
+ <th style="text-align:center">操作</th>
|
|
|
6364
|
+ </tr>
|
|
|
6365
|
+ </thead>
|
|
|
6366
|
+ <tbody id="${enumActionEl.DEVICE_DATA_BODY_EL}"></tbody>
|
|
|
6367
|
+ </table>
|
|
|
6368
|
+ <div style="display:flex;justify-content:center;">
|
|
|
6369
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="${enumActionEl.ADD_ROW_EL}">添加一条</button>
|
|
|
6370
|
+ </div>
|
|
|
6371
|
+ </div>`
|
|
|
6372
|
+
|
|
|
6373
|
+ layer.open({
|
|
|
6374
|
+ title: '创建交互',
|
|
|
6375
|
+ content,
|
|
|
6376
|
+ skin: 'event-layer__override',
|
|
|
6377
|
+ // area: ["1100px", "700px"],
|
|
|
6378
|
+ area: '1100px',
|
|
|
6379
|
+ offset: '100px',
|
|
|
6380
|
+ btn: ["保存", "取消"],
|
|
|
6381
|
+ shade: ["0.7", "#fafafa"],
|
|
|
6382
|
+ yes(index) {
|
|
|
6383
|
+ form.on(`submit(${enumActionEl.LAYER_SUBMIT_FILTER})`, data => {
|
|
|
6384
|
+ submit(() => {
|
|
|
6385
|
+ layer.close(index)
|
|
|
6386
|
+ getNodeBindInfo()
|
|
|
6387
|
+ })
|
|
|
6388
|
+ })
|
|
|
6389
|
+ },
|
|
|
6390
|
+ but2(index, layero) {
|
|
|
6391
|
+ return false
|
|
|
6392
|
+ },
|
|
|
6393
|
+ async success(layero, index) {
|
|
|
6394
|
+ $(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
|
|
6395
|
+ 'lay-submit': '',
|
|
|
6396
|
+ 'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
|
|
6397
|
+ })
|
|
|
6398
|
+ createOrgTreeSelect()
|
|
|
6399
|
+ const info = getLayerBindInfo('event', type)
|
|
|
6400
|
+ const { content: { data = [] } = {} } = info
|
|
|
6401
|
+ if (!info || !data.length) {
|
|
|
6402
|
+ addRecord()
|
|
|
6403
|
+ } else {
|
|
|
6404
|
+ await getMaterDevice()
|
|
|
6405
|
+ echoFormData(info)
|
|
|
6406
|
+ }
|
|
|
6407
|
+ generatorEventListen()
|
|
|
6408
|
+ form.render()
|
|
|
6409
|
+ },
|
|
|
6410
|
+ })
|
|
|
6411
|
+ }
|
|
|
6412
|
+
|
|
|
6413
|
+ createLayerForm(event.data.type)
|
|
|
6414
|
+ }
|
|
|
6415
|
+
|
|
|
6416
|
+ /**
|
|
|
6417
|
+ * @description 处理单击 or 双击事件
|
|
|
6418
|
+ */
|
|
|
6419
|
+ function handleClickOrDbClick(event) {
|
|
|
6420
|
+
|
|
|
6421
|
+ const enumEventType = {
|
|
|
6422
|
+ DOWN: "按下",
|
|
|
6423
|
+ UP: "抬起",
|
|
|
6424
|
+ SINGLE: "单击",
|
|
|
6425
|
+ DOUBLE: "双击",
|
|
|
6426
|
+ };
|
|
|
6427
|
+
|
|
|
6428
|
+ /**
|
|
|
6429
|
+ * @description
|
|
|
6430
|
+ */
|
|
|
6431
|
+ const enumConst = {
|
|
|
6432
|
+ EVENT: 'event',
|
|
|
6433
|
+ ACTION: 'actionType',
|
|
|
6434
|
+ PAGE_VALUE: 'pageValue',
|
|
|
6435
|
+ LINK_VALUE: 'linkValue',
|
|
|
6436
|
+ }
|
|
|
6437
|
+
|
|
|
6438
|
+ /**
|
|
|
6439
|
+ * @description 动作类型
|
|
|
6440
|
+ */
|
|
|
6441
|
+ const enumActionType = {
|
|
|
6442
|
+ PAGE: 'PAGE',
|
|
|
6443
|
+ LINK: 'LINK',
|
|
|
6444
|
+ PROPS: 'PROPS',
|
|
|
6445
|
+ }
|
|
|
6446
|
+
|
|
|
6447
|
+ const enumGetValue = {
|
5909
|
[enumActionType.PAGE]: enumConst.PAGE_VALUE,
|
6448
|
[enumActionType.PAGE]: enumConst.PAGE_VALUE,
|
5910
|
[enumActionType.LINK]: enumConst.LINK_VALUE,
|
6449
|
[enumActionType.LINK]: enumConst.LINK_VALUE,
|
5911
|
}
|
6450
|
}
|
|
@@ -5947,8 +6486,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5947,8 +6486,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5947
|
[enumGetValue[content.type]]: content.value,
|
6486
|
[enumGetValue[content.type]]: content.value,
|
5948
|
}
|
6487
|
}
|
5949
|
if (content.type === enumActionType.PAGE) {
|
6488
|
if (content.type === enumActionType.PAGE) {
|
5950
|
- $(`#${ enumActionEl.PAGE_EL_ID }`).css({ display: 'block' })
|
|
|
5951
|
- $(`#${ enumActionEl.LINK_EL_ID }`).css({ display: 'none' })
|
6489
|
+ $(`#${enumActionEl.PAGE_EL_ID}`).css({ display: 'block' })
|
|
|
6490
|
+ $(`#${enumActionEl.LINK_EL_ID}`).css({ display: 'none' })
|
5952
|
}
|
6491
|
}
|
5953
|
form.val(enumActionEl.FORM_FILTER, val)
|
6492
|
form.val(enumActionEl.FORM_FILTER, val)
|
5954
|
}
|
6493
|
}
|
|
@@ -5968,7 +6507,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5968,7 +6507,8 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5968
|
value: formVal[enumGetValue[formVal[enumConst.ACTION]]],
|
6507
|
value: formVal[enumGetValue[formVal[enumConst.ACTION]]],
|
5969
|
},
|
6508
|
},
|
5970
|
}
|
6509
|
}
|
5971
|
- const [ err ] = await to(ConfigurationNodeApi.updateNodeEvent(data))
|
6510
|
+ await to(autoSaveGraphInfo())
|
|
|
6511
|
+ const [err] = await to(ConfigurationNodeApi.updateNodeEvent(data))
|
5972
|
if (err) return
|
6512
|
if (err) return
|
5973
|
UseLayUi.successMsg()
|
6513
|
UseLayUi.successMsg()
|
5974
|
callback()
|
6514
|
callback()
|
|
@@ -5994,523 +6534,897 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
|
@@ -5994,523 +6534,897 @@ DataFormatPanel.prototype.addDataFont = function (container) { |
5994
|
return UseLayUi.generateOptionTemplate({ dataSource: options, addPlaceholderOption: false })
|
6534
|
return UseLayUi.generateOptionTemplate({ dataSource: options, addPlaceholderOption: false })
|
5995
|
}
|
6535
|
}
|
5996
|
|
6536
|
|
5997
|
- function generatorEventListen() {
|
|
|
5998
|
- form.on(`select(${ enumActionEl.ACTION_SELECT_FILTER })`, (data) => {
|
|
|
5999
|
- const { value } = data
|
|
|
6000
|
- if (value === enumActionType.PAGE) {
|
|
|
6001
|
- $(`#${ enumActionEl.LINK_EL_ID }`).css({ display: 'none' })
|
|
|
6002
|
- $(`#${ enumActionEl.PAGE_EL_ID }`).css({ display: 'block' })
|
|
|
6003
|
- } else if (value === enumActionType.LINK) {
|
|
|
6004
|
- $(`#${ enumActionEl.PAGE_EL_ID }`).css({ display: 'none' })
|
|
|
6005
|
- $(`#${ enumActionEl.LINK_EL_ID }`).css({ display: 'block' })
|
|
|
6006
|
- }
|
|
|
6007
|
- })
|
6537
|
+ function generatorEventListen() {
|
|
|
6538
|
+ form.on(`select(${enumActionEl.ACTION_SELECT_FILTER})`, (data) => {
|
|
|
6539
|
+ const { value } = data
|
|
|
6540
|
+ if (value === enumActionType.PAGE) {
|
|
|
6541
|
+ $(`#${enumActionEl.LINK_EL_ID}`).css({ display: 'none' })
|
|
|
6542
|
+ $(`#${enumActionEl.PAGE_EL_ID}`).css({ display: 'block' })
|
|
|
6543
|
+ } else if (value === enumActionType.LINK) {
|
|
|
6544
|
+ $(`#${enumActionEl.PAGE_EL_ID}`).css({ display: 'none' })
|
|
|
6545
|
+ $(`#${enumActionEl.LINK_EL_ID}`).css({ display: 'block' })
|
|
|
6546
|
+ }
|
|
|
6547
|
+ })
|
|
|
6548
|
+ }
|
|
|
6549
|
+
|
|
|
6550
|
+ /**
|
|
|
6551
|
+ * @description 创建弹窗表单
|
|
|
6552
|
+ */
|
|
|
6553
|
+ function createLayerForm(type) {
|
|
|
6554
|
+
|
|
|
6555
|
+ const content = `
|
|
|
6556
|
+ <form class="layui-form" lay-filter="${enumActionEl.FORM_FILTER}">
|
|
|
6557
|
+ <div style="width:400px">
|
|
|
6558
|
+ <div class="layui-form-item">
|
|
|
6559
|
+ <label class="layui-form-label">事件</label>
|
|
|
6560
|
+ <div class="layui-input-block">
|
|
|
6561
|
+ <input type="text" name="${enumConst.EVENT}" disabled class="layui-input" value="${enumEventType[type]}">
|
|
|
6562
|
+ </div>
|
|
|
6563
|
+ </div>
|
|
|
6564
|
+ <div class="layui-form-item">
|
|
|
6565
|
+ <label class="layui-form-label">动作</label>
|
|
|
6566
|
+ <div class="layui-input-block">
|
|
|
6567
|
+ <select name="${enumConst.ACTION}" lay-verType="tips" lay-verify="required" lay-filter="${enumActionEl.ACTION_SELECT_FILTER}">
|
|
|
6568
|
+ ${generatorActionOptions()}
|
|
|
6569
|
+ </select>
|
|
|
6570
|
+ </div>
|
|
|
6571
|
+ </div>
|
|
|
6572
|
+ <div class="layui-form-item" id="${enumActionEl.LINK_EL_ID}">
|
|
|
6573
|
+ <label class="layui-form-label">链接</label>
|
|
|
6574
|
+ <div class="layui-input-block">
|
|
|
6575
|
+ <input type="text" lay-verType="tips" name="${enumConst.LINK_VALUE}" class="layui-input">
|
|
|
6576
|
+ </div>
|
|
|
6577
|
+ </div>
|
|
|
6578
|
+ <div class="layui-form-item" id="${enumActionEl.PAGE_EL_ID}" style="display:none">
|
|
|
6579
|
+ <label class="layui-form-label">页面</label>
|
|
|
6580
|
+ <div class="layui-input-block">
|
|
|
6581
|
+ <select name="${enumConst.PAGE_VALUE}" lay-verType="tips" id="pageSelect">
|
|
|
6582
|
+ ${generatorPageOptions()}
|
|
|
6583
|
+ </select>
|
|
|
6584
|
+ </div>
|
|
|
6585
|
+ </div>
|
|
|
6586
|
+ </div>
|
|
|
6587
|
+ </form>
|
|
|
6588
|
+ `
|
|
|
6589
|
+
|
|
|
6590
|
+ layer.open({
|
|
|
6591
|
+ title: "创建交互",
|
|
|
6592
|
+ content,
|
|
|
6593
|
+ area: ["800px", "500px"],
|
|
|
6594
|
+ btn: ["保存", "取消"],
|
|
|
6595
|
+ yes(index) {
|
|
|
6596
|
+ form.on(`submit(${enumActionEl.LAYER_SUBMIT_FILTER})`, data => {
|
|
|
6597
|
+ submit(() => {
|
|
|
6598
|
+ layer.close(index)
|
|
|
6599
|
+ getNodeBindInfo()
|
|
|
6600
|
+ })
|
|
|
6601
|
+ })
|
|
|
6602
|
+ },
|
|
|
6603
|
+ btn2(index) {
|
|
|
6604
|
+ layer.close(index);
|
|
|
6605
|
+ },
|
|
|
6606
|
+ success(layero) {
|
|
|
6607
|
+ $(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
|
|
6608
|
+ 'lay-submit': '',
|
|
|
6609
|
+ 'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
|
|
6610
|
+ })
|
|
|
6611
|
+ generatorEventListen()
|
|
|
6612
|
+ const info = getLayerBindInfo('event', type)
|
|
|
6613
|
+ form.render(null, enumActionEl.FORM_FILTER)
|
|
|
6614
|
+ if (info) echoFormData(info)
|
|
|
6615
|
+ },
|
|
|
6616
|
+ shade: ["0.7", "#fafafa"],
|
|
|
6617
|
+ });
|
|
|
6618
|
+ }
|
|
|
6619
|
+
|
|
|
6620
|
+ createLayerForm(event.data.type)
|
|
|
6621
|
+ }
|
|
|
6622
|
+
|
|
|
6623
|
+ /**
|
|
|
6624
|
+ * @description 处理数据动效
|
|
|
6625
|
+ */
|
|
|
6626
|
+ function handleDataDynamicEffect(event) {
|
|
|
6627
|
+
|
|
|
6628
|
+ const IS_DISPLAY = event.data.type === 'DISPLAY'
|
|
|
6629
|
+
|
|
|
6630
|
+ const enumEventType = {
|
|
|
6631
|
+ FLASH: '闪烁',
|
|
|
6632
|
+ DISPLAY: '显示/隐藏',
|
|
|
6633
|
+ ROTATE: '旋转',
|
|
|
6634
|
+ }
|
|
|
6635
|
+
|
|
|
6636
|
+ const enumActionEl = {
|
|
|
6637
|
+ ROW_FILTER: 'dataDynamicEffectRowFilter',
|
|
|
6638
|
+ FORM_FILTER: 'dataDynamicEffectFormFilter',
|
|
|
6639
|
+ TABLE_BODY_EL: 'dataDynamicEffectTbody',
|
|
|
6640
|
+ TYPE_EL: 'dataDynamicEffectType',
|
|
|
6641
|
+ DEL_BTN_EL: 'dataDynamicEffectDelBtn',
|
|
|
6642
|
+ ADD_BTN_EL: 'dataDynamicEffectAddBtn',
|
|
|
6643
|
+ DISPLAY_SWITCH_EL: 'visibleOrHidden',
|
|
|
6644
|
+ LAYER_SUBMIT_FILTER: 'dynamicEffectLayerFilter',
|
|
|
6645
|
+ MIN_FILTER: 'dynamicEffectMinFilter',
|
|
|
6646
|
+ MAX_FILTER: 'dynamicEffectMaxFilter',
|
|
|
6647
|
+ DATA_SOURCE_COMP_EL: 'dynamicDataSourceCompEl',
|
|
|
6648
|
+ }
|
|
|
6649
|
+
|
|
|
6650
|
+ const getRowFilter = (rowNumber) => `${enumActionEl.ROW_FILTER}${rowNumber}`
|
|
|
6651
|
+
|
|
|
6652
|
+ /**
|
|
|
6653
|
+ * @description
|
|
|
6654
|
+ */
|
|
|
6655
|
+ const enumConst = {
|
|
|
6656
|
+ MIN: 'min',
|
|
|
6657
|
+ MAX: 'max',
|
|
|
6658
|
+ TYPE: 'type',
|
|
|
6659
|
+ ORG_ID: 'orgId',
|
|
|
6660
|
+ DEVICE_ID: 'deviceId',
|
|
|
6661
|
+ SLAVE_DEVICE_ID: 'slaveDeviceId',
|
|
|
6662
|
+ ATTR: 'attr',
|
|
|
6663
|
+ GATEWAY: 'GATEWAY',
|
|
|
6664
|
+ }
|
|
|
6665
|
+
|
|
|
6666
|
+ const enumDisplayType = HandleDynamicEffect.enumDisplayType
|
|
|
6667
|
+
|
|
|
6668
|
+ /**
|
|
|
6669
|
+ * @description
|
|
|
6670
|
+ */
|
|
|
6671
|
+ let addRowNumber = 0
|
|
|
6672
|
+
|
|
|
6673
|
+ function generatorDisplayOptions() {
|
|
|
6674
|
+ const options = [
|
|
|
6675
|
+ { name: '显示', id: enumDisplayType.SHOW },
|
|
|
6676
|
+ { name: '隐藏', id: enumDisplayType.HIDDEN },
|
|
|
6677
|
+ ]
|
|
|
6678
|
+ const template = UseLayUi.generateOptionTemplate({ dataSource: options })
|
|
|
6679
|
+ return `
|
|
|
6680
|
+ <div class="layui-form-item" style="margin-bottom: 0px">
|
|
|
6681
|
+ <div class="layui-input-block" style="margin-left: 0px;">
|
|
|
6682
|
+ <select name="${enumConst.TYPE}" lay-verType="tips" lay-verify="required">${template}</select>
|
|
|
6683
|
+ </div>
|
|
|
6684
|
+ </div>
|
|
|
6685
|
+ `
|
|
|
6686
|
+ }
|
|
|
6687
|
+
|
|
|
6688
|
+ /**
|
|
|
6689
|
+ * @description 添加一条记录
|
|
|
6690
|
+ */
|
|
|
6691
|
+ function addRecord() {
|
|
|
6692
|
+ const content = `
|
|
|
6693
|
+ <tr class="layui-form" lay-filter="${getRowFilter(addRowNumber)}">
|
|
|
6694
|
+ ${IS_DISPLAY && `<td>${generatorDisplayOptions()}</td>`}
|
|
|
6695
|
+ <td>
|
|
|
6696
|
+ <input autocomplete="off" lay-verType="tips" lay-verify="required" type="number" name="${enumConst.MIN}" class="layui-input ${enumActionEl.MIN_FILTER}">
|
|
|
6697
|
+ </td>
|
|
|
6698
|
+ <td>
|
|
|
6699
|
+ <input autocomplete="off" lay-verType="tips" lay-verify="required" type="number" name="${enumConst.MAX}" class="layui-input ${enumActionEl.MAX_FILTER}">
|
|
|
6700
|
+ </td>
|
|
|
6701
|
+ <td style="text-align: center;">
|
|
|
6702
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-red ${enumActionEl.DEL_BTN_EL}">删除</button>
|
|
|
6703
|
+ </td>
|
|
|
6704
|
+ </tr>
|
|
|
6705
|
+ `
|
|
|
6706
|
+ addRowNumber++
|
|
|
6707
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`).append(content)
|
|
|
6708
|
+ if (IS_DISPLAY) {
|
|
|
6709
|
+ form.render()
|
|
|
6710
|
+ }
|
|
|
6711
|
+ }
|
|
|
6712
|
+
|
|
|
6713
|
+ /**
|
|
|
6714
|
+ * @description 创建添加记录事件
|
|
|
6715
|
+ */
|
|
|
6716
|
+ function createAddRowListenEvent() {
|
|
|
6717
|
+ $(`#${enumActionEl.ADD_BTN_EL}`).on('click', () => {
|
|
|
6718
|
+ addRecord()
|
|
|
6719
|
+ createDeleteRowListenEvent()
|
|
|
6720
|
+ })
|
|
|
6721
|
+ }
|
|
|
6722
|
+
|
|
|
6723
|
+ /**
|
|
|
6724
|
+ * @description 创建删除行事件
|
|
|
6725
|
+ */
|
|
|
6726
|
+ function createDeleteRowListenEvent() {
|
|
|
6727
|
+ $(`.${enumActionEl.DEL_BTN_EL}`).on('click', (event) => {
|
|
|
6728
|
+ $(event.target).parents('tr').remove()
|
|
|
6729
|
+ })
|
|
|
6730
|
+ }
|
|
|
6731
|
+
|
|
|
6732
|
+
|
|
|
6733
|
+ /**
|
|
|
6734
|
+ * @description 创建输入监听
|
|
|
6735
|
+ */
|
|
|
6736
|
+ function createInputListener() {
|
|
|
6737
|
+ $(`#${enumActionEl.TABLE_BODY_EL}`)
|
|
|
6738
|
+ .on('input', `.${enumActionEl.MIN_FILTER}`, event => {
|
|
|
6739
|
+ const minVal = $(event.target).val()
|
|
|
6740
|
+ const maxVal = $(event.target).parents('tr').find(`input.${enumActionEl.MAX_FILTER}`).val()
|
|
|
6741
|
+ if (maxVal !== '' && Number(minVal) > Number(maxVal)) {
|
|
|
6742
|
+ layer.tips('输入值大于最大值', $(event.target), {
|
|
|
6743
|
+ tips: 1,
|
|
|
6744
|
+ });
|
|
|
6745
|
+ }
|
|
|
6746
|
+ })
|
|
|
6747
|
+ .on('input', `.${enumActionEl.MAX_FILTER}`, event => {
|
|
|
6748
|
+ const maxVal = $(event.target).val()
|
|
|
6749
|
+ const minVal = $(event.target).parents('tr').find(`input.${enumActionEl.MIN_FILTER}`).val()
|
|
|
6750
|
+ if (minVal !== '' && Number(maxVal) < Number(minVal)) {
|
|
|
6751
|
+ layer.tips('输入值小于最小值', $(event.target), {
|
|
|
6752
|
+ tips: 1,
|
|
|
6753
|
+ });
|
|
|
6754
|
+ }
|
|
|
6755
|
+ })
|
|
|
6756
|
+ }
|
|
|
6757
|
+
|
|
|
6758
|
+ /**
|
|
|
6759
|
+ * @description 创建事件监听
|
|
|
6760
|
+ */
|
|
|
6761
|
+ function createEventListen() {
|
|
|
6762
|
+ createInputListener()
|
|
|
6763
|
+ createAddRowListenEvent()
|
|
|
6764
|
+ createDeleteRowListenEvent()
|
|
|
6765
|
+ }
|
|
|
6766
|
+
|
|
|
6767
|
+ /**
|
|
|
6768
|
+ * @description 回显数据
|
|
|
6769
|
+ */
|
|
|
6770
|
+ function echoData(info) {
|
|
|
6771
|
+ const { condition = [] } = info
|
|
|
6772
|
+ echoEachData(condition)
|
|
|
6773
|
+ }
|
|
|
6774
|
+
|
|
|
6775
|
+ /**
|
|
|
6776
|
+ * @description 回显行数据
|
|
|
6777
|
+ */
|
|
|
6778
|
+ function echoEachData(condition = []) {
|
|
|
6779
|
+ condition.forEach((item, index) => {
|
|
|
6780
|
+ addRecord()
|
|
|
6781
|
+ form.val(getRowFilter(index), { ...item })
|
|
|
6782
|
+ })
|
|
|
6783
|
+ }
|
|
|
6784
|
+
|
|
|
6785
|
+ function validate(tableData) {
|
|
|
6786
|
+ let validateFlag = true
|
|
|
6787
|
+ for (let i = 0; i < tableData.length; i++) {
|
|
|
6788
|
+ const { min, max } = tableData[i]
|
|
|
6789
|
+ if (Number(min) > Number(max)) {
|
|
|
6790
|
+ validateFlag = false
|
|
|
6791
|
+ layer.tips('输入值大于最大值', $(`#${enumActionEl.TABLE_BODY_EL} tr`).eq(i).find(`input[name="${enumConst.MIN}"]`), { tips: 1 })
|
|
|
6792
|
+ break
|
|
|
6793
|
+ } else if (Number(max) < Number(min)) {
|
|
|
6794
|
+ validateFlag = false
|
|
|
6795
|
+ layer.tips('输入值小于最小值', $(`#${enumActionEl.TABLE_BODY_EL} tr`).eq(i).find(`input[name="${enumConst.MAX}"]`), { tips: 1 })
|
|
|
6796
|
+ break
|
|
|
6797
|
+ }
|
|
|
6798
|
+ }
|
|
|
6799
|
+ return validateFlag
|
|
|
6800
|
+ }
|
|
|
6801
|
+
|
|
|
6802
|
+ async function submit(callback) {
|
|
|
6803
|
+ const tableData = Array.from({ length: addRowNumber }).map((_, index) => form.val(getRowFilter(index))).filter(obj => Object.keys(obj).length)
|
|
|
6804
|
+ if (!validate(tableData)) return
|
|
|
6805
|
+ const formVal = form.val(enumActionEl.FORM_FILTER)
|
|
|
6806
|
+ const formModel = {
|
|
|
6807
|
+ configurationId,
|
|
|
6808
|
+ contentId: currentPageId.id,
|
|
|
6809
|
+ ...formVal,
|
|
|
6810
|
+ id: graphId,
|
|
|
6811
|
+ condition: tableData,
|
|
|
6812
|
+ type: event.data.type,
|
|
|
6813
|
+ }
|
|
|
6814
|
+ await to(autoSaveGraphInfo())
|
|
|
6815
|
+ const [err, res] = await to(ConfigurationNodeApi.updateNodeAct(formModel))
|
|
|
6816
|
+ if (err) return
|
|
|
6817
|
+ UseLayUi.successMsg()
|
|
|
6818
|
+ callback()
|
|
|
6819
|
+ }
|
|
|
6820
|
+
|
|
|
6821
|
+ function isExistInArea(min, max, value) {
|
|
|
6822
|
+ return Number(value) >= Number(min) && Number(value) <= Number(max)
|
6008
|
}
|
6823
|
}
|
6009
|
|
6824
|
|
6010
|
- /**
|
|
|
6011
|
- * @description 创建弹窗表单
|
|
|
6012
|
- */
|
|
|
6013
|
function createLayerForm(type) {
|
6825
|
function createLayerForm(type) {
|
6014
|
-
|
|
|
6015
|
const content = `
|
6826
|
const content = `
|
6016
|
- <form class="layui-form" lay-filter="${ enumActionEl.FORM_FILTER }">
|
|
|
6017
|
- <div style="width:400px">
|
|
|
6018
|
- <div class="layui-form-item">
|
|
|
6019
|
- <label class="layui-form-label">事件</label>
|
|
|
6020
|
- <div class="layui-input-block">
|
|
|
6021
|
- <input type="text" name="${ enumConst.EVENT }" disabled class="layui-input" value="${ enumEventType[type] }">
|
|
|
6022
|
- </div>
|
|
|
6023
|
- </div>
|
|
|
6024
|
- <div class="layui-form-item">
|
|
|
6025
|
- <label class="layui-form-label">动作</label>
|
|
|
6026
|
- <div class="layui-input-block">
|
|
|
6027
|
- <select name="${ enumConst.ACTION }" lay-verType="tips" lay-verify="required" lay-filter="${ enumActionEl.ACTION_SELECT_FILTER }">
|
|
|
6028
|
- ${ generatorActionOptions() }
|
|
|
6029
|
- </select>
|
|
|
6030
|
- </div>
|
|
|
6031
|
- </div>
|
|
|
6032
|
- <div class="layui-form-item" id="${ enumActionEl.LINK_EL_ID }">
|
|
|
6033
|
- <label class="layui-form-label">链接</label>
|
|
|
6034
|
- <div class="layui-input-block">
|
|
|
6035
|
- <input type="text" lay-verType="tips" name="${ enumConst.LINK_VALUE }" class="layui-input">
|
6827
|
+ <form class="layui-form" lay-filter="${enumActionEl.FORM_FILTER}">
|
|
|
6828
|
+ <div style="width:400px">
|
|
|
6829
|
+ <div class="layui-form-item">
|
|
|
6830
|
+ <label class="layui-form-label">类型</label>
|
|
|
6831
|
+ <div class="layui-input-block">
|
|
|
6832
|
+ <input type="radio" name="type" value="1" title="联网设备" checked>
|
|
|
6833
|
+ <input type="radio" name="type" value="2" title="产品/场景" disabled>
|
|
|
6834
|
+ </div>
|
6036
|
</div>
|
6835
|
</div>
|
|
|
6836
|
+
|
|
|
6837
|
+ <div id="${enumActionEl.DATA_SOURCE_COMP_EL}"></div>
|
|
|
6838
|
+
|
6037
|
</div>
|
6839
|
</div>
|
6038
|
- <div class="layui-form-item" id="${ enumActionEl.PAGE_EL_ID }" style="display:none">
|
|
|
6039
|
- <label class="layui-form-label">页面</label>
|
|
|
6040
|
- <div class="layui-input-block">
|
|
|
6041
|
- <select name="${ enumConst.PAGE_VALUE }" lay-verType="tips" id="pageSelect">
|
|
|
6042
|
- ${ generatorPageOptions() }
|
|
|
6043
|
- </select>
|
|
|
6044
|
- </div>
|
6840
|
+ </form>
|
|
|
6841
|
+ <div class="override__table">
|
|
|
6842
|
+ <table class="layui-table" >
|
|
|
6843
|
+ <thead>
|
|
|
6844
|
+ <tr>
|
|
|
6845
|
+ ${IS_DISPLAY ? '<th style="text-align:center">类型</th>' : ''}
|
|
|
6846
|
+ <th style="text-align:center">最小值(<=)</th>
|
|
|
6847
|
+ <th style="text-align:center">最大值(>=)</th>
|
|
|
6848
|
+ <th style="text-align:center">操作</th>
|
|
|
6849
|
+ </tr>
|
|
|
6850
|
+ </thead>
|
|
|
6851
|
+ <tbody id="${enumActionEl.TABLE_BODY_EL}"></tbody>
|
|
|
6852
|
+ </table>
|
|
|
6853
|
+ <div style="display:flex;justify-content:center;">
|
|
|
6854
|
+ <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="${enumActionEl.ADD_BTN_EL}">添加一条</button>
|
6045
|
</div>
|
6855
|
</div>
|
6046
|
</div>
|
6856
|
</div>
|
6047
|
- </form>
|
|
|
6048
|
- `
|
6857
|
+ `
|
6049
|
|
6858
|
|
6050
|
layer.open({
|
6859
|
layer.open({
|
6051
|
- title: "创建交互",
|
6860
|
+ title: enumEventType[type],
|
6052
|
content,
|
6861
|
content,
|
6053
|
- area: [ "800px", "500px" ],
|
|
|
6054
|
- btn: [ "保存", "取消" ],
|
6862
|
+ skin: 'event-layer__override',
|
|
|
6863
|
+ btn: ['保存', '取消'],
|
|
|
6864
|
+ offset: '100px',
|
|
|
6865
|
+ area: IS_DISPLAY ? '1000px' : '800PX',
|
|
|
6866
|
+ success(layero) {
|
|
|
6867
|
+ $(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
|
|
6868
|
+ 'lay-submit': '',
|
|
|
6869
|
+ 'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
|
|
6870
|
+ })
|
|
|
6871
|
+ const {
|
|
|
6872
|
+ component,
|
|
|
6873
|
+ echoDataSource,
|
|
|
6874
|
+ } = generatorDataSourceComponent({ overrideClass: 'dynamic-effect__data-source-comp--override' })
|
|
|
6875
|
+ $(`#${enumActionEl.DATA_SOURCE_COMP_EL}`).append(component)
|
|
|
6876
|
+ const info = getLayerBindInfo('act', type)
|
|
|
6877
|
+ const { condition = [] } = info
|
|
|
6878
|
+ if (info && condition.length) {
|
|
|
6879
|
+ echoDataSource(info)
|
|
|
6880
|
+ echoData(info)
|
|
|
6881
|
+ } else {
|
|
|
6882
|
+ addRecord()
|
|
|
6883
|
+ }
|
|
|
6884
|
+ createEventListen()
|
|
|
6885
|
+ form.render()
|
|
|
6886
|
+ },
|
6055
|
yes(index) {
|
6887
|
yes(index) {
|
6056
|
- form.on(`submit(${ enumActionEl.LAYER_SUBMIT_FILTER })`, data => {
|
6888
|
+ form.on(`submit(${enumActionEl.LAYER_SUBMIT_FILTER})`, data => {
|
6057
|
submit(() => {
|
6889
|
submit(() => {
|
6058
|
layer.close(index)
|
6890
|
layer.close(index)
|
6059
|
getNodeBindInfo()
|
6891
|
getNodeBindInfo()
|
6060
|
})
|
6892
|
})
|
6061
|
})
|
6893
|
})
|
6062
|
},
|
6894
|
},
|
6063
|
- btn2(index) {
|
|
|
6064
|
- layer.close(index);
|
|
|
6065
|
- },
|
|
|
6066
|
- success(layero) {
|
|
|
6067
|
- $(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
|
|
6068
|
- 'lay-submit': '',
|
|
|
6069
|
- 'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
|
|
6070
|
- })
|
|
|
6071
|
- generatorEventListen()
|
|
|
6072
|
- const info = getLayerBindInfo('event', type)
|
|
|
6073
|
- form.render(null, enumActionEl.FORM_FILTER)
|
|
|
6074
|
- if (info) echoFormData(info)
|
6895
|
+ btn2() {
|
|
|
6896
|
+
|
6075
|
},
|
6897
|
},
|
6076
|
- shade: [ "0.7", "#fafafa" ],
|
|
|
6077
|
- });
|
6898
|
+ })
|
6078
|
}
|
6899
|
}
|
6079
|
|
6900
|
|
6080
|
createLayerForm(event.data.type)
|
6901
|
createLayerForm(event.data.type)
|
|
|
6902
|
+
|
6081
|
}
|
6903
|
}
|
6082
|
|
6904
|
|
6083
|
/**
|
6905
|
/**
|
6084
|
- * @description 处理数据动效
|
6906
|
+ * @description 生成数据源组件
|
|
|
6907
|
+ * @param {object} options
|
|
|
6908
|
+ * @param {string} [options.overrideClass = ''] options.overrideClass
|
|
|
6909
|
+ * @param {boolean} [options.validate = true ] options.validate
|
6085
|
*/
|
6910
|
*/
|
6086
|
- function handleDataDynamicEffect(event) {
|
|
|
6087
|
-
|
|
|
6088
|
- const IS_DISPLAY = event.data.type === 'DISPLAY'
|
|
|
6089
|
-
|
|
|
6090
|
- const enumEventType = {
|
|
|
6091
|
- FLASH: '闪烁',
|
|
|
6092
|
- DISPLAY: '显示/隐藏',
|
|
|
6093
|
- ROTATE: '旋转',
|
|
|
6094
|
- }
|
|
|
6095
|
-
|
|
|
6096
|
- const enumActionEl = {
|
|
|
6097
|
- ROW_FILTER: 'dataDynamicEffectRowFilter',
|
|
|
6098
|
- FORM_FILTER: 'dataDynamicEffectFormFilter',
|
|
|
6099
|
- TABLE_BODY_EL: 'dataDynamicEffectTbody',
|
|
|
6100
|
- TYPE_EL: 'dataDynamicEffectType',
|
|
|
6101
|
- ORG_EL: 'dataDynamicEffectOrg',
|
|
|
6102
|
- ORG_FILTER: 'dataDynamicEffectOrgFilter',
|
|
|
6103
|
- DEVICE_EL: 'dataDynamicEffectDevice',
|
|
|
6104
|
- SLAVE_DEVICE_EL: 'dataDynamicEffectSlaveDevice',
|
|
|
6105
|
- ATTR_EL: 'dataDynamicEffectAtt',
|
|
|
6106
|
- DEL_BTN_EL: 'dataDynamicEffectDelBtn',
|
|
|
6107
|
- ADD_BTN_EL: 'dataDynamicEffectAddBtn',
|
|
|
6108
|
- DISPLAY_SWITCH_EL: 'visibleOrHidden',
|
|
|
6109
|
- LAYER_SUBMIT_FILTER: 'dynamicEffectLayerFilter',
|
|
|
6110
|
- MIN_FILTER: 'dynamicEffectMinFilter',
|
|
|
6111
|
- MAX_FILTER: 'dynamicEffectMaxFilter',
|
|
|
6112
|
- }
|
6911
|
+ function generatorDataSourceComponent(options = {}) {
|
|
|
6912
|
+ const { overrideClass = '', validate = true } = options
|
|
|
6913
|
+ const componentFilter = `data-source__component-filter-${Date.now()}`
|
|
|
6914
|
+ const componentId = `data-source__component-${Date.now()}`
|
6113
|
|
6915
|
|
6114
|
- const getRowFilter = (rowNumber) => `${ enumActionEl.ROW_FILTER }${ rowNumber }`
|
6916
|
+ const validateRule = validate ? { layVerify: 'required', layVerType: 'tips' } : {}
|
6115
|
|
6917
|
|
6116
|
- /**
|
|
|
6117
|
- * @description
|
|
|
6118
|
- */
|
|
|
6119
|
- const enumConst = {
|
|
|
6120
|
- MIN: 'min',
|
|
|
6121
|
- MAX: 'max',
|
|
|
6122
|
- TYPE: 'type',
|
6918
|
+ const enumDataSourceConst = {
|
6123
|
ORG_ID: 'orgId',
|
6919
|
ORG_ID: 'orgId',
|
6124
|
DEVICE_ID: 'deviceId',
|
6920
|
DEVICE_ID: 'deviceId',
|
6125
|
SLAVE_DEVICE_ID: 'slaveDeviceId',
|
6921
|
SLAVE_DEVICE_ID: 'slaveDeviceId',
|
6126
|
ATTR: 'attr',
|
6922
|
ATTR: 'attr',
|
6127
|
GATEWAY: 'GATEWAY',
|
6923
|
GATEWAY: 'GATEWAY',
|
6128
|
}
|
6924
|
}
|
|
|
6925
|
+ /**
|
|
|
6926
|
+ * @description
|
|
|
6927
|
+ * @type {{id: string, deviceType: string, name: string}[]}
|
|
|
6928
|
+ */
|
|
|
6929
|
+ let deviceList = []
|
|
|
6930
|
+
|
|
|
6931
|
+ const component = document.createElement('div')
|
|
|
6932
|
+
|
|
|
6933
|
+ $(component)
|
|
|
6934
|
+ .addClass(`layui-form data-source__component-style ${overrideClass}`)
|
|
|
6935
|
+ .attr({
|
|
|
6936
|
+ id: componentId,
|
|
|
6937
|
+ 'lay-filter': componentFilter,
|
|
|
6938
|
+ })
|
|
|
6939
|
+
|
|
|
6940
|
+ init()
|
|
|
6941
|
+
|
|
|
6942
|
+ function init() {
|
|
|
6943
|
+ generatorOrgTres()
|
|
|
6944
|
+ generatorDeviceSelect()
|
|
|
6945
|
+ generatorSlaveDevice()
|
|
|
6946
|
+ generatorAttrSelect()
|
|
|
6947
|
+ }
|
6129
|
|
6948
|
|
6130
|
- const enumDisplayType = HandleDynamicEffect.enumDisplayType
|
|
|
6131
|
|
6949
|
|
6132
|
/**
|
6950
|
/**
|
6133
|
- * @description 设备列表
|
6951
|
+ * @description 根据组织ID获取设备
|
6134
|
*/
|
6952
|
*/
|
6135
|
- let deviceList = []
|
6953
|
+ async function getDevicesByOrgId(organizationId) {
|
|
|
6954
|
+ if (organizationId) {
|
|
|
6955
|
+ const items = deviceList = await ConfigurationNodeApi.getMasterDevice(organizationId);
|
|
|
6956
|
+ $(`#${componentId} `).find(`select[name="${enumDataSourceConst.DEVICE_ID}"]`).html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
6957
|
+ form.render('select', componentFilter)
|
|
|
6958
|
+ }
|
|
|
6959
|
+ }
|
6136
|
|
6960
|
|
6137
|
/**
|
6961
|
/**
|
6138
|
- * @description 当前组织ID
|
|
|
6139
|
- * @type {null | string}
|
6962
|
+ * @description 通过主设备ID获取从设备
|
6140
|
*/
|
6963
|
*/
|
6141
|
- let currentOrgId = null
|
6964
|
+ async function getSlaveDeviceByMasterDeviceId(orgId, deviceId) {
|
|
|
6965
|
+ if (deviceId && currentCheckedOrgNode) {
|
|
|
6966
|
+ const items = await ConfigurationNodeApi.getSlaveDevice(orgId, deviceId);
|
|
|
6967
|
+ $(`#${componentId} `).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`).html(UseLayUi.generateOptionTemplate({ dataSource: items }))
|
|
|
6968
|
+ form.render('select', componentFilter)
|
|
|
6969
|
+ }
|
|
|
6970
|
+ }
|
6142
|
|
6971
|
|
6143
|
/**
|
6972
|
/**
|
6144
|
- * @description
|
6973
|
+ * @description 根据设备ID获取属性
|
6145
|
*/
|
6974
|
*/
|
6146
|
- let addRowNumber = 0
|
6975
|
+ async function getAttrByDeviceId(tbDeviceId) {
|
|
|
6976
|
+ if (tbDeviceId) {
|
|
|
6977
|
+ const [err, res] = await to(ConfigurationNodeApi.getDeviceAttr(tbDeviceId))
|
|
|
6978
|
+ $(`#${componentId} `).find(`select[name="${enumDataSourceConst.ATTR}"]`).html(UseLayUi.generateOptionTemplate({ dataSource: res }))
|
|
|
6979
|
+ form.render('select', componentFilter)
|
|
|
6980
|
+ }
|
|
|
6981
|
+ }
|
6147
|
|
6982
|
|
6148
|
|
6983
|
|
6149
|
/**
|
6984
|
/**
|
6150
|
- * @description 生成组织下拉树
|
6985
|
+ * @description 生成组织选择
|
6151
|
*/
|
6986
|
*/
|
6152
|
- function generatorOrgTreeSelect() {
|
6987
|
+ async function generatorOrgTres() {
|
|
|
6988
|
+ const orgContainerId = `data-source__component--org-${Date.now()}`
|
|
|
6989
|
+ const orgContainer = `<div id="${orgContainerId}"></div>`
|
|
|
6990
|
+ $(component).append(orgContainer)
|
|
|
6991
|
+
|
|
|
6992
|
+ const [err, res] = await to(ConfigurationNodeApi.getOrgTree())
|
|
|
6993
|
+ if (err) return
|
|
|
6994
|
+ treeList = res
|
|
|
6995
|
+
|
6153
|
UseLayUi.createTreeSelect({
|
6996
|
UseLayUi.createTreeSelect({
|
6154
|
- elem: `#${ enumActionEl.ORG_EL }`,
|
|
|
6155
|
- layFilter: enumConst.ORG_ID,
|
6997
|
+ elem: `#${orgContainerId}`,
|
|
|
6998
|
+ layFilter: enumDataSourceConst.ORG_ID,
|
6156
|
label: '组织',
|
6999
|
label: '组织',
|
6157
|
singleUsage: false,
|
7000
|
singleUsage: false,
|
|
|
7001
|
+ className: 'data-source__component-select',
|
|
|
7002
|
+ ...validateRule,
|
6158
|
treeProps: {
|
7003
|
treeProps: {
|
6159
|
data: treeList,
|
7004
|
data: treeList,
|
6160
|
onlyIconControl: true,
|
7005
|
onlyIconControl: true,
|
6161
|
click(node) {
|
7006
|
click(node) {
|
6162
|
- currentOrgId = node.data.id
|
|
|
6163
|
- getDeviceByOrg(node.data.id)
|
7007
|
+ form.val(componentFilter, {
|
|
|
7008
|
+ [enumDataSourceConst.DEVICE_ID]: null,
|
|
|
7009
|
+ [enumDataSourceConst.SLAVE_DEVICE_ID]: null,
|
|
|
7010
|
+ [enumDataSourceConst.ATTR]: null,
|
|
|
7011
|
+ })
|
|
|
7012
|
+ getDevicesByOrgId(node.data.id)
|
6164
|
},
|
7013
|
},
|
6165
|
},
|
7014
|
},
|
6166
|
})
|
7015
|
})
|
6167
|
}
|
7016
|
}
|
6168
|
|
7017
|
|
|
|
7018
|
+ /**
|
|
|
7019
|
+ * @description 生成设备选择器
|
|
|
7020
|
+ */
|
|
|
7021
|
+ function generatorDeviceSelect() {
|
|
|
7022
|
+ const deviceSelect = UseLayUi.createSelect({
|
|
|
7023
|
+ label: '设备',
|
|
|
7024
|
+ bindValueFiled: enumDataSourceConst.DEVICE_ID,
|
|
|
7025
|
+ layFilter: `${componentFilter}--${enumDataSourceConst.DEVICE_ID}`,
|
|
|
7026
|
+ className: 'data-source__component-select',
|
|
|
7027
|
+ ...validateRule,
|
|
|
7028
|
+ onClick(data) {
|
|
|
7029
|
+ const { value } = data
|
|
|
7030
|
+ const selected = deviceList.find(item => item.id === value)
|
|
|
7031
|
+ form.val(componentFilter, {
|
|
|
7032
|
+ [enumDataSourceConst.SLAVE_DEVICE_ID]: null,
|
|
|
7033
|
+ [enumDataSourceConst.ATTR]: null,
|
|
|
7034
|
+ })
|
|
|
7035
|
+ if (selected.deviceType === enumDataSourceConst.GATEWAY) {
|
|
|
7036
|
+ $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`)
|
|
|
7037
|
+ .attr('lay-verify', 'required').attr('lay-verType', 'tips')
|
|
|
7038
|
+ .parentsUntil(`#${componentId}`).show()
|
|
|
7039
|
+ getSlaveDeviceByMasterDeviceId(currentCheckedOrgNode, selected.id)
|
|
|
7040
|
+ } else {
|
|
|
7041
|
+ $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`)
|
|
|
7042
|
+ .attr('lay-verify', '').attr('lay-verType', 'tips')
|
|
|
7043
|
+ .parentsUntil(`#${componentId}`).hide()
|
|
|
7044
|
+ getAttrByDeviceId(selected.id)
|
|
|
7045
|
+ }
|
|
|
7046
|
+ },
|
|
|
7047
|
+ })
|
|
|
7048
|
+ $(component).append(deviceSelect)
|
|
|
7049
|
+ }
|
|
|
7050
|
+
|
|
|
7051
|
+ /**
|
|
|
7052
|
+ * @description 生成从设备选择器
|
|
|
7053
|
+ */
|
|
|
7054
|
+ function generatorSlaveDevice() {
|
|
|
7055
|
+ const slaveDeviceSelect = UseLayUi.createSelect({
|
|
|
7056
|
+ label: '子设备',
|
|
|
7057
|
+ bindValueFiled: enumDataSourceConst.SLAVE_DEVICE_ID,
|
|
|
7058
|
+ layFilter: `${componentFilter}--${enumDataSourceConst.SLAVE_DEVICE_ID}`,
|
|
|
7059
|
+ className: 'data-source__component-select',
|
|
|
7060
|
+ onClick(data) {
|
|
|
7061
|
+ const { value } = data
|
|
|
7062
|
+ form.val(componentFilter, {
|
|
|
7063
|
+ [enumDataSourceConst.ATTR]: null,
|
|
|
7064
|
+ })
|
|
|
7065
|
+ getAttrByDeviceId(value)
|
|
|
7066
|
+ },
|
|
|
7067
|
+ })
|
|
|
7068
|
+ $(component).append(slaveDeviceSelect)
|
|
|
7069
|
+ }
|
|
|
7070
|
+
|
|
|
7071
|
+ /**
|
|
|
7072
|
+ * @description 生成属性选择器
|
|
|
7073
|
+ */
|
|
|
7074
|
+ function generatorAttrSelect() {
|
|
|
7075
|
+ const attrsSelect = UseLayUi.createSelect({
|
|
|
7076
|
+ label: '属性',
|
|
|
7077
|
+ bindValueFiled: enumDataSourceConst.ATTR,
|
|
|
7078
|
+ layFilter: `${componentFilter}--${enumDataSourceConst.ATTR}`,
|
|
|
7079
|
+ className: 'data-source__component-select',
|
|
|
7080
|
+ ...validateRule,
|
|
|
7081
|
+ })
|
|
|
7082
|
+ $(component).append(attrsSelect)
|
|
|
7083
|
+ }
|
|
|
7084
|
+
|
|
|
7085
|
+ /**
|
|
|
7086
|
+ * @description 回显数据
|
|
|
7087
|
+ * @param {{orgId: string, deviceId: string, slaveDeviceId?: string, attr: string}} dataSource
|
|
|
7088
|
+ */
|
|
|
7089
|
+ function echoDataSource(dataSource = {}) {
|
|
|
7090
|
+ const { orgId, deviceId, slaveDeviceId, attr } = dataSource
|
|
|
7091
|
+ const queue = []
|
|
|
7092
|
+ if (orgId) {
|
|
|
7093
|
+ currentCheckedOrgNode = orgId
|
|
|
7094
|
+ queue.push(getDevicesByOrgId(orgId))
|
|
|
7095
|
+ }
|
|
|
7096
|
+ if (slaveDeviceId) {
|
|
|
7097
|
+ queue.push(getSlaveDeviceByMasterDeviceId(orgId, deviceId))
|
|
|
7098
|
+ $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`).parentsUntil(`#${componentId}`).show()
|
|
|
7099
|
+ queue.push(getAttrByDeviceId(slaveDeviceId))
|
|
|
7100
|
+ } else {
|
|
|
7101
|
+ $(`#${componentId}`).find(`select[name="${enumDataSourceConst.SLAVE_DEVICE_ID}"]`).parentsUntil(`#${componentId}`).hide()
|
|
|
7102
|
+ queue.push(getAttrByDeviceId(deviceId))
|
|
|
7103
|
+ }
|
|
|
7104
|
+ Promise.all(queue)
|
|
|
7105
|
+ .finally(() => {
|
|
|
7106
|
+ const orgNode = UseLayUi.findTreeObjectByField(treeList, currentCheckedOrgNode)
|
|
|
7107
|
+ $(`#${componentId} input[name="${enumDataSourceConst.ORG_ID}"]`).parent().find('span').html(orgNode?.name)
|
|
|
7108
|
+ form.val(componentFilter, {
|
|
|
7109
|
+ orgId,
|
|
|
7110
|
+ deviceId,
|
|
|
7111
|
+ slaveDeviceId,
|
|
|
7112
|
+ attr,
|
|
|
7113
|
+ })
|
|
|
7114
|
+ })
|
|
|
7115
|
+ }
|
|
|
7116
|
+
|
|
|
7117
|
+ function getValue() {
|
|
|
7118
|
+ return form.val(componentFilter)
|
|
|
7119
|
+ }
|
|
|
7120
|
+
|
|
|
7121
|
+ return { component, getValue, componentId, componentFilter, echoDataSource }
|
|
|
7122
|
+ }
|
|
|
7123
|
+
|
|
|
7124
|
+ /**
|
|
|
7125
|
+ * @description 生成上传弹出层组件
|
|
|
7126
|
+ */
|
|
|
7127
|
+ function generatorUploadLayerComponent(callback) {
|
|
|
7128
|
+
|
|
|
7129
|
+ const enumActionEl = {
|
|
|
7130
|
+ /**
|
|
|
7131
|
+ * @description 图片选中区域节点
|
|
|
7132
|
+ */
|
|
|
7133
|
+ IMG_SELECT_CONTAINER_EL: 'imgSelectContainerEl',
|
|
|
7134
|
+
|
|
|
7135
|
+ /**
|
|
|
7136
|
+ * @description 切换图片来源控制
|
|
|
7137
|
+ */
|
|
|
7138
|
+ SWITCH_IMG_ORIGIN_FILTER: 'switchImgOriginFilter',
|
|
|
7139
|
+
|
|
|
7140
|
+ /**
|
|
|
7141
|
+ * @description 图片选中侧边栏节点
|
|
|
7142
|
+ */
|
|
|
7143
|
+ VAR_IMG_CONTAINER_SIDEBAR: 'var-image__container-sidebar',
|
|
|
7144
|
+
|
|
|
7145
|
+ /**
|
|
|
7146
|
+ * @description 图库图形选择区域
|
|
|
7147
|
+ */
|
|
|
7148
|
+ VAR_IMG_CONTAINER_CONTENT: 'var-image__container-content',
|
|
|
7149
|
+
|
|
|
7150
|
+ /**
|
|
|
7151
|
+ * @description 图库图形项
|
|
|
7152
|
+ */
|
|
|
7153
|
+ VAR_IMG_ITEM: 'var-image__img-item',
|
|
|
7154
|
+
|
|
|
7155
|
+ /**
|
|
|
7156
|
+ * @description 图库图形选中控制
|
|
|
7157
|
+ */
|
|
|
7158
|
+ VAR_IMG_ITEM_CHECKED: 'var-image__img-item--checked',
|
|
|
7159
|
+
|
|
|
7160
|
+ /**
|
|
|
7161
|
+ * @description 图库图形类别节点
|
|
|
7162
|
+ */
|
|
|
7163
|
+ VAR_IMG_CATEGORY: 'var-image__category',
|
|
|
7164
|
+
|
|
|
7165
|
+ /**
|
|
|
7166
|
+ * @description 图库图形类别选择状态
|
|
|
7167
|
+ */
|
|
|
7168
|
+ VAR_IMG_CATEGORY_CHECKED: 'var-image__category--checked',
|
6169
|
|
7169
|
|
6170
|
- /**
|
|
|
6171
|
- * @description 通过组织获取设备
|
|
|
6172
|
- */
|
|
|
6173
|
- async function getDeviceByOrg(id) {
|
|
|
6174
|
- if (!id) return
|
|
|
6175
|
- const [ err, res ] = await to(ConfigurationNodeApi.getMasterDevice(id))
|
|
|
6176
|
- if (!res) return
|
|
|
6177
|
- deviceList = res
|
|
|
6178
|
- const template = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6179
|
- $(`#${ enumActionEl.DEVICE_EL } select`).html(template)
|
|
|
6180
|
- form.render('select', enumActionEl.FORM_FILTER)
|
|
|
6181
|
- }
|
7170
|
+ /**
|
|
|
7171
|
+ * @description 本地上传图片节点
|
|
|
7172
|
+ */
|
|
|
7173
|
+ UPLOAD_LOCAL_FILE_EL: 'var-image__container--local',
|
6182
|
|
7174
|
|
6183
|
- /**
|
|
|
6184
|
- * @description 通过主设备ID获取从设备
|
|
|
6185
|
- */
|
|
|
6186
|
- async function getSlaveDeviceByMasterDevice(orgId, id) {
|
|
|
6187
|
- if (!orgId || !id) return
|
|
|
6188
|
- const [ err, res ] = await to(ConfigurationNodeApi.getSlaveDevice(orgId, id))
|
|
|
6189
|
- if (res) {
|
|
|
6190
|
- const template = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6191
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL } select`).html(template)
|
|
|
6192
|
- form.render('select', enumActionEl.FORM_FILTER)
|
|
|
6193
|
- }
|
|
|
6194
|
- }
|
7175
|
+ /**
|
|
|
7176
|
+ * @description 本地上传图片状态
|
|
|
7177
|
+ */
|
|
|
7178
|
+ IMAGE_UPLOAD_STATE_EL: 'var-image__upload-state',
|
6195
|
|
7179
|
|
6196
|
- /**
|
|
|
6197
|
- * @description 通过设备ID获取设备属性
|
|
|
6198
|
- */
|
|
|
6199
|
- async function getAttrsByDevice(id) {
|
|
|
6200
|
- if (!id) return
|
|
|
6201
|
- const [ err, res ] = await to(ConfigurationNodeApi.getDeviceAttr(id))
|
|
|
6202
|
- if (res) {
|
|
|
6203
|
- const template = UseLayUi.generateOptionTemplate({ dataSource: res })
|
|
|
6204
|
- $(`#${ enumActionEl.ATTR_EL } select`).html(template)
|
|
|
6205
|
- // form.render('select')
|
|
|
6206
|
- form.render('select', enumActionEl.FORM_FILTER)
|
|
|
6207
|
- }
|
7180
|
+ /**
|
|
|
7181
|
+ * @description 预览图片状态
|
|
|
7182
|
+ */
|
|
|
7183
|
+ IMAGE_PREVIEW_EL: 'preview__img--preview',
|
|
|
7184
|
+
|
|
|
7185
|
+ /**
|
|
|
7186
|
+ * @description 本地图片上传删除按钮
|
|
|
7187
|
+ */
|
|
|
7188
|
+ IMAGE_DEL_PREVIEW_EL: 'var-image__del-icon',
|
6208
|
}
|
7189
|
}
|
6209
|
|
7190
|
|
6210
|
- function generatorDisplayOptions() {
|
|
|
6211
|
- const options = [
|
|
|
6212
|
- { name: '显示', id: enumDisplayType.SHOW },
|
|
|
6213
|
- { name: '隐藏', id: enumDisplayType.HIDDEN },
|
|
|
6214
|
- ]
|
|
|
6215
|
- const template = UseLayUi.generateOptionTemplate({ dataSource: options })
|
|
|
6216
|
- return `
|
|
|
6217
|
- <div class="layui-form-item" style="margin-bottom: 0px">
|
|
|
6218
|
- <div class="layui-input-block" style="margin-left: 0px;">
|
|
|
6219
|
- <select name="${ enumConst.TYPE }" lay-verify="required">${ template }</select>
|
|
|
6220
|
- </div>
|
|
|
6221
|
- </div>
|
|
|
6222
|
- `
|
7191
|
+ const enumConst = {
|
|
|
7192
|
+ /**
|
|
|
7193
|
+ * @description 图片来源
|
|
|
7194
|
+ */
|
|
|
7195
|
+ IMAGE_ORIGIN: 'imageOrigin',
|
|
|
7196
|
+
|
|
|
7197
|
+ /**
|
|
|
7198
|
+ * @description 图库图形类别
|
|
|
7199
|
+ */
|
|
|
7200
|
+ IMAGE_GALLERY_CATEGORY: 'category',
|
|
|
7201
|
+
|
|
|
7202
|
+ /**
|
|
|
7203
|
+ * @description 图表图形路径
|
|
|
7204
|
+ */
|
|
|
7205
|
+ IMAGE_GALLERY_IMAGE_PATH: 'imagePath',
|
6223
|
}
|
7206
|
}
|
6224
|
|
7207
|
|
6225
|
/**
|
7208
|
/**
|
6226
|
- * @description 添加一条记录
|
7209
|
+ * @description 图片来源枚举类型
|
6227
|
*/
|
7210
|
*/
|
6228
|
- function addRecord() {
|
|
|
6229
|
- const content = `
|
|
|
6230
|
- <tr class="layui-form" lay-filter="${ getRowFilter(addRowNumber) }">
|
|
|
6231
|
- ${ IS_DISPLAY && `<td>${ generatorDisplayOptions() }</td>` }
|
|
|
6232
|
- <td>
|
|
|
6233
|
- <input lay-verType="tips" lay-verify="required" type="number" name="${ enumConst.MIN }" class="layui-input ${ enumActionEl.MIN_FILTER }">
|
|
|
6234
|
- </td>
|
|
|
6235
|
- <td>
|
|
|
6236
|
- <input lay-verType="tips" lay-verify="required" type="number" name="${ enumConst.MAX }" class="layui-input ${ enumActionEl.MAX_FILTER }">
|
|
|
6237
|
- </td>
|
|
|
6238
|
- <td style="text-align: center;">
|
|
|
6239
|
- <button type="button" class="layui-btn layui-btn-primary layui-border-red ${ enumActionEl.DEL_BTN_EL }">删除</button>
|
|
|
6240
|
- </td>
|
|
|
6241
|
- </tr>
|
|
|
6242
|
- `
|
|
|
6243
|
- addRowNumber++
|
|
|
6244
|
- $(`#${ enumActionEl.TABLE_BODY_EL }`).append(content)
|
|
|
6245
|
- if (IS_DISPLAY) {
|
|
|
6246
|
- // form.render(null, getRowFilter(addRowNumber))
|
|
|
6247
|
- form.render()
|
|
|
6248
|
- }
|
7211
|
+ const enumImageOriginType = {
|
|
|
7212
|
+ LOCAL: 'local',
|
|
|
7213
|
+ GALLERY: 'gallery',
|
6249
|
}
|
7214
|
}
|
6250
|
|
7215
|
|
|
|
7216
|
+ let imageState = {}
|
|
|
7217
|
+
|
6251
|
/**
|
7218
|
/**
|
6252
|
- * @description 创建添加记录事件
|
7219
|
+ * @description 设置选中样式
|
|
|
7220
|
+ * @param event
|
|
|
7221
|
+ * @param nodeClass
|
|
|
7222
|
+ * @param styleClass
|
6253
|
*/
|
7223
|
*/
|
6254
|
- function createAddRowListenEvent() {
|
|
|
6255
|
- $(`#${ enumActionEl.ADD_BTN_EL }`).click(() => {
|
|
|
6256
|
- addRecord()
|
|
|
6257
|
- createDeleteRowListenEvent()
|
7224
|
+ function setImageSelectedStyle(event, nodeClass, styleClass) {
|
|
|
7225
|
+ if (!$(event.target).hasClass(nodeClass)) return
|
|
|
7226
|
+ $(`.${nodeClass}`).each(function () {
|
|
|
7227
|
+ $(this).removeClass(styleClass)
|
6258
|
})
|
7228
|
})
|
|
|
7229
|
+ $(event.target).addClass(styleClass)
|
6259
|
}
|
7230
|
}
|
6260
|
|
7231
|
|
6261
|
/**
|
7232
|
/**
|
6262
|
- * @description 创建删除行事件
|
7233
|
+ * @description 切换图库图形
|
|
|
7234
|
+ * @param event
|
6263
|
*/
|
7235
|
*/
|
6264
|
- function createDeleteRowListenEvent() {
|
|
|
6265
|
- $(`.${ enumActionEl.DEL_BTN_EL }`).click((event) => {
|
|
|
6266
|
- $(event.target).parents('tr').remove()
|
|
|
6267
|
- })
|
7236
|
+ function switchGalleryLib(event) {
|
|
|
7237
|
+ const key = $(event.target).attr(enumConst.IMAGE_GALLERY_CATEGORY)
|
|
|
7238
|
+ const category = sidebarInstance.getVariableImageLib(key)
|
|
|
7239
|
+ if (key && category) {
|
|
|
7240
|
+ $(`#${enumActionEl.VAR_IMG_CONTAINER_CONTENT}`).html(
|
|
|
7241
|
+ category.lib.reduce((prev, next) => prev + `<div class="${enumActionEl.VAR_IMG_ITEM}" title="${next.name}"><img src="${next.staticPath}" alt=""></div>`, ''),
|
|
|
7242
|
+ )
|
|
|
7243
|
+ }
|
6268
|
}
|
7244
|
}
|
6269
|
|
7245
|
|
6270
|
/**
|
7246
|
/**
|
6271
|
- * @description 创建下拉联动事件
|
7247
|
+ * @description 图片来源事件监听
|
6272
|
*/
|
7248
|
*/
|
6273
|
- function createSelectLinkageListenEvent() {
|
|
|
6274
|
- form.on(`select(${ enumActionEl.DEVICE_EL })`, (data) => {
|
|
|
6275
|
- const { value } = data
|
|
|
6276
|
- const selected = deviceList.find(item => item.id === value)
|
|
|
6277
|
- if (selected.deviceType === enumConst.GATEWAY) {
|
|
|
6278
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'block' })
|
|
|
6279
|
- getSlaveDeviceByMasterDevice(currentOrgId, selected.id)
|
|
|
6280
|
- } else {
|
|
|
6281
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'none' })
|
|
|
6282
|
- getAttrsByDevice(selected.id)
|
|
|
6283
|
- }
|
7249
|
+ function generatorSelectImgEventListener() {
|
|
|
7250
|
+ $(`#${enumActionEl.VAR_IMG_CONTAINER_CONTENT}`).on('click', event => {
|
|
|
7251
|
+ setImageSelectedStyle(event, enumActionEl.VAR_IMG_ITEM, enumActionEl.VAR_IMG_ITEM_CHECKED)
|
|
|
7252
|
+ imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH] = $(event.target).find('img').attr('src')
|
6284
|
})
|
7253
|
})
|
6285
|
-
|
|
|
6286
|
- form.on(`select(${ enumActionEl.SLAVE_DEVICE_EL })`, (data) => {
|
|
|
6287
|
- getAttrsByDevice(data.value)
|
7254
|
+ $(`#${enumActionEl.VAR_IMG_CONTAINER_SIDEBAR}`).on('click', event => {
|
|
|
7255
|
+ setImageSelectedStyle(event, enumActionEl.VAR_IMG_CATEGORY, enumActionEl.VAR_IMG_CATEGORY_CHECKED)
|
|
|
7256
|
+ imageState[enumConst.IMAGE_GALLERY_CATEGORY] = $(event.target).attr(enumConst.IMAGE_GALLERY_CATEGORY)
|
|
|
7257
|
+ imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH] = null
|
|
|
7258
|
+ switchGalleryLib(event)
|
6288
|
})
|
7259
|
})
|
6289
|
}
|
7260
|
}
|
6290
|
|
7261
|
|
6291
|
- /**
|
|
|
6292
|
- * @description 创建输入监听
|
|
|
6293
|
- */
|
|
|
6294
|
- function createInputListener() {
|
|
|
6295
|
- $(`#${ enumActionEl.TABLE_BODY_EL }`)
|
|
|
6296
|
- .on('input', `.${ enumActionEl.MIN_FILTER }`, event => {
|
|
|
6297
|
- const minVal = $(event.target).val()
|
|
|
6298
|
- const maxVal = $(event.target).parents('tr').find(`input.${ enumActionEl.MAX_FILTER }`).val()
|
|
|
6299
|
- if (maxVal !== '' && Number(minVal) > Number(maxVal)) {
|
|
|
6300
|
- layer.tips('输入值大于最大值', $(event.target), {
|
|
|
6301
|
- tips: 1,
|
|
|
6302
|
- });
|
|
|
6303
|
- }
|
|
|
6304
|
- })
|
|
|
6305
|
- .on('input', `.${ enumActionEl.MAX_FILTER }`, event => {
|
|
|
6306
|
- const maxVal = $(event.target).val()
|
|
|
6307
|
- const minVal = $(event.target).parents('tr').find(`input.${ enumActionEl.MIN_FILTER }`).val()
|
|
|
6308
|
- if (minVal !== '' && Number(maxVal) < Number(minVal)) {
|
|
|
6309
|
- layer.tips('输入值小于最小值', $(event.target), {
|
|
|
6310
|
- tips: 1,
|
|
|
6311
|
- });
|
|
|
6312
|
- }
|
|
|
6313
|
- })
|
|
|
6314
|
- }
|
|
|
6315
|
|
7262
|
|
6316
|
/**
|
7263
|
/**
|
6317
|
- * @description 创建事件监听
|
7264
|
+ * @description 创建本地图片上传区域
|
6318
|
*/
|
7265
|
*/
|
6319
|
- function createEventListen() {
|
|
|
6320
|
- createInputListener()
|
|
|
6321
|
- createSelectLinkageListenEvent()
|
|
|
6322
|
- createAddRowListenEvent()
|
|
|
6323
|
- createDeleteRowListenEvent()
|
7266
|
+ function createLocalFileContainer() {
|
|
|
7267
|
+ return `
|
|
|
7268
|
+ <div id="${enumActionEl.UPLOAD_LOCAL_FILE_EL}" class="layui-upload">
|
|
|
7269
|
+ <div class="preview__img">
|
|
|
7270
|
+ <img src="" class="layui-upload-img" id="${enumActionEl.IMAGE_PREVIEW_EL}">
|
|
|
7271
|
+ <div class="var_image__add-icon">+</div>
|
|
|
7272
|
+ <div class="var-image__del-icon">x</div>
|
|
|
7273
|
+ </div>
|
|
|
7274
|
+ <div class="layui-upload-list"></div>
|
|
|
7275
|
+ </div>
|
|
|
7276
|
+ <div id="${enumActionEl.IMAGE_UPLOAD_STATE_EL}"></div>
|
|
|
7277
|
+ <div style="margin-top: 30px;">图片格式支持png、jpg(jpeg)、gif, 大小不能超过5M</div>
|
|
|
7278
|
+ `
|
6324
|
}
|
7279
|
}
|
6325
|
|
7280
|
|
6326
|
/**
|
7281
|
/**
|
6327
|
- * @description 回显数据
|
|
|
6328
|
- */
|
|
|
6329
|
- function echoData(info) {
|
|
|
6330
|
- const { slaveDeviceId, deviceId, attr, orgId, condition = [] } = info
|
|
|
6331
|
- echoEachData(condition)
|
|
|
6332
|
- echoOrgTree(orgId)
|
|
|
6333
|
- const queue = []
|
|
|
6334
|
- if (orgId) {
|
|
|
6335
|
- queue.push(getDeviceByOrg(orgId))
|
|
|
6336
|
- }
|
|
|
6337
|
- if (slaveDeviceId) {
|
|
|
6338
|
- $(`#${ enumActionEl.SLAVE_DEVICE_EL }`).css({ display: 'block' })
|
|
|
6339
|
- queue.push(getSlaveDeviceByMasterDevice(orgId, deviceId))
|
|
|
6340
|
- queue.push(getAttrsByDevice(slaveDeviceId))
|
|
|
6341
|
- } else {
|
|
|
6342
|
- queue.push(getAttrsByDevice(deviceId))
|
|
|
6343
|
- }
|
|
|
6344
|
- Promise.all(queue).finally(() => {
|
|
|
6345
|
- form.val(enumActionEl.FORM_FILTER, { slaveDeviceId, deviceId, attr, orgId })
|
|
|
6346
|
- })
|
7282
|
+ * @description 创建图库图形上传区域
|
|
|
7283
|
+ */
|
|
|
7284
|
+ function createGalleryFileContainer() {
|
|
|
7285
|
+ const category = sidebarInstance.getAllVariableImageLib()
|
|
|
7286
|
+ const defaultShow = category[0] || { lib: [] }
|
|
|
7287
|
+ return `
|
|
|
7288
|
+ <div class="var-image__container--gallery">
|
|
|
7289
|
+ <div id="${enumActionEl.VAR_IMG_CONTAINER_SIDEBAR}">
|
|
|
7290
|
+ ${category.reduce((prev, next) => prev + `<div class="${enumActionEl.VAR_IMG_CATEGORY}" ${enumConst.IMAGE_GALLERY_CATEGORY}="${next.key}">${next.label}</div>`, '')}
|
|
|
7291
|
+ </div>
|
|
|
7292
|
+ <div id="${enumActionEl.VAR_IMG_CONTAINER_CONTENT}">
|
|
|
7293
|
+ ${defaultShow.lib.reduce((prev, next) => prev + `<div class="${enumActionEl.VAR_IMG_ITEM}" title="${next.name}"><img src="${next.staticPath}" alt=""></div>`, '')}
|
|
|
7294
|
+ </div>
|
|
|
7295
|
+ </div>
|
|
|
7296
|
+ `
|
6347
|
}
|
7297
|
}
|
6348
|
|
7298
|
|
6349
|
/**
|
7299
|
/**
|
6350
|
- * @description 回显行数据
|
7300
|
+ * @description 上传
|
6351
|
*/
|
7301
|
*/
|
6352
|
- function echoEachData(condition = []) {
|
|
|
6353
|
- condition.forEach((item, index) => {
|
|
|
6354
|
- addRecord()
|
|
|
6355
|
- form.val(getRowFilter(index), { ...item })
|
7302
|
+ function uploadFileEvent() {
|
|
|
7303
|
+ $(`.${enumActionEl.IMAGE_DEL_PREVIEW_EL}`).on('click', (event) => {
|
|
|
7304
|
+ event.stopPropagation()
|
|
|
7305
|
+ $(`#${enumActionEl.IMAGE_PREVIEW_EL}`).attr('src', '')
|
|
|
7306
|
+ imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH] = null
|
6356
|
})
|
7307
|
})
|
|
|
7308
|
+ upload.render({
|
|
|
7309
|
+ elem: `#${enumActionEl.UPLOAD_LOCAL_FILE_EL}`,
|
|
|
7310
|
+ auto: false,
|
|
|
7311
|
+ size: 1024 * 5,
|
|
|
7312
|
+ url: '/yt/oss/upload',
|
|
|
7313
|
+ method: 'post',
|
|
|
7314
|
+ choose(obj) {
|
|
|
7315
|
+ obj.preview(async function (index, file, result) {
|
|
|
7316
|
+ const formData = new FormData()
|
|
|
7317
|
+ formData.set('file', file)
|
|
|
7318
|
+ const [err, res] = await to(ConfigurationNodeApi.uploadImg(formData))
|
|
|
7319
|
+ if (!err) {
|
|
|
7320
|
+ $(`#${enumActionEl.IMAGE_PREVIEW_EL}`).attr('src', result)
|
|
|
7321
|
+ const { fileStaticUri = '' } = res
|
|
|
7322
|
+ imageState[enumConst.IMAGE_GALLERY_IMAGE_PATH] = fileStaticUri
|
|
|
7323
|
+ }
|
|
|
7324
|
+ });
|
|
|
7325
|
+ },
|
|
|
7326
|
+ });
|
6357
|
}
|
7327
|
}
|
6358
|
|
7328
|
|
6359
|
/**
|
7329
|
/**
|
6360
|
- * @description 回显组织树
|
7330
|
+ * @description 切换
|
6361
|
*/
|
7331
|
*/
|
6362
|
- function echoOrgTree(id) {
|
|
|
6363
|
- const node = UseLayUi.findTreeObjectByField(treeList, id)
|
|
|
6364
|
- $(`#${ enumActionEl.ORG_EL }`).find(`input[name="${ enumConst.ORG_ID }"]`).parent().find('span').html(node?.name)
|
|
|
6365
|
- }
|
|
|
6366
|
-
|
|
|
6367
|
- function validate(tableData) {
|
|
|
6368
|
- let validateFlag = true
|
|
|
6369
|
- for (let i = 0; i < tableData.length; i++) {
|
|
|
6370
|
- const { min, max } = tableData[i]
|
|
|
6371
|
- if (Number(min) > Number(max)) {
|
|
|
6372
|
- validateFlag = false
|
|
|
6373
|
- layer.tips('输入值大于最大值', $(`#${ enumActionEl.TABLE_BODY_EL } tr`).eq(i).find(`input[name="${ enumConst.MIN }"]`), { tips: 1 })
|
|
|
6374
|
- break
|
|
|
6375
|
- } else if (Number(max) < Number(min)) {
|
|
|
6376
|
- validateFlag = false
|
|
|
6377
|
- layer.tips('输入值小于最小值', $(`#${ enumActionEl.TABLE_BODY_EL } tr`).eq(i).find(`input[name="${ enumConst.MAX }"]`), { tips: 1 })
|
|
|
6378
|
- break
|
7332
|
+ function switchUploadImgTypeEventListener() {
|
|
|
7333
|
+ form.on(`radio(${enumActionEl.SWITCH_IMG_ORIGIN_FILTER})`, event => {
|
|
|
7334
|
+ const { value } = event
|
|
|
7335
|
+ console.log('event', event)
|
|
|
7336
|
+ imageState = {}
|
|
|
7337
|
+ if (value === enumImageOriginType.LOCAL) {
|
|
|
7338
|
+ $(`#${enumActionEl.IMG_SELECT_CONTAINER_EL}`).html(createLocalFileContainer())
|
|
|
7339
|
+ imageState[enumConst.IMAGE_ORIGIN] = enumImageOriginType.LOCAL
|
|
|
7340
|
+ uploadFileEvent()
|
|
|
7341
|
+ } else if (value === enumImageOriginType.GALLERY) {
|
|
|
7342
|
+ $(`#${enumActionEl.IMG_SELECT_CONTAINER_EL}`).html(createGalleryFileContainer())
|
|
|
7343
|
+ const defaultChecked = $(`.${enumActionEl.VAR_IMG_CATEGORY}`).eq(0)
|
|
|
7344
|
+ defaultChecked.addClass(enumActionEl.VAR_IMG_CATEGORY_CHECKED)
|
|
|
7345
|
+ imageState[enumConst.IMAGE_GALLERY_CATEGORY] = defaultChecked.attr(enumConst.IMAGE_GALLERY_CATEGORY)
|
|
|
7346
|
+ imageState[enumConst.IMAGE_ORIGIN] = enumImageOriginType.GALLERY
|
|
|
7347
|
+ generatorSelectImgEventListener()
|
6379
|
}
|
7348
|
}
|
6380
|
- }
|
|
|
6381
|
- return validateFlag
|
7349
|
+ })
|
6382
|
}
|
7350
|
}
|
6383
|
|
7351
|
|
6384
|
- async function submit(callback) {
|
|
|
6385
|
- const tableData = Array.from({ length: addRowNumber }).map((_, index) => form.val(getRowFilter(index))).filter(obj => Object.keys(obj).length)
|
|
|
6386
|
- if (!validate(tableData)) return
|
|
|
6387
|
- const formVal = form.val(enumActionEl.FORM_FILTER)
|
|
|
6388
|
- const formModel = {
|
|
|
6389
|
- configurationId,
|
|
|
6390
|
- contentId: currentPageId.id,
|
|
|
6391
|
- ...formVal,
|
|
|
6392
|
- id: graphId,
|
|
|
6393
|
- condition: tableData,
|
|
|
6394
|
- type: event.data.type,
|
|
|
6395
|
- }
|
|
|
6396
|
- const [ err, res ] = await to(ConfigurationNodeApi.updateNodeAct(formModel))
|
|
|
6397
|
- if (err) return
|
|
|
6398
|
- UseLayUi.successMsg()
|
|
|
6399
|
- callback()
|
|
|
6400
|
- }
|
|
|
6401
|
|
7352
|
|
6402
|
- function isExistInArea(min, max, value) {
|
|
|
6403
|
- return Number(value) >= Number(min) && Number(value) <= Number(max)
|
7353
|
+ /**
|
|
|
7354
|
+ * @description 初始化并设置默认值
|
|
|
7355
|
+ */
|
|
|
7356
|
+ function initSelectImg() {
|
|
|
7357
|
+ switchUploadImgTypeEventListener()
|
|
|
7358
|
+ uploadFileEvent()
|
|
|
7359
|
+ imageState[enumConst.IMAGE_ORIGIN] = enumImageOriginType.LOCAL
|
|
|
7360
|
+ form.render()
|
6404
|
}
|
7361
|
}
|
6405
|
|
7362
|
|
6406
|
-
|
|
|
6407
|
- function createLayerForm(type) {
|
7363
|
+ /**
|
|
|
7364
|
+ * @description 创建上传图片layer
|
|
|
7365
|
+ */
|
|
|
7366
|
+ function createUploadImgLayer() {
|
6408
|
const content = `
|
7367
|
const content = `
|
6409
|
- <form class="layui-form" lay-filter="${ enumActionEl.FORM_FILTER }">
|
|
|
6410
|
- <div style="width:400px">
|
|
|
6411
|
- <div class="layui-form-item">
|
|
|
6412
|
- <label class="layui-form-label">类型</label>
|
|
|
6413
|
- <div class="layui-input-block">
|
|
|
6414
|
- <input type="radio" name="type" value="1" title="联网设备" checked>
|
|
|
6415
|
- <input type="radio" name="type" value="2" title="产品/场景" disabled>
|
|
|
6416
|
- </div>
|
|
|
6417
|
- </div>
|
|
|
6418
|
-
|
|
|
6419
|
- <div id="${ enumActionEl.ORG_EL }">组织</div>
|
|
|
6420
|
-
|
|
|
6421
|
- <div class="layui-form-item" id="${ enumActionEl.DEVICE_EL }">
|
|
|
6422
|
- <label class="layui-form-label">设备</label>
|
|
|
6423
|
- <div class="layui-input-block">
|
|
|
6424
|
- <select name="${ enumConst.DEVICE_ID }" lay-verType="tips" lay-verify="required" lay-filter="${ enumActionEl.DEVICE_EL }">
|
|
|
6425
|
- </select>
|
|
|
6426
|
- </div>
|
|
|
6427
|
- </div>
|
|
|
6428
|
-
|
|
|
6429
|
- <div class="layui-form-item" id="${ enumActionEl.SLAVE_DEVICE_EL }" style="display: none">
|
|
|
6430
|
- <label class="layui-form-label">子设备</label>
|
|
|
6431
|
- <div class="layui-input-block">
|
|
|
6432
|
- <select name="${ enumConst.SLAVE_DEVICE_ID }" lay-verType="tips" lay-filter="${ enumActionEl.SLAVE_DEVICE_EL }">
|
|
|
6433
|
- </select>
|
|
|
6434
|
- </div>
|
|
|
6435
|
- </div>
|
|
|
6436
|
-
|
|
|
6437
|
- <div class="layui-form-item" id="${ enumActionEl.ATTR_EL }">
|
|
|
6438
|
- <label class="layui-form-label">属性</label>
|
|
|
6439
|
- <div class="layui-input-block">
|
|
|
6440
|
- <select name="${ enumConst.ATTR }" lay-verType="tips" lay-verify="required" lay-filter="${ enumActionEl.ATTR_EL }"></select>
|
|
|
6441
|
- </div>
|
|
|
6442
|
- </div>
|
|
|
6443
|
- </div>
|
|
|
6444
|
- </form>
|
|
|
6445
|
- <div class="override__table">
|
|
|
6446
|
- <table class="layui-table" >
|
|
|
6447
|
- <thead>
|
|
|
6448
|
- <tr>
|
|
|
6449
|
- ${ IS_DISPLAY ? '<th style="text-align:center">类型</th>' : '' }
|
|
|
6450
|
- <th style="text-align:center">最小值(<=)</th>
|
|
|
6451
|
- <th style="text-align:center">最大值(>=)</th>
|
|
|
6452
|
- <th style="text-align:center">操作</th>
|
|
|
6453
|
- </tr>
|
|
|
6454
|
- </thead>
|
|
|
6455
|
- <tbody id="${ enumActionEl.TABLE_BODY_EL }"></tbody>
|
|
|
6456
|
- </table>
|
|
|
6457
|
- <div style="display:flex;justify-content:center;">
|
|
|
6458
|
- <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="${ enumActionEl.ADD_BTN_EL }">添加一条</button>
|
|
|
6459
|
- </div>
|
|
|
6460
|
- </div>
|
|
|
6461
|
- `
|
7368
|
+ <div class="layui-form">
|
|
|
7369
|
+ <div class="layui-form-item">
|
|
|
7370
|
+ <div class="var-image__radio">
|
|
|
7371
|
+ <input type="radio" lay-filter="${enumActionEl.SWITCH_IMG_ORIGIN_FILTER}" name="${enumConst.IMAGE}" value="${enumImageOriginType.LOCAL}" title="本地图片" checked="">
|
|
|
7372
|
+ <input type="radio" lay-filter="${enumActionEl.SWITCH_IMG_ORIGIN_FILTER}" name="${enumConst.IMAGE}" value="${enumImageOriginType.GALLERY}" title="图库图形">
|
|
|
7373
|
+ </div>
|
|
|
7374
|
+ </div>
|
|
|
7375
|
+ </div>
|
|
|
7376
|
+ <div id="${enumActionEl.IMG_SELECT_CONTAINER_EL}">
|
|
|
7377
|
+ ${createLocalFileContainer()}
|
|
|
7378
|
+ </div>
|
|
|
7379
|
+ `
|
6462
|
|
7380
|
|
6463
|
layer.open({
|
7381
|
layer.open({
|
6464
|
- title: enumEventType[type],
|
7382
|
+ title: '图片',
|
|
|
7383
|
+ type: 1,
|
6465
|
content,
|
7384
|
content,
|
6466
|
skin: 'event-layer__override',
|
7385
|
skin: 'event-layer__override',
|
6467
|
- btn: [ '保存', '取消' ],
|
|
|
6468
|
- area: IS_DISPLAY ? '1000px' : '800PX',
|
|
|
6469
|
- success(layero) {
|
7386
|
+ area: '600px',
|
|
|
7387
|
+ btn: ["应用", "取消"],
|
|
|
7388
|
+ shade: ["0.7", "#fafafa"],
|
|
|
7389
|
+ yes(index) {
|
|
|
7390
|
+ layer.close(index)
|
|
|
7391
|
+ if (callback && typeof callback === 'function') callback(imageState)
|
|
|
7392
|
+ },
|
|
|
7393
|
+ but2(index, layero) {
|
|
|
7394
|
+ imageState = {}
|
|
|
7395
|
+ layer.close(index)
|
|
|
7396
|
+ },
|
|
|
7397
|
+ zIndex: layer.zIndex,
|
|
|
7398
|
+ async success(layero, index) {
|
|
|
7399
|
+ layer.setTop(layero);
|
6470
|
$(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
7400
|
$(layero).addClass('layui-form').find('.layui-layer-btn0').attr({
|
6471
|
'lay-submit': '',
|
7401
|
'lay-submit': '',
|
6472
|
- 'lay-filter': enumActionEl.LAYER_SUBMIT_FILTER,
|
|
|
6473
|
- })
|
|
|
6474
|
- generatorOrgTreeSelect()
|
|
|
6475
|
- const info = getLayerBindInfo('act', type)
|
|
|
6476
|
- if (info) {
|
|
|
6477
|
- echoData(info)
|
|
|
6478
|
- } else {
|
|
|
6479
|
- addRecord()
|
|
|
6480
|
- }
|
|
|
6481
|
- createEventListen()
|
|
|
6482
|
- form.render()
|
|
|
6483
|
- },
|
|
|
6484
|
- yes(index) {
|
|
|
6485
|
- form.on(`submit(${ enumActionEl.LAYER_SUBMIT_FILTER })`, data => {
|
|
|
6486
|
- submit(() => {
|
|
|
6487
|
- layer.close(index)
|
|
|
6488
|
- getNodeBindInfo()
|
|
|
6489
|
- })
|
7402
|
+ 'lay-filter': enumActionEl.IMAGE_LAYER_FILTER,
|
6490
|
})
|
7403
|
})
|
6491
|
- },
|
|
|
6492
|
- btn2() {
|
|
|
6493
|
-
|
7404
|
+ initSelectImg()
|
6494
|
},
|
7405
|
},
|
6495
|
})
|
7406
|
})
|
6496
|
}
|
7407
|
}
|
6497
|
|
7408
|
|
6498
|
- createLayerForm(event.data.type)
|
7409
|
+ createUploadImgLayer()
|
6499
|
|
7410
|
|
|
|
7411
|
+ return { record: imageState }
|
6500
|
}
|
7412
|
}
|
6501
|
|
7413
|
|
6502
|
// 异步设置此处才能生效 -- 设置默认select和样式和初始化侧边栏生成组件和事件绑定
|
7414
|
// 异步设置此处才能生效 -- 设置默认select和样式和初始化侧边栏生成组件和事件绑定
|
6503
|
setTimeout(() => {
|
7415
|
setTimeout(() => {
|
6504
|
|
7416
|
|
6505
|
// TODO 数据交互事件
|
7417
|
// TODO 数据交互事件
|
6506
|
- $(`#${ enumInteractionType.DOWN }`).click({ type: enumInteractionType.DOWN }, handleDownOrUpEvent);
|
|
|
6507
|
- $(`#${ enumInteractionType.UP }`).click({ type: enumInteractionType.UP }, handleDownOrUpEvent);
|
|
|
6508
|
- $(`#${ enumInteractionType.SINGLE }`).click({ type: enumInteractionType.SINGLE }, handleClickOrDbClick);
|
|
|
6509
|
- $(`#${ enumInteractionType.DOUBLE }`).click({ type: enumInteractionType.DOUBLE }, handleClickOrDbClick);
|
7418
|
+ $(`#${enumDynamicEffectType.IMAGE}`).click({ type: enumDynamicEffectType.IMAGE }, handleSettingVarImage);
|
|
|
7419
|
+
|
|
|
7420
|
+ $(`#${enumInteractionType.DOWN}`).click({ type: enumInteractionType.DOWN }, handleDownOrUpEvent);
|
|
|
7421
|
+ $(`#${enumInteractionType.UP}`).click({ type: enumInteractionType.UP }, handleDownOrUpEvent);
|
|
|
7422
|
+ $(`#${enumInteractionType.SINGLE}`).click({ type: enumInteractionType.SINGLE }, handleClickOrDbClick);
|
|
|
7423
|
+ $(`#${enumInteractionType.DOUBLE}`).click({ type: enumInteractionType.DOUBLE }, handleClickOrDbClick);
|
6510
|
// 数据动效事件
|
7424
|
// 数据动效事件
|
6511
|
- $(`#${ enumDynamicEffectType.FLASH }`).click({ type: enumDynamicEffectType.FLASH }, handleDataDynamicEffect);
|
|
|
6512
|
- $(`#${ enumDynamicEffectType.DISPLAY }`).click({ type: enumDynamicEffectType.DISPLAY }, handleDataDynamicEffect);
|
|
|
6513
|
- $(`#${ enumDynamicEffectType.ROTATE }`).click({ type: enumDynamicEffectType.ROTATE }, handleDataDynamicEffect);
|
7425
|
+ $(`#${enumDynamicEffectType.FLASH}`).click({ type: enumDynamicEffectType.FLASH }, handleDataDynamicEffect);
|
|
|
7426
|
+ $(`#${enumDynamicEffectType.DISPLAY}`).click({ type: enumDynamicEffectType.DISPLAY }, handleDataDynamicEffect);
|
|
|
7427
|
+ $(`#${enumDynamicEffectType.ROTATE}`).click({ type: enumDynamicEffectType.ROTATE }, handleDataDynamicEffect);
|
6514
|
});
|
7428
|
});
|
6515
|
};
|
7429
|
};
|
6516
|
|
7430
|
|
|
@@ -6848,9 +7762,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
|
@@ -6848,9 +7762,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
6848
|
var tmpColor = mxUtils.getValue(ss.style, fillKey, null);
|
7762
|
var tmpColor = mxUtils.getValue(ss.style, fillKey, null);
|
6849
|
gradientPanel.style.display =
|
7763
|
gradientPanel.style.display =
|
6850
|
tmpColor != null &&
|
7764
|
tmpColor != null &&
|
6851
|
- tmpColor != mxConstants.NONE &&
|
|
|
6852
|
- ss.fill &&
|
|
|
6853
|
- ss.style.shape != "image"
|
7765
|
+ tmpColor != mxConstants.NONE &&
|
|
|
7766
|
+ ss.fill &&
|
|
|
7767
|
+ ss.style.shape != "image"
|
6854
|
? ""
|
7768
|
? ""
|
6855
|
: "none";
|
7769
|
: "none";
|
6856
|
|
7770
|
|
|
@@ -6912,7 +7826,7 @@ StyleFormatPanel.prototype.addFill = function (container) { |
|
@@ -6912,7 +7826,7 @@ StyleFormatPanel.prototype.addFill = function (container) { |
6912
|
fillStyleSelect.style.display = ss.style.sketch == "1" ? "" : "none";
|
7826
|
fillStyleSelect.style.display = ss.style.sketch == "1" ? "" : "none";
|
6913
|
gradientPanel.style.display =
|
7827
|
gradientPanel.style.display =
|
6914
|
!ss.containsImage &&
|
7828
|
!ss.containsImage &&
|
6915
|
- (ss.style.sketch != "1" || fillStyle == "solid" || fillStyle == "auto")
|
7829
|
+ (ss.style.sketch != "1" || fillStyle == "solid" || fillStyle == "auto")
|
6916
|
? ""
|
7830
|
? ""
|
6917
|
: "none";
|
7831
|
: "none";
|
6918
|
}
|
7832
|
}
|
|
@@ -6936,9 +7850,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
|
@@ -6936,9 +7850,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
6936
|
new mxEventObject(
|
7850
|
new mxEventObject(
|
6937
|
"styleChanged",
|
7851
|
"styleChanged",
|
6938
|
"keys",
|
7852
|
"keys",
|
6939
|
- [ mxConstants.STYLE_GRADIENT_DIRECTION ],
|
7853
|
+ [mxConstants.STYLE_GRADIENT_DIRECTION],
|
6940
|
"values",
|
7854
|
"values",
|
6941
|
- [ gradientSelect.value ],
|
7855
|
+ [gradientSelect.value],
|
6942
|
"cells",
|
7856
|
"cells",
|
6943
|
ss.cells,
|
7857
|
ss.cells,
|
6944
|
),
|
7858
|
),
|
|
@@ -6952,9 +7866,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
|
@@ -6952,9 +7866,9 @@ StyleFormatPanel.prototype.addFill = function (container) { |
6952
|
new mxEventObject(
|
7866
|
new mxEventObject(
|
6953
|
"styleChanged",
|
7867
|
"styleChanged",
|
6954
|
"keys",
|
7868
|
"keys",
|
6955
|
- [ "fillStyle" ],
|
7869
|
+ ["fillStyle"],
|
6956
|
"values",
|
7870
|
"values",
|
6957
|
- [ fillStyleSelect.value ],
|
7871
|
+ [fillStyleSelect.value],
|
6958
|
"cells",
|
7872
|
"cells",
|
6959
|
ss.cells,
|
7873
|
ss.cells,
|
6960
|
),
|
7874
|
),
|
|
@@ -7030,7 +7944,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7030,7 +7944,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7030
|
styleSelect.style.border = "1px solid rgb(160, 160, 160)";
|
7944
|
styleSelect.style.border = "1px solid rgb(160, 160, 160)";
|
7031
|
styleSelect.style.borderRadius = "4px";
|
7945
|
styleSelect.style.borderRadius = "4px";
|
7032
|
|
7946
|
|
7033
|
- var styles = [ "sharp", "rounded", "curved" ];
|
7947
|
+ var styles = ["sharp", "rounded", "curved"];
|
7034
|
|
7948
|
|
7035
|
for (var i = 0; i < styles.length; i++) {
|
7949
|
for (var i = 0; i < styles.length; i++) {
|
7036
|
var styleOption = document.createElement("option");
|
7950
|
var styleOption = document.createElement("option");
|
|
@@ -7042,14 +7956,14 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7042,14 +7956,14 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7042
|
mxEvent.addListener(styleSelect, "change", function (evt) {
|
7956
|
mxEvent.addListener(styleSelect, "change", function (evt) {
|
7043
|
graph.getModel().beginUpdate();
|
7957
|
graph.getModel().beginUpdate();
|
7044
|
try {
|
7958
|
try {
|
7045
|
- var keys = [ mxConstants.STYLE_ROUNDED, mxConstants.STYLE_CURVED ];
|
7959
|
+ var keys = [mxConstants.STYLE_ROUNDED, mxConstants.STYLE_CURVED];
|
7046
|
// Default for rounded is 1
|
7960
|
// Default for rounded is 1
|
7047
|
- var values = [ "0", null ];
|
7961
|
+ var values = ["0", null];
|
7048
|
|
7962
|
|
7049
|
if (styleSelect.value == "rounded") {
|
7963
|
if (styleSelect.value == "rounded") {
|
7050
|
- values = [ "1", null ];
|
7964
|
+ values = ["1", null];
|
7051
|
} else if (styleSelect.value == "curved") {
|
7965
|
} else if (styleSelect.value == "curved") {
|
7052
|
- values = [ null, "1" ];
|
7966
|
+ values = [null, "1"];
|
7053
|
}
|
7967
|
}
|
7054
|
|
7968
|
|
7055
|
for (var i = 0; i < keys.length; i++) {
|
7969
|
for (var i = 0; i < keys.length; i++) {
|
|
@@ -7150,36 +8064,36 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7150,36 +8064,36 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7150
|
menu,
|
8064
|
menu,
|
7151
|
75,
|
8065
|
75,
|
7152
|
"solid",
|
8066
|
"solid",
|
7153
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7154
|
- [ null, null ],
|
8067
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8068
|
+ [null, null],
|
7155
|
).setAttribute("title", mxResources.get("solid"));
|
8069
|
).setAttribute("title", mxResources.get("solid"));
|
7156
|
addItem(
|
8070
|
addItem(
|
7157
|
menu,
|
8071
|
menu,
|
7158
|
75,
|
8072
|
75,
|
7159
|
"dashed",
|
8073
|
"dashed",
|
7160
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7161
|
- [ "1", null ],
|
8074
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8075
|
+ ["1", null],
|
7162
|
).setAttribute("title", mxResources.get("dashed"));
|
8076
|
).setAttribute("title", mxResources.get("dashed"));
|
7163
|
addItem(
|
8077
|
addItem(
|
7164
|
menu,
|
8078
|
menu,
|
7165
|
75,
|
8079
|
75,
|
7166
|
"dotted",
|
8080
|
"dotted",
|
7167
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7168
|
- [ "1", "1 1" ],
|
8081
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8082
|
+ ["1", "1 1"],
|
7169
|
).setAttribute("title", mxResources.get("dotted") + " (1)");
|
8083
|
).setAttribute("title", mxResources.get("dotted") + " (1)");
|
7170
|
addItem(
|
8084
|
addItem(
|
7171
|
menu,
|
8085
|
menu,
|
7172
|
75,
|
8086
|
75,
|
7173
|
"dotted",
|
8087
|
"dotted",
|
7174
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7175
|
- [ "1", "1 2" ],
|
8088
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8089
|
+ ["1", "1 2"],
|
7176
|
).setAttribute("title", mxResources.get("dotted") + " (2)");
|
8090
|
).setAttribute("title", mxResources.get("dotted") + " (2)");
|
7177
|
addItem(
|
8091
|
addItem(
|
7178
|
menu,
|
8092
|
menu,
|
7179
|
75,
|
8093
|
75,
|
7180
|
"dotted",
|
8094
|
"dotted",
|
7181
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7182
|
- [ "1", "1 4" ],
|
8095
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8096
|
+ ["1", "1 4"],
|
7183
|
).setAttribute("title", mxResources.get("dotted") + " (3)");
|
8097
|
).setAttribute("title", mxResources.get("dotted") + " (3)");
|
7184
|
}),
|
8098
|
}),
|
7185
|
);
|
8099
|
);
|
|
@@ -7203,7 +8117,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7203,7 +8117,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7203
|
mxConstants.STYLE_ENDSIZE,
|
8117
|
mxConstants.STYLE_ENDSIZE,
|
7204
|
"width",
|
8118
|
"width",
|
7205
|
],
|
8119
|
],
|
7206
|
- [ null, null, null, null ],
|
8120
|
+ [null, null, null, null],
|
7207
|
"geIcon geSprite geSprite-connection",
|
8121
|
"geIcon geSprite geSprite-connection",
|
7208
|
null,
|
8122
|
null,
|
7209
|
true,
|
8123
|
true,
|
|
@@ -7219,7 +8133,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7219,7 +8133,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7219
|
mxConstants.STYLE_ENDSIZE,
|
8133
|
mxConstants.STYLE_ENDSIZE,
|
7220
|
"width",
|
8134
|
"width",
|
7221
|
],
|
8135
|
],
|
7222
|
- [ "link", null, null, null ],
|
8136
|
+ ["link", null, null, null],
|
7223
|
"geIcon geSprite geSprite-linkedge",
|
8137
|
"geIcon geSprite geSprite-linkedge",
|
7224
|
null,
|
8138
|
null,
|
7225
|
true,
|
8139
|
true,
|
|
@@ -7235,7 +8149,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7235,7 +8149,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7235
|
mxConstants.STYLE_ENDSIZE,
|
8149
|
mxConstants.STYLE_ENDSIZE,
|
7236
|
"width",
|
8150
|
"width",
|
7237
|
],
|
8151
|
],
|
7238
|
- [ "flexArrow", null, null, null ],
|
8152
|
+ ["flexArrow", null, null, null],
|
7239
|
"geIcon geSprite geSprite-arrow",
|
8153
|
"geIcon geSprite geSprite-arrow",
|
7240
|
null,
|
8154
|
null,
|
7241
|
true,
|
8155
|
true,
|
|
@@ -7251,7 +8165,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7251,7 +8165,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7251
|
mxConstants.STYLE_ENDSIZE,
|
8165
|
mxConstants.STYLE_ENDSIZE,
|
7252
|
"width",
|
8166
|
"width",
|
7253
|
],
|
8167
|
],
|
7254
|
- [ "arrow", null, null, null ],
|
8168
|
+ ["arrow", null, null, null],
|
7255
|
"geIcon geSprite geSprite-simplearrow",
|
8169
|
"geIcon geSprite geSprite-simplearrow",
|
7256
|
null,
|
8170
|
null,
|
7257
|
true,
|
8171
|
true,
|
|
@@ -7270,36 +8184,36 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7270,36 +8184,36 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7270
|
menu,
|
8184
|
menu,
|
7271
|
33,
|
8185
|
33,
|
7272
|
"solid",
|
8186
|
"solid",
|
7273
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7274
|
- [ null, null ],
|
8187
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8188
|
+ [null, null],
|
7275
|
).setAttribute("title", mxResources.get("solid"));
|
8189
|
).setAttribute("title", mxResources.get("solid"));
|
7276
|
addItem(
|
8190
|
addItem(
|
7277
|
menu,
|
8191
|
menu,
|
7278
|
33,
|
8192
|
33,
|
7279
|
"dashed",
|
8193
|
"dashed",
|
7280
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7281
|
- [ "1", null ],
|
8194
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8195
|
+ ["1", null],
|
7282
|
).setAttribute("title", mxResources.get("dashed"));
|
8196
|
).setAttribute("title", mxResources.get("dashed"));
|
7283
|
addItem(
|
8197
|
addItem(
|
7284
|
menu,
|
8198
|
menu,
|
7285
|
33,
|
8199
|
33,
|
7286
|
"dotted",
|
8200
|
"dotted",
|
7287
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7288
|
- [ "1", "1 1" ],
|
8201
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8202
|
+ ["1", "1 1"],
|
7289
|
).setAttribute("title", mxResources.get("dotted") + " (1)");
|
8203
|
).setAttribute("title", mxResources.get("dotted") + " (1)");
|
7290
|
addItem(
|
8204
|
addItem(
|
7291
|
menu,
|
8205
|
menu,
|
7292
|
33,
|
8206
|
33,
|
7293
|
"dotted",
|
8207
|
"dotted",
|
7294
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7295
|
- [ "1", "1 2" ],
|
8208
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8209
|
+ ["1", "1 2"],
|
7296
|
).setAttribute("title", mxResources.get("dotted") + " (2)");
|
8210
|
).setAttribute("title", mxResources.get("dotted") + " (2)");
|
7297
|
addItem(
|
8211
|
addItem(
|
7298
|
menu,
|
8212
|
menu,
|
7299
|
33,
|
8213
|
33,
|
7300
|
"dotted",
|
8214
|
"dotted",
|
7301
|
- [ mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN ],
|
|
|
7302
|
- [ "1", "1 4" ],
|
8215
|
+ [mxConstants.STYLE_DASHED, mxConstants.STYLE_DASH_PATTERN],
|
|
|
8216
|
+ ["1", "1 4"],
|
7303
|
).setAttribute("title", mxResources.get("dotted") + " (3)");
|
8217
|
).setAttribute("title", mxResources.get("dotted") + " (3)");
|
7304
|
}),
|
8218
|
}),
|
7305
|
);
|
8219
|
);
|
|
@@ -7335,9 +8249,9 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7335,9 +8249,9 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7335
|
new mxEventObject(
|
8249
|
new mxEventObject(
|
7336
|
"styleChanged",
|
8250
|
"styleChanged",
|
7337
|
"keys",
|
8251
|
"keys",
|
7338
|
- [ mxConstants.STYLE_STROKEWIDTH ],
|
8252
|
+ [mxConstants.STYLE_STROKEWIDTH],
|
7339
|
"values",
|
8253
|
"values",
|
7340
|
- [ value ],
|
8254
|
+ [value],
|
7341
|
"cells",
|
8255
|
"cells",
|
7342
|
ss.cells,
|
8256
|
ss.cells,
|
7343
|
),
|
8257
|
),
|
|
@@ -7359,9 +8273,9 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7359,9 +8273,9 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7359
|
new mxEventObject(
|
8273
|
new mxEventObject(
|
7360
|
"styleChanged",
|
8274
|
"styleChanged",
|
7361
|
"keys",
|
8275
|
"keys",
|
7362
|
- [ mxConstants.STYLE_STROKEWIDTH ],
|
8276
|
+ [mxConstants.STYLE_STROKEWIDTH],
|
7363
|
"values",
|
8277
|
"values",
|
7364
|
- [ value ],
|
8278
|
+ [value],
|
7365
|
"cells",
|
8279
|
"cells",
|
7366
|
ss.cells,
|
8280
|
ss.cells,
|
7367
|
),
|
8281
|
),
|
|
@@ -7407,7 +8321,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7407,7 +8321,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7407
|
mxConstants.STYLE_CURVED,
|
8321
|
mxConstants.STYLE_CURVED,
|
7408
|
mxConstants.STYLE_NOEDGESTYLE,
|
8322
|
mxConstants.STYLE_NOEDGESTYLE,
|
7409
|
],
|
8323
|
],
|
7410
|
- [ null, null, null ],
|
8324
|
+ [null, null, null],
|
7411
|
"geIcon geSprite geSprite-straight",
|
8325
|
"geIcon geSprite geSprite-straight",
|
7412
|
null,
|
8326
|
null,
|
7413
|
true,
|
8327
|
true,
|
|
@@ -7422,7 +8336,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7422,7 +8336,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7422
|
mxConstants.STYLE_CURVED,
|
8336
|
mxConstants.STYLE_CURVED,
|
7423
|
mxConstants.STYLE_NOEDGESTYLE,
|
8337
|
mxConstants.STYLE_NOEDGESTYLE,
|
7424
|
],
|
8338
|
],
|
7425
|
- [ "orthogonalEdgeStyle", null, null ],
|
8339
|
+ ["orthogonalEdgeStyle", null, null],
|
7426
|
"geIcon geSprite geSprite-orthogonal",
|
8340
|
"geIcon geSprite geSprite-orthogonal",
|
7427
|
null,
|
8341
|
null,
|
7428
|
true,
|
8342
|
true,
|
|
@@ -7438,7 +8352,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7438,7 +8352,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7438
|
mxConstants.STYLE_CURVED,
|
8352
|
mxConstants.STYLE_CURVED,
|
7439
|
mxConstants.STYLE_NOEDGESTYLE,
|
8353
|
mxConstants.STYLE_NOEDGESTYLE,
|
7440
|
],
|
8354
|
],
|
7441
|
- [ "elbowEdgeStyle", null, null, null ],
|
8355
|
+ ["elbowEdgeStyle", null, null, null],
|
7442
|
"geIcon geSprite geSprite-horizontalelbow",
|
8356
|
"geIcon geSprite geSprite-horizontalelbow",
|
7443
|
null,
|
8357
|
null,
|
7444
|
true,
|
8358
|
true,
|
|
@@ -7454,7 +8368,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7454,7 +8368,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7454
|
mxConstants.STYLE_CURVED,
|
8368
|
mxConstants.STYLE_CURVED,
|
7455
|
mxConstants.STYLE_NOEDGESTYLE,
|
8369
|
mxConstants.STYLE_NOEDGESTYLE,
|
7456
|
],
|
8370
|
],
|
7457
|
- [ "elbowEdgeStyle", "vertical", null, null ],
|
8371
|
+ ["elbowEdgeStyle", "vertical", null, null],
|
7458
|
"geIcon geSprite geSprite-verticalelbow",
|
8372
|
"geIcon geSprite geSprite-verticalelbow",
|
7459
|
null,
|
8373
|
null,
|
7460
|
true,
|
8374
|
true,
|
|
@@ -7470,7 +8384,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7470,7 +8384,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7470
|
mxConstants.STYLE_CURVED,
|
8384
|
mxConstants.STYLE_CURVED,
|
7471
|
mxConstants.STYLE_NOEDGESTYLE,
|
8385
|
mxConstants.STYLE_NOEDGESTYLE,
|
7472
|
],
|
8386
|
],
|
7473
|
- [ "isometricEdgeStyle", null, null, null ],
|
8387
|
+ ["isometricEdgeStyle", null, null, null],
|
7474
|
"geIcon geSprite geSprite-horizontalisometric",
|
8388
|
"geIcon geSprite geSprite-horizontalisometric",
|
7475
|
null,
|
8389
|
null,
|
7476
|
true,
|
8390
|
true,
|
|
@@ -7486,7 +8400,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7486,7 +8400,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7486
|
mxConstants.STYLE_CURVED,
|
8400
|
mxConstants.STYLE_CURVED,
|
7487
|
mxConstants.STYLE_NOEDGESTYLE,
|
8401
|
mxConstants.STYLE_NOEDGESTYLE,
|
7488
|
],
|
8402
|
],
|
7489
|
- [ "isometricEdgeStyle", "vertical", null, null ],
|
8403
|
+ ["isometricEdgeStyle", "vertical", null, null],
|
7490
|
"geIcon geSprite geSprite-verticalisometric",
|
8404
|
"geIcon geSprite geSprite-verticalisometric",
|
7491
|
null,
|
8405
|
null,
|
7492
|
true,
|
8406
|
true,
|
|
@@ -7503,7 +8417,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7503,7 +8417,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7503
|
mxConstants.STYLE_CURVED,
|
8417
|
mxConstants.STYLE_CURVED,
|
7504
|
mxConstants.STYLE_NOEDGESTYLE,
|
8418
|
mxConstants.STYLE_NOEDGESTYLE,
|
7505
|
],
|
8419
|
],
|
7506
|
- [ "orthogonalEdgeStyle", "1", null ],
|
8420
|
+ ["orthogonalEdgeStyle", "1", null],
|
7507
|
"geIcon geSprite geSprite-curved",
|
8421
|
"geIcon geSprite geSprite-curved",
|
7508
|
null,
|
8422
|
null,
|
7509
|
true,
|
8423
|
true,
|
|
@@ -7520,7 +8434,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7520,7 +8434,7 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7520
|
mxConstants.STYLE_CURVED,
|
8434
|
mxConstants.STYLE_CURVED,
|
7521
|
mxConstants.STYLE_NOEDGESTYLE,
|
8435
|
mxConstants.STYLE_NOEDGESTYLE,
|
7522
|
],
|
8436
|
],
|
7523
|
- [ "entityRelationEdgeStyle", null, null ],
|
8437
|
+ ["entityRelationEdgeStyle", null, null],
|
7524
|
"geIcon geSprite geSprite-entity",
|
8438
|
"geIcon geSprite geSprite-entity",
|
7525
|
null,
|
8439
|
null,
|
7526
|
true,
|
8440
|
true,
|
|
@@ -7544,8 +8458,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7544,8 +8458,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7544
|
var item = this.editorUi.menus.edgeStyleChange(
|
8458
|
var item = this.editorUi.menus.edgeStyleChange(
|
7545
|
menu,
|
8459
|
menu,
|
7546
|
"",
|
8460
|
"",
|
7547
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7548
|
- [ mxConstants.NONE, 0 ],
|
8461
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8462
|
+ [mxConstants.NONE, 0],
|
7549
|
"geIcon",
|
8463
|
"geIcon",
|
7550
|
null,
|
8464
|
null,
|
7551
|
false,
|
8465
|
false,
|
|
@@ -7562,8 +8476,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7562,8 +8476,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7562
|
this.editorUi.menus.edgeStyleChange(
|
8476
|
this.editorUi.menus.edgeStyleChange(
|
7563
|
menu,
|
8477
|
menu,
|
7564
|
"",
|
8478
|
"",
|
7565
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7566
|
- [ mxConstants.ARROW_CLASSIC, 1 ],
|
8479
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8480
|
+ [mxConstants.ARROW_CLASSIC, 1],
|
7567
|
null,
|
8481
|
null,
|
7568
|
null,
|
8482
|
null,
|
7569
|
false,
|
8483
|
false,
|
|
@@ -7574,8 +8488,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7574,8 +8488,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7574
|
this.editorUi.menus.edgeStyleChange(
|
8488
|
this.editorUi.menus.edgeStyleChange(
|
7575
|
menu,
|
8489
|
menu,
|
7576
|
"",
|
8490
|
"",
|
7577
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7578
|
- [ mxConstants.ARROW_CLASSIC_THIN, 1 ],
|
8491
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8492
|
+ [mxConstants.ARROW_CLASSIC_THIN, 1],
|
7579
|
null,
|
8493
|
null,
|
7580
|
null,
|
8494
|
null,
|
7581
|
false,
|
8495
|
false,
|
|
@@ -7586,8 +8500,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7586,8 +8500,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7586
|
this.editorUi.menus.edgeStyleChange(
|
8500
|
this.editorUi.menus.edgeStyleChange(
|
7587
|
menu,
|
8501
|
menu,
|
7588
|
"",
|
8502
|
"",
|
7589
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7590
|
- [ mxConstants.ARROW_OPEN, 0 ],
|
8503
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8504
|
+ [mxConstants.ARROW_OPEN, 0],
|
7591
|
null,
|
8505
|
null,
|
7592
|
null,
|
8506
|
null,
|
7593
|
false,
|
8507
|
false,
|
|
@@ -7598,8 +8512,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7598,8 +8512,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7598
|
this.editorUi.menus.edgeStyleChange(
|
8512
|
this.editorUi.menus.edgeStyleChange(
|
7599
|
menu,
|
8513
|
menu,
|
7600
|
"",
|
8514
|
"",
|
7601
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7602
|
- [ mxConstants.ARROW_OPEN_THIN, 0 ],
|
8515
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8516
|
+ [mxConstants.ARROW_OPEN_THIN, 0],
|
7603
|
null,
|
8517
|
null,
|
7604
|
null,
|
8518
|
null,
|
7605
|
false,
|
8519
|
false,
|
|
@@ -7610,8 +8524,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7610,8 +8524,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7610
|
this.editorUi.menus.edgeStyleChange(
|
8524
|
this.editorUi.menus.edgeStyleChange(
|
7611
|
menu,
|
8525
|
menu,
|
7612
|
"",
|
8526
|
"",
|
7613
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7614
|
- [ "openAsync", 0 ],
|
8527
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8528
|
+ ["openAsync", 0],
|
7615
|
null,
|
8529
|
null,
|
7616
|
null,
|
8530
|
null,
|
7617
|
false,
|
8531
|
false,
|
|
@@ -7622,8 +8536,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7622,8 +8536,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7622
|
this.editorUi.menus.edgeStyleChange(
|
8536
|
this.editorUi.menus.edgeStyleChange(
|
7623
|
menu,
|
8537
|
menu,
|
7624
|
"",
|
8538
|
"",
|
7625
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7626
|
- [ mxConstants.ARROW_BLOCK, 1 ],
|
8539
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8540
|
+ [mxConstants.ARROW_BLOCK, 1],
|
7627
|
null,
|
8541
|
null,
|
7628
|
null,
|
8542
|
null,
|
7629
|
false,
|
8543
|
false,
|
|
@@ -7634,8 +8548,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7634,8 +8548,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7634
|
this.editorUi.menus.edgeStyleChange(
|
8548
|
this.editorUi.menus.edgeStyleChange(
|
7635
|
menu,
|
8549
|
menu,
|
7636
|
"",
|
8550
|
"",
|
7637
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7638
|
- [ mxConstants.ARROW_BLOCK_THIN, 1 ],
|
8551
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8552
|
+ [mxConstants.ARROW_BLOCK_THIN, 1],
|
7639
|
null,
|
8553
|
null,
|
7640
|
null,
|
8554
|
null,
|
7641
|
false,
|
8555
|
false,
|
|
@@ -7646,8 +8560,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7646,8 +8560,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7646
|
this.editorUi.menus.edgeStyleChange(
|
8560
|
this.editorUi.menus.edgeStyleChange(
|
7647
|
menu,
|
8561
|
menu,
|
7648
|
"",
|
8562
|
"",
|
7649
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7650
|
- [ "async", 1 ],
|
8563
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8564
|
+ ["async", 1],
|
7651
|
null,
|
8565
|
null,
|
7652
|
null,
|
8566
|
null,
|
7653
|
false,
|
8567
|
false,
|
|
@@ -7658,8 +8572,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7658,8 +8572,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7658
|
this.editorUi.menus.edgeStyleChange(
|
8572
|
this.editorUi.menus.edgeStyleChange(
|
7659
|
menu,
|
8573
|
menu,
|
7660
|
"",
|
8574
|
"",
|
7661
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7662
|
- [ mxConstants.ARROW_OVAL, 1 ],
|
8575
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8576
|
+ [mxConstants.ARROW_OVAL, 1],
|
7663
|
null,
|
8577
|
null,
|
7664
|
null,
|
8578
|
null,
|
7665
|
false,
|
8579
|
false,
|
|
@@ -7670,8 +8584,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7670,8 +8584,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7670
|
this.editorUi.menus.edgeStyleChange(
|
8584
|
this.editorUi.menus.edgeStyleChange(
|
7671
|
menu,
|
8585
|
menu,
|
7672
|
"",
|
8586
|
"",
|
7673
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7674
|
- [ mxConstants.ARROW_DIAMOND, 1 ],
|
8587
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8588
|
+ [mxConstants.ARROW_DIAMOND, 1],
|
7675
|
null,
|
8589
|
null,
|
7676
|
null,
|
8590
|
null,
|
7677
|
false,
|
8591
|
false,
|
|
@@ -7682,8 +8596,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7682,8 +8596,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7682
|
this.editorUi.menus.edgeStyleChange(
|
8596
|
this.editorUi.menus.edgeStyleChange(
|
7683
|
menu,
|
8597
|
menu,
|
7684
|
"",
|
8598
|
"",
|
7685
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7686
|
- [ mxConstants.ARROW_DIAMOND_THIN, 1 ],
|
8599
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8600
|
+ [mxConstants.ARROW_DIAMOND_THIN, 1],
|
7687
|
null,
|
8601
|
null,
|
7688
|
null,
|
8602
|
null,
|
7689
|
false,
|
8603
|
false,
|
|
@@ -7694,8 +8608,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7694,8 +8608,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7694
|
this.editorUi.menus.edgeStyleChange(
|
8608
|
this.editorUi.menus.edgeStyleChange(
|
7695
|
menu,
|
8609
|
menu,
|
7696
|
"",
|
8610
|
"",
|
7697
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7698
|
- [ mxConstants.ARROW_CLASSIC, 0 ],
|
8611
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8612
|
+ [mxConstants.ARROW_CLASSIC, 0],
|
7699
|
null,
|
8613
|
null,
|
7700
|
null,
|
8614
|
null,
|
7701
|
false,
|
8615
|
false,
|
|
@@ -7706,8 +8620,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7706,8 +8620,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7706
|
this.editorUi.menus.edgeStyleChange(
|
8620
|
this.editorUi.menus.edgeStyleChange(
|
7707
|
menu,
|
8621
|
menu,
|
7708
|
"",
|
8622
|
"",
|
7709
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7710
|
- [ mxConstants.ARROW_CLASSIC_THIN, 0 ],
|
8623
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8624
|
+ [mxConstants.ARROW_CLASSIC_THIN, 0],
|
7711
|
null,
|
8625
|
null,
|
7712
|
null,
|
8626
|
null,
|
7713
|
false,
|
8627
|
false,
|
|
@@ -7718,8 +8632,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7718,8 +8632,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7718
|
this.editorUi.menus.edgeStyleChange(
|
8632
|
this.editorUi.menus.edgeStyleChange(
|
7719
|
menu,
|
8633
|
menu,
|
7720
|
"",
|
8634
|
"",
|
7721
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7722
|
- [ mxConstants.ARROW_BLOCK, 0 ],
|
8635
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8636
|
+ [mxConstants.ARROW_BLOCK, 0],
|
7723
|
null,
|
8637
|
null,
|
7724
|
null,
|
8638
|
null,
|
7725
|
false,
|
8639
|
false,
|
|
@@ -7730,8 +8644,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7730,8 +8644,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7730
|
this.editorUi.menus.edgeStyleChange(
|
8644
|
this.editorUi.menus.edgeStyleChange(
|
7731
|
menu,
|
8645
|
menu,
|
7732
|
"",
|
8646
|
"",
|
7733
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7734
|
- [ mxConstants.ARROW_BLOCK_THIN, 0 ],
|
8647
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8648
|
+ [mxConstants.ARROW_BLOCK_THIN, 0],
|
7735
|
null,
|
8649
|
null,
|
7736
|
null,
|
8650
|
null,
|
7737
|
false,
|
8651
|
false,
|
|
@@ -7742,8 +8656,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7742,8 +8656,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7742
|
this.editorUi.menus.edgeStyleChange(
|
8656
|
this.editorUi.menus.edgeStyleChange(
|
7743
|
menu,
|
8657
|
menu,
|
7744
|
"",
|
8658
|
"",
|
7745
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7746
|
- [ "async", 0 ],
|
8659
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8660
|
+ ["async", 0],
|
7747
|
null,
|
8661
|
null,
|
7748
|
null,
|
8662
|
null,
|
7749
|
false,
|
8663
|
false,
|
|
@@ -7754,8 +8668,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7754,8 +8668,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7754
|
this.editorUi.menus.edgeStyleChange(
|
8668
|
this.editorUi.menus.edgeStyleChange(
|
7755
|
menu,
|
8669
|
menu,
|
7756
|
"",
|
8670
|
"",
|
7757
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7758
|
- [ mxConstants.ARROW_OVAL, 0 ],
|
8671
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8672
|
+ [mxConstants.ARROW_OVAL, 0],
|
7759
|
null,
|
8673
|
null,
|
7760
|
null,
|
8674
|
null,
|
7761
|
false,
|
8675
|
false,
|
|
@@ -7766,8 +8680,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7766,8 +8680,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7766
|
this.editorUi.menus.edgeStyleChange(
|
8680
|
this.editorUi.menus.edgeStyleChange(
|
7767
|
menu,
|
8681
|
menu,
|
7768
|
"",
|
8682
|
"",
|
7769
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7770
|
- [ mxConstants.ARROW_DIAMOND, 0 ],
|
8683
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8684
|
+ [mxConstants.ARROW_DIAMOND, 0],
|
7771
|
null,
|
8685
|
null,
|
7772
|
null,
|
8686
|
null,
|
7773
|
false,
|
8687
|
false,
|
|
@@ -7778,8 +8692,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7778,8 +8692,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7778
|
this.editorUi.menus.edgeStyleChange(
|
8692
|
this.editorUi.menus.edgeStyleChange(
|
7779
|
menu,
|
8693
|
menu,
|
7780
|
"",
|
8694
|
"",
|
7781
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7782
|
- [ mxConstants.ARROW_DIAMOND_THIN, 0 ],
|
8695
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8696
|
+ [mxConstants.ARROW_DIAMOND_THIN, 0],
|
7783
|
null,
|
8697
|
null,
|
7784
|
null,
|
8698
|
null,
|
7785
|
false,
|
8699
|
false,
|
|
@@ -7790,8 +8704,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7790,8 +8704,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7790
|
this.editorUi.menus.edgeStyleChange(
|
8704
|
this.editorUi.menus.edgeStyleChange(
|
7791
|
menu,
|
8705
|
menu,
|
7792
|
"",
|
8706
|
"",
|
7793
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7794
|
- [ "box", 0 ],
|
8707
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8708
|
+ ["box", 0],
|
7795
|
null,
|
8709
|
null,
|
7796
|
null,
|
8710
|
null,
|
7797
|
false,
|
8711
|
false,
|
|
@@ -7802,8 +8716,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7802,8 +8716,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7802
|
this.editorUi.menus.edgeStyleChange(
|
8716
|
this.editorUi.menus.edgeStyleChange(
|
7803
|
menu,
|
8717
|
menu,
|
7804
|
"",
|
8718
|
"",
|
7805
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7806
|
- [ "halfCircle", 0 ],
|
8719
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8720
|
+ ["halfCircle", 0],
|
7807
|
null,
|
8721
|
null,
|
7808
|
null,
|
8722
|
null,
|
7809
|
false,
|
8723
|
false,
|
|
@@ -7814,8 +8728,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7814,8 +8728,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7814
|
this.editorUi.menus.edgeStyleChange(
|
8728
|
this.editorUi.menus.edgeStyleChange(
|
7815
|
menu,
|
8729
|
menu,
|
7816
|
"",
|
8730
|
"",
|
7817
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7818
|
- [ "dash", 0 ],
|
8731
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8732
|
+ ["dash", 0],
|
7819
|
null,
|
8733
|
null,
|
7820
|
null,
|
8734
|
null,
|
7821
|
false,
|
8735
|
false,
|
|
@@ -7826,8 +8740,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7826,8 +8740,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7826
|
this.editorUi.menus.edgeStyleChange(
|
8740
|
this.editorUi.menus.edgeStyleChange(
|
7827
|
menu,
|
8741
|
menu,
|
7828
|
"",
|
8742
|
"",
|
7829
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7830
|
- [ "cross", 0 ],
|
8743
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8744
|
+ ["cross", 0],
|
7831
|
null,
|
8745
|
null,
|
7832
|
null,
|
8746
|
null,
|
7833
|
false,
|
8747
|
false,
|
|
@@ -7838,8 +8752,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7838,8 +8752,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7838
|
this.editorUi.menus.edgeStyleChange(
|
8752
|
this.editorUi.menus.edgeStyleChange(
|
7839
|
menu,
|
8753
|
menu,
|
7840
|
"",
|
8754
|
"",
|
7841
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7842
|
- [ "circlePlus", 0 ],
|
8755
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8756
|
+ ["circlePlus", 0],
|
7843
|
null,
|
8757
|
null,
|
7844
|
null,
|
8758
|
null,
|
7845
|
false,
|
8759
|
false,
|
|
@@ -7850,8 +8764,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7850,8 +8764,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7850
|
this.editorUi.menus.edgeStyleChange(
|
8764
|
this.editorUi.menus.edgeStyleChange(
|
7851
|
menu,
|
8765
|
menu,
|
7852
|
"",
|
8766
|
"",
|
7853
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7854
|
- [ "circle", 1 ],
|
8767
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8768
|
+ ["circle", 1],
|
7855
|
null,
|
8769
|
null,
|
7856
|
null,
|
8770
|
null,
|
7857
|
false,
|
8771
|
false,
|
|
@@ -7862,8 +8776,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7862,8 +8776,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7862
|
this.editorUi.menus.edgeStyleChange(
|
8776
|
this.editorUi.menus.edgeStyleChange(
|
7863
|
menu,
|
8777
|
menu,
|
7864
|
"",
|
8778
|
"",
|
7865
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7866
|
- [ "baseDash", 0 ],
|
8779
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8780
|
+ ["baseDash", 0],
|
7867
|
null,
|
8781
|
null,
|
7868
|
null,
|
8782
|
null,
|
7869
|
false,
|
8783
|
false,
|
|
@@ -7874,8 +8788,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7874,8 +8788,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7874
|
this.editorUi.menus.edgeStyleChange(
|
8788
|
this.editorUi.menus.edgeStyleChange(
|
7875
|
menu,
|
8789
|
menu,
|
7876
|
"",
|
8790
|
"",
|
7877
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7878
|
- [ "ERone", 0 ],
|
8791
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8792
|
+ ["ERone", 0],
|
7879
|
null,
|
8793
|
null,
|
7880
|
null,
|
8794
|
null,
|
7881
|
false,
|
8795
|
false,
|
|
@@ -7886,8 +8800,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7886,8 +8800,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7886
|
this.editorUi.menus.edgeStyleChange(
|
8800
|
this.editorUi.menus.edgeStyleChange(
|
7887
|
menu,
|
8801
|
menu,
|
7888
|
"",
|
8802
|
"",
|
7889
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7890
|
- [ "ERmandOne", 0 ],
|
8803
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8804
|
+ ["ERmandOne", 0],
|
7891
|
null,
|
8805
|
null,
|
7892
|
null,
|
8806
|
null,
|
7893
|
false,
|
8807
|
false,
|
|
@@ -7898,8 +8812,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7898,8 +8812,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7898
|
this.editorUi.menus.edgeStyleChange(
|
8812
|
this.editorUi.menus.edgeStyleChange(
|
7899
|
menu,
|
8813
|
menu,
|
7900
|
"",
|
8814
|
"",
|
7901
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7902
|
- [ "ERmany", 0 ],
|
8815
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8816
|
+ ["ERmany", 0],
|
7903
|
null,
|
8817
|
null,
|
7904
|
null,
|
8818
|
null,
|
7905
|
false,
|
8819
|
false,
|
|
@@ -7910,8 +8824,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7910,8 +8824,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7910
|
this.editorUi.menus.edgeStyleChange(
|
8824
|
this.editorUi.menus.edgeStyleChange(
|
7911
|
menu,
|
8825
|
menu,
|
7912
|
"",
|
8826
|
"",
|
7913
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7914
|
- [ "ERoneToMany", 0 ],
|
8827
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8828
|
+ ["ERoneToMany", 0],
|
7915
|
null,
|
8829
|
null,
|
7916
|
null,
|
8830
|
null,
|
7917
|
false,
|
8831
|
false,
|
|
@@ -7922,8 +8836,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7922,8 +8836,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7922
|
this.editorUi.menus.edgeStyleChange(
|
8836
|
this.editorUi.menus.edgeStyleChange(
|
7923
|
menu,
|
8837
|
menu,
|
7924
|
"",
|
8838
|
"",
|
7925
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7926
|
- [ "ERzeroToOne", 0 ],
|
8839
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8840
|
+ ["ERzeroToOne", 0],
|
7927
|
null,
|
8841
|
null,
|
7928
|
null,
|
8842
|
null,
|
7929
|
false,
|
8843
|
false,
|
|
@@ -7934,8 +8848,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7934,8 +8848,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7934
|
this.editorUi.menus.edgeStyleChange(
|
8848
|
this.editorUi.menus.edgeStyleChange(
|
7935
|
menu,
|
8849
|
menu,
|
7936
|
"",
|
8850
|
"",
|
7937
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7938
|
- [ "ERzeroToMany", 0 ],
|
8851
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8852
|
+ ["ERzeroToMany", 0],
|
7939
|
null,
|
8853
|
null,
|
7940
|
null,
|
8854
|
null,
|
7941
|
false,
|
8855
|
false,
|
|
@@ -7946,8 +8860,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7946,8 +8860,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7946
|
this.editorUi.menus.edgeStyleChange(
|
8860
|
this.editorUi.menus.edgeStyleChange(
|
7947
|
menu,
|
8861
|
menu,
|
7948
|
"",
|
8862
|
"",
|
7949
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7950
|
- [ "doubleBlock", 0 ],
|
8863
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8864
|
+ ["doubleBlock", 0],
|
7951
|
null,
|
8865
|
null,
|
7952
|
null,
|
8866
|
null,
|
7953
|
false,
|
8867
|
false,
|
|
@@ -7958,8 +8872,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7958,8 +8872,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7958
|
this.editorUi.menus.edgeStyleChange(
|
8872
|
this.editorUi.menus.edgeStyleChange(
|
7959
|
menu,
|
8873
|
menu,
|
7960
|
"",
|
8874
|
"",
|
7961
|
- [ mxConstants.STYLE_STARTARROW, "startFill" ],
|
|
|
7962
|
- [ "doubleBlock", 1 ],
|
8875
|
+ [mxConstants.STYLE_STARTARROW, "startFill"],
|
|
|
8876
|
+ ["doubleBlock", 1],
|
7963
|
null,
|
8877
|
null,
|
7964
|
null,
|
8878
|
null,
|
7965
|
false,
|
8879
|
false,
|
|
@@ -7971,8 +8885,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -7971,8 +8885,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
7971
|
.edgeStyleChange(
|
8885
|
.edgeStyleChange(
|
7972
|
menu,
|
8886
|
menu,
|
7973
|
"",
|
8887
|
"",
|
7974
|
- [ mxConstants.STYLE_STARTARROW ],
|
|
|
7975
|
- [ mxConstants.ARROW_BLOCK ],
|
8888
|
+ [mxConstants.STYLE_STARTARROW],
|
|
|
8889
|
+ [mxConstants.ARROW_BLOCK],
|
7976
|
"geIcon geSprite geSprite-startblocktrans",
|
8890
|
"geIcon geSprite geSprite-startblocktrans",
|
7977
|
null,
|
8891
|
null,
|
7978
|
false,
|
8892
|
false,
|
|
@@ -8008,8 +8922,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8008,8 +8922,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8008
|
var item = this.editorUi.menus.edgeStyleChange(
|
8922
|
var item = this.editorUi.menus.edgeStyleChange(
|
8009
|
menu,
|
8923
|
menu,
|
8010
|
"",
|
8924
|
"",
|
8011
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8012
|
- [ mxConstants.NONE, 0 ],
|
8925
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8926
|
+ [mxConstants.NONE, 0],
|
8013
|
"geIcon",
|
8927
|
"geIcon",
|
8014
|
null,
|
8928
|
null,
|
8015
|
false,
|
8929
|
false,
|
|
@@ -8026,8 +8940,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8026,8 +8940,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8026
|
this.editorUi.menus.edgeStyleChange(
|
8940
|
this.editorUi.menus.edgeStyleChange(
|
8027
|
menu,
|
8941
|
menu,
|
8028
|
"",
|
8942
|
"",
|
8029
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8030
|
- [ mxConstants.ARROW_CLASSIC, 1 ],
|
8943
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8944
|
+ [mxConstants.ARROW_CLASSIC, 1],
|
8031
|
null,
|
8945
|
null,
|
8032
|
null,
|
8946
|
null,
|
8033
|
false,
|
8947
|
false,
|
|
@@ -8039,8 +8953,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8039,8 +8953,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8039
|
this.editorUi.menus.edgeStyleChange(
|
8953
|
this.editorUi.menus.edgeStyleChange(
|
8040
|
menu,
|
8954
|
menu,
|
8041
|
"",
|
8955
|
"",
|
8042
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8043
|
- [ mxConstants.ARROW_CLASSIC_THIN, 1 ],
|
8956
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8957
|
+ [mxConstants.ARROW_CLASSIC_THIN, 1],
|
8044
|
null,
|
8958
|
null,
|
8045
|
null,
|
8959
|
null,
|
8046
|
false,
|
8960
|
false,
|
|
@@ -8052,8 +8966,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8052,8 +8966,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8052
|
this.editorUi.menus.edgeStyleChange(
|
8966
|
this.editorUi.menus.edgeStyleChange(
|
8053
|
menu,
|
8967
|
menu,
|
8054
|
"",
|
8968
|
"",
|
8055
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8056
|
- [ mxConstants.ARROW_OPEN, 0 ],
|
8969
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8970
|
+ [mxConstants.ARROW_OPEN, 0],
|
8057
|
null,
|
8971
|
null,
|
8058
|
null,
|
8972
|
null,
|
8059
|
false,
|
8973
|
false,
|
|
@@ -8065,8 +8979,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8065,8 +8979,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8065
|
this.editorUi.menus.edgeStyleChange(
|
8979
|
this.editorUi.menus.edgeStyleChange(
|
8066
|
menu,
|
8980
|
menu,
|
8067
|
"",
|
8981
|
"",
|
8068
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8069
|
- [ mxConstants.ARROW_OPEN_THIN, 0 ],
|
8982
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8983
|
+ [mxConstants.ARROW_OPEN_THIN, 0],
|
8070
|
null,
|
8984
|
null,
|
8071
|
null,
|
8985
|
null,
|
8072
|
false,
|
8986
|
false,
|
|
@@ -8078,8 +8992,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8078,8 +8992,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8078
|
this.editorUi.menus.edgeStyleChange(
|
8992
|
this.editorUi.menus.edgeStyleChange(
|
8079
|
menu,
|
8993
|
menu,
|
8080
|
"",
|
8994
|
"",
|
8081
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8082
|
- [ "openAsync", 0 ],
|
8995
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
8996
|
+ ["openAsync", 0],
|
8083
|
null,
|
8997
|
null,
|
8084
|
null,
|
8998
|
null,
|
8085
|
false,
|
8999
|
false,
|
|
@@ -8091,8 +9005,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8091,8 +9005,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8091
|
this.editorUi.menus.edgeStyleChange(
|
9005
|
this.editorUi.menus.edgeStyleChange(
|
8092
|
menu,
|
9006
|
menu,
|
8093
|
"",
|
9007
|
"",
|
8094
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8095
|
- [ mxConstants.ARROW_BLOCK, 1 ],
|
9008
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9009
|
+ [mxConstants.ARROW_BLOCK, 1],
|
8096
|
null,
|
9010
|
null,
|
8097
|
null,
|
9011
|
null,
|
8098
|
false,
|
9012
|
false,
|
|
@@ -8104,8 +9018,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8104,8 +9018,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8104
|
this.editorUi.menus.edgeStyleChange(
|
9018
|
this.editorUi.menus.edgeStyleChange(
|
8105
|
menu,
|
9019
|
menu,
|
8106
|
"",
|
9020
|
"",
|
8107
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8108
|
- [ mxConstants.ARROW_BLOCK_THIN, 1 ],
|
9021
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9022
|
+ [mxConstants.ARROW_BLOCK_THIN, 1],
|
8109
|
null,
|
9023
|
null,
|
8110
|
null,
|
9024
|
null,
|
8111
|
false,
|
9025
|
false,
|
|
@@ -8117,8 +9031,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8117,8 +9031,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8117
|
this.editorUi.menus.edgeStyleChange(
|
9031
|
this.editorUi.menus.edgeStyleChange(
|
8118
|
menu,
|
9032
|
menu,
|
8119
|
"",
|
9033
|
"",
|
8120
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8121
|
- [ "async", 1 ],
|
9034
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9035
|
+ ["async", 1],
|
8122
|
null,
|
9036
|
null,
|
8123
|
null,
|
9037
|
null,
|
8124
|
false,
|
9038
|
false,
|
|
@@ -8130,8 +9044,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8130,8 +9044,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8130
|
this.editorUi.menus.edgeStyleChange(
|
9044
|
this.editorUi.menus.edgeStyleChange(
|
8131
|
menu,
|
9045
|
menu,
|
8132
|
"",
|
9046
|
"",
|
8133
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8134
|
- [ mxConstants.ARROW_OVAL, 1 ],
|
9047
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9048
|
+ [mxConstants.ARROW_OVAL, 1],
|
8135
|
null,
|
9049
|
null,
|
8136
|
null,
|
9050
|
null,
|
8137
|
false,
|
9051
|
false,
|
|
@@ -8143,8 +9057,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8143,8 +9057,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8143
|
this.editorUi.menus.edgeStyleChange(
|
9057
|
this.editorUi.menus.edgeStyleChange(
|
8144
|
menu,
|
9058
|
menu,
|
8145
|
"",
|
9059
|
"",
|
8146
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8147
|
- [ mxConstants.ARROW_DIAMOND, 1 ],
|
9060
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9061
|
+ [mxConstants.ARROW_DIAMOND, 1],
|
8148
|
null,
|
9062
|
null,
|
8149
|
null,
|
9063
|
null,
|
8150
|
false,
|
9064
|
false,
|
|
@@ -8156,8 +9070,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8156,8 +9070,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8156
|
this.editorUi.menus.edgeStyleChange(
|
9070
|
this.editorUi.menus.edgeStyleChange(
|
8157
|
menu,
|
9071
|
menu,
|
8158
|
"",
|
9072
|
"",
|
8159
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8160
|
- [ mxConstants.ARROW_DIAMOND_THIN, 1 ],
|
9073
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9074
|
+ [mxConstants.ARROW_DIAMOND_THIN, 1],
|
8161
|
null,
|
9075
|
null,
|
8162
|
null,
|
9076
|
null,
|
8163
|
false,
|
9077
|
false,
|
|
@@ -8169,8 +9083,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8169,8 +9083,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8169
|
this.editorUi.menus.edgeStyleChange(
|
9083
|
this.editorUi.menus.edgeStyleChange(
|
8170
|
menu,
|
9084
|
menu,
|
8171
|
"",
|
9085
|
"",
|
8172
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8173
|
- [ mxConstants.ARROW_CLASSIC, 0 ],
|
9086
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9087
|
+ [mxConstants.ARROW_CLASSIC, 0],
|
8174
|
null,
|
9088
|
null,
|
8175
|
null,
|
9089
|
null,
|
8176
|
false,
|
9090
|
false,
|
|
@@ -8182,8 +9096,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8182,8 +9096,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8182
|
this.editorUi.menus.edgeStyleChange(
|
9096
|
this.editorUi.menus.edgeStyleChange(
|
8183
|
menu,
|
9097
|
menu,
|
8184
|
"",
|
9098
|
"",
|
8185
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8186
|
- [ mxConstants.ARROW_CLASSIC_THIN, 0 ],
|
9099
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9100
|
+ [mxConstants.ARROW_CLASSIC_THIN, 0],
|
8187
|
null,
|
9101
|
null,
|
8188
|
null,
|
9102
|
null,
|
8189
|
false,
|
9103
|
false,
|
|
@@ -8195,8 +9109,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8195,8 +9109,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8195
|
this.editorUi.menus.edgeStyleChange(
|
9109
|
this.editorUi.menus.edgeStyleChange(
|
8196
|
menu,
|
9110
|
menu,
|
8197
|
"",
|
9111
|
"",
|
8198
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8199
|
- [ mxConstants.ARROW_BLOCK, 0 ],
|
9112
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9113
|
+ [mxConstants.ARROW_BLOCK, 0],
|
8200
|
null,
|
9114
|
null,
|
8201
|
null,
|
9115
|
null,
|
8202
|
false,
|
9116
|
false,
|
|
@@ -8208,8 +9122,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8208,8 +9122,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8208
|
this.editorUi.menus.edgeStyleChange(
|
9122
|
this.editorUi.menus.edgeStyleChange(
|
8209
|
menu,
|
9123
|
menu,
|
8210
|
"",
|
9124
|
"",
|
8211
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8212
|
- [ mxConstants.ARROW_BLOCK_THIN, 0 ],
|
9125
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9126
|
+ [mxConstants.ARROW_BLOCK_THIN, 0],
|
8213
|
null,
|
9127
|
null,
|
8214
|
null,
|
9128
|
null,
|
8215
|
false,
|
9129
|
false,
|
|
@@ -8221,8 +9135,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8221,8 +9135,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8221
|
this.editorUi.menus.edgeStyleChange(
|
9135
|
this.editorUi.menus.edgeStyleChange(
|
8222
|
menu,
|
9136
|
menu,
|
8223
|
"",
|
9137
|
"",
|
8224
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8225
|
- [ "async", 0 ],
|
9138
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9139
|
+ ["async", 0],
|
8226
|
null,
|
9140
|
null,
|
8227
|
null,
|
9141
|
null,
|
8228
|
false,
|
9142
|
false,
|
|
@@ -8234,8 +9148,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8234,8 +9148,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8234
|
this.editorUi.menus.edgeStyleChange(
|
9148
|
this.editorUi.menus.edgeStyleChange(
|
8235
|
menu,
|
9149
|
menu,
|
8236
|
"",
|
9150
|
"",
|
8237
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8238
|
- [ mxConstants.ARROW_OVAL, 0 ],
|
9151
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9152
|
+ [mxConstants.ARROW_OVAL, 0],
|
8239
|
null,
|
9153
|
null,
|
8240
|
null,
|
9154
|
null,
|
8241
|
false,
|
9155
|
false,
|
|
@@ -8247,8 +9161,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8247,8 +9161,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8247
|
this.editorUi.menus.edgeStyleChange(
|
9161
|
this.editorUi.menus.edgeStyleChange(
|
8248
|
menu,
|
9162
|
menu,
|
8249
|
"",
|
9163
|
"",
|
8250
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8251
|
- [ mxConstants.ARROW_DIAMOND, 0 ],
|
9164
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9165
|
+ [mxConstants.ARROW_DIAMOND, 0],
|
8252
|
null,
|
9166
|
null,
|
8253
|
null,
|
9167
|
null,
|
8254
|
false,
|
9168
|
false,
|
|
@@ -8260,8 +9174,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8260,8 +9174,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8260
|
this.editorUi.menus.edgeStyleChange(
|
9174
|
this.editorUi.menus.edgeStyleChange(
|
8261
|
menu,
|
9175
|
menu,
|
8262
|
"",
|
9176
|
"",
|
8263
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8264
|
- [ mxConstants.ARROW_DIAMOND_THIN, 0 ],
|
9177
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9178
|
+ [mxConstants.ARROW_DIAMOND_THIN, 0],
|
8265
|
null,
|
9179
|
null,
|
8266
|
null,
|
9180
|
null,
|
8267
|
false,
|
9181
|
false,
|
|
@@ -8273,8 +9187,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8273,8 +9187,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8273
|
this.editorUi.menus.edgeStyleChange(
|
9187
|
this.editorUi.menus.edgeStyleChange(
|
8274
|
menu,
|
9188
|
menu,
|
8275
|
"",
|
9189
|
"",
|
8276
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8277
|
- [ "box", 0 ],
|
9190
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9191
|
+ ["box", 0],
|
8278
|
null,
|
9192
|
null,
|
8279
|
null,
|
9193
|
null,
|
8280
|
false,
|
9194
|
false,
|
|
@@ -8286,8 +9200,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8286,8 +9200,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8286
|
this.editorUi.menus.edgeStyleChange(
|
9200
|
this.editorUi.menus.edgeStyleChange(
|
8287
|
menu,
|
9201
|
menu,
|
8288
|
"",
|
9202
|
"",
|
8289
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8290
|
- [ "halfCircle", 0 ],
|
9203
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9204
|
+ ["halfCircle", 0],
|
8291
|
null,
|
9205
|
null,
|
8292
|
null,
|
9206
|
null,
|
8293
|
false,
|
9207
|
false,
|
|
@@ -8299,8 +9213,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8299,8 +9213,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8299
|
this.editorUi.menus.edgeStyleChange(
|
9213
|
this.editorUi.menus.edgeStyleChange(
|
8300
|
menu,
|
9214
|
menu,
|
8301
|
"",
|
9215
|
"",
|
8302
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8303
|
- [ "dash", 0 ],
|
9216
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9217
|
+ ["dash", 0],
|
8304
|
null,
|
9218
|
null,
|
8305
|
null,
|
9219
|
null,
|
8306
|
false,
|
9220
|
false,
|
|
@@ -8312,8 +9226,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8312,8 +9226,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8312
|
this.editorUi.menus.edgeStyleChange(
|
9226
|
this.editorUi.menus.edgeStyleChange(
|
8313
|
menu,
|
9227
|
menu,
|
8314
|
"",
|
9228
|
"",
|
8315
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8316
|
- [ "cross", 0 ],
|
9229
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9230
|
+ ["cross", 0],
|
8317
|
null,
|
9231
|
null,
|
8318
|
null,
|
9232
|
null,
|
8319
|
false,
|
9233
|
false,
|
|
@@ -8325,8 +9239,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8325,8 +9239,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8325
|
this.editorUi.menus.edgeStyleChange(
|
9239
|
this.editorUi.menus.edgeStyleChange(
|
8326
|
menu,
|
9240
|
menu,
|
8327
|
"",
|
9241
|
"",
|
8328
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8329
|
- [ "circlePlus", 0 ],
|
9242
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9243
|
+ ["circlePlus", 0],
|
8330
|
null,
|
9244
|
null,
|
8331
|
null,
|
9245
|
null,
|
8332
|
false,
|
9246
|
false,
|
|
@@ -8338,8 +9252,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8338,8 +9252,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8338
|
this.editorUi.menus.edgeStyleChange(
|
9252
|
this.editorUi.menus.edgeStyleChange(
|
8339
|
menu,
|
9253
|
menu,
|
8340
|
"",
|
9254
|
"",
|
8341
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8342
|
- [ "circle", 0 ],
|
9255
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9256
|
+ ["circle", 0],
|
8343
|
null,
|
9257
|
null,
|
8344
|
null,
|
9258
|
null,
|
8345
|
false,
|
9259
|
false,
|
|
@@ -8351,8 +9265,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8351,8 +9265,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8351
|
this.editorUi.menus.edgeStyleChange(
|
9265
|
this.editorUi.menus.edgeStyleChange(
|
8352
|
menu,
|
9266
|
menu,
|
8353
|
"",
|
9267
|
"",
|
8354
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8355
|
- [ "baseDash", 0 ],
|
9268
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9269
|
+ ["baseDash", 0],
|
8356
|
null,
|
9270
|
null,
|
8357
|
null,
|
9271
|
null,
|
8358
|
false,
|
9272
|
false,
|
|
@@ -8364,8 +9278,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8364,8 +9278,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8364
|
this.editorUi.menus.edgeStyleChange(
|
9278
|
this.editorUi.menus.edgeStyleChange(
|
8365
|
menu,
|
9279
|
menu,
|
8366
|
"",
|
9280
|
"",
|
8367
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8368
|
- [ "ERone", 0 ],
|
9281
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9282
|
+ ["ERone", 0],
|
8369
|
null,
|
9283
|
null,
|
8370
|
null,
|
9284
|
null,
|
8371
|
false,
|
9285
|
false,
|
|
@@ -8377,8 +9291,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8377,8 +9291,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8377
|
this.editorUi.menus.edgeStyleChange(
|
9291
|
this.editorUi.menus.edgeStyleChange(
|
8378
|
menu,
|
9292
|
menu,
|
8379
|
"",
|
9293
|
"",
|
8380
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8381
|
- [ "ERmandOne", 0 ],
|
9294
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9295
|
+ ["ERmandOne", 0],
|
8382
|
null,
|
9296
|
null,
|
8383
|
null,
|
9297
|
null,
|
8384
|
false,
|
9298
|
false,
|
|
@@ -8390,8 +9304,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8390,8 +9304,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8390
|
this.editorUi.menus.edgeStyleChange(
|
9304
|
this.editorUi.menus.edgeStyleChange(
|
8391
|
menu,
|
9305
|
menu,
|
8392
|
"",
|
9306
|
"",
|
8393
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8394
|
- [ "ERmany", 0 ],
|
9307
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9308
|
+ ["ERmany", 0],
|
8395
|
null,
|
9309
|
null,
|
8396
|
null,
|
9310
|
null,
|
8397
|
false,
|
9311
|
false,
|
|
@@ -8403,8 +9317,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8403,8 +9317,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8403
|
this.editorUi.menus.edgeStyleChange(
|
9317
|
this.editorUi.menus.edgeStyleChange(
|
8404
|
menu,
|
9318
|
menu,
|
8405
|
"",
|
9319
|
"",
|
8406
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8407
|
- [ "ERoneToMany", 0 ],
|
9320
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9321
|
+ ["ERoneToMany", 0],
|
8408
|
null,
|
9322
|
null,
|
8409
|
null,
|
9323
|
null,
|
8410
|
false,
|
9324
|
false,
|
|
@@ -8416,8 +9330,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8416,8 +9330,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8416
|
this.editorUi.menus.edgeStyleChange(
|
9330
|
this.editorUi.menus.edgeStyleChange(
|
8417
|
menu,
|
9331
|
menu,
|
8418
|
"",
|
9332
|
"",
|
8419
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8420
|
- [ "ERzeroToOne", 0 ],
|
9333
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9334
|
+ ["ERzeroToOne", 0],
|
8421
|
null,
|
9335
|
null,
|
8422
|
null,
|
9336
|
null,
|
8423
|
false,
|
9337
|
false,
|
|
@@ -8429,8 +9343,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8429,8 +9343,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8429
|
this.editorUi.menus.edgeStyleChange(
|
9343
|
this.editorUi.menus.edgeStyleChange(
|
8430
|
menu,
|
9344
|
menu,
|
8431
|
"",
|
9345
|
"",
|
8432
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8433
|
- [ "ERzeroToMany", 0 ],
|
9346
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9347
|
+ ["ERzeroToMany", 0],
|
8434
|
null,
|
9348
|
null,
|
8435
|
null,
|
9349
|
null,
|
8436
|
false,
|
9350
|
false,
|
|
@@ -8442,8 +9356,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8442,8 +9356,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8442
|
this.editorUi.menus.edgeStyleChange(
|
9356
|
this.editorUi.menus.edgeStyleChange(
|
8443
|
menu,
|
9357
|
menu,
|
8444
|
"",
|
9358
|
"",
|
8445
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8446
|
- [ "doubleBlock", 0 ],
|
9359
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9360
|
+ ["doubleBlock", 0],
|
8447
|
null,
|
9361
|
null,
|
8448
|
null,
|
9362
|
null,
|
8449
|
false,
|
9363
|
false,
|
|
@@ -8455,8 +9369,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8455,8 +9369,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8455
|
this.editorUi.menus.edgeStyleChange(
|
9369
|
this.editorUi.menus.edgeStyleChange(
|
8456
|
menu,
|
9370
|
menu,
|
8457
|
"",
|
9371
|
"",
|
8458
|
- [ mxConstants.STYLE_ENDARROW, "endFill" ],
|
|
|
8459
|
- [ "doubleBlock", 1 ],
|
9372
|
+ [mxConstants.STYLE_ENDARROW, "endFill"],
|
|
|
9373
|
+ ["doubleBlock", 1],
|
8460
|
null,
|
9374
|
null,
|
8461
|
null,
|
9375
|
null,
|
8462
|
false,
|
9376
|
false,
|
|
@@ -8469,8 +9383,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8469,8 +9383,8 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8469
|
.edgeStyleChange(
|
9383
|
.edgeStyleChange(
|
8470
|
menu,
|
9384
|
menu,
|
8471
|
"",
|
9385
|
"",
|
8472
|
- [ mxConstants.STYLE_ENDARROW ],
|
|
|
8473
|
- [ mxConstants.ARROW_BLOCK ],
|
9386
|
+ [mxConstants.STYLE_ENDARROW],
|
|
|
9387
|
+ [mxConstants.ARROW_BLOCK],
|
8474
|
"geIcon geSprite geSprite-endblocktrans",
|
9388
|
"geIcon geSprite geSprite-endblocktrans",
|
8475
|
null,
|
9389
|
null,
|
8476
|
false,
|
9390
|
false,
|
|
@@ -8693,14 +9607,14 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
|
@@ -8693,14 +9607,14 @@ StyleFormatPanel.prototype.addStroke = function (container) { |
8693
|
edgeStyleDiv.className =
|
9607
|
edgeStyleDiv.className =
|
8694
|
"geSprite " +
|
9608
|
"geSprite " +
|
8695
|
(mxUtils.getValue(ss.style, mxConstants.STYLE_ELBOW, null) ==
|
9609
|
(mxUtils.getValue(ss.style, mxConstants.STYLE_ELBOW, null) ==
|
8696
|
- "vertical"
|
9610
|
+ "vertical"
|
8697
|
? "geSprite-verticalelbow"
|
9611
|
? "geSprite-verticalelbow"
|
8698
|
: "geSprite-horizontalelbow");
|
9612
|
: "geSprite-horizontalelbow");
|
8699
|
} else if (es == "isometricEdgeStyle") {
|
9613
|
} else if (es == "isometricEdgeStyle") {
|
8700
|
edgeStyleDiv.className =
|
9614
|
edgeStyleDiv.className =
|
8701
|
"geSprite " +
|
9615
|
"geSprite " +
|
8702
|
(mxUtils.getValue(ss.style, mxConstants.STYLE_ELBOW, null) ==
|
9616
|
(mxUtils.getValue(ss.style, mxConstants.STYLE_ELBOW, null) ==
|
8703
|
- "vertical"
|
9617
|
+ "vertical"
|
8704
|
? "geSprite-verticalisometric"
|
9618
|
? "geSprite-verticalisometric"
|
8705
|
: "geSprite-horizontalisometric");
|
9619
|
: "geSprite-horizontalisometric");
|
8706
|
} else {
|
9620
|
} else {
|
|
@@ -8957,7 +9871,7 @@ StyleFormatPanel.prototype.addLineJumps = function (container) { |
|
@@ -8957,7 +9871,7 @@ StyleFormatPanel.prototype.addLineJumps = function (container) { |
8957
|
styleSelect.style.border = "1px solid rgb(160, 160, 160)";
|
9871
|
styleSelect.style.border = "1px solid rgb(160, 160, 160)";
|
8958
|
styleSelect.style.borderRadius = "4px";
|
9872
|
styleSelect.style.borderRadius = "4px";
|
8959
|
|
9873
|
|
8960
|
- var styles = [ "none", "arc", "gap", "sharp", "line" ];
|
9874
|
+ var styles = ["none", "arc", "gap", "sharp", "line"];
|
8961
|
|
9875
|
|
8962
|
for (var i = 0; i < styles.length; i++) {
|
9876
|
for (var i = 0; i < styles.length; i++) {
|
8963
|
var styleOption = document.createElement("option");
|
9877
|
var styleOption = document.createElement("option");
|
|
@@ -8974,9 +9888,9 @@ StyleFormatPanel.prototype.addLineJumps = function (container) { |
|
@@ -8974,9 +9888,9 @@ StyleFormatPanel.prototype.addLineJumps = function (container) { |
8974
|
new mxEventObject(
|
9888
|
new mxEventObject(
|
8975
|
"styleChanged",
|
9889
|
"styleChanged",
|
8976
|
"keys",
|
9890
|
"keys",
|
8977
|
- [ "jumpStyle" ],
|
9891
|
+ ["jumpStyle"],
|
8978
|
"values",
|
9892
|
"values",
|
8979
|
- [ styleSelect.value ],
|
9893
|
+ [styleSelect.value],
|
8980
|
"cells",
|
9894
|
"cells",
|
8981
|
ss.cells,
|
9895
|
ss.cells,
|
8982
|
),
|
9896
|
),
|
|
@@ -9126,7 +10040,7 @@ StyleFormatPanel.prototype.addStyleOps = function (div) { |
|
@@ -9126,7 +10040,7 @@ StyleFormatPanel.prototype.addStyleOps = function (div) { |
9126
|
div.style.paddingTop = "10px";
|
10040
|
div.style.paddingTop = "10px";
|
9127
|
div.style.paddingBottom = "10px";
|
10041
|
div.style.paddingBottom = "10px";
|
9128
|
|
10042
|
|
9129
|
- this.addActions(div, [ "setAsDefaultStyle" ]);
|
10043
|
+ this.addActions(div, ["setAsDefaultStyle"]);
|
9130
|
|
10044
|
|
9131
|
return div;
|
10045
|
return div;
|
9132
|
};
|
10046
|
};
|
|
@@ -9327,7 +10241,7 @@ DiagramStylePanel.prototype.addView = function (div) { |
|
@@ -9327,7 +10241,7 @@ DiagramStylePanel.prototype.addView = function (div) { |
9327
|
labelBackgroundColor:
|
10241
|
labelBackgroundColor:
|
9328
|
graphStyle != null ? graphStyle.background : null,
|
10242
|
graphStyle != null ? graphStyle.background : null,
|
9329
|
},
|
10243
|
},
|
9330
|
- [ cells[i] ],
|
10244
|
+ [cells[i]],
|
9331
|
);
|
10245
|
);
|
9332
|
}
|
10246
|
}
|
9333
|
|
10247
|
|
|
@@ -9503,7 +10417,7 @@ DiagramStylePanel.prototype.addView = function (div) { |
|
@@ -9503,7 +10417,7 @@ DiagramStylePanel.prototype.addView = function (div) { |
9503
|
v1,
|
10417
|
v1,
|
9504
|
"edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;",
|
10418
|
"edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;",
|
9505
|
);
|
10419
|
);
|
9506
|
- e1.geometry.points = [ new mxPoint(32, 70) ];
|
10420
|
+ e1.geometry.points = [new mxPoint(32, 70)];
|
9507
|
e1.geometry.offset = new mxPoint(0, 8);
|
10421
|
e1.geometry.offset = new mxPoint(0, 8);
|
9508
|
} finally {
|
10422
|
} finally {
|
9509
|
graph2.model.endUpdate();
|
10423
|
graph2.model.endUpdate();
|
|
@@ -10252,8 +11166,8 @@ DiagramFormatPanel.prototype.addPaperSize = function (div) { |
|
@@ -10252,8 +11166,8 @@ DiagramFormatPanel.prototype.addPaperSize = function (div) { |
10252
|
* Adds the label menu items to the given menu and parent.
|
11166
|
* Adds the label menu items to the given menu and parent.
|
10253
|
*/
|
11167
|
*/
|
10254
|
DiagramFormatPanel.prototype.addStyleOps = function (div) {
|
11168
|
DiagramFormatPanel.prototype.addStyleOps = function (div) {
|
10255
|
- this.addActions(div, [ "editData" ]);
|
|
|
10256
|
- this.addActions(div, [ "clearDefaultStyle" ]);
|
11169
|
+ this.addActions(div, ["editData"]);
|
|
|
11170
|
+ this.addActions(div, ["clearDefaultStyle"]);
|
10257
|
|
11171
|
|
10258
|
return div;
|
11172
|
return div;
|
10259
|
};
|
11173
|
};
|
|
@@ -10281,7 +11195,7 @@ class UseLayUi { |
|
@@ -10281,7 +11195,7 @@ class UseLayUi { |
10281
|
return result === '[object Function]' || result === '[object AsyncFunction]'
|
11195
|
return result === '[object Function]' || result === '[object AsyncFunction]'
|
10282
|
}
|
11196
|
}
|
10283
|
|
11197
|
|
10284
|
- static dynamicAttr = (attr, value) => value ? `${ attr }="${ value }"` : ''
|
11198
|
+ static dynamicAttr = (attr, value) => value ? `${attr}="${value}"` : ''
|
10285
|
|
11199
|
|
10286
|
/**
|
11200
|
/**
|
10287
|
* @description format data source to tree structure
|
11201
|
* @description format data source to tree structure
|
|
@@ -10301,7 +11215,7 @@ class UseLayUi { |
|
@@ -10301,7 +11215,7 @@ class UseLayUi { |
10301
|
if (next[childrenField] && next[childrenField].length) {
|
11215
|
if (next[childrenField] && next[childrenField].length) {
|
10302
|
children = fn(next.children)
|
11216
|
children = fn(next.children)
|
10303
|
}
|
11217
|
}
|
10304
|
- return [ ...prev, { children, ...customSetValue(next) } ]
|
11218
|
+ return [...prev, { children, ...customSetValue(next) }]
|
10305
|
}, [])
|
11219
|
}, [])
|
10306
|
}
|
11220
|
}
|
10307
|
return fn(data)
|
11221
|
return fn(data)
|
|
@@ -10350,9 +11264,9 @@ class UseLayUi { |
|
@@ -10350,9 +11264,9 @@ class UseLayUi { |
10350
|
let { renderFn } = options
|
11264
|
let { renderFn } = options
|
10351
|
renderFn = renderFn || ((record) => {
|
11265
|
renderFn = renderFn || ((record) => {
|
10352
|
if (typeof record === 'object') {
|
11266
|
if (typeof record === 'object') {
|
10353
|
- return `<option value="${ record[valueField] }" ${ record.disabled ? 'disabled=""' : '' }>${ record[labelField] }</option>`
|
11267
|
+ return `<option value="${record[valueField]}" ${record.disabled ? 'disabled=""' : ''}>${record[labelField]}</option>`
|
10354
|
} else {
|
11268
|
} else {
|
10355
|
- return `<option value="${ record }">${ record }</option>`
|
11269
|
+ return `<option value="${record}">${record}</option>`
|
10356
|
}
|
11270
|
}
|
10357
|
})
|
11271
|
})
|
10358
|
const optionsList = dataSource.map(renderFn)
|
11272
|
const optionsList = dataSource.map(renderFn)
|
|
@@ -10366,8 +11280,8 @@ class UseLayUi { |
|
@@ -10366,8 +11280,8 @@ class UseLayUi { |
10366
|
*/
|
11280
|
*/
|
10367
|
static createSingleUseFormItem(content, props = '') {
|
11281
|
static createSingleUseFormItem(content, props = '') {
|
10368
|
return `
|
11282
|
return `
|
10369
|
- <div class="layui-form" ${ props }>
|
|
|
10370
|
- ${ content }
|
11283
|
+ <div class="layui-form" ${props}>
|
|
|
11284
|
+ ${content}
|
10371
|
</div>
|
11285
|
</div>
|
10372
|
`
|
11286
|
`
|
10373
|
}
|
11287
|
}
|
|
@@ -10388,7 +11302,9 @@ class UseLayUi { |
|
@@ -10388,7 +11302,9 @@ class UseLayUi { |
10388
|
/**
|
11302
|
/**
|
10389
|
* @description create layui single select template
|
11303
|
* @description create layui single select template
|
10390
|
* @param {string} [options.layFilter] options.layFilter
|
11304
|
* @param {string} [options.layFilter] options.layFilter
|
|
|
11305
|
+ * @param {string} [options.bindValueFiled] options.bindValueFiled
|
10391
|
* @param {string} [options.layVerify] options.layVerify
|
11306
|
* @param {string} [options.layVerify] options.layVerify
|
|
|
11307
|
+ * @param {string} [options.layVerType] options.layVerType
|
10392
|
* @param {Function} [options.renderFn] options.renderFn
|
11308
|
* @param {Function} [options.renderFn] options.renderFn
|
10393
|
* @param {Array} [options.dataSource = []] options.dataSource
|
11309
|
* @param {Array} [options.dataSource = []] options.dataSource
|
10394
|
* @param {string} [options.valueField = id] options.valueField
|
11310
|
* @param {string} [options.valueField = id] options.valueField
|
|
@@ -10404,7 +11320,9 @@ class UseLayUi { |
|
@@ -10404,7 +11320,9 @@ class UseLayUi { |
10404
|
const {
|
11320
|
const {
|
10405
|
elem,
|
11321
|
elem,
|
10406
|
layFilter,
|
11322
|
layFilter,
|
|
|
11323
|
+ bindValueFiled,
|
10407
|
layVerify,
|
11324
|
layVerify,
|
|
|
11325
|
+ layVerType,
|
10408
|
renderFn,
|
11326
|
renderFn,
|
10409
|
dataSource = [],
|
11327
|
dataSource = [],
|
10410
|
valueField = 'id',
|
11328
|
valueField = 'id',
|
|
@@ -10429,7 +11347,7 @@ class UseLayUi { |
|
@@ -10429,7 +11347,7 @@ class UseLayUi { |
10429
|
return dataSource.map(record => renderFn(record))
|
11347
|
return dataSource.map(record => renderFn(record))
|
10430
|
}
|
11348
|
}
|
10431
|
return formatDataSource(dataSource).map(record => {
|
11349
|
return formatDataSource(dataSource).map(record => {
|
10432
|
- return `<option value="${ record[valueField] }" ${ record.disable ? 'disabled=""' : '' }>${ record[labelField] }</option>`
|
11350
|
+ return `<option value="${record[valueField]}" ${record.disable ? 'disabled=""' : ''}>${record[labelField]}</option>`
|
10433
|
})
|
11351
|
})
|
10434
|
}
|
11352
|
}
|
10435
|
|
11353
|
|
|
@@ -10440,7 +11358,7 @@ class UseLayUi { |
|
@@ -10440,7 +11358,7 @@ class UseLayUi { |
10440
|
}
|
11358
|
}
|
10441
|
|
11359
|
|
10442
|
if (layFilter) {
|
11360
|
if (layFilter) {
|
10443
|
- form.on(`select(${ layFilter })`, (data) => {
|
11361
|
+ form.on(`select(${layFilter})`, (data) => {
|
10444
|
if (onClick && this.isFunction(onClick)) {
|
11362
|
if (onClick && this.isFunction(onClick)) {
|
10445
|
onClick(data)
|
11363
|
onClick(data)
|
10446
|
}
|
11364
|
}
|
|
@@ -10448,11 +11366,11 @@ class UseLayUi { |
|
@@ -10448,11 +11366,11 @@ class UseLayUi { |
10448
|
}
|
11366
|
}
|
10449
|
|
11367
|
|
10450
|
let template = `
|
11368
|
let template = `
|
10451
|
- <div class="layui-form-item ${ className }">
|
|
|
10452
|
- <label class="layui-form-label">${ label }</label>
|
11369
|
+ <div class="layui-form-item ${className}">
|
|
|
11370
|
+ <label class="layui-form-label">${label}</label>
|
10453
|
<div class="layui-input-block">
|
11371
|
<div class="layui-input-block">
|
10454
|
- <select name="${ layFilter }" ${ this.dynamicAttr('lay-filter', layFilter) } ${ this.dynamicAttr('lay-verify', layVerify) }>
|
|
|
10455
|
- ${ generateOptionTemplate(dataSource) }
|
11372
|
+ <select name="${bindValueFiled}" ${this.dynamicAttr('lay-filter', layFilter)} ${this.dynamicAttr('lay-verify', layVerify)} ${this.dynamicAttr('lay-verType', layVerType)}>
|
|
|
11373
|
+ ${generateOptionTemplate(dataSource)}
|
10456
|
</select>
|
11374
|
</select>
|
10457
|
</div>
|
11375
|
</div>
|
10458
|
</div>`
|
11376
|
</div>`
|
|
@@ -10464,7 +11382,7 @@ class UseLayUi { |
|
@@ -10464,7 +11382,7 @@ class UseLayUi { |
10464
|
form.render('select', layFilter)
|
11382
|
form.render('select', layFilter)
|
10465
|
}
|
11383
|
}
|
10466
|
|
11384
|
|
10467
|
- template = singleUsage ? UseLayUi.createSingleUseFormItem(template, this.dynamicAttr('lay-filter', layFilter)) : template
|
11385
|
+ template = singleUsage ? UseLayUi.createSingleUseFormItem(template, '') : template
|
10468
|
|
11386
|
|
10469
|
|
11387
|
|
10470
|
function mount() {
|
11388
|
function mount() {
|
|
@@ -10490,6 +11408,8 @@ class UseLayUi { |
|
@@ -10490,6 +11408,8 @@ class UseLayUi { |
10490
|
* @param {boolean} [options.singleUsage = true] options.singleUsage
|
11408
|
* @param {boolean} [options.singleUsage = true] options.singleUsage
|
10491
|
* @param {Function} [options.customSetTree = ((record) => ({ id: record.id, title: record.name }))] options.customSetTree
|
11409
|
* @param {Function} [options.customSetTree = ((record) => ({ id: record.id, title: record.name }))] options.customSetTree
|
10492
|
* @param {boolean} [options.autoFormatDataSource = true] options.autoFormatDataSource
|
11410
|
* @param {boolean} [options.autoFormatDataSource = true] options.autoFormatDataSource
|
|
|
11411
|
+ * @param {string} [options.layVerify] options.layVerify
|
|
|
11412
|
+ * @param {string} [options.layVerType] options.layVerType
|
10493
|
* @param {Function} [options.treeProps.onReady] options.treeProps.onReady
|
11413
|
* @param {Function} [options.treeProps.onReady] options.treeProps.onReady
|
10494
|
*/
|
11414
|
*/
|
10495
|
static createTreeSelect(options) {
|
11415
|
static createTreeSelect(options) {
|
|
@@ -10509,23 +11429,25 @@ class UseLayUi { |
|
@@ -10509,23 +11429,25 @@ class UseLayUi { |
10509
|
labelField = 'name',
|
11429
|
labelField = 'name',
|
10510
|
valueField = 'id',
|
11430
|
valueField = 'id',
|
10511
|
childrenField = 'children',
|
11431
|
childrenField = 'children',
|
|
|
11432
|
+ layVerify,
|
|
|
11433
|
+ layVerType,
|
10512
|
} = options
|
11434
|
} = options
|
10513
|
|
11435
|
|
10514
|
let { data = [], click, onReady } = treeProps
|
11436
|
let { data = [], click, onReady } = treeProps
|
10515
|
|
11437
|
|
10516
|
let template = `
|
11438
|
let template = `
|
10517
|
- <div class="layui-form-item ${ CLASS_NAME } ${ className }">
|
|
|
10518
|
- <label class="layui-form-label">${ label }</label>
|
11439
|
+ <div class="layui-form-item ${CLASS_NAME} ${className}">
|
|
|
11440
|
+ <label class="layui-form-label">${label}</label>
|
10519
|
<div class="layui-input-block">
|
11441
|
<div class="layui-input-block">
|
10520
|
- <div class="layui-unselect layui-form-select ${ SELECT_CLS }">
|
11442
|
+ <div class="layui-unselect layui-form-select ${SELECT_CLS}">
|
10521
|
<div class="layui-select-title">
|
11443
|
<div class="layui-select-title">
|
10522
|
<span class="layui-input layui-unselect">请选择</span>
|
11444
|
<span class="layui-input layui-unselect">请选择</span>
|
10523
|
- <input type="hidden" name="${ layFilter }">
|
11445
|
+ <input ${this.dynamicAttr('lay-verify', layVerify)} ${this.dynamicAttr('lay-verType', layVerType)} type="text" style="visibility: hidden; position: absolute; top: 0" name="${layFilter}">
|
10524
|
<i class="layui-edge"></i>
|
11446
|
<i class="layui-edge"></i>
|
10525
|
</div>
|
11447
|
</div>
|
10526
|
<dl class="layui-anim layui-anim-upbit">
|
11448
|
<dl class="layui-anim layui-anim-upbit">
|
10527
|
<dd>
|
11449
|
<dd>
|
10528
|
- <ul id="${ layFilter }"></ul>
|
11450
|
+ <ul class="tree-select__tree-mount"></ul>
|
10529
|
</dd>
|
11451
|
</dd>
|
10530
|
</dl>
|
11452
|
</dl>
|
10531
|
</div>
|
11453
|
</div>
|
|
@@ -10543,7 +11465,7 @@ class UseLayUi { |
|
@@ -10543,7 +11465,7 @@ class UseLayUi { |
10543
|
$(elem)
|
11465
|
$(elem)
|
10544
|
.find('.layui-form-select').removeClass('layui-form-selected').end()
|
11466
|
.find('.layui-form-select').removeClass('layui-form-selected').end()
|
10545
|
.find(".layui-select-title span").html(title).end()
|
11467
|
.find(".layui-select-title span").html(title).end()
|
10546
|
- .find(`input:hidden[name='${ layFilter }']`).val(id);
|
11468
|
+ .find(`input[name='${layFilter}']`).val(id);
|
10547
|
}
|
11469
|
}
|
10548
|
|
11470
|
|
10549
|
// init mount
|
11471
|
// init mount
|
|
@@ -10556,7 +11478,7 @@ class UseLayUi { |
|
@@ -10556,7 +11478,7 @@ class UseLayUi { |
10556
|
tree.render({
|
11478
|
tree.render({
|
10557
|
...treeProps,
|
11479
|
...treeProps,
|
10558
|
...(autoFormatDataSource ? { data: UseLayUi.formatTreeDataSource(data, customSetTree, valueField, labelField, childrenField) } : {}),
|
11480
|
...(autoFormatDataSource ? { data: UseLayUi.formatTreeDataSource(data, customSetTree, valueField, labelField, childrenField) } : {}),
|
10559
|
- elem: $(elem).find(`#${ layFilter }`),
|
11481
|
+ elem: $(elem).find('.tree-select__tree-mount'),
|
10560
|
click(node) {
|
11482
|
click(node) {
|
10561
|
setValue(node.data)
|
11483
|
setValue(node.data)
|
10562
|
if (UseLayUi.isFunction(click)) click(node)
|
11484
|
if (UseLayUi.isFunction(click)) click(node)
|
|
@@ -10564,10 +11486,9 @@ class UseLayUi { |
|
@@ -10564,10 +11486,9 @@ class UseLayUi { |
10564
|
})
|
11486
|
})
|
10565
|
|
11487
|
|
10566
|
// focus
|
11488
|
// focus
|
10567
|
- $(`.${ SELECT_CLS }`)
|
11489
|
+ $(`.${SELECT_CLS}`).off('click')
|
10568
|
.on("click", ".layui-select-title", function (e) {
|
11490
|
.on("click", ".layui-select-title", function (e) {
|
10569
|
- $(".layui-form-select").not($(this).parents(".layui-form-select")).removeClass("layui-form-selected");
|
|
|
10570
|
- $(this).parents(`.${ SELECT_CLS }`).toggleClass("layui-form-selected");
|
11491
|
+ $(this).parents(`.${SELECT_CLS}`).toggleClass("layui-form-selected");
|
10571
|
layui.stope(e);
|
11492
|
layui.stope(e);
|
10572
|
})
|
11493
|
})
|
10573
|
.on('click', '.layui-anim', (e) => {
|
11494
|
.on('click', '.layui-anim', (e) => {
|
|
@@ -10578,15 +11499,16 @@ class UseLayUi { |
|
@@ -10578,15 +11499,16 @@ class UseLayUi { |
10578
|
})
|
11499
|
})
|
10579
|
|
11500
|
|
10580
|
// blur
|
11501
|
// blur
|
10581
|
- $(document)
|
|
|
10582
|
- .on("click", function (e) {
|
|
|
10583
|
- const target = e.target
|
|
|
10584
|
- const parentNode = document.getElementById(layFilter)
|
|
|
10585
|
- if (!parentNode) return
|
|
|
10586
|
- const showClose = UseLayUi.isInNode(parentNode, target, true)
|
|
|
10587
|
- if (showClose) return
|
|
|
10588
|
- $(`.${ SELECT_CLS }`).removeClass("layui-form-selected")
|
|
|
10589
|
- });
|
11502
|
+ // $(document)
|
|
|
11503
|
+ // .on("click", function (e) {
|
|
|
11504
|
+ // const target = e.target
|
|
|
11505
|
+ // const parentNode = $(`.${CLASS_NAME} .tree-select__tree-mount`)
|
|
|
11506
|
+ // if (!parentNode) return
|
|
|
11507
|
+ // console.log($.contains(parentNode, target))
|
|
|
11508
|
+ // // const showClose = UseLayUi.isInNode(parentNode, target, true)
|
|
|
11509
|
+ // // if (showClose) return
|
|
|
11510
|
+ // // $(`.${ SELECT_CLS }`).removeClass("layui-form-selected")
|
|
|
11511
|
+ // });
|
10590
|
|
11512
|
|
10591
|
if (UseLayUi.isFunction(onReady)) {
|
11513
|
if (UseLayUi.isFunction(onReady)) {
|
10592
|
onReady(setValue)
|
11514
|
onReady(setValue)
|
|
@@ -10616,27 +11538,27 @@ class UseLayUi { |
|
@@ -10616,27 +11538,27 @@ class UseLayUi { |
10616
|
} = options
|
11538
|
} = options
|
10617
|
customSetValue = customSetValue || ((record) => ({ value: record.id, title: record.name }))
|
11539
|
customSetValue = customSetValue || ((record) => ({ value: record.id, title: record.name }))
|
10618
|
if (!Array.isArray(dataSource)) {
|
11540
|
if (!Array.isArray(dataSource)) {
|
10619
|
- dataSource = [ dataSource ]
|
11541
|
+ dataSource = [dataSource]
|
10620
|
}
|
11542
|
}
|
10621
|
|
11543
|
|
10622
|
function createOptions(dataSource) {
|
11544
|
function createOptions(dataSource) {
|
10623
|
return dataSource.map((record) => {
|
11545
|
return dataSource.map((record) => {
|
10624
|
return `<input
|
11546
|
return `<input
|
10625
|
- type="checkbox" lay-skin="${ laySkin }"
|
|
|
10626
|
- ${ UseLayUi.dynamicAttr('name', record[valueField]) }
|
|
|
10627
|
- ${ UseLayUi.dynamicAttr('title', record[labelField]) }
|
|
|
10628
|
- ${ UseLayUi.dynamicAttr('lay-filter', layFilter) }
|
|
|
10629
|
- ${ UseLayUi.dynamicAttr('lay-verify', layVerify) }
|
|
|
10630
|
- ${ UseLayUi.dynamicAttr('checked', record[checkedField]) }
|
11547
|
+ type="checkbox" lay-skin="${laySkin}"
|
|
|
11548
|
+ ${UseLayUi.dynamicAttr('name', record[valueField])}
|
|
|
11549
|
+ ${UseLayUi.dynamicAttr('title', record[labelField])}
|
|
|
11550
|
+ ${UseLayUi.dynamicAttr('lay-filter', layFilter)}
|
|
|
11551
|
+ ${UseLayUi.dynamicAttr('lay-verify', layVerify)}
|
|
|
11552
|
+ ${UseLayUi.dynamicAttr('checked', record[checkedField])}
|
10631
|
>`
|
11553
|
>`
|
10632
|
})
|
11554
|
})
|
10633
|
}
|
11555
|
}
|
10634
|
|
11556
|
|
10635
|
let template = `
|
11557
|
let template = `
|
10636
|
- <div class="layui-form-item ${ CLASS_NAME }" >
|
|
|
10637
|
- <label class="layui-form-label">${ label }</label>
|
11558
|
+ <div class="layui-form-item ${CLASS_NAME}" >
|
|
|
11559
|
+ <label class="layui-form-label">${label}</label>
|
10638
|
<div class="layui-input-block">
|
11560
|
<div class="layui-input-block">
|
10639
|
- ${ createOptions(dataSource).join('') }
|
11561
|
+ ${createOptions(dataSource).join('')}
|
10640
|
</div>
|
11562
|
</div>
|
10641
|
</div>
|
11563
|
</div>
|
10642
|
`
|
11564
|
`
|
|
@@ -10646,7 +11568,7 @@ class UseLayUi { |
|
@@ -10646,7 +11568,7 @@ class UseLayUi { |
10646
|
if (!elem) return template
|
11568
|
if (!elem) return template
|
10647
|
$(elem).empty()
|
11569
|
$(elem).empty()
|
10648
|
$(elem).append(template)
|
11570
|
$(elem).append(template)
|
10649
|
- form.on(`checkbox(${ layFilter })`, (data) => {
|
11571
|
+ form.on(`checkbox(${layFilter})`, (data) => {
|
10650
|
onChange && (onChange(data))
|
11572
|
onChange && (onChange(data))
|
10651
|
})
|
11573
|
})
|
10652
|
form.render()
|
11574
|
form.render()
|
|
@@ -10721,13 +11643,13 @@ class UseLayUi { |
|
@@ -10721,13 +11643,13 @@ class UseLayUi { |
10721
|
*/
|
11643
|
*/
|
10722
|
function to(promise, errorExt) {
|
11644
|
function to(promise, errorExt) {
|
10723
|
return promise
|
11645
|
return promise
|
10724
|
- .then((data) => [ null, data ])
|
11646
|
+ .then((data) => [null, data])
|
10725
|
.catch((err) => {
|
11647
|
.catch((err) => {
|
10726
|
if (errorExt) {
|
11648
|
if (errorExt) {
|
10727
|
const parsedError = Object.assign({}, err, errorExt)
|
11649
|
const parsedError = Object.assign({}, err, errorExt)
|
10728
|
- return [ parsedError, undefined ]
|
11650
|
+ return [parsedError, undefined]
|
10729
|
}
|
11651
|
}
|
10730
|
- return [ err, undefined ]
|
11652
|
+ return [err, undefined]
|
10731
|
})
|
11653
|
})
|
10732
|
}
|
11654
|
}
|
10733
|
|
11655
|
|
|
@@ -10757,7 +11679,7 @@ class EventCenter { |
|
@@ -10757,7 +11679,7 @@ class EventCenter { |
10757
|
this.eventStack.get(eventName).push(callback)
|
11679
|
this.eventStack.get(eventName).push(callback)
|
10758
|
return
|
11680
|
return
|
10759
|
}
|
11681
|
}
|
10760
|
- this.eventStack.set(eventName, [ callback ])
|
11682
|
+ this.eventStack.set(eventName, [callback])
|
10761
|
}
|
11683
|
}
|
10762
|
|
11684
|
|
10763
|
/**
|
11685
|
/**
|
|
@@ -11218,7 +12140,7 @@ class DispatchCenter { |
|
@@ -11218,7 +12140,7 @@ class DispatchCenter { |
11218
|
async getContentDataNode() {
|
12140
|
async getContentDataNode() {
|
11219
|
const { node: { id } = {} } = this.currentPage
|
12141
|
const { node: { id } = {} } = this.currentPage
|
11220
|
if (!id) return
|
12142
|
if (!id) return
|
11221
|
- const [ err, res ] = await to(ConfigurationNodeApi.getConfigurationInfo('CONTENT', id))
|
12143
|
+ const [err, res] = await to(ConfigurationNodeApi.getConfigurationInfo('CONTENT', id))
|
11222
|
const { dataSources, event, act } = this.contentData = res
|
12144
|
const { dataSources, event, act } = this.contentData = res
|
11223
|
const tsSubCmds = this.generatorDataSourceMapping(dataSources)
|
12145
|
const tsSubCmds = this.generatorDataSourceMapping(dataSources)
|
11224
|
this.sendMessageToGetRealTimeData({ tsSubCmds })
|
12146
|
this.sendMessageToGetRealTimeData({ tsSubCmds })
|
|
@@ -11268,6 +12190,7 @@ class DispatchCenter { |
|
@@ -11268,6 +12190,7 @@ class DispatchCenter { |
11268
|
* @description 分发事件
|
12190
|
* @description 分发事件
|
11269
|
*/
|
12191
|
*/
|
11270
|
publishEvent(eventName, data, message, event, ws) {
|
12192
|
publishEvent(eventName, data, message, event, ws) {
|
|
|
12193
|
+ data = data ? data : {}
|
11271
|
Object.keys(data).forEach(() => {
|
12194
|
Object.keys(data).forEach(() => {
|
11272
|
this.eventBus.emit(eventName, message, event, ws)
|
12195
|
this.eventBus.emit(eventName, message, event, ws)
|
11273
|
})
|
12196
|
})
|
|
@@ -11284,7 +12207,7 @@ class DispatchCenter { |
|
@@ -11284,7 +12207,7 @@ class DispatchCenter { |
11284
|
this.eventBus.on(eventName, (message) => {
|
12207
|
this.eventBus.on(eventName, (message) => {
|
11285
|
this.updatePage(() => {
|
12208
|
this.updatePage(() => {
|
11286
|
const { data } = message
|
12209
|
const { data } = message
|
11287
|
- const [ [ timespan, value ] ] = data[key]
|
12210
|
+ const [[timespan, value]] = data[key]
|
11288
|
node.setValue(value)
|
12211
|
node.setValue(value)
|
11289
|
}, node)
|
12212
|
}, node)
|
11290
|
})
|
12213
|
})
|
|
@@ -11413,7 +12336,7 @@ class HandleDataInteraction { |
|
@@ -11413,7 +12336,7 @@ class HandleDataInteraction { |
11413
|
if (eventName === mxEvent.MOUSE_UP) {
|
12336
|
if (eventName === mxEvent.MOUSE_UP) {
|
11414
|
this.handleMouseUpEvent(eventName, event, sender)
|
12337
|
this.handleMouseUpEvent(eventName, event, sender)
|
11415
|
}
|
12338
|
}
|
11416
|
- graphFireMouseEvent.apply(this.graph, [ eventName, event, sender ]);
|
12339
|
+ graphFireMouseEvent.apply(this.graph, [eventName, event, sender]);
|
11417
|
};
|
12340
|
};
|
11418
|
|
12341
|
|
11419
|
DispatchCenter.eventListenerIsExist = true
|
12342
|
DispatchCenter.eventListenerIsExist = true
|
|
@@ -11494,7 +12417,7 @@ class HandleDataInteraction { |
|
@@ -11494,7 +12417,7 @@ class HandleDataInteraction { |
11494
|
sendInstruction(list = []) {
|
12417
|
sendInstruction(list = []) {
|
11495
|
const queue = []
|
12418
|
const queue = []
|
11496
|
const fn = async (way, deviceId, data) => {
|
12419
|
const fn = async (way, deviceId, data) => {
|
11497
|
- const [ err, res = {} ] = await to(ConfigurationNodeApi.deviceIsOnLine(deviceId))
|
12420
|
+ const [err, res = {}] = await to(ConfigurationNodeApi.deviceIsOnLine(deviceId))
|
11498
|
const { value } = res
|
12421
|
const { value } = res
|
11499
|
if (value) {
|
12422
|
if (value) {
|
11500
|
await to(ConfigurationNodeApi.sendInstruction(way, deviceId, data))
|
12423
|
await to(ConfigurationNodeApi.sendInstruction(way, deviceId, data))
|
|
@@ -11527,10 +12450,13 @@ class HandleDataInteraction { |
|
@@ -11527,10 +12450,13 @@ class HandleDataInteraction { |
11527
|
* @description 跳转页面
|
12450
|
* @description 跳转页面
|
11528
|
*/
|
12451
|
*/
|
11529
|
jumpPage(page) {
|
12452
|
jumpPage(page) {
|
11530
|
- this.editorUi.handleCustomLink(`data:page/id,${ page }`)
|
12453
|
+ this.editorUi.handleCustomLink(`data:page/id,${page}`)
|
11531
|
}
|
12454
|
}
|
11532
|
}
|
12455
|
}
|
11533
|
|
12456
|
|
|
|
12457
|
+/**
|
|
|
12458
|
+ * @description 处理数据
|
|
|
12459
|
+ */
|
11534
|
class HandleDynamicEffect {
|
12460
|
class HandleDynamicEffect {
|
11535
|
|
12461
|
|
11536
|
/**
|
12462
|
/**
|
|
@@ -11571,6 +12497,7 @@ class HandleDynamicEffect { |
|
@@ -11571,6 +12497,7 @@ class HandleDynamicEffect { |
11571
|
FLASH: 'FLASH',
|
12497
|
FLASH: 'FLASH',
|
11572
|
DISPLAY: 'DISPLAY',
|
12498
|
DISPLAY: 'DISPLAY',
|
11573
|
ROTATE: 'ROTATE',
|
12499
|
ROTATE: 'ROTATE',
|
|
|
12500
|
+ IMAGE: 'IMAGE',
|
11574
|
}
|
12501
|
}
|
11575
|
|
12502
|
|
11576
|
static enumDisplayType = {
|
12503
|
static enumDisplayType = {
|
|
@@ -11640,7 +12567,7 @@ class HandleDynamicEffect { |
|
@@ -11640,7 +12567,7 @@ class HandleDynamicEffect { |
11640
|
|
12567
|
|
11641
|
tsSubCmds.push(this.generatorMessage(slaveDeviceId ? slaveDeviceId : deviceId, cmdId, attr))
|
12568
|
tsSubCmds.push(this.generatorMessage(slaveDeviceId ? slaveDeviceId : deviceId, cmdId, attr))
|
11642
|
|
12569
|
|
11643
|
- this.subscribeEvent(cmdId, this.dispatch(type), attr)
|
12570
|
+ this.subscribeEvent(cmdId, this.dispatch(type))
|
11644
|
})
|
12571
|
})
|
11645
|
this.sendMsg({ tsSubCmds })
|
12572
|
this.sendMsg({ tsSubCmds })
|
11646
|
}
|
12573
|
}
|
|
@@ -11697,6 +12624,9 @@ class HandleDynamicEffect { |
|
@@ -11697,6 +12624,9 @@ class HandleDynamicEffect { |
11697
|
case HandleDynamicEffect.enumActType.FLASH:
|
12624
|
case HandleDynamicEffect.enumActType.FLASH:
|
11698
|
invoke = this.flash.bind(this)
|
12625
|
invoke = this.flash.bind(this)
|
11699
|
break
|
12626
|
break
|
|
|
12627
|
+ case HandleDynamicEffect.enumActType.IMAGE:
|
|
|
12628
|
+ invoke = this.varImage.bind(this)
|
|
|
12629
|
+ break
|
11700
|
}
|
12630
|
}
|
11701
|
return invoke
|
12631
|
return invoke
|
11702
|
}
|
12632
|
}
|
|
@@ -11706,7 +12636,7 @@ class HandleDynamicEffect { |
|
@@ -11706,7 +12636,7 @@ class HandleDynamicEffect { |
11706
|
* @param message
|
12636
|
* @param message
|
11707
|
* @param attr
|
12637
|
* @param attr
|
11708
|
*/
|
12638
|
*/
|
11709
|
- rotate(message, attr) {
|
12639
|
+ rotate(message) {
|
11710
|
const { subscriptionId, data } = message
|
12640
|
const { subscriptionId, data } = message
|
11711
|
const node = this.getNodeByCmdId(subscriptionId)
|
12641
|
const node = this.getNodeByCmdId(subscriptionId)
|
11712
|
const { flag } = this.validate(subscriptionId, DispatchCenter.enumDynamicEffectType.ROTATE, data)
|
12642
|
const { flag } = this.validate(subscriptionId, DispatchCenter.enumDynamicEffectType.ROTATE, data)
|
|
@@ -11716,7 +12646,7 @@ class HandleDynamicEffect { |
|
@@ -11716,7 +12646,7 @@ class HandleDynamicEffect { |
11716
|
deg += 20
|
12646
|
deg += 20
|
11717
|
let style = node.getStyle()
|
12647
|
let style = node.getStyle()
|
11718
|
const reg = /rotation=(-?)\w+(;?)/g
|
12648
|
const reg = /rotation=(-?)\w+(;?)/g
|
11719
|
- style = style.replace(reg, `rotation=${ deg }`)
|
12649
|
+ style = style.replace(reg, `rotation=${deg}`)
|
11720
|
node.setStyle(style)
|
12650
|
node.setStyle(style)
|
11721
|
this.graph.updateCellStyles(style, node)
|
12651
|
this.graph.updateCellStyles(style, node)
|
11722
|
}
|
12652
|
}
|
|
@@ -11733,7 +12663,7 @@ class HandleDynamicEffect { |
|
@@ -11733,7 +12663,7 @@ class HandleDynamicEffect { |
11733
|
* @param message
|
12663
|
* @param message
|
11734
|
* @param attr
|
12664
|
* @param attr
|
11735
|
*/
|
12665
|
*/
|
11736
|
- display(message, attr) {
|
12666
|
+ display(message) {
|
11737
|
const { subscriptionId, data = {} } = message
|
12667
|
const { subscriptionId, data = {} } = message
|
11738
|
const { flag, condition } = this.validate(subscriptionId, HandleDynamicEffect.enumActType.DISPLAY, data)
|
12668
|
const { flag, condition } = this.validate(subscriptionId, HandleDynamicEffect.enumActType.DISPLAY, data)
|
11739
|
if (!flag) return
|
12669
|
if (!flag) return
|
|
@@ -11757,7 +12687,7 @@ class HandleDynamicEffect { |
|
@@ -11757,7 +12687,7 @@ class HandleDynamicEffect { |
11757
|
* @param message
|
12687
|
* @param message
|
11758
|
* @param attr
|
12688
|
* @param attr
|
11759
|
*/
|
12689
|
*/
|
11760
|
- flash(message, attr) {
|
12690
|
+ flash(message) {
|
11761
|
const { subscriptionId, data } = message
|
12691
|
const { subscriptionId, data } = message
|
11762
|
const node = this.getNodeByCmdId(subscriptionId)
|
12692
|
const node = this.getNodeByCmdId(subscriptionId)
|
11763
|
const { flag, condition } = this.validate(subscriptionId, HandleDynamicEffect.enumActType.FLASH, data)
|
12693
|
const { flag, condition } = this.validate(subscriptionId, HandleDynamicEffect.enumActType.FLASH, data)
|
|
@@ -11777,6 +12707,23 @@ class HandleDynamicEffect { |
|
@@ -11777,6 +12707,23 @@ class HandleDynamicEffect { |
11777
|
}
|
12707
|
}
|
11778
|
|
12708
|
|
11779
|
/**
|
12709
|
/**
|
|
|
12710
|
+ * @description 处理变量图片
|
|
|
12711
|
+ */
|
|
|
12712
|
+ varImage(message) {
|
|
|
12713
|
+ const { subscriptionId, data } = message
|
|
|
12714
|
+ const node = this.getNodeByCmdId(subscriptionId)
|
|
|
12715
|
+ const { flag, condition } = this.validate(subscriptionId, HandleDynamicEffect.enumActType.IMAGE, data)
|
|
|
12716
|
+ if (flag && node) {
|
|
|
12717
|
+ const { imagePath } = condition
|
|
|
12718
|
+ this.insertOnceUpdateFn(
|
|
|
12719
|
+ node,
|
|
|
12720
|
+ () => {
|
|
|
12721
|
+ node.setStyle(`image;image=${imagePath};imageAspect=0;`)
|
|
|
12722
|
+ })
|
|
|
12723
|
+ }
|
|
|
12724
|
+ }
|
|
|
12725
|
+
|
|
|
12726
|
+ /**
|
11780
|
* @description 验证是否满足条件列表中的任意一条
|
12727
|
* @description 验证是否满足条件列表中的任意一条
|
11781
|
* @param subscriptionId
|
12728
|
* @param subscriptionId
|
11782
|
* @param type
|
12729
|
* @param type
|
|
@@ -11788,7 +12735,7 @@ class HandleDynamicEffect { |
|
@@ -11788,7 +12735,7 @@ class HandleDynamicEffect { |
11788
|
const result = { condition: {}, flag: false }
|
12735
|
const result = { condition: {}, flag: false }
|
11789
|
for (let i = 0; i < condition.length; i++) {
|
12736
|
for (let i = 0; i < condition.length; i++) {
|
11790
|
const { min, max } = condition[i]
|
12737
|
const { min, max } = condition[i]
|
11791
|
- const [ timespan, realValue ] = value[attr][0]
|
12738
|
+ const [timespan, realValue] = value[attr][0]
|
11792
|
result.flag = this.isExistInArea(min, max, realValue)
|
12739
|
result.flag = this.isExistInArea(min, max, realValue)
|
11793
|
if (result.flag) {
|
12740
|
if (result.flag) {
|
11794
|
result.condition = condition[i]
|
12741
|
result.condition = condition[i]
|
|
@@ -11880,7 +12827,6 @@ class UpdateQueue { |
|
@@ -11880,7 +12827,6 @@ class UpdateQueue { |
11880
|
this.graph.getModel().endUpdate()
|
12827
|
this.graph.getModel().endUpdate()
|
11881
|
}
|
12828
|
}
|
11882
|
}
|
12829
|
}
|
11883
|
- console.log('enter')
|
|
|
11884
|
const cleanFn = RAFSetInterval(callback, time)
|
12830
|
const cleanFn = RAFSetInterval(callback, time)
|
11885
|
this.timeQueue.set(time, cleanFn)
|
12831
|
this.timeQueue.set(time, cleanFn)
|
11886
|
}
|
12832
|
}
|
|
@@ -12011,22 +12957,3 @@ function RAFSetInterval(callback, time) { |
|
@@ -12011,22 +12957,3 @@ function RAFSetInterval(callback, time) { |
12011
|
}
|
12957
|
}
|
12012
|
|
12958
|
|
12013
|
|
12959
|
|
12014
|
-function globalInit() {
|
|
|
12015
|
- init()
|
|
|
12016
|
-
|
|
|
12017
|
- function init() {
|
|
|
12018
|
- initRealTime()
|
|
|
12019
|
- }
|
|
|
12020
|
-
|
|
|
12021
|
- function initRealTime() {
|
|
|
12022
|
- RAFSetInterval(() => {
|
|
|
12023
|
- const allTimeNode = document.querySelectorAll('.thingKit-component__real-time .real-time__now')
|
|
|
12024
|
- for (const time of allTimeNode) {
|
|
|
12025
|
- const date = new Date()
|
|
|
12026
|
- time.innerHTML = `${ date.getHours() < 10 ? '0' : '' }${ date.getHours() }:${ date.getMinutes() < 10 ? '0' : '' }${ date.getMinutes() }:${ date.getSeconds() < 10 ? '0' : '' }${ date.getSeconds() }`
|
|
|
12027
|
- }
|
|
|
12028
|
- }, 1000)
|
|
|
12029
|
- }
|
|
|
12030
|
-}
|
|
|
12031
|
-
|
|
|
12032
|
-globalInit() |
|
|