|
1
|
import { getCameraList } from '/@/api/camera/cameraManager';
|
1
|
import { getCameraList } from '/@/api/camera/cameraManager';
|
|
2
|
import { CameraModel } from '/@/api/camera/model/cameraModel';
|
2
|
import { CameraModel } from '/@/api/camera/model/cameraModel';
|
|
3
|
import { FormSchema } from '/@/components/Form';
|
3
|
import { FormSchema } from '/@/components/Form';
|
|
|
|
4
|
+import { AccessMode } from '/@/views/camera/manage/config.data';
|
|
4
|
|
5
|
|
|
5
|
export enum FormFieldEnum {
|
6
|
export enum FormFieldEnum {
|
|
6
|
VIDEO_TYPE = 'type',
|
7
|
VIDEO_TYPE = 'type',
|
|
@@ -9,6 +10,9 @@ export enum FormFieldEnum { |
|
@@ -9,6 +10,9 @@ export enum FormFieldEnum { |
|
9
|
ACCESS_MODE = 'accessMode',
|
10
|
ACCESS_MODE = 'accessMode',
|
|
10
|
VIDEO_ID = 'id',
|
11
|
VIDEO_ID = 'id',
|
|
11
|
ORGANIZATION_ID = 'organizationId',
|
12
|
ORGANIZATION_ID = 'organizationId',
|
|
|
|
13
|
+
|
|
|
|
14
|
+ DEVICE_ID = 'deviceId',
|
|
|
|
15
|
+ CHANNEL_ID = 'channelId',
|
|
12
|
}
|
16
|
}
|
|
13
|
|
17
|
|
|
14
|
export interface DataSourceValueType {
|
18
|
export interface DataSourceValueType {
|
|
@@ -40,16 +44,10 @@ export const formSchemas: FormSchema[] = [ |
|
@@ -40,16 +44,10 @@ export const formSchemas: FormSchema[] = [ |
|
40
|
const { setFieldsValue } = formActionType;
|
44
|
const { setFieldsValue } = formActionType;
|
|
41
|
return {
|
45
|
return {
|
|
42
|
placeholder: '请选择视频来源',
|
46
|
placeholder: '请选择视频来源',
|
|
43
|
- options: [
|
|
|
|
44
|
- {
|
|
|
|
45
|
- label: VideoOriginalNameEnum[VideoOriginalEnum.CUSTOM],
|
|
|
|
46
|
- value: VideoOriginalEnum.CUSTOM,
|
|
|
|
47
|
- },
|
|
|
|
48
|
- {
|
|
|
|
49
|
- label: VideoOriginalNameEnum[VideoOriginalEnum.VIDEO_MANAGE],
|
|
|
|
50
|
- value: VideoOriginalEnum.VIDEO_MANAGE,
|
|
|
|
51
|
- },
|
|
|
|
52
|
- ],
|
47
|
+ options: Object.keys(VideoOriginalEnum).map((value) => ({
|
|
|
|
48
|
+ label: VideoOriginalNameEnum[value],
|
|
|
|
49
|
+ value,
|
|
|
|
50
|
+ })),
|
|
53
|
onChange() {
|
51
|
onChange() {
|
|
54
|
setFieldsValue({
|
52
|
setFieldsValue({
|
|
55
|
[FormFieldEnum.ACCESS_MODE]: null,
|
53
|
[FormFieldEnum.ACCESS_MODE]: null,
|
|
@@ -96,6 +94,8 @@ export const formSchemas: FormSchema[] = [ |
|
@@ -96,6 +94,8 @@ export const formSchemas: FormSchema[] = [ |
|
96
|
[FormFieldEnum.ACCESS_MODE]: null,
|
94
|
[FormFieldEnum.ACCESS_MODE]: null,
|
|
97
|
[FormFieldEnum.VIDEO_PLAY_URL]: null,
|
95
|
[FormFieldEnum.VIDEO_PLAY_URL]: null,
|
|
98
|
[FormFieldEnum.VIDEO_ID]: null,
|
96
|
[FormFieldEnum.VIDEO_ID]: null,
|
|
|
|
97
|
+ [FormFieldEnum.DEVICE_ID]: null,
|
|
|
|
98
|
+ [FormFieldEnum.CHANNEL_ID]: null,
|
|
99
|
});
|
99
|
});
|
|
100
|
},
|
100
|
},
|
|
101
|
};
|
101
|
};
|
|
@@ -117,13 +117,30 @@ export const formSchemas: FormSchema[] = [ |
|
@@ -117,13 +117,30 @@ export const formSchemas: FormSchema[] = [ |
|
117
|
labelField: 'name',
|
117
|
labelField: 'name',
|
|
118
|
valueField: 'id',
|
118
|
valueField: 'id',
|
|
119
|
resultField: 'data',
|
119
|
resultField: 'data',
|
|
120
|
- onChange(value: string, options: CameraModel) {
|
120
|
+ onChange(_: string, options: CameraModel) {
|
|
|
|
121
|
+ const accessMode = options?.accessMode;
|
|
121
|
setFieldsValue({
|
122
|
setFieldsValue({
|
|
122
|
- [FormFieldEnum.ACCESS_MODE]: value ? (options || {}).accessMode : null,
|
|
|
|
123
|
- [FormFieldEnum.VIDEO_PLAY_URL]: value ? (options || {}).videoUrl : null,
|
123
|
+ [FormFieldEnum.ACCESS_MODE]: accessMode,
|
|
|
|
124
|
+ [FormFieldEnum.VIDEO_PLAY_URL]: options?.videoUrl,
|
|
|
|
125
|
+ [FormFieldEnum.CHANNEL_ID]:
|
|
|
|
126
|
+ accessMode === AccessMode.GBT28181 ? options.params?.channelNo : null,
|
|
|
|
127
|
+ [FormFieldEnum.DEVICE_ID]:
|
|
|
|
128
|
+ accessMode === AccessMode.GBT28181 ? options.params?.deviceId : null,
|
|
124
|
});
|
129
|
});
|
|
125
|
},
|
130
|
},
|
|
126
|
};
|
131
|
};
|
|
127
|
},
|
132
|
},
|
|
128
|
},
|
133
|
},
|
|
|
|
134
|
+ {
|
|
|
|
135
|
+ field: FormFieldEnum.DEVICE_ID,
|
|
|
|
136
|
+ label: '设备Id',
|
|
|
|
137
|
+ component: 'Input',
|
|
|
|
138
|
+ ifShow: false,
|
|
|
|
139
|
+ },
|
|
|
|
140
|
+ {
|
|
|
|
141
|
+ field: FormFieldEnum.CHANNEL_ID,
|
|
|
|
142
|
+ label: '通道号',
|
|
|
|
143
|
+ component: 'Input',
|
|
|
|
144
|
+ ifShow: false,
|
|
|
|
145
|
+ },
|
|
129
|
]; |
146
|
]; |