@cmstops/pro-compo 3.9.0 → 3.9.1-rc.1
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/es/hooks/useAttachement.d.ts +26 -7
- package/es/hooks/useAttachement.js +49 -2
- package/es/selectResourceModal/components/List/ListNormal/Filter.js +25 -10
- package/es/selectThumb/component.js +57 -3
- package/lib/hooks/useAttachement.js +49 -0
- package/lib/selectResourceModal/components/List/ListNormal/Filter.js +24 -9
- package/lib/selectThumb/component.js +56 -2
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
1
|
export declare function getAttachmentsAll(BASE_API: string, query?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
2
|
export declare function getAttachmentsMy(BASE_API: string, query?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
3
|
export declare function getAttachmentsMyMessage(BASE_API: string, query: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -7,12 +6,12 @@ declare type OptionsType = {
|
|
|
7
6
|
BASE_API: string;
|
|
8
7
|
};
|
|
9
8
|
export default function useAttachement(options: OptionsType): {
|
|
10
|
-
list: Ref<any[], any[]>;
|
|
11
|
-
total: Ref<number, number>;
|
|
12
|
-
limit: Ref<number, number>;
|
|
13
|
-
offset: Ref<number, number>;
|
|
9
|
+
list: import("vue").Ref<any[], any[]>;
|
|
10
|
+
total: import("vue").Ref<number, number>;
|
|
11
|
+
limit: import("vue").Ref<number, number>;
|
|
12
|
+
offset: import("vue").Ref<number, number>;
|
|
14
13
|
pageIdx: import("vue").ComputedRef<number>;
|
|
15
|
-
loading: Ref<boolean, boolean>;
|
|
14
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
16
15
|
changeFilter: (f: any) => void;
|
|
17
16
|
changeKey: (k: string) => void;
|
|
18
17
|
changePage: (o: number) => void;
|
|
@@ -20,7 +19,7 @@ export default function useAttachement(options: OptionsType): {
|
|
|
20
19
|
loadData: () => Promise<void>;
|
|
21
20
|
};
|
|
22
21
|
export declare function useLocalRecource(): {
|
|
23
|
-
localList: Ref<any[], any[]>;
|
|
22
|
+
localList: import("vue").Ref<any[], any[]>;
|
|
24
23
|
initLocalList: () => void;
|
|
25
24
|
setLocalList: (list: any[]) => void;
|
|
26
25
|
};
|
|
@@ -31,4 +30,24 @@ export declare const mediaUseEnum: {
|
|
|
31
30
|
export declare function getSysRsByTag(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
32
31
|
export declare function getSysRsClassifyList(BASE_API: string, sys_tag: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
33
32
|
export declare function getSysRsPage(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
33
|
+
export declare function getDirectory(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
34
|
+
/**
|
|
35
|
+
* 数据结构:
|
|
36
|
+
* Array<{
|
|
37
|
+
* "id": {dirid},
|
|
38
|
+
* "alias": {dirname},
|
|
39
|
+
* "parent_id": {parent_dirid},
|
|
40
|
+
* "children": [],
|
|
41
|
+
* ...
|
|
42
|
+
* }>
|
|
43
|
+
*/
|
|
44
|
+
declare type DirOptionsType = {
|
|
45
|
+
key?: string;
|
|
46
|
+
BASE_API: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function useDirectory(options: DirOptionsType): {
|
|
49
|
+
tree: import("vue").Ref<any[], any[]>;
|
|
50
|
+
init: () => Promise<void>;
|
|
51
|
+
loadMore: (target: any) => Promise<void>;
|
|
52
|
+
};
|
|
34
53
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, computed } from "vue";
|
|
1
|
+
import { ref, computed, onMounted } from "vue";
|
|
2
2
|
import request from "../utils/request.js";
|
|
3
3
|
function getAttachmentsAll(BASE_API, query) {
|
|
4
4
|
return request(BASE_API, {
|
|
@@ -108,4 +108,51 @@ function getSysRsPage(BASE_API, params) {
|
|
|
108
108
|
params
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
function getDirectory(BASE_API, params) {
|
|
112
|
+
return request(BASE_API, {
|
|
113
|
+
url: "/poplar/v3/directories",
|
|
114
|
+
method: "get",
|
|
115
|
+
params
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function useDirectory(options) {
|
|
119
|
+
const tree = ref([]);
|
|
120
|
+
async function loadDirTree(parent_id) {
|
|
121
|
+
const params = parent_id ? { parent_id } : {};
|
|
122
|
+
const { code, message } = await getDirectory(options.BASE_API, params);
|
|
123
|
+
if (code === 0) {
|
|
124
|
+
if (!Array.isArray(message.data))
|
|
125
|
+
return [];
|
|
126
|
+
return message.data.map(({ alias, id }) => {
|
|
127
|
+
return {
|
|
128
|
+
title: alias,
|
|
129
|
+
key: id,
|
|
130
|
+
isLeaf: false,
|
|
131
|
+
children: []
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
async function init() {
|
|
138
|
+
const result = await loadDirTree();
|
|
139
|
+
if (!Array.isArray(result))
|
|
140
|
+
return;
|
|
141
|
+
tree.value = result;
|
|
142
|
+
}
|
|
143
|
+
async function loadMore(target) {
|
|
144
|
+
const children = await loadDirTree(target.key);
|
|
145
|
+
target.children = children;
|
|
146
|
+
if (children.length === 0)
|
|
147
|
+
target.isLeaf = true;
|
|
148
|
+
}
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
init();
|
|
151
|
+
});
|
|
152
|
+
return {
|
|
153
|
+
tree,
|
|
154
|
+
init,
|
|
155
|
+
loadMore
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export { useAttachement as default, getAttachmentsAll, getAttachmentsMy, getAttachmentsMyMessage, getDirectory, getSysRsByTag, getSysRsPage, useDirectory };
|
|
@@ -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";
|
|
@@ -56,6 +57,9 @@ const _sfc_main = defineComponent({
|
|
|
56
57
|
});
|
|
57
58
|
const resourceSource = RESOURCE_SOURCE_OPTIONS;
|
|
58
59
|
const resourceCatalog = RESOURCE_CATALOG_OPTIONS;
|
|
60
|
+
const { tree, loadMore: loadDirMore } = useDirectory({
|
|
61
|
+
BASE_API: baseAPI
|
|
62
|
+
});
|
|
59
63
|
const originFilter = {
|
|
60
64
|
catalog: [],
|
|
61
65
|
source: "",
|
|
@@ -64,7 +68,8 @@ const _sfc_main = defineComponent({
|
|
|
64
68
|
keyword: "",
|
|
65
69
|
precise_keyword: "",
|
|
66
70
|
upload_by: null,
|
|
67
|
-
sf: ""
|
|
71
|
+
sf: "",
|
|
72
|
+
directory_id: void 0
|
|
68
73
|
};
|
|
69
74
|
const filter = ref(JSON.parse(JSON.stringify(originFilter)));
|
|
70
75
|
const handleReset = () => {
|
|
@@ -180,13 +185,13 @@ const _sfc_main = defineComponent({
|
|
|
180
185
|
}, {
|
|
181
186
|
content: withCtx(() => [
|
|
182
187
|
createVNode(unref(Doption), { value: 0 }, {
|
|
183
|
-
default: withCtx(() => _cache[
|
|
188
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
184
189
|
createTextVNode("\u7CBE\u51C6\u641C")
|
|
185
190
|
])),
|
|
186
191
|
_: 1
|
|
187
192
|
}),
|
|
188
193
|
createVNode(unref(Doption), { value: 1 }, {
|
|
189
|
-
default: withCtx(() => _cache[
|
|
194
|
+
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
190
195
|
createTextVNode("\u6A21\u7CCA\u641C")
|
|
191
196
|
])),
|
|
192
197
|
_: 1
|
|
@@ -228,10 +233,20 @@ const _sfc_main = defineComponent({
|
|
|
228
233
|
_: 1
|
|
229
234
|
}, 8, ["modelValue", "disabled"])
|
|
230
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"]),
|
|
231
246
|
createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
|
|
232
247
|
createVNode(unref(RangePicker), {
|
|
233
248
|
modelValue: rangeTime.value,
|
|
234
|
-
"onUpdate:modelValue": _cache[
|
|
249
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
|
|
235
250
|
"allow-clear": "",
|
|
236
251
|
style: { "width": "240px" }
|
|
237
252
|
}, null, 8, ["modelValue"]),
|
|
@@ -239,7 +254,7 @@ const _sfc_main = defineComponent({
|
|
|
239
254
|
createElementVNode("div", _hoisted_6, [
|
|
240
255
|
createVNode(unref(Select), {
|
|
241
256
|
modelValue: filter.value.source,
|
|
242
|
-
"onUpdate:modelValue": _cache[
|
|
257
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
|
|
243
258
|
"allow-clear": "",
|
|
244
259
|
placeholder: "\u6765\u6E90"
|
|
245
260
|
}, {
|
|
@@ -259,7 +274,7 @@ const _sfc_main = defineComponent({
|
|
|
259
274
|
!_ctx.disableUploadBy ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
260
275
|
createVNode(unref(Select), {
|
|
261
276
|
modelValue: filter.value.upload_by,
|
|
262
|
-
"onUpdate:modelValue": _cache[
|
|
277
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
|
|
263
278
|
"allow-clear": "",
|
|
264
279
|
placeholder: "\u4E0A\u4F20\u4EBA",
|
|
265
280
|
loading: unref(loading),
|
|
@@ -284,7 +299,7 @@ const _sfc_main = defineComponent({
|
|
|
284
299
|
type: "text",
|
|
285
300
|
onClick: handleReset
|
|
286
301
|
}, {
|
|
287
|
-
default: withCtx(() => _cache[
|
|
302
|
+
default: withCtx(() => _cache[10] || (_cache[10] = [
|
|
288
303
|
createTextVNode(" \u91CD\u7F6E ")
|
|
289
304
|
])),
|
|
290
305
|
_: 1
|
|
@@ -293,13 +308,13 @@ const _sfc_main = defineComponent({
|
|
|
293
308
|
createElementVNode("div", _hoisted_8, [
|
|
294
309
|
createVNode(unref(Button), {
|
|
295
310
|
type: "primary",
|
|
296
|
-
onClick: _cache[
|
|
311
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
|
|
297
312
|
}, {
|
|
298
313
|
icon: withCtx(() => [
|
|
299
314
|
createVNode(unref(IconUpload))
|
|
300
315
|
]),
|
|
301
316
|
default: withCtx(() => [
|
|
302
|
-
_cache[
|
|
317
|
+
_cache[11] || (_cache[11] = createTextVNode(" \u4E0A\u4F20 "))
|
|
303
318
|
]),
|
|
304
319
|
_: 1
|
|
305
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;
|
|
@@ -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");
|
|
@@ -57,6 +58,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
57
58
|
});
|
|
58
59
|
const resourceSource = typeMap.RESOURCE_SOURCE_OPTIONS;
|
|
59
60
|
const resourceCatalog = typeMap.RESOURCE_CATALOG_OPTIONS;
|
|
61
|
+
const { tree, loadMore: loadDirMore } = useAttachement.useDirectory({
|
|
62
|
+
BASE_API: baseAPI
|
|
63
|
+
});
|
|
60
64
|
const originFilter = {
|
|
61
65
|
catalog: [],
|
|
62
66
|
source: "",
|
|
@@ -65,7 +69,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
65
69
|
keyword: "",
|
|
66
70
|
precise_keyword: "",
|
|
67
71
|
upload_by: null,
|
|
68
|
-
sf: ""
|
|
72
|
+
sf: "",
|
|
73
|
+
directory_id: void 0
|
|
69
74
|
};
|
|
70
75
|
const filter = vue.ref(JSON.parse(JSON.stringify(originFilter)));
|
|
71
76
|
const handleReset = () => {
|
|
@@ -181,13 +186,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
181
186
|
}, {
|
|
182
187
|
content: vue.withCtx(() => [
|
|
183
188
|
vue.createVNode(vue.unref(webVue.Doption), { value: 0 }, {
|
|
184
|
-
default: vue.withCtx(() => _cache[
|
|
189
|
+
default: vue.withCtx(() => _cache[8] || (_cache[8] = [
|
|
185
190
|
vue.createTextVNode("\u7CBE\u51C6\u641C")
|
|
186
191
|
])),
|
|
187
192
|
_: 1
|
|
188
193
|
}),
|
|
189
194
|
vue.createVNode(vue.unref(webVue.Doption), { value: 1 }, {
|
|
190
|
-
default: vue.withCtx(() => _cache[
|
|
195
|
+
default: vue.withCtx(() => _cache[9] || (_cache[9] = [
|
|
191
196
|
vue.createTextVNode("\u6A21\u7CCA\u641C")
|
|
192
197
|
])),
|
|
193
198
|
_: 1
|
|
@@ -229,10 +234,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
229
234
|
_: 1
|
|
230
235
|
}, 8, ["modelValue", "disabled"])
|
|
231
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"]),
|
|
232
247
|
vue.createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
|
|
233
248
|
vue.createVNode(vue.unref(webVue.RangePicker), {
|
|
234
249
|
modelValue: rangeTime.value,
|
|
235
|
-
"onUpdate:modelValue": _cache[
|
|
250
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
|
|
236
251
|
"allow-clear": "",
|
|
237
252
|
style: { "width": "240px" }
|
|
238
253
|
}, null, 8, ["modelValue"]),
|
|
@@ -240,7 +255,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
240
255
|
vue.createElementVNode("div", _hoisted_6, [
|
|
241
256
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
242
257
|
modelValue: filter.value.source,
|
|
243
|
-
"onUpdate:modelValue": _cache[
|
|
258
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
|
|
244
259
|
"allow-clear": "",
|
|
245
260
|
placeholder: "\u6765\u6E90"
|
|
246
261
|
}, {
|
|
@@ -260,7 +275,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
260
275
|
!_ctx.disableUploadBy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
261
276
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
262
277
|
modelValue: filter.value.upload_by,
|
|
263
|
-
"onUpdate:modelValue": _cache[
|
|
278
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
|
|
264
279
|
"allow-clear": "",
|
|
265
280
|
placeholder: "\u4E0A\u4F20\u4EBA",
|
|
266
281
|
loading: vue.unref(loading),
|
|
@@ -285,7 +300,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
285
300
|
type: "text",
|
|
286
301
|
onClick: handleReset
|
|
287
302
|
}, {
|
|
288
|
-
default: vue.withCtx(() => _cache[
|
|
303
|
+
default: vue.withCtx(() => _cache[10] || (_cache[10] = [
|
|
289
304
|
vue.createTextVNode(" \u91CD\u7F6E ")
|
|
290
305
|
])),
|
|
291
306
|
_: 1
|
|
@@ -294,13 +309,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
294
309
|
vue.createElementVNode("div", _hoisted_8, [
|
|
295
310
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
296
311
|
type: "primary",
|
|
297
|
-
onClick: _cache[
|
|
312
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
|
|
298
313
|
}, {
|
|
299
314
|
icon: vue.withCtx(() => [
|
|
300
315
|
vue.createVNode(vue.unref(icon.IconUpload))
|
|
301
316
|
]),
|
|
302
317
|
default: vue.withCtx(() => [
|
|
303
|
-
_cache[
|
|
318
|
+
_cache[11] || (_cache[11] = vue.createTextVNode(" \u4E0A\u4F20 "))
|
|
304
319
|
]),
|
|
305
320
|
_: 1
|
|
306
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 }, [
|