@cmstops/pro-compo 0.3.99 → 3.0.0
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 +1 -0
- package/dist/index.min.css +1 -1
- package/es/hooks/useAttachement.d.ts +26 -7
- package/es/hooks/useAttachement.js +49 -2
- package/es/index.css +1 -0
- package/es/selectResourceModal/components/List/ListCardWrapper.js +3 -2
- package/es/selectResourceModal/components/List/ListNormal/Filter.js +36 -15
- package/es/selectResourceModal/style/index.css +1 -0
- package/es/selectResourceModal/style/list.less +1 -0
- package/es/selectThumb/component.js +57 -3
- package/lib/hooks/useAttachement.js +49 -0
- package/lib/index.css +1 -0
- package/lib/selectResourceModal/components/List/ListCardWrapper.js +3 -2
- package/lib/selectResourceModal/components/List/ListNormal/Filter.js +35 -14
- package/lib/selectResourceModal/style/index.css +1 -0
- package/lib/selectResourceModal/style/list.less +1 -0
- package/lib/selectThumb/component.js +56 -2
- package/package.json +1 -1
|
@@ -32,8 +32,9 @@ const _sfc_main = defineComponent({
|
|
|
32
32
|
return false;
|
|
33
33
|
if (filterOptions == null ? void 0 : filterOptions.value) {
|
|
34
34
|
const { mediaType, mediaTypeStrict } = filterOptions.value;
|
|
35
|
-
if (mediaTypeStrict)
|
|
36
|
-
return props.item.catalog
|
|
35
|
+
if (mediaTypeStrict) {
|
|
36
|
+
return mediaType.split(",").includes(props.item.catalog);
|
|
37
|
+
}
|
|
37
38
|
}
|
|
38
39
|
if (props.item.progress >= 0)
|
|
39
40
|
return false;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, inject, computed, ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, Fragment, renderList, createBlock, normalizeClass } from "vue";
|
|
2
|
-
import { Input, Dropdown, Doption, Button, Select, Option, RangePicker } from "@arco-design/web-vue";
|
|
2
|
+
import { Input, Dropdown, Doption, Button, Select, Option, TreeSelect, RangePicker } from "@arco-design/web-vue";
|
|
3
3
|
import { IconUpload } from "@arco-design/web-vue/es/icon";
|
|
4
4
|
import useSelection from "../../../../hooks/useSelection.js";
|
|
5
|
+
import { useDirectory } from "../../../../hooks/useAttachement.js";
|
|
5
6
|
import { RESOURCE_SOURCE_OPTIONS, RESOURCE_CATALOG_OPTIONS } from "../../../../utils/typeMap.js";
|
|
6
7
|
import { getAccountList } from "../../../scripts/selectionApis.js";
|
|
7
8
|
import { keywordsSelection } from "../../../../utils/resource.js";
|
|
@@ -9,7 +10,10 @@ const _hoisted_1 = { class: "list-filter-wrapper" };
|
|
|
9
10
|
const _hoisted_2 = { class: "list-filter" };
|
|
10
11
|
const _hoisted_3 = { class: "filter-list" };
|
|
11
12
|
const _hoisted_4 = { style: { "width": "200px" } };
|
|
12
|
-
const _hoisted_5 = {
|
|
13
|
+
const _hoisted_5 = {
|
|
14
|
+
class: "filter-item",
|
|
15
|
+
style: { "width": "200px" }
|
|
16
|
+
};
|
|
13
17
|
const _hoisted_6 = { class: "filter-item" };
|
|
14
18
|
const _hoisted_7 = {
|
|
15
19
|
key: 0,
|
|
@@ -53,15 +57,19 @@ const _sfc_main = defineComponent({
|
|
|
53
57
|
});
|
|
54
58
|
const resourceSource = RESOURCE_SOURCE_OPTIONS;
|
|
55
59
|
const resourceCatalog = RESOURCE_CATALOG_OPTIONS;
|
|
60
|
+
const { tree, loadMore: loadDirMore } = useDirectory({
|
|
61
|
+
BASE_API: baseAPI
|
|
62
|
+
});
|
|
56
63
|
const originFilter = {
|
|
57
|
-
catalog:
|
|
64
|
+
catalog: [],
|
|
58
65
|
source: "",
|
|
59
66
|
created_begin: "",
|
|
60
67
|
created_end: "",
|
|
61
68
|
keyword: "",
|
|
62
69
|
precise_keyword: "",
|
|
63
70
|
upload_by: null,
|
|
64
|
-
sf: ""
|
|
71
|
+
sf: "",
|
|
72
|
+
directory_id: void 0
|
|
65
73
|
};
|
|
66
74
|
const filter = ref(JSON.parse(JSON.stringify(originFilter)));
|
|
67
75
|
const handleReset = () => {
|
|
@@ -133,6 +141,8 @@ const _sfc_main = defineComponent({
|
|
|
133
141
|
});
|
|
134
142
|
if (!result.catalog)
|
|
135
143
|
result.catalog = "image,video,audio";
|
|
144
|
+
else
|
|
145
|
+
result.catalog = result.catalog.join(",");
|
|
136
146
|
emits("change", result);
|
|
137
147
|
},
|
|
138
148
|
{ deep: true, immediate: true }
|
|
@@ -142,9 +152,9 @@ const _sfc_main = defineComponent({
|
|
|
142
152
|
() => {
|
|
143
153
|
var _a;
|
|
144
154
|
if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
|
|
145
|
-
filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
|
|
155
|
+
filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
|
|
146
156
|
if (filterOptions == null ? void 0 : filterOptions.value.mediaTypeStrict) {
|
|
147
|
-
originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
|
|
157
|
+
originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
|
|
148
158
|
}
|
|
149
159
|
}
|
|
150
160
|
},
|
|
@@ -175,13 +185,13 @@ const _sfc_main = defineComponent({
|
|
|
175
185
|
}, {
|
|
176
186
|
content: withCtx(() => [
|
|
177
187
|
createVNode(unref(Doption), { value: 0 }, {
|
|
178
|
-
default: withCtx(() => _cache[
|
|
188
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
179
189
|
createTextVNode("\u7CBE\u51C6\u641C")
|
|
180
190
|
])),
|
|
181
191
|
_: 1
|
|
182
192
|
}),
|
|
183
193
|
createVNode(unref(Doption), { value: 1 }, {
|
|
184
|
-
default: withCtx(() => _cache[
|
|
194
|
+
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
185
195
|
createTextVNode("\u6A21\u7CCA\u641C")
|
|
186
196
|
])),
|
|
187
197
|
_: 1
|
|
@@ -208,7 +218,8 @@ const _sfc_main = defineComponent({
|
|
|
208
218
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.catalog = $event),
|
|
209
219
|
disabled: (_a = unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
|
|
210
220
|
"allow-clear": "",
|
|
211
|
-
placeholder: "\u7C7B\u578B"
|
|
221
|
+
placeholder: "\u7C7B\u578B",
|
|
222
|
+
multiple: ""
|
|
212
223
|
}, {
|
|
213
224
|
default: withCtx(() => [
|
|
214
225
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(resourceCatalog), (item) => {
|
|
@@ -222,10 +233,20 @@ const _sfc_main = defineComponent({
|
|
|
222
233
|
_: 1
|
|
223
234
|
}, 8, ["modelValue", "disabled"])
|
|
224
235
|
]),
|
|
236
|
+
createCommentVNode(" \u76EE\u5F55 "),
|
|
237
|
+
createVNode(unref(TreeSelect), {
|
|
238
|
+
modelValue: filter.value.directory_id,
|
|
239
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.directory_id = $event),
|
|
240
|
+
data: unref(tree),
|
|
241
|
+
"load-more": unref(loadDirMore),
|
|
242
|
+
placeholder: "\u8BF7\u9009\u62E9\u76EE\u5F55",
|
|
243
|
+
style: { "width": "180px" },
|
|
244
|
+
"allow-clear": ""
|
|
245
|
+
}, null, 8, ["modelValue", "data", "load-more"]),
|
|
225
246
|
createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
|
|
226
247
|
createVNode(unref(RangePicker), {
|
|
227
248
|
modelValue: rangeTime.value,
|
|
228
|
-
"onUpdate:modelValue": _cache[
|
|
249
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
|
|
229
250
|
"allow-clear": "",
|
|
230
251
|
style: { "width": "240px" }
|
|
231
252
|
}, null, 8, ["modelValue"]),
|
|
@@ -233,7 +254,7 @@ const _sfc_main = defineComponent({
|
|
|
233
254
|
createElementVNode("div", _hoisted_6, [
|
|
234
255
|
createVNode(unref(Select), {
|
|
235
256
|
modelValue: filter.value.source,
|
|
236
|
-
"onUpdate:modelValue": _cache[
|
|
257
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
|
|
237
258
|
"allow-clear": "",
|
|
238
259
|
placeholder: "\u6765\u6E90"
|
|
239
260
|
}, {
|
|
@@ -253,7 +274,7 @@ const _sfc_main = defineComponent({
|
|
|
253
274
|
!_ctx.disableUploadBy ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
254
275
|
createVNode(unref(Select), {
|
|
255
276
|
modelValue: filter.value.upload_by,
|
|
256
|
-
"onUpdate:modelValue": _cache[
|
|
277
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
|
|
257
278
|
"allow-clear": "",
|
|
258
279
|
placeholder: "\u4E0A\u4F20\u4EBA",
|
|
259
280
|
loading: unref(loading),
|
|
@@ -278,7 +299,7 @@ const _sfc_main = defineComponent({
|
|
|
278
299
|
type: "text",
|
|
279
300
|
onClick: handleReset
|
|
280
301
|
}, {
|
|
281
|
-
default: withCtx(() => _cache[
|
|
302
|
+
default: withCtx(() => _cache[10] || (_cache[10] = [
|
|
282
303
|
createTextVNode(" \u91CD\u7F6E ")
|
|
283
304
|
])),
|
|
284
305
|
_: 1
|
|
@@ -287,13 +308,13 @@ const _sfc_main = defineComponent({
|
|
|
287
308
|
createElementVNode("div", _hoisted_8, [
|
|
288
309
|
createVNode(unref(Button), {
|
|
289
310
|
type: "primary",
|
|
290
|
-
onClick: _cache[
|
|
311
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
|
|
291
312
|
}, {
|
|
292
313
|
icon: withCtx(() => [
|
|
293
314
|
createVNode(unref(IconUpload))
|
|
294
315
|
]),
|
|
295
316
|
default: withCtx(() => [
|
|
296
|
-
_cache[
|
|
317
|
+
_cache[11] || (_cache[11] = createTextVNode(" \u4E0A\u4F20 "))
|
|
297
318
|
]),
|
|
298
319
|
_: 1
|
|
299
320
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, computed, watch, nextTick, openBlock, createElementBlock, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, Fragment, renderList, createBlock, createVNode, unref, withCtx, createTextVNode } from "vue";
|
|
1
|
+
import { defineComponent, ref, provide, computed, watch, nextTick, onMounted, openBlock, createElementBlock, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, Fragment, renderList, createBlock, createVNode, unref, withCtx, createTextVNode } from "vue";
|
|
2
2
|
import { RadioGroup, Radio, Switch } from "@arco-design/web-vue";
|
|
3
3
|
import { docThumbObjMap, docThumbArrMap } from "../utils/doc.js";
|
|
4
4
|
import _sfc_main$4 from "../imageCrop/component.js";
|
|
@@ -234,7 +234,6 @@ const _sfc_main = defineComponent({
|
|
|
234
234
|
thumbOptionIndex.value = index;
|
|
235
235
|
};
|
|
236
236
|
const openDialogMediaSelection = (type, index) => {
|
|
237
|
-
console.log(type, index, "dkdk");
|
|
238
237
|
thumbBannerModel.value = type || "thumb";
|
|
239
238
|
thumbOptionIndex.value = index || 0;
|
|
240
239
|
dialogMediaSelectionShow.value = true;
|
|
@@ -271,6 +270,16 @@ const _sfc_main = defineComponent({
|
|
|
271
270
|
temp = [{ url: data[0].url, thumb: data[0].url }];
|
|
272
271
|
}
|
|
273
272
|
styleData.value.data = temp;
|
|
273
|
+
styleData.value.cover_url = data[0].url;
|
|
274
|
+
const getColors = getThemeColor(BASE_API, data[0].url);
|
|
275
|
+
getColors.then((themes) => {
|
|
276
|
+
styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
|
|
277
|
+
styleData.value.cover_theme_color = `rgb(${themes[1]})`;
|
|
278
|
+
callback(styleData.value);
|
|
279
|
+
}).catch((e) => {
|
|
280
|
+
styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
|
|
281
|
+
callback(styleData.value);
|
|
282
|
+
});
|
|
274
283
|
} else if (thumbBannerModel.value === "banner") {
|
|
275
284
|
styleData.value.banner_url = data[0].url;
|
|
276
285
|
const getColors = getThemeColor(BASE_API, data[0].url);
|
|
@@ -338,10 +347,13 @@ const _sfc_main = defineComponent({
|
|
|
338
347
|
});
|
|
339
348
|
};
|
|
340
349
|
const modelChange = () => {
|
|
350
|
+
styleData.value.cover_theme_color = "";
|
|
341
351
|
if (!props.dataValue)
|
|
342
352
|
return;
|
|
343
353
|
if (styleData.value.model === oldData.value.model) {
|
|
344
354
|
styleData.value.data = oldData.value.data;
|
|
355
|
+
styleData.value.cover_theme_color = oldData.value.cover_theme_color;
|
|
356
|
+
styleData.value.cover_colorList = oldData.value.cover_colorList;
|
|
345
357
|
} else {
|
|
346
358
|
styleData.value.data = [];
|
|
347
359
|
}
|
|
@@ -354,6 +366,15 @@ const _sfc_main = defineComponent({
|
|
|
354
366
|
},
|
|
355
367
|
set(value) {
|
|
356
368
|
styleData.value.banner_url = value.url;
|
|
369
|
+
styleData.value.cover_colorList = styleData.value.banner_colorList;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
const cover = computed({
|
|
373
|
+
get() {
|
|
374
|
+
const { cover_theme_color } = styleData.value;
|
|
375
|
+
return cover_theme_color;
|
|
376
|
+
},
|
|
377
|
+
set() {
|
|
357
378
|
}
|
|
358
379
|
});
|
|
359
380
|
const hasBanner = computed({
|
|
@@ -366,6 +387,15 @@ const _sfc_main = defineComponent({
|
|
|
366
387
|
callback(styleData.value);
|
|
367
388
|
}
|
|
368
389
|
});
|
|
390
|
+
const hasCover = computed({
|
|
391
|
+
get() {
|
|
392
|
+
return !!cover.value;
|
|
393
|
+
},
|
|
394
|
+
set(value) {
|
|
395
|
+
styleData.value.cover = value;
|
|
396
|
+
callback(styleData.value);
|
|
397
|
+
}
|
|
398
|
+
});
|
|
369
399
|
const pcBanner = computed({
|
|
370
400
|
get() {
|
|
371
401
|
const { pc_banner_url_info, pc_banner_url } = styleData.value;
|
|
@@ -378,6 +408,23 @@ const _sfc_main = defineComponent({
|
|
|
378
408
|
const colorChange = (styleData2) => {
|
|
379
409
|
callback(styleData2);
|
|
380
410
|
};
|
|
411
|
+
onMounted(() => {
|
|
412
|
+
if (!styleData.value.cover_url) {
|
|
413
|
+
setTimeout(() => {
|
|
414
|
+
styleData.value.cover_url = styleData.value.data[0].url;
|
|
415
|
+
const getColors = getThemeColor(BASE_API, styleData.value.data[0].url);
|
|
416
|
+
getColors.then((themes) => {
|
|
417
|
+
styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
|
|
418
|
+
styleData.value.cover_theme_color = `rgb(${themes[1]})`;
|
|
419
|
+
oldData.value = JSON.parse(JSON.stringify(styleData.value));
|
|
420
|
+
callback(styleData.value);
|
|
421
|
+
}).catch((e) => {
|
|
422
|
+
styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
|
|
423
|
+
callback(styleData.value);
|
|
424
|
+
});
|
|
425
|
+
}, 700);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
381
428
|
return (_ctx, _cache) => {
|
|
382
429
|
var _a, _b, _c, _d, _e, _f;
|
|
383
430
|
return openBlock(), createElementBlock("div", {
|
|
@@ -470,7 +517,14 @@ const _sfc_main = defineComponent({
|
|
|
470
517
|
]),
|
|
471
518
|
_: 1
|
|
472
519
|
}, 8, ["modelValue"])
|
|
473
|
-
], 64)) : createCommentVNode("v-if", true)
|
|
520
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
521
|
+
hasCover.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
522
|
+
key: 3,
|
|
523
|
+
"style-data": styleData.value,
|
|
524
|
+
model: "cover",
|
|
525
|
+
style: { "margin-top": "10px" },
|
|
526
|
+
onChange: colorChange
|
|
527
|
+
}, null, 8, ["style-data"])) : createCommentVNode("v-if", true)
|
|
474
528
|
])
|
|
475
529
|
], 2),
|
|
476
530
|
_ctx.mode === "doc" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
@@ -110,9 +110,58 @@ function getSysRsPage(BASE_API, params) {
|
|
|
110
110
|
params
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
function getDirectory(BASE_API, params) {
|
|
114
|
+
return request(BASE_API, {
|
|
115
|
+
url: "/poplar/v3/directories",
|
|
116
|
+
method: "get",
|
|
117
|
+
params
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function useDirectory(options) {
|
|
121
|
+
const tree = vue.ref([]);
|
|
122
|
+
async function loadDirTree(parent_id) {
|
|
123
|
+
const params = parent_id ? { parent_id } : {};
|
|
124
|
+
const { code, message } = await getDirectory(options.BASE_API, params);
|
|
125
|
+
if (code === 0) {
|
|
126
|
+
if (!Array.isArray(message.data))
|
|
127
|
+
return [];
|
|
128
|
+
return message.data.map(({ alias, id }) => {
|
|
129
|
+
return {
|
|
130
|
+
title: alias,
|
|
131
|
+
key: id,
|
|
132
|
+
isLeaf: false,
|
|
133
|
+
children: []
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
async function init() {
|
|
140
|
+
const result = await loadDirTree();
|
|
141
|
+
if (!Array.isArray(result))
|
|
142
|
+
return;
|
|
143
|
+
tree.value = result;
|
|
144
|
+
}
|
|
145
|
+
async function loadMore(target) {
|
|
146
|
+
const children = await loadDirTree(target.key);
|
|
147
|
+
target.children = children;
|
|
148
|
+
if (children.length === 0)
|
|
149
|
+
target.isLeaf = true;
|
|
150
|
+
}
|
|
151
|
+
vue.onMounted(() => {
|
|
152
|
+
init();
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
tree,
|
|
156
|
+
init,
|
|
157
|
+
loadMore
|
|
158
|
+
};
|
|
159
|
+
}
|
|
113
160
|
exports["default"] = useAttachement;
|
|
114
161
|
exports.getAttachmentsAll = getAttachmentsAll;
|
|
115
162
|
exports.getAttachmentsMy = getAttachmentsMy;
|
|
116
163
|
exports.getAttachmentsMyMessage = getAttachmentsMyMessage;
|
|
164
|
+
exports.getDirectory = getDirectory;
|
|
117
165
|
exports.getSysRsByTag = getSysRsByTag;
|
|
118
166
|
exports.getSysRsPage = getSysRsPage;
|
|
167
|
+
exports.useDirectory = useDirectory;
|
package/lib/index.css
CHANGED
|
@@ -33,8 +33,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
33
33
|
return false;
|
|
34
34
|
if (filterOptions == null ? void 0 : filterOptions.value) {
|
|
35
35
|
const { mediaType, mediaTypeStrict } = filterOptions.value;
|
|
36
|
-
if (mediaTypeStrict)
|
|
37
|
-
return props.item.catalog
|
|
36
|
+
if (mediaTypeStrict) {
|
|
37
|
+
return mediaType.split(",").includes(props.item.catalog);
|
|
38
|
+
}
|
|
38
39
|
}
|
|
39
40
|
if (props.item.progress >= 0)
|
|
40
41
|
return false;
|
|
@@ -3,6 +3,7 @@ var vue = require("vue");
|
|
|
3
3
|
var webVue = require("@arco-design/web-vue");
|
|
4
4
|
var icon = require("@arco-design/web-vue/es/icon");
|
|
5
5
|
var useSelection = require("../../../../hooks/useSelection.js");
|
|
6
|
+
var useAttachement = require("../../../../hooks/useAttachement.js");
|
|
6
7
|
var typeMap = require("../../../../utils/typeMap.js");
|
|
7
8
|
var selectionApis = require("../../../scripts/selectionApis.js");
|
|
8
9
|
var resource = require("../../../../utils/resource.js");
|
|
@@ -10,7 +11,10 @@ const _hoisted_1 = { class: "list-filter-wrapper" };
|
|
|
10
11
|
const _hoisted_2 = { class: "list-filter" };
|
|
11
12
|
const _hoisted_3 = { class: "filter-list" };
|
|
12
13
|
const _hoisted_4 = { style: { "width": "200px" } };
|
|
13
|
-
const _hoisted_5 = {
|
|
14
|
+
const _hoisted_5 = {
|
|
15
|
+
class: "filter-item",
|
|
16
|
+
style: { "width": "200px" }
|
|
17
|
+
};
|
|
14
18
|
const _hoisted_6 = { class: "filter-item" };
|
|
15
19
|
const _hoisted_7 = {
|
|
16
20
|
key: 0,
|
|
@@ -54,15 +58,19 @@ const _sfc_main = vue.defineComponent({
|
|
|
54
58
|
});
|
|
55
59
|
const resourceSource = typeMap.RESOURCE_SOURCE_OPTIONS;
|
|
56
60
|
const resourceCatalog = typeMap.RESOURCE_CATALOG_OPTIONS;
|
|
61
|
+
const { tree, loadMore: loadDirMore } = useAttachement.useDirectory({
|
|
62
|
+
BASE_API: baseAPI
|
|
63
|
+
});
|
|
57
64
|
const originFilter = {
|
|
58
|
-
catalog:
|
|
65
|
+
catalog: [],
|
|
59
66
|
source: "",
|
|
60
67
|
created_begin: "",
|
|
61
68
|
created_end: "",
|
|
62
69
|
keyword: "",
|
|
63
70
|
precise_keyword: "",
|
|
64
71
|
upload_by: null,
|
|
65
|
-
sf: ""
|
|
72
|
+
sf: "",
|
|
73
|
+
directory_id: void 0
|
|
66
74
|
};
|
|
67
75
|
const filter = vue.ref(JSON.parse(JSON.stringify(originFilter)));
|
|
68
76
|
const handleReset = () => {
|
|
@@ -134,6 +142,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
134
142
|
});
|
|
135
143
|
if (!result.catalog)
|
|
136
144
|
result.catalog = "image,video,audio";
|
|
145
|
+
else
|
|
146
|
+
result.catalog = result.catalog.join(",");
|
|
137
147
|
emits("change", result);
|
|
138
148
|
},
|
|
139
149
|
{ deep: true, immediate: true }
|
|
@@ -143,9 +153,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
143
153
|
() => {
|
|
144
154
|
var _a;
|
|
145
155
|
if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
|
|
146
|
-
filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
|
|
156
|
+
filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
|
|
147
157
|
if (filterOptions == null ? void 0 : filterOptions.value.mediaTypeStrict) {
|
|
148
|
-
originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
|
|
158
|
+
originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
|
|
149
159
|
}
|
|
150
160
|
}
|
|
151
161
|
},
|
|
@@ -176,13 +186,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
176
186
|
}, {
|
|
177
187
|
content: vue.withCtx(() => [
|
|
178
188
|
vue.createVNode(vue.unref(webVue.Doption), { value: 0 }, {
|
|
179
|
-
default: vue.withCtx(() => _cache[
|
|
189
|
+
default: vue.withCtx(() => _cache[8] || (_cache[8] = [
|
|
180
190
|
vue.createTextVNode("\u7CBE\u51C6\u641C")
|
|
181
191
|
])),
|
|
182
192
|
_: 1
|
|
183
193
|
}),
|
|
184
194
|
vue.createVNode(vue.unref(webVue.Doption), { value: 1 }, {
|
|
185
|
-
default: vue.withCtx(() => _cache[
|
|
195
|
+
default: vue.withCtx(() => _cache[9] || (_cache[9] = [
|
|
186
196
|
vue.createTextVNode("\u6A21\u7CCA\u641C")
|
|
187
197
|
])),
|
|
188
198
|
_: 1
|
|
@@ -209,7 +219,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
209
219
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.catalog = $event),
|
|
210
220
|
disabled: (_a = vue.unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
|
|
211
221
|
"allow-clear": "",
|
|
212
|
-
placeholder: "\u7C7B\u578B"
|
|
222
|
+
placeholder: "\u7C7B\u578B",
|
|
223
|
+
multiple: ""
|
|
213
224
|
}, {
|
|
214
225
|
default: vue.withCtx(() => [
|
|
215
226
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(resourceCatalog), (item) => {
|
|
@@ -223,10 +234,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
223
234
|
_: 1
|
|
224
235
|
}, 8, ["modelValue", "disabled"])
|
|
225
236
|
]),
|
|
237
|
+
vue.createCommentVNode(" \u76EE\u5F55 "),
|
|
238
|
+
vue.createVNode(vue.unref(webVue.TreeSelect), {
|
|
239
|
+
modelValue: filter.value.directory_id,
|
|
240
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.directory_id = $event),
|
|
241
|
+
data: vue.unref(tree),
|
|
242
|
+
"load-more": vue.unref(loadDirMore),
|
|
243
|
+
placeholder: "\u8BF7\u9009\u62E9\u76EE\u5F55",
|
|
244
|
+
style: { "width": "180px" },
|
|
245
|
+
"allow-clear": ""
|
|
246
|
+
}, null, 8, ["modelValue", "data", "load-more"]),
|
|
226
247
|
vue.createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
|
|
227
248
|
vue.createVNode(vue.unref(webVue.RangePicker), {
|
|
228
249
|
modelValue: rangeTime.value,
|
|
229
|
-
"onUpdate:modelValue": _cache[
|
|
250
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
|
|
230
251
|
"allow-clear": "",
|
|
231
252
|
style: { "width": "240px" }
|
|
232
253
|
}, null, 8, ["modelValue"]),
|
|
@@ -234,7 +255,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
234
255
|
vue.createElementVNode("div", _hoisted_6, [
|
|
235
256
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
236
257
|
modelValue: filter.value.source,
|
|
237
|
-
"onUpdate:modelValue": _cache[
|
|
258
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
|
|
238
259
|
"allow-clear": "",
|
|
239
260
|
placeholder: "\u6765\u6E90"
|
|
240
261
|
}, {
|
|
@@ -254,7 +275,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
254
275
|
!_ctx.disableUploadBy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
255
276
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
256
277
|
modelValue: filter.value.upload_by,
|
|
257
|
-
"onUpdate:modelValue": _cache[
|
|
278
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
|
|
258
279
|
"allow-clear": "",
|
|
259
280
|
placeholder: "\u4E0A\u4F20\u4EBA",
|
|
260
281
|
loading: vue.unref(loading),
|
|
@@ -279,7 +300,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
279
300
|
type: "text",
|
|
280
301
|
onClick: handleReset
|
|
281
302
|
}, {
|
|
282
|
-
default: vue.withCtx(() => _cache[
|
|
303
|
+
default: vue.withCtx(() => _cache[10] || (_cache[10] = [
|
|
283
304
|
vue.createTextVNode(" \u91CD\u7F6E ")
|
|
284
305
|
])),
|
|
285
306
|
_: 1
|
|
@@ -288,13 +309,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
288
309
|
vue.createElementVNode("div", _hoisted_8, [
|
|
289
310
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
290
311
|
type: "primary",
|
|
291
|
-
onClick: _cache[
|
|
312
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
|
|
292
313
|
}, {
|
|
293
314
|
icon: vue.withCtx(() => [
|
|
294
315
|
vue.createVNode(vue.unref(icon.IconUpload))
|
|
295
316
|
]),
|
|
296
317
|
default: vue.withCtx(() => [
|
|
297
|
-
_cache[
|
|
318
|
+
_cache[11] || (_cache[11] = vue.createTextVNode(" \u4E0A\u4F20 "))
|
|
298
319
|
]),
|
|
299
320
|
_: 1
|
|
300
321
|
})
|
|
@@ -235,7 +235,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
235
235
|
thumbOptionIndex.value = index2;
|
|
236
236
|
};
|
|
237
237
|
const openDialogMediaSelection = (type, index2) => {
|
|
238
|
-
console.log(type, index2, "dkdk");
|
|
239
238
|
thumbBannerModel.value = type || "thumb";
|
|
240
239
|
thumbOptionIndex.value = index2 || 0;
|
|
241
240
|
dialogMediaSelectionShow.value = true;
|
|
@@ -272,6 +271,16 @@ const _sfc_main = vue.defineComponent({
|
|
|
272
271
|
temp = [{ url: data[0].url, thumb: data[0].url }];
|
|
273
272
|
}
|
|
274
273
|
styleData.value.data = temp;
|
|
274
|
+
styleData.value.cover_url = data[0].url;
|
|
275
|
+
const getColors = index.getThemeColor(BASE_API, data[0].url);
|
|
276
|
+
getColors.then((themes) => {
|
|
277
|
+
styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
|
|
278
|
+
styleData.value.cover_theme_color = `rgb(${themes[1]})`;
|
|
279
|
+
callback(styleData.value);
|
|
280
|
+
}).catch((e) => {
|
|
281
|
+
styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
|
|
282
|
+
callback(styleData.value);
|
|
283
|
+
});
|
|
275
284
|
} else if (thumbBannerModel.value === "banner") {
|
|
276
285
|
styleData.value.banner_url = data[0].url;
|
|
277
286
|
const getColors = index.getThemeColor(BASE_API, data[0].url);
|
|
@@ -339,10 +348,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
339
348
|
});
|
|
340
349
|
};
|
|
341
350
|
const modelChange = () => {
|
|
351
|
+
styleData.value.cover_theme_color = "";
|
|
342
352
|
if (!props.dataValue)
|
|
343
353
|
return;
|
|
344
354
|
if (styleData.value.model === oldData.value.model) {
|
|
345
355
|
styleData.value.data = oldData.value.data;
|
|
356
|
+
styleData.value.cover_theme_color = oldData.value.cover_theme_color;
|
|
357
|
+
styleData.value.cover_colorList = oldData.value.cover_colorList;
|
|
346
358
|
} else {
|
|
347
359
|
styleData.value.data = [];
|
|
348
360
|
}
|
|
@@ -355,6 +367,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
355
367
|
},
|
|
356
368
|
set(value) {
|
|
357
369
|
styleData.value.banner_url = value.url;
|
|
370
|
+
styleData.value.cover_colorList = styleData.value.banner_colorList;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
const cover = vue.computed({
|
|
374
|
+
get() {
|
|
375
|
+
const { cover_theme_color } = styleData.value;
|
|
376
|
+
return cover_theme_color;
|
|
377
|
+
},
|
|
378
|
+
set() {
|
|
358
379
|
}
|
|
359
380
|
});
|
|
360
381
|
const hasBanner = vue.computed({
|
|
@@ -367,6 +388,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
367
388
|
callback(styleData.value);
|
|
368
389
|
}
|
|
369
390
|
});
|
|
391
|
+
const hasCover = vue.computed({
|
|
392
|
+
get() {
|
|
393
|
+
return !!cover.value;
|
|
394
|
+
},
|
|
395
|
+
set(value) {
|
|
396
|
+
styleData.value.cover = value;
|
|
397
|
+
callback(styleData.value);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
370
400
|
const pcBanner = vue.computed({
|
|
371
401
|
get() {
|
|
372
402
|
const { pc_banner_url_info, pc_banner_url } = styleData.value;
|
|
@@ -379,6 +409,23 @@ const _sfc_main = vue.defineComponent({
|
|
|
379
409
|
const colorChange = (styleData2) => {
|
|
380
410
|
callback(styleData2);
|
|
381
411
|
};
|
|
412
|
+
vue.onMounted(() => {
|
|
413
|
+
if (!styleData.value.cover_url) {
|
|
414
|
+
setTimeout(() => {
|
|
415
|
+
styleData.value.cover_url = styleData.value.data[0].url;
|
|
416
|
+
const getColors = index.getThemeColor(BASE_API, styleData.value.data[0].url);
|
|
417
|
+
getColors.then((themes) => {
|
|
418
|
+
styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
|
|
419
|
+
styleData.value.cover_theme_color = `rgb(${themes[1]})`;
|
|
420
|
+
oldData.value = JSON.parse(JSON.stringify(styleData.value));
|
|
421
|
+
callback(styleData.value);
|
|
422
|
+
}).catch((e) => {
|
|
423
|
+
styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
|
|
424
|
+
callback(styleData.value);
|
|
425
|
+
});
|
|
426
|
+
}, 700);
|
|
427
|
+
}
|
|
428
|
+
});
|
|
382
429
|
return (_ctx, _cache) => {
|
|
383
430
|
var _a, _b, _c, _d, _e, _f;
|
|
384
431
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -471,7 +518,14 @@ const _sfc_main = vue.defineComponent({
|
|
|
471
518
|
]),
|
|
472
519
|
_: 1
|
|
473
520
|
}, 8, ["modelValue"])
|
|
474
|
-
], 64)) : vue.createCommentVNode("v-if", true)
|
|
521
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
522
|
+
hasCover.value ? (vue.openBlock(), vue.createBlock(colorPalette, {
|
|
523
|
+
key: 3,
|
|
524
|
+
"style-data": styleData.value,
|
|
525
|
+
model: "cover",
|
|
526
|
+
style: { "margin-top": "10px" },
|
|
527
|
+
onChange: colorChange
|
|
528
|
+
}, null, 8, ["style-data"])) : vue.createCommentVNode("v-if", true)
|
|
475
529
|
])
|
|
476
530
|
], 2),
|
|
477
531
|
_ctx.mode === "doc" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|