【问题标题】:thingsboard navigation to other dashboard statesthingsboard 导航到其他仪表板状态
【发布时间】:2019-10-15 16:53:51
【问题描述】:

有谁知道如何导航到资产而不是设备的其他仪表板状态?因为我想导航到不同级别的其他仪表板状态。 我希望有人能够帮助我解决我已经尝试解决了一段时间的这个问题。下面将是我的仪表板不同级别的屏幕截图 还有我在自定义操作中添加的代码。

我尝试了很多不同的方法,其中一种是下面的:

var $injector = widgetContext.$scope.$injector;

$injector.get('assetService').getAsset(entityId.id).then

(function(asset) {

    if(asset.getName == 'LEVEL 5') {
        openDashboardState('building_level_view');
    } else if(asset.getName == 'LEVEL 6') {
        openDashboardState('building_level_lab_view');
    } else {
        openDashboardState('building_view');
    }
});

function openDashboardState(StateId) {
    var params = {
        entityId: entityId,
        entityName: entityName
    };

    widgetContext.stateController.openState(StateId, params, false);
}

【问题讨论】:

  • 您好,我们找到了一种解决方案,我们需要将所有资产类型分组到一个资产组中。

标签: navigation state dashboard custom-action thingsboard


【解决方案1】:

如果您仍然遇到问题,请尝试使用 asset.name 而不是 asset.getName

它对我有用(在演示平台上)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-11
    • 2019-09-04
    • 2019-07-07
    • 2019-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多