Showing
4 changed files
with
191 additions
and
5 deletions
src/api/report/model/reportModel.ts
0 → 100644
1 | +import { BasicPageParams } from '/@/api/model/baseModel'; | ||
2 | +export type CameraQueryParam = BasicPageParams & CameraParam; | ||
3 | + | ||
4 | +export type CameraParam = { | ||
5 | + status: true; | ||
6 | + name: string; | ||
7 | + organizationId: string; | ||
8 | + orderFiled: string; | ||
9 | + orderType: string; | ||
10 | +}; | ||
11 | + | ||
12 | +export interface CameraModel { | ||
13 | + accessMode: number; | ||
14 | + avatar?: string; | ||
15 | + brand: string; | ||
16 | + createTime?: '2022-04-19T11:33:13.113Z'; | ||
17 | + creator?: string; | ||
18 | + defaultConfig?: string; | ||
19 | + description?: string; | ||
20 | + deviceInfo?: string; | ||
21 | + deviceType?: string; | ||
22 | + enabled?: true; | ||
23 | + icon?: string; | ||
24 | + id?: string; | ||
25 | + name: string; | ||
26 | + organizationId: string; | ||
27 | + organizationName?: string; | ||
28 | + roleIds?: ['string']; | ||
29 | + sn: string; | ||
30 | + status?: false; | ||
31 | + tenantExpireTime?: '2022-04-19T11:33:13.113Z'; | ||
32 | + tenantId?: string; | ||
33 | + tenantProfileId?: string; | ||
34 | + tenantStatus?: 'DISABLED'; | ||
35 | + updateTime?: '2022-04-19T11:33:13.113Z'; | ||
36 | + updater?: string; | ||
37 | + videoUrl: string; | ||
38 | +} | ||
39 | + | ||
40 | +export interface StreamingManageRecord { | ||
41 | + id: string; | ||
42 | + creator: string; | ||
43 | + createTime: string; | ||
44 | + name: string; | ||
45 | + enabled: boolean; | ||
46 | + tenantId: string; | ||
47 | + sn: string; | ||
48 | + organizationId: string; | ||
49 | + organizationName: string; | ||
50 | + status: boolean; | ||
51 | + accessMode: number; | ||
52 | + playProtocol: number; | ||
53 | +} | ||
54 | + | ||
55 | +export interface StreamingMediaModel { | ||
56 | + id: string; | ||
57 | + creator: string; | ||
58 | + createTime: string; | ||
59 | + enabled: boolean; | ||
60 | + tenantId: string; | ||
61 | + type: number; | ||
62 | + host: string; | ||
63 | + appKey: string; | ||
64 | + appSecret: string; | ||
65 | + ssl: number; | ||
66 | +} | ||
67 | + | ||
68 | +export interface StreamingQueryParam { | ||
69 | + host?: string; | ||
70 | +} | ||
71 | + | ||
72 | +export interface StreamingSubmitParam { | ||
73 | + type: number; | ||
74 | + ssl: number; | ||
75 | + host: string; | ||
76 | + appKey: string; | ||
77 | + appSecret: string; | ||
78 | + id?: string; | ||
79 | +} | ||
80 | + | ||
81 | +export interface StreamingMediaDeleteParam { | ||
82 | + tenantId?: string; | ||
83 | + ids: string[]; | ||
84 | +} |
src/api/report/reportManager.ts
0 → 100644
1 | +import { defHttp } from '/@/utils/http/axios'; | ||
2 | +import { | ||
3 | + CameraModel, | ||
4 | + CameraQueryParam, | ||
5 | + StreamingMediaDeleteParam, | ||
6 | + StreamingQueryParam, | ||
7 | + StreamingSubmitParam, | ||
8 | +} from './model/reportModel'; | ||
9 | + | ||
10 | +enum CameraManagerApi { | ||
11 | + CAMERA_POST_URL = '/video', | ||
12 | + CAMERA_GET_URL = '/video', | ||
13 | + CAMERA_DELETE_URL = '/video', | ||
14 | + CAMERA_GET_DETAIL_URL = '/video', | ||
15 | + STREAMING_GET_URL = '/video/platform', | ||
16 | + STREAMING_POST_URL = '/video/platform', | ||
17 | + STREAMING_DELETE_URL = '/video/platform', | ||
18 | + STREAMING_PLAY_GET_URL = '/video/url', | ||
19 | +} | ||
20 | + | ||
21 | +export const cameraPage = (params: CameraQueryParam) => { | ||
22 | + return defHttp.get<CameraQueryParam>({ | ||
23 | + url: CameraManagerApi.CAMERA_GET_URL, | ||
24 | + params, | ||
25 | + }); | ||
26 | +}; | ||
27 | + | ||
28 | +/** | ||
29 | + * 删除视频 | ||
30 | + * @param ids 删除的ids | ||
31 | + */ | ||
32 | +export const deleteCameraManage = (ids: string[]) => { | ||
33 | + return defHttp.delete({ | ||
34 | + url: CameraManagerApi.CAMERA_DELETE_URL, | ||
35 | + data: { | ||
36 | + ids: ids, | ||
37 | + }, | ||
38 | + }); | ||
39 | +}; | ||
40 | + | ||
41 | +// 创建或编辑视频 | ||
42 | +export const createOrEditCameraManage = (data) => { | ||
43 | + return defHttp.post<CameraModel>({ | ||
44 | + url: CameraManagerApi.CAMERA_POST_URL, | ||
45 | + data, | ||
46 | + }); | ||
47 | +}; | ||
48 | + | ||
49 | +// 查询视频详情 | ||
50 | +export const getCameraManageDetail = (id: string) => { | ||
51 | + return defHttp.get({ | ||
52 | + url: CameraManagerApi.CAMERA_GET_DETAIL_URL + `/${id}`, | ||
53 | + }); | ||
54 | +}; | ||
55 | + | ||
56 | +/** | ||
57 | + * @description 获取流媒体列表 | ||
58 | + * @param params | ||
59 | + * @returns | ||
60 | + */ | ||
61 | +export const getStreamingMediaList = (params: StreamingQueryParam) => { | ||
62 | + return defHttp.get({ | ||
63 | + url: CameraManagerApi.STREAMING_GET_URL, | ||
64 | + params, | ||
65 | + }); | ||
66 | +}; | ||
67 | + | ||
68 | +/** | ||
69 | + * @description 更新/新增流媒体记录 | ||
70 | + * @param params | ||
71 | + * @returns | ||
72 | + */ | ||
73 | +export const createOrUpdateStreamingMediaRecord = (params: StreamingSubmitParam) => { | ||
74 | + return defHttp.post({ | ||
75 | + url: CameraManagerApi.STREAMING_POST_URL, | ||
76 | + params, | ||
77 | + }); | ||
78 | +}; | ||
79 | + | ||
80 | +/** | ||
81 | + * @description 删除流媒体记录 | ||
82 | + * @param params | ||
83 | + * @returns | ||
84 | + */ | ||
85 | +export const deleteStreamingMediaRecord = (params: StreamingMediaDeleteParam) => { | ||
86 | + return defHttp.delete({ | ||
87 | + url: CameraManagerApi.STREAMING_POST_URL, | ||
88 | + params, | ||
89 | + }); | ||
90 | +}; | ||
91 | + | ||
92 | +/** | ||
93 | + * @description 获取流媒体播放地址 | ||
94 | + * @param entityId | ||
95 | + * @returns | ||
96 | + */ | ||
97 | +export const getStreamingPlayUrl = (entityId: string) => { | ||
98 | + return defHttp.get({ | ||
99 | + url: `${CameraManagerApi.STREAMING_PLAY_GET_URL}/${entityId}`, | ||
100 | + }); | ||
101 | +}; |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | import { BasicForm, useForm } from '/@/components/Form'; | 15 | import { BasicForm, useForm } from '/@/components/Form'; |
16 | import { formSchema } from './config.data'; | 16 | import { formSchema } from './config.data'; |
17 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 17 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
18 | - import { createOrEditCameraManage } from '/@/api/camera/cameraManager'; | 18 | + // import { createOrEditCameraManage } from '/@/api/camera/cameraManager'; |
19 | import { useMessage } from '/@/hooks/web/useMessage'; | 19 | import { useMessage } from '/@/hooks/web/useMessage'; |
20 | 20 | ||
21 | const emit = defineEmits(['success', 'register']); | 21 | const emit = defineEmits(['success', 'register']); |
@@ -47,10 +47,11 @@ | @@ -47,10 +47,11 @@ | ||
47 | try { | 47 | try { |
48 | const { createMessage } = useMessage(); | 48 | const { createMessage } = useMessage(); |
49 | const values = await validate(); | 49 | const values = await validate(); |
50 | + console.log(values); | ||
50 | if (!values) return; | 51 | if (!values) return; |
51 | let saveMessage = '添加成功'; | 52 | let saveMessage = '添加成功'; |
52 | let updateMessage = '修改成功'; | 53 | let updateMessage = '修改成功'; |
53 | - await createOrEditCameraManage(values); | 54 | + // await createOrEditCameraManage(values); |
54 | closeDrawer(); | 55 | closeDrawer(); |
55 | emit('success'); | 56 | emit('success'); |
56 | createMessage.success(unref(isUpdate) ? updateMessage : saveMessage); | 57 | createMessage.success(unref(isUpdate) ? updateMessage : saveMessage); |
@@ -139,7 +139,6 @@ export const formSchema: QFormSchema[] = [ | @@ -139,7 +139,6 @@ export const formSchema: QFormSchema[] = [ | ||
139 | field: '1', | 139 | field: '1', |
140 | label: '报表名称', | 140 | label: '报表名称', |
141 | colProps: { span: 24 }, | 141 | colProps: { span: 24 }, |
142 | - helpMessage: ['报表配置', '只对拥有数值型属性', '的设备才能配置'], | ||
143 | required: true, | 142 | required: true, |
144 | component: 'Input', | 143 | component: 'Input', |
145 | componentProps: { | 144 | componentProps: { |
@@ -258,7 +257,7 @@ export const formSchema: QFormSchema[] = [ | @@ -258,7 +257,7 @@ export const formSchema: QFormSchema[] = [ | ||
258 | label: '每周', | 257 | label: '每周', |
259 | required: true, | 258 | required: true, |
260 | colProps: { span: 24 }, | 259 | colProps: { span: 24 }, |
261 | - defaultValue: '0 0 0 ? * MON', | 260 | + defaultValue: '0 0 0 ? * 1', |
262 | componentProps: { | 261 | componentProps: { |
263 | placeholder: '请选择周期', | 262 | placeholder: '请选择周期', |
264 | api: findDictItemByCode, | 263 | api: findDictItemByCode, |
@@ -294,7 +293,7 @@ export const formSchema: QFormSchema[] = [ | @@ -294,7 +293,7 @@ export const formSchema: QFormSchema[] = [ | ||
294 | label: '时间', | 293 | label: '时间', |
295 | required: true, | 294 | required: true, |
296 | colProps: { span: 24 }, | 295 | colProps: { span: 24 }, |
297 | - defaultValue: '0 0 0 ? * *', | 296 | + defaultValue: '0 0 0 * * ?', |
298 | componentProps: { | 297 | componentProps: { |
299 | placeholder: '请选择时间', | 298 | placeholder: '请选择时间', |
300 | api: findDictItemByCode, | 299 | api: findDictItemByCode, |
@@ -310,6 +309,7 @@ export const formSchema: QFormSchema[] = [ | @@ -310,6 +309,7 @@ export const formSchema: QFormSchema[] = [ | ||
310 | field: 'entityId', | 309 | field: 'entityId', |
311 | label: '设备', | 310 | label: '设备', |
312 | required: true, | 311 | required: true, |
312 | + helpMessage: ['报表配置只对拥有数值型属性的设备才能配置'], | ||
313 | component: 'Select', | 313 | component: 'Select', |
314 | componentProps: { | 314 | componentProps: { |
315 | placeholder: '请选择设备', | 315 | placeholder: '请选择设备', |