美文网首页重新撸码
amis 单个页面多个table实例

amis 单个页面多个table实例

作者: 大黄蜂阿天 | 来源:发表于2021-01-09 15:15 被阅读0次

效果

amis-1.png amis-2.png

代码

{
  "type": "page",
  "title": "提现列表",
  "body": {
    "type": "crud",
    "name": "wp",
    "api": {
      "url": "api/withdraw/list"
    },
    "defaultParams": {
      "pagesize": 20,
      "with": "id"
    },
    "headerToolbar": [
      {
        "type": "columns-toggler",
        "align": "left"
      },
      {
        "type": "tpl",
        "tpl": "当前有 ${count} 条数据",
        "align": "right",
        "className": "v-middle"
      }
    ],
    "footable": {
      "expand": "first"
    },
    "filter": {
      "title": "条件搜索",
      "submitText": "",
      "controls": [
        {
          "name": "id",
          "type": "text",
          "placeholder": "按照UID搜索",
          "value": ""
        },
        {
          "type": "select",
          "labelClassName": "text-muted",
          "name": "status",
          "value": "",
          "source": {
            "url": "api/const/WithdrawStatus",
            "adaptor": "constName2options"
          }
        },
        {
          "type": "date",
          "name": "date",
          "format": "YYYY-MM-DD",
          "inline": true
        },
        {
          "label": "搜索",
          "type": "submit"
        },
        {
          "type": "reset",
          "level": "danger",
          "label": "重置"
        }
      ]
    },
    "columns": [
      {
        "name": "id",
        "label": "ID",
        "sortable": true,
        "type": "text",
        "popOver": {
          "className": "withdrawIdShow",
          "body": {
            "type": "tpl",
            "tpl": "${withdrawId}"
          }
        }
      },
      {
        "name": "user.nickname",
        "label": "提现用户",
        "type": "tpl",
        "tpl": "${user.nickname} (uid=${userId})"
      },
      {
        "name": "user.phone",
        "label": "联系电话",
        "type": "text"
      },
      {
        "name": "money",
        "label": "提现金额",
        "type": "text"
      },
      {
        "name": "createdAt",
        "label": "申请时间",
        "type": "text"
      },
      {
        "name": "checkedAt",
        "label": "审核时间",
        "type": "text"
      },
      {
        "name": "status.label",
        "label": "提现状态",
        "type": "text"
      },
      {
        "label": "操作",
        "className": "w-sm",
        "sortable": false,
        "type": "button-group",
        "buttons": [
          {
            "label": "审核",
            "level": "danger",
            "visibleOn": "this.status.value==0",
            "type": "button",
            "actionType": "dialog",
            "dialog": {
              "size": "lg",
              "data": {
                "curUserId": "${userId}",
                "withdrawId": "${eid}"
              },
              "title": "审核",
              "actions": [
                {
                  "type": "button",
                  "actionType": "ajax",
                  "reload": "wp",
                  "close": true,
                  "api": "post:api/withdraw/${withdrawId}/check?status=ING",
                  "label": "通过"
                },
                {
                  "type": "button",
                  "actionType": "ajax",
                  "reload": "wp",
                  "confirmText": "确认审核不通过?",
                  "api": "post:api/withdraw/${withdrawId}/check?status=FAILED",
                  "close": true,
                  "level": "danger",
                  "label": "不通过"
                }
              ],
              "body": [
                {
                  "type": "service",
                  "api": "api/credit/${curUserId}/latest",
                  "body": {
                    "type": "table",
                    "title": "最近流水记录",
                    "columns": [
                      {
                        "name": "createdAt",
                        "label": "时间"
                      },
                      {
                        "name": "creditType.label",
                        "label": "类型"
                      },
                      {
                        "name": "amount",
                        "label": "金额"
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "label": "返还积分",
            "visibleOn": "this.status.value==-1",
            "type": "button",
            "level": "success",
            "actionType": "ajax",
            "confirmText": "确认返还积分?",
            "api": "post:api/withdraw/${eid}/refund"
          },
          {
            "label": "提现通过",
            "visibleOn": "this.status.value==-1",
            "type": "button",
            "level": "success",
            "actionType": "ajax",
            "confirmText": "确认提现通过?",
            "api": "post:api/withdraw/${eid}/check?status=ING"
          }
        ]
      }
    ]
  }
}

相关文章

  • amis 单个页面多个table实例

    效果 代码

  • 设计模式 - 单例模式

    概念: Typical Class:多个实例Singleton :单个实例 优点: 全局变量\公用组件可以快速实现...

  • SQl语句 常用

    单个通配符:_ in:在where子句中规定多个值;SELECT column_name(s)FROM table...

  • 数据库检索(Select)

    基本检索 检索单个列select column_name from table_name; 检索多个列select...

  • xterm实现单个页面多个webssh

    xterm是一个使用TypeScript编写的前端终端组件。 1、demo主要介绍 本文demo主要实现一个页面可...

  • 容器相关

    区分单个容器多个实例的方法 1.Jboss domainSystem.getProperties()参数中有[Se...

  • 消息队列之Kafka-生产者

    1、发送模式 KafkaProducer 是线程安全的,可以在多个线程中共享单个 KafkaProducer 实例...

  • Vue 实例化多个Vue对象

    一.实例化多个Vue对象 1. 多个实例化vue对象,和单个vue对象,使用方法一样,只是绑定操控的el元素不同了...

  • 正则表达式 -- 模式匹配

    匹配单个字符 实例演示: . 实例演示:[ ] 实例演示:\d 匹配多个字符 实例演示:*匹配一个字符串,首字母大...

  • Section 2: Checklists

    Checklists将带你从单个页面的app过渡到多个页面的app。在这你将会学习导航流、显示数据列表、模型、固化...

网友评论

    本文标题:amis 单个页面多个table实例

    本文链接:https://www.haomeiwen.com/subject/bdtxiktx.html