import { h } from 'vue';
import { ElTag } from 'element-plus';

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id'
  },
  {
    label: '数据源名称',
    prop: 'name',
  },
  {
    label: '数据库类型',
    prop: 'dbType',
    render(record) {
      let typeText = ''
      switch (record.row.dbType) {
        case 1:
          typeText='MySQL'
          break;
        case 2:
          typeText='PostgreSQL'
          break;
        case 3:
          typeText='SQLServer'
          break;
        case 4:
          typeText='Oracle'
          break;
        case 5:
          typeText='Sqlite'
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    label: '数据源编码',
    prop: 'code',
  },
  {
    label: '数据库名称',
    prop: 'dbName',
  },
  {
    label: '数据源地址',
    prop: 'dbUrl',
  },
];
