@cmstops/pro-compo 0.3.33 → 0.3.35

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 (48) hide show
  1. package/dist/index.css +114 -58
  2. package/dist/index.min.css +1 -1
  3. package/es/appCenter/component.js +1 -1
  4. package/es/hooks/useUpload.d.ts +15 -0
  5. package/es/hooks/useUpload.js +88 -0
  6. package/es/index.css +114 -58
  7. package/es/selectResourceModal/component.js +24 -8
  8. package/es/selectResourceModal/components/ListCardWrapper/index.d.ts +0 -0
  9. package/es/selectResourceModal/components/ListCardWrapper/index.js +56 -0
  10. package/es/selectResourceModal/components/ListContent/index.js +12 -35
  11. package/es/selectResourceModal/components/ListContentLocal/components/Upload.d.ts +0 -0
  12. package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +67 -0
  13. package/es/selectResourceModal/components/ListContentLocal/index.d.ts +0 -0
  14. package/es/selectResourceModal/components/ListContentLocal/index.js +87 -0
  15. package/es/selectResourceModal/components/ListFilter/index.js +9 -2
  16. package/es/selectResourceModal/style/index.css +98 -58
  17. package/es/selectResourceModal/style/index.less +20 -2
  18. package/es/selectResourceModal/style/listCardWrapper.less +63 -0
  19. package/es/selectResourceModal/style/listContent.less +1 -63
  20. package/es/selectResourceModal/style/listContentLocal.less +26 -0
  21. package/es/selectResourceModal/style/listSelected.less +11 -3
  22. package/es/thumbCard/assets/magic.js +2 -0
  23. package/es/thumbCard/component.js +70 -43
  24. package/es/thumbCard/style/index.css +16 -0
  25. package/es/thumbCard/style/index.less +21 -0
  26. package/es/utils/tusUpload.d.ts +8 -0
  27. package/es/utils/tusUpload.js +35 -1
  28. package/lib/appCenter/component.js +1 -1
  29. package/lib/hooks/useUpload.js +91 -0
  30. package/lib/index.css +114 -58
  31. package/lib/selectResourceModal/component.js +25 -9
  32. package/lib/selectResourceModal/components/ListCardWrapper/index.js +57 -0
  33. package/lib/selectResourceModal/components/ListContent/index.js +15 -38
  34. package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +68 -0
  35. package/lib/selectResourceModal/components/ListContentLocal/index.js +88 -0
  36. package/lib/selectResourceModal/components/ListFilter/index.js +9 -2
  37. package/lib/selectResourceModal/style/index.css +98 -58
  38. package/lib/selectResourceModal/style/index.less +20 -2
  39. package/lib/selectResourceModal/style/listCardWrapper.less +63 -0
  40. package/lib/selectResourceModal/style/listContent.less +1 -63
  41. package/lib/selectResourceModal/style/listContentLocal.less +26 -0
  42. package/lib/selectResourceModal/style/listSelected.less +11 -3
  43. package/lib/thumbCard/assets/magic.js +3 -0
  44. package/lib/thumbCard/component.js +68 -41
  45. package/lib/thumbCard/style/index.css +16 -0
  46. package/lib/thumbCard/style/index.less +21 -0
  47. package/lib/utils/tusUpload.js +35 -0
  48. package/package.json +1 -1
package/es/index.css CHANGED
@@ -4254,6 +4254,18 @@
4254
4254
  border-radius: 2px;
4255
4255
  cursor: pointer;
4256
4256
  }
4257
+ .thumb-select-wrapper .thumb-upload-loading {
4258
+ display: flex;
4259
+ align-items: center;
4260
+ justify-content: center;
4261
+ width: 100%;
4262
+ height: 100%;
4263
+ color: #fff;
4264
+ background-color: rgba(0, 0, 0, 0.5);
4265
+ }
4266
+ .thumb-select-wrapper .thumb-upload-loading .arco-progress-circle-text {
4267
+ color: #fff;
4268
+ }
4257
4269
  .thumb-select-wrapper .thumb-add {
4258
4270
  color: var(--color-text-2);
4259
4271
  font-size: 16px;
@@ -4290,6 +4302,10 @@
4290
4302
  .thumb-select-wrapper:hover .thumb-handler-list {
4291
4303
  opacity: 1;
4292
4304
  }
4305
+ .thumb-select-wrapper.thumb-no-mask {
4306
+ background-color: #f2f3f5;
4307
+ border: 1px dashed #e5e6eb !important;
4308
+ }
4293
4309
  .arco-dropdown-option-content {
4294
4310
  display: flex;
4295
4311
  gap: 8px;
@@ -4299,59 +4315,7 @@
4299
4315
  .card-list-wrapper {
4300
4316
  display: grid;
4301
4317
  grid-gap: 20px;
4302
- grid-template-columns: repeat(4, 1fr);
4303
- }
4304
- .card-list-wrapper .card-wrapper-image {
4305
- position: relative;
4306
- overflow: hidden;
4307
- }
4308
- .card-list-wrapper .card-wrapper-image .card-wrapper {
4309
- overflow: hidden;
4310
- aspect-ratio: 4 / 3;
4311
- }
4312
- .card-list-wrapper .card-wrapper-image .card-alias {
4313
- width: 100%;
4314
- margin-top: 6px;
4315
- overflow: hidden;
4316
- color: #3d3d3d;
4317
- font-size: 14px;
4318
- line-height: 22px;
4319
- white-space: nowrap;
4320
- text-overflow: ellipsis;
4321
- }
4322
- .card-list-wrapper .card-wrapper-image:hover .check-box-wrapper .check-box,
4323
- .card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box.active {
4324
- opacity: 1;
4325
- }
4326
- .card-list-wrapper .card-wrapper-image .check-box-wrapper {
4327
- position: absolute;
4328
- top: 8px;
4329
- left: 8px;
4330
- cursor: pointer;
4331
- }
4332
- .card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box {
4333
- box-sizing: border-box;
4334
- width: 22px;
4335
- height: 22px;
4336
- font-size: 14px;
4337
- line-height: 22px;
4338
- text-align: center;
4339
- background-color: rgba(0, 0, 0, 0.2);
4340
- border: 1px solid white;
4341
- border-radius: 50%;
4342
- opacity: 0;
4343
- transition: all 0.3s ease-in-out;
4344
- }
4345
- .card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box::selection {
4346
- display: none;
4347
- }
4348
- .card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box:hover {
4349
- background-color: rgba(0, 0, 0, 0.3);
4350
- }
4351
- .card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box.active {
4352
- color: white;
4353
- background-color: #165dff;
4354
- border-color: #165dff;
4318
+ grid-template-columns: repeat(5, 1fr);
4355
4319
  }
4356
4320
  .list-filter-wrapper {
4357
4321
  display: flex;
@@ -4369,7 +4333,6 @@
4369
4333
  }
4370
4334
  .list-panel-wrapper {
4371
4335
  width: 420px;
4372
- max-height: 600px;
4373
4336
  padding: 0 !important;
4374
4337
  overflow: hidden;
4375
4338
  border: none;
@@ -4383,7 +4346,12 @@
4383
4346
  display: none;
4384
4347
  }
4385
4348
  .list-panel-wrapper .arco-popover-content {
4349
+ display: flex;
4350
+ flex-direction: column;
4351
+ height: 100%;
4352
+ max-height: 600px;
4386
4353
  margin-top: 0;
4354
+ overflow: hidden;
4387
4355
  }
4388
4356
  .list-panel-wrapper .list-panel-header {
4389
4357
  display: flex;
@@ -4403,8 +4371,11 @@
4403
4371
  cursor: pointer;
4404
4372
  }
4405
4373
  .list-panel-wrapper .list-selected-record {
4406
- display: flex;
4407
- flex-direction: column;
4374
+ flex: 1;
4375
+ overflow-y: scroll;
4376
+ }
4377
+ .list-panel-wrapper .list-selected-record::-webkit-scrollbar {
4378
+ display: none;
4408
4379
  }
4409
4380
  .list-panel-wrapper .list-selected-record .list-selected-item {
4410
4381
  display: flex;
@@ -4424,6 +4395,85 @@
4424
4395
  white-space: nowrap;
4425
4396
  text-overflow: ellipsis;
4426
4397
  }
4398
+ .upload-list-wrapper .list-content {
4399
+ margin-top: 30px;
4400
+ }
4401
+ .upload-list-wrapper .list-content .list-tips {
4402
+ margin-bottom: 16px;
4403
+ color: #3d3d3d;
4404
+ }
4405
+ .upload-list-wrapper .upload-wrapper {
4406
+ display: flex;
4407
+ flex-direction: column;
4408
+ }
4409
+ .upload-list-wrapper .upload-wrapper .upload-buttons {
4410
+ display: flex;
4411
+ gap: 20px;
4412
+ justify-content: center;
4413
+ margin: 20px 0;
4414
+ }
4415
+ .upload-list-wrapper .upload-wrapper .upload-dragger {
4416
+ width: calc(100% - 2px);
4417
+ }
4418
+ .card-wrapper-image {
4419
+ position: relative;
4420
+ overflow: hidden;
4421
+ cursor: pointer;
4422
+ }
4423
+ .card-wrapper-image .card-wrapper {
4424
+ position: relative;
4425
+ overflow: hidden;
4426
+ aspect-ratio: 4 / 3;
4427
+ }
4428
+ .card-wrapper-image .card-alias {
4429
+ width: 100%;
4430
+ margin-top: 6px;
4431
+ overflow: hidden;
4432
+ color: #3d3d3d;
4433
+ font-size: 14px;
4434
+ line-height: 22px;
4435
+ white-space: nowrap;
4436
+ text-overflow: ellipsis;
4437
+ }
4438
+ .card-wrapper-image:hover .check-box-wrapper .check-box,
4439
+ .card-wrapper-image .check-box-wrapper .check-box.active {
4440
+ opacity: 1;
4441
+ }
4442
+ .card-wrapper-image .check-box-wrapper {
4443
+ position: absolute;
4444
+ top: 8px;
4445
+ left: 8px;
4446
+ cursor: pointer;
4447
+ }
4448
+ .card-wrapper-image .check-box-wrapper .check-box {
4449
+ box-sizing: border-box;
4450
+ width: 22px;
4451
+ height: 22px;
4452
+ font-size: 14px;
4453
+ line-height: 22px;
4454
+ text-align: center;
4455
+ background-color: rgba(0, 0, 0, 0.2);
4456
+ border: 1px solid white;
4457
+ border-radius: 50%;
4458
+ opacity: 0;
4459
+ transition: all 0.3s ease-in-out;
4460
+ }
4461
+ .card-wrapper-image .check-box-wrapper .check-box::selection {
4462
+ display: none;
4463
+ }
4464
+ .card-wrapper-image .check-box-wrapper .check-box:hover {
4465
+ background-color: rgba(0, 0, 0, 0.3);
4466
+ }
4467
+ .card-wrapper-image .check-box-wrapper .check-box.active {
4468
+ color: white;
4469
+ background-color: #165dff;
4470
+ border-color: #165dff;
4471
+ }
4472
+ .resource-select-drawer .arco-drawer-body {
4473
+ box-sizing: border-box;
4474
+ padding: 0;
4475
+ overflow: hidden;
4476
+ }
4427
4477
  .resource-select-container {
4428
4478
  display: flex;
4429
4479
  flex-direction: column;
@@ -4432,9 +4482,14 @@
4432
4482
  height: 100%;
4433
4483
  }
4434
4484
  .resource-select-container .resource-select-filter,
4435
- .resource-select-container .resource-select-content,
4436
4485
  .resource-select-container .resource-select-footer {
4437
- padding: 0 16px 0;
4486
+ padding: 0 40px;
4487
+ }
4488
+ .resource-select-container .resource-select-content .arco-scrollbar-container {
4489
+ padding: 0 40px;
4490
+ }
4491
+ .resource-select-container .resource-select-header {
4492
+ padding: 10px 24px 0;
4438
4493
  }
4439
4494
  .resource-select-container .resource-select-header .arco-tabs-nav::before {
4440
4495
  display: none;
@@ -4449,6 +4504,7 @@
4449
4504
  .resource-select-container .resource-select-footer {
4450
4505
  display: flex;
4451
4506
  justify-content: space-between;
4507
+ padding-bottom: 10px;
4452
4508
  }
4453
4509
  .resource-select-container .resource-select-footer .footer-right {
4454
4510
  display: flex;
@@ -1,9 +1,10 @@
1
- import { defineComponent, ref, provide, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, createTextVNode } from "vue";
1
+ import { defineComponent, ref, provide, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, createTextVNode, withDirectives, vShow } from "vue";
2
2
  import { Drawer, Tabs, Button, TabPane, Scrollbar, Pagination } from "@arco-design/web-vue";
3
3
  import emptyData from "../emptyData/index.js";
4
4
  import _sfc_main$1 from "./components/ListFilter/index.js";
5
5
  import _sfc_main$2 from "./components/ListContent/index.js";
6
- import _sfc_main$3 from "./components/ListSelected/index.js";
6
+ import _sfc_main$4 from "./components/ListSelected/index.js";
7
+ import _sfc_main$3 from "./components/ListContentLocal/index.js";
7
8
  import useAttachement from "../hooks/useAttachement.js";
8
9
  import { DEFAULT_BASE_API } from "../config.js";
9
10
  const _hoisted_1 = {
@@ -29,7 +30,8 @@ const _sfc_main = defineComponent({
29
30
  BASE_API: {},
30
31
  visible: { type: Boolean },
31
32
  userInfo: {},
32
- maxcount: {}
33
+ maxcount: {},
34
+ filterOptions: {}
33
35
  },
34
36
  emits: ["update:visible", "submit"],
35
37
  setup(__props, { emit: __emit }) {
@@ -90,7 +92,8 @@ const _sfc_main = defineComponent({
90
92
  visible: _ctx.visible,
91
93
  width: "1024px",
92
94
  header: false,
93
- footer: false
95
+ footer: false,
96
+ class: "resource-select-drawer"
94
97
  }, {
95
98
  default: withCtx(() => [
96
99
  _ctx.userInfo ? (openBlock(), createElementBlock("div", _hoisted_1, [
@@ -137,9 +140,10 @@ const _sfc_main = defineComponent({
137
140
  activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_3, [
138
141
  createVNode(_sfc_main$1, {
139
142
  "disable-upload-by": activeKey.value !== "all",
143
+ filterOptions: _ctx.filterOptions,
140
144
  onChange: unref(changeFilter),
141
145
  onUpload: handleToUpload
142
- }, null, 8, ["disable-upload-by", "onChange"])
146
+ }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
143
147
  ])) : createCommentVNode("v-if", true),
144
148
  createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
145
149
  createElementVNode("div", _hoisted_4, [
@@ -148,14 +152,24 @@ const _sfc_main = defineComponent({
148
152
  style: { "height": "100%", "overflow": "auto" }
149
153
  }, {
150
154
  default: withCtx(() => [
151
- createVNode(_sfc_main$2, {
155
+ withDirectives(createVNode(_sfc_main$2, {
152
156
  loading: unref(loading),
153
157
  list: unref(list),
154
158
  disable: disableSelect.value,
155
159
  "select-keys": selectedKeys.value,
156
160
  onSelect: handleSelect,
157
161
  onSelectOne: handleSelectOne
158
- }, null, 8, ["loading", "list", "disable", "select-keys"])
162
+ }, null, 8, ["loading", "list", "disable", "select-keys"]), [
163
+ [vShow, activeKey.value !== "local"]
164
+ ]),
165
+ withDirectives(createVNode(_sfc_main$3, {
166
+ disable: disableSelect.value,
167
+ "select-keys": selectedKeys.value,
168
+ onSelect: handleSelect,
169
+ onSelectOne: handleSelectOne
170
+ }, null, 8, ["disable", "select-keys"]), [
171
+ [vShow, activeKey.value === "local"]
172
+ ])
159
173
  ]),
160
174
  _: 1
161
175
  })
@@ -169,12 +183,14 @@ const _sfc_main = defineComponent({
169
183
  "page-size": unref(limit),
170
184
  "show-total": "",
171
185
  "show-page-size": "",
186
+ "base-size": 3,
187
+ "buffer-size": 1,
172
188
  onChange: _cache[1] || (_cache[1] = (e) => unref(changePage)((e - 1) * unref(limit))),
173
189
  onPageSizeChange: unref(changeSize)
174
190
  }, null, 8, ["total", "page-size", "onPageSizeChange"])) : createCommentVNode("v-if", true)
175
191
  ]),
176
192
  selected.value.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
177
- createVNode(_sfc_main$3, {
193
+ createVNode(_sfc_main$4, {
178
194
  maxcount: _ctx.maxcount,
179
195
  selected: selected.value,
180
196
  onRemove: handleSelect,
@@ -0,0 +1,56 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, renderSlot, toDisplayString, createCommentVNode } from "vue";
2
+ const _hoisted_1 = { class: "card-alias" };
3
+ const _hoisted_2 = {
4
+ key: 0,
5
+ class: "check-box active"
6
+ };
7
+ const _hoisted_3 = {
8
+ key: 1,
9
+ class: "check-box"
10
+ };
11
+ const _sfc_main = defineComponent({
12
+ __name: "index",
13
+ props: {
14
+ item: {},
15
+ selectKeys: {},
16
+ disable: { type: Boolean }
17
+ },
18
+ emits: ["select"],
19
+ setup(__props, { emit: __emit }) {
20
+ const props = __props;
21
+ const emits = __emit;
22
+ const selectedOrder = computed(() => {
23
+ var _a;
24
+ const result = {};
25
+ (_a = props.selectKeys) == null ? void 0 : _a.forEach((key, index) => {
26
+ result[key] = index + 1;
27
+ });
28
+ return result;
29
+ });
30
+ function handleCheck() {
31
+ if (props.disable && !selectedOrder.value[props.item.id])
32
+ return;
33
+ emits("select", props.item);
34
+ }
35
+ return (_ctx, _cache) => {
36
+ return openBlock(), createElementBlock("div", {
37
+ class: "card-wrapper-image",
38
+ onClick: withModifiers(handleCheck, ["stop"])
39
+ }, [
40
+ createElementVNode("div", {
41
+ class: normalizeClass(["card-wrapper", { active: selectedOrder.value[_ctx.item.id] }])
42
+ }, [
43
+ renderSlot(_ctx.$slots, "default")
44
+ ], 2),
45
+ createElementVNode("div", _hoisted_1, toDisplayString(_ctx.item.alias), 1),
46
+ createElementVNode("div", {
47
+ class: "check-box-wrapper",
48
+ onClick: withModifiers(handleCheck, ["stop"])
49
+ }, [
50
+ selectedOrder.value[_ctx.item.id] ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("v-if", true)
51
+ ])
52
+ ]);
53
+ };
54
+ }
55
+ });
56
+ export { _sfc_main as default };
@@ -1,19 +1,9 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, unref, toDisplayString, createCommentVNode, createBlock } from "vue";
1
+ import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, createBlock, withCtx, createVNode, unref, createCommentVNode } from "vue";
2
2
  import { Spin } from "@arco-design/web-vue";
3
3
  import emptyData from "../../../emptyData/index.js";
4
4
  import thumbCard from "../../../thumbCard/index.js";
5
+ import _sfc_main$1 from "../ListCardWrapper/index.js";
5
6
  const _hoisted_1 = { class: "card-list-wrapper" };
6
- const _hoisted_2 = { class: "card-wrapper" };
7
- const _hoisted_3 = { class: "card-alias" };
8
- const _hoisted_4 = ["onClick"];
9
- const _hoisted_5 = {
10
- key: 0,
11
- class: "check-box active"
12
- };
13
- const _hoisted_6 = {
14
- key: 1,
15
- class: "check-box"
16
- };
17
7
  const _sfc_main = defineComponent({
18
8
  __name: "index",
19
9
  props: {
@@ -38,43 +28,30 @@ const _sfc_main = defineComponent({
38
28
  emits("select-one", item);
39
29
  }
40
30
  }
41
- function handleCheck(params) {
42
- emits("select", params);
43
- }
44
- const selectedOrder = computed(() => {
45
- var _a;
46
- const result = {};
47
- (_a = props.selectKeys) == null ? void 0 : _a.forEach((key, index) => {
48
- result[key] = index + 1;
49
- });
50
- return result;
51
- });
52
31
  return (_ctx, _cache) => {
53
32
  var _a, _b;
54
33
  return openBlock(), createElementBlock("div", _hoisted_1, [
55
34
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item) => {
56
- return openBlock(), createElementBlock("div", {
35
+ return openBlock(), createBlock(_sfc_main$1, {
57
36
  key: item.id,
58
- class: "card-wrapper-image"
59
- }, [
60
- createElementVNode("div", _hoisted_2, [
37
+ item,
38
+ "select-keys": _ctx.selectKeys,
39
+ disable: _ctx.disable,
40
+ onSelect: () => emits("select", item)
41
+ }, {
42
+ default: withCtx(() => [
61
43
  createVNode(unref(thumbCard), {
62
44
  url: item.url,
63
45
  thumb: item.thumb,
64
46
  catalog: item.catalog,
65
47
  meta: item,
48
+ "use-mask": true,
66
49
  "handlers-key": handlersKey.value,
67
50
  onHandle: handleOption
68
51
  }, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key"])
69
52
  ]),
70
- createElementVNode("div", _hoisted_3, toDisplayString(item.alias), 1),
71
- createElementVNode("div", {
72
- class: "check-box-wrapper",
73
- onClick: () => handleCheck(item)
74
- }, [
75
- selectedOrder.value[item.id] ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(selectedOrder.value[item.id]), 1)) : !_ctx.disable ? (openBlock(), createElementBlock("div", _hoisted_6)) : createCommentVNode("v-if", true)
76
- ], 8, _hoisted_4)
77
- ]);
53
+ _: 2
54
+ }, 1032, ["item", "select-keys", "disable", "onSelect"]);
78
55
  }), 128)),
79
56
  createCommentVNode(" \u7A7A\u72B6\u6001 "),
80
57
  ((_a = _ctx.list) == null ? void 0 : _a.length) === 0 && _ctx.loading ? (openBlock(), createBlock(unref(Spin), {
@@ -0,0 +1,67 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode } from "vue";
2
+ import { Upload, Button } from "@arco-design/web-vue";
3
+ import { IconComputer } from "@arco-iconbox/vue-cmstop-icons";
4
+ const _hoisted_1 = { class: "upload-wrapper" };
5
+ const _hoisted_2 = { class: "upload-buttons" };
6
+ const _hoisted_3 = { class: "upload-dragger" };
7
+ const accept = "image/*,video/*,audio/*";
8
+ const _sfc_main = defineComponent({
9
+ __name: "Upload",
10
+ emits: ["change"],
11
+ setup(__props, { emit: __emit }) {
12
+ const emits = __emit;
13
+ function handleUpload(options) {
14
+ emits("change", options.fileItem);
15
+ }
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createElementBlock("div", _hoisted_1, [
18
+ createElementVNode("div", _hoisted_2, [
19
+ createVNode(unref(Upload), {
20
+ accept,
21
+ multiple: true,
22
+ directory: false,
23
+ "show-file-list": false,
24
+ "custom-request": handleUpload,
25
+ style: { "width": "auto" }
26
+ }, {
27
+ "upload-button": withCtx(() => [
28
+ createVNode(unref(Button), { type: "primary" }, {
29
+ icon: withCtx(() => [
30
+ createVNode(unref(IconComputer))
31
+ ]),
32
+ default: withCtx(() => [
33
+ createTextVNode(" \u672C\u5730\u4E0A\u4F20 ")
34
+ ]),
35
+ _: 1
36
+ })
37
+ ]),
38
+ _: 1
39
+ }),
40
+ createVNode(unref(Button), { type: "primary" }, {
41
+ default: withCtx(() => [
42
+ createTextVNode(" \u626B\u7801\u4E0A\u4F20 ")
43
+ ]),
44
+ _: 1
45
+ }),
46
+ createVNode(unref(Button), { type: "primary" }, {
47
+ default: withCtx(() => [
48
+ createTextVNode(" \u5206\u4EAB\u4E0A\u4F20 ")
49
+ ]),
50
+ _: 1
51
+ })
52
+ ]),
53
+ createElementVNode("div", _hoisted_3, [
54
+ createVNode(unref(Upload), {
55
+ draggable: "",
56
+ tip: "\u652F\u6301\u56FE\u7247\u3001\u89C6\u9891\u3001\u97F3\u9891\u6587\u4EF6",
57
+ accept,
58
+ multiple: true,
59
+ "show-file-list": false,
60
+ "custom-request": handleUpload
61
+ })
62
+ ])
63
+ ]);
64
+ };
65
+ }
66
+ });
67
+ export { _sfc_main as default };
@@ -0,0 +1,87 @@
1
+ import { defineComponent, computed, inject, openBlock, createElementBlock, createCommentVNode, createElementVNode, createVNode, unref, toDisplayString, Fragment, renderList, createBlock, withCtx } from "vue";
2
+ import _sfc_main$1 from "./components/Upload.js";
3
+ import useUpload from "../../../hooks/useUpload.js";
4
+ import thumbCard from "../../../thumbCard/index.js";
5
+ import _sfc_main$2 from "../ListCardWrapper/index.js";
6
+ const _hoisted_1 = { class: "upload-list-wrapper" };
7
+ const _hoisted_2 = { class: "list-upload" };
8
+ const _hoisted_3 = { class: "list-content" };
9
+ const _hoisted_4 = {
10
+ key: 0,
11
+ class: "list-tips"
12
+ };
13
+ const _hoisted_5 = { class: "card-list-wrapper" };
14
+ const _sfc_main = defineComponent({
15
+ __name: "index",
16
+ props: {
17
+ selectKeys: {},
18
+ disable: { type: Boolean }
19
+ },
20
+ emits: ["select", "select-one"],
21
+ setup(__props, { emit: __emit }) {
22
+ const props = __props;
23
+ const emits = __emit;
24
+ const handlersKey = computed(() => {
25
+ var _a;
26
+ if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
27
+ return [];
28
+ return [{ label: "\u9009\u7528", key: "select" }];
29
+ });
30
+ function handleOption(params) {
31
+ const { key, item } = params;
32
+ if (key === "select") {
33
+ emits("select-one", item);
34
+ }
35
+ }
36
+ const { list, uploadFile } = useUpload();
37
+ const userInfo = inject("userInfo");
38
+ const baseAPI = inject("baseAPI");
39
+ const repoId = computed(() => {
40
+ var _a;
41
+ return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
42
+ });
43
+ function handleChange(file) {
44
+ if (!baseAPI || !repoId.value)
45
+ return;
46
+ uploadFile(baseAPI, file.file, 0, repoId.value);
47
+ }
48
+ return (_ctx, _cache) => {
49
+ var _a, _b;
50
+ return openBlock(), createElementBlock("div", _hoisted_1, [
51
+ createCommentVNode(" \u4E0A\u4F20\u7EC4\u4EF6 "),
52
+ createElementVNode("div", _hoisted_2, [
53
+ createVNode(_sfc_main$1, { onChange: handleChange })
54
+ ]),
55
+ createElementVNode("div", _hoisted_3, [
56
+ ((_a = unref(list)) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_4, " \u5DF2\u4E0A\u4F20 " + toDisplayString((_b = unref(list)) == null ? void 0 : _b.length) + " \u4E2A\u7D20\u6750 ", 1)) : createCommentVNode("v-if", true),
57
+ createCommentVNode(" \u4E0A\u4F20\u5217\u8868 "),
58
+ createElementVNode("div", _hoisted_5, [
59
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item) => {
60
+ return openBlock(), createBlock(_sfc_main$2, {
61
+ key: item.sig_id,
62
+ item,
63
+ "select-keys": _ctx.selectKeys,
64
+ disable: _ctx.disable,
65
+ onSelect: () => emits("select", item)
66
+ }, {
67
+ default: withCtx(() => [
68
+ createVNode(unref(thumbCard), {
69
+ url: item.url,
70
+ thumb: item.url,
71
+ catalog: item.catalog,
72
+ meta: item,
73
+ "use-mask": true,
74
+ "handlers-key": handlersKey.value,
75
+ onHandle: handleOption
76
+ }, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key"])
77
+ ]),
78
+ _: 2
79
+ }, 1032, ["item", "select-keys", "disable", "onSelect"]);
80
+ }), 128))
81
+ ])
82
+ ])
83
+ ]);
84
+ };
85
+ }
86
+ });
87
+ export { _sfc_main as default };
@@ -17,7 +17,8 @@ const _hoisted_7 = { class: "filter-extra" };
17
17
  const _sfc_main = defineComponent({
18
18
  __name: "index",
19
19
  props: {
20
- disableUploadBy: { type: Boolean }
20
+ disableUploadBy: { type: Boolean },
21
+ filterOptions: {}
21
22
  },
22
23
  emits: ["upload", "change"],
23
24
  setup(__props, { emit: __emit }) {
@@ -111,9 +112,14 @@ const _sfc_main = defineComponent({
111
112
  { deep: true }
112
113
  );
113
114
  onMounted(() => {
115
+ var _a;
114
116
  load();
117
+ if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
118
+ filter.value.catalog = props.filterOptions.mediaType;
119
+ }
115
120
  });
116
121
  return (_ctx, _cache) => {
122
+ var _a;
117
123
  return openBlock(), createElementBlock("div", _hoisted_1, [
118
124
  createElementVNode("div", _hoisted_2, [
119
125
  createCommentVNode(" \u5173\u952E\u8BCD "),
@@ -161,6 +167,7 @@ const _sfc_main = defineComponent({
161
167
  createVNode(unref(Select), {
162
168
  modelValue: filter.value.catalog,
163
169
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.catalog = $event),
170
+ disabled: (_a = _ctx.filterOptions) == null ? void 0 : _a.mediaTypeStrict,
164
171
  "allow-clear": "",
165
172
  placeholder: "\u7C7B\u578B"
166
173
  }, {
@@ -174,7 +181,7 @@ const _sfc_main = defineComponent({
174
181
  }), 128))
175
182
  ]),
176
183
  _: 1
177
- }, 8, ["modelValue"])
184
+ }, 8, ["modelValue", "disabled"])
178
185
  ]),
179
186
  createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
180
187
  createVNode(unref(RangePicker), {