1
|
|
-import {defHttp} from '@/utils/external/http/axios';
|
2
|
|
-import {
|
3
|
|
- ContentParams,
|
4
|
|
- ContentResultModel,
|
5
|
|
-} from './model/contentModel';
|
|
1
|
+import { defHttp } from '@/utils/external/http/axios'
|
|
2
|
+import { BaseSaveContentParams, BaseUpdateContentParams } from './model/contentModel'
|
6
|
3
|
|
7
|
|
-import type {ErrorMessageMode} from '/#/external/axios';
|
|
4
|
+import type { ErrorMessageMode } from '/#/external/axios'
|
8
|
5
|
|
9
|
6
|
enum Api {
|
10
|
|
- CONTENT = '/data_view/content',
|
11
|
|
- GET_CONTENT = '/data_view',
|
12
|
|
- FILE_UPLOAD = '/oss/upload'
|
|
7
|
+ //大屏设计器
|
|
8
|
+ DATA_VIEW_CONTENT = '/data_view/content',
|
|
9
|
+ //大屏内容
|
|
10
|
+ DATA_VIEW = '/data_view',
|
|
11
|
+ FILE_UPLOAD = '/oss/upload'
|
13
|
12
|
}
|
14
|
13
|
|
15
|
14
|
/**
|
16
|
|
- * @description: content save api
|
|
15
|
+ * @description: 大屏设计器 update api
|
17
|
16
|
*/
|
18
|
|
-export function contentUpdateApi(params: object, mode: ErrorMessageMode = 'modal') {
|
19
|
|
- return defHttp.put(
|
20
|
|
- {
|
21
|
|
- url: Api.CONTENT,
|
22
|
|
- params,
|
23
|
|
- },
|
24
|
|
- {
|
25
|
|
- errorMessageMode: mode,
|
26
|
|
- }
|
27
|
|
- );
|
|
17
|
+export function contentUpdateApi(params: BaseUpdateContentParams, mode: ErrorMessageMode = 'modal') {
|
|
18
|
+ return defHttp.put<BaseUpdateContentParams>(
|
|
19
|
+ {
|
|
20
|
+ url: Api.DATA_VIEW_CONTENT,
|
|
21
|
+ params
|
|
22
|
+ },
|
|
23
|
+ {
|
|
24
|
+ errorMessageMode: mode
|
|
25
|
+ }
|
|
26
|
+ )
|
28
|
27
|
}
|
|
28
|
+
|
|
29
|
+/**
|
|
30
|
+ * @description: 大屏设计器 save api
|
|
31
|
+ */
|
29
|
32
|
export function contentSaveApi(params: object, mode: ErrorMessageMode = 'modal') {
|
30
|
|
- return defHttp.post(
|
31
|
|
- {
|
32
|
|
- url: Api.CONTENT,
|
33
|
|
- params,
|
34
|
|
- },
|
35
|
|
- {
|
36
|
|
- errorMessageMode: mode,
|
37
|
|
- }
|
38
|
|
- );
|
|
33
|
+ return defHttp.post<BaseSaveContentParams>(
|
|
34
|
+ {
|
|
35
|
+ url: Api.DATA_VIEW_CONTENT,
|
|
36
|
+ params
|
|
37
|
+ },
|
|
38
|
+ {
|
|
39
|
+ errorMessageMode: mode
|
|
40
|
+ }
|
|
41
|
+ )
|
39
|
42
|
}
|
|
43
|
+
|
40
|
44
|
/**
|
41
|
|
- * @description:dataView content get api
|
|
45
|
+ * @description: 大屏设计器 delete api
|
42
|
46
|
*/
|
|
47
|
+export function contentDeleteApi(data: [string], mode: ErrorMessageMode = 'modal') {
|
|
48
|
+ return defHttp.delete(
|
|
49
|
+ {
|
|
50
|
+ url: Api.DATA_VIEW_CONTENT,
|
|
51
|
+ data
|
|
52
|
+ },
|
|
53
|
+ {
|
|
54
|
+ errorMessageMode: mode
|
|
55
|
+ }
|
|
56
|
+ )
|
|
57
|
+}
|
43
|
58
|
|
44
|
|
-export const getDataView = (id: string) => {
|
45
|
|
- return defHttp.get({
|
46
|
|
- url: `${Api.GET_CONTENT}/get_configuration_info/${id}`,
|
47
|
|
- });
|
48
|
|
-};
|
|
59
|
+/**
|
|
60
|
+ * @description:大屏内容 content get api
|
|
61
|
+ */
|
49
|
62
|
|
|
63
|
+export const getDataView = (id: string) => {
|
|
64
|
+ return defHttp.get({
|
|
65
|
+ url: `${Api.DATA_VIEW}/get_configuration_info/${id}`
|
|
66
|
+ })
|
|
67
|
+}
|
50
|
68
|
|
51
|
69
|
/**
|
52
|
|
- * @description: content get api
|
|
70
|
+ * @description: 大屏内容 get api
|
53
|
71
|
*/
|
54
|
72
|
|
55
|
73
|
export const getDataViewList = (params: object) => {
|
56
|
|
- return defHttp.get({
|
57
|
|
- url: `${Api.GET_CONTENT}`,
|
58
|
|
- params
|
59
|
|
- });
|
60
|
|
-};
|
|
74
|
+ return defHttp.get({
|
|
75
|
+ url: `${Api.DATA_VIEW}`,
|
|
76
|
+ params
|
|
77
|
+ })
|
|
78
|
+}
|
61
|
79
|
|
62
|
80
|
/**
|
63
|
81
|
* @description: file Upload
|
64
|
82
|
*/
|
65
|
|
-
|
66
|
|
-
|
67
|
|
-// * 上传文件
|
68
|
83
|
export const uploadFile = async (file: FormData, mode: ErrorMessageMode = 'modal') => {
|
69
|
|
- return defHttp.post({url: Api.FILE_UPLOAD, params: file}, {
|
70
|
|
- errorMessageMode: mode,
|
71
|
|
- });
|
|
84
|
+ return defHttp.post(
|
|
85
|
+ { url: Api.FILE_UPLOAD, params: file },
|
|
86
|
+ {
|
|
87
|
+ errorMessageMode: mode
|
|
88
|
+ }
|
|
89
|
+ )
|
72
|
90
|
} |
73
|
|
- |
...
|
...
|
|