@cmstops/pro-compo 0.3.43 → 0.3.45

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 (43) hide show
  1. package/dist/index.css +38 -2
  2. package/dist/index.min.css +1 -1
  3. package/es/hooks/useAttachement.d.ts +5 -0
  4. package/es/hooks/useLocalStorage.d.ts +8 -0
  5. package/es/hooks/useLocalStorage.js +31 -0
  6. package/es/hooks/useUpload.d.ts +2 -1
  7. package/es/hooks/useUpload.js +48 -11
  8. package/es/index.css +38 -2
  9. package/es/selectResourceModal/component.js +176 -43
  10. package/es/selectResourceModal/components/ListCardWrapper/index.js +9 -7
  11. package/es/selectResourceModal/components/ListContentLocal/index.js +15 -9
  12. package/es/selectResourceModal/components/ListSelected/index.js +19 -6
  13. package/es/selectResourceModal/components/ListTabs/index.js +61 -0
  14. package/es/selectResourceModal/scripts/useResourceSelect.d.ts +7 -0
  15. package/es/selectResourceModal/scripts/useResourceSelect.js +25 -0
  16. package/es/selectResourceModal/style/index.css +30 -1
  17. package/es/selectResourceModal/style/listCardWrapper.less +25 -1
  18. package/es/selectResourceModal/style/listSelected.less +9 -0
  19. package/es/thumbCard/component.js +21 -13
  20. package/es/thumbCard/style/index.css +8 -1
  21. package/es/thumbCard/style/index.less +8 -1
  22. package/es/utils/transcodeMedia.d.ts +13 -0
  23. package/es/utils/transcodeMedia.js +46 -0
  24. package/lib/hooks/useLocalStorage.js +34 -0
  25. package/lib/hooks/useUpload.js +47 -10
  26. package/lib/index.css +38 -2
  27. package/lib/selectResourceModal/component.js +174 -41
  28. package/lib/selectResourceModal/components/ListCardWrapper/index.js +9 -7
  29. package/lib/selectResourceModal/components/ListContentLocal/index.js +14 -8
  30. package/lib/selectResourceModal/components/ListSelected/index.js +18 -5
  31. package/lib/selectResourceModal/components/ListTabs/index.js +62 -0
  32. package/lib/selectResourceModal/scripts/useResourceSelect.js +27 -0
  33. package/lib/selectResourceModal/style/index.css +30 -1
  34. package/lib/selectResourceModal/style/listCardWrapper.less +25 -1
  35. package/lib/selectResourceModal/style/listSelected.less +9 -0
  36. package/lib/thumbCard/component.js +19 -11
  37. package/lib/thumbCard/style/index.css +8 -1
  38. package/lib/thumbCard/style/index.less +8 -1
  39. package/lib/utils/transcodeMedia.js +49 -0
  40. package/package.json +2 -2
  41. package/es/selectResourceModal/components/Main/index.js +0 -215
  42. package/lib/selectResourceModal/components/Main/index.js +0 -216
  43. /package/es/selectResourceModal/components/{Main → ListTabs}/index.d.ts +0 -0
@@ -1,8 +1,32 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
- var index = require("./components/Main/index.js");
4
+ var index$5 = require("../emptyData/index.js");
5
+ var index = require("./components/ListTabs/index.js");
6
+ var index$1 = require("./components/ListFilter/index.js");
7
+ var index$2 = require("./components/ListContent/index.js");
8
+ var index$4 = require("./components/ListSelected/index.js");
9
+ var index$3 = require("./components/ListContentLocal/index.js");
10
+ var useAttachement = require("../hooks/useAttachement.js");
11
+ var config = require("../config.js");
12
+ var useResourceSelect = require("./scripts/useResourceSelect.js");
5
13
  const _hoisted_1 = { class: "resource-select-wrap" };
14
+ const _hoisted_2 = { class: "resource-select-main" };
15
+ const _hoisted_3 = {
16
+ key: 0,
17
+ class: "resource-select-container"
18
+ };
19
+ const _hoisted_4 = {
20
+ key: 0,
21
+ class: "resource-select-filter"
22
+ };
23
+ const _hoisted_5 = { class: "resource-select-content" };
24
+ const _hoisted_6 = { class: "resource-select-footer" };
25
+ const _hoisted_7 = { class: "footer-left" };
26
+ const _hoisted_8 = {
27
+ key: 0,
28
+ class: "footer-right"
29
+ };
6
30
  const _sfc_main = vue.defineComponent({
7
31
  ...{ name: "selectResourceModal" },
8
32
  __name: "component",
@@ -18,55 +42,164 @@ const _sfc_main = vue.defineComponent({
18
42
  setup(__props, { emit: __emit }) {
19
43
  const props = __props;
20
44
  const emits = __emit;
21
- const wrapMode = vue.ref(props.wrap || "modal");
22
- const handleClose = () => {
45
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
46
+ const wrapProps = vue.computed(() => {
47
+ if (props.wrap === "drawer") {
48
+ return {
49
+ class: "resource-select-drawer",
50
+ header: false,
51
+ width: "1024px",
52
+ footer: false
53
+ };
54
+ }
55
+ return {
56
+ bodyClass: "resource-select-modal-body",
57
+ width: "986px",
58
+ closable: false,
59
+ hideTitle: false,
60
+ footer: false
61
+ };
62
+ });
63
+ const activeKey = vue.ref("all");
64
+ vue.provide("userInfo", vue.computed(() => props.userInfo));
65
+ vue.provide("baseAPI", BASE_API);
66
+ const {
67
+ list,
68
+ total,
69
+ limit,
70
+ loading,
71
+ changeKey,
72
+ changeFilter,
73
+ changePage,
74
+ changeSize
75
+ } = useAttachement["default"]({ key: "all", BASE_API });
76
+ const {
77
+ selected,
78
+ selectedKeys,
79
+ disableSelect,
80
+ handleSelect,
81
+ handleClear
82
+ } = useResourceSelect.useResourceSelect(props);
83
+ function handleClose() {
84
+ handleClear();
23
85
  emits("update:visible", false);
24
- };
86
+ }
25
87
  const handleSubmit = (data) => {
26
88
  emits("submit", JSON.parse(JSON.stringify(data)));
27
89
  };
90
+ const handleSelectOne = (params) => {
91
+ if (Array.isArray(params))
92
+ handleSubmit(params);
93
+ else
94
+ handleSubmit([params]);
95
+ handleClose();
96
+ };
97
+ function handleConfirm() {
98
+ handleSelectOne(selected.value);
99
+ }
100
+ function handleToUpload() {
101
+ changeKey("local");
102
+ activeKey.value = "local";
103
+ }
28
104
  return (_ctx, _cache) => {
29
105
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
30
- wrapMode.value === "drawer" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Drawer), {
31
- key: 0,
32
- visible: _ctx.visible,
33
- width: "1024px",
34
- header: false,
35
- footer: false,
36
- class: "resource-select-drawer"
37
- }, {
38
- default: vue.withCtx(() => [
39
- vue.createVNode(index, {
40
- BASE_API: _ctx.BASE_API,
41
- userInfo: _ctx.userInfo,
42
- maxcount: _ctx.maxcount,
43
- filterOptions: _ctx.filterOptions,
44
- onClose: handleClose,
45
- onSubmit: handleSubmit
46
- }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
47
- ]),
48
- _: 1
49
- }, 8, ["visible"])) : wrapMode.value === "modal" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
50
- key: 1,
51
- visible: _ctx.visible,
52
- width: "986px",
53
- "body-class": "resource-select-modal-body",
54
- "hide-title": false,
55
- closable: false,
56
- footer: false
57
- }, {
106
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.wrap === "drawer" ? vue.unref(webVue.Drawer) : vue.unref(webVue.Modal)), vue.mergeProps({ visible: _ctx.visible }, wrapProps.value), {
58
107
  default: vue.withCtx(() => [
59
- vue.createVNode(index, {
60
- BASE_API: _ctx.BASE_API,
61
- userInfo: _ctx.userInfo,
62
- maxcount: _ctx.maxcount,
63
- filterOptions: _ctx.filterOptions,
64
- onClose: handleClose,
65
- onSubmit: handleSubmit
66
- }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
108
+ vue.createElementVNode("div", _hoisted_2, [
109
+ _ctx.userInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
110
+ vue.createCommentVNode(" \u5934\u90E8 "),
111
+ vue.createVNode(index, {
112
+ "model-value": activeKey.value,
113
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
114
+ onChange: vue.unref(changeKey),
115
+ onClose: handleClose
116
+ }, null, 8, ["model-value", "onChange"]),
117
+ vue.createCommentVNode(" \u7B5B\u9009 "),
118
+ activeKey.value !== "local" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
119
+ vue.createVNode(index$1, {
120
+ "disable-upload-by": !["all", "remind"].includes(activeKey.value),
121
+ filterOptions: _ctx.filterOptions,
122
+ onChange: vue.unref(changeFilter),
123
+ onUpload: handleToUpload
124
+ }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
125
+ ])) : vue.createCommentVNode("v-if", true),
126
+ vue.createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
127
+ vue.createElementVNode("div", _hoisted_5, [
128
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
129
+ "outer-style": { height: "100%" },
130
+ style: { "height": "100%", "overflow": "auto" }
131
+ }, {
132
+ default: vue.withCtx(() => [
133
+ vue.withDirectives(vue.createVNode(index$2, {
134
+ loading: vue.unref(loading),
135
+ list: vue.unref(list),
136
+ disable: vue.unref(disableSelect),
137
+ "select-keys": vue.unref(selectedKeys),
138
+ onSelect: vue.unref(handleSelect),
139
+ onSelectOne: handleSelectOne
140
+ }, null, 8, ["loading", "list", "disable", "select-keys", "onSelect"]), [
141
+ [vue.vShow, activeKey.value !== "local"]
142
+ ]),
143
+ vue.withDirectives(vue.createVNode(index$3, {
144
+ disable: vue.unref(disableSelect),
145
+ "select-keys": vue.unref(selectedKeys),
146
+ onSelect: vue.unref(handleSelect),
147
+ onSelectOne: handleSelectOne
148
+ }, null, 8, ["disable", "select-keys", "onSelect"]), [
149
+ [vue.vShow, activeKey.value === "local"]
150
+ ])
151
+ ]),
152
+ _: 1
153
+ })
154
+ ]),
155
+ vue.createCommentVNode(" \u5E95\u90E8 "),
156
+ vue.createElementVNode("div", _hoisted_6, [
157
+ vue.createElementVNode("div", _hoisted_7, [
158
+ activeKey.value !== "local" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Pagination), {
159
+ key: 0,
160
+ total: vue.unref(total),
161
+ "page-size": vue.unref(limit),
162
+ "show-total": "",
163
+ "show-page-size": "",
164
+ "base-size": 3,
165
+ "buffer-size": 1,
166
+ onChange: _cache[1] || (_cache[1] = (e) => vue.unref(changePage)((e - 1) * vue.unref(limit))),
167
+ onPageSizeChange: vue.unref(changeSize)
168
+ }, null, 8, ["total", "page-size", "onPageSizeChange"])) : vue.createCommentVNode("v-if", true)
169
+ ]),
170
+ vue.unref(selected).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
171
+ vue.createVNode(index$4, {
172
+ maxcount: _ctx.maxcount,
173
+ selected: vue.unref(selected),
174
+ onRemove: vue.unref(handleSelect),
175
+ onClear: vue.unref(handleClear)
176
+ }, null, 8, ["maxcount", "selected", "onRemove", "onClear"]),
177
+ vue.createVNode(vue.unref(webVue.Button), { onClick: handleClose }, {
178
+ default: vue.withCtx(() => [
179
+ vue.createTextVNode("\u53D6\u6D88")
180
+ ]),
181
+ _: 1
182
+ }),
183
+ vue.createVNode(vue.unref(webVue.Button), {
184
+ type: "primary",
185
+ onClick: handleConfirm
186
+ }, {
187
+ default: vue.withCtx(() => [
188
+ vue.createTextVNode("\u786E\u5B9A")
189
+ ]),
190
+ _: 1
191
+ })
192
+ ])) : vue.createCommentVNode("v-if", true)
193
+ ])
194
+ ])) : (vue.openBlock(), vue.createBlock(vue.unref(index$5), {
195
+ key: 1,
196
+ type: "empty",
197
+ customTip: "\u6682\u65E0\u6743\u9650"
198
+ }))
199
+ ])
67
200
  ]),
68
201
  _: 1
69
- }, 8, ["visible"])) : vue.createCommentVNode("v-if", true)
202
+ }, 16, ["visible"]))
70
203
  ]);
71
204
  };
72
205
  }
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
- const _hoisted_1 = { class: "card-alias" };
4
- const _hoisted_2 = {
3
+ const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "mask" }, null, -1);
4
+ const _hoisted_2 = { class: "card-alias" };
5
+ const _hoisted_3 = {
5
6
  key: 0,
6
7
  class: "check-box active"
7
8
  };
8
- const _hoisted_3 = {
9
+ const _hoisted_4 = {
9
10
  key: 1,
10
11
  class: "check-box"
11
12
  };
@@ -39,16 +40,17 @@ const _sfc_main = vue.defineComponent({
39
40
  onClick: vue.withModifiers(handleCheck, ["stop"])
40
41
  }, [
41
42
  vue.createElementVNode("div", {
42
- class: vue.normalizeClass(["card-wrapper", { active: selectedOrder.value[_ctx.item.id] }])
43
+ class: vue.normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
43
44
  }, [
44
- vue.renderSlot(_ctx.$slots, "default")
45
+ vue.renderSlot(_ctx.$slots, "default"),
46
+ _hoisted_1
45
47
  ], 2),
46
- vue.createElementVNode("div", _hoisted_1, vue.toDisplayString(_ctx.item.alias), 1),
48
+ vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(_ctx.item.alias), 1),
47
49
  vue.createElementVNode("div", {
48
50
  class: "check-box-wrapper",
49
51
  onClick: vue.withModifiers(handleCheck, ["stop"])
50
52
  }, [
51
- selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3)) : vue.createCommentVNode("v-if", true)
53
+ selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true)
52
54
  ])
53
55
  ]);
54
56
  };
@@ -22,6 +22,12 @@ const _sfc_main = vue.defineComponent({
22
22
  setup(__props, { emit: __emit }) {
23
23
  const props = __props;
24
24
  const emits = __emit;
25
+ const userInfo = vue.inject("userInfo");
26
+ const baseAPI = vue.inject("baseAPI");
27
+ const repoId = vue.computed(() => {
28
+ var _a;
29
+ return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
30
+ });
25
31
  const handlersKey = vue.computed(() => {
26
32
  var _a;
27
33
  if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
@@ -34,17 +40,17 @@ const _sfc_main = vue.defineComponent({
34
40
  emits("select-one", item);
35
41
  }
36
42
  }
37
- const { list, uploadFile } = useUpload["default"]();
38
- const userInfo = vue.inject("userInfo");
39
- const baseAPI = vue.inject("baseAPI");
40
- const repoId = vue.computed(() => {
41
- var _a;
42
- return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
43
- });
43
+ const { list, uploadFile, transcodingFile } = useUpload["default"]();
44
44
  function handleChange(file) {
45
45
  if (!baseAPI || !repoId.value)
46
46
  return;
47
- uploadFile(baseAPI, file.file, 0, repoId.value);
47
+ uploadFile(
48
+ baseAPI,
49
+ file.file,
50
+ 0,
51
+ repoId.value,
52
+ (media) => transcodingFile(baseAPI, media)
53
+ );
48
54
  }
49
55
  return (_ctx, _cache) => {
50
56
  var _a, _b;
@@ -2,13 +2,15 @@
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
4
  var icon = require("@arco-design/web-vue/es/icon");
5
+ var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
5
6
  const _hoisted_1 = { class: "list-selected-wrapper" };
6
7
  const _hoisted_2 = { key: 0 };
7
8
  const _hoisted_3 = { class: "list-panel-header" };
8
9
  const _hoisted_4 = { class: "header-options" };
9
10
  const _hoisted_5 = { class: "list-selected-record" };
10
11
  const _hoisted_6 = { class: "item-thumb" };
11
- const _hoisted_7 = { class: "item-alias" };
12
+ const _hoisted_7 = { class: "item-tag" };
13
+ const _hoisted_8 = { class: "item-alias" };
12
14
  const _sfc_main = vue.defineComponent({
13
15
  __name: "index",
14
16
  props: {
@@ -18,6 +20,10 @@ const _sfc_main = vue.defineComponent({
18
20
  emits: ["remove", "clear"],
19
21
  setup(__props, { emit: __emit }) {
20
22
  const emits = __emit;
23
+ const baseAPI = vue.inject("baseAPI");
24
+ const audioThumb = vue.computed(() => {
25
+ return `${baseAPI}/static/img/music.2ee269c.png`;
26
+ });
21
27
  const visible = vue.ref(false);
22
28
  return (_ctx, _cache) => {
23
29
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
@@ -57,11 +63,18 @@ const _sfc_main = vue.defineComponent({
57
63
  height: "100%",
58
64
  src: item.thumb || item.url
59
65
  }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
60
- ["audio"].includes(item.catalog) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
61
- vue.createTextVNode(" \u97F3\u9891 ")
62
- ], 64)) : vue.createCommentVNode("v-if", true)
66
+ ["audio"].includes(item.catalog) ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), {
67
+ key: 1,
68
+ width: "100%",
69
+ height: "100%",
70
+ fit: "cover",
71
+ src: audioThumb.value
72
+ }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
73
+ vue.createElementVNode("div", _hoisted_7, [
74
+ item.catalog === "video" ? (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconVideoTag), { key: 0 })) : vue.createCommentVNode("v-if", true)
75
+ ])
63
76
  ]),
64
- vue.createElementVNode("div", _hoisted_7, vue.toDisplayString(item.alias), 1),
77
+ vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(item.alias), 1),
65
78
  vue.createVNode(vue.unref(webVue.Button), {
66
79
  type: "text",
67
80
  onClick: ($event) => emits("remove", item)
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var icon = require("@arco-design/web-vue/es/icon");
4
+ var webVue = require("@arco-design/web-vue");
5
+ const _hoisted_1 = { class: "resource-select-header" };
6
+ const _sfc_main = vue.defineComponent({
7
+ __name: "index",
8
+ props: {
9
+ modelValue: {}
10
+ },
11
+ emits: ["update:model-value", "change", "close"],
12
+ setup(__props, { emit: __emit }) {
13
+ const props = __props;
14
+ const emits = __emit;
15
+ const activeKey = vue.computed({
16
+ get: () => props.modelValue,
17
+ set: (value) => emits("update:model-value", value)
18
+ });
19
+ return (_ctx, _cache) => {
20
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
21
+ vue.createVNode(vue.unref(webVue.Tabs), {
22
+ "active-key": activeKey.value,
23
+ "onUpdate:activeKey": _cache[1] || (_cache[1] = ($event) => activeKey.value = $event),
24
+ onChange: _cache[2] || (_cache[2] = (e) => emits("change", e))
25
+ }, {
26
+ extra: vue.withCtx(() => [
27
+ vue.createVNode(vue.unref(webVue.Button), {
28
+ type: "secondary",
29
+ shape: "round",
30
+ onClick: _cache[0] || (_cache[0] = ($event) => emits("close"))
31
+ }, {
32
+ icon: vue.withCtx(() => [
33
+ vue.createVNode(vue.unref(icon.IconClose))
34
+ ]),
35
+ _: 1
36
+ })
37
+ ]),
38
+ default: vue.withCtx(() => [
39
+ vue.createVNode(vue.unref(webVue.TabPane), {
40
+ key: "all",
41
+ title: "\u5168\u90E8\u7D20\u6750"
42
+ }),
43
+ vue.createVNode(vue.unref(webVue.TabPane), {
44
+ key: "my",
45
+ title: "\u6211\u7684\u7D20\u6750"
46
+ }),
47
+ vue.createVNode(vue.unref(webVue.TabPane), {
48
+ key: "remind",
49
+ title: "\u63D0\u9192\u6211\u7684"
50
+ }),
51
+ vue.createVNode(vue.unref(webVue.TabPane), {
52
+ key: "local",
53
+ title: "\u672C\u5730\u7D20\u6750"
54
+ })
55
+ ]),
56
+ _: 1
57
+ }, 8, ["active-key"])
58
+ ]);
59
+ };
60
+ }
61
+ });
62
+ module.exports = _sfc_main;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ var vue = require("vue");
4
+ function useResourceSelect(props) {
5
+ const selected = vue.ref([]);
6
+ const selectedKeys = vue.computed(() => selected.value.map((item) => item.id));
7
+ const disableSelect = vue.computed(() => props.maxcount && selected.value.length >= props.maxcount);
8
+ function handleSelect(params) {
9
+ const { id } = params;
10
+ const index = selected.value.findIndex((item) => item.id === id);
11
+ if (index > -1)
12
+ selected.value.splice(index, 1);
13
+ else
14
+ selected.value.push(params);
15
+ }
16
+ function handleClear() {
17
+ selected.value = [];
18
+ }
19
+ return {
20
+ selected,
21
+ selectedKeys,
22
+ disableSelect,
23
+ handleSelect,
24
+ handleClear
25
+ };
26
+ }
27
+ exports.useResourceSelect = useResourceSelect;
@@ -71,10 +71,18 @@
71
71
  overflow: hidden;
72
72
  }
73
73
  .list-panel-wrapper .list-selected-record .list-selected-item .item-thumb {
74
+ position: relative;
74
75
  width: 50px;
75
76
  height: 38px;
76
77
  overflow: hidden;
77
78
  }
79
+ .list-panel-wrapper .list-selected-record .list-selected-item .item-thumb .item-tag {
80
+ position: absolute;
81
+ top: 50%;
82
+ left: 50%;
83
+ color: white;
84
+ transform: translate(-50%, -50%);
85
+ }
78
86
  .list-panel-wrapper .list-selected-record .list-selected-item .item-alias {
79
87
  flex: 1;
80
88
  overflow: hidden;
@@ -104,13 +112,31 @@
104
112
  .card-wrapper-image {
105
113
  position: relative;
106
114
  overflow: hidden;
107
- cursor: pointer;
108
115
  }
109
116
  .card-wrapper-image .card-wrapper {
110
117
  position: relative;
111
118
  overflow: hidden;
119
+ border-radius: 2px;
120
+ transition: all 0.3s ease-in-out;
112
121
  aspect-ratio: 4 / 3;
113
122
  }
123
+ .card-wrapper-image .card-wrapper.disable:not(.active) {
124
+ opacity: 0.4;
125
+ }
126
+ .card-wrapper-image .card-wrapper .mask {
127
+ position: absolute;
128
+ top: 0;
129
+ z-index: 9;
130
+ display: none;
131
+ width: 100%;
132
+ height: 100%;
133
+ font-size: 18px;
134
+ background: rgba(0, 0, 0, 0.3);
135
+ cursor: pointer;
136
+ }
137
+ .card-wrapper-image .card-wrapper.active .mask {
138
+ display: block;
139
+ }
114
140
  .card-wrapper-image .card-alias {
115
141
  width: 100%;
116
142
  margin-top: 6px;
@@ -120,6 +146,8 @@
120
146
  line-height: 22px;
121
147
  white-space: nowrap;
122
148
  text-overflow: ellipsis;
149
+ user-select: none;
150
+ -webkit-user-drag: none;
123
151
  }
124
152
  .card-wrapper-image:hover .check-box-wrapper .check-box,
125
153
  .card-wrapper-image .check-box-wrapper .check-box.active {
@@ -129,6 +157,7 @@
129
157
  position: absolute;
130
158
  top: 8px;
131
159
  left: 8px;
160
+ z-index: 10;
132
161
  cursor: pointer;
133
162
  }
134
163
  .card-wrapper-image .check-box-wrapper .check-box {
@@ -1,13 +1,34 @@
1
1
  .card-wrapper-image {
2
2
  position: relative;
3
3
  overflow: hidden;
4
- cursor: pointer;
5
4
 
6
5
  .card-wrapper {
7
6
  position: relative;
8
7
  overflow: hidden;
8
+ border-radius: 2px;
9
+ transition: all 0.3s ease-in-out;
9
10
  // 宽高:43
10
11
  aspect-ratio: 4 / 3;
12
+
13
+ &.disable:not(.active) {
14
+ opacity: 0.4;
15
+ }
16
+
17
+ .mask {
18
+ position: absolute;
19
+ top: 0;
20
+ z-index: 9;
21
+ display: none;
22
+ width: 100%;
23
+ height: 100%;
24
+ font-size: 18px;
25
+ background: rgba(0, 0, 0, 0.3);
26
+ cursor: pointer;
27
+ }
28
+
29
+ &.active .mask {
30
+ display: block;
31
+ }
11
32
  }
12
33
 
13
34
  .card-alias {
@@ -19,6 +40,8 @@
19
40
  line-height: 22px;
20
41
  white-space: nowrap;
21
42
  text-overflow: ellipsis;
43
+ user-select: none;
44
+ -webkit-user-drag: none;
22
45
  }
23
46
 
24
47
  &:hover .check-box-wrapper .check-box,
@@ -30,6 +53,7 @@
30
53
  position: absolute;
31
54
  top: 8px;
32
55
  left: 8px;
56
+ z-index: 10;
33
57
  cursor: pointer;
34
58
 
35
59
  .check-box {
@@ -59,9 +59,18 @@
59
59
  overflow: hidden;
60
60
 
61
61
  .item-thumb {
62
+ position: relative;
62
63
  width: 50px;
63
64
  height: 38px;
64
65
  overflow: hidden;
66
+
67
+ .item-tag {
68
+ position: absolute;
69
+ top: 50%;
70
+ left: 50%;
71
+ color: white;
72
+ transform: translate(-50%, -50%);
73
+ }
65
74
  }
66
75
 
67
76
  .item-alias {
@@ -10,9 +10,13 @@ const _hoisted_1 = {
10
10
  key: 0,
11
11
  class: "thumb-upload-loading"
12
12
  };
13
- const _hoisted_2 = { class: "thumb-handler-list" };
14
- const _hoisted_3 = ["onClick"];
15
- const _hoisted_4 = {
13
+ const _hoisted_2 = {
14
+ key: 0,
15
+ class: "thumb-upload-text"
16
+ };
17
+ const _hoisted_3 = { class: "thumb-handler-list" };
18
+ const _hoisted_4 = ["onClick"];
19
+ const _hoisted_5 = {
16
20
  key: 3,
17
21
  class: "thumb-select-tag"
18
22
  };
@@ -40,7 +44,7 @@ const _sfc_main = vue.defineComponent({
40
44
  var _a;
41
45
  return ((_a = props.meta) == null ? void 0 : _a.progress) != null;
42
46
  });
43
- const thumb = vue.computed(() => {
47
+ const realThumb = vue.computed(() => {
44
48
  if (["image", "video"].includes(props.catalog || "")) {
45
49
  return props.thumb || props.url || "";
46
50
  }
@@ -76,7 +80,7 @@ const _sfc_main = vue.defineComponent({
76
80
  emits("edit", { key });
77
81
  }
78
82
  return (_ctx, _cache) => {
79
- var _a, _b;
83
+ var _a, _b, _c;
80
84
  return vue.openBlock(), vue.createElementBlock("div", {
81
85
  class: vue.normalizeClass(["thumb-select-wrapper", classList.value]),
82
86
  style: vue.normalizeStyle(styleObject.value)
@@ -84,8 +88,9 @@ const _sfc_main = vue.defineComponent({
84
88
  isUploading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
85
89
  vue.createVNode(vue.unref(webVue.Progress), {
86
90
  type: "circle",
87
- percent: ((_a = _ctx.meta) == null ? void 0 : _a.progress) / 10
88
- }, null, 8, ["percent"])
91
+ percent: (_a = _ctx.meta) == null ? void 0 : _a.progress
92
+ }, null, 8, ["percent"]),
93
+ ((_b = _ctx.meta) == null ? void 0 : _b.isTrans) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, "\u8F6C\u7801\u4E2D...")) : vue.createCommentVNode("v-if", true)
89
94
  ])) : _ctx.isEdit && !_ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
90
95
  vue.createCommentVNode(" \u7F16\u8F91\u6A21\u5F0F\u4E0B\u53EF\u4F7F\u7528\u60AC\u6D6E\u6846\u5FEB\u901F\u63D2\u5165\u7D20\u6750 "),
91
96
  vue.createVNode(vue.unref(webVue.Dropdown), {
@@ -124,20 +129,23 @@ const _sfc_main = vue.defineComponent({
124
129
  _ctx.catalog ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
125
130
  key: 0,
126
131
  class: "thumb-image",
127
- src: thumb.value
132
+ src: realThumb.value
128
133
  }, aImageAttr.value), null, 16, ["src"])) : vue.createCommentVNode("v-if", true),
129
134
  vue.createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
130
- vue.createElementVNode("div", _hoisted_2, [
135
+ vue.createElementVNode("div", _hoisted_3, [
131
136
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
132
137
  return vue.openBlock(), vue.createElementBlock("div", {
133
138
  key: item.key,
134
139
  class: "handler-item",
135
140
  onClick: vue.withModifiers(() => handleOption(item.key), ["stop"])
136
- }, vue.toDisplayString(item.label), 9, _hoisted_3);
141
+ }, vue.toDisplayString(item.label), 9, _hoisted_4);
137
142
  }), 128))
138
143
  ])
139
144
  ], 64)) : vue.createCommentVNode("v-if", true),
140
- ["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, vue.toDisplayString(vue.unref(index.mediaTime)((_b = _ctx.meta) == null ? void 0 : _b.length)), 1)) : vue.createCommentVNode("v-if", true)
145
+ ["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
146
+ _ctx.catalog === "video" ? (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconVideoTag), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconAudioTag), { key: 1 })),
147
+ vue.createTextVNode(" " + vue.toDisplayString(vue.unref(index.mediaTime)((_c = _ctx.meta) == null ? void 0 : _c.length)), 1)
148
+ ])) : vue.createCommentVNode("v-if", true)
141
149
  ], 6);
142
150
  };
143
151
  }