@cmstops/pro-compo 0.1.13 → 0.1.15

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.
Files changed (150) hide show
  1. package/dist/gif.worker.js +3 -0
  2. package/dist/index.css +486 -6
  3. package/dist/index.min.css +1 -1
  4. package/es/contentDetailList/component.js +1 -2
  5. package/es/contentDetailList/components/Content/CompoItem/index.js +1 -2
  6. package/es/contentDetailList/components/Content/ContentListItem/index.js +1 -2
  7. package/es/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.js +1 -2
  8. package/es/contentDetailList/components/Content/DocItem/index.js +1 -2
  9. package/es/contentDetailList/components/Content/KongoNavItem/index.js +1 -2
  10. package/es/contentDetailList/components/Content/LiveItem/index.js +1 -2
  11. package/es/contentDetailList/components/Content/MaccountItem/index.js +1 -2
  12. package/es/contentDetailList/components/Content/index.js +1 -2
  13. package/es/contentDetailList/components/Doc/index.js +1 -2
  14. package/es/contentModal/component.js +1 -2
  15. package/es/contentModal/components/CompoList/CompoFilter/index.js +2 -3
  16. package/es/contentModal/components/CompoList/index.js +2 -3
  17. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +1 -2
  18. package/es/contentModal/components/ViewAllColumn/columnTree/index.js +1 -2
  19. package/es/contentModal/components/ViewAllColumn/index.js +1 -2
  20. package/es/contentModal/components/storeBox/index.js +1 -2
  21. package/es/gif.worker.js +3 -0
  22. package/es/hooks/assets.d.ts +1 -0
  23. package/es/hooks/assets.js +9 -0
  24. package/es/hooks/user.d.ts +1 -3
  25. package/es/imageCrop/component.d.ts +0 -0
  26. package/es/imageCrop/component.js +472 -0
  27. package/es/imageCrop/index.d.ts +2 -0
  28. package/es/imageCrop/index.js +7 -0
  29. package/es/imageCrop/script/api.d.ts +1 -0
  30. package/es/imageCrop/script/api.js +11 -0
  31. package/es/imageCrop/style/cropper.less +291 -0
  32. package/es/imageCrop/style/css.js +1 -0
  33. package/es/imageCrop/style/imageCropper.less +133 -0
  34. package/es/imageCrop/style/index.css +366 -0
  35. package/es/imageCrop/style/index.d.ts +1 -0
  36. package/es/imageCrop/style/index.js +1 -0
  37. package/es/imageCrop/style/index.less +2 -0
  38. package/es/index.css +486 -6
  39. package/es/index.d.ts +2 -0
  40. package/es/index.js +2 -0
  41. package/es/index.less +2 -0
  42. package/es/mediaFilter/component.js +1 -2
  43. package/es/mediaFilter/components/DocFilter.js +1 -2
  44. package/es/messageBox/list.js +1 -2
  45. package/es/previousVersion/component.js +1 -2
  46. package/es/resourceModal/component.js +4 -7
  47. package/es/resourceModal/components/MediaPreviewer/index.js +1 -2
  48. package/es/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +10 -19
  49. package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +4 -9
  50. package/es/resourceModal/components/MediaSelection/MainContent/index.js +7 -15
  51. package/es/resourceModal/components/MediaSelection/ToolbarSearch/index.js +1 -2
  52. package/es/resourceModal/components/MediaSelection/index.js +8 -12
  53. package/es/selectAvatarList/component.js +67 -48
  54. package/es/selectGategory/component.js +1 -2
  55. package/es/selectGategory/components/ColumnSelection/index.js +1 -2
  56. package/es/selectThumb/component.d.ts +0 -0
  57. package/es/selectThumb/component.js +410 -0
  58. package/es/selectThumb/components/card.d.ts +0 -0
  59. package/es/selectThumb/components/card.js +86 -0
  60. package/es/selectThumb/components/colorPalette.d.ts +0 -0
  61. package/es/selectThumb/components/colorPalette.js +75 -0
  62. package/es/selectThumb/index.d.ts +2 -0
  63. package/es/selectThumb/index.js +7 -0
  64. package/es/selectThumb/style/card.less +79 -0
  65. package/es/selectThumb/style/colorPalette.less +0 -0
  66. package/es/selectThumb/style/css.js +1 -0
  67. package/es/selectThumb/style/index.css +101 -0
  68. package/es/selectThumb/style/index.d.ts +1 -0
  69. package/es/selectThumb/style/index.js +1 -0
  70. package/es/selectThumb/style/index.less +27 -0
  71. package/es/uploadBefore/component.js +2 -3
  72. package/es/uploadBefore/components/UploadBefore.js +1 -2
  73. package/es/uploadBefore/components/UploadForClick.js +1 -2
  74. package/es/uploadStep/component.js +2 -3
  75. package/es/userDirector/component.js +15 -14
  76. package/es/userDirector/components/userTree.js +2 -2
  77. package/es/userDirector/style/index.css +19 -6
  78. package/es/userDirector/style/index.less +25 -12
  79. package/es/utils/doc.js +30 -7
  80. package/es/utils/index.d.ts +1 -0
  81. package/es/utils/index.js +6 -1
  82. package/es/utils/tusUpload.d.ts +1 -1
  83. package/es/utils/tusUpload.js +1 -1
  84. package/es/utils/uploadCatalog.d.ts +1 -0
  85. package/lib/contentDetailList/component.js +1 -2
  86. package/lib/contentDetailList/components/Content/CompoItem/index.js +1 -2
  87. package/lib/contentDetailList/components/Content/ContentListItem/index.js +1 -2
  88. package/lib/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.js +1 -2
  89. package/lib/contentDetailList/components/Content/DocItem/index.js +1 -2
  90. package/lib/contentDetailList/components/Content/KongoNavItem/index.js +1 -2
  91. package/lib/contentDetailList/components/Content/LiveItem/index.js +1 -2
  92. package/lib/contentDetailList/components/Content/MaccountItem/index.js +1 -2
  93. package/lib/contentDetailList/components/Content/index.js +1 -2
  94. package/lib/contentDetailList/components/Doc/index.js +1 -2
  95. package/lib/contentModal/component.js +1 -2
  96. package/lib/contentModal/components/CompoList/CompoFilter/index.js +2 -3
  97. package/lib/contentModal/components/CompoList/index.js +2 -3
  98. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +1 -2
  99. package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +1 -2
  100. package/lib/contentModal/components/ViewAllColumn/index.js +1 -2
  101. package/lib/contentModal/components/storeBox/index.js +1 -2
  102. package/lib/hooks/assets.js +11 -0
  103. package/lib/imageCrop/component.js +479 -0
  104. package/lib/imageCrop/index.js +8 -0
  105. package/lib/imageCrop/script/api.js +13 -0
  106. package/lib/imageCrop/style/cropper.less +291 -0
  107. package/lib/imageCrop/style/css.js +2 -0
  108. package/lib/imageCrop/style/imageCropper.less +133 -0
  109. package/lib/imageCrop/style/index.css +366 -0
  110. package/lib/imageCrop/style/index.js +2 -0
  111. package/lib/imageCrop/style/index.less +2 -0
  112. package/lib/index.css +486 -6
  113. package/lib/index.js +16 -12
  114. package/lib/index.less +2 -0
  115. package/lib/mediaFilter/component.js +1 -2
  116. package/lib/mediaFilter/components/DocFilter.js +1 -2
  117. package/lib/messageBox/list.js +1 -2
  118. package/lib/previousVersion/component.js +1 -2
  119. package/lib/resourceModal/component.js +4 -7
  120. package/lib/resourceModal/components/MediaPreviewer/index.js +1 -2
  121. package/lib/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +10 -19
  122. package/lib/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +4 -9
  123. package/lib/resourceModal/components/MediaSelection/MainContent/index.js +7 -15
  124. package/lib/resourceModal/components/MediaSelection/ToolbarSearch/index.js +1 -2
  125. package/lib/resourceModal/components/MediaSelection/index.js +8 -12
  126. package/lib/selectAvatarList/component.js +67 -48
  127. package/lib/selectGategory/component.js +1 -2
  128. package/lib/selectGategory/components/ColumnSelection/index.js +1 -2
  129. package/lib/selectThumb/component.js +411 -0
  130. package/lib/selectThumb/components/card.js +87 -0
  131. package/lib/selectThumb/components/colorPalette.js +76 -0
  132. package/lib/selectThumb/index.js +8 -0
  133. package/lib/selectThumb/style/card.less +79 -0
  134. package/lib/selectThumb/style/colorPalette.less +0 -0
  135. package/lib/selectThumb/style/css.js +2 -0
  136. package/lib/selectThumb/style/index.css +101 -0
  137. package/lib/selectThumb/style/index.js +2 -0
  138. package/lib/selectThumb/style/index.less +27 -0
  139. package/lib/uploadBefore/component.js +2 -3
  140. package/lib/uploadBefore/components/UploadBefore.js +1 -2
  141. package/lib/uploadBefore/components/UploadForClick.js +1 -2
  142. package/lib/uploadStep/component.js +2 -3
  143. package/lib/userDirector/component.js +15 -14
  144. package/lib/userDirector/components/userTree.js +2 -2
  145. package/lib/userDirector/style/index.css +19 -6
  146. package/lib/userDirector/style/index.less +25 -12
  147. package/lib/utils/doc.js +31 -6
  148. package/lib/utils/index.js +6 -0
  149. package/lib/utils/tusUpload.js +1 -1
  150. package/package.json +16 -2
@@ -0,0 +1,410 @@
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createVNode, unref, withCtx, withDirectives, vShow } from "vue";
2
+ import { RadioGroup, Radio, Switch } from "@arco-design/web-vue";
3
+ import { docThumbObjMap, docThumbArrMap, docThumbRatioMap } from "../utils/doc.js";
4
+ import _sfc_main$3 from "../resourceModal/component.js";
5
+ import _sfc_main$4 from "../imageCrop/component.js";
6
+ import _sfc_main$1 from "./components/card.js";
7
+ import _sfc_main$2 from "./components/colorPalette.js";
8
+ import { DEFAULT_BASE_API } from "../config.js";
9
+ const _hoisted_1 = { class: "select-thumb-container" };
10
+ const _hoisted_2 = { class: "title" };
11
+ const _hoisted_3 = {
12
+ key: 0,
13
+ class: "tip"
14
+ };
15
+ const _hoisted_4 = {
16
+ key: 0,
17
+ class: "thumb-list-view"
18
+ };
19
+ const _hoisted_5 = { class: "banner-view" };
20
+ const _hoisted_6 = { class: "title" };
21
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", null, "\u72EC\u7ACB\u8F6E\u64AD\u56FE", -1);
22
+ const _hoisted_8 = { class: "title" };
23
+ const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", null, "\u72EC\u7ACB\u8F6E\u64AD\u56FE\u80CC\u666F\u989C\u8272", -1);
24
+ const _hoisted_10 = [
25
+ _hoisted_9
26
+ ];
27
+ const _hoisted_11 = { class: "banner-view" };
28
+ const _hoisted_12 = { class: "title" };
29
+ const _hoisted_13 = { key: 0 };
30
+ const _hoisted_14 = { key: 1 };
31
+ const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", { class: "star" }, "*", -1);
32
+ const _hoisted_16 = { key: 2 };
33
+ const _hoisted_17 = /* @__PURE__ */ createElementVNode("span", { class: "tip" }, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)", -1);
34
+ const _hoisted_18 = { class: "title" };
35
+ const _hoisted_19 = /* @__PURE__ */ createElementVNode("span", null, "\u4E13\u9898\u5934\u56FE\u80CC\u666F\u989C\u8272", -1);
36
+ const _hoisted_20 = [
37
+ _hoisted_19
38
+ ];
39
+ const _sfc_main = defineComponent({
40
+ ...{ name: "selectThumb" },
41
+ __name: "component",
42
+ props: {
43
+ BASE_API: {},
44
+ mode: {},
45
+ dataValue: {},
46
+ title: {},
47
+ cropper: { type: Boolean },
48
+ aiImages: {},
49
+ series: {}
50
+ },
51
+ emits: ["update:dataValue"],
52
+ setup(__props, { emit }) {
53
+ const props = __props;
54
+ const BASE_API = props.BASE_API || DEFAULT_BASE_API;
55
+ const useCropper = ref(props.cropper || false);
56
+ const oldData = ref(null);
57
+ const styleData = ref({});
58
+ const thumbBannerModel = ref("banner");
59
+ const dialogMediaSelectionShow = ref(false);
60
+ const dialogCropperShow = ref(false);
61
+ const thumbOptionIndex = ref(0);
62
+ const aspectRatioProp = ref(16 / 9);
63
+ const cropperData = ref([]);
64
+ const model = computed({
65
+ get() {
66
+ if (!styleData.value.model)
67
+ return "4";
68
+ return `${styleData.value.model}`;
69
+ },
70
+ set(value) {
71
+ styleData.value.model = parseInt(value, 10);
72
+ callback(styleData.value);
73
+ }
74
+ });
75
+ watch(
76
+ () => props.dataValue,
77
+ () => {
78
+ loadData(props.dataValue);
79
+ }
80
+ );
81
+ const loadData = (value) => {
82
+ let data = null;
83
+ if (!value) {
84
+ data = { model: 3, data: [{ url: "", thumb: "" }] };
85
+ } else if (props.mode === "smiple") {
86
+ data = { model: 3, data: [{ url: value, thumb: value }] };
87
+ } else {
88
+ data = { ...JSON.parse(value) };
89
+ }
90
+ if (!oldData.value) {
91
+ oldData.value = { ...data };
92
+ }
93
+ styleData.value = data;
94
+ };
95
+ const callback = (value) => {
96
+ var _a;
97
+ const temp = JSON.parse(JSON.stringify(value));
98
+ if (Array.isArray(temp.data)) {
99
+ temp.data = temp.data.map((item) => {
100
+ return item || {};
101
+ });
102
+ }
103
+ if (props.mode === "smiple") {
104
+ emit("update:dataValue", ((_a = temp.data[0]) == null ? void 0 : _a.url) || "");
105
+ } else {
106
+ if (!temp.data) {
107
+ temp.data = [];
108
+ }
109
+ emit("update:dataValue", JSON.stringify(temp));
110
+ }
111
+ };
112
+ const curtemplate = computed(() => {
113
+ if (props.mode !== "doc") {
114
+ return docThumbObjMap[3];
115
+ }
116
+ return docThumbObjMap[parseInt(model.value, 10)];
117
+ });
118
+ const modelList = computed(() => {
119
+ return docThumbArrMap().filter((item) => {
120
+ return FromThumbArr.value.split(",").includes(item.value);
121
+ });
122
+ });
123
+ const FromThumbArr = computed(() => {
124
+ const { series } = props;
125
+ if (series) {
126
+ if (series === "imagetext")
127
+ return "1,2,3,4";
128
+ if (series === "svideo")
129
+ return "2,5";
130
+ if (series === "video")
131
+ return "1,2,3,4";
132
+ if (series === "atlas")
133
+ return "1,2,3,4";
134
+ if (series === "audio")
135
+ return "1,2,3,4";
136
+ if (series === "link")
137
+ return "1,2,3,4,7";
138
+ if (series === "h5")
139
+ return "1,2,3,4,7";
140
+ }
141
+ return "1,2,3,4,5,7";
142
+ });
143
+ const currentModel = computed(() => {
144
+ if (props.mode !== "doc") {
145
+ return docThumbObjMap[3];
146
+ }
147
+ return modelList.value.find((item) => item.value === model.value);
148
+ });
149
+ const thumbList = computed(() => {
150
+ var _a;
151
+ return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
152
+ });
153
+ const previewList = computed(() => {
154
+ return thumbList.value.map((item) => item.url);
155
+ });
156
+ const openDialogMediaSelection = (type, index) => {
157
+ thumbBannerModel.value = type || "thumb";
158
+ thumbOptionIndex.value = index || 0;
159
+ dialogMediaSelectionShow.value = true;
160
+ };
161
+ const docSeriesShowTopThemeColor = computed(() => {
162
+ const { series } = props;
163
+ return ["special", "special_v3", "video_album", "audio_album"].includes(
164
+ series
165
+ );
166
+ });
167
+ const submitCallback = (data) => {
168
+ var _a;
169
+ console.log("submitCallback", data);
170
+ const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
171
+ const _useCropper = props.mode === "doc" ? true : useCropper.value;
172
+ if (isPcBaner || !_useCropper) {
173
+ dialogMediaSelectionShow.value = false;
174
+ data.map(async (media) => {
175
+ const { width, height } = await loadImage(media.url);
176
+ styleData.value.pc_banner_url = `${media.url}?width=${width}&height=${height}`;
177
+ styleData.value.pc_banner_url_info = JSON.stringify({ width, height });
178
+ callback(styleData.value);
179
+ return media;
180
+ });
181
+ } else {
182
+ cropperData.value = [].concat(data);
183
+ if (thumbBannerModel.value === "banner" || docSeriesShowTopThemeColor.value) {
184
+ aspectRatioProp.value = docThumbRatioMap()[2];
185
+ }
186
+ if (thumbBannerModel.value === "thumb") {
187
+ aspectRatioProp.value = docThumbRatioMap()[model.value];
188
+ if (data.length) {
189
+ const media = data[0];
190
+ const wh = [];
191
+ (_a = media.metas) == null ? void 0 : _a.map((item) => {
192
+ if (item.key === "width")
193
+ wh.unshift(parseInt(item.value, 10));
194
+ if (item.key === "height")
195
+ wh.push(parseInt(item.value, 10));
196
+ return item;
197
+ });
198
+ if (wh.length === 2 && Math.abs(wh[0] / wh[1] - curtemplate.value.ratio) <= 0.05) {
199
+ const [width, height] = wh;
200
+ const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
201
+ temp[thumbOptionIndex.value] = {
202
+ url: `${media.url}?width=${width}&height=${height}`,
203
+ thumb: `${media.url}?width=${width}&height=${height}`
204
+ };
205
+ styleData.value.data = temp;
206
+ callback(styleData.value);
207
+ dialogMediaSelectionShow.value = false;
208
+ return false;
209
+ }
210
+ }
211
+ }
212
+ setTimeout(() => {
213
+ dialogCropperShow.value = true;
214
+ }, 300);
215
+ }
216
+ };
217
+ const cropConfirm = (data) => {
218
+ dialogMediaSelectionShow.value = false;
219
+ if (thumbBannerModel.value === "banner") {
220
+ styleData.value.banner_url = data[0].url;
221
+ styleData.value.banner_colorList = JSON.parse(
222
+ JSON.stringify(data[0].banner_theme_color)
223
+ );
224
+ styleData.value.banner_theme_color = `rgb(${data[0].banner_theme_color[1]})`;
225
+ }
226
+ if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
227
+ styleData.value.top_image_url = data[0].url;
228
+ styleData.value.pc_banner_url = data[0].url;
229
+ styleData.value.top_colorList = JSON.parse(
230
+ JSON.stringify(data[0].banner_theme_color)
231
+ );
232
+ styleData.value.top_theme_color = `rgb(${data[0].banner_theme_color[1]})`;
233
+ }
234
+ if (thumbBannerModel.value === "thumb") {
235
+ const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
236
+ temp[thumbOptionIndex.value] = {
237
+ url: data[0].url,
238
+ thumb: data[0].url
239
+ };
240
+ styleData.value.data = temp;
241
+ }
242
+ callback(styleData.value);
243
+ };
244
+ const loadImage = (url) => {
245
+ return new Promise((resolve, reject) => {
246
+ const _img = new Image();
247
+ _img.src = url;
248
+ _img.onload = () => {
249
+ resolve(_img);
250
+ };
251
+ _img.onerror = reject;
252
+ });
253
+ };
254
+ const modelChange = () => {
255
+ if (!props.dataValue)
256
+ return;
257
+ if (styleData.value.model === oldData.value.model) {
258
+ styleData.value.data = oldData.value.data;
259
+ } else {
260
+ styleData.value.data = [];
261
+ }
262
+ callback(styleData.value);
263
+ };
264
+ const banner = computed(() => {
265
+ const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
266
+ return { banner: banner2, banner_theme_color, url: banner_url };
267
+ });
268
+ const hasBanner = computed({
269
+ get() {
270
+ var _a;
271
+ return !!((_a = banner.value) == null ? void 0 : _a.banner);
272
+ },
273
+ set(value) {
274
+ styleData.value.banner = value;
275
+ callback(styleData.value);
276
+ }
277
+ });
278
+ const pcBanner = computed(() => {
279
+ const { pc_banner_url_info, pc_banner_url } = styleData.value;
280
+ return { pc_banner_url_info, url: pc_banner_url };
281
+ });
282
+ const colorChange = (styleData2) => {
283
+ callback(styleData2);
284
+ };
285
+ return (_ctx, _cache) => {
286
+ var _a, _b, _c;
287
+ return openBlock(), createElementBlock("div", _hoisted_1, [
288
+ createElementVNode("div", _hoisted_2, [
289
+ createTextVNode(toDisplayString(_ctx.title ? _ctx.title : "\u5C01\u9762") + " ", 1),
290
+ ((_a = curtemplate.value) == null ? void 0 : _a.value) !== "4" ? (openBlock(), createElementBlock("span", _hoisted_3, "(" + toDisplayString((_b = curtemplate.value) == null ? void 0 : _b.alias) + "\u6BD4\u4F8B\uFF1A" + toDisplayString((_c = curtemplate.value) == null ? void 0 : _c.ratioStr) + ")", 1)) : createCommentVNode("v-if", true)
291
+ ]),
292
+ currentModel.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
293
+ (openBlock(true), createElementBlock(Fragment, null, renderList(currentModel.value.maxLength, (item, index) => {
294
+ return openBlock(), createBlock(_sfc_main$1, {
295
+ key: index,
296
+ id: `thumb-card-${index}`,
297
+ data: thumbList.value[index],
298
+ model: model.value,
299
+ "preview-list": previewList.value,
300
+ "thumb-model": "thumb",
301
+ onOpen: ($event) => openDialogMediaSelection($event, index)
302
+ }, null, 8, ["id", "data", "model", "preview-list", "onOpen"]);
303
+ }), 128))
304
+ ])) : createCommentVNode("v-if", true),
305
+ _ctx.mode === "doc" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
306
+ createCommentVNode(" \u9009\u62E9\u5927\u56FE\u3001\u4E09\u56FE\u3001\u5355\u56FE...\u7B49\u6A21\u5F0F "),
307
+ createVNode(unref(RadioGroup), {
308
+ modelValue: model.value,
309
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
310
+ size: "small",
311
+ type: "button",
312
+ onChange: modelChange
313
+ }, {
314
+ default: withCtx(() => [
315
+ (openBlock(true), createElementBlock(Fragment, null, renderList(modelList.value, (item, index) => {
316
+ return openBlock(), createBlock(unref(Radio), {
317
+ key: index,
318
+ value: item.value
319
+ }, {
320
+ default: withCtx(() => [
321
+ createTextVNode(toDisplayString(item.alias), 1)
322
+ ]),
323
+ _: 2
324
+ }, 1032, ["value"]);
325
+ }), 128))
326
+ ]),
327
+ _: 1
328
+ }, 8, ["modelValue"]),
329
+ createCommentVNode(" \u72EC\u7ACB\u8F6E\u535A\u56FE "),
330
+ createElementVNode("div", _hoisted_5, [
331
+ createElementVNode("div", _hoisted_6, [
332
+ _hoisted_7,
333
+ createVNode(unref(Switch), {
334
+ modelValue: hasBanner.value,
335
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => hasBanner.value = $event),
336
+ size: "small"
337
+ }, null, 8, ["modelValue"])
338
+ ]),
339
+ withDirectives(createVNode(_sfc_main$1, {
340
+ id: `banner-card`,
341
+ data: banner.value,
342
+ "preview-list": previewList.value,
343
+ "thumb-model": "banner",
344
+ onOpen: openDialogMediaSelection
345
+ }, null, 8, ["data", "preview-list"]), [
346
+ [vShow, hasBanner.value]
347
+ ]),
348
+ withDirectives(createElementVNode("div", _hoisted_8, _hoisted_10, 512), [
349
+ [vShow, hasBanner.value && styleData.value.banner_theme_color]
350
+ ]),
351
+ createCommentVNode(" banner\u8C03\u8272\u677F "),
352
+ withDirectives(createVNode(_sfc_main$2, {
353
+ "style-data": styleData.value,
354
+ model: "banner",
355
+ onChange: colorChange
356
+ }, null, 8, ["style-data"]), [
357
+ [vShow, hasBanner.value]
358
+ ])
359
+ ]),
360
+ createCommentVNode(" pc\u5C01\u9762\u56FE\uFF08\u4E13\u9898\u5934\u56FE\u5171\u7528\u4E00\u4E2A\u5B57\u6BB5\uFF09 "),
361
+ createElementVNode("div", _hoisted_11, [
362
+ createElementVNode("div", _hoisted_12, [
363
+ ["special", "special_v3"].includes(props.series) ? (openBlock(), createElementBlock("span", _hoisted_13, "\u4E13\u9898\u5934\u56FE")) : ["video_album", "audio_album"].includes(props.series) ? (openBlock(), createElementBlock("span", _hoisted_14, [
364
+ _hoisted_15,
365
+ createTextVNode("\u5C01\u9762\u5934\u56FE")
366
+ ])) : (openBlock(), createElementBlock("span", _hoisted_16, "PC\u5C01\u9762\u56FE")),
367
+ _hoisted_17
368
+ ]),
369
+ createVNode(_sfc_main$1, {
370
+ id: `pc-banner-card`,
371
+ data: pcBanner.value,
372
+ previewList: previewList.value,
373
+ thumbModel: "pcBanner",
374
+ onOpen: openDialogMediaSelection
375
+ }, null, 8, ["data", "previewList"]),
376
+ withDirectives(createElementVNode("div", _hoisted_18, _hoisted_20, 512), [
377
+ [vShow, docSeriesShowTopThemeColor.value && styleData.value.top_theme_color]
378
+ ]),
379
+ withDirectives(createVNode(_sfc_main$2, {
380
+ styleData: styleData.value,
381
+ model: "top",
382
+ onChange: colorChange
383
+ }, null, 8, ["styleData"]), [
384
+ [vShow, docSeriesShowTopThemeColor.value]
385
+ ])
386
+ ])
387
+ ], 64)) : createCommentVNode("v-if", true),
388
+ createVNode(_sfc_main$3, {
389
+ dialogVisible: dialogMediaSelectionShow.value,
390
+ "onUpdate:dialogVisible": _cache[2] || (_cache[2] = ($event) => dialogMediaSelectionShow.value = $event),
391
+ preview: false,
392
+ "catalog-props": "image",
393
+ ai_static_covers: _ctx.aiImages,
394
+ base_api: unref(BASE_API),
395
+ onSubmit: submitCallback
396
+ }, null, 8, ["dialogVisible", "ai_static_covers", "base_api"]),
397
+ createVNode(_sfc_main$4, {
398
+ visible: dialogCropperShow.value,
399
+ "onUpdate:visible": _cache[3] || (_cache[3] = ($event) => dialogCropperShow.value = $event),
400
+ "aspect-ratio-prop": aspectRatioProp.value,
401
+ BASE_API: unref(BASE_API),
402
+ "corp-data": cropperData.value,
403
+ "generate-assets": false,
404
+ onConfirm: cropConfirm
405
+ }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])
406
+ ]);
407
+ };
408
+ }
409
+ });
410
+ export { _sfc_main as default };
File without changes
@@ -0,0 +1,86 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createVNode, unref, Transition, withCtx, createElementVNode, withModifiers, createCommentVNode } from "vue";
2
+ import { Image } from "@arco-design/web-vue";
3
+ import { IconEdit, IconDelete, IconPlus } from "@arco-design/web-vue/es/icon";
4
+ const _hoisted_1 = {
5
+ key: 0,
6
+ class: "img-v"
7
+ };
8
+ const _hoisted_2 = ["onClick"];
9
+ const _hoisted_3 = ["onClick"];
10
+ const _hoisted_4 = ["onClick"];
11
+ const _sfc_main = defineComponent({
12
+ ...{ name: "thumbCard" },
13
+ __name: "card",
14
+ props: {
15
+ data: {},
16
+ previewList: {},
17
+ thumbModel: {},
18
+ along: { type: Boolean },
19
+ model: {}
20
+ },
21
+ emits: ["open", "remove"],
22
+ setup(__props, { emit }) {
23
+ const props = __props;
24
+ const classObj = computed(() => {
25
+ var _a;
26
+ if (!props.model)
27
+ return {};
28
+ return {
29
+ [`model-${props.model}`]: ((_a = props.data) == null ? void 0 : _a.url) && props.model
30
+ };
31
+ });
32
+ const clickMask = () => {
33
+ props.along && openDialogMediaSelection();
34
+ };
35
+ const openDialogMediaSelection = () => {
36
+ emit("open", props.thumbModel);
37
+ };
38
+ const remove = () => {
39
+ emit("remove");
40
+ };
41
+ return (_ctx, _cache) => {
42
+ var _a, _b;
43
+ return openBlock(), createElementBlock("div", {
44
+ class: normalizeClass(["thumb-card-container", classObj.value])
45
+ }, [
46
+ ((_a = props.data) == null ? void 0 : _a.url) ? (openBlock(), createElementBlock("div", _hoisted_1, [
47
+ createVNode(unref(Image), {
48
+ class: "item",
49
+ fit: "cover",
50
+ src: (_b = props.data) == null ? void 0 : _b.url
51
+ }, null, 8, ["src"]),
52
+ createVNode(Transition, { name: "fade" }, {
53
+ default: withCtx(() => [
54
+ createElementVNode("div", {
55
+ class: "mask",
56
+ onClick: clickMask
57
+ }, [
58
+ createElementVNode("span", {
59
+ class: "half",
60
+ onClick: withModifiers(openDialogMediaSelection, ["stop"])
61
+ }, [
62
+ createVNode(unref(IconEdit))
63
+ ], 8, _hoisted_2),
64
+ _ctx.along ? (openBlock(), createElementBlock("span", {
65
+ key: 0,
66
+ class: "half",
67
+ onClick: withModifiers(remove, ["stop"])
68
+ }, [
69
+ createVNode(unref(IconDelete))
70
+ ], 8, _hoisted_3)) : createCommentVNode("v-if", true)
71
+ ])
72
+ ]),
73
+ _: 1
74
+ })
75
+ ])) : (openBlock(), createElementBlock("div", {
76
+ key: 1,
77
+ class: "item add-thumb",
78
+ onClick: withModifiers(openDialogMediaSelection, ["stop"])
79
+ }, [
80
+ createVNode(unref(IconPlus))
81
+ ], 8, _hoisted_4))
82
+ ], 2);
83
+ };
84
+ }
85
+ });
86
+ export { _sfc_main as default };
File without changes
@@ -0,0 +1,75 @@
1
+ import { defineComponent, ref, watch, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock, normalizeStyle, createCommentVNode } from "vue";
2
+ import { RadioGroup, Radio } from "@arco-design/web-vue";
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "color-palette-container"
6
+ };
7
+ const _sfc_main = defineComponent({
8
+ __name: "colorPalette",
9
+ props: {
10
+ styleData: {},
11
+ model: {}
12
+ },
13
+ emits: ["change"],
14
+ setup(__props, { emit }) {
15
+ const props = __props;
16
+ const color = ref("rgb(101,121,109)");
17
+ const colorList = ref([]);
18
+ watch(
19
+ () => props.styleData,
20
+ () => {
21
+ if (props.styleData) {
22
+ const _color = props.styleData[`${props.model}_theme_color`] || "";
23
+ color.value = colorRgb(_color);
24
+ const colorList2 = props.styleData.value[`${props.model}_colorList`];
25
+ if (colorList2 == null ? void 0 : colorList2.length) {
26
+ colorList2.value = colorList2.map((color2) => `rgb(${color2})`);
27
+ } else if (color.value) {
28
+ colorList2.value = [color.value];
29
+ }
30
+ }
31
+ }
32
+ );
33
+ const colorChange = (color2) => {
34
+ if (color2) {
35
+ color2.value = color2.replace(/\s+/g, "");
36
+ const styleData = JSON.parse(JSON.stringify(props.styleData));
37
+ styleData[`${props.model}_theme_color`] = color2.value;
38
+ emit("change", styleData);
39
+ }
40
+ };
41
+ const colorRgb = (_color) => {
42
+ if (_color.includes("rgb")) {
43
+ return _color;
44
+ }
45
+ const colorChange2 = [];
46
+ for (let i = 1; i < 7; i += 2) {
47
+ colorChange2.push(parseInt(`0x${_color.slice(i, i + 2)}`, 10) || 0);
48
+ }
49
+ return `rgb(${colorChange2.join(",")})`;
50
+ };
51
+ return (_ctx, _cache) => {
52
+ return colorList.value && colorList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
53
+ createVNode(unref(RadioGroup), {
54
+ modelValue: color.value,
55
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => color.value = $event),
56
+ class: "color-radio-group",
57
+ type: "button",
58
+ onChange: colorChange
59
+ }, {
60
+ default: withCtx(() => [
61
+ (openBlock(true), createElementBlock(Fragment, null, renderList(colorList.value, (colr, index) => {
62
+ return openBlock(), createBlock(unref(Radio), {
63
+ key: index,
64
+ style: normalizeStyle({ background: `${colr}` }),
65
+ value: colr
66
+ }, null, 8, ["style", "value"]);
67
+ }), 128))
68
+ ]),
69
+ _: 1
70
+ }, 8, ["modelValue"])
71
+ ])) : createCommentVNode("v-if", true);
72
+ };
73
+ }
74
+ });
75
+ export { _sfc_main as default };
@@ -0,0 +1,2 @@
1
+ declare const selectThumb: any;
2
+ export default selectThumb;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./component.js";
2
+ const selectThumb = Object.assign(_sfc_main, {
3
+ install: (app) => {
4
+ app.component(_sfc_main.name, _sfc_main);
5
+ }
6
+ });
7
+ export { selectThumb as default };
@@ -0,0 +1,79 @@
1
+ .thumb-card-container {
2
+ width: 100px;
3
+ height: 58px;
4
+ margin-right: 10px;
5
+ border-radius: 4px;
6
+ overflow: hidden;
7
+ position: relative;
8
+ &.model-5 {
9
+ width: 75px;
10
+ height: 100px;
11
+ }
12
+ &.model-7 {
13
+ width: 232px;
14
+ height: 58px;
15
+ }
16
+ .img-v {
17
+ width: 100%;
18
+ height: 100%;
19
+ position: relative;
20
+ .change-icon {
21
+ width: 25px;
22
+ height: 25px;
23
+ font-size: 25px;
24
+ position: absolute;
25
+ left: 0;
26
+ right: 0;
27
+ top: 0;
28
+ bottom: 0;
29
+ margin: auto;
30
+ z-index: 1;
31
+ color: #ffffff;
32
+ cursor: pointer;
33
+ }
34
+ }
35
+ .item {
36
+ width: 100%;
37
+ height: 100%;
38
+ cursor: pointer;
39
+ &.add-thumb {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ background-color: #f9f9f9;
44
+ }
45
+ }
46
+ .mask {
47
+ display: none;
48
+ width: 100%;
49
+ height: 100%;
50
+ background: rgba(0, 0, 0, 0.3);
51
+ position: absolute;
52
+ top: 0;
53
+ // display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ color: #eaeaea;
57
+ font-size: 18px;
58
+ i {
59
+ display: inline-block;
60
+ cursor: pointer;
61
+ &:active {
62
+ opacity: 0.4;
63
+ }
64
+ }
65
+ .half {
66
+ height: 100%;
67
+ width: 48%;
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ &:hover {
72
+ opacity: 0.7;
73
+ }
74
+ }
75
+ }
76
+ .img-v:hover .mask {
77
+ display: flex;
78
+ }
79
+ }
File without changes
@@ -0,0 +1 @@
1
+ import "./index.css";