顶部信息栏

效果预览

yml配置

sidebar_tree: #与sidebar同级
  data: '{%new_tree_data%}'
  name: 'sidebar_tree' #如果需要传值,则需要配置这个name作为key
  search_bar: #检索
    - model: select
      label: 管理
      placeholder: 请选择
      name: type123
      options: '{%selectlist%}'
  config:
    show_checkbox: true #是否显示选择框
    resizalbe: true #是否可以改变宽度
    # check_strictly: true #选择框是否与下级解除关联
  root_buttons: #最外层按钮,配置同按钮配置
    - {model: btn, name: ajax, type: ajax, url: '/platform/user/save', refer: 'sidebar_tree'}
    - {model: btn, name: 新增父节点, type: dialog, dialog_id: add_tree_root, params: {user_id: '1'}, refer: 'sidebar_tree'}
  buttons: #每一个选项的菜单,配置同按钮配置
    - {model: btn, type: clipboard, icon: fa-clipboard, content: '点我复制', clipcontent: '{%label%}'}
    - {model: btn, name: 添加, type: dialog, dialog_id: add_tree, params: {user_id: '{%id%}'}}  
    - {model: btn, name: 删除, type: dialog, dialog_id: delete_tree, params: {user_id: '{%id%}', label: '{%label%}'}}

# 后端数据
data:
  new_tree_data:
    - label: '一级 1'
      id: 1
      href: '/list'
      children: 
        - label: '二级 1-1'
          id: 11
        - label: '二级 1-2'
          id: 12
          active: true
    - label: '一级 2'
      id: 2
      children: 
        - label: '二级 2-1'
          id: 21
        - label: '二级 2-2'
          id: 22
    - label: '一级 3'
      id: 3
      children: 
        - label: '二级 3-1'
          id: 31
        - label: '二级 3-2'
          id: 32

## 树形相关弹窗
preloader:
  delete_tree:
    model: dialog
    title: '系统提示'
    # show: false
    body: 
      engine: 'html'
      template: '是否要删除{%label%}这个节点?'
    buttons:
      - model: button
        content: 确定
        class_name: btn-info
        type: ajax
        url: '/platform/user/delete_tree'
        trigger_name: 'new_tree.delete'
        params:
          id: '{%user_id%}'
      - model: button
        content: 取消
        type: dismiss
  add_tree:
    model: dialog
    title: "添加树节点"
    height: small
    body:
      form:
        action:  "/platform/user/save_tree"
        content:
          - model: input
            label: 表单标题
            type: text
            name: act_name
            value: '{%user_id%}'
    buttons:
      - model: button
        class_name: btn-info
        content: 提交
        type: submit
        trigger_name: 'new_tree.add'
        params: 
          qq: '{%role_key%}'
      - model: button
        content: 取消
        type: dismiss
  add_tree_root:
    model: dialog
    title: "添加父节点"
    height: small
    body:
      form:
        action:  "/platform/user/save_tree_root"
        content:
          - model: input
            label: 表单标题
            type: text
            name: act_name
            value: '{%user_id%}'
    buttons:
      - model: button
        class_name: btn-info
        content: 提交
        type: submit
        trigger_name: 'new_tree.add_root'
        params: 
          qq: '{%role_key%}'
      - model: button
        content: 取消
        type: dismiss

results matching ""

    No results matching ""