页面树结构
转至元数据结尾
转至元数据起始

(本文档仅供参考,如和实际应用场景不匹配,需自行调整相关宏代码)

问题现象

      客户版本V11 在使用命名集添加了添加了TOP10的维度。

      在添加到仪表盘之后,无法将对应的参数值向下传递到其他页面




问题方案

      因为命名集有可能会有多个字段组件,所以在传参数的时候会有问题。如果命名集是单个字段,可以写宏实现:

function main(page: IPage, portlet: ITableListPortlet) {
    let fuId = page.getId() + '_' + portlet.getId()
    portlet.setRenderCellHandler((cell, row, rowIndex, columnIndex) => {
        if (columnIndex !== 0) {
            return;
        }
        // console.warn(cell.getValue())
        if (cell[`__${}_fn`]) {
            cell.removeEventListener(TableCellEvent.CLICK, cell[`__${fuId}_fn`])
        }
        cell[`__${fuId}_fn`] = () => {
            page.openResourceByType('I8aaa8000018d0f420f429c7d018d11a58b510b40', {
                paramInfo: [{
                    name: '产品名称',
                    value: [cell.getValue()]
                }]
            })
        }
        cell.addEventListener(TableCellEvent.CLICK, cell[`__${fuId}_fn`])
    })
}
  • 无标签