@cmstops/pro-compo 0.1.14 → 0.1.16

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