Node-RED opcua items 二次修改记录
发布日期:2021-06-30 10:11:36 浏览次数:4 分类:技术文章

本文共 1664 字,大约阅读时间需要 5 分钟。

101-opcuaitem.html:

在:

<script type="text/x-red" data-template-name="OpcUa-Item">

后面添加:

在该script最后添加:

在:

<script type="text/javascript">

添加:

function updateopcualist()    {        var opcualistItem =  document.getElementById("opcualist");        var opcuainputItem = document.getElementById("node-input-item");        var opcuaTypeItem =  document.getElementById("node-input-datatype");        $.ajax({            headers: {                "Accept": "application/json"            },            dataType: "json",            cache: false,            url: 'aheadgetOpcuaFileContent',            success: function (data) {                opucalists = data["list"]                var muloption = "";                for (var key in opucalists) {                  var item = opucalists[key];  //["ns=1;s=xxx","Boolean"]                    muloption = muloption + ""                }                opcualistItem.innerHTML="" + muloption;                                opcualistItem.onchange = function () {                    var results = opcualistItem.value.split(',');                    opcuainputItem.value = results[0];                    //设置类型                    for (i = 0; i < opcuaTypeItem.length; i++) {                        if (opcuaTypeItem[i].value == results[1]) {//value                            opcuaTypeItem[i].selected = true;                            break;                        }                    }            }            },            error: function(jqXHR,textStatus,errorThrown) {                console.log("get Opcua File Content Failed");            }        });    }

 

转载地址:https://islet.blog.csdn.net/article/details/117128338 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:文本自动对齐功能探索实现
下一篇:Node-RED dashboard ui-template 文件获取与保存

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年05月03日 09时14分57秒