@cmstops/pro-compo 0.3.30 → 0.3.32

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 (71) hide show
  1. package/dist/index.css +84 -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 +84 -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 +4 -0
  24. package/es/selectResourceModal/style/index.css +31 -0
  25. package/es/selectResourceModal/style/index.d.ts +4 -0
  26. package/es/selectResourceModal/style/index.js +4 -0
  27. package/es/selectResourceModal/style/index.less +39 -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/selectThumb/component.js +10 -5
  32. package/es/selectThumb/components/card.js +111 -59
  33. package/es/thumbCard/component.d.ts +0 -0
  34. package/es/thumbCard/component.js +114 -0
  35. package/es/thumbCard/index.d.ts +2 -0
  36. package/es/thumbCard/index.js +7 -0
  37. package/es/thumbCard/style/css.js +1 -0
  38. package/es/thumbCard/style/index.css +53 -0
  39. package/es/thumbCard/style/index.d.ts +1 -0
  40. package/es/thumbCard/style/index.js +1 -0
  41. package/es/thumbCard/style/index.less +70 -0
  42. package/es/utils/typeMap.d.ts +19 -0
  43. package/es/utils/typeMap.js +17 -1
  44. package/lib/hooks/useAttachement.js +100 -0
  45. package/lib/hooks/useSelection.js +60 -0
  46. package/lib/index.css +84 -0
  47. package/lib/index.js +4 -0
  48. package/lib/index.less +2 -0
  49. package/lib/selectResourceModal/component.js +212 -0
  50. package/lib/selectResourceModal/components/ListContent/index.js +93 -0
  51. package/lib/selectResourceModal/components/ListFilter/index.js +260 -0
  52. package/lib/selectResourceModal/components/ListFilter/scripts/api.js +11 -0
  53. package/lib/selectResourceModal/components/ListSelected/index.js +92 -0
  54. package/lib/selectResourceModal/index.js +8 -0
  55. package/lib/selectResourceModal/style/css.js +5 -0
  56. package/lib/selectResourceModal/style/index.css +31 -0
  57. package/lib/selectResourceModal/style/index.js +5 -0
  58. package/lib/selectResourceModal/style/index.less +39 -0
  59. package/lib/selectResourceModal/style/listContent.less +67 -0
  60. package/lib/selectResourceModal/style/listFilter.less +17 -0
  61. package/lib/selectResourceModal/style/listSelected.less +67 -0
  62. package/lib/selectThumb/component.js +10 -5
  63. package/lib/selectThumb/components/card.js +110 -58
  64. package/lib/thumbCard/component.js +115 -0
  65. package/lib/thumbCard/index.js +8 -0
  66. package/lib/thumbCard/style/css.js +2 -0
  67. package/lib/thumbCard/style/index.css +53 -0
  68. package/lib/thumbCard/style/index.js +2 -0
  69. package/lib/thumbCard/style/index.less +70 -0
  70. package/lib/utils/typeMap.js +20 -0
  71. package/package.json +2 -2
@@ -80,7 +80,8 @@ const _sfc_main = defineComponent({
80
80
  aiImages: {},
81
81
  series: {},
82
82
  thumbsMax: {},
83
- mediaUseType: {}
83
+ mediaUseType: {},
84
+ localUpload: { type: Boolean }
84
85
  },
85
86
  emits: ["update:dataValue", "upload"],
86
87
  setup(__props, { emit: __emit }) {
@@ -417,12 +418,13 @@ const _sfc_main = defineComponent({
417
418
  parentRef: selectThumbRef.value,
418
419
  idx: index,
419
420
  "preview-list": previewList.value,
421
+ "is-popover": _ctx.localUpload,
420
422
  "thumb-model": "thumb",
421
423
  onFileForShowThumb: fileForShowThumb,
422
424
  onChangeThumbType: changeThumbType,
423
425
  onUploadLocal: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb)),
424
426
  onOpen: ($event) => openDialogMediaSelection($event, index)
425
- }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "idx", "preview-list", "onOpen"]);
427
+ }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "idx", "preview-list", "is-popover", "onOpen"]);
426
428
  }), 128))
427
429
  ])) : currentModel.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
428
430
  createCommentVNode(" \u5C01\u9762\u56FEcard "),
@@ -437,12 +439,13 @@ const _sfc_main = defineComponent({
437
439
  model: model.value,
438
440
  idx: index,
439
441
  "preview-list": previewList.value,
442
+ "is-popover": _ctx.localUpload,
440
443
  "thumb-model": "thumb",
441
444
  onFileForShowThumb: fileForShowThumb,
442
445
  onChangeThumbType: changeThumbType,
443
446
  onUploadLocal: _cache[1] || (_cache[1] = (cb) => _ctx.$emit("upload", cb)),
444
447
  onOpen: ($event) => openDialogMediaSelection($event, index)
445
- }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "model", "idx", "preview-list", "onOpen"]);
448
+ }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "model", "idx", "preview-list", "is-popover", "onOpen"]);
446
449
  }), 128))
447
450
  ])
448
451
  ], 2112)) : createCommentVNode("v-if", true),
@@ -512,12 +515,13 @@ const _sfc_main = defineComponent({
512
515
  "onUpdate:data": _cache[5] || (_cache[5] = ($event) => banner.value = $event),
513
516
  parentRef: selectThumbRef.value,
514
517
  "preview-list": previewList.value,
518
+ "is-popover": _ctx.localUpload,
515
519
  "thumb-model": "banner",
516
520
  onFileForShowThumb: fileForShowThumb,
517
521
  onChangeThumbType: changeThumbType,
518
522
  onUploadLocal: _cache[6] || (_cache[6] = (cb) => _ctx.$emit("upload", cb)),
519
523
  onOpen: openDialogMediaSelection
520
- }, null, 8, ["data", "parentRef", "preview-list"])) : createCommentVNode("v-if", true),
524
+ }, null, 8, ["data", "parentRef", "preview-list", "is-popover"])) : createCommentVNode("v-if", true),
521
525
  hasBanner.value && styleData.value.banner_theme_color ? (openBlock(), createElementBlock("div", _hoisted_10, _hoisted_12)) : createCommentVNode("v-if", true),
522
526
  createCommentVNode(" banner\u8C03\u8272\u677F "),
523
527
  hasBanner.value ? (openBlock(), createBlock(_sfc_main$2, {
@@ -549,12 +553,13 @@ const _sfc_main = defineComponent({
549
553
  "onUpdate:data": _cache[7] || (_cache[7] = ($event) => pcBanner.value = $event),
550
554
  parentRef: selectThumbRef.value,
551
555
  previewList: previewList.value,
556
+ "is-popover": _ctx.localUpload,
552
557
  thumbModel: "pcBanner",
553
558
  onFileForShowThumb: fileForShowThumb,
554
559
  onChangeThumbType: changeThumbType,
555
560
  onUploadLocal: _cache[8] || (_cache[8] = (cb) => _ctx.$emit("upload", cb)),
556
561
  onOpen: openDialogMediaSelection
557
- }, null, 8, ["data", "parentRef", "previewList"]),
562
+ }, null, 8, ["data", "parentRef", "previewList", "is-popover"]),
558
563
  _ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_18, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)")) : createCommentVNode("v-if", true),
559
564
  docSeriesShowTopThemeColor.value && styleData.value.top_theme_color ? (openBlock(), createElementBlock("div", _hoisted_19, _hoisted_21)) : createCommentVNode("v-if", true),
560
565
  docSeriesShowTopThemeColor.value ? (openBlock(), createBlock(_sfc_main$2, {
@@ -1,8 +1,13 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createVNode, Transition, withModifiers, createCommentVNode, normalizeStyle } from "vue";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createVNode, Transition, withModifiers, createCommentVNode, normalizeStyle } from "vue";
2
2
  import { Popover, Image } from "@arco-design/web-vue";
3
3
  import { IconEdit, IconDelete, IconPlus } from "@arco-design/web-vue/es/icon";
4
4
  import { DEFAULT_BASE_API } from "../../config.js";
5
- const _hoisted_1 = {
5
+ const _hoisted_1 = { class: "thumb-card-container-wrap" };
6
+ const _hoisted_2 = {
7
+ key: 0,
8
+ class: "img-v"
9
+ };
10
+ const _hoisted_3 = {
6
11
  key: 0,
7
12
  class: "img-v"
8
13
  };
@@ -16,7 +21,8 @@ const _sfc_main = defineComponent({
16
21
  parentRef: {},
17
22
  idx: {},
18
23
  along: { type: Boolean },
19
- model: {}
24
+ model: {},
25
+ isPopover: { type: Boolean }
20
26
  },
21
27
  emits: [
22
28
  "open",
@@ -62,64 +68,110 @@ const _sfc_main = defineComponent({
62
68
  emit("remove");
63
69
  };
64
70
  return (_ctx, _cache) => {
65
- return openBlock(), createBlock(unref(Popover), {
66
- trigger: "hover",
67
- position: "bottom",
68
- "popup-container": props.parentRef
69
- }, {
70
- content: withCtx(() => [
71
- createElementVNode("div", { onClick: openDialogMediaSelection }, "\u7D20\u6750\u5E93\u9009\u62E9"),
72
- createElementVNode("div", { onClick: loaclUpload }, "\u672C\u5730\u4E0A\u4F20")
73
- ]),
74
- default: withCtx(() => {
75
- var _a;
76
- return [
77
- createElementVNode("div", {
78
- class: normalizeClass(["thumb-card-container", classObj.value])
79
- }, [
80
- ((_a = props.data) == null ? void 0 : _a.url) ? (openBlock(), createElementBlock("div", _hoisted_1, [
81
- createVNode(unref(Image), {
82
- class: "item",
83
- fit: "cover",
84
- src: props.data.url,
85
- "show-loader": ""
86
- }, null, 8, ["src"]),
87
- createVNode(Transition, { name: "fade" }, {
88
- default: withCtx(() => [
89
- createElementVNode("div", {
90
- class: "mask",
91
- onClick: clickMask
92
- }, [
93
- createElementVNode("span", {
94
- class: "half",
95
- onClick: withModifiers(openDialogMediaSelection, ["stop"])
96
- }, [
97
- createVNode(unref(IconEdit))
98
- ]),
99
- _ctx.along ? (openBlock(), createElementBlock("span", {
100
- key: 0,
101
- class: "half",
102
- onClick: withModifiers(remove, ["stop"])
71
+ var _a;
72
+ return openBlock(), createElementBlock("div", _hoisted_1, [
73
+ _ctx.isPopover ? (openBlock(), createBlock(unref(Popover), {
74
+ key: 0,
75
+ trigger: "hover",
76
+ position: "bottom",
77
+ "popup-container": props.parentRef
78
+ }, {
79
+ content: withCtx(() => [
80
+ createElementVNode("div", { onClick: openDialogMediaSelection }, "\u7D20\u6750\u5E93\u9009\u62E9"),
81
+ createElementVNode("div", { onClick: loaclUpload }, "\u672C\u5730\u4E0A\u4F20")
82
+ ]),
83
+ default: withCtx(() => {
84
+ var _a2;
85
+ return [
86
+ createElementVNode("div", {
87
+ class: normalizeClass(["thumb-card-container", classObj.value])
88
+ }, [
89
+ ((_a2 = props.data) == null ? void 0 : _a2.url) ? (openBlock(), createElementBlock("div", _hoisted_2, [
90
+ createVNode(unref(Image), {
91
+ class: "item",
92
+ fit: "cover",
93
+ src: props.data.url,
94
+ "show-loader": ""
95
+ }, null, 8, ["src"]),
96
+ createVNode(Transition, { name: "fade" }, {
97
+ default: withCtx(() => [
98
+ createElementVNode("div", {
99
+ class: "mask",
100
+ onClick: clickMask
103
101
  }, [
104
- createVNode(unref(IconDelete))
105
- ])) : createCommentVNode("v-if", true)
106
- ])
102
+ createElementVNode("span", {
103
+ class: "half",
104
+ onClick: withModifiers(openDialogMediaSelection, ["stop"])
105
+ }, [
106
+ createVNode(unref(IconEdit))
107
+ ]),
108
+ _ctx.along ? (openBlock(), createElementBlock("span", {
109
+ key: 0,
110
+ class: "half",
111
+ onClick: withModifiers(remove, ["stop"])
112
+ }, [
113
+ createVNode(unref(IconDelete))
114
+ ])) : createCommentVNode("v-if", true)
115
+ ])
116
+ ]),
117
+ _: 1
118
+ })
119
+ ])) : (openBlock(), createElementBlock("div", {
120
+ key: 1,
121
+ class: "item add-thumb",
122
+ style: normalizeStyle({ backgroundImage: `url(${waterBg})` }),
123
+ onClick: openDialogMediaSelection
124
+ }, [
125
+ createVNode(unref(IconPlus))
126
+ ], 4))
127
+ ], 2)
128
+ ];
129
+ }),
130
+ _: 1
131
+ }, 8, ["popup-container"])) : (openBlock(), createElementBlock("div", {
132
+ key: 1,
133
+ class: normalizeClass(["thumb-card-container", classObj.value])
134
+ }, [
135
+ ((_a = props.data) == null ? void 0 : _a.url) ? (openBlock(), createElementBlock("div", _hoisted_3, [
136
+ createVNode(unref(Image), {
137
+ class: "item",
138
+ fit: "cover",
139
+ src: props.data.url,
140
+ "show-loader": ""
141
+ }, null, 8, ["src"]),
142
+ createVNode(Transition, { name: "fade" }, {
143
+ default: withCtx(() => [
144
+ createElementVNode("div", {
145
+ class: "mask",
146
+ onClick: clickMask
147
+ }, [
148
+ createElementVNode("span", {
149
+ class: "half",
150
+ onClick: withModifiers(openDialogMediaSelection, ["stop"])
151
+ }, [
152
+ createVNode(unref(IconEdit))
107
153
  ]),
108
- _: 1
109
- })
110
- ])) : (openBlock(), createElementBlock("div", {
111
- key: 1,
112
- class: "item add-thumb",
113
- style: normalizeStyle({ backgroundImage: `url(${waterBg})` }),
114
- onClick: openDialogMediaSelection
115
- }, [
116
- createVNode(unref(IconPlus))
117
- ], 4))
118
- ], 2)
119
- ];
120
- }),
121
- _: 1
122
- }, 8, ["popup-container"]);
154
+ _ctx.along ? (openBlock(), createElementBlock("span", {
155
+ key: 0,
156
+ class: "half",
157
+ onClick: withModifiers(remove, ["stop"])
158
+ }, [
159
+ createVNode(unref(IconDelete))
160
+ ])) : createCommentVNode("v-if", true)
161
+ ])
162
+ ]),
163
+ _: 1
164
+ })
165
+ ])) : (openBlock(), createElementBlock("div", {
166
+ key: 1,
167
+ class: "item add-thumb",
168
+ style: normalizeStyle({ backgroundImage: `url(${waterBg})` }),
169
+ onClick: openDialogMediaSelection
170
+ }, [
171
+ createVNode(unref(IconPlus))
172
+ ], 4))
173
+ ], 2))
174
+ ]);
123
175
  };
124
176
  }
125
177
  });
File without changes
@@ -0,0 +1,114 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createBlock, unref, withCtx, createVNode, createTextVNode, createElementVNode, Fragment, createCommentVNode, mergeProps, renderList, toDisplayString } from "vue";
2
+ import { IconPlus } from "@arco-design/web-vue/es/icon";
3
+ import { IconResource, IconComputer } from "@arco-iconbox/vue-cmstop-icons";
4
+ import { Dropdown, Doption, Image } from "@arco-design/web-vue";
5
+ import { DEFAULT_BASE_API } from "../config.js";
6
+ const _hoisted_1 = { class: "thumb-add" };
7
+ const _hoisted_2 = { class: "thumb-handler-list" };
8
+ const _hoisted_3 = ["onClick"];
9
+ const _sfc_main = defineComponent({
10
+ ...{ name: "thumbCard" },
11
+ __name: "component",
12
+ props: {
13
+ BASE_API: {},
14
+ url: {},
15
+ thumb: {},
16
+ isEdit: { type: Boolean },
17
+ options: {},
18
+ meta: {},
19
+ catalog: {},
20
+ handlersKey: {}
21
+ },
22
+ emits: ["handle", "edit"],
23
+ setup(__props, { emit: __emit }) {
24
+ const props = __props;
25
+ const emits = __emit;
26
+ const BASE_API = props.BASE_API || DEFAULT_BASE_API;
27
+ const WATER_BG_URL = `${BASE_API}/static/images/waterBg.png`;
28
+ const thumb = computed(() => {
29
+ return props.thumb || props.url || "";
30
+ });
31
+ const styleObject = computed(() => ({
32
+ backgroundImage: `url(${WATER_BG_URL})`
33
+ }));
34
+ const aImageAttr = computed(() => {
35
+ return {
36
+ fit: "contain",
37
+ preview: false,
38
+ width: "100%",
39
+ height: "100%",
40
+ ...props.options
41
+ };
42
+ });
43
+ function handleOption(key) {
44
+ emits("handle", { key, item: props.meta });
45
+ }
46
+ function handleEdit(key) {
47
+ emits("edit", { key });
48
+ }
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("div", {
51
+ class: "thumb-select-wrapper",
52
+ style: normalizeStyle(styleObject.value)
53
+ }, [
54
+ _ctx.isEdit && !_ctx.url ? (openBlock(), createBlock(unref(Dropdown), {
55
+ key: 0,
56
+ trigger: "click",
57
+ onSelect: handleEdit
58
+ }, {
59
+ content: withCtx(() => [
60
+ createVNode(unref(Doption), { value: "resource" }, {
61
+ default: withCtx(() => [
62
+ createVNode(unref(IconResource)),
63
+ createTextVNode(" \u7D20\u6750\u5E93\u9009\u62E9 ")
64
+ ]),
65
+ _: 1
66
+ }),
67
+ createVNode(unref(Doption), { value: "local" }, {
68
+ default: withCtx(() => [
69
+ createVNode(unref(IconComputer)),
70
+ createTextVNode(" \u672C\u5730\u4E0A\u4F20 ")
71
+ ]),
72
+ _: 1
73
+ })
74
+ ]),
75
+ default: withCtx(() => [
76
+ createElementVNode("div", _hoisted_1, [
77
+ createVNode(unref(IconPlus))
78
+ ])
79
+ ]),
80
+ _: 1
81
+ })) : _ctx.catalog && _ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
82
+ createCommentVNode(" \u56FE\u7247 "),
83
+ _ctx.catalog === "image" ? (openBlock(), createBlock(unref(Image), mergeProps({
84
+ key: 0,
85
+ class: "thumb-image",
86
+ src: thumb.value
87
+ }, aImageAttr.value), null, 16, ["src"])) : _ctx.catalog === "video" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
88
+ createCommentVNode(" \u89C6\u9891 "),
89
+ createVNode(unref(Image), mergeProps({
90
+ class: "thumb-image",
91
+ src: thumb.value
92
+ }, aImageAttr.value), null, 16, ["src"])
93
+ ], 64)) : _ctx.catalog === "audio" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
94
+ createCommentVNode(" \u97F3\u9891 "),
95
+ createTextVNode(" \u97F3\u9891 ")
96
+ ], 64)) : createCommentVNode("v-if", true),
97
+ createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
98
+ createElementVNode("div", _hoisted_2, [
99
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
100
+ return openBlock(), createElementBlock("div", {
101
+ key: item.key,
102
+ class: "handler-item",
103
+ onClick: () => handleOption(item.key)
104
+ }, toDisplayString(item.label), 9, _hoisted_3);
105
+ }), 128))
106
+ ])
107
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
108
+ createTextVNode(" \u7F3A\u7701\u56FE ")
109
+ ], 64))
110
+ ], 4);
111
+ };
112
+ }
113
+ });
114
+ export { _sfc_main as default };
@@ -0,0 +1,2 @@
1
+ declare const thumbCard: any;
2
+ export default thumbCard;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./component.js";
2
+ const thumbCard = Object.assign(_sfc_main, {
3
+ install: (app) => {
4
+ app.component(_sfc_main.name, _sfc_main);
5
+ }
6
+ });
7
+ export { thumbCard as default };
@@ -0,0 +1 @@
1
+ import "./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 @@
1
+ import './index.less';
@@ -0,0 +1 @@
1
+ import "./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
+ }
@@ -168,3 +168,22 @@ export declare const matrixPublishFormalStateMap: {
168
168
  12: string;
169
169
  13: string;
170
170
  };
171
+ export declare const RESOURCE_SOURCE_DICT: {
172
+ ai: string;
173
+ live_rec: string;
174
+ backend: string;
175
+ };
176
+ export declare const RESOURCE_CATALOG_DICT: {
177
+ image: string;
178
+ video: string;
179
+ audio: string;
180
+ other: string;
181
+ };
182
+ export declare const RESOURCE_SOURCE_OPTIONS: {
183
+ value: string;
184
+ label: string;
185
+ }[];
186
+ export declare const RESOURCE_CATALOG_OPTIONS: {
187
+ value: string;
188
+ label: string;
189
+ }[];
@@ -1,4 +1,7 @@
1
1
  var _a, _b, _c;
2
+ function object2LabelList(object) {
3
+ return Object.keys(object).map((key) => ({ value: key, label: object[key] }));
4
+ }
2
5
  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";
3
6
  const key_target_type_map = {
4
7
  3: "doc",
@@ -158,4 +161,17 @@ const matrixPublishFormalStateMap = {
158
161
  12: "\u672A\u77E5",
159
162
  13: "\u79C1\u5BC6"
160
163
  };
161
- export { approveFlowStatusMap, calcApprovingDependent, calcApprovingUser, compoColumnsMap, componentsColumns, contentList_layout_map, contentList_list_type_map, contentList_relation_type_map, groupPieceType, ilive_type_map, key_target_type_map, kongo_source_map, local_live_doc_status, local_live_doc_type, matrixPublishFormalStateMap, matrixPublishStateMap, mp_type_map };
164
+ const RESOURCE_SOURCE_DICT = {
165
+ ai: "AI \u751F\u6210",
166
+ live_rec: "\u76F4\u64AD\u6536\u5F55",
167
+ backend: "\u540E\u53F0\u4E0A\u4F20"
168
+ };
169
+ const RESOURCE_CATALOG_DICT = {
170
+ image: "\u56FE\u7247",
171
+ video: "\u89C6\u9891",
172
+ audio: "\u97F3\u9891",
173
+ other: "\u5176\u4ED6"
174
+ };
175
+ const RESOURCE_SOURCE_OPTIONS = object2LabelList(RESOURCE_SOURCE_DICT);
176
+ const RESOURCE_CATALOG_OPTIONS = object2LabelList(RESOURCE_CATALOG_DICT);
177
+ export { RESOURCE_CATALOG_DICT, RESOURCE_CATALOG_OPTIONS, RESOURCE_SOURCE_DICT, RESOURCE_SOURCE_OPTIONS, approveFlowStatusMap, calcApprovingDependent, calcApprovingUser, compoColumnsMap, componentsColumns, contentList_layout_map, contentList_list_type_map, contentList_relation_type_map, groupPieceType, ilive_type_map, key_target_type_map, kongo_source_map, local_live_doc_status, local_live_doc_type, matrixPublishFormalStateMap, matrixPublishStateMap, mp_type_map };
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ var vue = require("vue");
4
+ var request = require("../utils/request.js");
5
+ function getAttachmentsAll(BASE_API, query) {
6
+ return request(BASE_API, {
7
+ url: `/poplar/v3/attachments`,
8
+ method: "get",
9
+ params: query
10
+ });
11
+ }
12
+ function getAttachmentsMy(BASE_API, query) {
13
+ return request(BASE_API, {
14
+ url: `/poplar/v3/my/attachments`,
15
+ method: "get",
16
+ params: query
17
+ });
18
+ }
19
+ function getAttachmentsMyMessage(BASE_API, query) {
20
+ return request(BASE_API, {
21
+ url: `/poplar/v3/remind/to/my/attachments`,
22
+ method: "get",
23
+ params: query
24
+ });
25
+ }
26
+ function useAttachement(options) {
27
+ const key = vue.ref(options.key);
28
+ const limit = vue.ref(20);
29
+ const offset = vue.ref(0);
30
+ const filter = vue.ref({});
31
+ const params = vue.computed(() => {
32
+ return {
33
+ limit: limit.value,
34
+ offset: offset.value,
35
+ ...filter.value
36
+ };
37
+ });
38
+ const loading = vue.ref(true);
39
+ const list = vue.ref([]);
40
+ const total = vue.ref(0);
41
+ async function loadData() {
42
+ let apiFunc;
43
+ if (key.value === "all")
44
+ apiFunc = getAttachmentsAll;
45
+ if (key.value === "my")
46
+ apiFunc = getAttachmentsMy;
47
+ if (key.value === "remind")
48
+ apiFunc = getAttachmentsMyMessage;
49
+ list.value = [];
50
+ if (!apiFunc)
51
+ return;
52
+ loading.value = true;
53
+ try {
54
+ const { code, message } = await apiFunc(options.BASE_API, params.value);
55
+ if (code !== 0)
56
+ return;
57
+ const { data, count } = message;
58
+ list.value = data || [];
59
+ total.value = count;
60
+ } catch (e) {
61
+ console.log("\u83B7\u53D6\u7D20\u6750\u5217\u8868\u5F02\u5E38", e);
62
+ } finally {
63
+ loading.value = false;
64
+ }
65
+ }
66
+ function changePage(o) {
67
+ offset.value = o;
68
+ loadData();
69
+ }
70
+ function changeSize(s) {
71
+ limit.value = s;
72
+ loadData();
73
+ }
74
+ function changeKey(k) {
75
+ if (k === key.value)
76
+ return;
77
+ key.value = k;
78
+ changePage(0);
79
+ }
80
+ function changeFilter(f) {
81
+ filter.value = f;
82
+ changePage(0);
83
+ }
84
+ return {
85
+ list,
86
+ total,
87
+ limit,
88
+ offset,
89
+ loading,
90
+ changeFilter,
91
+ changeKey,
92
+ changePage,
93
+ changeSize,
94
+ loadData
95
+ };
96
+ }
97
+ exports["default"] = useAttachement;
98
+ exports.getAttachmentsAll = getAttachmentsAll;
99
+ exports.getAttachmentsMy = getAttachmentsMy;
100
+ exports.getAttachmentsMyMessage = getAttachmentsMyMessage;