@qynpm/ui 0.0.2 → 1.0.4
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.
- package/README.md +183 -8
- package/dist/_virtual/plugin-vue_export-helper.cjs +1 -0
- package/dist/_virtual/plugin-vue_export-helper.mjs +9 -0
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +17 -0
- package/dist/lib/dialog/index.vue.cjs +1 -0
- package/dist/lib/dialog/index.vue.mjs +326 -0
- package/dist/lib/index.cjs +1 -0
- package/dist/lib/index.mjs +40 -0
- package/dist/lib/qy-action-bar/index.vue.cjs +1 -0
- package/dist/lib/qy-action-bar/index.vue.mjs +56 -0
- package/dist/lib/qy-form-section/index.vue.cjs +1 -0
- package/dist/lib/qy-form-section/index.vue.mjs +89 -0
- package/dist/lib/qy-input/index.vue.cjs +1 -0
- package/dist/lib/qy-input/index.vue.mjs +142 -0
- package/dist/lib/qy-record-quote-search/index.vue.cjs +1 -0
- package/dist/lib/qy-record-quote-search/index.vue.mjs +206 -0
- package/dist/lib/qy-search-input/index.vue.cjs +1 -0
- package/dist/lib/qy-search-input/index.vue.mjs +277 -0
- package/dist/lib/qy-select/index.vue.cjs +1 -0
- package/dist/lib/qy-select/index.vue.mjs +137 -0
- package/dist/lib/remark-image/index.vue.cjs +1 -0
- package/dist/lib/remark-image/index.vue.mjs +198 -0
- package/dist/lib/remark-image/utils.cjs +1 -0
- package/dist/lib/remark-image/utils.mjs +22 -0
- package/dist/lib/upload/index.vue.cjs +1 -0
- package/dist/lib/upload/index.vue.mjs +382 -0
- package/dist/lib/utils/auth.cjs +1 -0
- package/dist/lib/utils/auth.mjs +8 -0
- package/dist/lib/utils/install.cjs +1 -0
- package/dist/lib/utils/install.mjs +8 -0
- package/dist/node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.cjs +1 -0
- package/dist/node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.mjs +74 -0
- package/dist/qy-action-bar/index.cjs +1 -0
- package/dist/qy-action-bar/index.mjs +6 -0
- package/dist/qy-dialog/index.cjs +1 -0
- package/dist/qy-dialog/index.mjs +6 -0
- package/dist/qy-form-section/index.cjs +1 -0
- package/dist/qy-form-section/index.mjs +6 -0
- package/dist/qy-input/index.cjs +1 -0
- package/dist/qy-input/index.mjs +6 -0
- package/dist/qy-record-quote-search/index.cjs +1 -0
- package/dist/qy-record-quote-search/index.mjs +6 -0
- package/dist/qy-remark-image/index.cjs +2 -0
- package/dist/qy-remark-image/index.mjs +7 -0
- package/dist/qy-search-input/index.cjs +1 -0
- package/dist/qy-search-input/index.mjs +6 -0
- package/dist/qy-select/index.cjs +1 -0
- package/dist/qy-select/index.mjs +6 -0
- package/dist/qy-upload/index.cjs +1 -0
- package/dist/qy-upload/index.mjs +6 -0
- package/index.d.ts +16 -4
- package/package.json +60 -7
- package/qy-action-bar/index.d.ts +5 -0
- package/qy-action-bar/index.js +4 -0
- package/qy-dialog/index.d.ts +5 -0
- package/qy-dialog/index.js +4 -0
- package/qy-form-section/index.d.ts +5 -0
- package/qy-form-section/index.js +4 -0
- package/qy-input/index.d.ts +5 -0
- package/qy-input/index.js +4 -0
- package/qy-record-quote-search/index.d.ts +5 -0
- package/qy-record-quote-search/index.js +4 -0
- package/qy-remark-image/index.d.ts +5 -0
- package/qy-remark-image/index.js +4 -0
- package/qy-search-input/index.d.ts +5 -0
- package/qy-search-input/index.js +4 -0
- package/qy-select/index.d.ts +5 -0
- package/qy-select/index.js +4 -0
- package/qy-upload/index.d.ts +5 -0
- package/qy-upload/index.js +4 -0
- package/dist/ui.es.js +0 -994
- package/dist/ui.umd.js +0 -2
- package/index.js +0 -9
package/dist/ui.es.js
DELETED
|
@@ -1,994 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.icon-\\[ion--cloud-upload-outline\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='M320 367.79h76c55 0 100-29.21 100-83.6s-53-81.47-96-83.6c-8.89-85.06-71-136.8-144-136.8c-69 0-113.44 45.79-128 91.2c-60 5.7-112 43.88-112 106.4s54 106.4 120 106.4h56'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='32' d='m320 255.79l-64-64l-64 64m64 192.42V207.79'/%3E%3C/svg%3E") }.icon-\\[line-md--loading-twotone-loop\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath stroke-dasharray='16' stroke-dashoffset='16' d='M12 3c4.97 0 9 4.03 9 9'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='0.3s' values='16;0'/%3E%3CanimateTransform attributeName='transform' dur='1.5s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3Cpath stroke-dasharray='64' stroke-dashoffset='64' stroke-opacity='.3' d='M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='1.2s' values='64;0'/%3E%3C/path%3E%3C/g%3E%3C/svg%3E") }.icon-\\[material-symbols--minimize\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M6 21v-2h12v2z'/%3E%3C/svg%3E") }.icon-\\[material-symbols--square-outline-rounded\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5z'/%3E%3C/svg%3E") }.icon-\\[mdi--close\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E") }.icon-\\[mdi--window-maximize\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M4 4h16v16H4zm2 4v10h12V8z'/%3E%3C/svg%3E") }.icon-\\[mdi--window-restore\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M4 8h4V4h12v12h-4v4H4zm12 0v6h2V6h-8v2zM6 12v6h8v-6z'/%3E%3C/svg%3E") }.icon-\\[ph--images-thin\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' width='256' height='256'%3E%3Cpath fill='black' d='M216 44H72a12 12 0 0 0-12 12v20H40a12 12 0 0 0-12 12v112a12 12 0 0 0 12 12h144a12 12 0 0 0 12-12v-20h20a12 12 0 0 0 12-12V56a12 12 0 0 0-12-12M68 56a4 4 0 0 1 4-4h144a4 4 0 0 1 4 4v72.4l-16.89-16.89a12 12 0 0 0-17 0l-22.83 22.83l-46.79-46.83a12 12 0 0 0-17 0L68 119Zm120 144a4 4 0 0 1-4 4H40a4 4 0 0 1-4-4V88a4 4 0 0 1 4-4h20v84a12 12 0 0 0 12 12h116Zm28-28H72a4 4 0 0 1-4-4v-37.66l37.17-37.17a4 4 0 0 1 5.66 0l49.66 49.66a4 4 0 0 0 5.65 0l25.66-25.66a4 4 0 0 1 5.66 0L220 139.71V168a4 4 0 0 1-4 4m-52-88a8 8 0 1 1 8 8a8 8 0 0 1-8-8'/%3E%3C/svg%3E") }.icon-\\[ri--close-line\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z'/%3E%3C/svg%3E") }.icon-\\[tdesign--fullscreen-exit-1\\]{display:inline-block;width:1em;height:1em;background-color:currentColor;-webkit-mask-image:var(--svg);mask-image:var(--svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M14 20v-6h6v2h-4v4zm-6 0v-4H4v-2h6v6zm12-10h-6V4h2v4h4zm-10 0H4V8h4V4h2z'/%3E%3C/svg%3E") }.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.-right-12{right:-3rem}.left-0{left:0}.top-0{top:0}.top-2{top:.5rem}.z-\\[9999\\]{z-index:9999}.mb-3{margin-bottom:.75rem}.ml-2{margin-left:.5rem}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.h-9{height:2.25rem}.h-\\[var\\(--footer-height\\)\\]{height:var(--footer-height)}.h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}.h-full{height:100%}.min-h-\\[var\\(--footer-height\\)\\]{min-height:var(--footer-height)}.w-9{width:2.25rem}.w-\\[56px\\]{width:56px}.w-full{width:100%}.max-w-\\[200px\\]{max-width:200px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.px-\\[var\\(--content-padding\\)\\]{padding-left:var(--content-padding);padding-right:var(--content-padding)}.pl-1{padding-left:.25rem}.pl-\\[var\\(--content-padding\\)\\]{padding-left:var(--content-padding)}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.text-\\[1rem\\]{font-size:1rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.uppercase{text-transform:uppercase}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\\:bg-gray-600\\/80:hover{background-color:#4b5563cc}.hover\\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.hover\\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.active\\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_\\.el-dialog\\\\_\\\\_header\\]\\:\\!hidden .el-dialog__header{display:none!important}.qy-upload[data-v-12bbc6cc]{--qy-upload-size: 140px;--el-upload-picture-card-size: var(--qy-upload-size);display:inline-flex;flex-direction:column;gap:8px;vertical-align:top}.qy-upload[data-v-12bbc6cc] .el-upload--picture-card{width:var(--qy-upload-size)!important;height:var(--qy-upload-size)!important;line-height:1;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.qy-upload[data-v-12bbc6cc] .el-upload-list--picture-card .el-upload-list__item{width:var(--qy-upload-size)!important;height:var(--qy-upload-size)!important;margin:0 8px 8px 0}.qy-upload__trigger[data-v-12bbc6cc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;overflow:hidden;padding:4px 4px clamp(26px,var(--qy-upload-size) * .28,36px);box-sizing:border-box}.qy-upload__icon[data-v-12bbc6cc]{font-size:clamp(14px,var(--qy-upload-size) * .2,28px);color:#8c939d;flex-shrink:0}.qy-upload__trigger.is-dragover[data-v-12bbc6cc]{border:2px dashed var(--el-color-primary)!important;background-color:var(--el-color-primary-light-9)!important}.qy-upload__trigger.is-dragover .qy-upload__icon[data-v-12bbc6cc]{color:var(--el-color-primary)}.qy-upload__label[data-v-12bbc6cc]{font-size:13px;color:#606266}.qy-upload__hint[data-v-12bbc6cc]{font-size:11px;color:#909399}.qy-upload__text[data-v-12bbc6cc]{position:absolute;bottom:5px;left:5px;right:5px}.qy-upload__text-preview[data-v-12bbc6cc]{height:20px;line-height:20px;padding:0 5px;background:#ffffffe6;border:1px solid #dcdfe6;border-radius:4px;font-size:clamp(10px,var(--qy-upload-size) * .08,12px);color:#303133;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:text;transition:border-color .2s}.qy-upload__text-preview[data-v-12bbc6cc]:hover{border-color:#409eff}.qy-upload__text-preview.is-placeholder[data-v-12bbc6cc]{color:#c0c4cc}.qy-upload__tip[data-v-12bbc6cc]{display:flex;align-items:center;gap:4px;font-size:12px;color:#909399;line-height:1.4}.qy-upload__tip .error[data-v-12bbc6cc]{color:var(--el-color-danger)}.qy-upload--video[data-v-12bbc6cc]{display:flex;flex-direction:column;gap:8px}.qy-upload--video[data-v-12bbc6cc] .el-upload{display:block;width:100%}.qy-upload--video .qy-upload__trigger[data-v-12bbc6cc]{position:relative;flex-direction:row;gap:10px;height:80px;padding:0 20px 30px;border:1px dashed var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:#fafcff;transition:border-color .2s}.qy-upload--video .qy-upload__trigger[data-v-12bbc6cc]:hover{border-color:var(--el-color-primary)}.qy-upload--video .qy-upload__trigger .qy-upload__text-preview[data-v-12bbc6cc]{font-size:13px;height:22px;line-height:22px;background:#fffffff2}.qy-upload--video .qy-upload__icon[data-v-12bbc6cc]{font-size:24px;color:var(--el-color-primary)}.qy-upload--video .qy-upload__label[data-v-12bbc6cc]{font-size:14px;font-weight:500}.qy-upload--reached-limit[data-v-12bbc6cc] .el-upload--picture-card{display:none!important}.qy-upload--disabled[data-v-12bbc6cc] .el-upload--picture-card{cursor:not-allowed;background-color:#f5f7fa}.qy-upload--disabled .qy-upload__trigger[data-v-12bbc6cc]{cursor:not-allowed;color:#c0c4cc}.qy-upload__text-popover.el-popover{padding:10px!important}.qy-upload__text-popover .el-textarea__inner{font-size:13px;line-height:1.6}.qy-dialog{--small-content-padding: 16px;--content-padding: 24px;--header-height: 50px;--footer-height: 60px;--sides-gap: 10px;--block-outline-color: #e9e9e9}.qy-dialog .el-dialog__footer{padding:0}.qy-dialog .el-dialog__header{margin:0;padding:0}.qy-dialog__wrapper-container{position:relative;overflow:auto;width:100%!important;height:100%;min-width:300px;min-height:200px}.qy-dialog__wrapper-container::-webkit-scrollbar{width:6px;height:6px}.qy-dialog__wrapper-container::-webkit-scrollbar-track{background:transparent}.qy-dialog__wrapper-container::-webkit-scrollbar-thumb{background-color:#9093994d;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.qy-dialog__wrapper-container::-webkit-scrollbar-thumb:hover{background-color:#90939980}.qy-dialog .el-dialog{display:flex;flex-direction:column;max-height:90vh}.qy-dialog .el-dialog__body{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.qy-dialog__btn{display:flex;height:100%;width:56px;align-items:center;justify-content:center;font-size:1rem;cursor:pointer!important;z-index:10}.qy-dialog__btn:active{opacity:.6}.qy-dialog__btn--default:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.qy-dialog__btn--danger:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.qy-dialog__wrapper{overflow-y:auto}.qy-dialog__wrapper--fullscreen{min-height:calc(100vh - var(--header-height) - var(--footer-height))}.qy-dialog__footer{border-top:1px solid transparent;transition:border-color .2s linear}.qy-dialog__footer--outline{border-top-color:var(--block-outline-color)}.fixed.left-0.top-0.bg-white.rounded{-webkit-user-select:none;-moz-user-select:none;user-select:none}.fixed.left-0.top-0.bg-white.rounded *{-moz-user-select:none;user-select:none;-webkit-user-select:none}.qy-remark-image[data-v-00916fb4]{width:100%}.qy-remark-image__field[data-v-00916fb4]{position:relative;width:100%}.qy-remark-image__upload-anchor[data-v-00916fb4]{position:absolute;right:6px;top:14px;z-index:2}.qy-remark-image__upload[data-v-00916fb4]{width:20px;color:#6b7280;cursor:pointer;transition:color .2s ease;transform:translateY(-35%)}.qy-remark-image__upload[data-v-00916fb4]:hover{color:#2563eb}.qy-remark-image__popover[data-v-00916fb4]{padding:8px}.qy-remark-image__preview-img[data-v-00916fb4]{display:block;width:100%}.qy-remark-image__popover-footer[data-v-00916fb4]{margin-top:8px;padding:8px 12px;border-radius:6px;background:#f3f4f6;display:flex;align-items:center;justify-content:space-between}.qy-remark-image__popover-tip[data-v-00916fb4]{color:#6b7280;font-size:12px}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { ElUpload as je, ElIcon as Ie, ElPopover as Oe, ElInput as Pe, ElImageViewer as He, ElDialog as Be } from "element-plus/es";
|
|
3
|
-
import { ref as y, onMounted as _e, computed as F, watch as ve, onBeforeUnmount as Ze, createElementBlock as b, openBlock as h, normalizeStyle as re, normalizeClass as oe, createVNode as q, createBlock as ge, createCommentVNode as V, withCtx as I, withModifiers as $, createElementVNode as s, unref as D, Fragment as fe, toDisplayString as G, createTextVNode as se, defineComponent as Ue, mergeModels as qe, useSlots as Ne, useModel as We, watchEffect as Xe, useAttrs as Re, h as ze, nextTick as Ve, onUnmounted as Ee, resolveComponent as Qe, withDirectives as Ke, mergeProps as Me, createSlots as Je, renderSlot as ie, vShow as Ye } from "vue";
|
|
4
|
-
import { Plus as Ge, InfoFilled as et } from "@element-plus/icons-vue";
|
|
5
|
-
import { ElMessage as N, ElLoading as tt, ElButton as ye, ElInput as lt, ElPopover as ot, ElUpload as at } from "element-plus";
|
|
6
|
-
import nt from "clsx";
|
|
7
|
-
import { useBreakpoints as it, useDraggable as st } from "@vueuse/core";
|
|
8
|
-
/*! js-cookie v3.0.1 | MIT */
|
|
9
|
-
function pe(o) {
|
|
10
|
-
for (var g = 1; g < arguments.length; g++) {
|
|
11
|
-
var B = arguments[g];
|
|
12
|
-
for (var l in B)
|
|
13
|
-
o[l] = B[l];
|
|
14
|
-
}
|
|
15
|
-
return o;
|
|
16
|
-
}
|
|
17
|
-
var rt = {
|
|
18
|
-
read: function(o) {
|
|
19
|
-
return o[0] === '"' && (o = o.slice(1, -1)), o.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
20
|
-
},
|
|
21
|
-
write: function(o) {
|
|
22
|
-
return encodeURIComponent(o).replace(
|
|
23
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
24
|
-
decodeURIComponent
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
function he(o, g) {
|
|
29
|
-
function B(r, z, n) {
|
|
30
|
-
if (!(typeof document > "u")) {
|
|
31
|
-
n = pe({}, g, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
32
|
-
var x = "";
|
|
33
|
-
for (var f in n)
|
|
34
|
-
n[f] && (x += "; " + f, n[f] !== !0 && (x += "=" + n[f].split(";")[0]));
|
|
35
|
-
return document.cookie = r + "=" + o.write(z, r) + x;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function l(r) {
|
|
39
|
-
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
40
|
-
for (var z = document.cookie ? document.cookie.split("; ") : [], n = {}, x = 0; x < z.length; x++) {
|
|
41
|
-
var f = z[x].split("="), L = f.slice(1).join("=");
|
|
42
|
-
try {
|
|
43
|
-
var E = decodeURIComponent(f[0]);
|
|
44
|
-
if (n[E] = o.read(L, E), r === E)
|
|
45
|
-
break;
|
|
46
|
-
} catch {
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return r ? n[r] : n;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return Object.create(
|
|
53
|
-
{
|
|
54
|
-
set: B,
|
|
55
|
-
get: l,
|
|
56
|
-
remove: function(r, z) {
|
|
57
|
-
B(
|
|
58
|
-
r,
|
|
59
|
-
"",
|
|
60
|
-
pe({}, z, {
|
|
61
|
-
expires: -1
|
|
62
|
-
})
|
|
63
|
-
);
|
|
64
|
-
},
|
|
65
|
-
withAttributes: function(r) {
|
|
66
|
-
return he(this.converter, pe({}, this.attributes, r));
|
|
67
|
-
},
|
|
68
|
-
withConverter: function(r) {
|
|
69
|
-
return he(pe({}, this.converter, r), this.attributes);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
attributes: { value: Object.freeze(g) },
|
|
74
|
-
converter: { value: Object.freeze(o) }
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
var Fe = he(rt, { path: "/" });
|
|
79
|
-
const ut = "Admin-Token";
|
|
80
|
-
function dt(o = ut) {
|
|
81
|
-
return Fe.get(o);
|
|
82
|
-
}
|
|
83
|
-
const Le = (o, g) => {
|
|
84
|
-
const B = o.__vccOpts || o;
|
|
85
|
-
for (const [l, r] of g)
|
|
86
|
-
B[l] = r;
|
|
87
|
-
return B;
|
|
88
|
-
}, ct = { class: "qy-upload__hint" }, pt = ["src"], ft = {
|
|
89
|
-
key: 1,
|
|
90
|
-
class: "qy-upload__tip"
|
|
91
|
-
}, mt = { class: "error" }, vt = { class: "error" }, gt = {
|
|
92
|
-
__name: "index",
|
|
93
|
-
props: {
|
|
94
|
-
/**
|
|
95
|
-
* 初始值,结构为 { files: '逗号分隔的URL', text: '文字内容' }
|
|
96
|
-
* 非受控模式,仅初始化时读取一次
|
|
97
|
-
*/
|
|
98
|
-
defaultValue: { type: Object, default: () => ({ files: "", text: "" }) },
|
|
99
|
-
/** 是否多选 */
|
|
100
|
-
multiple: { type: Boolean, default: !0 },
|
|
101
|
-
/** 是否禁用 */
|
|
102
|
-
disabled: { type: Boolean, default: !1 },
|
|
103
|
-
/** 允许的文件类型后缀(如 ['jpg', 'mp4']) */
|
|
104
|
-
fileType: { type: Array, default: () => [] },
|
|
105
|
-
/** 单个文件大小限制(MB) */
|
|
106
|
-
fileSize: { type: Number, default: 10 },
|
|
107
|
-
/** 文件数量限制 */
|
|
108
|
-
limit: { type: Number, default: 9 },
|
|
109
|
-
/** 是否显示格式/大小提示 */
|
|
110
|
-
isShowTip: { type: Boolean, default: !1 },
|
|
111
|
-
/** 接口路径 */
|
|
112
|
-
api: { type: String, default: "/permission-api/common/uploads" },
|
|
113
|
-
/** FormData 中文件字段名 */
|
|
114
|
-
name: { type: String, default: "file" },
|
|
115
|
-
tokenKey: { type: String, default: "Admin-Token" },
|
|
116
|
-
/** 是否支持视频模式(强制 limit=1) */
|
|
117
|
-
supportVideo: { type: Boolean, default: !1 },
|
|
118
|
-
/**
|
|
119
|
-
* 卡片尺寸
|
|
120
|
-
* 预设:'large'(160px) | 'default'(140px) | 'small'(80px)
|
|
121
|
-
* 自定义:任意 CSS 单位,如 '60px'、'8vw'
|
|
122
|
-
*/
|
|
123
|
-
size: { type: String, default: "default" },
|
|
124
|
-
/** 禁用拖拽(默认在触发区开启) */
|
|
125
|
-
disableDrag: { type: Boolean, default: !1 },
|
|
126
|
-
/** 成功回调(用于复杂业务联动) */
|
|
127
|
-
callBack: { type: Function, default: null },
|
|
128
|
-
/** 上传时附加的额外 FormData 字段 */
|
|
129
|
-
extraData: { type: Object, default: () => ({}) }
|
|
130
|
-
},
|
|
131
|
-
emits: ["change", "success", "error", "remove"],
|
|
132
|
-
setup(o, { expose: g, emit: B }) {
|
|
133
|
-
const l = o, r = B, z = y(null), n = y([]), x = y(null), f = [], L = y(!1), E = y([]), X = y(0), T = y(!1), Q = y(""), O = y(""), M = /* @__PURE__ */ new Set(), A = y(!1), S = y(""), U = y(!1);
|
|
134
|
-
_e(() => {
|
|
135
|
-
const t = l.defaultValue;
|
|
136
|
-
if (!t) return;
|
|
137
|
-
S.value = t.text ?? "";
|
|
138
|
-
const e = t.files ?? "", d = Array.isArray(e) ? e.filter(Boolean) : String(e).split(",").filter(Boolean);
|
|
139
|
-
d.length && (n.value = d.map((i, p) => ({
|
|
140
|
-
name: i.split("/").pop() || `file-${p}`,
|
|
141
|
-
url: i,
|
|
142
|
-
status: "success",
|
|
143
|
-
uid: Date.now() + p
|
|
144
|
-
})));
|
|
145
|
-
});
|
|
146
|
-
const a = F(() => ({ large: "160px", default: "140px", small: "80px" })[l.size] ?? l.size), w = F(() => l.disabled), P = F(
|
|
147
|
-
() => {
|
|
148
|
-
var t;
|
|
149
|
-
return l.isShowTip && (l.fileSize || ((t = k.value) == null ? void 0 : t.length));
|
|
150
|
-
}
|
|
151
|
-
), k = F(() => {
|
|
152
|
-
var t;
|
|
153
|
-
return (t = l.fileType) != null && t.length ? l.fileType.map((e) => e.toLowerCase()) : l.supportVideo ? ["mp4", "mov", "avi"] : ["jpg", "jpeg", "png", "gif", "webp"];
|
|
154
|
-
}), j = F(() => {
|
|
155
|
-
const t = l.supportVideo ? 1 : l.limit;
|
|
156
|
-
return n.value.length >= t;
|
|
157
|
-
}), W = F(
|
|
158
|
-
() => k.value.map((t) => `.${t}`).join(",")
|
|
159
|
-
), ee = F(() => ({
|
|
160
|
-
"qy-upload--reached-limit": j.value,
|
|
161
|
-
"qy-upload--disabled": l.disabled,
|
|
162
|
-
"qy-upload--video": l.supportVideo
|
|
163
|
-
}));
|
|
164
|
-
ve(S, () => m());
|
|
165
|
-
function ae() {
|
|
166
|
-
var t;
|
|
167
|
-
(t = x.value) == null || t.focus();
|
|
168
|
-
}
|
|
169
|
-
function m(t) {
|
|
170
|
-
const i = { files: (t ?? n.value).filter((p) => p.status === "success" && p.url).map((p) => p.url), text: S.value };
|
|
171
|
-
r("change", i), l.callBack && l.callBack(i);
|
|
172
|
-
}
|
|
173
|
-
function K(t, e) {
|
|
174
|
-
m(e);
|
|
175
|
-
}
|
|
176
|
-
function ue(t) {
|
|
177
|
-
var i;
|
|
178
|
-
if (!(t.size / 1024 / 1024 < l.fileSize))
|
|
179
|
-
return N.warning(`文件大小不能超过${l.fileSize}M`), !1;
|
|
180
|
-
const d = ((i = t.name.split(".").pop()) == null ? void 0 : i.toLowerCase()) || "";
|
|
181
|
-
return k.value.includes(d) ? !0 : (N.warning(
|
|
182
|
-
`格式不支持,仅允许: ${k.value.join("/")}`
|
|
183
|
-
), !1);
|
|
184
|
-
}
|
|
185
|
-
function ne(t, e, d, i) {
|
|
186
|
-
var ke, Ce;
|
|
187
|
-
const p = l.api.startsWith("http") ? l.api : window.location.origin + l.api.replace(/^([^/])/, "/$1"), C = new FormData();
|
|
188
|
-
C.append(l.name, t), l.extraData && Object.entries(l.extraData).forEach(([_, Te]) => C.append(_, Te));
|
|
189
|
-
const v = new XMLHttpRequest();
|
|
190
|
-
f.push(v);
|
|
191
|
-
const Y = ((ke = z.value) == null ? void 0 : ke.$el.querySelector(".el-upload--picture-card")) || ((Ce = z.value) == null ? void 0 : Ce.$el), ce = tt.service({
|
|
192
|
-
target: Y,
|
|
193
|
-
text: "上传中",
|
|
194
|
-
background: "rgba(255,255,255,0.7)"
|
|
195
|
-
}), R = () => {
|
|
196
|
-
const _ = f.indexOf(v);
|
|
197
|
-
_ !== -1 && f.splice(_, 1), ce.close();
|
|
198
|
-
};
|
|
199
|
-
v.open("POST", p);
|
|
200
|
-
const be = dt(l.tokenKey);
|
|
201
|
-
be && v.setRequestHeader("Authorization", `Bearer ${be}`), v.upload.onprogress = (_) => {
|
|
202
|
-
_.total > 0 && (e == null || e({ percent: _.loaded / _.total * 100 }));
|
|
203
|
-
}, v.onload = () => {
|
|
204
|
-
if (R(), v.status < 200 || v.status >= 300) {
|
|
205
|
-
const _ = `上传失败 (HTTP ${v.status})`;
|
|
206
|
-
N.error(_), r("error", { msg: _, status: v.status }), i == null || i(new Error(_));
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
try {
|
|
210
|
-
const _ = JSON.parse(v.responseText);
|
|
211
|
-
_.code === 200 && _.urls ? (N.success("上传成功"), d == null || d({ ..._, url: _.urls })) : (N.error(_.msg || "上传失败"), r("error", _), i == null || i(_));
|
|
212
|
-
} catch {
|
|
213
|
-
N.error("上传失败,响应格式错误"), r("error", new Error("Response parse error")), i == null || i(new Error("Response parse error"));
|
|
214
|
-
}
|
|
215
|
-
}, v.onerror = () => {
|
|
216
|
-
R(), N.error("上传失败,网络异常"), r("error", new Error("Network error")), i == null || i(new Error("Network error"));
|
|
217
|
-
}, v.send(C);
|
|
218
|
-
}
|
|
219
|
-
function J(t) {
|
|
220
|
-
return l.disabled ? !1 : ue(t);
|
|
221
|
-
}
|
|
222
|
-
function de(t) {
|
|
223
|
-
ne(
|
|
224
|
-
t.file,
|
|
225
|
-
t.onProgress,
|
|
226
|
-
(e) => {
|
|
227
|
-
t.onSuccess(e), m(), r("success", e);
|
|
228
|
-
},
|
|
229
|
-
(e) => t.onError(e)
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
function c(t) {
|
|
233
|
-
var i;
|
|
234
|
-
if (!t.url) return;
|
|
235
|
-
const e = ((i = t.url.split(".").pop()) == null ? void 0 : i.toLowerCase()) || "";
|
|
236
|
-
if (["mp4", "mov", "avi", "webm"].includes(e)) {
|
|
237
|
-
Q.value = t.url, O.value = t.name || "视频预览", T.value = !0;
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const d = n.value.filter(
|
|
241
|
-
(p) => {
|
|
242
|
-
var C;
|
|
243
|
-
return p.status === "success" && p.url && !["mp4", "mov", "avi", "webm"].includes(
|
|
244
|
-
(C = p.url.split(".").pop()) == null ? void 0 : C.toLowerCase()
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
E.value = d.map((p) => p.url), X.value = d.findIndex((p) => p.uid === t.uid) || 0, L.value = !0;
|
|
249
|
-
}
|
|
250
|
-
function u() {
|
|
251
|
-
L.value = !1, E.value = [];
|
|
252
|
-
}
|
|
253
|
-
function H(t) {
|
|
254
|
-
for (let e = 0; e < t.length; e++) {
|
|
255
|
-
const d = t[e];
|
|
256
|
-
if (!J(d)) continue;
|
|
257
|
-
const i = Date.now() + e, p = URL.createObjectURL(d);
|
|
258
|
-
M.add(p), n.value.push({
|
|
259
|
-
uid: i,
|
|
260
|
-
name: d.name || `file-${i}`,
|
|
261
|
-
status: "uploading",
|
|
262
|
-
percentage: 0,
|
|
263
|
-
url: p
|
|
264
|
-
}), ne(
|
|
265
|
-
d,
|
|
266
|
-
(C) => {
|
|
267
|
-
const v = n.value.find((Y) => Y.uid === i);
|
|
268
|
-
v && (v.percentage = C.percent);
|
|
269
|
-
},
|
|
270
|
-
(C) => {
|
|
271
|
-
const v = n.value.find((Y) => Y.uid === i);
|
|
272
|
-
v && (v.status = "success", v.url = C.url, m(), r("success", C));
|
|
273
|
-
},
|
|
274
|
-
() => le(i)
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function Z(t) {
|
|
279
|
-
var i;
|
|
280
|
-
if (l.disabled) return;
|
|
281
|
-
const e = (i = t.clipboardData) == null ? void 0 : i.items;
|
|
282
|
-
if (!e) return;
|
|
283
|
-
const d = [];
|
|
284
|
-
for (let p = 0; p < e.length; p++) {
|
|
285
|
-
const C = e[p];
|
|
286
|
-
if (C.kind === "file" && C.type.startsWith("image/")) {
|
|
287
|
-
const v = C.getAsFile();
|
|
288
|
-
v && d.push(v);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
d.length && (t.preventDefault(), H(d));
|
|
292
|
-
}
|
|
293
|
-
function te(t) {
|
|
294
|
-
var d;
|
|
295
|
-
if (A.value = !1, l.disabled || j.value) return;
|
|
296
|
-
const e = Array.from(((d = t.dataTransfer) == null ? void 0 : d.files) || []).filter(
|
|
297
|
-
(i) => {
|
|
298
|
-
var p;
|
|
299
|
-
return k.value.includes((p = i.name.split(".").pop()) == null ? void 0 : p.toLowerCase());
|
|
300
|
-
}
|
|
301
|
-
);
|
|
302
|
-
e.length && H(e);
|
|
303
|
-
}
|
|
304
|
-
function le(t) {
|
|
305
|
-
var d;
|
|
306
|
-
const e = n.value.findIndex((i) => i.uid === t);
|
|
307
|
-
e !== -1 && ((d = n.value[e].url) != null && d.startsWith("blob:") && (URL.revokeObjectURL(n.value[e].url), M.delete(n.value[e].url)), n.value.splice(e, 1));
|
|
308
|
-
}
|
|
309
|
-
return Ze(() => {
|
|
310
|
-
f.forEach((t) => t.abort()), f.length = 0, M.forEach((t) => URL.revokeObjectURL(t)), M.clear();
|
|
311
|
-
}), g({
|
|
312
|
-
openFileDialog: () => {
|
|
313
|
-
var t, e;
|
|
314
|
-
l.disabled || j.value || (e = (t = z.value) == null ? void 0 : t.$el.querySelector('input[type="file"]')) == null || e.click();
|
|
315
|
-
},
|
|
316
|
-
getPathList: () => n.value.filter((t) => t.status === "success").map((t) => t.url),
|
|
317
|
-
clearFiles: () => {
|
|
318
|
-
n.value = [], S.value = "", m();
|
|
319
|
-
},
|
|
320
|
-
getValue: () => ({
|
|
321
|
-
files: n.value.filter((t) => t.status === "success" && t.url).map((t) => t.url),
|
|
322
|
-
text: S.value
|
|
323
|
-
})
|
|
324
|
-
}), (t, e) => {
|
|
325
|
-
var ce;
|
|
326
|
-
const d = Ie, i = Pe, p = Oe, C = je, v = He, Y = Be;
|
|
327
|
-
return h(), b("div", {
|
|
328
|
-
class: oe(["qy-upload", ee.value]),
|
|
329
|
-
style: re({ "--qy-upload-size": a.value })
|
|
330
|
-
}, [
|
|
331
|
-
q(C, {
|
|
332
|
-
ref_key: "uploadRef",
|
|
333
|
-
ref: z,
|
|
334
|
-
"file-list": n.value,
|
|
335
|
-
"onUpdate:fileList": e[6] || (e[6] = (R) => n.value = R),
|
|
336
|
-
action: "#",
|
|
337
|
-
multiple: o.supportVideo ? !1 : o.multiple,
|
|
338
|
-
limit: o.supportVideo ? 1 : o.limit,
|
|
339
|
-
"list-type": o.supportVideo ? "text" : "picture-card",
|
|
340
|
-
accept: W.value,
|
|
341
|
-
disabled: w.value,
|
|
342
|
-
"http-request": de,
|
|
343
|
-
"before-upload": J,
|
|
344
|
-
"on-preview": c,
|
|
345
|
-
"on-remove": K
|
|
346
|
-
}, {
|
|
347
|
-
default: I(() => [
|
|
348
|
-
j.value ? V("", !0) : (h(), b("div", {
|
|
349
|
-
key: 0,
|
|
350
|
-
class: oe(["qy-upload__trigger", { "is-dragover": A.value }]),
|
|
351
|
-
onPaste: Z,
|
|
352
|
-
onDragover: e[4] || (e[4] = $((R) => A.value = !0, ["prevent"])),
|
|
353
|
-
onDragleave: e[5] || (e[5] = $((R) => A.value = !1, ["prevent"])),
|
|
354
|
-
onDrop: $(te, ["prevent"])
|
|
355
|
-
}, [
|
|
356
|
-
q(d, { class: "qy-upload__icon" }, {
|
|
357
|
-
default: I(() => [
|
|
358
|
-
q(D(Ge))
|
|
359
|
-
]),
|
|
360
|
-
_: 1
|
|
361
|
-
}),
|
|
362
|
-
o.supportVideo ? (h(), b(fe, { key: 0 }, [
|
|
363
|
-
e[9] || (e[9] = s("span", { class: "qy-upload__label" }, "点击上传视频", -1)),
|
|
364
|
-
s("span", ct, "支持 " + G(k.value.join(" / ")) + ",不超过 " + G(o.fileSize) + "MB", 1)
|
|
365
|
-
], 64)) : V("", !0),
|
|
366
|
-
s("div", {
|
|
367
|
-
class: "qy-upload__text",
|
|
368
|
-
onClick: e[3] || (e[3] = $(() => {
|
|
369
|
-
}, ["stop"])),
|
|
370
|
-
onPaste: $(Z, ["stop"])
|
|
371
|
-
}, [
|
|
372
|
-
q(p, {
|
|
373
|
-
visible: U.value,
|
|
374
|
-
"onUpdate:visible": e[2] || (e[2] = (R) => U.value = R),
|
|
375
|
-
placement: "bottom-start",
|
|
376
|
-
width: 220,
|
|
377
|
-
trigger: "click",
|
|
378
|
-
"popper-class": "qy-upload__text-popover",
|
|
379
|
-
onAfterEnter: ae
|
|
380
|
-
}, {
|
|
381
|
-
reference: I(() => [
|
|
382
|
-
s("div", {
|
|
383
|
-
class: oe(["qy-upload__text-preview", { "is-placeholder": !S.value }])
|
|
384
|
-
}, G(S.value || "输入文字"), 3)
|
|
385
|
-
]),
|
|
386
|
-
default: I(() => [
|
|
387
|
-
q(i, {
|
|
388
|
-
ref_key: "inputRef",
|
|
389
|
-
ref: x,
|
|
390
|
-
modelValue: S.value,
|
|
391
|
-
"onUpdate:modelValue": e[0] || (e[0] = (R) => S.value = R),
|
|
392
|
-
type: "textarea",
|
|
393
|
-
autosize: { minRows: 2, maxRows: 5 },
|
|
394
|
-
placeholder: "输入文字或粘贴图片",
|
|
395
|
-
disabled: o.disabled,
|
|
396
|
-
onBlur: e[1] || (e[1] = (R) => U.value = !1),
|
|
397
|
-
onPaste: $(Z, ["stop"])
|
|
398
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
399
|
-
]),
|
|
400
|
-
_: 1
|
|
401
|
-
}, 8, ["visible"])
|
|
402
|
-
], 32)
|
|
403
|
-
], 34))
|
|
404
|
-
]),
|
|
405
|
-
_: 1
|
|
406
|
-
}, 8, ["file-list", "multiple", "limit", "list-type", "accept", "disabled"]),
|
|
407
|
-
L.value ? (h(), ge(v, {
|
|
408
|
-
key: 0,
|
|
409
|
-
"url-list": E.value,
|
|
410
|
-
"initial-index": X.value,
|
|
411
|
-
onClose: u
|
|
412
|
-
}, null, 8, ["url-list", "initial-index"])) : V("", !0),
|
|
413
|
-
q(Y, {
|
|
414
|
-
modelValue: T.value,
|
|
415
|
-
"onUpdate:modelValue": e[7] || (e[7] = (R) => T.value = R),
|
|
416
|
-
title: O.value,
|
|
417
|
-
width: "640px",
|
|
418
|
-
"append-to-body": "",
|
|
419
|
-
"destroy-on-close": "",
|
|
420
|
-
onClose: e[8] || (e[8] = (R) => T.value = !1)
|
|
421
|
-
}, {
|
|
422
|
-
default: I(() => [
|
|
423
|
-
T.value ? (h(), b("video", {
|
|
424
|
-
key: 0,
|
|
425
|
-
src: Q.value,
|
|
426
|
-
controls: "",
|
|
427
|
-
autoplay: "",
|
|
428
|
-
style: { width: "100%", "max-height": "400px", "border-radius": "4px" }
|
|
429
|
-
}, null, 8, pt)) : V("", !0)
|
|
430
|
-
]),
|
|
431
|
-
_: 1
|
|
432
|
-
}, 8, ["modelValue", "title"]),
|
|
433
|
-
P.value ? (h(), b("div", ft, [
|
|
434
|
-
q(d, null, {
|
|
435
|
-
default: I(() => [
|
|
436
|
-
q(D(et))
|
|
437
|
-
]),
|
|
438
|
-
_: 1
|
|
439
|
-
}),
|
|
440
|
-
s("span", null, [
|
|
441
|
-
e[12] || (e[12] = se(" 请上传 ", -1)),
|
|
442
|
-
o.fileSize ? (h(), b(fe, { key: 0 }, [
|
|
443
|
-
e[10] || (e[10] = se("大小不超过 ", -1)),
|
|
444
|
-
s("b", mt, G(o.fileSize) + "MB", 1)
|
|
445
|
-
], 64)) : V("", !0),
|
|
446
|
-
(ce = k.value) != null && ce.length ? (h(), b(fe, { key: 1 }, [
|
|
447
|
-
e[11] || (e[11] = se(",格式为 ", -1)),
|
|
448
|
-
s("b", vt, G(k.value.join("/")), 1)
|
|
449
|
-
], 64)) : V("", !0),
|
|
450
|
-
e[13] || (e[13] = se(" 的文件。 ", -1))
|
|
451
|
-
])
|
|
452
|
-
])) : V("", !0)
|
|
453
|
-
], 6);
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
}, Ae = /* @__PURE__ */ Le(gt, [["__scopeId", "data-v-12bbc6cc"]]), yt = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, ht = { key: 0 }, wt = { key: 1 }, xt = {
|
|
457
|
-
key: 0,
|
|
458
|
-
class: "icon-[material-symbols--square-outline-rounded]",
|
|
459
|
-
role: "img",
|
|
460
|
-
"aria-hidden": "true"
|
|
461
|
-
}, _t = {
|
|
462
|
-
key: 1,
|
|
463
|
-
class: "icon-[tdesign--fullscreen-exit-1]",
|
|
464
|
-
role: "img",
|
|
465
|
-
"aria-hidden": "true"
|
|
466
|
-
}, bt = {
|
|
467
|
-
key: 0,
|
|
468
|
-
class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
|
|
469
|
-
}, kt = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, Ct = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, qt = { class: "flex items-center gap-2" }, zt = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, St = { class: "flex items-center gap-2" }, Se = 5, me = 2e3, we = Ue({
|
|
470
|
-
__name: "index",
|
|
471
|
-
props: /* @__PURE__ */ qe({
|
|
472
|
-
layout: { type: [Array, String, Boolean], default: () => ["confirm", "cancel"] },
|
|
473
|
-
fullscreen: { type: Boolean, default: !1 },
|
|
474
|
-
showFullscreen: { type: Boolean, default: !1 },
|
|
475
|
-
confirmProps: { default: () => ({}) },
|
|
476
|
-
size: { default: "default" },
|
|
477
|
-
zIndex: { default: 2e3 }
|
|
478
|
-
}, {
|
|
479
|
-
modelValue: { default: !0 },
|
|
480
|
-
modelModifiers: {}
|
|
481
|
-
}),
|
|
482
|
-
emits: /* @__PURE__ */ qe(["confirm", "cancel", "close", "opened", "ok"], ["update:modelValue"]),
|
|
483
|
-
setup(o, { expose: g, emit: B }) {
|
|
484
|
-
const l = o, r = Ne(), z = y(!0), n = y(!1), x = y(me), L = it({
|
|
485
|
-
mobile: 0,
|
|
486
|
-
tablet: 640,
|
|
487
|
-
laptop: 1024,
|
|
488
|
-
desktop: 1280
|
|
489
|
-
}).isSmaller("tablet"), E = F(() => {
|
|
490
|
-
if (Array.isArray(l.layout)) return l.layout;
|
|
491
|
-
if (typeof l.layout == "string")
|
|
492
|
-
return l.layout.split(",").map((c) => c.trim());
|
|
493
|
-
}), X = F(() => ({
|
|
494
|
-
CancelButton: q(ne),
|
|
495
|
-
ConfirmButton: q(ue)
|
|
496
|
-
})), T = F(() => r.footer || l.layout !== !1), Q = y(!1), O = y(
|
|
497
|
-
l.showFullscreen && L ? !0 : l.fullscreen
|
|
498
|
-
), M = B, A = We(o, "modelValue");
|
|
499
|
-
Xe(() => {
|
|
500
|
-
A.value && (Q.value = !1);
|
|
501
|
-
}), g({});
|
|
502
|
-
const S = Re(), U = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, a = y(!1), w = y(null);
|
|
503
|
-
window.minimizedCount || (window.minimizedCount = 0);
|
|
504
|
-
const { x: P, y: k } = st(w, {
|
|
505
|
-
initialValue: {
|
|
506
|
-
x: 5,
|
|
507
|
-
y: window.innerHeight - 100 - (window.minimizedCount || 0) * 60
|
|
508
|
-
},
|
|
509
|
-
onMove(c) {
|
|
510
|
-
var u;
|
|
511
|
-
(u = w.value) == null || u.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), P.value = Math.max(
|
|
512
|
-
0,
|
|
513
|
-
Math.min(window.innerWidth - 300, c.x)
|
|
514
|
-
), k.value = Math.max(
|
|
515
|
-
0,
|
|
516
|
-
Math.min(window.innerHeight - 50, c.y)
|
|
517
|
-
);
|
|
518
|
-
},
|
|
519
|
-
onEnd() {
|
|
520
|
-
var c;
|
|
521
|
-
(c = w.value) == null || c.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
|
|
522
|
-
}
|
|
523
|
-
}), j = F(() => ({
|
|
524
|
-
transform: `translate(${P.value}px, ${k.value}px)`,
|
|
525
|
-
willChange: "transform"
|
|
526
|
-
}));
|
|
527
|
-
function W(c) {
|
|
528
|
-
const u = c.target, { scrollTop: H, scrollHeight: Z, clientHeight: te } = u;
|
|
529
|
-
z.value = H <= Se, n.value = Z - (H + te) <= Se;
|
|
530
|
-
}
|
|
531
|
-
function ee() {
|
|
532
|
-
document.querySelector(`.${U}.el-dialog`).addEventListener("scroll", W), J(), M("opened");
|
|
533
|
-
}
|
|
534
|
-
function ae() {
|
|
535
|
-
O.value = !O.value, J();
|
|
536
|
-
}
|
|
537
|
-
function m() {
|
|
538
|
-
Q.value || (Q.value = !0, a.value = !1, A.value = !1, M("cancel"), M("close"));
|
|
539
|
-
}
|
|
540
|
-
function K(c) {
|
|
541
|
-
l.showFullscreen && c.detail >= 2 && ae();
|
|
542
|
-
}
|
|
543
|
-
function ue() {
|
|
544
|
-
return ze(
|
|
545
|
-
ye,
|
|
546
|
-
{
|
|
547
|
-
...D(l.confirmProps),
|
|
548
|
-
type: "primary",
|
|
549
|
-
class: "dialog__footerBtn",
|
|
550
|
-
onClick: () => {
|
|
551
|
-
M("confirm"), M("ok");
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
() => D(l.confirmProps).title || "确 认"
|
|
555
|
-
);
|
|
556
|
-
}
|
|
557
|
-
function ne() {
|
|
558
|
-
return ze(
|
|
559
|
-
ye,
|
|
560
|
-
{ class: "dialog__footerBtn", onClick: () => m() },
|
|
561
|
-
() => "取 消"
|
|
562
|
-
);
|
|
563
|
-
}
|
|
564
|
-
_e(() => {
|
|
565
|
-
typeof window.qyDialogMaxZIndex > "u" && (window.qyDialogMaxZIndex = me), J();
|
|
566
|
-
});
|
|
567
|
-
function J() {
|
|
568
|
-
var t;
|
|
569
|
-
const c = Array.from(
|
|
570
|
-
document.querySelectorAll(".el-overlay")
|
|
571
|
-
).filter((e) => window.getComputedStyle(e).display !== "none" && !e.classList.contains("is-message")), u = (t = document.querySelector(`.${U}`)) == null ? void 0 : t.closest(".el-overlay"), H = document.querySelector(
|
|
572
|
-
`.${U}.el-dialog`
|
|
573
|
-
);
|
|
574
|
-
if (!u || !H) return;
|
|
575
|
-
const Z = me;
|
|
576
|
-
window.qyDialogMaxZIndex = window.qyDialogMaxZIndex || Z;
|
|
577
|
-
const le = Math.max(
|
|
578
|
-
window.qyDialogMaxZIndex,
|
|
579
|
-
...c.map(
|
|
580
|
-
(e) => parseInt(window.getComputedStyle(e).zIndex || Z.toString())
|
|
581
|
-
)
|
|
582
|
-
) + 2;
|
|
583
|
-
window.qyDialogMaxZIndex = le, Ve(() => {
|
|
584
|
-
u.style.zIndex = le.toString(), H.style.zIndex = (le + 1).toString(), x.value = le + 1;
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
Ee(() => {
|
|
588
|
-
const c = document.querySelector(
|
|
589
|
-
`.${U} .qy-dialog__wrapper-container`
|
|
590
|
-
);
|
|
591
|
-
c && c.removeEventListener("scroll", W), a.value && window.minimizedCount--;
|
|
592
|
-
});
|
|
593
|
-
function de() {
|
|
594
|
-
var u;
|
|
595
|
-
a.value = !a.value;
|
|
596
|
-
const c = (u = document.querySelector(`.${U}`)) == null ? void 0 : u.closest(".el-overlay");
|
|
597
|
-
a.value ? (c.style.display = "none", window.minimizedCount++, k.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (c.style.display = "block", window.minimizedCount--, J());
|
|
598
|
-
}
|
|
599
|
-
return (c, u) => {
|
|
600
|
-
const H = Qe("Close"), Z = Ie, te = Be;
|
|
601
|
-
return h(), b("div", null, [
|
|
602
|
-
q(te, Me({
|
|
603
|
-
ref: "dialogRef",
|
|
604
|
-
class: ["qy-dialog", [
|
|
605
|
-
l.size === "small" && "[&_.el-dialog__header]:!hidden",
|
|
606
|
-
U
|
|
607
|
-
]],
|
|
608
|
-
"model-value": A.value,
|
|
609
|
-
"align-center": "",
|
|
610
|
-
"append-to-body": "",
|
|
611
|
-
style: {
|
|
612
|
-
"--el-dialog-padding-primary": 0
|
|
613
|
-
},
|
|
614
|
-
"show-close": !1,
|
|
615
|
-
fullscreen: O.value,
|
|
616
|
-
"z-index": x.value,
|
|
617
|
-
onClosed: m,
|
|
618
|
-
onOpened: ee,
|
|
619
|
-
draggable: ""
|
|
620
|
-
}, D(S)), Je({
|
|
621
|
-
header: I(() => [
|
|
622
|
-
l.size === "default" ? (h(), b("div", {
|
|
623
|
-
key: 0,
|
|
624
|
-
style: re({
|
|
625
|
-
borderBottom: "1px solid",
|
|
626
|
-
borderColor: z.value ? "transparent" : "var(--block-outline-color)",
|
|
627
|
-
transition: "border-color .2s linear"
|
|
628
|
-
}),
|
|
629
|
-
class: "flex justify-between h-[var(--header-height)]",
|
|
630
|
-
onDblclick: K
|
|
631
|
-
}, [
|
|
632
|
-
s("div", yt, [
|
|
633
|
-
D(r).header ? D(r).header ? (h(), b("div", wt, [
|
|
634
|
-
ie(c.$slots, "header")
|
|
635
|
-
])) : V("", !0) : (h(), b("span", ht, G(D(S).title), 1))
|
|
636
|
-
]),
|
|
637
|
-
s("div", {
|
|
638
|
-
class: "flex",
|
|
639
|
-
onMousedown: u[3] || (u[3] = $(() => {
|
|
640
|
-
}, ["stop"]))
|
|
641
|
-
}, [
|
|
642
|
-
l.size === "default" ? (h(), b("div", {
|
|
643
|
-
key: 0,
|
|
644
|
-
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
645
|
-
onClick: $(de, ["stop"]),
|
|
646
|
-
onMousedown: u[0] || (u[0] = $(() => {
|
|
647
|
-
}, ["stop"]))
|
|
648
|
-
}, u[4] || (u[4] = [
|
|
649
|
-
s("span", {
|
|
650
|
-
class: "icon-[material-symbols--minimize] text-xl mb-3",
|
|
651
|
-
role: "img",
|
|
652
|
-
"aria-hidden": "true"
|
|
653
|
-
}, null, -1)
|
|
654
|
-
]), 32)) : V("", !0),
|
|
655
|
-
l.showFullscreen ? (h(), b("div", {
|
|
656
|
-
key: 1,
|
|
657
|
-
class: "qy-dialog__btn qy-dialog__btn--default",
|
|
658
|
-
onClick: $(ae, ["stop"]),
|
|
659
|
-
onMousedown: u[1] || (u[1] = $(() => {
|
|
660
|
-
}, ["stop"]))
|
|
661
|
-
}, [
|
|
662
|
-
O.value ? (h(), b("span", _t)) : (h(), b("span", xt))
|
|
663
|
-
], 32)) : V("", !0),
|
|
664
|
-
s("div", {
|
|
665
|
-
class: "qy-dialog__btn qy-dialog__btn--danger",
|
|
666
|
-
onClick: $(m, ["stop"]),
|
|
667
|
-
onMousedown: u[2] || (u[2] = $(() => {
|
|
668
|
-
}, ["stop"]))
|
|
669
|
-
}, u[5] || (u[5] = [
|
|
670
|
-
s("span", {
|
|
671
|
-
class: "icon-[ri--close-line] text-xl",
|
|
672
|
-
role: "img",
|
|
673
|
-
"aria-hidden": "true"
|
|
674
|
-
}, null, -1)
|
|
675
|
-
]), 32)
|
|
676
|
-
], 32)
|
|
677
|
-
], 36)) : V("", !0)
|
|
678
|
-
]),
|
|
679
|
-
default: I(() => [
|
|
680
|
-
s("div", {
|
|
681
|
-
class: oe(["qy-dialog__wrapper", D(nt)(O.value && "qy-dialog__wrapper--fullscreen")]),
|
|
682
|
-
style: re({
|
|
683
|
-
maxHeight: T.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
|
|
684
|
-
padding: l.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
|
|
685
|
-
})
|
|
686
|
-
}, [
|
|
687
|
-
l.size === "small" ? (h(), b("div", bt, [
|
|
688
|
-
q(Z, {
|
|
689
|
-
size: 36,
|
|
690
|
-
class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
|
|
691
|
-
onClick: m
|
|
692
|
-
}, {
|
|
693
|
-
default: I(() => [
|
|
694
|
-
q(H)
|
|
695
|
-
]),
|
|
696
|
-
_: 1
|
|
697
|
-
})
|
|
698
|
-
])) : V("", !0),
|
|
699
|
-
ie(c.$slots, "default")
|
|
700
|
-
], 6)
|
|
701
|
-
]),
|
|
702
|
-
_: 2
|
|
703
|
-
}, [
|
|
704
|
-
!c.$slots.footer && Array.isArray(E.value) ? {
|
|
705
|
-
name: "footer",
|
|
706
|
-
fn: I(() => [
|
|
707
|
-
s("div", kt, [
|
|
708
|
-
s("div", null, [
|
|
709
|
-
ie(c.$slots, "footer-left")
|
|
710
|
-
]),
|
|
711
|
-
s("div", {
|
|
712
|
-
class: oe([{
|
|
713
|
-
"qy-dialog__footer--outline": n.value
|
|
714
|
-
}, "qy-dialog__footer flex items-center justify-end"])
|
|
715
|
-
}, [
|
|
716
|
-
E.value.includes("cancel") ? (h(), ge(ne, { key: 0 })) : V("", !0),
|
|
717
|
-
E.value.includes("confirm") ? (h(), ge(ue, { key: 1 })) : V("", !0),
|
|
718
|
-
ie(c.$slots, "footer-append")
|
|
719
|
-
], 2)
|
|
720
|
-
])
|
|
721
|
-
]),
|
|
722
|
-
key: "0"
|
|
723
|
-
} : T.value ? {
|
|
724
|
-
name: "footer",
|
|
725
|
-
fn: I(() => [
|
|
726
|
-
s("div", {
|
|
727
|
-
class: oe([{
|
|
728
|
-
"qy-dialog__footer--outline": n.value
|
|
729
|
-
}, "qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])
|
|
730
|
-
}, [
|
|
731
|
-
ie(c.$slots, "footer", {
|
|
732
|
-
layouts: X.value,
|
|
733
|
-
layoutsNode: Object.values(X.value)
|
|
734
|
-
})
|
|
735
|
-
], 2)
|
|
736
|
-
]),
|
|
737
|
-
key: "1"
|
|
738
|
-
} : void 0
|
|
739
|
-
]), 1040, ["class", "model-value", "fullscreen", "z-index"]),
|
|
740
|
-
Ke(s("div", {
|
|
741
|
-
ref_key: "minimizedRef",
|
|
742
|
-
ref: w,
|
|
743
|
-
class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
|
|
744
|
-
style: re([j.value, { width: "300px", height: "50px", "will-change": "transform" }])
|
|
745
|
-
}, [
|
|
746
|
-
s("div", Ct, [
|
|
747
|
-
s("div", qt, [
|
|
748
|
-
u[6] || (u[6] = s("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
|
|
749
|
-
s("span", zt, G(D(S).title), 1)
|
|
750
|
-
]),
|
|
751
|
-
s("div", St, [
|
|
752
|
-
s("div", {
|
|
753
|
-
class: "p-1 hover:bg-gray-200 rounded",
|
|
754
|
-
onClick: $(de, ["stop"])
|
|
755
|
-
}, u[7] || (u[7] = [
|
|
756
|
-
s("div", { class: "icon-[mdi--window-maximize] text-gray-600" }, null, -1)
|
|
757
|
-
])),
|
|
758
|
-
s("div", {
|
|
759
|
-
class: "p-1 hover:bg-red-100 rounded",
|
|
760
|
-
onClick: $(m, ["stop"])
|
|
761
|
-
}, u[8] || (u[8] = [
|
|
762
|
-
s("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
|
|
763
|
-
]))
|
|
764
|
-
])
|
|
765
|
-
])
|
|
766
|
-
], 4), [
|
|
767
|
-
[Ye, a.value]
|
|
768
|
-
])
|
|
769
|
-
]);
|
|
770
|
-
};
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
function $e(o) {
|
|
774
|
-
const g = o == null ? void 0 : o.match(/(\[url\:(.*?)\])(.*)/);
|
|
775
|
-
return g ? {
|
|
776
|
-
imageUrl: g[2],
|
|
777
|
-
text: g[3]
|
|
778
|
-
} : {
|
|
779
|
-
imageUrl: "",
|
|
780
|
-
text: o || ""
|
|
781
|
-
};
|
|
782
|
-
}
|
|
783
|
-
function $t(o) {
|
|
784
|
-
const g = String(o || "").match(/(\[url\:.*?\])([\s\S]*)/);
|
|
785
|
-
return g ? g[2] : o;
|
|
786
|
-
}
|
|
787
|
-
function De(o, g) {
|
|
788
|
-
return g ? `[url:${g}]${o}` : o;
|
|
789
|
-
}
|
|
790
|
-
const Dt = { class: "qy-remark-image__field" }, It = { class: "qy-remark-image__upload-anchor" }, Bt = {
|
|
791
|
-
key: 0,
|
|
792
|
-
class: "icon-[line-md--loading-twotone-loop]",
|
|
793
|
-
role: "img",
|
|
794
|
-
"aria-hidden": "true"
|
|
795
|
-
}, Ut = {
|
|
796
|
-
key: 1,
|
|
797
|
-
class: "icon-[ion--cloud-upload-outline]",
|
|
798
|
-
role: "img",
|
|
799
|
-
"aria-hidden": "true"
|
|
800
|
-
}, Rt = {
|
|
801
|
-
key: 2,
|
|
802
|
-
class: "icon-[ph--images-thin]",
|
|
803
|
-
role: "img",
|
|
804
|
-
"aria-hidden": "true"
|
|
805
|
-
}, Vt = { class: "qy-remark-image__popover" }, Et = ["src"], Mt = { class: "qy-remark-image__popover-footer" }, Ft = Ue({
|
|
806
|
-
__name: "index",
|
|
807
|
-
props: {
|
|
808
|
-
defaultValue: { default: "" },
|
|
809
|
-
defaultImage: { default: "" },
|
|
810
|
-
rows: { default: 6 },
|
|
811
|
-
width: { default: "" },
|
|
812
|
-
autosize: { type: [Boolean, Object], default: !1 },
|
|
813
|
-
disabled: { type: Boolean, default: !1 },
|
|
814
|
-
placeholder: { default: "粘贴图片上传" },
|
|
815
|
-
type: { default: "textarea" },
|
|
816
|
-
api: { default: "/permission-api/common/uploads" },
|
|
817
|
-
tokenKey: { default: "Admin-Token" }
|
|
818
|
-
},
|
|
819
|
-
emits: ["change"],
|
|
820
|
-
setup(o, { expose: g, emit: B }) {
|
|
821
|
-
const l = o, r = B, z = Re(), n = y(null), x = y(""), f = y(""), L = y(!1), E = F(
|
|
822
|
-
() => l.type === "text" ? "text" : "textarea"
|
|
823
|
-
), X = F(() => {
|
|
824
|
-
if (l.width)
|
|
825
|
-
return {
|
|
826
|
-
width: typeof l.width == "number" ? `${l.width}px` : l.width
|
|
827
|
-
};
|
|
828
|
-
});
|
|
829
|
-
ve(
|
|
830
|
-
() => l.defaultValue,
|
|
831
|
-
(a) => {
|
|
832
|
-
const w = $e(a || "");
|
|
833
|
-
x.value = w.text, f.value = w.imageUrl || l.defaultImage || "";
|
|
834
|
-
},
|
|
835
|
-
{ immediate: !0 }
|
|
836
|
-
), ve(
|
|
837
|
-
() => l.defaultImage,
|
|
838
|
-
(a) => {
|
|
839
|
-
a !== void 0 && !$e(l.defaultValue || "").imageUrl && (f.value = a || "");
|
|
840
|
-
},
|
|
841
|
-
{ immediate: !0 }
|
|
842
|
-
), _e(() => {
|
|
843
|
-
Ve(Q);
|
|
844
|
-
}), Ee(() => {
|
|
845
|
-
const a = T();
|
|
846
|
-
a && a.removeEventListener("paste", A);
|
|
847
|
-
});
|
|
848
|
-
function T() {
|
|
849
|
-
var a, w;
|
|
850
|
-
return ((a = n.value) == null ? void 0 : a.textarea) || ((w = n.value) == null ? void 0 : w.input) || null;
|
|
851
|
-
}
|
|
852
|
-
function Q() {
|
|
853
|
-
const a = T();
|
|
854
|
-
a && (a.removeEventListener("paste", A), a.addEventListener("paste", A));
|
|
855
|
-
}
|
|
856
|
-
function O(a) {
|
|
857
|
-
x.value = $t(a || "");
|
|
858
|
-
}
|
|
859
|
-
function M() {
|
|
860
|
-
f.value = "", U();
|
|
861
|
-
}
|
|
862
|
-
async function A(a) {
|
|
863
|
-
var k;
|
|
864
|
-
const P = Array.from(((k = a.clipboardData) == null ? void 0 : k.files) || []).find((j) => j.type.startsWith("image/"));
|
|
865
|
-
P && (a.preventDefault(), await S({
|
|
866
|
-
file: P,
|
|
867
|
-
onError: () => {
|
|
868
|
-
},
|
|
869
|
-
onProgress: () => {
|
|
870
|
-
},
|
|
871
|
-
onSuccess: () => {
|
|
872
|
-
}
|
|
873
|
-
}));
|
|
874
|
-
}
|
|
875
|
-
async function S(a) {
|
|
876
|
-
var w, P, k, j;
|
|
877
|
-
if (a.file.size > 51200 * 1e3)
|
|
878
|
-
return N.error("图片过大"), !1;
|
|
879
|
-
L.value = !0;
|
|
880
|
-
try {
|
|
881
|
-
const W = new FormData();
|
|
882
|
-
W.append("files", a.file);
|
|
883
|
-
const ee = Fe.get(l.tokenKey), m = await (await fetch(l.api, {
|
|
884
|
-
method: "POST",
|
|
885
|
-
body: W,
|
|
886
|
-
credentials: "include",
|
|
887
|
-
headers: ee ? { Authorization: `Bearer ${ee}` } : void 0
|
|
888
|
-
})).json(), K = (m == null ? void 0 : m.urls) ?? ((w = m == null ? void 0 : m.data) == null ? void 0 : w.urls) ?? ((P = m == null ? void 0 : m.data) == null ? void 0 : P.url) ?? (m == null ? void 0 : m.url) ?? "";
|
|
889
|
-
return f.value = Array.isArray(K) ? K[0] : K, U(), N.success("上传图片成功"), (k = a.onSuccess) == null || k.call(a, m), !0;
|
|
890
|
-
} catch (W) {
|
|
891
|
-
return (j = a.onError) == null || j.call(a, W), N.error("上传失败"), !1;
|
|
892
|
-
} finally {
|
|
893
|
-
L.value = !1;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
function U() {
|
|
897
|
-
r(
|
|
898
|
-
"change",
|
|
899
|
-
De(x.value || "", f.value || ""),
|
|
900
|
-
f.value || ""
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
return g({
|
|
904
|
-
deleteImage: M,
|
|
905
|
-
getValue: () => ({
|
|
906
|
-
text: x.value || "",
|
|
907
|
-
imageUrl: f.value || "",
|
|
908
|
-
value: De(x.value || "", f.value || "")
|
|
909
|
-
})
|
|
910
|
-
}), (a, w) => (h(), b("div", {
|
|
911
|
-
class: "qy-remark-image",
|
|
912
|
-
style: re(X.value)
|
|
913
|
-
}, [
|
|
914
|
-
s("div", Dt, [
|
|
915
|
-
q(D(lt), Me({
|
|
916
|
-
ref_key: "inputRef",
|
|
917
|
-
ref: n,
|
|
918
|
-
"model-value": x.value,
|
|
919
|
-
type: E.value,
|
|
920
|
-
rows: a.rows,
|
|
921
|
-
autosize: a.autosize,
|
|
922
|
-
disabled: a.disabled,
|
|
923
|
-
placeholder: a.placeholder
|
|
924
|
-
}, D(z), {
|
|
925
|
-
"onUpdate:modelValue": O,
|
|
926
|
-
onBlur: U
|
|
927
|
-
}), null, 16, ["model-value", "type", "rows", "autosize", "disabled", "placeholder"]),
|
|
928
|
-
q(D(ot), {
|
|
929
|
-
placement: "top-start",
|
|
930
|
-
width: 400,
|
|
931
|
-
trigger: "hover",
|
|
932
|
-
disabled: !f.value
|
|
933
|
-
}, {
|
|
934
|
-
reference: I(() => [
|
|
935
|
-
s("div", It, [
|
|
936
|
-
q(D(at), {
|
|
937
|
-
disabled: L.value || a.disabled,
|
|
938
|
-
class: "qy-remark-image__upload",
|
|
939
|
-
"show-file-list": !1,
|
|
940
|
-
"http-request": S
|
|
941
|
-
}, {
|
|
942
|
-
default: I(() => [
|
|
943
|
-
L.value ? (h(), b("span", Bt)) : f.value ? (h(), b("span", Rt)) : (h(), b("span", Ut))
|
|
944
|
-
]),
|
|
945
|
-
_: 1
|
|
946
|
-
}, 8, ["disabled"])
|
|
947
|
-
])
|
|
948
|
-
]),
|
|
949
|
-
default: I(() => [
|
|
950
|
-
s("div", Vt, [
|
|
951
|
-
s("img", {
|
|
952
|
-
src: f.value,
|
|
953
|
-
class: "qy-remark-image__preview-img"
|
|
954
|
-
}, null, 8, Et),
|
|
955
|
-
s("div", Mt, [
|
|
956
|
-
w[1] || (w[1] = s("span", { class: "qy-remark-image__popover-tip" }, "再次点击按钮可更换图片", -1)),
|
|
957
|
-
q(D(ye), {
|
|
958
|
-
link: "",
|
|
959
|
-
size: "small",
|
|
960
|
-
type: "danger",
|
|
961
|
-
disabled: a.disabled,
|
|
962
|
-
onClick: M
|
|
963
|
-
}, {
|
|
964
|
-
default: I(() => w[0] || (w[0] = [
|
|
965
|
-
se(" 删除图片 ", -1)
|
|
966
|
-
])),
|
|
967
|
-
_: 1,
|
|
968
|
-
__: [0]
|
|
969
|
-
}, 8, ["disabled"])
|
|
970
|
-
])
|
|
971
|
-
])
|
|
972
|
-
]),
|
|
973
|
-
_: 1
|
|
974
|
-
}, 8, ["disabled"])
|
|
975
|
-
])
|
|
976
|
-
], 4));
|
|
977
|
-
}
|
|
978
|
-
}), xe = /* @__PURE__ */ Le(Ft, [["__scopeId", "data-v-00916fb4"]]), Lt = (o) => {
|
|
979
|
-
o.component("Upload", Ae), o.component("QyDialog", we), o.component("qyDialog", we), o.component("RemarkImage", xe), o.component("QyRemarkImage", xe);
|
|
980
|
-
}, Zt = {
|
|
981
|
-
install: Lt,
|
|
982
|
-
Upload: Ae,
|
|
983
|
-
QyDialog: we,
|
|
984
|
-
RemarkImage: xe
|
|
985
|
-
};
|
|
986
|
-
export {
|
|
987
|
-
we as QyDialog,
|
|
988
|
-
xe as RemarkImage,
|
|
989
|
-
Ae as Upload,
|
|
990
|
-
Zt as default,
|
|
991
|
-
$t as formatRemarkText,
|
|
992
|
-
$e as parseRemarkText,
|
|
993
|
-
De as parseRemarkWithImage
|
|
994
|
-
};
|