• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

视图:表格列尾统计


一、概述

可以通过扩展TableWidget.ts实现

二、示例代码

import {
  BaseElementWidget,
  DslDefinitionType,
  SPI,
  TableWidget,
  ViewType,
  Widget
} from '@oinone/kunlun-dependencies';

@SPI.ClassFactory(
  BaseElementWidget.Token({
    type: ViewType.Table,
    widget: 'table',
    model: 'resource.k2.Model0000000109',
    viewName: '移动端品牌_TABLE_0000000000021513'
  })
)
  export class FooterStatisticsTable extends TableWidget {
    public initialize(props) {
      if (props.template) {
        props.template?.widgets?.forEach((a) => {
          if (a.dslNodeType === DslDefinitionType.FIELD && this.statisticsFieldList.includes(a.name)) {
            a.statistics = true;
          }
        });
      }
      super.initialize(props);
      return this;
    }

    // 需要表尾做合并的字段名称
    public statisticsFieldList = ['fansNum'];

    @Widget.Reactive()
    protected get showFooter(): boolean | undefined {
      return true;
    }
  }

三、效果预览

编辑此页
最近更新:2026/1/15 04:02
上一页
视图:表格列合并
下一页
视图:表格实现复制行
默认页脚
Copyright © 2026 Mr.Hope