Commit 18ad1bcc6e927f70dc16bf7e3c1627c1f7f376f3
1 parent
c22de5c3
fix: upload component not work #169
Showing
23 changed files
with
566 additions
and
577 deletions
src/assets/svg/preview/p-rotate.svg deleted
100644 → 0
1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1595306944988" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1820" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><defs><style type="text/css"></style></defs><path d="M1464.3 279.7" p-id="1821" fill="#ffffff"></path><path d="M512 960c-60.5 0-119.1-11.9-174.4-35.2-53.4-22.6-101.3-54.9-142.4-96s-73.4-89-96-142.4C75.9 631.1 64 572.5 64 512s11.9-119.1 35.2-174.4c22.6-53.4 54.9-101.3 96-142.4s89-73.4 142.4-96C392.9 75.9 451.5 64 512 64s119.1 11.9 174.4 35.2c53.4 22.6 101.3 54.9 142.4 96s73.4 89 96 142.4C948.1 392.9 960 451.5 960 512c0 19.1-15.5 34.6-34.6 34.6s-34.6-15.5-34.6-34.6c0-51.2-10-100.8-29.8-147.4-19.1-45.1-46.4-85.6-81.2-120.4C745 209.4 704.5 182 659.4 163c-46.7-19.7-96.3-29.8-147.4-29.8-51.2 0-100.8 10-147.4 29.8-45.1 19.1-85.6 46.4-120.4 81.2S182 319.5 163 364.6c-19.7 46.7-29.8 96.3-29.8 147.4 0 51.2 10 100.8 29.8 147.4 19.1 45.1 46.4 85.6 81.2 120.4C279 814.6 319.5 842 364.6 861c46.7 19.7 96.3 29.8 147.4 29.8 64.6 0 128.4-16.5 184.4-47.8 54.4-30.4 100.9-74.1 134.6-126.6 10.3-16.1 31.7-20.8 47.8-10.4 16.1 10.3 20.8 31.7 10.4 47.8-39.8 62-94.8 113.7-159.1 149.6-66.2 37-141.7 56.6-218.1 56.6z" p-id="1822" fill="#ffffff"></path><path d="M924 552c-19.8 0-36-16.2-36-36V228c0-19.8 16.2-36 36-36s36 16.2 36 36v288c0 19.8-16.2 36-36 36zM275.4 575.5c9.5-2.5 19.1 2.9 22.3 12.2 3.5 10.2 9.9 17.7 19.1 22.6 7.1 3.9 15.1 5.8 24 5.8 16.6 0 30.8-6.9 42.5-20.8 11.7-13.8 20-32.7 24.9-75.1-7.7 12.2-17.3 20.8-28.7 25.8-11.4 5-23.7 7.4-36.8 7.4-26.7 0-47.7-8.3-63.3-24.9-15.5-16.6-23.3-37.9-23.3-64.1 0-25.1 7.7-47.1 23-66.2 15.3-19 37.9-28.6 67.8-28.6 40.3 0 68.1 18.1 83.4 54.4 8.5 19.9 12.7 44.9 12.7 74.9 0 33.8-5.1 63.8-15.3 89.9-16.9 43.5-45.5 65.2-85.8 65.2-27 0-47.6-7.1-61.6-21.2-10-10.1-16.4-22-19.3-35.8-2-9.6 4-19.1 13.5-21.6l0.9 0.1z m103-74.4c9.4-7.5 14.1-20.6 14.1-39.3 0-16.8-4.2-29.3-12.7-37.5S360.6 412 347.5 412c-14 0-25.2 4.7-33.4 14.1-8.2 9.4-12.4 22-12.4 37.7 0 14.9 3.6 26.7 10.9 35.5 7.2 8.8 18.8 13.1 34.6 13.1 11.4 0 21.8-3.8 31.2-11.3zM646.6 414.4c12.4 22.8 18.5 54 18.5 93.7 0 37.6-5.6 68.7-16.8 93.3-16.2 35.3-42.8 52.9-79.6 52.9-33.2 0-57.9-14.4-74.2-43.3-13.5-24.1-20.3-56.4-20.3-97 0-31.4 4.1-58.4 12.2-80.9 15.2-42 42.7-63 82.5-63 35.9 0 61.8 14.8 77.7 44.3z m-40.2 173.3c9.4-13.9 14-39.9 14-78 0-27.4-3.4-50-10.1-67.7-6.8-17.7-19.9-26.6-39.4-26.6-17.9 0-31 8.4-39.3 25.2-8.3 16.8-12.4 41.6-12.4 74.3 0 24.6 2.6 44.4 7.9 59.4 8.1 22.8 22 34.3 41.6 34.3 15.7 0 28.3-7 37.7-20.9zM803.3 387.2c11.2 11.3 16.8 25 16.8 41.2 0 16.7-5.8 30.7-17.5 41.8C791 481.4 777.4 487 762 487c-17.1 0-31.2-5.8-42.1-17.4-10.9-11.6-16.4-25.1-16.4-40.6 0-16.5 5.8-30.4 17.3-41.7 11.5-11.3 25.3-17 41.2-17 16.3 0 30.1 5.7 41.3 16.9zM739.5 451c6.2 6.2 13.7 9.3 22.5 9.3 8.4 0 15.8-3.1 22.1-9.3 6.3-6.2 9.4-13.7 9.4-22.6 0-8.5-3.1-15.9-9.3-22.1-6.2-6.2-13.6-9.3-22.2-9.3s-16.1 3.1-22.4 9.3c-6.3 6.2-9.4 13.7-9.4 22.6-0.1 8.4 3 15.8 9.3 22.1z" p-id="1823" fill="#ffffff"></path></svg> | |
2 | 0 | \ No newline at end of file |
src/assets/svg/preview/resume.svg deleted
100644 → 0
1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1595307154239" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7317" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><defs><style type="text/css"></style></defs><path d="M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zM512 622c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zM512 482c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z" p-id="7318" fill="#ffffff"></path><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z" p-id="7319" fill="#ffffff"></path><path d="M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z" p-id="7320" fill="#ffffff"></path></svg> | |
2 | 0 | \ No newline at end of file |
src/assets/svg/preview/scale.svg deleted
100644 → 0
1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1595307195033" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8116" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><defs><style type="text/css"></style></defs><path d="M887.081 904.791a25.8 25.8 0 0 1-18.376-7.619L705.618 734.075l-4.163 3.369c-58.255 47.18-131.522 73.16-206.32 73.16-181.07 0-328.377-147.308-328.377-328.367 0-181.068 147.308-328.376 328.377-328.376 181.063 0 328.376 147.308 328.376 328.376 0 77.072-27.412 152.07-77.169 211.17l-3.522 4.173 162.719 162.744a25.846 25.846 0 0 1 7.639 18.432 26.081 26.081 0 0 1-26.051 26.045l-0.046-0.01zM495.13 205.957c-152.336 0-276.27 123.935-276.27 276.27 0 152.33 123.934 276.27 276.27 276.27 152.34 0 276.275-123.94 276.275-276.27 0-152.335-123.935-276.27-276.275-276.27z" fill="#ffffff" p-id="8117"></path><path d="M626.545 508.355h-262.83a26.127 26.127 0 0 1 0-52.255h262.83a26.127 26.127 0 0 1 0 52.255z" fill="#ffffff" p-id="8118"></path><path d="M495.13 639.77a26.127 26.127 0 0 1-26.128-26.128v-262.83a26.127 26.127 0 0 1 52.255 0v262.835a26.127 26.127 0 0 1-26.127 26.123z" fill="#ffffff" p-id="8119"></path></svg> | |
2 | 0 | \ No newline at end of file |
src/assets/svg/preview/unrotate.svg deleted
100644 → 0
1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1595306911635" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1352" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M924.8 337.6c-22.6-53.4-54.9-101.3-96-142.4s-89-73.4-142.4-96C631.1 75.9 572.5 64 512 64S392.9 75.9 337.6 99.2c-53.4 22.6-101.3 54.9-142.4 96-22.4 22.4-42.2 46.8-59.2 73.1V228c0-19.8-16.2-36-36-36s-36 16.2-36 36v288c0 19.8 16.2 36 36 36s36-16.2 36-36v-50.2c4.2-34.8 13.2-68.7 27-101.2 19.1-45.1 46.4-85.6 81.2-120.4C279 209.4 319.5 182 364.6 163c46.7-19.7 96.3-29.8 147.4-29.8 51.2 0 100.8 10 147.4 29.8 45.1 19.1 85.6 46.4 120.4 81.2C814.6 279 842 319.5 861 364.6c19.7 46.7 29.8 96.3 29.8 147.4 0 51.2-10 100.8-29.8 147.4-19.1 45.1-46.4 85.6-81.2 120.4C745 814.6 704.5 842 659.4 861c-46.7 19.7-96.3 29.8-147.4 29.8-64.6 0-128.4-16.5-184.4-47.8-54.4-30.4-100.9-74.1-134.6-126.6-10.3-16.1-31.7-20.8-47.8-10.4-16.1 10.3-20.8 31.7-10.4 47.8 39.8 62 94.8 113.7 159.1 149.6 66.2 37 141.7 56.6 218.1 56.6 60.5 0 119.1-11.9 174.4-35.2 53.4-22.6 101.3-54.9 142.4-96 41.1-41.1 73.4-89 96-142.4C948.1 631.1 960 572.5 960 512s-11.9-119.1-35.2-174.4z" p-id="1353" fill="#ffffff"></path><path d="M275.4 575.5c9.5-2.5 19.1 2.9 22.3 12.2 3.5 10.2 9.9 17.7 19.1 22.6 7.1 3.9 15.1 5.8 24 5.8 16.6 0 30.8-6.9 42.5-20.8 11.7-13.8 20-32.7 24.9-75.1-7.7 12.2-17.3 20.8-28.7 25.8-11.4 5-23.7 7.4-36.8 7.4-26.7 0-47.7-8.3-63.3-24.9-15.5-16.6-23.3-37.9-23.3-64.1 0-25.1 7.7-47.1 23-66.2 15.3-19 37.9-28.6 67.8-28.6 40.3 0 68.1 18.1 83.4 54.4 8.5 19.9 12.7 44.9 12.7 74.9 0 33.8-5.1 63.8-15.3 89.9-16.9 43.5-45.5 65.2-85.8 65.2-27 0-47.6-7.1-61.6-21.2-10-10.1-16.4-22-19.3-35.8-2-9.6 4-19.1 13.5-21.6l0.9 0.1z m103-74.4c9.4-7.5 14.1-20.6 14.1-39.3 0-16.8-4.2-29.3-12.7-37.5S360.6 412 347.5 412c-14 0-25.2 4.7-33.4 14.1-8.2 9.4-12.4 22-12.4 37.7 0 14.9 3.6 26.7 10.9 35.5 7.2 8.8 18.8 13.1 34.6 13.1 11.4 0 21.8-3.8 31.2-11.3zM646.6 414.4c12.4 22.8 18.5 54 18.5 93.7 0 37.6-5.6 68.7-16.8 93.3-16.2 35.3-42.8 52.9-79.6 52.9-33.2 0-57.9-14.4-74.2-43.3-13.5-24.1-20.3-56.4-20.3-97 0-31.4 4.1-58.4 12.2-80.9 15.2-42 42.7-63 82.5-63 35.9 0 61.8 14.8 77.7 44.3z m-40.2 173.3c9.4-13.9 14-39.9 14-78 0-27.4-3.4-50-10.1-67.7-6.8-17.7-19.9-26.6-39.4-26.6-17.9 0-31 8.4-39.3 25.2-8.3 16.8-12.4 41.6-12.4 74.3 0 24.6 2.6 44.4 7.9 59.4 8.1 22.8 22 34.3 41.6 34.3 15.7 0 28.3-7 37.7-20.9zM803.3 387.2c11.2 11.3 16.8 25 16.8 41.2 0 16.7-5.8 30.7-17.5 41.8C791 481.4 777.4 487 762 487c-17.1 0-31.2-5.8-42.1-17.4-10.9-11.6-16.4-25.1-16.4-40.6 0-16.5 5.8-30.4 17.3-41.7 11.5-11.3 25.3-17 41.2-17 16.3 0 30.1 5.7 41.3 16.9zM739.5 451c6.2 6.2 13.7 9.3 22.5 9.3 8.4 0 15.8-3.1 22.1-9.3 6.3-6.2 9.4-13.7 9.4-22.6 0-8.5-3.1-15.9-9.3-22.1-6.2-6.2-13.6-9.3-22.2-9.3s-16.1 3.1-22.4 9.3c-6.3 6.2-9.4 13.7-9.4 22.6-0.1 8.4 3 15.8 9.3 22.1z" p-id="1354" fill="#ffffff"></path></svg> | |
2 | 0 | \ No newline at end of file |
src/assets/svg/preview/unscale.svg deleted
100644 → 0
1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1595308005241" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9878" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><defs><style type="text/css"></style></defs><path d="M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H271v-50h400v50z" fill="#ffffff" p-id="9879"></path></svg> | |
2 | 0 | \ No newline at end of file |
src/components/Modal/src/BasicModal.vue
... | ... | @@ -14,7 +14,11 @@ |
14 | 14 | </template> |
15 | 15 | |
16 | 16 | <template #footer v-if="!$slots.footer"> |
17 | - <ModalFooter v-bind="getProps" @ok="handleOk" @cancel="handleCancel" /> | |
17 | + <ModalFooter v-bind="getProps" @ok="handleOk" @cancel="handleCancel"> | |
18 | + <template #[item]="data" v-for="item in Object.keys($slots)"> | |
19 | + <slot :name="item" v-bind="data" /> | |
20 | + </template> | |
21 | + </ModalFooter> | |
18 | 22 | </template> |
19 | 23 | |
20 | 24 | <ModalWrapper | ... | ... |
src/components/Modal/src/components/ModalWrapper.vue
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | return { |
68 | 68 | minHeight: `${props.minHeight}px`, |
69 | 69 | // padding 28 |
70 | - height: `${unref(realHeightRef) - 28}px`, | |
70 | + height: `${unref(realHeightRef)}px`, | |
71 | 71 | }; |
72 | 72 | } |
73 | 73 | ); |
... | ... | @@ -130,10 +130,11 @@ |
130 | 130 | const spinEl = unref(spinRef); |
131 | 131 | |
132 | 132 | if (!spinEl) return; |
133 | + await nextTick(); | |
134 | + // if (!realHeight) { | |
135 | + realHeight = spinEl.scrollHeight; | |
136 | + // } | |
133 | 137 | |
134 | - if (!realHeight) { | |
135 | - realHeight = spinEl.scrollHeight; | |
136 | - } | |
137 | 138 | if (props.fullScreen) { |
138 | 139 | realHeightRef.value = |
139 | 140 | window.innerHeight - props.modalFooterHeight - props.modalHeaderHeight; |
... | ... | @@ -142,7 +143,7 @@ |
142 | 143 | ? props.height |
143 | 144 | : realHeight > maxHeight |
144 | 145 | ? maxHeight |
145 | - : realHeight + 46; | |
146 | + : realHeight; | |
146 | 147 | } |
147 | 148 | emit('height-change', unref(realHeightRef)); |
148 | 149 | } catch (error) { | ... | ... |
src/components/Preview/index.ts
src/components/Preview/src/functional.ts deleted
100644 → 0
1 | -import ImgPreview from './index'; | |
2 | -import { isClient } from '/@/utils/is'; | |
3 | - | |
4 | -import type { Options, Props } from './types'; | |
5 | - | |
6 | -import { createVNode, render } from 'vue'; | |
7 | - | |
8 | -let instance: any = null; | |
9 | -export function createImgPreview(options: Options) { | |
10 | - if (!isClient) return; | |
11 | - const { imageList, show = true, index = 0 } = options; | |
12 | - | |
13 | - const propsData: Partial<Props> = {}; | |
14 | - const container = document.createElement('div'); | |
15 | - propsData.imageList = imageList; | |
16 | - propsData.show = show; | |
17 | - propsData.index = index; | |
18 | - | |
19 | - instance = createVNode(ImgPreview, propsData); | |
20 | - render(instance, container); | |
21 | - document.body.appendChild(container); | |
22 | -} |
src/components/Preview/src/index.less deleted
100644 → 0
1 | -.img-preview { | |
2 | - position: fixed; | |
3 | - top: 0; | |
4 | - right: 0; | |
5 | - bottom: 0; | |
6 | - left: 0; | |
7 | - z-index: @preview-comp-z-index; | |
8 | - background: rgba(0, 0, 0, 0.5); | |
9 | - user-select: none; | |
10 | - | |
11 | - &-content { | |
12 | - display: flex; | |
13 | - width: 100%; | |
14 | - height: 100%; | |
15 | - color: @white; | |
16 | - justify-content: center; | |
17 | - align-items: center; | |
18 | - } | |
19 | - | |
20 | - &-image { | |
21 | - cursor: pointer; | |
22 | - transition: transform 0.3s; | |
23 | - } | |
24 | - | |
25 | - &__close { | |
26 | - position: absolute; | |
27 | - top: -40px; | |
28 | - right: -40px; | |
29 | - width: 80px; | |
30 | - height: 80px; | |
31 | - overflow: hidden; | |
32 | - color: @white; | |
33 | - cursor: pointer; | |
34 | - background-color: rgba(0, 0, 0, 0.5); | |
35 | - border-radius: 50%; | |
36 | - transition: all 0.2s; | |
37 | - | |
38 | - &-icon { | |
39 | - position: absolute; | |
40 | - top: 46px; | |
41 | - left: 16px; | |
42 | - font-size: 16px; | |
43 | - } | |
44 | - | |
45 | - &:hover { | |
46 | - background-color: rgba(0, 0, 0, 0.8); | |
47 | - } | |
48 | - } | |
49 | - | |
50 | - &__index { | |
51 | - position: absolute; | |
52 | - bottom: 5%; | |
53 | - left: 50%; | |
54 | - padding: 0 22px; | |
55 | - font-size: 16px; | |
56 | - background: rgba(109, 109, 109, 0.6); | |
57 | - border-radius: 15px; | |
58 | - transform: translateX(-50%); | |
59 | - } | |
60 | - | |
61 | - &__controller { | |
62 | - position: absolute; | |
63 | - bottom: 10%; | |
64 | - left: 50%; | |
65 | - display: flex; | |
66 | - width: 260px; | |
67 | - height: 44px; | |
68 | - padding: 0 22px; | |
69 | - margin-left: -139px; | |
70 | - background: rgba(109, 109, 109, 0.6); | |
71 | - border-radius: 22px; | |
72 | - justify-content: center; | |
73 | - | |
74 | - &-item { | |
75 | - display: flex; | |
76 | - height: 100%; | |
77 | - padding: 0 9px; | |
78 | - font-size: 24px; | |
79 | - cursor: pointer; | |
80 | - transition: all 0.2s; | |
81 | - | |
82 | - &:hover { | |
83 | - transform: scale(1.2); | |
84 | - } | |
85 | - | |
86 | - img { | |
87 | - width: 1em; | |
88 | - } | |
89 | - } | |
90 | - } | |
91 | - | |
92 | - &__arrow { | |
93 | - position: absolute; | |
94 | - top: 50%; | |
95 | - display: flex; | |
96 | - align-items: center; | |
97 | - justify-content: center; | |
98 | - width: 50px; | |
99 | - height: 50px; | |
100 | - font-size: 28px; | |
101 | - cursor: pointer; | |
102 | - background-color: rgba(0, 0, 0, 0.5); | |
103 | - border-radius: 50%; | |
104 | - transition: all 0.2s; | |
105 | - | |
106 | - &:hover { | |
107 | - background-color: rgba(0, 0, 0, 0.8); | |
108 | - } | |
109 | - | |
110 | - &.left { | |
111 | - left: 50px; | |
112 | - } | |
113 | - | |
114 | - &.right { | |
115 | - right: 50px; | |
116 | - } | |
117 | - } | |
118 | -} |
src/components/Preview/src/index.tsx deleted
100644 → 0
1 | -import './index.less'; | |
2 | - | |
3 | -import { defineComponent, ref, unref, computed, reactive, watchEffect } from 'vue'; | |
4 | - | |
5 | -import { basicProps } from './props'; | |
6 | -import { Props } from './types'; | |
7 | - | |
8 | -import { CloseOutlined, LeftOutlined, RightOutlined, LoadingOutlined } from '@ant-design/icons-vue'; | |
9 | -import { Spin } from 'ant-design-vue'; | |
10 | - | |
11 | -import resumeSvg from '/@/assets/svg/preview/resume.svg'; | |
12 | -import rotateSvg from '/@/assets/svg/preview/p-rotate.svg'; | |
13 | -import scaleSvg from '/@/assets/svg/preview/scale.svg'; | |
14 | -import unScaleSvg from '/@/assets/svg/preview/unscale.svg'; | |
15 | -import unRotateSvg from '/@/assets/svg/preview/unrotate.svg'; | |
16 | -enum StatueEnum { | |
17 | - LOADING, | |
18 | - DONE, | |
19 | - FAIL, | |
20 | -} | |
21 | -interface ImgState { | |
22 | - currentUrl: string; | |
23 | - imgScale: number; | |
24 | - imgRotate: number; | |
25 | - imgTop: number; | |
26 | - imgLeft: number; | |
27 | - currentIndex: number; | |
28 | - status: StatueEnum; | |
29 | - moveX: number; | |
30 | - moveY: number; | |
31 | - show: boolean; | |
32 | -} | |
33 | - | |
34 | -const prefixCls = 'img-preview'; | |
35 | -export default defineComponent({ | |
36 | - name: 'ImagePreview', | |
37 | - props: basicProps, | |
38 | - setup(props: Props) { | |
39 | - const imgState = reactive<ImgState>({ | |
40 | - currentUrl: '', | |
41 | - imgScale: 1, | |
42 | - imgRotate: 0, | |
43 | - imgTop: 0, | |
44 | - imgLeft: 0, | |
45 | - status: StatueEnum.LOADING, | |
46 | - currentIndex: 0, | |
47 | - moveX: 0, | |
48 | - moveY: 0, | |
49 | - show: props.show, | |
50 | - }); | |
51 | - | |
52 | - const wrapElRef = ref<HTMLDivElement | null>(null); | |
53 | - const imgElRef = ref<HTMLImageElement | null>(null); | |
54 | - | |
55 | - // 初始化 | |
56 | - function init() { | |
57 | - initMouseWheel(); | |
58 | - const { index, imageList } = props; | |
59 | - | |
60 | - if (!imageList || !imageList.length) { | |
61 | - throw new Error('imageList is undefined'); | |
62 | - } | |
63 | - imgState.currentIndex = index; | |
64 | - handleIChangeImage(imageList[index]); | |
65 | - } | |
66 | - | |
67 | - // 重置 | |
68 | - function initState() { | |
69 | - imgState.imgScale = 1; | |
70 | - imgState.imgRotate = 0; | |
71 | - imgState.imgTop = 0; | |
72 | - imgState.imgLeft = 0; | |
73 | - } | |
74 | - | |
75 | - // 初始化鼠标滚轮事件 | |
76 | - function initMouseWheel() { | |
77 | - const wrapEl = unref(wrapElRef); | |
78 | - if (!wrapEl) { | |
79 | - return; | |
80 | - } | |
81 | - (wrapEl as any).onmousewheel = scrollFunc; | |
82 | - // 火狐浏览器没有onmousewheel事件,用DOMMouseScroll代替 | |
83 | - document.body.addEventListener('DOMMouseScroll', scrollFunc); | |
84 | - // 禁止火狐浏览器下拖拽图片的默认事件 | |
85 | - document.ondragstart = function () { | |
86 | - return false; | |
87 | - }; | |
88 | - } | |
89 | - | |
90 | - // 监听鼠标滚轮 | |
91 | - function scrollFunc(e: any) { | |
92 | - e = e || window.event; | |
93 | - e.delta = e.wheelDelta || -e.detail; | |
94 | - | |
95 | - e.preventDefault(); | |
96 | - if (e.delta > 0) { | |
97 | - // 滑轮向上滚动 | |
98 | - scaleFunc(0.015); | |
99 | - } | |
100 | - if (e.delta < 0) { | |
101 | - // 滑轮向下滚动 | |
102 | - scaleFunc(-0.015); | |
103 | - } | |
104 | - } | |
105 | - // 缩放函数 | |
106 | - function scaleFunc(num: number) { | |
107 | - if (imgState.imgScale <= 0.2 && num < 0) return; | |
108 | - imgState.imgScale += num; | |
109 | - } | |
110 | - | |
111 | - // 旋转图片 | |
112 | - function rotateFunc(deg: number) { | |
113 | - imgState.imgRotate += deg; | |
114 | - } | |
115 | - | |
116 | - // 鼠标事件 | |
117 | - function handleMouseUp() { | |
118 | - const imgEl = unref(imgElRef); | |
119 | - if (!imgEl) return; | |
120 | - imgEl.onmousemove = null; | |
121 | - } | |
122 | - | |
123 | - // 更换图片 | |
124 | - function handleIChangeImage(url: string) { | |
125 | - imgState.status = StatueEnum.LOADING; | |
126 | - const img = new Image(); | |
127 | - img.src = url; | |
128 | - img.onload = () => { | |
129 | - imgState.currentUrl = url; | |
130 | - imgState.status = StatueEnum.DONE; | |
131 | - }; | |
132 | - img.onerror = () => { | |
133 | - imgState.status = StatueEnum.FAIL; | |
134 | - }; | |
135 | - } | |
136 | - | |
137 | - // 关闭 | |
138 | - function handleClose(e: MouseEvent) { | |
139 | - e && e.stopPropagation(); | |
140 | - imgState.show = false; | |
141 | - // 移除火狐浏览器下的鼠标滚动事件 | |
142 | - document.body.removeEventListener('DOMMouseScroll', scrollFunc); | |
143 | - // 恢复火狐及Safari浏览器下的图片拖拽 | |
144 | - document.ondragstart = null; | |
145 | - } | |
146 | - | |
147 | - // 图片复原 | |
148 | - function resume() { | |
149 | - initState(); | |
150 | - } | |
151 | - | |
152 | - // 上一页下一页 | |
153 | - function handleChange(direction: 'left' | 'right') { | |
154 | - const { currentIndex } = imgState; | |
155 | - const { imageList } = props; | |
156 | - if (direction === 'left') { | |
157 | - imgState.currentIndex--; | |
158 | - if (currentIndex <= 0) { | |
159 | - imgState.currentIndex = imageList.length - 1; | |
160 | - } | |
161 | - } | |
162 | - if (direction === 'right') { | |
163 | - imgState.currentIndex++; | |
164 | - if (currentIndex >= imageList.length - 1) { | |
165 | - imgState.currentIndex = 0; | |
166 | - } | |
167 | - } | |
168 | - handleIChangeImage(imageList[imgState.currentIndex]); | |
169 | - } | |
170 | - | |
171 | - function handleAddMoveListener(e: MouseEvent) { | |
172 | - e = e || window.event; | |
173 | - imgState.moveX = e.clientX; | |
174 | - imgState.moveY = e.clientY; | |
175 | - const imgEl = unref(imgElRef); | |
176 | - if (imgEl) { | |
177 | - imgEl.onmousemove = moveFunc; | |
178 | - } | |
179 | - } | |
180 | - | |
181 | - function moveFunc(e: MouseEvent) { | |
182 | - e = e || window.event; | |
183 | - e.preventDefault(); | |
184 | - const movementX = e.clientX - imgState.moveX; | |
185 | - const movementY = e.clientY - imgState.moveY; | |
186 | - imgState.imgLeft += movementX; | |
187 | - imgState.imgTop += movementY; | |
188 | - imgState.moveX = e.clientX; | |
189 | - imgState.moveY = e.clientY; | |
190 | - } | |
191 | - | |
192 | - // 获取图片样式 | |
193 | - const getImageStyle = computed(() => { | |
194 | - const { imgScale, imgRotate, imgTop, imgLeft } = imgState; | |
195 | - return { | |
196 | - transform: `scale(${imgScale}) rotate(${imgRotate}deg)`, | |
197 | - marginTop: `${imgTop}px`, | |
198 | - marginLeft: `${imgLeft}px`, | |
199 | - }; | |
200 | - }); | |
201 | - | |
202 | - const getIsMultipleImage = computed(() => { | |
203 | - const { imageList } = props; | |
204 | - return imageList.length > 1; | |
205 | - }); | |
206 | - | |
207 | - watchEffect(() => { | |
208 | - if (props.show) { | |
209 | - init(); | |
210 | - } | |
211 | - if (props.imageList) { | |
212 | - initState(); | |
213 | - } | |
214 | - }); | |
215 | - | |
216 | - const renderClose = () => { | |
217 | - return ( | |
218 | - <div class={`${prefixCls}__close`} onClick={handleClose}> | |
219 | - <CloseOutlined class={`${prefixCls}__close-icon`} /> | |
220 | - </div> | |
221 | - ); | |
222 | - }; | |
223 | - | |
224 | - const renderIndex = () => { | |
225 | - if (!unref(getIsMultipleImage)) { | |
226 | - return null; | |
227 | - } | |
228 | - const { currentIndex } = imgState; | |
229 | - const { imageList } = props; | |
230 | - return ( | |
231 | - <div class={`${prefixCls}__index`}> | |
232 | - {currentIndex + 1} / {imageList.length} | |
233 | - </div> | |
234 | - ); | |
235 | - }; | |
236 | - | |
237 | - const renderController = () => { | |
238 | - return ( | |
239 | - <div class={`${prefixCls}__controller`}> | |
240 | - <div class={`${prefixCls}__controller-item`} onClick={() => scaleFunc(-0.15)}> | |
241 | - <img src={unScaleSvg} /> | |
242 | - </div> | |
243 | - <div class={`${prefixCls}__controller-item`} onClick={() => scaleFunc(0.15)}> | |
244 | - <img src={scaleSvg} /> | |
245 | - </div> | |
246 | - <div class={`${prefixCls}__controller-item`} onClick={resume}> | |
247 | - <img src={resumeSvg} /> | |
248 | - </div> | |
249 | - <div class={`${prefixCls}__controller-item`} onClick={() => rotateFunc(-90)}> | |
250 | - <img src={unRotateSvg} /> | |
251 | - </div> | |
252 | - <div class={`${prefixCls}__controller-item`} onClick={() => rotateFunc(90)}> | |
253 | - <img src={rotateSvg} /> | |
254 | - </div> | |
255 | - </div> | |
256 | - ); | |
257 | - }; | |
258 | - | |
259 | - const renderArrow = (direction: 'left' | 'right') => { | |
260 | - if (!unref(getIsMultipleImage)) { | |
261 | - return null; | |
262 | - } | |
263 | - return ( | |
264 | - <div class={[`${prefixCls}__arrow`, direction]} onClick={() => handleChange(direction)}> | |
265 | - {direction === 'left' ? <LeftOutlined /> : <RightOutlined />} | |
266 | - </div> | |
267 | - ); | |
268 | - }; | |
269 | - | |
270 | - return () => { | |
271 | - return ( | |
272 | - imgState.show && ( | |
273 | - <div class={prefixCls} ref={wrapElRef} onMouseup={handleMouseUp}> | |
274 | - <div class={`${prefixCls}-content`}> | |
275 | - <Spin | |
276 | - indicator={<LoadingOutlined style="font-size: 24px" spin />} | |
277 | - spinning={true} | |
278 | - class={[ | |
279 | - `${prefixCls}-image`, | |
280 | - { | |
281 | - hidden: imgState.status !== StatueEnum.LOADING, | |
282 | - }, | |
283 | - ]} | |
284 | - /> | |
285 | - <img | |
286 | - style={unref(getImageStyle)} | |
287 | - class={[`${prefixCls}-image`, imgState.status === StatueEnum.DONE ? '' : 'hidden']} | |
288 | - ref={imgElRef} | |
289 | - src={imgState.currentUrl} | |
290 | - onMousedown={handleAddMoveListener} | |
291 | - /> | |
292 | - {renderClose()} | |
293 | - {renderIndex()} | |
294 | - {renderController()} | |
295 | - {renderArrow('left')} | |
296 | - {renderArrow('right')} | |
297 | - </div> | |
298 | - </div> | |
299 | - ) | |
300 | - ); | |
301 | - }; | |
302 | - }, | |
303 | -}); |
src/components/Preview/src/index.vue
1 | 1 | <template> |
2 | - <PreviewGroup :class="prefixCls"> | |
3 | - <slot v-if="!imageList || $slots.default" /> | |
4 | - <template v-else> | |
5 | - <template v-for="item in getImageList" :key="item.src"> | |
6 | - <Image v-bind="item"> | |
7 | - <template #placeholder v-if="item.placeholder"> | |
8 | - <Image v-bind="item" :src="item.placeholder" :preview="false" /> | |
9 | - </template> | |
10 | - </Image> | |
2 | + <div :class="prefixCls"> | |
3 | + <PreviewGroup> | |
4 | + <slot v-if="!imageList || $slots.default" /> | |
5 | + <template v-else> | |
6 | + <template v-for="item in getImageList" :key="item.src"> | |
7 | + <Image v-bind="item"> | |
8 | + <template #placeholder v-if="item.placeholder"> | |
9 | + <Image v-bind="item" :src="item.placeholder" :preview="false" /> | |
10 | + </template> | |
11 | + </Image> | |
12 | + </template> | |
11 | 13 | </template> |
12 | - </template> | |
13 | - </PreviewGroup> | |
14 | + </PreviewGroup> | |
15 | + </div> | |
14 | 16 | </template> |
15 | 17 | <script lang="ts"> |
16 | 18 | import type { PropType } from 'vue'; |
... | ... | @@ -53,7 +55,10 @@ |
53 | 55 | }); |
54 | 56 | }); |
55 | 57 | |
56 | - return { prefixCls, getImageList }; | |
58 | + return { | |
59 | + prefixCls, | |
60 | + getImageList, | |
61 | + }; | |
57 | 62 | }, |
58 | 63 | }); |
59 | 64 | </script> |
... | ... | @@ -61,6 +66,10 @@ |
61 | 66 | @prefix-cls: ~'@{namespace}-image-preview'; |
62 | 67 | |
63 | 68 | .@{prefix-cls} { |
69 | + .ant-image { | |
70 | + margin-right: 10px; | |
71 | + } | |
72 | + | |
64 | 73 | .ant-image-preview-operations { |
65 | 74 | background: rgba(0, 0, 0, 0.4); |
66 | 75 | } | ... | ... |
src/components/Preview/src/props.ts deleted
100644 → 0
1 | -import { PropType } from 'vue'; | |
2 | -export const basicProps = { | |
3 | - show: { | |
4 | - type: Boolean as PropType<boolean>, | |
5 | - default: false, | |
6 | - }, | |
7 | - imageList: { | |
8 | - type: [Array] as PropType<string[]>, | |
9 | - default: null, | |
10 | - }, | |
11 | - index: { | |
12 | - type: Number as PropType<number>, | |
13 | - default: 0, | |
14 | - }, | |
15 | -}; |
src/components/Preview/src/types.ts deleted
100644 → 0
1 | -export interface Options { | |
2 | - show?: boolean; | |
3 | - imageList: string[]; | |
4 | - index?: number; | |
5 | -} | |
6 | - | |
7 | -export interface Props { | |
8 | - show: boolean; | |
9 | - instance: Props; | |
10 | - imageList: string[]; | |
11 | - index: number; | |
12 | -} | |
13 | - | |
14 | -export interface ImageProps { | |
15 | - alt?: string; | |
16 | - fallback?: string; | |
17 | - src: string; | |
18 | - width: string | number; | |
19 | - height?: string | number; | |
20 | - placeholder?: string | boolean; | |
21 | - preview?: | |
22 | - | boolean | |
23 | - | { | |
24 | - visible?: boolean; | |
25 | - onVisibleChange?: (visible: boolean, prevVisible: boolean) => void; | |
26 | - getContainer: string | HTMLElement | (() => HTMLElement); | |
27 | - }; | |
28 | -} | |
29 | - | |
30 | -export type ImageItem = string | ImageProps; |
src/components/Table/src/components/TableAction.vue
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | <script lang="ts"> |
19 | 19 | import { defineComponent, PropType, computed } from 'vue'; |
20 | 20 | import Icon from '/@/components/Icon/index'; |
21 | - import { ActionItem } from '/@/components/Table'; | |
21 | + import { ActionItem, TableActionType } from '/@/components/Table'; | |
22 | 22 | import { PopConfirmButton } from '/@/components/Button'; |
23 | 23 | import { Divider } from 'ant-design-vue'; |
24 | 24 | import { Dropdown } from '/@/components/Dropdown'; |
... | ... | @@ -40,10 +40,15 @@ |
40 | 40 | default: null, |
41 | 41 | }, |
42 | 42 | divider: propTypes.bool.def(true), |
43 | + outside: propTypes.bool, | |
43 | 44 | }, |
44 | 45 | setup(props) { |
45 | 46 | const { prefixCls } = useDesign('basic-table-action'); |
46 | - const table = useTableContext(); | |
47 | + let table = {}; | |
48 | + if (!props.outside) { | |
49 | + table = useTableContext(); | |
50 | + } | |
51 | + | |
47 | 52 | const getActions = computed(() => { |
48 | 53 | return (props.actions || []).map((action) => { |
49 | 54 | const { popConfirm } = action; |
... | ... | @@ -71,7 +76,7 @@ |
71 | 76 | }); |
72 | 77 | |
73 | 78 | const getAlign = computed(() => { |
74 | - const columns = table.getColumns(); | |
79 | + const columns = (table as TableActionType)?.getColumns?.() || []; | |
75 | 80 | const actionColumn = columns.find((item) => item.flag === ACTION_COLUMN_FLAG); |
76 | 81 | return actionColumn?.align ?? 'left'; |
77 | 82 | }); | ... | ... |
src/components/Upload/src/FileList.tsx
1 | -import { defineComponent, CSSProperties } from 'vue'; | |
1 | +import { defineComponent, CSSProperties, watch, nextTick } from 'vue'; | |
2 | 2 | import { fileListProps } from './props'; |
3 | 3 | import { isFunction } from '/@/utils/is'; |
4 | 4 | import './FileList.less'; |
5 | +import { useModalContext } from '/@/components/Modal/src/hooks/useModalContext'; | |
5 | 6 | |
6 | 7 | export default defineComponent({ |
7 | 8 | name: 'FileList', |
8 | 9 | props: fileListProps, |
9 | 10 | setup(props) { |
11 | + const modalFn = useModalContext(); | |
12 | + watch( | |
13 | + () => props.dataSource, | |
14 | + () => { | |
15 | + nextTick(() => { | |
16 | + modalFn?.redoModalHeight?.(); | |
17 | + }); | |
18 | + } | |
19 | + ); | |
10 | 20 | return () => { |
11 | 21 | const { columns, actionColumn, dataSource } = props; |
12 | - | |
13 | 22 | const columnList = [...columns, actionColumn]; |
14 | 23 | return ( |
15 | 24 | <table class="file-table"> | ... | ... |
src/components/Upload/src/ThumbUrl.vue
1 | 1 | <template> |
2 | 2 | <span class="thumb"> |
3 | - <img v-if="fileUrl" :src="fileUrl" /> | |
3 | + <Image v-if="fileUrl" :src="fileUrl" :width="104" /> | |
4 | 4 | </span> |
5 | 5 | </template> |
6 | 6 | <script lang="ts"> |
7 | 7 | import { defineComponent } from 'vue'; |
8 | 8 | import { propTypes } from '/@/utils/propTypes'; |
9 | + import { Image } from 'ant-design-vue'; | |
9 | 10 | |
10 | 11 | export default defineComponent({ |
12 | + components: { Image }, | |
11 | 13 | props: { |
12 | 14 | fileUrl: propTypes.string.def(''), |
13 | 15 | fileName: propTypes.string.def(''), |
14 | 16 | }, |
15 | 17 | }); |
16 | 18 | </script> |
17 | -<style lang="less" scoped> | |
19 | +<style lang="less"> | |
18 | 20 | .thumb { |
19 | 21 | img { |
20 | 22 | position: static; |
21 | 23 | display: block; |
22 | - width: 104px; | |
23 | - height: 104px; | |
24 | + cursor: zoom-in; | |
25 | + border-radius: 4px; | |
24 | 26 | object-fit: cover; |
25 | 27 | } |
26 | 28 | } | ... | ... |
src/components/Upload/src/UploadModal.vue
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | :okButtonProps="getOkButtonProps" |
14 | 14 | :cancelButtonProps="{ disabled: isUploadingRef }" |
15 | 15 | > |
16 | - <template #centerdFooter> | |
16 | + <template #centerFooter> | |
17 | 17 | <a-button |
18 | 18 | @click="handleStartUpload" |
19 | 19 | color="success" |
... | ... | @@ -54,7 +54,6 @@ |
54 | 54 | // utils |
55 | 55 | import { checkFileType, checkImgType, getBase64WithFile } from './helper'; |
56 | 56 | import { buildUUID } from '/@/utils/uuid'; |
57 | - import { createImgPreview } from '/@/components/Preview/index'; | |
58 | 57 | import { isFunction } from '/@/utils/is'; |
59 | 58 | import { warn } from '/@/utils/log'; |
60 | 59 | import FileList from './FileList'; |
... | ... | @@ -161,12 +160,12 @@ |
161 | 160 | } |
162 | 161 | |
163 | 162 | // 预览 |
164 | - function handlePreview(record: FileItem) { | |
165 | - const { thumbUrl = '' } = record; | |
166 | - createImgPreview({ | |
167 | - imageList: [thumbUrl], | |
168 | - }); | |
169 | - } | |
163 | + // function handlePreview(record: FileItem) { | |
164 | + // const { thumbUrl = '' } = record; | |
165 | + // createImgPreview({ | |
166 | + // imageList: [thumbUrl], | |
167 | + // }); | |
168 | + // } | |
170 | 169 | |
171 | 170 | async function uploadApiByItem(item: FileItem) { |
172 | 171 | const { api } = props; |
... | ... | @@ -267,7 +266,7 @@ |
267 | 266 | |
268 | 267 | return { |
269 | 268 | columns: createTableColumns(), |
270 | - actionColumn: createActionColumn(handleRemove, handlePreview), | |
269 | + actionColumn: createActionColumn(handleRemove), | |
271 | 270 | register, |
272 | 271 | closeModal, |
273 | 272 | getHelpText, | ... | ... |
src/components/Upload/src/UploadPreviewModal.vue
... | ... | @@ -19,7 +19,6 @@ |
19 | 19 | import { BasicModal, useModalInner } from '/@/components/Modal'; |
20 | 20 | import { previewProps } from './props'; |
21 | 21 | import { PreviewFileItem } from './types'; |
22 | - import { createImgPreview } from '/@/components/Preview/index'; | |
23 | 22 | import { downloadByUrl } from '/@/utils/file/download'; |
24 | 23 | |
25 | 24 | import { createPreviewColumns, createPreviewActionColumn } from './data'; |
... | ... | @@ -63,13 +62,13 @@ |
63 | 62 | } |
64 | 63 | } |
65 | 64 | |
66 | - // 预览 | |
67 | - function handlePreview(record: PreviewFileItem) { | |
68 | - const { url = '' } = record; | |
69 | - createImgPreview({ | |
70 | - imageList: [url], | |
71 | - }); | |
72 | - } | |
65 | + // // 预览 | |
66 | + // function handlePreview(record: PreviewFileItem) { | |
67 | + // const { url = '' } = record; | |
68 | + // createImgPreview({ | |
69 | + // imageList: [url], | |
70 | + // }); | |
71 | + // } | |
73 | 72 | |
74 | 73 | // 下载 |
75 | 74 | function handleDownload(record: PreviewFileItem) { |
... | ... | @@ -83,7 +82,7 @@ |
83 | 82 | closeModal, |
84 | 83 | fileListRef, |
85 | 84 | columns: createPreviewColumns(), |
86 | - actionColumn: createPreviewActionColumn({ handleRemove, handlePreview, handleDownload }), | |
85 | + actionColumn: createPreviewActionColumn({ handleRemove, handleDownload }), | |
87 | 86 | }; |
88 | 87 | }, |
89 | 88 | }); | ... | ... |
src/components/Upload/src/data.tsx
1 | 1 | import type { BasicColumn, ActionItem } from '/@/components/Table'; |
2 | 2 | |
3 | 3 | import { FileItem, PreviewFileItem, UploadResultStatus } from './types'; |
4 | -import { checkImgType, isImgTypeByName } from './helper'; | |
4 | +import { | |
5 | + // checkImgType, | |
6 | + isImgTypeByName, | |
7 | +} from './helper'; | |
5 | 8 | import { Progress, Tag } from 'ant-design-vue'; |
6 | 9 | |
7 | 10 | import TableAction from '/@/components/Table/src/components/TableAction.vue'; |
... | ... | @@ -76,7 +79,7 @@ export function createTableColumns(): BasicColumn[] { |
76 | 79 | }, |
77 | 80 | ]; |
78 | 81 | } |
79 | -export function createActionColumn(handleRemove: Function, handlePreview: Function): BasicColumn { | |
82 | +export function createActionColumn(handleRemove: Function): BasicColumn { | |
80 | 83 | return { |
81 | 84 | width: 120, |
82 | 85 | title: t('component.upload.operating'), |
... | ... | @@ -90,13 +93,13 @@ export function createActionColumn(handleRemove: Function, handlePreview: Functi |
90 | 93 | onClick: handleRemove.bind(null, record), |
91 | 94 | }, |
92 | 95 | ]; |
93 | - if (checkImgType(record)) { | |
94 | - actions.unshift({ | |
95 | - label: t('component.upload.preview'), | |
96 | - onClick: handlePreview.bind(null, record), | |
97 | - }); | |
98 | - } | |
99 | - return <TableAction actions={actions} />; | |
96 | + // if (checkImgType(record)) { | |
97 | + // actions.unshift({ | |
98 | + // label: t('component.upload.preview'), | |
99 | + // onClick: handlePreview.bind(null, record), | |
100 | + // }); | |
101 | + // } | |
102 | + return <TableAction actions={actions} outside={true} />; | |
100 | 103 | }, |
101 | 104 | }; |
102 | 105 | } |
... | ... | @@ -122,7 +125,6 @@ export function createPreviewColumns(): BasicColumn[] { |
122 | 125 | |
123 | 126 | export function createPreviewActionColumn({ |
124 | 127 | handleRemove, |
125 | - handlePreview, | |
126 | 128 | handleDownload, |
127 | 129 | }: { |
128 | 130 | handleRemove: Fn; |
... | ... | @@ -135,7 +137,7 @@ export function createPreviewActionColumn({ |
135 | 137 | dataIndex: 'action', |
136 | 138 | fixed: false, |
137 | 139 | customRender: ({ record }) => { |
138 | - const { url } = (record || {}) as PreviewFileItem; | |
140 | + // const { url } = (record || {}) as PreviewFileItem; | |
139 | 141 | |
140 | 142 | const actions: ActionItem[] = [ |
141 | 143 | { |
... | ... | @@ -148,12 +150,12 @@ export function createPreviewActionColumn({ |
148 | 150 | onClick: handleDownload.bind(null, record), |
149 | 151 | }, |
150 | 152 | ]; |
151 | - if (isImgTypeByName(url)) { | |
152 | - actions.unshift({ | |
153 | - label: t('component.upload.preview'), | |
154 | - onClick: handlePreview.bind(null, record), | |
155 | - }); | |
156 | - } | |
153 | + // if (isImgTypeByName(url)) { | |
154 | + // actions.unshift({ | |
155 | + // label: t('component.upload.preview'), | |
156 | + // onClick: handlePreview.bind(null, record), | |
157 | + // }); | |
158 | + // } | |
157 | 159 | return <TableAction actions={actions} />; |
158 | 160 | }, |
159 | 161 | }; | ... | ... |
src/views/demo/feat/img-preview/index.vue
1 | 1 | <template> |
2 | 2 | <PageWrapper title="图片预览示例"> |
3 | 3 | <ImagePreview :imageList="imgList" /> |
4 | - <Alert message="有预览图" type="info" /> | |
5 | - <div class="flex justify-center mt-4"> | |
6 | - <img :src="img" v-for="img in imgList" :key="img" class="mr-2" @click="handleClick(img)" /> | |
7 | - </div> | |
8 | - <Alert message="无预览图" type="info" /> | |
9 | - <a-button @click="handlePreview" type="primary" class="mt-4">预览图片</a-button> | |
10 | 4 | </PageWrapper> |
11 | 5 | </template> |
12 | 6 | <script lang="ts"> |
13 | 7 | import { defineComponent } from 'vue'; |
14 | - import { Alert } from 'ant-design-vue'; | |
15 | - import { createImgPreview, ImagePreview } from '/@/components/Preview/index'; | |
8 | + import { ImagePreview } from '/@/components/Preview/index'; | |
16 | 9 | import { PageWrapper } from '/@/components/Page'; |
17 | 10 | |
18 | 11 | const imgList: string[] = [ |
... | ... | @@ -21,16 +14,9 @@ |
21 | 14 | 'https://picsum.photos/id/68/346/216', |
22 | 15 | ]; |
23 | 16 | export default defineComponent({ |
24 | - components: { Alert, PageWrapper, ImagePreview }, | |
17 | + components: { PageWrapper, ImagePreview }, | |
25 | 18 | setup() { |
26 | - function handleClick(img: string) { | |
27 | - createImgPreview({ imageList: [img] }); | |
28 | - } | |
29 | - | |
30 | - function handlePreview() { | |
31 | - createImgPreview({ imageList: imgList }); | |
32 | - } | |
33 | - return { imgList, handleClick, handlePreview }; | |
19 | + return { imgList }; | |
34 | 20 | }, |
35 | 21 | }); |
36 | 22 | </script> | ... | ... |
test/upload-server/README.md
test/upload-server/yarn.lock
0 → 100644
1 | +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |
2 | +# yarn lockfile v1 | |
3 | + | |
4 | + | |
5 | +"@types/formidable@^1.0.31": | |
6 | + version "1.0.32" | |
7 | + resolved "https://registry.npmjs.org/@types/formidable/-/formidable-1.0.32.tgz#d9a7eefbaa995a4486ec4e3960e9552e68b3f33c" | |
8 | + integrity sha512-jOAB5+GFW+C+2xdvUcpd/CnYg2rD5xCyagJLBJU+9PB4a/DKmsAqS9yZI3j/Q9zwvM7ztPHaAIH1ijzp4cezdQ== | |
9 | + dependencies: | |
10 | + "@types/node" "*" | |
11 | + | |
12 | +"@types/node@*": | |
13 | + version "14.14.20" | |
14 | + resolved "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" | |
15 | + integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== | |
16 | + | |
17 | +accepts@^1.3.5: | |
18 | + version "1.3.7" | |
19 | + resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" | |
20 | + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== | |
21 | + dependencies: | |
22 | + mime-types "~2.1.24" | |
23 | + negotiator "0.6.2" | |
24 | + | |
25 | +any-promise@^1.1.0: | |
26 | + version "1.3.0" | |
27 | + resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" | |
28 | + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= | |
29 | + | |
30 | +bytes@3.1.0: | |
31 | + version "3.1.0" | |
32 | + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" | |
33 | + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== | |
34 | + | |
35 | +cache-content-type@^1.0.0: | |
36 | + version "1.0.1" | |
37 | + resolved "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" | |
38 | + integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== | |
39 | + dependencies: | |
40 | + mime-types "^2.1.18" | |
41 | + ylru "^1.2.0" | |
42 | + | |
43 | +co-body@^5.1.1: | |
44 | + version "5.2.0" | |
45 | + resolved "https://registry.npmjs.org/co-body/-/co-body-5.2.0.tgz#5a0a658c46029131e0e3a306f67647302f71c124" | |
46 | + integrity sha512-sX/LQ7LqUhgyaxzbe7IqwPeTr2yfpfUIQ/dgpKo6ZI4y4lpQA0YxAomWIY+7I7rHWcG02PG+OuPREzMW/5tszQ== | |
47 | + dependencies: | |
48 | + inflation "^2.0.0" | |
49 | + qs "^6.4.0" | |
50 | + raw-body "^2.2.0" | |
51 | + type-is "^1.6.14" | |
52 | + | |
53 | +co@^4.6.0: | |
54 | + version "4.6.0" | |
55 | + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" | |
56 | + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= | |
57 | + | |
58 | +content-disposition@~0.5.2: | |
59 | + version "0.5.3" | |
60 | + resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" | |
61 | + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== | |
62 | + dependencies: | |
63 | + safe-buffer "5.1.2" | |
64 | + | |
65 | +content-type@^1.0.4: | |
66 | + version "1.0.4" | |
67 | + resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" | |
68 | + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== | |
69 | + | |
70 | +cookies@~0.8.0: | |
71 | + version "0.8.0" | |
72 | + resolved "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" | |
73 | + integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== | |
74 | + dependencies: | |
75 | + depd "~2.0.0" | |
76 | + keygrip "~1.1.0" | |
77 | + | |
78 | +debug@^3.1.0: | |
79 | + version "3.2.7" | |
80 | + resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" | |
81 | + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== | |
82 | + dependencies: | |
83 | + ms "^2.1.1" | |
84 | + | |
85 | +debug@^4.1.1: | |
86 | + version "4.3.1" | |
87 | + resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" | |
88 | + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== | |
89 | + dependencies: | |
90 | + ms "2.1.2" | |
91 | + | |
92 | +debug@~3.1.0: | |
93 | + version "3.1.0" | |
94 | + resolved "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" | |
95 | + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== | |
96 | + dependencies: | |
97 | + ms "2.0.0" | |
98 | + | |
99 | +deep-equal@~1.0.1: | |
100 | + version "1.0.1" | |
101 | + resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" | |
102 | + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= | |
103 | + | |
104 | +delegates@^1.0.0: | |
105 | + version "1.0.0" | |
106 | + resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" | |
107 | + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= | |
108 | + | |
109 | +depd@^2.0.0, depd@~2.0.0: | |
110 | + version "2.0.0" | |
111 | + resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" | |
112 | + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== | |
113 | + | |
114 | +depd@~1.1.2: | |
115 | + version "1.1.2" | |
116 | + resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" | |
117 | + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= | |
118 | + | |
119 | +destroy@^1.0.4: | |
120 | + version "1.0.4" | |
121 | + resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" | |
122 | + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= | |
123 | + | |
124 | +ee-first@1.1.1: | |
125 | + version "1.1.1" | |
126 | + resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" | |
127 | + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= | |
128 | + | |
129 | +encodeurl@^1.0.2: | |
130 | + version "1.0.2" | |
131 | + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" | |
132 | + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= | |
133 | + | |
134 | +escape-html@^1.0.3: | |
135 | + version "1.0.3" | |
136 | + resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" | |
137 | + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= | |
138 | + | |
139 | +formidable@^1.1.1: | |
140 | + version "1.2.2" | |
141 | + resolved "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9" | |
142 | + integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q== | |
143 | + | |
144 | +fresh@~0.5.2: | |
145 | + version "0.5.2" | |
146 | + resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" | |
147 | + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= | |
148 | + | |
149 | +http-assert@^1.3.0: | |
150 | + version "1.4.1" | |
151 | + resolved "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" | |
152 | + integrity sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw== | |
153 | + dependencies: | |
154 | + deep-equal "~1.0.1" | |
155 | + http-errors "~1.7.2" | |
156 | + | |
157 | +http-errors@1.7.3, http-errors@~1.7.2: | |
158 | + version "1.7.3" | |
159 | + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" | |
160 | + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== | |
161 | + dependencies: | |
162 | + depd "~1.1.2" | |
163 | + inherits "2.0.4" | |
164 | + setprototypeof "1.1.1" | |
165 | + statuses ">= 1.5.0 < 2" | |
166 | + toidentifier "1.0.0" | |
167 | + | |
168 | +http-errors@^1.6.3, http-errors@^1.7.3: | |
169 | + version "1.8.0" | |
170 | + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" | |
171 | + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== | |
172 | + dependencies: | |
173 | + depd "~1.1.2" | |
174 | + inherits "2.0.4" | |
175 | + setprototypeof "1.2.0" | |
176 | + statuses ">= 1.5.0 < 2" | |
177 | + toidentifier "1.0.0" | |
178 | + | |
179 | +http-errors@~1.6.2: | |
180 | + version "1.6.3" | |
181 | + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" | |
182 | + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= | |
183 | + dependencies: | |
184 | + depd "~1.1.2" | |
185 | + inherits "2.0.3" | |
186 | + setprototypeof "1.1.0" | |
187 | + statuses ">= 1.4.0 < 2" | |
188 | + | |
189 | +iconv-lite@0.4.24: | |
190 | + version "0.4.24" | |
191 | + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" | |
192 | + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== | |
193 | + dependencies: | |
194 | + safer-buffer ">= 2.1.2 < 3" | |
195 | + | |
196 | +inflation@^2.0.0: | |
197 | + version "2.0.0" | |
198 | + resolved "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz#8b417e47c28f925a45133d914ca1fd389107f30f" | |
199 | + integrity sha1-i0F+R8KPklpFEz2RTKH9OJEH8w8= | |
200 | + | |
201 | +inherits@2.0.3: | |
202 | + version "2.0.3" | |
203 | + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" | |
204 | + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= | |
205 | + | |
206 | +inherits@2.0.4: | |
207 | + version "2.0.4" | |
208 | + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" | |
209 | + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | |
210 | + | |
211 | +is-generator-function@^1.0.7: | |
212 | + version "1.0.8" | |
213 | + resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz#dfb5c2b120e02b0a8d9d2c6806cd5621aa922f7b" | |
214 | + integrity sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ== | |
215 | + | |
216 | +keygrip@~1.1.0: | |
217 | + version "1.1.0" | |
218 | + resolved "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" | |
219 | + integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== | |
220 | + dependencies: | |
221 | + tsscmp "1.0.6" | |
222 | + | |
223 | +koa-body@^4.2.0: | |
224 | + version "4.2.0" | |
225 | + resolved "https://registry.npmjs.org/koa-body/-/koa-body-4.2.0.tgz#37229208b820761aca5822d14c5fc55cee31b26f" | |
226 | + integrity sha512-wdGu7b9amk4Fnk/ytH8GuWwfs4fsB5iNkY8kZPpgQVb04QZSv85T0M8reb+cJmvLE8cjPYvBzRikD3s6qz8OoA== | |
227 | + dependencies: | |
228 | + "@types/formidable" "^1.0.31" | |
229 | + co-body "^5.1.1" | |
230 | + formidable "^1.1.1" | |
231 | + | |
232 | +koa-compose@^3.0.0: | |
233 | + version "3.2.1" | |
234 | + resolved "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" | |
235 | + integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= | |
236 | + dependencies: | |
237 | + any-promise "^1.1.0" | |
238 | + | |
239 | +koa-compose@^4.1.0: | |
240 | + version "4.1.0" | |
241 | + resolved "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" | |
242 | + integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== | |
243 | + | |
244 | +koa-convert@^1.2.0: | |
245 | + version "1.2.0" | |
246 | + resolved "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" | |
247 | + integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= | |
248 | + dependencies: | |
249 | + co "^4.6.0" | |
250 | + koa-compose "^3.0.0" | |
251 | + | |
252 | +koa-router@^10.0.0: | |
253 | + version "10.0.0" | |
254 | + resolved "https://registry.npmjs.org/koa-router/-/koa-router-10.0.0.tgz#7bc76a031085731e61fc92c1683687b2f44de6a4" | |
255 | + integrity sha512-gAE5J1gBQTvfR8rMMtMUkE26+1MbO3DGpGmvfmM2pR9Z7w2VIb2Ecqeal98yVO7+4ltffby7gWOzpCmdNOQe0w== | |
256 | + dependencies: | |
257 | + debug "^4.1.1" | |
258 | + http-errors "^1.7.3" | |
259 | + koa-compose "^4.1.0" | |
260 | + methods "^1.1.2" | |
261 | + path-to-regexp "^6.1.0" | |
262 | + | |
263 | +koa-send@^5.0.0: | |
264 | + version "5.0.1" | |
265 | + resolved "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz#39dceebfafb395d0d60beaffba3a70b4f543fe79" | |
266 | + integrity sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ== | |
267 | + dependencies: | |
268 | + debug "^4.1.1" | |
269 | + http-errors "^1.7.3" | |
270 | + resolve-path "^1.4.0" | |
271 | + | |
272 | +koa-static@^5.0.0: | |
273 | + version "5.0.0" | |
274 | + resolved "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz#5e92fc96b537ad5219f425319c95b64772776943" | |
275 | + integrity sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ== | |
276 | + dependencies: | |
277 | + debug "^3.1.0" | |
278 | + koa-send "^5.0.0" | |
279 | + | |
280 | +koa2-cors@^2.0.6: | |
281 | + version "2.0.6" | |
282 | + resolved "https://registry.npmjs.org/koa2-cors/-/koa2-cors-2.0.6.tgz#9ad23df3a0b9bb84530b46f5944f3fb576086554" | |
283 | + integrity sha512-JRCcSM4lamM+8kvKGDKlesYk2ASrmSTczDtGUnIadqMgnHU4Ct5Gw7Bxt3w3m6d6dy3WN0PU4oMP43HbddDEWg== | |
284 | + | |
285 | +koa@^2.13.0: | |
286 | + version "2.13.1" | |
287 | + resolved "https://registry.npmjs.org/koa/-/koa-2.13.1.tgz#6275172875b27bcfe1d454356a5b6b9f5a9b1051" | |
288 | + integrity sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w== | |
289 | + dependencies: | |
290 | + accepts "^1.3.5" | |
291 | + cache-content-type "^1.0.0" | |
292 | + content-disposition "~0.5.2" | |
293 | + content-type "^1.0.4" | |
294 | + cookies "~0.8.0" | |
295 | + debug "~3.1.0" | |
296 | + delegates "^1.0.0" | |
297 | + depd "^2.0.0" | |
298 | + destroy "^1.0.4" | |
299 | + encodeurl "^1.0.2" | |
300 | + escape-html "^1.0.3" | |
301 | + fresh "~0.5.2" | |
302 | + http-assert "^1.3.0" | |
303 | + http-errors "^1.6.3" | |
304 | + is-generator-function "^1.0.7" | |
305 | + koa-compose "^4.1.0" | |
306 | + koa-convert "^1.2.0" | |
307 | + on-finished "^2.3.0" | |
308 | + only "~0.0.2" | |
309 | + parseurl "^1.3.2" | |
310 | + statuses "^1.5.0" | |
311 | + type-is "^1.6.16" | |
312 | + vary "^1.1.2" | |
313 | + | |
314 | +media-typer@0.3.0: | |
315 | + version "0.3.0" | |
316 | + resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" | |
317 | + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= | |
318 | + | |
319 | +methods@^1.1.2: | |
320 | + version "1.1.2" | |
321 | + resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" | |
322 | + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= | |
323 | + | |
324 | +mime-db@1.45.0: | |
325 | + version "1.45.0" | |
326 | + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" | |
327 | + integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== | |
328 | + | |
329 | +mime-types@^2.1.18, mime-types@~2.1.24: | |
330 | + version "2.1.28" | |
331 | + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" | |
332 | + integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== | |
333 | + dependencies: | |
334 | + mime-db "1.45.0" | |
335 | + | |
336 | +ms@2.0.0: | |
337 | + version "2.0.0" | |
338 | + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" | |
339 | + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= | |
340 | + | |
341 | +ms@2.1.2: | |
342 | + version "2.1.2" | |
343 | + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" | |
344 | + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== | |
345 | + | |
346 | +ms@^2.1.1: | |
347 | + version "2.1.3" | |
348 | + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" | |
349 | + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== | |
350 | + | |
351 | +negotiator@0.6.2: | |
352 | + version "0.6.2" | |
353 | + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" | |
354 | + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== | |
355 | + | |
356 | +on-finished@^2.3.0: | |
357 | + version "2.3.0" | |
358 | + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" | |
359 | + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= | |
360 | + dependencies: | |
361 | + ee-first "1.1.1" | |
362 | + | |
363 | +only@~0.0.2: | |
364 | + version "0.0.2" | |
365 | + resolved "https://registry.npmjs.org/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" | |
366 | + integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= | |
367 | + | |
368 | +parseurl@^1.3.2: | |
369 | + version "1.3.3" | |
370 | + resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" | |
371 | + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== | |
372 | + | |
373 | +path-is-absolute@1.0.1: | |
374 | + version "1.0.1" | |
375 | + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" | |
376 | + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= | |
377 | + | |
378 | +path-to-regexp@^6.1.0: | |
379 | + version "6.2.0" | |
380 | + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.0.tgz#f7b3803336104c346889adece614669230645f38" | |
381 | + integrity sha512-f66KywYG6+43afgE/8j/GoiNyygk/bnoCbps++3ErRKsIYkGGupyv07R2Ok5m9i67Iqc+T2g1eAUGUPzWhYTyg== | |
382 | + | |
383 | +qs@^6.4.0: | |
384 | + version "6.9.4" | |
385 | + resolved "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" | |
386 | + integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== | |
387 | + | |
388 | +raw-body@^2.2.0: | |
389 | + version "2.4.1" | |
390 | + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" | |
391 | + integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== | |
392 | + dependencies: | |
393 | + bytes "3.1.0" | |
394 | + http-errors "1.7.3" | |
395 | + iconv-lite "0.4.24" | |
396 | + unpipe "1.0.0" | |
397 | + | |
398 | +resolve-path@^1.4.0: | |
399 | + version "1.4.0" | |
400 | + resolved "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz#c4bda9f5efb2fce65247873ab36bb4d834fe16f7" | |
401 | + integrity sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc= | |
402 | + dependencies: | |
403 | + http-errors "~1.6.2" | |
404 | + path-is-absolute "1.0.1" | |
405 | + | |
406 | +safe-buffer@5.1.2: | |
407 | + version "5.1.2" | |
408 | + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" | |
409 | + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== | |
410 | + | |
411 | +"safer-buffer@>= 2.1.2 < 3": | |
412 | + version "2.1.2" | |
413 | + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" | |
414 | + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== | |
415 | + | |
416 | +setprototypeof@1.1.0: | |
417 | + version "1.1.0" | |
418 | + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" | |
419 | + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== | |
420 | + | |
421 | +setprototypeof@1.1.1: | |
422 | + version "1.1.1" | |
423 | + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" | |
424 | + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== | |
425 | + | |
426 | +setprototypeof@1.2.0: | |
427 | + version "1.2.0" | |
428 | + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" | |
429 | + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== | |
430 | + | |
431 | +"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0: | |
432 | + version "1.5.0" | |
433 | + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" | |
434 | + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= | |
435 | + | |
436 | +toidentifier@1.0.0: | |
437 | + version "1.0.0" | |
438 | + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" | |
439 | + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== | |
440 | + | |
441 | +tsscmp@1.0.6: | |
442 | + version "1.0.6" | |
443 | + resolved "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" | |
444 | + integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== | |
445 | + | |
446 | +type-is@^1.6.14, type-is@^1.6.16: | |
447 | + version "1.6.18" | |
448 | + resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" | |
449 | + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== | |
450 | + dependencies: | |
451 | + media-typer "0.3.0" | |
452 | + mime-types "~2.1.24" | |
453 | + | |
454 | +unpipe@1.0.0: | |
455 | + version "1.0.0" | |
456 | + resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" | |
457 | + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= | |
458 | + | |
459 | +vary@^1.1.2: | |
460 | + version "1.1.2" | |
461 | + resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" | |
462 | + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= | |
463 | + | |
464 | +ylru@^1.2.0: | |
465 | + version "1.2.1" | |
466 | + resolved "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" | |
467 | + integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== | ... | ... |