@cmstops/pro-compo 0.3.31 → 0.3.33

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 (67) hide show
  1. package/dist/index.css +212 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/hooks/useAttachement.d.ts +20 -0
  4. package/es/hooks/useAttachement.js +95 -0
  5. package/es/hooks/useSelection.d.ts +23 -0
  6. package/es/hooks/useSelection.js +59 -0
  7. package/es/index.css +212 -0
  8. package/es/index.d.ts +2 -0
  9. package/es/index.js +2 -0
  10. package/es/index.less +2 -0
  11. package/es/selectResourceModal/component.d.ts +0 -0
  12. package/es/selectResourceModal/component.js +211 -0
  13. package/es/selectResourceModal/components/ListContent/index.d.ts +0 -0
  14. package/es/selectResourceModal/components/ListContent/index.js +92 -0
  15. package/es/selectResourceModal/components/ListFilter/index.d.ts +0 -0
  16. package/es/selectResourceModal/components/ListFilter/index.js +259 -0
  17. package/es/selectResourceModal/components/ListFilter/scripts/api.d.ts +1 -0
  18. package/es/selectResourceModal/components/ListFilter/scripts/api.js +9 -0
  19. package/es/selectResourceModal/components/ListSelected/index.d.ts +0 -0
  20. package/es/selectResourceModal/components/ListSelected/index.js +91 -0
  21. package/es/selectResourceModal/index.d.ts +2 -0
  22. package/es/selectResourceModal/index.js +7 -0
  23. package/es/selectResourceModal/style/css.js +1 -0
  24. package/es/selectResourceModal/style/index.css +159 -0
  25. package/es/selectResourceModal/style/index.d.ts +1 -0
  26. package/es/selectResourceModal/style/index.js +1 -0
  27. package/es/selectResourceModal/style/index.less +43 -0
  28. package/es/selectResourceModal/style/listContent.less +67 -0
  29. package/es/selectResourceModal/style/listFilter.less +17 -0
  30. package/es/selectResourceModal/style/listSelected.less +67 -0
  31. package/es/thumbCard/component.d.ts +0 -0
  32. package/es/thumbCard/component.js +114 -0
  33. package/es/thumbCard/index.d.ts +2 -0
  34. package/es/thumbCard/index.js +7 -0
  35. package/es/thumbCard/style/css.js +1 -0
  36. package/es/thumbCard/style/index.css +53 -0
  37. package/es/thumbCard/style/index.d.ts +1 -0
  38. package/es/thumbCard/style/index.js +1 -0
  39. package/es/thumbCard/style/index.less +70 -0
  40. package/es/utils/typeMap.d.ts +19 -0
  41. package/es/utils/typeMap.js +17 -1
  42. package/lib/hooks/useAttachement.js +100 -0
  43. package/lib/hooks/useSelection.js +60 -0
  44. package/lib/index.css +212 -0
  45. package/lib/index.js +4 -0
  46. package/lib/index.less +2 -0
  47. package/lib/selectResourceModal/component.js +212 -0
  48. package/lib/selectResourceModal/components/ListContent/index.js +93 -0
  49. package/lib/selectResourceModal/components/ListFilter/index.js +260 -0
  50. package/lib/selectResourceModal/components/ListFilter/scripts/api.js +11 -0
  51. package/lib/selectResourceModal/components/ListSelected/index.js +92 -0
  52. package/lib/selectResourceModal/index.js +8 -0
  53. package/lib/selectResourceModal/style/css.js +2 -0
  54. package/lib/selectResourceModal/style/index.css +159 -0
  55. package/lib/selectResourceModal/style/index.js +2 -0
  56. package/lib/selectResourceModal/style/index.less +43 -0
  57. package/lib/selectResourceModal/style/listContent.less +67 -0
  58. package/lib/selectResourceModal/style/listFilter.less +17 -0
  59. package/lib/selectResourceModal/style/listSelected.less +67 -0
  60. package/lib/thumbCard/component.js +115 -0
  61. package/lib/thumbCard/index.js +8 -0
  62. package/lib/thumbCard/style/css.js +2 -0
  63. package/lib/thumbCard/style/index.css +53 -0
  64. package/lib/thumbCard/style/index.js +2 -0
  65. package/lib/thumbCard/style/index.less +70 -0
  66. package/lib/utils/typeMap.js +20 -0
  67. package/package.json +2 -2
@@ -0,0 +1,67 @@
1
+ .list-panel-wrapper {
2
+ * {
3
+ user-select: none;
4
+
5
+ &::selection {
6
+ display: none;
7
+ }
8
+ }
9
+
10
+ width: 420px;
11
+ max-height: 600px;
12
+ padding: 0 !important;
13
+ overflow: hidden;
14
+ border: none;
15
+ border-radius: 4px;
16
+ box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1);
17
+
18
+ .arco-popover-content {
19
+ margin-top: 0;
20
+ }
21
+
22
+ .list-panel-header {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: space-between;
26
+ padding: 11px 15px;
27
+ color: white;
28
+ font-weight: 500;
29
+ background-color: #165dff;
30
+
31
+ .header-options {
32
+ display: flex;
33
+ gap: 12px;
34
+ align-items: center;
35
+
36
+ div {
37
+ cursor: pointer;
38
+ }
39
+ }
40
+ }
41
+
42
+ .list-selected-record {
43
+ display: flex;
44
+ flex-direction: column;
45
+
46
+ .list-selected-item {
47
+ display: flex;
48
+ gap: 12px;
49
+ align-items: center;
50
+ padding: 9px 16px;
51
+ overflow: hidden;
52
+
53
+ .item-thumb {
54
+ width: 50px;
55
+ height: 38px;
56
+ overflow: hidden;
57
+ }
58
+
59
+ .item-alias {
60
+ flex: 1;
61
+ overflow: hidden;
62
+ white-space: nowrap;
63
+ text-overflow: ellipsis;
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var icon = require("@arco-design/web-vue/es/icon");
4
+ var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
5
+ var webVue = require("@arco-design/web-vue");
6
+ var config = require("../config.js");
7
+ const _hoisted_1 = { class: "thumb-add" };
8
+ const _hoisted_2 = { class: "thumb-handler-list" };
9
+ const _hoisted_3 = ["onClick"];
10
+ const _sfc_main = vue.defineComponent({
11
+ ...{ name: "thumbCard" },
12
+ __name: "component",
13
+ props: {
14
+ BASE_API: {},
15
+ url: {},
16
+ thumb: {},
17
+ isEdit: { type: Boolean },
18
+ options: {},
19
+ meta: {},
20
+ catalog: {},
21
+ handlersKey: {}
22
+ },
23
+ emits: ["handle", "edit"],
24
+ setup(__props, { emit: __emit }) {
25
+ const props = __props;
26
+ const emits = __emit;
27
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
28
+ const WATER_BG_URL = `${BASE_API}/static/images/waterBg.png`;
29
+ const thumb = vue.computed(() => {
30
+ return props.thumb || props.url || "";
31
+ });
32
+ const styleObject = vue.computed(() => ({
33
+ backgroundImage: `url(${WATER_BG_URL})`
34
+ }));
35
+ const aImageAttr = vue.computed(() => {
36
+ return {
37
+ fit: "contain",
38
+ preview: false,
39
+ width: "100%",
40
+ height: "100%",
41
+ ...props.options
42
+ };
43
+ });
44
+ function handleOption(key) {
45
+ emits("handle", { key, item: props.meta });
46
+ }
47
+ function handleEdit(key) {
48
+ emits("edit", { key });
49
+ }
50
+ return (_ctx, _cache) => {
51
+ return vue.openBlock(), vue.createElementBlock("div", {
52
+ class: "thumb-select-wrapper",
53
+ style: vue.normalizeStyle(styleObject.value)
54
+ }, [
55
+ _ctx.isEdit && !_ctx.url ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Dropdown), {
56
+ key: 0,
57
+ trigger: "click",
58
+ onSelect: handleEdit
59
+ }, {
60
+ content: vue.withCtx(() => [
61
+ vue.createVNode(vue.unref(webVue.Doption), { value: "resource" }, {
62
+ default: vue.withCtx(() => [
63
+ vue.createVNode(vue.unref(vueCmstopIcons.IconResource)),
64
+ vue.createTextVNode(" \u7D20\u6750\u5E93\u9009\u62E9 ")
65
+ ]),
66
+ _: 1
67
+ }),
68
+ vue.createVNode(vue.unref(webVue.Doption), { value: "local" }, {
69
+ default: vue.withCtx(() => [
70
+ vue.createVNode(vue.unref(vueCmstopIcons.IconComputer)),
71
+ vue.createTextVNode(" \u672C\u5730\u4E0A\u4F20 ")
72
+ ]),
73
+ _: 1
74
+ })
75
+ ]),
76
+ default: vue.withCtx(() => [
77
+ vue.createElementVNode("div", _hoisted_1, [
78
+ vue.createVNode(vue.unref(icon.IconPlus))
79
+ ])
80
+ ]),
81
+ _: 1
82
+ })) : _ctx.catalog && _ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
83
+ vue.createCommentVNode(" \u56FE\u7247 "),
84
+ _ctx.catalog === "image" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
85
+ key: 0,
86
+ class: "thumb-image",
87
+ src: thumb.value
88
+ }, aImageAttr.value), null, 16, ["src"])) : _ctx.catalog === "video" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
89
+ vue.createCommentVNode(" \u89C6\u9891 "),
90
+ vue.createVNode(vue.unref(webVue.Image), vue.mergeProps({
91
+ class: "thumb-image",
92
+ src: thumb.value
93
+ }, aImageAttr.value), null, 16, ["src"])
94
+ ], 64)) : _ctx.catalog === "audio" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
95
+ vue.createCommentVNode(" \u97F3\u9891 "),
96
+ vue.createTextVNode(" \u97F3\u9891 ")
97
+ ], 64)) : vue.createCommentVNode("v-if", true),
98
+ vue.createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
99
+ vue.createElementVNode("div", _hoisted_2, [
100
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
101
+ return vue.openBlock(), vue.createElementBlock("div", {
102
+ key: item.key,
103
+ class: "handler-item",
104
+ onClick: () => handleOption(item.key)
105
+ }, vue.toDisplayString(item.label), 9, _hoisted_3);
106
+ }), 128))
107
+ ])
108
+ ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
109
+ vue.createTextVNode(" \u7F3A\u7701\u56FE ")
110
+ ], 64))
111
+ ], 4);
112
+ };
113
+ }
114
+ });
115
+ module.exports = _sfc_main;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var component = require("./component.js");
3
+ const thumbCard = Object.assign(component, {
4
+ install: (app) => {
5
+ app.component(component.name, component);
6
+ }
7
+ });
8
+ module.exports = thumbCard;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ require("./index.css");
@@ -0,0 +1,53 @@
1
+ .thumb-select-wrapper {
2
+ position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: 100%;
7
+ height: 100%;
8
+ overflow: hidden;
9
+ border-radius: 2px;
10
+ cursor: pointer;
11
+ }
12
+ .thumb-select-wrapper .thumb-add {
13
+ color: var(--color-text-2);
14
+ font-size: 16px;
15
+ cursor: pointer;
16
+ }
17
+ .thumb-select-wrapper .thumb-image img {
18
+ width: 100%;
19
+ height: 100%;
20
+ }
21
+ .thumb-select-wrapper .thumb-handler-list {
22
+ position: absolute;
23
+ bottom: 0;
24
+ display: flex;
25
+ gap: 10px;
26
+ align-items: center;
27
+ justify-content: center;
28
+ width: 100%;
29
+ height: 40px;
30
+ opacity: 0;
31
+ transition: all 0.3s ease-in-out;
32
+ }
33
+ .thumb-select-wrapper .thumb-handler-list .handler-item {
34
+ padding: 0 8px;
35
+ color: #fff;
36
+ font-size: 12px;
37
+ line-height: 26px;
38
+ background-color: #000000b3;
39
+ border-radius: 2px;
40
+ cursor: pointer;
41
+ }
42
+ .thumb-select-wrapper .thumb-handler-list .handler-item:hover {
43
+ color: rgba(255, 255, 255, 0.7);
44
+ }
45
+ .thumb-select-wrapper:hover .thumb-handler-list {
46
+ opacity: 1;
47
+ }
48
+ .arco-dropdown-option-content {
49
+ display: flex;
50
+ gap: 8px;
51
+ align-items: center;
52
+ font-size: 14px;
53
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ require("./index.less");
@@ -0,0 +1,70 @@
1
+ .thumb-select-wrapper {
2
+ position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ // 高度宽度不在这里定义,根据具体的业务场景去处理,更灵活
7
+ width: 100%;
8
+ height: 100%;
9
+ overflow: hidden;
10
+ border-radius: 2px;
11
+ cursor: pointer;
12
+
13
+ // 添加模式
14
+ .thumb-add {
15
+ color: var(--color-text-2);
16
+ font-size: 16px;
17
+ cursor: pointer;
18
+ }
19
+
20
+ // 样式
21
+ .thumb-image {
22
+ img {
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+ }
27
+
28
+ // 扩展按钮
29
+ .thumb-handler-list {
30
+ position: absolute;
31
+ bottom: 0;
32
+ display: flex;
33
+ gap: 10px;
34
+ align-items: center;
35
+ justify-content: center;
36
+ width: 100%;
37
+ height: 40px;
38
+ opacity: 0;
39
+ transition: all 0.3s ease-in-out;
40
+
41
+ .handler-item {
42
+ padding: 0 8px;
43
+ color: #fff;
44
+ font-size: 12px;
45
+ line-height: 26px;
46
+ // 50%透明度
47
+ background-color: #000000b3;
48
+ border-radius: 2px;
49
+ cursor: pointer;
50
+
51
+ &:hover {
52
+ color: rgba(255, 255, 255, 0.7);
53
+ }
54
+ }
55
+ }
56
+
57
+ &:hover {
58
+ .thumb-handler-list {
59
+ opacity: 1;
60
+ }
61
+ }
62
+ }
63
+
64
+ // 素材选择
65
+ .arco-dropdown-option-content {
66
+ display: flex;
67
+ gap: 8px;
68
+ align-items: center;
69
+ font-size: 14px;
70
+ }
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  var _a, _b, _c;
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ function object2LabelList(object) {
5
+ return Object.keys(object).map((key) => ({ value: key, label: object[key] }));
6
+ }
4
7
  const mpName = ((_c = (_b = (_a = window.situoyun) == null ? void 0 : _a.config) == null ? void 0 : _b.oem_config) == null ? void 0 : _c.mp_name) || "\u516C\u4F17\u53F7";
5
8
  const key_target_type_map = {
6
9
  3: "doc",
@@ -160,6 +163,23 @@ const matrixPublishFormalStateMap = {
160
163
  12: "\u672A\u77E5",
161
164
  13: "\u79C1\u5BC6"
162
165
  };
166
+ const RESOURCE_SOURCE_DICT = {
167
+ ai: "AI \u751F\u6210",
168
+ live_rec: "\u76F4\u64AD\u6536\u5F55",
169
+ backend: "\u540E\u53F0\u4E0A\u4F20"
170
+ };
171
+ const RESOURCE_CATALOG_DICT = {
172
+ image: "\u56FE\u7247",
173
+ video: "\u89C6\u9891",
174
+ audio: "\u97F3\u9891",
175
+ other: "\u5176\u4ED6"
176
+ };
177
+ const RESOURCE_SOURCE_OPTIONS = object2LabelList(RESOURCE_SOURCE_DICT);
178
+ const RESOURCE_CATALOG_OPTIONS = object2LabelList(RESOURCE_CATALOG_DICT);
179
+ exports.RESOURCE_CATALOG_DICT = RESOURCE_CATALOG_DICT;
180
+ exports.RESOURCE_CATALOG_OPTIONS = RESOURCE_CATALOG_OPTIONS;
181
+ exports.RESOURCE_SOURCE_DICT = RESOURCE_SOURCE_DICT;
182
+ exports.RESOURCE_SOURCE_OPTIONS = RESOURCE_SOURCE_OPTIONS;
163
183
  exports.approveFlowStatusMap = approveFlowStatusMap;
164
184
  exports.calcApprovingDependent = calcApprovingDependent;
165
185
  exports.calcApprovingUser = calcApprovingUser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@arco-design/web-vue": "~2",
62
- "@arco-iconbox/vue-cmstop-icons": "^0.0.24",
62
+ "@arco-iconbox/vue-cmstop-icons": "^0.0.29",
63
63
  "@babel/core": "^7.14.6",
64
64
  "@babel/plugin-proposal-class-properties": "^7.14.5",
65
65
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",