Commit 76d6ebb1 authored by 李纪文's avatar 李纪文

fix: 组态增加动画及mqtt增加_site

parent 7e59f631
...@@ -26,7 +26,12 @@ class MqttView { ...@@ -26,7 +26,12 @@ class MqttView {
userName = 'admin', userName = 'admin',
password = 'public'; password = 'public';
this.saveWaCount = 0; this.saveWaCount = 0;
this.saveWaClient = new MqttClient.Client(hostname, port, path, clientId); this.saveWaClient = new MqttClient.Client(
hostname,
port,
`${path}?_site=${this.siteCode}`,
clientId,
);
this.saveWaOptions = { this.saveWaOptions = {
invocationContext: { invocationContext: {
host: hostname, host: hostname,
......
...@@ -173,6 +173,8 @@ const ConfigurationView = (props) => { ...@@ -173,6 +173,8 @@ const ConfigurationView = (props) => {
break; break;
case 'valCase': // 实时值模型 case 'valCase': // 实时值模型
const division = node.division || false; const division = node.division || false;
// 动画翻转
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.FlipHorizontal);
if (node.shType === '值显示') { if (node.shType === '值显示') {
myDiagram.model.setDataProperty( myDiagram.model.setDataProperty(
node, node,
...@@ -186,6 +188,10 @@ const ConfigurationView = (props) => { ...@@ -186,6 +188,10 @@ const ConfigurationView = (props) => {
division ? realVal.toLocaleString() : realVal, division ? realVal.toLocaleString() : realVal,
); );
} }
// 动画还原
myTimeout(() => {
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.None);
}, 100);
if (node.stateName) return false; if (node.stateName) return false;
shRule = ruleOperation(node, realVal); shRule = ruleOperation(node, realVal);
myDiagram.model.setDataProperty( myDiagram.model.setDataProperty(
...@@ -1565,6 +1571,7 @@ const ConfigurationView = (props) => { ...@@ -1565,6 +1571,7 @@ const ConfigurationView = (props) => {
editable: true, editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif', font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545', stroke: '#454545',
flip: go.GraphObject.None,
}, },
new go.Binding('text', 'showVal'), new go.Binding('text', 'showVal'),
new go.Binding('font', 'fontStyle'), new go.Binding('font', 'fontStyle'),
...@@ -1572,6 +1579,7 @@ const ConfigurationView = (props) => { ...@@ -1572,6 +1579,7 @@ const ConfigurationView = (props) => {
new go.Binding('textAlign', 'fontAlign'), new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'), new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'), new go.Binding('minSize', 'textSize'),
new go.Binding('flip', 'flip'),
), ),
{ {
click(e, node) { click(e, node) {
......
...@@ -213,6 +213,8 @@ const ConfigurationView = (props) => { ...@@ -213,6 +213,8 @@ const ConfigurationView = (props) => {
break; break;
case 'valCase': // 实时值模型 case 'valCase': // 实时值模型
const division = node.division || false; const division = node.division || false;
// 动画翻转
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.FlipHorizontal);
if (node.shType === '值显示') { if (node.shType === '值显示') {
myDiagram.model.setDataProperty( myDiagram.model.setDataProperty(
node, node,
...@@ -226,6 +228,10 @@ const ConfigurationView = (props) => { ...@@ -226,6 +228,10 @@ const ConfigurationView = (props) => {
division ? realVal.toLocaleString() : realVal, division ? realVal.toLocaleString() : realVal,
); );
} }
// 动画还原
myTimeout(() => {
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.None);
}, 100);
// 颜色规则 // 颜色规则
if (node.stateName) return false; if (node.stateName) return false;
shRule = ruleOperation(node, realVal); shRule = ruleOperation(node, realVal);
...@@ -2113,6 +2119,7 @@ const ConfigurationView = (props) => { ...@@ -2113,6 +2119,7 @@ const ConfigurationView = (props) => {
editable: true, editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif', font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545', stroke: '#454545',
flip: go.GraphObject.None,
}, },
new go.Binding('text', 'showVal'), new go.Binding('text', 'showVal'),
new go.Binding('font', 'fontStyle'), new go.Binding('font', 'fontStyle'),
...@@ -2120,6 +2127,7 @@ const ConfigurationView = (props) => { ...@@ -2120,6 +2127,7 @@ const ConfigurationView = (props) => {
new go.Binding('textAlign', 'fontAlign'), new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'), new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'), new go.Binding('minSize', 'textSize'),
new go.Binding('flip', 'flip'),
), ),
{ {
click(e, node) { click(e, node) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment