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