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

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

parent 7e59f631
......@@ -26,7 +26,12 @@ class MqttView {
userName = 'admin',
password = 'public';
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 = {
invocationContext: {
host: hostname,
......
......@@ -173,6 +173,8 @@ const ConfigurationView = (props) => {
break;
case 'valCase': // 实时值模型
const division = node.division || false;
// 动画翻转
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.FlipHorizontal);
if (node.shType === '值显示') {
myDiagram.model.setDataProperty(
node,
......@@ -186,6 +188,10 @@ const ConfigurationView = (props) => {
division ? realVal.toLocaleString() : realVal,
);
}
// 动画还原
myTimeout(() => {
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.None);
}, 100);
if (node.stateName) return false;
shRule = ruleOperation(node, realVal);
myDiagram.model.setDataProperty(
......@@ -1565,6 +1571,7 @@ const ConfigurationView = (props) => {
editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
flip: go.GraphObject.None,
},
new go.Binding('text', 'showVal'),
new go.Binding('font', 'fontStyle'),
......@@ -1572,6 +1579,7 @@ const ConfigurationView = (props) => {
new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'),
new go.Binding('flip', 'flip'),
),
{
click(e, node) {
......
......@@ -213,6 +213,8 @@ const ConfigurationView = (props) => {
break;
case 'valCase': // 实时值模型
const division = node.division || false;
// 动画翻转
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.FlipHorizontal);
if (node.shType === '值显示') {
myDiagram.model.setDataProperty(
node,
......@@ -226,6 +228,10 @@ const ConfigurationView = (props) => {
division ? realVal.toLocaleString() : realVal,
);
}
// 动画还原
myTimeout(() => {
myDiagram.model.setDataProperty(node, 'flip', go.GraphObject.None);
}, 100);
// 颜色规则
if (node.stateName) return false;
shRule = ruleOperation(node, realVal);
......@@ -2113,6 +2119,7 @@ const ConfigurationView = (props) => {
editable: true,
font: 'bold 12px Helvetica, Arial, sans-serif',
stroke: '#454545',
flip: go.GraphObject.None,
},
new go.Binding('text', 'showVal'),
new go.Binding('font', 'fontStyle'),
......@@ -2120,6 +2127,7 @@ const ConfigurationView = (props) => {
new go.Binding('textAlign', 'fontAlign'),
new go.Binding('maxSize', 'textSize'),
new go.Binding('minSize', 'textSize'),
new go.Binding('flip', 'flip'),
),
{
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