@cmstops/pro-compo 0.3.34 → 0.3.36

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 (82) hide show
  1. package/dist/index.css +269 -59
  2. package/dist/index.min.css +1 -1
  3. package/es/docPreview/component.d.ts +0 -0
  4. package/es/docPreview/component.js +153 -0
  5. package/es/docPreview/components/PreviewIframe.d.ts +0 -0
  6. package/es/docPreview/components/PreviewIframe.js +37 -0
  7. package/es/docPreview/images/phone.js +2 -0
  8. package/es/docPreview/index.d.ts +2 -0
  9. package/es/docPreview/index.js +7 -0
  10. package/es/docPreview/scripts/api.d.ts +1 -0
  11. package/es/docPreview/scripts/hook.d.ts +20 -0
  12. package/es/docPreview/scripts/hook.js +119 -0
  13. package/es/docPreview/style/css.js +1 -0
  14. package/es/docPreview/style/index.css +139 -0
  15. package/es/docPreview/style/index.d.ts +1 -0
  16. package/es/docPreview/style/index.js +1 -0
  17. package/es/docPreview/style/index.less +129 -0
  18. package/es/docPreview/style/previewIframe.less +36 -0
  19. package/es/hooks/useSelection.js +1 -1
  20. package/es/hooks/useUpload.d.ts +15 -0
  21. package/es/hooks/useUpload.js +88 -0
  22. package/es/index.css +269 -59
  23. package/es/index.d.ts +1 -0
  24. package/es/index.js +1 -0
  25. package/es/index.less +1 -0
  26. package/es/selectResourceModal/component.js +30 -16
  27. package/es/selectResourceModal/components/ListCardWrapper/index.d.ts +0 -0
  28. package/es/selectResourceModal/components/ListCardWrapper/index.js +56 -0
  29. package/es/selectResourceModal/components/ListContent/index.js +16 -36
  30. package/es/selectResourceModal/components/ListContentLocal/components/Upload.d.ts +0 -0
  31. package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +56 -0
  32. package/es/selectResourceModal/components/ListContentLocal/index.d.ts +0 -0
  33. package/es/selectResourceModal/components/ListContentLocal/index.js +90 -0
  34. package/es/selectResourceModal/components/ListFilter/index.js +12 -4
  35. package/es/selectResourceModal/style/index.css +98 -58
  36. package/es/selectResourceModal/style/index.less +20 -2
  37. package/es/selectResourceModal/style/listCardWrapper.less +63 -0
  38. package/es/selectResourceModal/style/listContent.less +1 -63
  39. package/es/selectResourceModal/style/listContentLocal.less +26 -0
  40. package/es/selectResourceModal/style/listSelected.less +11 -3
  41. package/es/thumbCard/assets/magic.js +2 -0
  42. package/es/thumbCard/component.js +80 -53
  43. package/es/thumbCard/style/index.css +32 -1
  44. package/es/thumbCard/style/index.less +45 -7
  45. package/es/utils/index.d.ts +2 -0
  46. package/es/utils/index.js +40 -1
  47. package/es/utils/tusUpload.d.ts +8 -0
  48. package/es/utils/tusUpload.js +35 -1
  49. package/lib/docPreview/component.js +154 -0
  50. package/lib/docPreview/components/PreviewIframe.js +38 -0
  51. package/lib/docPreview/images/phone.js +3 -0
  52. package/lib/docPreview/index.js +8 -0
  53. package/lib/docPreview/scripts/hook.js +123 -0
  54. package/lib/docPreview/style/css.js +2 -0
  55. package/lib/docPreview/style/index.css +139 -0
  56. package/lib/docPreview/style/index.js +2 -0
  57. package/lib/docPreview/style/index.less +129 -0
  58. package/lib/docPreview/style/previewIframe.less +36 -0
  59. package/lib/hooks/useSelection.js +1 -1
  60. package/lib/hooks/useUpload.js +91 -0
  61. package/lib/index.css +269 -59
  62. package/lib/index.js +2 -0
  63. package/lib/index.less +1 -0
  64. package/lib/selectResourceModal/component.js +31 -17
  65. package/lib/selectResourceModal/components/ListCardWrapper/index.js +57 -0
  66. package/lib/selectResourceModal/components/ListContent/index.js +19 -39
  67. package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +57 -0
  68. package/lib/selectResourceModal/components/ListContentLocal/index.js +91 -0
  69. package/lib/selectResourceModal/components/ListFilter/index.js +12 -4
  70. package/lib/selectResourceModal/style/index.css +98 -58
  71. package/lib/selectResourceModal/style/index.less +20 -2
  72. package/lib/selectResourceModal/style/listCardWrapper.less +63 -0
  73. package/lib/selectResourceModal/style/listContent.less +1 -63
  74. package/lib/selectResourceModal/style/listContentLocal.less +26 -0
  75. package/lib/selectResourceModal/style/listSelected.less +11 -3
  76. package/lib/thumbCard/assets/magic.js +3 -0
  77. package/lib/thumbCard/component.js +78 -51
  78. package/lib/thumbCard/style/index.css +32 -1
  79. package/lib/thumbCard/style/index.less +45 -7
  80. package/lib/utils/index.js +41 -0
  81. package/lib/utils/tusUpload.js +35 -0
  82. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ .iframe-container {
2
+ position: relative;
3
+ height: 95vh;
4
+ max-height: 750px;
5
+ overflow: hidden;
6
+ aspect-ratio: 390 / 750;
7
+
8
+ &::-webkit-scrollbar {
9
+ display: none;
10
+ }
11
+
12
+ img {
13
+ position: absolute;
14
+ width: 100%;
15
+ height: 100%;
16
+ }
17
+
18
+ .iframe-content {
19
+ position: absolute;
20
+ top: calc(100% / 8);
21
+ left: 19px;
22
+ z-index: 1000;
23
+ width: calc(100% - 38px);
24
+ height: calc(100% - 100% / 8 - 16px);
25
+ overflow: hidden;
26
+ border-bottom-right-radius: 40px;
27
+ border-bottom-left-radius: 40px;
28
+
29
+ iframe {
30
+ width: calc(100% + 20px);
31
+ height: 100%;
32
+ border: none;
33
+ outline: none;
34
+ }
35
+ }
36
+ }
@@ -11,7 +11,7 @@ function getLabelValue(list, options) {
11
11
  function useSelection(params) {
12
12
  const { func, labelStr, valueStr } = params;
13
13
  const lVParams = { labelStr, valueStr };
14
- const limit = ref(10);
14
+ const limit = ref(30);
15
15
  const offset = ref(0);
16
16
  const keyword = ref("");
17
17
  const options = ref([]);
@@ -0,0 +1,15 @@
1
+ export declare type CallbackFunc = (data: any, status?: 'success' | 'fail') => void;
2
+ export declare type TypeAddMediaParam = {
3
+ url: string;
4
+ alias: string;
5
+ catalog: string;
6
+ repository_id: number;
7
+ directory_id: number;
8
+ size: number;
9
+ };
10
+ export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): import("axios").AxiosPromise<any>;
11
+ export default function useUpload(): {
12
+ list: import("vue").Ref<any[]>;
13
+ uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
14
+ recordTaskStatusChange: (file: any, progress: number) => void;
15
+ };
@@ -0,0 +1,88 @@
1
+ import { ref } from "vue";
2
+ import { generateUUID } from "../utils/index.js";
3
+ import { TusUploadTask } from "../utils/tusUpload.js";
4
+ import request from "../utils/request.js";
5
+ function addMedia(BASE_API, params) {
6
+ return request(BASE_API, {
7
+ url: "/poplar/v2/media/add",
8
+ method: "post",
9
+ data: params
10
+ });
11
+ }
12
+ function useUpload() {
13
+ const list = ref([]);
14
+ function uploadSuccess(file) {
15
+ const originList = list.value;
16
+ const taskIndex = originList.findIndex(
17
+ (task) => task.sig_id === file.sig_id
18
+ );
19
+ if (taskIndex !== -1) {
20
+ originList[taskIndex] = file;
21
+ list.value = originList;
22
+ }
23
+ }
24
+ function recordTaskStatusChange(file, progress) {
25
+ const originList = list.value;
26
+ const taskIndex = originList.findIndex((task) => task.id === file.id);
27
+ if (taskIndex !== -1) {
28
+ progress !== -1 && (originList[taskIndex].progress = progress);
29
+ file.status != null && (originList[taskIndex].status = file.status);
30
+ file.msg != null && (originList[taskIndex].msg = file.msg);
31
+ originList[taskIndex].url = file.url;
32
+ } else {
33
+ file.created_at = new Date().getTime();
34
+ originList.push({ ...file, progress, status: 1 });
35
+ }
36
+ list.value = originList;
37
+ }
38
+ const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
39
+ const newFile = {
40
+ id: generateUUID(),
41
+ sig_id: file.sig_id || generateUUID(),
42
+ name: file.name,
43
+ url: "",
44
+ size: file.size,
45
+ isUpload: true,
46
+ type: file.type
47
+ };
48
+ const upload = new TusUploadTask(file);
49
+ newFile.abort = () => upload.abort();
50
+ recordTaskStatusChange(newFile, 0);
51
+ const progress = (percent, total) => {
52
+ const progress2 = percent / total;
53
+ recordTaskStatusChange(newFile, progress2);
54
+ };
55
+ const uploading = upload.start(progress);
56
+ uploading.then(async (url) => {
57
+ const { code, message } = await addMedia(BASE_API, {
58
+ url,
59
+ size: newFile.size,
60
+ directory_id: dir,
61
+ repository_id: repoId,
62
+ catalog: newFile.type,
63
+ alias: newFile.name
64
+ });
65
+ if (code !== 0) {
66
+ console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
67
+ recordTaskStatusChange({ ...newFile, status: 2, msg: "\u6DFB\u52A0\u5230\u7D20\u6750\u5E93\u5931\u8D25" }, -1);
68
+ return;
69
+ }
70
+ console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u4E0A\u4F20\u6210\u529F\uFF1A", url);
71
+ recordTaskStatusChange({ ...newFile, url: message.url, status: 0 }, 1);
72
+ setTimeout(() => {
73
+ uploadSuccess({ ...message, sig_id: newFile.sig_id });
74
+ }, 200);
75
+ callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
76
+ }).catch((e) => {
77
+ console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
78
+ recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u4E2D\u65AD" }, -1);
79
+ callback && callback(newFile, "fail");
80
+ });
81
+ };
82
+ return {
83
+ list,
84
+ uploadFile,
85
+ recordTaskStatusChange
86
+ };
87
+ }
88
+ export { addMedia, useUpload as default };
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,7 +4302,26 @@
4290
4302
  .thumb-select-wrapper:hover .thumb-handler-list {
4291
4303
  opacity: 1;
4292
4304
  }
4293
- .arco-dropdown-option-content {
4305
+ .thumb-select-wrapper:hover .thumb-select-tag {
4306
+ opacity: 0;
4307
+ }
4308
+ .thumb-select-wrapper.thumb-no-mask {
4309
+ background-color: #f2f3f5;
4310
+ border: 1px dashed #e5e6eb !important;
4311
+ }
4312
+ .thumb-select-wrapper .thumb-select-tag {
4313
+ position: absolute;
4314
+ right: 5px;
4315
+ bottom: 5px;
4316
+ padding: 2px 10px;
4317
+ color: #fff;
4318
+ font-size: 12px;
4319
+ background-color: rgba(0, 0, 0, 0.5);
4320
+ border-radius: 16px;
4321
+ opacity: 1;
4322
+ transition: all 0.3s ease-in-out;
4323
+ }
4324
+ .thumb-select-wrapper .arco-dropdown-option-content {
4294
4325
  display: flex;
4295
4326
  gap: 8px;
4296
4327
  align-items: center;
@@ -4299,59 +4330,7 @@
4299
4330
  .card-list-wrapper {
4300
4331
  display: grid;
4301
4332
  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;
4333
+ grid-template-columns: repeat(5, 1fr);
4355
4334
  }
4356
4335
  .list-filter-wrapper {
4357
4336
  display: flex;
@@ -4369,7 +4348,6 @@
4369
4348
  }
4370
4349
  .list-panel-wrapper {
4371
4350
  width: 420px;
4372
- max-height: 600px;
4373
4351
  padding: 0 !important;
4374
4352
  overflow: hidden;
4375
4353
  border: none;
@@ -4383,7 +4361,12 @@
4383
4361
  display: none;
4384
4362
  }
4385
4363
  .list-panel-wrapper .arco-popover-content {
4364
+ display: flex;
4365
+ flex-direction: column;
4366
+ height: 100%;
4367
+ max-height: 600px;
4386
4368
  margin-top: 0;
4369
+ overflow: hidden;
4387
4370
  }
4388
4371
  .list-panel-wrapper .list-panel-header {
4389
4372
  display: flex;
@@ -4403,8 +4386,11 @@
4403
4386
  cursor: pointer;
4404
4387
  }
4405
4388
  .list-panel-wrapper .list-selected-record {
4406
- display: flex;
4407
- flex-direction: column;
4389
+ flex: 1;
4390
+ overflow-y: scroll;
4391
+ }
4392
+ .list-panel-wrapper .list-selected-record::-webkit-scrollbar {
4393
+ display: none;
4408
4394
  }
4409
4395
  .list-panel-wrapper .list-selected-record .list-selected-item {
4410
4396
  display: flex;
@@ -4424,6 +4410,85 @@
4424
4410
  white-space: nowrap;
4425
4411
  text-overflow: ellipsis;
4426
4412
  }
4413
+ .upload-list-wrapper .list-content {
4414
+ margin-top: 30px;
4415
+ }
4416
+ .upload-list-wrapper .list-content .list-tips {
4417
+ margin-bottom: 16px;
4418
+ color: #3d3d3d;
4419
+ }
4420
+ .upload-list-wrapper .upload-wrapper {
4421
+ display: flex;
4422
+ flex-direction: column;
4423
+ }
4424
+ .upload-list-wrapper .upload-wrapper .upload-buttons {
4425
+ display: flex;
4426
+ gap: 20px;
4427
+ justify-content: center;
4428
+ margin: 20px 0;
4429
+ }
4430
+ .upload-list-wrapper .upload-wrapper .upload-dragger {
4431
+ width: calc(100% - 2px);
4432
+ }
4433
+ .card-wrapper-image {
4434
+ position: relative;
4435
+ overflow: hidden;
4436
+ cursor: pointer;
4437
+ }
4438
+ .card-wrapper-image .card-wrapper {
4439
+ position: relative;
4440
+ overflow: hidden;
4441
+ aspect-ratio: 4 / 3;
4442
+ }
4443
+ .card-wrapper-image .card-alias {
4444
+ width: 100%;
4445
+ margin-top: 6px;
4446
+ overflow: hidden;
4447
+ color: #3d3d3d;
4448
+ font-size: 14px;
4449
+ line-height: 22px;
4450
+ white-space: nowrap;
4451
+ text-overflow: ellipsis;
4452
+ }
4453
+ .card-wrapper-image:hover .check-box-wrapper .check-box,
4454
+ .card-wrapper-image .check-box-wrapper .check-box.active {
4455
+ opacity: 1;
4456
+ }
4457
+ .card-wrapper-image .check-box-wrapper {
4458
+ position: absolute;
4459
+ top: 8px;
4460
+ left: 8px;
4461
+ cursor: pointer;
4462
+ }
4463
+ .card-wrapper-image .check-box-wrapper .check-box {
4464
+ box-sizing: border-box;
4465
+ width: 22px;
4466
+ height: 22px;
4467
+ font-size: 14px;
4468
+ line-height: 22px;
4469
+ text-align: center;
4470
+ background-color: rgba(0, 0, 0, 0.2);
4471
+ border: 1px solid white;
4472
+ border-radius: 50%;
4473
+ opacity: 0;
4474
+ transition: all 0.3s ease-in-out;
4475
+ }
4476
+ .card-wrapper-image .check-box-wrapper .check-box::selection {
4477
+ display: none;
4478
+ }
4479
+ .card-wrapper-image .check-box-wrapper .check-box:hover {
4480
+ background-color: rgba(0, 0, 0, 0.3);
4481
+ }
4482
+ .card-wrapper-image .check-box-wrapper .check-box.active {
4483
+ color: white;
4484
+ background-color: #165dff;
4485
+ border-color: #165dff;
4486
+ }
4487
+ .resource-select-drawer .arco-drawer-body {
4488
+ box-sizing: border-box;
4489
+ padding: 0;
4490
+ overflow: hidden;
4491
+ }
4427
4492
  .resource-select-container {
4428
4493
  display: flex;
4429
4494
  flex-direction: column;
@@ -4432,9 +4497,14 @@
4432
4497
  height: 100%;
4433
4498
  }
4434
4499
  .resource-select-container .resource-select-filter,
4435
- .resource-select-container .resource-select-content,
4436
4500
  .resource-select-container .resource-select-footer {
4437
- padding: 0 16px 0;
4501
+ padding: 0 40px;
4502
+ }
4503
+ .resource-select-container .resource-select-content .arco-scrollbar-container {
4504
+ padding: 0 40px;
4505
+ }
4506
+ .resource-select-container .resource-select-header {
4507
+ padding: 10px 24px 0 24px;
4438
4508
  }
4439
4509
  .resource-select-container .resource-select-header .arco-tabs-nav::before {
4440
4510
  display: none;
@@ -4449,9 +4519,149 @@
4449
4519
  .resource-select-container .resource-select-footer {
4450
4520
  display: flex;
4451
4521
  justify-content: space-between;
4522
+ padding-bottom: 10px;
4452
4523
  }
4453
4524
  .resource-select-container .resource-select-footer .footer-right {
4454
4525
  display: flex;
4455
4526
  gap: 10px;
4456
4527
  align-items: center;
4457
4528
  }
4529
+ .iframe-container {
4530
+ position: relative;
4531
+ height: 95vh;
4532
+ max-height: 750px;
4533
+ overflow: hidden;
4534
+ aspect-ratio: 390 / 750;
4535
+ }
4536
+ .iframe-container::-webkit-scrollbar {
4537
+ display: none;
4538
+ }
4539
+ .iframe-container img {
4540
+ position: absolute;
4541
+ width: 100%;
4542
+ height: 100%;
4543
+ }
4544
+ .iframe-container .iframe-content {
4545
+ position: absolute;
4546
+ top: calc(100% / 8);
4547
+ left: 19px;
4548
+ z-index: 1000;
4549
+ width: calc(100% - 38px);
4550
+ height: calc(100% - 100% / 8 - 16px);
4551
+ overflow: hidden;
4552
+ border-bottom-right-radius: 40px;
4553
+ border-bottom-left-radius: 40px;
4554
+ }
4555
+ .iframe-container .iframe-content iframe {
4556
+ width: calc(100% + 20px);
4557
+ height: 100%;
4558
+ border: none;
4559
+ outline: none;
4560
+ }
4561
+ .doc-preview-container {
4562
+ position: fixed;
4563
+ top: 0;
4564
+ left: 0;
4565
+ z-index: 10;
4566
+ display: flex;
4567
+ gap: 40px;
4568
+ align-items: center;
4569
+ justify-content: center;
4570
+ width: 100%;
4571
+ height: 100%;
4572
+ background-color: rgba(0, 0, 0, 0.5);
4573
+ user-select: none;
4574
+ }
4575
+ .doc-preview-container .loading-wrapper {
4576
+ display: flex;
4577
+ align-items: center;
4578
+ justify-content: center;
4579
+ width: 100%;
4580
+ height: 100%;
4581
+ }
4582
+ .doc-preview-container .doc-preview-share {
4583
+ display: flex;
4584
+ flex-direction: column;
4585
+ align-items: center;
4586
+ width: 300px;
4587
+ overflow: hidden;
4588
+ background-color: #fff;
4589
+ border-radius: 12px;
4590
+ }
4591
+ .doc-preview-container .doc-preview-share-img {
4592
+ width: 300px;
4593
+ height: 300px;
4594
+ }
4595
+ .doc-preview-container .doc-preview-share-img img {
4596
+ width: 100%;
4597
+ height: 100%;
4598
+ }
4599
+ .doc-preview-container .doc-preview-share-img-hint {
4600
+ display: flex;
4601
+ align-items: center;
4602
+ justify-content: center;
4603
+ width: calc(100% - 40px);
4604
+ height: calc(100% - 40px);
4605
+ margin-top: 20px;
4606
+ margin-left: 20px;
4607
+ color: #4886ff;
4608
+ background-color: #edf3ff;
4609
+ border-radius: 6px;
4610
+ }
4611
+ .doc-preview-container .doc-preview-share-tips,
4612
+ .doc-preview-container .doc-preview-share-header,
4613
+ .doc-preview-container .doc-preview-share-link,
4614
+ .doc-preview-container .doc-preview-share-action {
4615
+ box-sizing: border-box;
4616
+ width: 100%;
4617
+ padding: 0 20px;
4618
+ }
4619
+ .doc-preview-container .doc-preview-share-tips {
4620
+ color: #333;
4621
+ font-size: 14px;
4622
+ text-align: center;
4623
+ }
4624
+ .doc-preview-container .doc-preview-share-header {
4625
+ display: flex;
4626
+ align-items: center;
4627
+ justify-content: space-between;
4628
+ margin: 10px 0 5px;
4629
+ }
4630
+ .doc-preview-container .doc-preview-share-link {
4631
+ display: flex;
4632
+ flex-direction: column;
4633
+ width: 100%;
4634
+ }
4635
+ .doc-preview-container .doc-preview-share-link-value {
4636
+ display: -webkit-box;
4637
+ box-sizing: border-box;
4638
+ padding: 6px 10px;
4639
+ overflow: hidden;
4640
+ color: #86909c;
4641
+ line-height: 25px;
4642
+ word-break: break-all;
4643
+ background: #f2f2f2;
4644
+ -webkit-line-clamp: 2;
4645
+ -webkit-box-orient: vertical;
4646
+ }
4647
+ .doc-preview-container .doc-preview-share-link-hint {
4648
+ margin-top: 10px;
4649
+ color: #86909c;
4650
+ font-size: 12px;
4651
+ text-align: center;
4652
+ }
4653
+ .doc-preview-container .doc-preview-share-action {
4654
+ display: flex;
4655
+ gap: 10px;
4656
+ align-items: center;
4657
+ justify-content: center;
4658
+ margin: 20px 0;
4659
+ }
4660
+ .doc-preview-container .preview-close {
4661
+ position: absolute;
4662
+ top: 20px;
4663
+ right: 20px;
4664
+ color: #fff;
4665
+ font-size: 20px;
4666
+ cursor: pointer;
4667
+ }
package/es/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export { default as resourceGridList } from './resourceGridList';
24
24
  export { default as mediaView } from './mediaView';
25
25
  export { default as thumbCard } from './thumbCard';
26
26
  export { default as selectResourceModal } from './selectResourceModal';
27
+ export { default as docPreview } from './docPreview';
package/es/index.js CHANGED
@@ -24,3 +24,4 @@ export { default as resourceGridList } from "./resourceGridList/index.js";
24
24
  export { default as mediaView } from "./mediaView/index.js";
25
25
  export { default as thumbCard } from "./thumbCard/index.js";
26
26
  export { default as selectResourceModal } from "./selectResourceModal/index.js";
27
+ export { default as docPreview } from "./docPreview/index.js";
package/es/index.less CHANGED
@@ -24,3 +24,4 @@
24
24
  @import './mediaView/style/index.less';
25
25
  @import './thumbCard/style/index.less';
26
26
  @import './selectResourceModal/style/index.less';
27
+ @import './docPreview/style/index.less';
@@ -1,9 +1,11 @@
1
- import { defineComponent, ref, provide, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, createTextVNode } from "vue";
1
+ import { defineComponent, ref, provide, computed, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, withDirectives, vShow, createTextVNode } from "vue";
2
2
  import { Drawer, Tabs, Button, TabPane, Scrollbar, Pagination } from "@arco-design/web-vue";
3
+ import { IconClose } from "@arco-design/web-vue/es/icon";
3
4
  import emptyData from "../emptyData/index.js";
4
5
  import _sfc_main$1 from "./components/ListFilter/index.js";
5
6
  import _sfc_main$2 from "./components/ListContent/index.js";
6
- import _sfc_main$3 from "./components/ListSelected/index.js";
7
+ import _sfc_main$4 from "./components/ListSelected/index.js";
8
+ import _sfc_main$3 from "./components/ListContentLocal/index.js";
7
9
  import useAttachement from "../hooks/useAttachement.js";
8
10
  import { DEFAULT_BASE_API } from "../config.js";
9
11
  const _hoisted_1 = {
@@ -29,7 +31,8 @@ const _sfc_main = defineComponent({
29
31
  BASE_API: {},
30
32
  visible: { type: Boolean },
31
33
  userInfo: {},
32
- maxcount: {}
34
+ maxcount: {},
35
+ filterOptions: {}
33
36
  },
34
37
  emits: ["update:visible", "submit"],
35
38
  setup(__props, { emit: __emit }) {
@@ -47,8 +50,7 @@ const _sfc_main = defineComponent({
47
50
  changeKey,
48
51
  changeFilter,
49
52
  changePage,
50
- changeSize,
51
- loadData
53
+ changeSize
52
54
  } = useAttachement({ key: "all", BASE_API });
53
55
  const selected = ref([]);
54
56
  const selectedKeys = computed(() => selected.value.map((item) => item.id));
@@ -82,15 +84,13 @@ const _sfc_main = defineComponent({
82
84
  changeKey("local");
83
85
  activeKey.value = "local";
84
86
  }
85
- onMounted(() => {
86
- loadData();
87
- });
88
87
  return (_ctx, _cache) => {
89
88
  return openBlock(), createBlock(unref(Drawer), {
90
89
  visible: _ctx.visible,
91
90
  width: "1024px",
92
91
  header: false,
93
- footer: false
92
+ footer: false,
93
+ class: "resource-select-drawer"
94
94
  }, {
95
95
  default: withCtx(() => [
96
96
  _ctx.userInfo ? (openBlock(), createElementBlock("div", _hoisted_1, [
@@ -103,11 +103,12 @@ const _sfc_main = defineComponent({
103
103
  }, {
104
104
  extra: withCtx(() => [
105
105
  createVNode(unref(Button), {
106
- type: "text",
106
+ type: "secondary",
107
+ shape: "round",
107
108
  onClick: handleClose
108
109
  }, {
109
- default: withCtx(() => [
110
- createTextVNode("\u5173\u95ED")
110
+ icon: withCtx(() => [
111
+ createVNode(unref(IconClose))
111
112
  ]),
112
113
  _: 1
113
114
  })
@@ -137,9 +138,10 @@ const _sfc_main = defineComponent({
137
138
  activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_3, [
138
139
  createVNode(_sfc_main$1, {
139
140
  "disable-upload-by": activeKey.value !== "all",
141
+ filterOptions: _ctx.filterOptions,
140
142
  onChange: unref(changeFilter),
141
143
  onUpload: handleToUpload
142
- }, null, 8, ["disable-upload-by", "onChange"])
144
+ }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
143
145
  ])) : createCommentVNode("v-if", true),
144
146
  createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
145
147
  createElementVNode("div", _hoisted_4, [
@@ -148,14 +150,24 @@ const _sfc_main = defineComponent({
148
150
  style: { "height": "100%", "overflow": "auto" }
149
151
  }, {
150
152
  default: withCtx(() => [
151
- createVNode(_sfc_main$2, {
153
+ withDirectives(createVNode(_sfc_main$2, {
152
154
  loading: unref(loading),
153
155
  list: unref(list),
154
156
  disable: disableSelect.value,
155
157
  "select-keys": selectedKeys.value,
156
158
  onSelect: handleSelect,
157
159
  onSelectOne: handleSelectOne
158
- }, null, 8, ["loading", "list", "disable", "select-keys"])
160
+ }, null, 8, ["loading", "list", "disable", "select-keys"]), [
161
+ [vShow, activeKey.value !== "local"]
162
+ ]),
163
+ withDirectives(createVNode(_sfc_main$3, {
164
+ disable: disableSelect.value,
165
+ "select-keys": selectedKeys.value,
166
+ onSelect: handleSelect,
167
+ onSelectOne: handleSelectOne
168
+ }, null, 8, ["disable", "select-keys"]), [
169
+ [vShow, activeKey.value === "local"]
170
+ ])
159
171
  ]),
160
172
  _: 1
161
173
  })
@@ -169,12 +181,14 @@ const _sfc_main = defineComponent({
169
181
  "page-size": unref(limit),
170
182
  "show-total": "",
171
183
  "show-page-size": "",
184
+ "base-size": 3,
185
+ "buffer-size": 1,
172
186
  onChange: _cache[1] || (_cache[1] = (e) => unref(changePage)((e - 1) * unref(limit))),
173
187
  onPageSizeChange: unref(changeSize)
174
188
  }, null, 8, ["total", "page-size", "onPageSizeChange"])) : createCommentVNode("v-if", true)
175
189
  ]),
176
190
  selected.value.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
177
- createVNode(_sfc_main$3, {
191
+ createVNode(_sfc_main$4, {
178
192
  maxcount: _ctx.maxcount,
179
193
  selected: selected.value,
180
194
  onRemove: handleSelect,