//右上
// console.log(rowSchema)
import { ref } from 'vue'
type Tree = { id: string; label: string; children?: Tree[] }
export const treeData = ref<Tree[]>([
  {
    id: '1',
    label: '清单目录',
    children: [
      {
        id: '2',
        label: '广东',
        children: [
          { id: '3', label: '广东工民建工料机工程' },
          { id: '4', label: '广东公路工料机工程' },
          { id: '5', label: '广东水利工料机工程' }
        ]
      }
    ]
  },
  {
    id: '11',
    label: '清单目录2',
    children: [
      {
        id: '12',
        label: '广西',
        children: [
          { id: '13', label: '工料机1费率工程' },
          { id: '14', label: '工料机2费率工程' },
          { id: '15', label: '工料机3费率工程' }
        ]
      }
    ]
  }
])

// 直接使用配置对象，DbTree 会自动创建 HierarchyContextMenuHandler
export const contextMenuHandler = {
  rootKey: 'add-category',
  rootText: '添加定额',
  levels: [
    {
      depth: 0,
      addKey: 'add-province',
      addText: '添加省市',
      allowDelete: true
    },
    {
      depth: 1,
      addKey: 'add-name',
      addText: '添加名称',
      allowDelete: true
    },
    {
      depth: 2,
      addKey: 'add-model',
      addText: '添加模式',
      allowDelete: true
    },
    {
      depth: 3,
      allowDelete: true
    }
  ]
}