@cmstops/pro-compo 3.9.2-alpha.0 → 3.9.2-alpha.10
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/index.css +40 -3
- package/dist/index.min.css +1 -1
- package/es/baseFilter/component.js +71 -14
- package/es/contentDetailList/component.js +24 -0
- package/es/contentDetailList/components/Content/index.js +2 -1
- package/es/contentDetailList/components/Doc/index.js +6 -0
- package/es/hooks/usePopper.d.ts +1 -1
- package/es/hooks/usePopper.js +3 -3
- package/es/hooks/useUpload.d.ts +50 -2
- package/es/hooks/useUpload.js +43 -4
- package/es/index.css +40 -3
- package/es/selectResourceModal/__demo__/module/DivWrapper.d.ts +268 -0
- package/es/selectResourceModal/__demo__/module/basic.d.ts +299 -0
- package/es/selectResourceModal/components/List/ListLocal/index.js +8 -3
- package/es/selectResourceModal/components/List/ListNormal/Filter.js +198 -90
- package/es/selectResourceModal/components/List/ListNormal/index.js +5 -4
- package/es/selectResourceModal/hooks/useResponsiveFilter.d.ts +21 -0
- package/es/selectResourceModal/hooks/useResponsiveFilter.js +142 -0
- package/es/selectResourceModal/style/index.css +40 -3
- package/es/selectResourceModal/style/index.less +9 -0
- package/es/selectResourceModal/style/list.less +39 -3
- package/es/utils/index.js +6 -6
- package/lib/baseFilter/component.js +69 -12
- package/lib/contentDetailList/component.js +24 -0
- package/lib/contentDetailList/components/Content/index.js +2 -1
- package/lib/contentDetailList/components/Doc/index.js +6 -0
- package/lib/hooks/usePopper.js +3 -3
- package/lib/hooks/useUpload.js +43 -3
- package/lib/index.css +40 -3
- package/lib/selectResourceModal/components/List/ListLocal/index.js +6 -1
- package/lib/selectResourceModal/components/List/ListNormal/Filter.js +195 -87
- package/lib/selectResourceModal/components/List/ListNormal/index.js +5 -4
- package/lib/selectResourceModal/hooks/useResponsiveFilter.js +144 -0
- package/lib/selectResourceModal/style/index.css +40 -3
- package/lib/selectResourceModal/style/index.less +9 -0
- package/lib/selectResourceModal/style/list.less +39 -3
- package/lib/utils/index.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, unref, normalizeStyle, createCommentVNode
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, renderSlot, unref, createTextVNode, toDisplayString, normalizeStyle, createCommentVNode } from "vue";
|
|
2
|
+
import { InputGroup, Select, Option, Input, InputSearch, RangePicker, RadioGroup, Radio } from "@arco-design/web-vue";
|
|
3
3
|
import _sfc_main$2 from "./components/filterItem.js";
|
|
4
4
|
import _sfc_main$1 from "./components/FilterGroup.js";
|
|
5
5
|
const _sfc_main = defineComponent({
|
|
@@ -37,9 +37,11 @@ const _sfc_main = defineComponent({
|
|
|
37
37
|
});
|
|
38
38
|
return _columns;
|
|
39
39
|
});
|
|
40
|
-
const getOptions = (
|
|
41
|
-
return item
|
|
42
|
-
|
|
40
|
+
const getOptions = computed(() => {
|
|
41
|
+
return (item) => {
|
|
42
|
+
return item.options ? item.options : [];
|
|
43
|
+
};
|
|
44
|
+
});
|
|
43
45
|
const hasValue = computed(() => {
|
|
44
46
|
return (key) => {
|
|
45
47
|
var _a, _b;
|
|
@@ -76,7 +78,10 @@ const _sfc_main = defineComponent({
|
|
|
76
78
|
_form[column.range] = rangeTemp[column.range];
|
|
77
79
|
} else if (column.component === "select") {
|
|
78
80
|
_form[column.key] = column.defaultValue || null;
|
|
79
|
-
} else {
|
|
81
|
+
} else if (column.component === "input-group") {
|
|
82
|
+
_form[column.selectKey] = column.selectDefaultValue || "";
|
|
83
|
+
_form[column.inputKey] = column.inputDefaultValue || "";
|
|
84
|
+
} else if (column.component) {
|
|
80
85
|
_form[column.key] = column.defaultValue || "";
|
|
81
86
|
}
|
|
82
87
|
});
|
|
@@ -178,17 +183,48 @@ const _sfc_main = defineComponent({
|
|
|
178
183
|
active: hasValue.value(item.key)
|
|
179
184
|
}, {
|
|
180
185
|
default: withCtx(() => [
|
|
181
|
-
item.component === "input" ? (openBlock(), createBlock(unref(
|
|
182
|
-
|
|
186
|
+
item.slot ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input-group" ? (openBlock(), createBlock(unref(InputGroup), { key: 1 }, {
|
|
187
|
+
default: withCtx(() => [
|
|
188
|
+
createVNode(unref(Select), {
|
|
189
|
+
modelValue: form.value[item.selectKey],
|
|
190
|
+
"onUpdate:modelValue": ($event) => form.value[item.selectKey] = $event,
|
|
191
|
+
"default-active-first-option": "",
|
|
192
|
+
style: { "width": "100px" }
|
|
193
|
+
}, {
|
|
194
|
+
default: withCtx(() => [
|
|
195
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.selectOptions, (option, idx) => {
|
|
196
|
+
return openBlock(), createBlock(unref(Option), {
|
|
197
|
+
key: idx,
|
|
198
|
+
value: option.value
|
|
199
|
+
}, {
|
|
200
|
+
default: withCtx(() => [
|
|
201
|
+
createTextVNode(toDisplayString(option.label), 1)
|
|
202
|
+
]),
|
|
203
|
+
_: 2
|
|
204
|
+
}, 1032, ["value"]);
|
|
205
|
+
}), 128))
|
|
206
|
+
]),
|
|
207
|
+
_: 2
|
|
208
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]),
|
|
209
|
+
createVNode(unref(Input), {
|
|
210
|
+
modelValue: form.value[item.inputKey],
|
|
211
|
+
"onUpdate:modelValue": ($event) => form.value[item.inputKey] = $event,
|
|
212
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.inputLabel}`,
|
|
213
|
+
style: { "width": "180px" }
|
|
214
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
215
|
+
]),
|
|
216
|
+
_: 2
|
|
217
|
+
}, 1024)) : item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
|
|
218
|
+
key: 2,
|
|
183
219
|
modelValue: form.value[item.key],
|
|
184
220
|
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
185
221
|
style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
|
|
186
222
|
"allow-clear": "",
|
|
187
223
|
size: "medium",
|
|
188
|
-
placeholder: `\u8BF7\u8F93\u5165${item.label}`
|
|
224
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
|
|
189
225
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : createCommentVNode("v-if", true),
|
|
190
226
|
item.component === "select" ? (openBlock(), createBlock(unref(Select), {
|
|
191
|
-
key:
|
|
227
|
+
key: 3,
|
|
192
228
|
modelValue: form.value[item.key],
|
|
193
229
|
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
194
230
|
"popup-container": "#base-filter-popup-container",
|
|
@@ -196,13 +232,13 @@ const _sfc_main = defineComponent({
|
|
|
196
232
|
"allow-search": item.allowSearch,
|
|
197
233
|
"default-active-first-option": false,
|
|
198
234
|
style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
|
|
199
|
-
placeholder: `\u8BF7\u9009\u62E9${item.label}`,
|
|
235
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
|
|
200
236
|
onSearch: ($event) => handleSelectSearch($event, item),
|
|
201
237
|
onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
|
|
202
238
|
onChange: ($event) => handleSelectChange($event, item)
|
|
203
239
|
}, {
|
|
204
240
|
default: withCtx(() => [
|
|
205
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(getOptions(item), (opt) => {
|
|
241
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getOptions.value(item), (opt) => {
|
|
206
242
|
return openBlock(), createBlock(unref(Option), {
|
|
207
243
|
key: opt.value,
|
|
208
244
|
label: opt.label,
|
|
@@ -213,7 +249,7 @@ const _sfc_main = defineComponent({
|
|
|
213
249
|
_: 2
|
|
214
250
|
}, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : createCommentVNode("v-if", true),
|
|
215
251
|
item.component === "range-picker" ? (openBlock(), createBlock(unref(RangePicker), {
|
|
216
|
-
key:
|
|
252
|
+
key: 4,
|
|
217
253
|
modelValue: form.value[item.key].range,
|
|
218
254
|
"onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
|
|
219
255
|
style: normalizeStyle({ width: styleWidth(form.value[item.key]) }),
|
|
@@ -224,7 +260,28 @@ const _sfc_main = defineComponent({
|
|
|
224
260
|
"popup-container": "#base-filter-popup-container",
|
|
225
261
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
226
262
|
}, ["stop"]))
|
|
227
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true)
|
|
263
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true),
|
|
264
|
+
item.component === "radio" ? (openBlock(), createBlock(unref(RadioGroup), {
|
|
265
|
+
key: 5,
|
|
266
|
+
modelValue: form.value[item.key],
|
|
267
|
+
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
268
|
+
type: "button"
|
|
269
|
+
}, {
|
|
270
|
+
default: withCtx(() => [
|
|
271
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.options || [], (option, idx) => {
|
|
272
|
+
return openBlock(), createBlock(unref(Radio), {
|
|
273
|
+
key: idx,
|
|
274
|
+
value: option.value
|
|
275
|
+
}, {
|
|
276
|
+
default: withCtx(() => [
|
|
277
|
+
createTextVNode(toDisplayString(option.label), 1)
|
|
278
|
+
]),
|
|
279
|
+
_: 2
|
|
280
|
+
}, 1032, ["value"]);
|
|
281
|
+
}), 128))
|
|
282
|
+
]),
|
|
283
|
+
_: 2
|
|
284
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
228
285
|
]),
|
|
229
286
|
_: 2
|
|
230
287
|
}, 1032, ["active"]);
|
|
@@ -104,6 +104,12 @@ const _sfc_main = defineComponent({
|
|
|
104
104
|
onCellMouseEnter: tableCellMouseEnter,
|
|
105
105
|
onCellMouseLeave: tableCellMouseLeave
|
|
106
106
|
}, {
|
|
107
|
+
"after-index": withCtx(() => [
|
|
108
|
+
renderSlot(_ctx.$slots, "after-index", {
|
|
109
|
+
row: element,
|
|
110
|
+
index
|
|
111
|
+
})
|
|
112
|
+
]),
|
|
107
113
|
batch: withCtx(() => [
|
|
108
114
|
renderSlot(_ctx.$slots, "batch", {
|
|
109
115
|
row: element,
|
|
@@ -128,6 +134,12 @@ const _sfc_main = defineComponent({
|
|
|
128
134
|
onCellMouseEnter: tableCellMouseEnter,
|
|
129
135
|
onCellMouseLeave: tableCellMouseLeave
|
|
130
136
|
}, {
|
|
137
|
+
"after-index": withCtx(() => [
|
|
138
|
+
renderSlot(_ctx.$slots, "after-index", {
|
|
139
|
+
row: element,
|
|
140
|
+
index
|
|
141
|
+
})
|
|
142
|
+
]),
|
|
131
143
|
tip: withCtx(() => [
|
|
132
144
|
renderSlot(_ctx.$slots, "tip", {
|
|
133
145
|
row: element,
|
|
@@ -224,6 +236,12 @@ const _sfc_main = defineComponent({
|
|
|
224
236
|
onCellMouseEnter: tableCellMouseEnter,
|
|
225
237
|
onCellMouseLeave: tableCellMouseLeave
|
|
226
238
|
}, {
|
|
239
|
+
"after-index": withCtx(() => [
|
|
240
|
+
renderSlot(_ctx.$slots, "after-index", {
|
|
241
|
+
row: item,
|
|
242
|
+
index
|
|
243
|
+
})
|
|
244
|
+
]),
|
|
227
245
|
batch: withCtx(() => [
|
|
228
246
|
renderSlot(_ctx.$slots, "batch", {
|
|
229
247
|
row: item,
|
|
@@ -248,6 +266,12 @@ const _sfc_main = defineComponent({
|
|
|
248
266
|
onCellMouseEnter: tableCellMouseEnter,
|
|
249
267
|
onCellMouseLeave: tableCellMouseLeave
|
|
250
268
|
}, {
|
|
269
|
+
"after-index": withCtx(() => [
|
|
270
|
+
renderSlot(_ctx.$slots, "after-index", {
|
|
271
|
+
row: item,
|
|
272
|
+
index
|
|
273
|
+
})
|
|
274
|
+
]),
|
|
251
275
|
tip: withCtx(() => [
|
|
252
276
|
renderSlot(_ctx.$slots, "tip", {
|
|
253
277
|
row: item,
|
|
@@ -142,7 +142,8 @@ const _sfc_main = defineComponent({
|
|
|
142
142
|
})
|
|
143
143
|
]),
|
|
144
144
|
index: withCtx(() => [
|
|
145
|
-
createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1)
|
|
145
|
+
createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1),
|
|
146
|
+
renderSlot(_ctx.$slots, "after-index")
|
|
146
147
|
]),
|
|
147
148
|
tip: withCtx(() => [
|
|
148
149
|
createCommentVNode(" \u5148\u6DFB\u52A0\u6587\u4EF6\u8D44\u6E90\uFF0C\u672A\u53D1\u5E03 "),
|
|
@@ -37,6 +37,12 @@ const _sfc_main = defineComponent({
|
|
|
37
37
|
index: _ctx.index
|
|
38
38
|
})
|
|
39
39
|
]),
|
|
40
|
+
"after-index": withCtx(() => [
|
|
41
|
+
renderSlot(_ctx.$slots, "after-index", {
|
|
42
|
+
row: _ctx.element,
|
|
43
|
+
index: _ctx.index
|
|
44
|
+
})
|
|
45
|
+
]),
|
|
40
46
|
batch: withCtx(() => [
|
|
41
47
|
renderSlot(_ctx.$slots, "batch", {
|
|
42
48
|
row: _ctx.item,
|
package/es/hooks/usePopper.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Placement } from '@popperjs/core';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
export default function usePopper(pannel: Ref<HTMLElement | undefined>, triggerEl: Ref<HTMLElement | undefined>): {
|
|
4
|
-
initPopper: (placement?: Placement) => void;
|
|
4
|
+
initPopper: (placement?: Placement, of?: number[] | undefined) => void;
|
|
5
5
|
show: () => void;
|
|
6
6
|
hide: () => void;
|
|
7
7
|
visible: Ref<boolean, boolean>;
|
package/es/hooks/usePopper.js
CHANGED
|
@@ -8,16 +8,16 @@ function usePopper(pannel, triggerEl) {
|
|
|
8
8
|
};
|
|
9
9
|
const show = () => {
|
|
10
10
|
visible.value = true;
|
|
11
|
-
window.onclick = (
|
|
11
|
+
window.onclick = () => {
|
|
12
12
|
hide();
|
|
13
13
|
visible.value = false;
|
|
14
14
|
window.onclick = null;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
const initPopper = (placement = "bottom-start") => {
|
|
17
|
+
const initPopper = (placement = "bottom-start", of) => {
|
|
18
18
|
if (!pannel.value || !triggerEl.value)
|
|
19
19
|
return;
|
|
20
|
-
const offset = [0, 10];
|
|
20
|
+
const offset = of != null ? of : [0, 10];
|
|
21
21
|
if (window.__POWERED_BY_WUJIE__) {
|
|
22
22
|
offset[1] = -54;
|
|
23
23
|
}
|
package/es/hooks/useUpload.d.ts
CHANGED
|
@@ -7,24 +7,72 @@ export declare type TypeAddMediaParam = {
|
|
|
7
7
|
directory_id: number;
|
|
8
8
|
size: number;
|
|
9
9
|
};
|
|
10
|
+
declare type WaterMark = {
|
|
11
|
+
id: string;
|
|
12
|
+
position: string;
|
|
13
|
+
url: string;
|
|
14
|
+
title: string;
|
|
15
|
+
};
|
|
16
|
+
declare type UploadTemplate = {
|
|
17
|
+
watermark?: {
|
|
18
|
+
default?: WaterMark;
|
|
19
|
+
images: WaterMark[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
10
22
|
export declare function getSize(value: number): string;
|
|
11
23
|
export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
24
|
export declare function getMediaDetails(BASE_API: string, repoId: number, id: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
25
|
export declare function reTranscodeMedia(BASE_API: string, media_id: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
26
|
declare type UploadOptions = {
|
|
15
|
-
noAddMedia
|
|
27
|
+
noAddMedia?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare type UploadFileOptions = {
|
|
30
|
+
template?: UploadTemplate;
|
|
16
31
|
};
|
|
17
32
|
export default function useUpload(options?: UploadOptions): {
|
|
18
33
|
list: import("vue").Ref<any[], any[]>;
|
|
19
|
-
uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
|
|
34
|
+
uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined, upOptions?: UploadFileOptions | undefined) => void;
|
|
20
35
|
reTranscode: (BASE_API: string, file: any) => Promise<boolean>;
|
|
21
36
|
transcodingFile: (BASE_API: string, file: any, repoId: number) => void;
|
|
22
37
|
recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
|
|
23
38
|
removeRecord: (file: any) => void;
|
|
24
39
|
};
|
|
40
|
+
export declare function getWatermarkTemplate(BASE_API: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
25
41
|
export declare function useUploadConfig(): {
|
|
26
42
|
config: import("vue").Ref<any, any>;
|
|
43
|
+
template: import("vue").Ref<{
|
|
44
|
+
watermark?: {
|
|
45
|
+
default?: {
|
|
46
|
+
id: string;
|
|
47
|
+
position: string;
|
|
48
|
+
url: string;
|
|
49
|
+
title: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
images: {
|
|
52
|
+
id: string;
|
|
53
|
+
position: string;
|
|
54
|
+
url: string;
|
|
55
|
+
title: string;
|
|
56
|
+
}[];
|
|
57
|
+
} | undefined;
|
|
58
|
+
}, UploadTemplate | {
|
|
59
|
+
watermark?: {
|
|
60
|
+
default?: {
|
|
61
|
+
id: string;
|
|
62
|
+
position: string;
|
|
63
|
+
url: string;
|
|
64
|
+
title: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
images: {
|
|
67
|
+
id: string;
|
|
68
|
+
position: string;
|
|
69
|
+
url: string;
|
|
70
|
+
title: string;
|
|
71
|
+
}[];
|
|
72
|
+
} | undefined;
|
|
73
|
+
}>;
|
|
27
74
|
checkFileSizeOutLimit: (file: File, callback: (msg: string) => void) => boolean;
|
|
28
75
|
initUploadConfig: (BASE_API: string, domainId: number) => Promise<void>;
|
|
76
|
+
initTemplate: (BASE_API: string) => Promise<void>;
|
|
29
77
|
};
|
|
30
78
|
export {};
|
package/es/hooks/useUpload.js
CHANGED
|
@@ -73,7 +73,7 @@ function useUpload(options) {
|
|
|
73
73
|
list.value = originList;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
|
|
76
|
+
const uploadFile = (BASE_API, file, dir = 0, repoId, callback, upOptions) => {
|
|
77
77
|
const newFile = {
|
|
78
78
|
id: file.id || generateUUID(),
|
|
79
79
|
sig_id: file.sig_id || generateUUID(),
|
|
@@ -93,18 +93,24 @@ function useUpload(options) {
|
|
|
93
93
|
};
|
|
94
94
|
const uploading = upload.start(progress);
|
|
95
95
|
uploading.then(async (url) => {
|
|
96
|
+
var _a;
|
|
96
97
|
if (options == null ? void 0 : options.noAddMedia) {
|
|
97
98
|
recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
|
|
98
99
|
callback && callback({ ...newFile, url }, "success");
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
102
|
+
const params = {};
|
|
103
|
+
if ((_a = upOptions == null ? void 0 : upOptions.template) == null ? void 0 : _a.watermark) {
|
|
104
|
+
params.watermark = upOptions.template.watermark.default;
|
|
105
|
+
}
|
|
101
106
|
const { code, message } = await addMedia(BASE_API, {
|
|
102
107
|
url,
|
|
103
108
|
size: newFile.size,
|
|
104
109
|
directory_id: dir,
|
|
105
110
|
repository_id: repoId,
|
|
106
111
|
catalog: newFile.type,
|
|
107
|
-
alias: newFile.name
|
|
112
|
+
alias: newFile.name,
|
|
113
|
+
...params
|
|
108
114
|
});
|
|
109
115
|
if (code !== 0) {
|
|
110
116
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
|
|
@@ -194,9 +200,16 @@ function getConfiguration(BASE_API, params) {
|
|
|
194
200
|
params
|
|
195
201
|
});
|
|
196
202
|
}
|
|
203
|
+
function getWatermarkTemplate(BASE_API) {
|
|
204
|
+
return request(BASE_API, {
|
|
205
|
+
url: `/poplar/v2/material/image/watermark`,
|
|
206
|
+
method: "get"
|
|
207
|
+
});
|
|
208
|
+
}
|
|
197
209
|
function useUploadConfig() {
|
|
198
210
|
const { get, set, remove } = useLocalstorage("LOCAL_UPLOAD_CONFIG");
|
|
199
211
|
const config = ref(get() || {});
|
|
212
|
+
const template = ref({});
|
|
200
213
|
async function initUploadConfig(BASE_API, domainId) {
|
|
201
214
|
if (config.value.size_config_enabled != null)
|
|
202
215
|
return;
|
|
@@ -245,11 +258,37 @@ function useUploadConfig() {
|
|
|
245
258
|
);
|
|
246
259
|
return false;
|
|
247
260
|
}
|
|
261
|
+
async function initTemplate(BASE_API) {
|
|
262
|
+
try {
|
|
263
|
+
const { code, message } = await getWatermarkTemplate(BASE_API);
|
|
264
|
+
if (code !== 0)
|
|
265
|
+
return;
|
|
266
|
+
if (message) {
|
|
267
|
+
let defaultWaterMark;
|
|
268
|
+
if (Array.isArray(message.images)) {
|
|
269
|
+
message.images.forEach((item) => {
|
|
270
|
+
if (message.default === item.id)
|
|
271
|
+
defaultWaterMark = item;
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
template.value = {
|
|
275
|
+
watermark: {
|
|
276
|
+
default: defaultWaterMark,
|
|
277
|
+
images: message.images
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
} catch (e) {
|
|
282
|
+
console.error(e);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
248
285
|
window.addEventListener("beforeunload", remove, false);
|
|
249
286
|
return {
|
|
250
287
|
config,
|
|
288
|
+
template,
|
|
251
289
|
checkFileSizeOutLimit,
|
|
252
|
-
initUploadConfig
|
|
290
|
+
initUploadConfig,
|
|
291
|
+
initTemplate
|
|
253
292
|
};
|
|
254
293
|
}
|
|
255
|
-
export { addMedia, useUpload as default, getMediaDetails, getSize, reTranscodeMedia, useUploadConfig };
|
|
294
|
+
export { addMedia, useUpload as default, getMediaDetails, getSize, getWatermarkTemplate, reTranscodeMedia, useUploadConfig };
|
package/es/index.css
CHANGED
|
@@ -4529,11 +4529,13 @@
|
|
|
4529
4529
|
}
|
|
4530
4530
|
.resource-list-footer,
|
|
4531
4531
|
.resource-list-header,
|
|
4532
|
+
.resource-list-content .resource-list-content-empty,
|
|
4532
4533
|
.resource-list-content .arco-scrollbar-container {
|
|
4533
4534
|
padding: 0 40px;
|
|
4534
4535
|
}
|
|
4535
4536
|
.resource-list-footer {
|
|
4536
4537
|
display: flex;
|
|
4538
|
+
flex-wrap: wrap;
|
|
4537
4539
|
justify-content: space-between;
|
|
4538
4540
|
padding-bottom: 20px;
|
|
4539
4541
|
}
|
|
@@ -4543,6 +4545,10 @@
|
|
|
4543
4545
|
gap: 10px;
|
|
4544
4546
|
align-items: center;
|
|
4545
4547
|
justify-content: flex-end;
|
|
4548
|
+
margin-top: 10px;
|
|
4549
|
+
}
|
|
4550
|
+
.resource-list-footer .footer-right .list-selected-wrapper {
|
|
4551
|
+
font-size: 12px;
|
|
4546
4552
|
}
|
|
4547
4553
|
.resource-list-content-loading {
|
|
4548
4554
|
display: flex;
|
|
@@ -4597,7 +4603,8 @@
|
|
|
4597
4603
|
}
|
|
4598
4604
|
.resource-list .list-filter-wrapper .list-filter-tags {
|
|
4599
4605
|
display: flex;
|
|
4600
|
-
|
|
4606
|
+
flex-wrap: wrap;
|
|
4607
|
+
gap: 10px;
|
|
4601
4608
|
margin-top: 10px;
|
|
4602
4609
|
}
|
|
4603
4610
|
.resource-list .list-filter-wrapper .list-filter-tags .list-filter-tag {
|
|
@@ -4618,16 +4625,41 @@
|
|
|
4618
4625
|
justify-content: space-between;
|
|
4619
4626
|
}
|
|
4620
4627
|
.resource-list .list-filter-wrapper .list-filter .filter-list {
|
|
4628
|
+
position: relative;
|
|
4629
|
+
/** 给 popup 一个参考 */
|
|
4621
4630
|
display: flex;
|
|
4622
|
-
flex-wrap: wrap;
|
|
4623
|
-
gap: 10px;
|
|
4624
4631
|
}
|
|
4625
4632
|
.resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
|
|
4626
4633
|
width: 100px;
|
|
4634
|
+
margin-right: 10px;
|
|
4635
|
+
}
|
|
4636
|
+
.resource-list .list-filter-wrapper .list-filter .filter-list .arco-trigger-popup {
|
|
4637
|
+
z-index: 100000 !important;
|
|
4627
4638
|
}
|
|
4628
4639
|
.resource-list .list-filter-wrapper .list-filter .arco-input-prepend {
|
|
4629
4640
|
padding: 0;
|
|
4630
4641
|
}
|
|
4642
|
+
.resource-list .list-filter-wrapper .list-filter .more-btn {
|
|
4643
|
+
position: relative;
|
|
4644
|
+
/** 给 poperjs 一个参考 */
|
|
4645
|
+
}
|
|
4646
|
+
.resource-list .list-filter-wrapper .list-filter .more-btn .filter-pannel {
|
|
4647
|
+
inset: 40px auto auto auto !important;
|
|
4648
|
+
}
|
|
4649
|
+
.resource-list .list-filter-wrapper .filter-extra {
|
|
4650
|
+
display: flex;
|
|
4651
|
+
gap: 10px;
|
|
4652
|
+
}
|
|
4653
|
+
.resource-list .list-filter-wrapper .filter-pannel {
|
|
4654
|
+
z-index: 100000;
|
|
4655
|
+
display: flex;
|
|
4656
|
+
flex-direction: column;
|
|
4657
|
+
gap: 10px;
|
|
4658
|
+
padding: 10px;
|
|
4659
|
+
background-color: #fff;
|
|
4660
|
+
border-radius: 4px;
|
|
4661
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
4662
|
+
}
|
|
4631
4663
|
.resource-list .title {
|
|
4632
4664
|
display: flex;
|
|
4633
4665
|
gap: 8px;
|
|
@@ -4673,6 +4705,11 @@
|
|
|
4673
4705
|
.resource-select-container .resource-select-header .arco-tabs-content {
|
|
4674
4706
|
display: none !important;
|
|
4675
4707
|
}
|
|
4708
|
+
.resource-select-container .resource-list-content .resource-list-content-empty {
|
|
4709
|
+
box-sizing: border-box;
|
|
4710
|
+
width: 100%;
|
|
4711
|
+
height: 100%;
|
|
4712
|
+
}
|
|
4676
4713
|
.iframe-container {
|
|
4677
4714
|
position: relative;
|
|
4678
4715
|
height: 95vh;
|