| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- import { BasicColumn } from '/@/components/Table';
- const MANUFACTURER_HIKVISION = 'rtsp://admin:admin123@192.168.0.64:554/Streaming/Channels/1';
- const MANUFACTURER_DAHUA = 'http://0.0.0.0:8080/live/';
- const manufacturerOptions = [
- {
- label: '海康',
- value: MANUFACTURER_HIKVISION,
- },
- {
- label: '大华',
- value: MANUFACTURER_DAHUA,
- },
- ];
- /** 视频流类型 -> 厂家默认值 */
- const deviceKindManufacturerMap: Record<string, string> = {
- rtsp: MANUFACTURER_HIKVISION,
- };
- function syncManufacturerByDeviceKind(value: string, record: Recordable) {
- const manufacturer = deviceKindManufacturerMap[value];
- if (manufacturer && record?.editValueRefs?.label) {
- record.editValueRefs.label.value = manufacturer;
- }
- }
- export const columns = [
- {
- title: '设备id',
- dataIndex: 'deviceid',
- ifShow: false,
- editRow: true,
- textAlign: 'center',
- },
- {
- title: '摄像头名称',
- dataIndex: 'name',
- width: 100,
- editRow: true,
- editRule: true,
- textAlign: 'center',
- editComponent: 'Textarea',
- },
- {
- title: '视频流类型',
- dataIndex: 'devicekind',
- width: 100,
- editRow: true,
- editRule: true,
- editComponent: 'Select',
- textAlign: 'center',
- editComponentProps: {
- options: [
- {
- label: 'rtsp',
- value: 'rtsp',
- },
- {
- label: 'HLS ',
- value: 'HLS',
- },
- {
- label: 'flv',
- value: 'flv',
- },
- {
- label: '园子沟转URL',
- value: 'YZG_URL',
- },
- {
- label: '红柳林code转URl',
- value: 'HLL',
- },
- {
- label: '海康平台转换rtsp',
- value: 'toHKRtsp',
- },
- {
- label: '海康平台转换hls',
- value: 'toHKHLs',
- },
- ],
- },
- onEditChange: ({ value, record }) => {
- syncManufacturerByDeviceKind(value, record);
- },
- },
- {
- title: '摄像头地址',
- dataIndex: 'addr',
- width: 100,
- editRow: true,
- textAlign: 'center',
- editComponent: 'Textarea',
- },
- {
- title: '播放倍速',
- dataIndex: 'cameraRate',
- width: 70,
- editRow: true,
- textAlign: 'center',
- editComponent: 'Select',
- editComponentProps: {
- options: [
- {
- label: '0.5',
- value: 0.5,
- },
- {
- label: '1 ',
- value: 1,
- },
- {
- label: '1.5',
- value: 1.5,
- },
- {
- label: '2',
- value: 2,
- },
- ],
- },
- },
- {
- title: 'IP',
- dataIndex: 'ip',
- width: 100,
- editRow: true,
- editRule: true,
- textAlign: 'center',
- editComponent: 'Textarea',
- },
- {
- title: '端口号',
- width: 70,
- dataIndex: 'port',
- editRow: true,
- editRule: true,
- editComponent: 'InputNumber',
- textAlign: 'center',
- },
- {
- title: '摄像头用户',
- dataIndex: 'username',
- width: 70,
- editRow: true,
- textAlign: 'center',
- },
- {
- title: '控制密码',
- dataIndex: 'password',
- width: 70,
- editRow: true,
- editRule: true,
- textAlign: 'center',
- },
- {
- title: '厂家',
- dataIndex: 'label',
- width: 70,
- editRow: true,
- editRule: true,
- editComponent: 'Select',
- textAlign: 'center',
- editComponentProps: {
- options: manufacturerOptions,
- },
- },
- ];
|