config.ts
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { h } from 'vue';
import { BasicColumn, FormSchema } from '/@/components/Table';
import { Tag } from 'ant-design-vue';
import { withInstall } from '/@/utils/index';
import VideoPlay from './video.vue';
export const Video = withInstall(VideoPlay);
enum ChannelStatusEnum {
  ONLINE = 'ONLINE',
}
export const configColumns: BasicColumn[] = [
  {
    title: '通道编号',
    dataIndex: 'cameraCode',
  },
  {
    title: '通道名称',
    dataIndex: 'name',
  },
  {
    title: '型号',
    dataIndex: 'model',
  },
  {
    title: '厂商',
    dataIndex: 'manufacturer',
  },
  // {
  //   title: '开启音频',
  //   dataIndex: 'hasAudio',
  //   slots: { customRender: 'hasAudio' },
  // },
  {
    title: '状态',
    dataIndex: 'status',
    customRender: ({ text }: { text: ChannelStatusEnum }) => {
      return h(
        Tag,
        {
          color: text === ChannelStatusEnum.ONLINE ? 'green' : 'blue',
        },
        () => (text === ChannelStatusEnum.ONLINE ? '在线' : '离线')
      );
    },
  },
  {
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
  },
];
export const searchFormSchema: FormSchema[] | any = [
  {
    field: 'name',
    label: '通道名称',
    component: 'Input',
    colProps: { span: 6 },
    componentProps: {
      maxLength: 255,
      placeholder: '请输入通道名称',
    },
  },
  {
    field: 'cameraCode',
    label: '国标编号',
    component: 'Input',
    colProps: { span: 6 },
    componentProps: {
      placeholder: '请输入国标编号',
    },
  },
];