import type { VxeGridProps } from '#/adapter/vxe-table';

const base: VxeGridProps['columns'] = [
  { field: 'name', title: '名称', width: 200 },
  { field: 'point_type', title: '类型', width: 150 },
  { field: 'access', title: '权限', width: 80 },
  { field: 'calculation', title: '公式', width: 100 },
  { field: 'unit', title: '单位', width: 150 },
  { field: 'description', title: '描述' },
];

export const point_table = {
  modbus: [
    { title: '序号', type: 'seq', width: 80 },
    {
      title: '扩展配置',
      children: [
        {
          field: 'protocol_ext.register_type',
          title: '寄存器类型',
          width: 100,
        },
        {
          field: 'protocol_ext.register_address',
          title: '寄存器地址',
          width: 100,
        },
      ],
    },
    ...base,
  ],
};
