@cmstops/pro-compo 0.3.35 → 0.3.37

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 (64) hide show
  1. package/dist/index.css +156 -2
  2. package/dist/index.min.css +1 -1
  3. package/es/docPreview/component.d.ts +0 -0
  4. package/es/docPreview/component.js +153 -0
  5. package/es/docPreview/components/PreviewIframe.d.ts +0 -0
  6. package/es/docPreview/components/PreviewIframe.js +37 -0
  7. package/es/docPreview/images/phone.js +2 -0
  8. package/es/docPreview/index.d.ts +2 -0
  9. package/es/docPreview/index.js +7 -0
  10. package/es/docPreview/scripts/api.d.ts +1 -0
  11. package/es/docPreview/scripts/hook.d.ts +20 -0
  12. package/es/docPreview/scripts/hook.js +119 -0
  13. package/es/docPreview/style/css.js +1 -0
  14. package/es/docPreview/style/index.css +139 -0
  15. package/es/docPreview/style/index.d.ts +1 -0
  16. package/es/docPreview/style/index.js +1 -0
  17. package/es/docPreview/style/index.less +129 -0
  18. package/es/docPreview/style/previewIframe.less +36 -0
  19. package/es/hooks/useSelection.js +1 -1
  20. package/es/index.css +156 -2
  21. package/es/index.d.ts +1 -0
  22. package/es/index.js +1 -0
  23. package/es/index.less +1 -0
  24. package/es/selectResourceModal/component.js +7 -9
  25. package/es/selectResourceModal/components/ListContent/index.js +4 -1
  26. package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +2 -13
  27. package/es/selectResourceModal/components/ListContentLocal/index.js +4 -1
  28. package/es/selectResourceModal/components/ListFilter/index.js +3 -2
  29. package/es/selectResourceModal/style/index.css +1 -1
  30. package/es/selectResourceModal/style/index.less +1 -1
  31. package/es/thumbCard/component.js +15 -15
  32. package/es/thumbCard/style/index.css +16 -1
  33. package/es/thumbCard/style/index.less +24 -7
  34. package/es/utils/index.d.ts +2 -0
  35. package/es/utils/index.js +40 -1
  36. package/es/utils/typeMap.d.ts +2 -5
  37. package/es/utils/typeMap.js +2 -1
  38. package/lib/docPreview/component.js +154 -0
  39. package/lib/docPreview/components/PreviewIframe.js +38 -0
  40. package/lib/docPreview/images/phone.js +3 -0
  41. package/lib/docPreview/index.js +8 -0
  42. package/lib/docPreview/scripts/hook.js +123 -0
  43. package/lib/docPreview/style/css.js +2 -0
  44. package/lib/docPreview/style/index.css +139 -0
  45. package/lib/docPreview/style/index.js +2 -0
  46. package/lib/docPreview/style/index.less +129 -0
  47. package/lib/docPreview/style/previewIframe.less +36 -0
  48. package/lib/hooks/useSelection.js +1 -1
  49. package/lib/index.css +156 -2
  50. package/lib/index.js +2 -0
  51. package/lib/index.less +1 -0
  52. package/lib/selectResourceModal/component.js +6 -8
  53. package/lib/selectResourceModal/components/ListContent/index.js +4 -1
  54. package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +1 -12
  55. package/lib/selectResourceModal/components/ListContentLocal/index.js +4 -1
  56. package/lib/selectResourceModal/components/ListFilter/index.js +3 -2
  57. package/lib/selectResourceModal/style/index.css +1 -1
  58. package/lib/selectResourceModal/style/index.less +1 -1
  59. package/lib/thumbCard/component.js +15 -15
  60. package/lib/thumbCard/style/index.css +16 -1
  61. package/lib/thumbCard/style/index.less +24 -7
  62. package/lib/utils/index.js +41 -0
  63. package/lib/utils/typeMap.js +2 -1
  64. package/package.json +1 -1
@@ -38,18 +38,7 @@ const _sfc_main = vue.defineComponent({
38
38
  ]),
39
39
  _: 1
40
40
  }),
41
- vue.createVNode(vue.unref(webVue.Button), { type: "primary" }, {
42
- default: vue.withCtx(() => [
43
- vue.createTextVNode(" \u626B\u7801\u4E0A\u4F20 ")
44
- ]),
45
- _: 1
46
- }),
47
- vue.createVNode(vue.unref(webVue.Button), { type: "primary" }, {
48
- default: vue.withCtx(() => [
49
- vue.createTextVNode(" \u5206\u4EAB\u4E0A\u4F20 ")
50
- ]),
51
- _: 1
52
- })
41
+ vue.createCommentVNode(' <a-button type="primary"> \u626B\u7801\u4E0A\u4F20 </a-button>\n <a-button type="primary"> \u5206\u4EAB\u4E0A\u4F20 </a-button> ')
53
42
  ]),
54
43
  vue.createElementVNode("div", _hoisted_3, [
55
44
  vue.createVNode(vue.unref(webVue.Upload), {
@@ -71,10 +71,13 @@ const _sfc_main = vue.defineComponent({
71
71
  thumb: item.url,
72
72
  catalog: item.catalog,
73
73
  meta: item,
74
+ options: {
75
+ fit: item.catalog === "image" ? "contain" : "cover"
76
+ },
74
77
  "use-mask": true,
75
78
  "handlers-key": handlersKey.value,
76
79
  onHandle: handleOption
77
- }, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key"])
80
+ }, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"])
78
81
  ]),
79
82
  _: 2
80
83
  }, 1032, ["item", "select-keys", "disable", "onSelect"]);
@@ -95,7 +95,7 @@ const _sfc_main = vue.defineComponent({
95
95
  });
96
96
  const isEmpty = vue.computed(() => {
97
97
  return Object.keys(filter.value).every((key) => {
98
- return !filter.value[key];
98
+ return filter.value[key] === originFilter[key];
99
99
  });
100
100
  });
101
101
  vue.watch(
@@ -110,13 +110,14 @@ const _sfc_main = vue.defineComponent({
110
110
  });
111
111
  emits("change", result);
112
112
  },
113
- { deep: true }
113
+ { deep: true, immediate: true }
114
114
  );
115
115
  vue.onMounted(() => {
116
116
  var _a;
117
117
  load();
118
118
  if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
119
119
  filter.value.catalog = props.filterOptions.mediaType;
120
+ originFilter.catalog = props.filterOptions.mediaType;
120
121
  }
121
122
  });
122
123
  return (_ctx, _cache) => {
@@ -175,7 +175,7 @@
175
175
  padding: 0 40px;
176
176
  }
177
177
  .resource-select-container .resource-select-header {
178
- padding: 10px 24px 0;
178
+ padding: 10px 24px 0 24px;
179
179
  }
180
180
  .resource-select-container .resource-select-header .arco-tabs-nav::before {
181
181
  display: none;
@@ -31,7 +31,7 @@
31
31
  }
32
32
 
33
33
  .resource-select-header {
34
- padding: 10px 24px 0;
34
+ padding: 10px 24px 0 24px;
35
35
 
36
36
  .arco-tabs-nav::before {
37
37
  display: none;
@@ -4,12 +4,15 @@ var icon = require("@arco-design/web-vue/es/icon");
4
4
  var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
5
5
  var webVue = require("@arco-design/web-vue");
6
6
  var magic = require("./assets/magic.js");
7
+ var config = require("../config.js");
8
+ var index = require("../utils/index.js");
7
9
  const _hoisted_1 = {
8
10
  key: 0,
9
11
  class: "thumb-upload-loading"
10
12
  };
11
13
  const _hoisted_2 = { class: "thumb-handler-list" };
12
14
  const _hoisted_3 = ["onClick"];
15
+ const _hoisted_4 = { class: "thumb-select-tag" };
13
16
  const _sfc_main = vue.defineComponent({
14
17
  ...{ name: "thumbCard" },
15
18
  __name: "component",
@@ -28,12 +31,18 @@ const _sfc_main = vue.defineComponent({
28
31
  setup(__props, { emit: __emit }) {
29
32
  const props = __props;
30
33
  const emits = __emit;
34
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
31
35
  const WATER_BG_URL = magic;
32
36
  const isUploading = vue.computed(() => {
33
37
  var _a;
34
38
  return ((_a = props.meta) == null ? void 0 : _a.progress) != null;
35
39
  });
36
- const thumb = vue.computed(() => props.thumb || props.url || "");
40
+ const thumb = vue.computed(() => {
41
+ if (["image", "video"].includes(props.catalog || "")) {
42
+ return props.thumb || props.url || "";
43
+ }
44
+ return `${BASE_API}/static/img/music.2ee269c.png`;
45
+ });
37
46
  const styleObject = vue.computed(() => {
38
47
  const style = {};
39
48
  if (props.useMask) {
@@ -107,21 +116,13 @@ const _sfc_main = vue.defineComponent({
107
116
  _: 1
108
117
  })
109
118
  ], 64)) : _ctx.catalog && _ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
119
+ vue.createCommentVNode(" \u6709\u7C7B\u578B\u7684\u5C01\u9762 "),
110
120
  vue.createCommentVNode(" \u56FE\u7247 "),
111
- _ctx.catalog === "image" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
121
+ _ctx.catalog ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
112
122
  key: 0,
113
123
  class: "thumb-image",
114
124
  src: thumb.value
115
- }, aImageAttr.value), null, 16, ["src"])) : _ctx.catalog === "video" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
116
- vue.createCommentVNode(" \u89C6\u9891 "),
117
- vue.createVNode(vue.unref(webVue.Image), vue.mergeProps({
118
- class: "thumb-image",
119
- src: thumb.value
120
- }, aImageAttr.value), null, 16, ["src"])
121
- ], 64)) : _ctx.catalog === "audio" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
122
- vue.createCommentVNode(" \u97F3\u9891 "),
123
- vue.createTextVNode(" \u97F3\u9891 ")
124
- ], 64)) : vue.createCommentVNode("v-if", true),
125
+ }, aImageAttr.value), null, 16, ["src"])) : vue.createCommentVNode("v-if", true),
125
126
  vue.createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
126
127
  vue.createElementVNode("div", _hoisted_2, [
127
128
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
@@ -132,9 +133,8 @@ const _sfc_main = vue.defineComponent({
132
133
  }, vue.toDisplayString(item.label), 9, _hoisted_3);
133
134
  }), 128))
134
135
  ])
135
- ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
136
- vue.createTextVNode(" \u7F3A\u7701\u56FE ")
137
- ], 64))
136
+ ], 64)) : vue.createCommentVNode("v-if", true),
137
+ vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(vue.unref(index.mediaTime)(_ctx.meta.length)), 1)
138
138
  ], 6);
139
139
  };
140
140
  }
@@ -57,11 +57,26 @@
57
57
  .thumb-select-wrapper:hover .thumb-handler-list {
58
58
  opacity: 1;
59
59
  }
60
+ .thumb-select-wrapper:hover .thumb-select-tag {
61
+ opacity: 0;
62
+ }
60
63
  .thumb-select-wrapper.thumb-no-mask {
61
64
  background-color: #f2f3f5;
62
65
  border: 1px dashed #e5e6eb !important;
63
66
  }
64
- .arco-dropdown-option-content {
67
+ .thumb-select-wrapper .thumb-select-tag {
68
+ position: absolute;
69
+ right: 5px;
70
+ bottom: 5px;
71
+ padding: 2px 10px;
72
+ color: #fff;
73
+ font-size: 12px;
74
+ background-color: rgba(0, 0, 0, 0.5);
75
+ border-radius: 16px;
76
+ opacity: 1;
77
+ transition: all 0.3s ease-in-out;
78
+ }
79
+ .thumb-select-wrapper .arco-dropdown-option-content {
65
80
  display: flex;
66
81
  gap: 8px;
67
82
  align-items: center;
@@ -73,6 +73,10 @@
73
73
  .thumb-handler-list {
74
74
  opacity: 1;
75
75
  }
76
+
77
+ .thumb-select-tag {
78
+ opacity: 0;
79
+ }
76
80
  }
77
81
 
78
82
  // 非马赛克模式
@@ -80,12 +84,25 @@
80
84
  background-color: #f2f3f5;
81
85
  border: 1px dashed #e5e6eb !important;
82
86
  }
83
- }
84
87
 
85
- // 素材选择
86
- .arco-dropdown-option-content {
87
- display: flex;
88
- gap: 8px;
89
- align-items: center;
90
- font-size: 14px;
88
+ .thumb-select-tag {
89
+ position: absolute;
90
+ right: 5px;
91
+ bottom: 5px;
92
+ padding: 2px 10px;
93
+ color: #fff;
94
+ font-size: 12px;
95
+ background-color: rgba(0, 0, 0, 0.5);
96
+ border-radius: 16px;
97
+ opacity: 1;
98
+ transition: all 0.3s ease-in-out;
99
+ }
100
+
101
+ // 素材选择
102
+ .arco-dropdown-option-content {
103
+ display: flex;
104
+ gap: 8px;
105
+ align-items: center;
106
+ font-size: 14px;
107
+ }
91
108
  }
@@ -114,10 +114,51 @@ function getThemeColor(BASE_API, src) {
114
114
  });
115
115
  });
116
116
  }
117
+ async function copyContent(content) {
118
+ try {
119
+ if (typeof content === "string") {
120
+ const input = document.createElement("input");
121
+ input.setAttribute("value", content);
122
+ document.body.appendChild(input);
123
+ input.select();
124
+ document.execCommand("copy");
125
+ document.body.removeChild(input);
126
+ return true;
127
+ }
128
+ if (window.__POWERED_BY_WUJIE__) {
129
+ await window.parent.navigator.clipboard.write([
130
+ new ClipboardItem({
131
+ "image/png": content
132
+ })
133
+ ]);
134
+ } else {
135
+ await navigator.clipboard.write([
136
+ new ClipboardItem({
137
+ "image/png": content
138
+ })
139
+ ]);
140
+ }
141
+ return true;
142
+ } catch (e) {
143
+ return false;
144
+ }
145
+ }
146
+ function mediaTime(v) {
147
+ const h = Math.floor(v / (60 * 60));
148
+ const m = Math.floor((v - h) / 60);
149
+ const s = Math.floor(v - h * 360 - m * 60);
150
+ let ret = "";
151
+ ret += `${h < 10 ? `0${h}` : h}:`;
152
+ ret += `${m < 10 ? `0${m}` : m}:`;
153
+ ret += s < 10 ? `0${s}` : s;
154
+ return ret;
155
+ }
156
+ exports.copyContent = copyContent;
117
157
  exports.dateYYYYDDMMHHmm = dateYYYYDDMMHHmm;
118
158
  exports.generateUUID = generateUUID;
119
159
  exports.getRealUrl = getRealUrl;
120
160
  exports.getThemeColor = getThemeColor;
161
+ exports.mediaTime = mediaTime;
121
162
  exports.noCoverText = noCoverText;
122
163
  exports.replaceSuffix = replaceSuffix;
123
164
  exports.timeFormat = timeFormat;
@@ -100,7 +100,8 @@ const kongo_source_map = {
100
100
  document: "\u7A3F\u4EF6",
101
101
  category_list: "\u9891\u9053",
102
102
  service: "\u670D\u52A1",
103
- political: "\u653F\u60C5"
103
+ political: "\u653F\u60C5",
104
+ applet: "\u5C0F\u7A0B\u5E8F"
104
105
  };
105
106
  const calcApprovingUser = (data) => {
106
107
  if (data.current_processes[0] && data.current_processes[0].users && data.current_processes[0].users[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.35",
3
+ "version": "0.3.37",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",