@freelog/tools-lib 0.1.173 → 0.1.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service-API/presentables.d.ts +47 -0
- package/dist/tools-lib.cjs.development.js +76 -12
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +76 -12
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/service-API/presentables.ts +495 -348
- package/src/utils/linkTo.ts +651 -651
|
@@ -1,348 +1,495 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 创建展品
|
|
4
|
-
export interface CreatePresentableParamsType {
|
|
5
|
-
nodeId: number;
|
|
6
|
-
resourceId: string;
|
|
7
|
-
version: string;
|
|
8
|
-
// resolveResources: {
|
|
9
|
-
// resourceId: string;
|
|
10
|
-
// contracts: {
|
|
11
|
-
// policyId: string;
|
|
12
|
-
// }[];
|
|
13
|
-
// }[];
|
|
14
|
-
batchSignContracts?: {
|
|
15
|
-
resourceId: string;
|
|
16
|
-
subjectType: number;
|
|
17
|
-
policyIds: string[];
|
|
18
|
-
}[];
|
|
19
|
-
presentableName: string;
|
|
20
|
-
presentableTitle?: string;
|
|
21
|
-
tags?: string[];
|
|
22
|
-
policies?: {
|
|
23
|
-
policyName: string;
|
|
24
|
-
policyText: string;
|
|
25
|
-
status?: 0 | 1;
|
|
26
|
-
}[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function createPresentable(params: CreatePresentableParamsType) {
|
|
30
|
-
return FUtil.Request({
|
|
31
|
-
method: 'POST',
|
|
32
|
-
url: `/v2/presentables`,
|
|
33
|
-
data: params,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 更新展品
|
|
38
|
-
interface UpdatePresentableParamsType {
|
|
39
|
-
presentableId: string;
|
|
40
|
-
presentableTitle?: string;
|
|
41
|
-
presentableIntro?: string;
|
|
42
|
-
tags?: string[];
|
|
43
|
-
coverImages?: string[];
|
|
44
|
-
addPolicies?: {
|
|
45
|
-
policyName: string;
|
|
46
|
-
policyText: string;
|
|
47
|
-
status?: 0 | 1;
|
|
48
|
-
}[];
|
|
49
|
-
updatePolicies?: {
|
|
50
|
-
policyId: string;
|
|
51
|
-
status: 0 | 1;
|
|
52
|
-
}[];
|
|
53
|
-
resolveResources?: {
|
|
54
|
-
resourceId: string;
|
|
55
|
-
contracts: {
|
|
56
|
-
policyId: string;
|
|
57
|
-
}[];
|
|
58
|
-
}[];
|
|
59
|
-
autoUpdateStatus?: 0 | 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function updatePresentable({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
version
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export function
|
|
230
|
-
return FUtil.Request({
|
|
231
|
-
method: '
|
|
232
|
-
url: `/v2/presentables/${presentableId}/
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
interface
|
|
239
|
-
presentableId: string;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 创建展品
|
|
4
|
+
export interface CreatePresentableParamsType {
|
|
5
|
+
nodeId: number;
|
|
6
|
+
resourceId: string;
|
|
7
|
+
version: string;
|
|
8
|
+
// resolveResources: {
|
|
9
|
+
// resourceId: string;
|
|
10
|
+
// contracts: {
|
|
11
|
+
// policyId: string;
|
|
12
|
+
// }[];
|
|
13
|
+
// }[];
|
|
14
|
+
batchSignContracts?: {
|
|
15
|
+
resourceId: string;
|
|
16
|
+
subjectType: number;
|
|
17
|
+
policyIds: string[];
|
|
18
|
+
}[];
|
|
19
|
+
presentableName: string;
|
|
20
|
+
presentableTitle?: string;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
policies?: {
|
|
23
|
+
policyName: string;
|
|
24
|
+
policyText: string;
|
|
25
|
+
status?: 0 | 1;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createPresentable(params: CreatePresentableParamsType) {
|
|
30
|
+
return FUtil.Request({
|
|
31
|
+
method: 'POST',
|
|
32
|
+
url: `/v2/presentables`,
|
|
33
|
+
data: params,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 更新展品
|
|
38
|
+
interface UpdatePresentableParamsType {
|
|
39
|
+
presentableId: string;
|
|
40
|
+
presentableTitle?: string;
|
|
41
|
+
presentableIntro?: string;
|
|
42
|
+
tags?: string[];
|
|
43
|
+
coverImages?: string[];
|
|
44
|
+
addPolicies?: {
|
|
45
|
+
policyName: string;
|
|
46
|
+
policyText: string;
|
|
47
|
+
status?: 0 | 1;
|
|
48
|
+
}[];
|
|
49
|
+
updatePolicies?: {
|
|
50
|
+
policyId: string;
|
|
51
|
+
status: 0 | 1;
|
|
52
|
+
}[];
|
|
53
|
+
resolveResources?: {
|
|
54
|
+
resourceId: string;
|
|
55
|
+
contracts: {
|
|
56
|
+
policyId: string;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
59
|
+
autoUpdateStatus?: 0 | 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function updatePresentable({
|
|
63
|
+
presentableId,
|
|
64
|
+
...params
|
|
65
|
+
}: UpdatePresentableParamsType) {
|
|
66
|
+
return FUtil.Request({
|
|
67
|
+
method: 'PUT',
|
|
68
|
+
url: `/v2/presentables/${presentableId}`,
|
|
69
|
+
data: params,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// 上下线presentable
|
|
74
|
+
interface PresentablesOnlineParamsType {
|
|
75
|
+
presentableId: string;
|
|
76
|
+
onlineStatus: 0 | 1;
|
|
77
|
+
updatePolicies?: {
|
|
78
|
+
policyId: string;
|
|
79
|
+
status: 0 | 1;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function presentablesOnlineStatus({
|
|
84
|
+
presentableId,
|
|
85
|
+
...params
|
|
86
|
+
}: PresentablesOnlineParamsType) {
|
|
87
|
+
return FUtil.Request({
|
|
88
|
+
method: 'PUT',
|
|
89
|
+
url: `/v2/presentables/${presentableId}/onlineStatus`,
|
|
90
|
+
data: params,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 查看展品详情
|
|
95
|
+
interface PresentableDetailsParamsType1 {
|
|
96
|
+
presentableId: string;
|
|
97
|
+
projection?: string;
|
|
98
|
+
isLoadVersionProperty?: 0 | 1;
|
|
99
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
100
|
+
isTranslate?: 0 | 1;
|
|
101
|
+
isLoadCustomPropertyDescriptors?: 0 | 1;
|
|
102
|
+
isLoadResourceDetailInfo?: 0 | 1;
|
|
103
|
+
isLoadResourceVersionInfo?: 0 | 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface PresentableDetailsParamsType2 {
|
|
107
|
+
nodeId: number;
|
|
108
|
+
resourceId?: string;
|
|
109
|
+
resourceName?: string;
|
|
110
|
+
presentableName?: string;
|
|
111
|
+
projection?: string;
|
|
112
|
+
isLoadVersionProperty?: 0 | 1;
|
|
113
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
114
|
+
isLoadCustomPropertyDescriptors?: 0 | 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function presentableDetails(
|
|
118
|
+
params: PresentableDetailsParamsType1 | PresentableDetailsParamsType2
|
|
119
|
+
) {
|
|
120
|
+
if ((params as PresentableDetailsParamsType2).nodeId) {
|
|
121
|
+
return FUtil.Request({
|
|
122
|
+
method: 'GET',
|
|
123
|
+
url: `/v2/presentables/detail`,
|
|
124
|
+
params: params,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const { presentableId, ...p } = params as PresentableDetailsParamsType1;
|
|
128
|
+
return FUtil.Request({
|
|
129
|
+
method: 'GET',
|
|
130
|
+
url: `/v2/presentables/${presentableId}`,
|
|
131
|
+
params: p,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 查询展品分页列表
|
|
136
|
+
interface PresentablesParamsType {
|
|
137
|
+
nodeId: number;
|
|
138
|
+
skip?: number;
|
|
139
|
+
limit?: number;
|
|
140
|
+
resourceType?: string;
|
|
141
|
+
resourceTypeCode?: string;
|
|
142
|
+
omitResourceType?: string;
|
|
143
|
+
onlineStatus?: number;
|
|
144
|
+
tags?: string;
|
|
145
|
+
projection?: string;
|
|
146
|
+
keywords?: string;
|
|
147
|
+
isLoadVersionProperty?: 0 | 1;
|
|
148
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
149
|
+
isLoadResourceDetailInfo?: 0 | 1;
|
|
150
|
+
isLoadVersionUpdateTip?: 0 | 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function presentables(params: PresentablesParamsType) {
|
|
154
|
+
return FUtil.Request({
|
|
155
|
+
method: 'GET',
|
|
156
|
+
url: `/v2/presentables`,
|
|
157
|
+
params: params,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// 批量查询展品列表
|
|
162
|
+
interface PresentableListParamsType {
|
|
163
|
+
nodeId?: number;
|
|
164
|
+
userId?: number;
|
|
165
|
+
presentableIds?: string;
|
|
166
|
+
resourceIds?: string;
|
|
167
|
+
resourceNames?: string;
|
|
168
|
+
isLoadVersionProperty?: 0 | 1;
|
|
169
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
170
|
+
isTranslate?: 0 | 1;
|
|
171
|
+
projection?: string;
|
|
172
|
+
resolveResourceIds?: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function presentableList(params: PresentableListParamsType) {
|
|
176
|
+
return FUtil.Request({
|
|
177
|
+
method: 'GET',
|
|
178
|
+
url: `/v2/presentables/list`,
|
|
179
|
+
params: params,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 查看展品依赖树
|
|
184
|
+
interface DependencyTreeParamsType {
|
|
185
|
+
presentableId: string;
|
|
186
|
+
maxDeep?: number;
|
|
187
|
+
nid?: string;
|
|
188
|
+
isContainRootNode?: boolean;
|
|
189
|
+
version?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function dependencyTree({
|
|
193
|
+
presentableId,
|
|
194
|
+
...params
|
|
195
|
+
}: DependencyTreeParamsType) {
|
|
196
|
+
return FUtil.Request({
|
|
197
|
+
method: 'GET',
|
|
198
|
+
url: `/v2/presentables/${presentableId}/dependencyTree`,
|
|
199
|
+
params: params,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 查看展品关系树
|
|
204
|
+
interface RelationTreeParamsType {
|
|
205
|
+
presentableId: string;
|
|
206
|
+
version?: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function relationTree({
|
|
210
|
+
presentableId,
|
|
211
|
+
...params
|
|
212
|
+
}: RelationTreeParamsType) {
|
|
213
|
+
return FUtil.Request({
|
|
214
|
+
method: 'GET',
|
|
215
|
+
url: `/v2/presentables/${presentableId}/relationTree`,
|
|
216
|
+
params: params,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// 查看展品授权树
|
|
221
|
+
interface AuthTreeParamsType {
|
|
222
|
+
presentableId: string;
|
|
223
|
+
maxDeep?: number;
|
|
224
|
+
nid?: string;
|
|
225
|
+
isContainRootNode?: boolean;
|
|
226
|
+
version?: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function authTree({ presentableId, ...params }: AuthTreeParamsType) {
|
|
230
|
+
return FUtil.Request({
|
|
231
|
+
method: 'GET',
|
|
232
|
+
url: `/v2/presentables/${presentableId}/authTree`,
|
|
233
|
+
params: params,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// 切换展品版本
|
|
238
|
+
interface PresentablesVersionParamsType {
|
|
239
|
+
presentableId: string;
|
|
240
|
+
version: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function presentablesVersion({
|
|
244
|
+
presentableId,
|
|
245
|
+
...params
|
|
246
|
+
}: PresentablesVersionParamsType) {
|
|
247
|
+
return FUtil.Request({
|
|
248
|
+
method: 'PUT',
|
|
249
|
+
url: `/v2/presentables/${presentableId}/version`,
|
|
250
|
+
data: params,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// 设置展品自定义属性
|
|
255
|
+
interface UpdateRewritePropertyParamsType {
|
|
256
|
+
presentableId: string;
|
|
257
|
+
rewriteProperty: {
|
|
258
|
+
key: string;
|
|
259
|
+
value: string;
|
|
260
|
+
remark: string;
|
|
261
|
+
}[];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function updateRewriteProperty({
|
|
265
|
+
presentableId,
|
|
266
|
+
...params
|
|
267
|
+
}: UpdateRewritePropertyParamsType) {
|
|
268
|
+
return FUtil.Request({
|
|
269
|
+
method: 'PUT',
|
|
270
|
+
url: `/v2/presentables/${presentableId}/rewriteProperty`,
|
|
271
|
+
data: params,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 批量获取展品授权结果
|
|
276
|
+
interface BatchAuthParamsType {
|
|
277
|
+
nodeId: number;
|
|
278
|
+
authType: 1 | 2 | 3; // 1:节点侧授权 2:资源侧授权 3:节点+资源侧授权
|
|
279
|
+
presentableIds: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export function batchAuth({ nodeId, ...params }: BatchAuthParamsType) {
|
|
283
|
+
return FUtil.Request({
|
|
284
|
+
method: 'GET',
|
|
285
|
+
url: `/v2/auths/presentables/nodes/${nodeId}/batchAuth/result`,
|
|
286
|
+
params: params,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// 查看合约应用的展品列表
|
|
291
|
+
interface ContractAppliedPresentableParamsType {
|
|
292
|
+
nodeId: number;
|
|
293
|
+
contractIds: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function contractAppliedPresentable({
|
|
297
|
+
nodeId,
|
|
298
|
+
...params
|
|
299
|
+
}: ContractAppliedPresentableParamsType) {
|
|
300
|
+
return FUtil.Request({
|
|
301
|
+
method: 'GET',
|
|
302
|
+
url: `/v2/presentables/${nodeId}/contractAppliedPresentable`,
|
|
303
|
+
params: params,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// 一键批量创建展品
|
|
308
|
+
export interface BatchCreatePresentableParamsType {
|
|
309
|
+
nodeId: number;
|
|
310
|
+
resources: {
|
|
311
|
+
resourceId: string;
|
|
312
|
+
policyId?: string;
|
|
313
|
+
}[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export function batchCreatePresentable(
|
|
317
|
+
params: BatchCreatePresentableParamsType
|
|
318
|
+
) {
|
|
319
|
+
return FUtil.Request({
|
|
320
|
+
method: 'POST',
|
|
321
|
+
url: `/v2/presentables/createPresentableBatchEasy`,
|
|
322
|
+
data: params,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// 批量更新展品
|
|
327
|
+
interface BatchUpdatePresentableParamsType {
|
|
328
|
+
presentableIds: string[];
|
|
329
|
+
addPolicies: {
|
|
330
|
+
policyName: string;
|
|
331
|
+
policyText: string;
|
|
332
|
+
status?: 0 | 1;
|
|
333
|
+
}[];
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export function batchUpdatePresentable({
|
|
337
|
+
...params
|
|
338
|
+
}: BatchUpdatePresentableParamsType) {
|
|
339
|
+
return FUtil.Request({
|
|
340
|
+
method: 'PUT',
|
|
341
|
+
url: `/v2/presentables/updatePresentableBatch`,
|
|
342
|
+
data: params,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// 批量切换展品上下线状态
|
|
347
|
+
interface BatchUpdatePresentableStatusParamsType {
|
|
348
|
+
presentableIds: string[];
|
|
349
|
+
onlineStatus: 0 | 1;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function batchUpdatePresentableStatus({
|
|
353
|
+
...params
|
|
354
|
+
}: BatchUpdatePresentableStatusParamsType) {
|
|
355
|
+
return FUtil.Request({
|
|
356
|
+
method: 'PUT',
|
|
357
|
+
url: `/v2/presentables/updatePresentableOnlineStatusBatch`,
|
|
358
|
+
data: params,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// 忽略展品更新提醒
|
|
363
|
+
interface IgnorePresentableVersionUpdateTipParamsType {
|
|
364
|
+
presentableId: string;
|
|
365
|
+
ignoreVersion: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function ignorePresentableVersionUpdateTip({
|
|
369
|
+
presentableId,
|
|
370
|
+
...params
|
|
371
|
+
}: IgnorePresentableVersionUpdateTipParamsType) {
|
|
372
|
+
return FUtil.Request({
|
|
373
|
+
method: 'POST',
|
|
374
|
+
url: `/v2/presentables/${presentableId}/ignorePresentableVersionUpdateTip`,
|
|
375
|
+
data: params,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// 创建展品合集
|
|
380
|
+
interface CreatePresentableCollectionParamsType {
|
|
381
|
+
nodeId: number;
|
|
382
|
+
presentableName: string;
|
|
383
|
+
presentableTitle?: string;
|
|
384
|
+
policies?: {
|
|
385
|
+
policyName: string;
|
|
386
|
+
policyText: string;
|
|
387
|
+
status: 0 | 1;
|
|
388
|
+
}[];
|
|
389
|
+
tags?: string[];
|
|
390
|
+
coverImages?: string[];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export function createPresentableCollection({
|
|
394
|
+
...params
|
|
395
|
+
}: CreatePresentableCollectionParamsType) {
|
|
396
|
+
return FUtil.Request({
|
|
397
|
+
method: 'POST',
|
|
398
|
+
url: `/v2/presentables/catalogues`,
|
|
399
|
+
data: params,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// 批量为展品合集添加单品
|
|
404
|
+
interface AddItemsToPresentableCollectionParamsType {
|
|
405
|
+
presentableId: string;
|
|
406
|
+
addCollectionItems: {
|
|
407
|
+
presentableId: string;
|
|
408
|
+
}[];
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export function addItemsToPresentableCollection({
|
|
412
|
+
presentableId,
|
|
413
|
+
...params
|
|
414
|
+
}: AddItemsToPresentableCollectionParamsType) {
|
|
415
|
+
return FUtil.Request({
|
|
416
|
+
method: 'POST',
|
|
417
|
+
url: `/v2/presentables/catalogues/${presentableId}/items`,
|
|
418
|
+
data: params,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// 批量从展品合集中移除单品
|
|
423
|
+
interface RemoveItemsFromPresentableCollectionParamsType {
|
|
424
|
+
presentableId: string;
|
|
425
|
+
removeCollectionItemIds: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export function removeItemsFromPresentableCollection({
|
|
429
|
+
presentableId,
|
|
430
|
+
...params
|
|
431
|
+
}: RemoveItemsFromPresentableCollectionParamsType) {
|
|
432
|
+
return FUtil.Request({
|
|
433
|
+
method: 'DELETE',
|
|
434
|
+
url: `/v2/presentables/catalogues/${presentableId}/items`,
|
|
435
|
+
params: params,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// 查询展品合集中的单品分页列表
|
|
440
|
+
interface GetItemsFromPresentableCollectionParamsType {
|
|
441
|
+
presentableId: string;
|
|
442
|
+
isLoadLatestVersionInfo?: 0 | 1;
|
|
443
|
+
skip?: number;
|
|
444
|
+
limit?: number;
|
|
445
|
+
keywords?: number;
|
|
446
|
+
sortField?: 'createDate' | 'sortId';
|
|
447
|
+
sortType?: -1 | 1;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export function getItemsFromPresentableCollection({
|
|
451
|
+
presentableId,
|
|
452
|
+
...params
|
|
453
|
+
}: GetItemsFromPresentableCollectionParamsType) {
|
|
454
|
+
return FUtil.Request({
|
|
455
|
+
method: 'GET',
|
|
456
|
+
url: `/v2/presentables/catalogues/${presentableId}/items`,
|
|
457
|
+
params: params,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// 设置展品合集中的单品排序-手动排序
|
|
462
|
+
interface SetItemsSortFromPresentableCollectionManualParamsType {
|
|
463
|
+
presentableId: string;
|
|
464
|
+
sortIds: string[];
|
|
465
|
+
targetSortId: number;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export function setItemsSortFromPresentableCollectionManual({
|
|
469
|
+
presentableId,
|
|
470
|
+
...params
|
|
471
|
+
}: SetItemsSortFromPresentableCollectionManualParamsType) {
|
|
472
|
+
return FUtil.Request({
|
|
473
|
+
method: 'PUT',
|
|
474
|
+
url: `/v2/presentables/catalogues/${presentableId}/manualSort`,
|
|
475
|
+
data: params,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// 设置展品合集中的单品排序-快速排序
|
|
480
|
+
interface SetItemsSortFromPresentableCollectionQuickParamsType {
|
|
481
|
+
presentableId: string;
|
|
482
|
+
sortIds: string[];
|
|
483
|
+
targetSortId: number;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export function setItemsSortFromPresentableCollectionQuick({
|
|
487
|
+
presentableId,
|
|
488
|
+
...params
|
|
489
|
+
}: SetItemsSortFromPresentableCollectionQuickParamsType) {
|
|
490
|
+
return FUtil.Request({
|
|
491
|
+
method: 'PUT',
|
|
492
|
+
url: `/v2/presentables/catalogues/${presentableId}/manualSort`,
|
|
493
|
+
data: params,
|
|
494
|
+
});
|
|
495
|
+
}
|