config.ts 918 Bytes
import { h } from 'vue';
import { BasicColumn, FormSchema } from '/@/components/Table';
import { Tag } from 'ant-design-vue';

export const configColumns: BasicColumn[] = [
  {
    title: '通道编号',
    dataIndex: 'channellNumber',
  },
  {
    title: '设备名称',
    dataIndex: 'deviceName',
  },
  {
    title: '通道名称',
    dataIndex: 'channelName',
  },
  {
    title: '厂家',
    dataIndex: 'manufacturer',
  },
  {
    title: '开启音频',
    dataIndex: 'turnOnAudio',
    slots: { customRender: 'turnOnAudio' },
  },
  {
    title: '状态',
    dataIndex: 'state',
    format: (text) => {
      return h(
        Tag,
        {
          color: Number(text) === 1 ? 'green' : 'blue',
        },
        () => (Number(text) === 1 ? '在线' : '离线')
      );
    },
  },
  {
    title: '操作',
    dataIndex: 'action',
  },
];

export const searchFormSchema: FormSchema[] | any = [{}];