import { ElButton, ElTag } from 'element-plus'

export default (event: anyObj): TableColumn[] => [
  {
    label: '版本号',
    prop: 'versionNum',
    width: 100,
  },
  {
    label: '更新类型',
    prop: 'updateType',
    width: 100,
    render: (h, scope) => (
      <ElTag type={scope.row.updateType === 1 ? 'primary' : 'success'}>
        {scope.row.updateType === 1 ? 'WEB' : 'APK'}
      </ElTag>
    ),
  },
  {
    label: '型号',
    prop: 'model',
    width: 100,
  },
  {
    label: '下载链接',
    prop: 'downloadLink',
  },
  // {
  //     label: '状态',
  //     prop: 'status',
  //     'min-width': 110,
  //     render: (h, scope) => {
  //         return (
  //             <Switch
  //                 v-model={scope.row.status}
  //                 inactive-value={1}
  //                 active-value={0}
  //                 loading={scope.row.loading}
  //                 before-change={() => event.updateState(scope.row)}
  //             />
  //         );
  //     },
  // },
  {
    label: '创建时间',
    render: (h, scope) => scope.row.createTime,
  },
  {
    label: '操作',
    width: 140,
    render: (h, scope) => (
      <>
        <ElButton onClick={() => event.handleClick(scope.row)} type="danger">
          删除
        </ElButton>
      </>
    ),
  },
]
