@cmstops/pro-compo 0.3.12 → 0.3.14

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.
@@ -0,0 +1,108 @@
1
+ .medialist-group-piece-item-view {
2
+ display: flex;
3
+ // width: 100%;
4
+ padding: 10px;
5
+ border-bottom: 1px solid #f0f0f0;
6
+
7
+ &:hover {
8
+ background: #fafafa;
9
+ }
10
+
11
+ .cover-view {
12
+ position: relative;
13
+ flex-shrink: 0;
14
+ width: 110px;
15
+ height: 70px;
16
+ margin-right: 20px;
17
+ background: transparent;
18
+
19
+ .image {
20
+ width: 100%;
21
+ height: 100%;
22
+ border-radius: 4px;
23
+
24
+ img {
25
+ width: 100%;
26
+ height: 100%;
27
+ }
28
+ }
29
+
30
+ .no-img {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: 100%;
35
+ height: 100%;
36
+ color: white;
37
+ font-size: 30px;
38
+ }
39
+ }
40
+
41
+ .info-view {
42
+ display: flex;
43
+ flex-direction: column;
44
+ justify-content: space-between;
45
+ width: calc(100% - 130px);
46
+ padding: 2px 0;
47
+
48
+ .title {
49
+ display: flex;
50
+ align-items: center;
51
+ margin-bottom: 10px;
52
+ overflow: hidden;
53
+ color: #1d2129;
54
+ font-weight: 400;
55
+ font-size: 16px;
56
+ font-style: normal;
57
+ line-height: 22px;
58
+ cursor: pointer;
59
+ -webkit-line-clamp: 2;
60
+ -webkit-box-orient: vertical;
61
+ }
62
+
63
+ .abttrite-v {
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+
68
+ .left {
69
+ display: flex;
70
+ flex: 1;
71
+ align-items: center;
72
+ min-width: 510px;
73
+ color: #808692;
74
+ font-size: 12px;
75
+
76
+ .icon {
77
+ margin-right: 8px;
78
+ }
79
+
80
+ .tags {
81
+ display: inline-block;
82
+ width: 200px;
83
+ overflow: hidden;
84
+ white-space: nowrap;
85
+ text-overflow: ellipsis;
86
+ cursor: pointer;
87
+ }
88
+
89
+ .abttr {
90
+ width: 35%;
91
+ overflow: hidden;
92
+ white-space: nowrap;
93
+ text-overflow: ellipsis;
94
+ cursor: pointer;
95
+
96
+ &.value {
97
+ margin-left: 10px;
98
+ }
99
+ }
100
+ }
101
+
102
+ .right {
103
+ flex-shrink: 0;
104
+ margin-right: 20px;
105
+ }
106
+ }
107
+ }
108
+ }
@@ -639,6 +639,99 @@
639
639
  .popper-categories {
640
640
  max-width: 600px;
641
641
  }
642
+ .medialist-group-piece-item-view {
643
+ display: flex;
644
+ padding: 10px;
645
+ border-bottom: 1px solid #f0f0f0;
646
+ }
647
+ .medialist-group-piece-item-view:hover {
648
+ background: #fafafa;
649
+ }
650
+ .medialist-group-piece-item-view .cover-view {
651
+ position: relative;
652
+ flex-shrink: 0;
653
+ width: 110px;
654
+ height: 70px;
655
+ margin-right: 20px;
656
+ background: transparent;
657
+ }
658
+ .medialist-group-piece-item-view .cover-view .image {
659
+ width: 100%;
660
+ height: 100%;
661
+ border-radius: 4px;
662
+ }
663
+ .medialist-group-piece-item-view .cover-view .image img {
664
+ width: 100%;
665
+ height: 100%;
666
+ }
667
+ .medialist-group-piece-item-view .cover-view .no-img {
668
+ display: flex;
669
+ align-items: center;
670
+ justify-content: center;
671
+ width: 100%;
672
+ height: 100%;
673
+ color: white;
674
+ font-size: 30px;
675
+ }
676
+ .medialist-group-piece-item-view .info-view {
677
+ display: flex;
678
+ flex-direction: column;
679
+ justify-content: space-between;
680
+ width: calc(100% - 130px);
681
+ padding: 2px 0;
682
+ }
683
+ .medialist-group-piece-item-view .info-view .title {
684
+ display: flex;
685
+ align-items: center;
686
+ margin-bottom: 10px;
687
+ overflow: hidden;
688
+ color: #1d2129;
689
+ font-weight: 400;
690
+ font-size: 16px;
691
+ font-style: normal;
692
+ line-height: 22px;
693
+ cursor: pointer;
694
+ -webkit-line-clamp: 2;
695
+ -webkit-box-orient: vertical;
696
+ }
697
+ .medialist-group-piece-item-view .info-view .abttrite-v {
698
+ display: flex;
699
+ align-items: center;
700
+ justify-content: space-between;
701
+ }
702
+ .medialist-group-piece-item-view .info-view .abttrite-v .left {
703
+ display: flex;
704
+ flex: 1;
705
+ align-items: center;
706
+ min-width: 510px;
707
+ color: #808692;
708
+ font-size: 12px;
709
+ }
710
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .icon {
711
+ margin-right: 8px;
712
+ }
713
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .tags {
714
+ display: inline-block;
715
+ width: 200px;
716
+ overflow: hidden;
717
+ white-space: nowrap;
718
+ text-overflow: ellipsis;
719
+ cursor: pointer;
720
+ }
721
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .abttr {
722
+ width: 35%;
723
+ overflow: hidden;
724
+ white-space: nowrap;
725
+ text-overflow: ellipsis;
726
+ cursor: pointer;
727
+ }
728
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .abttr.value {
729
+ margin-left: 10px;
730
+ }
731
+ .medialist-group-piece-item-view .info-view .abttrite-v .right {
732
+ flex-shrink: 0;
733
+ margin-right: 20px;
734
+ }
642
735
  .medialist-mpdoc-item-view {
643
736
  display: flex;
644
737
  padding: 10px;
@@ -6,6 +6,7 @@
6
6
  @import './MaccountItem.less';
7
7
  @import './Doc.less';
8
8
  @import './DocItem.less';
9
+ @import './GroupPieceItem.less';
9
10
  @import './DocMpItem.less';
10
11
  @import './courseItem.less';
11
12
  @import './funhdItem.less';
package/lib/index.css CHANGED
@@ -2666,6 +2666,99 @@
2666
2666
  .popper-categories {
2667
2667
  max-width: 600px;
2668
2668
  }
2669
+ .medialist-group-piece-item-view {
2670
+ display: flex;
2671
+ padding: 10px;
2672
+ border-bottom: 1px solid #f0f0f0;
2673
+ }
2674
+ .medialist-group-piece-item-view:hover {
2675
+ background: #fafafa;
2676
+ }
2677
+ .medialist-group-piece-item-view .cover-view {
2678
+ position: relative;
2679
+ flex-shrink: 0;
2680
+ width: 110px;
2681
+ height: 70px;
2682
+ margin-right: 20px;
2683
+ background: transparent;
2684
+ }
2685
+ .medialist-group-piece-item-view .cover-view .image {
2686
+ width: 100%;
2687
+ height: 100%;
2688
+ border-radius: 4px;
2689
+ }
2690
+ .medialist-group-piece-item-view .cover-view .image img {
2691
+ width: 100%;
2692
+ height: 100%;
2693
+ }
2694
+ .medialist-group-piece-item-view .cover-view .no-img {
2695
+ display: flex;
2696
+ align-items: center;
2697
+ justify-content: center;
2698
+ width: 100%;
2699
+ height: 100%;
2700
+ color: white;
2701
+ font-size: 30px;
2702
+ }
2703
+ .medialist-group-piece-item-view .info-view {
2704
+ display: flex;
2705
+ flex-direction: column;
2706
+ justify-content: space-between;
2707
+ width: calc(100% - 130px);
2708
+ padding: 2px 0;
2709
+ }
2710
+ .medialist-group-piece-item-view .info-view .title {
2711
+ display: flex;
2712
+ align-items: center;
2713
+ margin-bottom: 10px;
2714
+ overflow: hidden;
2715
+ color: #1d2129;
2716
+ font-weight: 400;
2717
+ font-size: 16px;
2718
+ font-style: normal;
2719
+ line-height: 22px;
2720
+ cursor: pointer;
2721
+ -webkit-line-clamp: 2;
2722
+ -webkit-box-orient: vertical;
2723
+ }
2724
+ .medialist-group-piece-item-view .info-view .abttrite-v {
2725
+ display: flex;
2726
+ align-items: center;
2727
+ justify-content: space-between;
2728
+ }
2729
+ .medialist-group-piece-item-view .info-view .abttrite-v .left {
2730
+ display: flex;
2731
+ flex: 1;
2732
+ align-items: center;
2733
+ min-width: 510px;
2734
+ color: #808692;
2735
+ font-size: 12px;
2736
+ }
2737
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .icon {
2738
+ margin-right: 8px;
2739
+ }
2740
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .tags {
2741
+ display: inline-block;
2742
+ width: 200px;
2743
+ overflow: hidden;
2744
+ white-space: nowrap;
2745
+ text-overflow: ellipsis;
2746
+ cursor: pointer;
2747
+ }
2748
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .abttr {
2749
+ width: 35%;
2750
+ overflow: hidden;
2751
+ white-space: nowrap;
2752
+ text-overflow: ellipsis;
2753
+ cursor: pointer;
2754
+ }
2755
+ .medialist-group-piece-item-view .info-view .abttrite-v .left .abttr.value {
2756
+ margin-left: 10px;
2757
+ }
2758
+ .medialist-group-piece-item-view .info-view .abttrite-v .right {
2759
+ flex-shrink: 0;
2760
+ margin-right: 20px;
2761
+ }
2669
2762
  .medialist-mpdoc-item-view {
2670
2763
  display: flex;
2671
2764
  padding: 10px;
@@ -7,6 +7,7 @@ var component$1 = require("../imageCrop/component.js");
7
7
  var card = require("./components/card.js");
8
8
  var colorPalette = require("./components/colorPalette.js");
9
9
  var config = require("../config.js");
10
+ var index = require("../utils/index.js");
10
11
  const _hoisted_1 = {
11
12
  key: 0,
12
13
  class: "star"
@@ -236,14 +237,14 @@ const _sfc_main = vue.defineComponent({
236
237
  tempThumbFiles.value.push(data);
237
238
  submitCallback(tempThumbFiles.value);
238
239
  };
239
- const changeThumbType = (type, index) => {
240
+ const changeThumbType = (type, index2) => {
240
241
  tempThumbFiles.value = [];
241
242
  thumbBannerModel.value = type;
242
- thumbOptionIndex.value = index;
243
+ thumbOptionIndex.value = index2;
243
244
  };
244
- const openDialogMediaSelection = (type, index) => {
245
+ const openDialogMediaSelection = (type, index2) => {
245
246
  thumbBannerModel.value = type || "thumb";
246
- thumbOptionIndex.value = index || 0;
247
+ thumbOptionIndex.value = index2 || 0;
247
248
  dialogMediaSelectionShow.value = true;
248
249
  };
249
250
  const docSeriesShowTopThemeColor = vue.computed(() => {
@@ -280,9 +281,27 @@ const _sfc_main = vue.defineComponent({
280
281
  styleData.value.data = temp;
281
282
  } else if (thumbBannerModel.value === "banner") {
282
283
  styleData.value.banner_url = data[0].url;
284
+ const getColors = index.getThemeColor(BASE_API, data[0].url);
285
+ getColors.then((themes) => {
286
+ styleData.value.banner_colorList = JSON.parse(JSON.stringify(themes));
287
+ styleData.value.banner_theme_color = `rgb(${themes[1]})`;
288
+ callback(styleData.value);
289
+ }).catch((e) => {
290
+ styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
291
+ callback(styleData.value);
292
+ });
283
293
  } else {
284
294
  styleData.value.top_image_url = data[0].url;
285
295
  styleData.value.pc_banner_url = data[0].url;
296
+ const getColors = index.getThemeColor(BASE_API, data[0].url);
297
+ getColors.then((themes) => {
298
+ styleData.value.top_colorList = JSON.parse(JSON.stringify(themes));
299
+ styleData.value.top_theme_color = `rgb(${themes[1]})`;
300
+ callback(styleData.value);
301
+ }).catch((e) => {
302
+ styleData.value.top_theme_color = `rgb(255, 255, 255)`;
303
+ callback(styleData.value);
304
+ });
286
305
  }
287
306
  callback(styleData.value);
288
307
  dialogMediaSelectionShow.value = false;
@@ -390,40 +409,40 @@ const _sfc_main = vue.defineComponent({
390
409
  ], 4)) : vue.createCommentVNode("v-if", true),
391
410
  vue.createElementVNode("div", _hoisted_3, [
392
411
  ["thumbs"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
393
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbsLengthList.value, (item, index) => {
412
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbsLengthList.value, (item, index2) => {
394
413
  return vue.openBlock(), vue.createBlock(card, {
395
- key: index,
396
- id: `thumb-card-${index}`,
397
- data: thumbList.value[index],
398
- "onUpdate:data": ($event) => thumbList.value[index] = $event,
414
+ key: index2,
415
+ id: `thumb-card-${index2}`,
416
+ data: thumbList.value[index2],
417
+ "onUpdate:data": ($event) => thumbList.value[index2] = $event,
399
418
  parentRef: selectThumbRef.value,
400
- idx: index,
419
+ idx: index2,
401
420
  "preview-list": previewList.value,
402
421
  "thumb-model": "thumb",
403
422
  onFileForShowThumb: fileForShowThumb,
404
423
  onChangeThumbType: changeThumbType,
405
424
  onUploadLocal: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb)),
406
- onOpen: ($event) => openDialogMediaSelection($event, index)
425
+ onOpen: ($event) => openDialogMediaSelection($event, index2)
407
426
  }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "idx", "preview-list", "onOpen"]);
408
427
  }), 128))
409
428
  ])) : currentModel.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
410
429
  vue.createCommentVNode(" \u5C01\u9762\u56FEcard "),
411
430
  vue.createElementVNode("div", _hoisted_5, [
412
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentModel.value.maxLength, (item, index) => {
431
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentModel.value.maxLength, (item, index2) => {
413
432
  return vue.openBlock(), vue.createBlock(card, {
414
- key: index,
415
- id: `thumb-card-${index}`,
416
- data: thumbList.value[index],
417
- "onUpdate:data": ($event) => thumbList.value[index] = $event,
433
+ key: index2,
434
+ id: `thumb-card-${index2}`,
435
+ data: thumbList.value[index2],
436
+ "onUpdate:data": ($event) => thumbList.value[index2] = $event,
418
437
  parentRef: selectThumbRef.value,
419
438
  model: model.value,
420
- idx: index,
439
+ idx: index2,
421
440
  "preview-list": previewList.value,
422
441
  "thumb-model": "thumb",
423
442
  onFileForShowThumb: fileForShowThumb,
424
443
  onChangeThumbType: changeThumbType,
425
444
  onUploadLocal: _cache[1] || (_cache[1] = (cb) => _ctx.$emit("upload", cb)),
426
- onOpen: ($event) => openDialogMediaSelection($event, index)
445
+ onOpen: ($event) => openDialogMediaSelection($event, index2)
427
446
  }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "model", "idx", "preview-list", "onOpen"]);
428
447
  }), 128))
429
448
  ])
@@ -443,9 +462,9 @@ const _sfc_main = vue.defineComponent({
443
462
  onChange: modelChange
444
463
  }, {
445
464
  default: vue.withCtx(() => [
446
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modelList.value, (item, index) => {
465
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modelList.value, (item, index2) => {
447
466
  return vue.openBlock(), vue.createBlock(vue.unref(webVue.Radio), {
448
- key: index,
467
+ key: index2,
449
468
  value: item.value
450
469
  }, {
451
470
  default: vue.withCtx(() => [
@@ -111,7 +111,8 @@ const _sfc_main = vue.defineComponent({
111
111
  ])) : (vue.openBlock(), vue.createElementBlock("div", {
112
112
  key: 1,
113
113
  class: "item add-thumb",
114
- style: vue.normalizeStyle({ backgroundImage: `url(${waterBg})` })
114
+ style: vue.normalizeStyle({ backgroundImage: `url(${waterBg})` }),
115
+ onClick: openDialogMediaSelection
115
116
  }, [
116
117
  vue.createVNode(vue.unref(icon.IconPlus))
117
118
  ], 4))
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  var dayjs = require("dayjs");
4
+ var ColorThief = require("colorthief");
5
+ var api = require("../imageCrop/script/api.js");
6
+ var config = require("../config.js");
4
7
  function _interopDefaultLegacy(e) {
5
8
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
6
9
  }
7
10
  var dayjs__default = /* @__PURE__ */ _interopDefaultLegacy(dayjs);
11
+ var ColorThief__default = /* @__PURE__ */ _interopDefaultLegacy(ColorThief);
8
12
  const dateYYYYDDMMHHmm = (date) => {
9
13
  if (!date)
10
14
  return "--";
@@ -66,8 +70,54 @@ const validateForm = (formRef) => {
66
70
  }
67
71
  });
68
72
  };
73
+ function getRealUrl(BASE_API, url) {
74
+ return new Promise((resove, reject) => {
75
+ try {
76
+ const flag = !url.includes("/poplar/v2");
77
+ const cape = url.includes("cape/v1/upload");
78
+ const extented = !url.includes(BASE_API) && !url.includes(config.DEFAULT_UPLOAD_URL);
79
+ if (flag || extented || cape) {
80
+ resove(url);
81
+ } else {
82
+ api.getFileRealUrl(BASE_API, url).then((res) => {
83
+ resove(res.message);
84
+ });
85
+ }
86
+ } catch (e) {
87
+ reject(e);
88
+ }
89
+ });
90
+ }
91
+ function getThemeColor(BASE_API, src) {
92
+ return new Promise((resolve, reject) => {
93
+ const getUrl = getRealUrl(BASE_API, src);
94
+ getUrl.then((url) => {
95
+ const colorThief = new ColorThief__default["default"]();
96
+ const img = document.createElement("img");
97
+ img.crossOrigin = "Anonymous";
98
+ img.setAttribute("src", `${url}?t=${+new Date()}`);
99
+ img.onload = () => {
100
+ let themeColors = [];
101
+ const getResult = colorThief.getPalette(img);
102
+ if (getResult) {
103
+ themeColors = getResult.slice(0, 6);
104
+ } else {
105
+ themeColors = [[255, 255, 255]];
106
+ }
107
+ resolve(themeColors);
108
+ };
109
+ img.onerror = (e) => {
110
+ reject(e);
111
+ };
112
+ }).catch((e) => {
113
+ reject(e);
114
+ });
115
+ });
116
+ }
69
117
  exports.dateYYYYDDMMHHmm = dateYYYYDDMMHHmm;
70
118
  exports.generateUUID = generateUUID;
119
+ exports.getRealUrl = getRealUrl;
120
+ exports.getThemeColor = getThemeColor;
71
121
  exports.noCoverText = noCoverText;
72
122
  exports.replaceSuffix = replaceSuffix;
73
123
  exports.timeFormat = timeFormat;
@@ -18,7 +18,7 @@ const key_target_type_map = {
18
18
  16: "mp_content",
19
19
  17: "funhd",
20
20
  18: "course",
21
- 19: "matrix"
21
+ 19: "group_piece"
22
22
  };
23
23
  const approveFlowStatusMap = {
24
24
  1: "\u5BA1\u6838\u4E2D",
@@ -30,6 +30,11 @@ const approveFlowStatusMap = {
30
30
  7: "\u91CD\u65B0\u53D1\u8D77",
31
31
  8: "\u5DF2\u7ED3\u675F"
32
32
  };
33
+ const groupPieceType = {
34
+ category_list: "\u7ED1\u5B9A\u9891\u9053",
35
+ component: "\u7ED1\u5B9A\u7EC4\u4EF6",
36
+ special: "\u7ED1\u5B9A\u4E13\u9898"
37
+ };
33
38
  const componentsColumns = {
34
39
  banner: { value: "banner", label: "\u8F6E\u64AD\u7EC4\u4EF6" },
35
40
  top: { value: "top", label: "\u7F6E\u9876\u7EC4\u4EF6" },
@@ -45,7 +50,8 @@ const componentsColumns = {
45
50
  kongo: { value: "kongo", label: "\u529F\u80FD\u5BFC\u822A\u7EC4\u4EF6" },
46
51
  picture: { value: "picture", label: "\u56FE\u7247\u7EC4\u4EF6", simple: true },
47
52
  timeline: { value: "timeline", label: "\u65F6\u95F4\u94FE\u7EC4\u4EF6" },
48
- rank: { value: "rank", label: "\u699C\u5355\u7EC4\u4EF6" }
53
+ rank: { value: "rank", label: "\u699C\u5355\u7EC4\u4EF6" },
54
+ group_piece: { value: "group_piece", label: "\u5206\u7EC4\u7EC4\u4EF6" }
49
55
  };
50
56
  const compoColumnsMap = () => {
51
57
  const obj = {};
@@ -162,6 +168,7 @@ exports.componentsColumns = componentsColumns;
162
168
  exports.contentList_layout_map = contentList_layout_map;
163
169
  exports.contentList_list_type_map = contentList_list_type_map;
164
170
  exports.contentList_relation_type_map = contentList_relation_type_map;
171
+ exports.groupPieceType = groupPieceType;
165
172
  exports.ilive_type_map = ilive_type_map;
166
173
  exports.key_target_type_map = key_target_type_map;
167
174
  exports.kongo_source_map = kongo_source_map;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",