@vunk/form 2.19.20 → 2.19.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/components/ai-provider/index.cjs +1 -0
  2. package/components/ai-provider/index.d.ts +7 -0
  3. package/components/ai-provider/index.mjs +61 -0
  4. package/components/ai-provider/src/ctx.d.ts +8 -0
  5. package/components/ai-provider/src/index.vue.d.ts +23 -0
  6. package/components/ai-provider/src/types.d.ts +56 -0
  7. package/components/ai-provider/src/use.d.ts +3 -0
  8. package/components/api-tables-select/index.cjs +1 -1
  9. package/components/api-tables-select/index.mjs +1 -1
  10. package/components/api-tables-select/src/ctx.d.ts +57 -57
  11. package/components/api-tables-select/src/index.vue.d.ts +46 -419
  12. package/components/button/index.cjs +1 -1
  13. package/components/button/index.mjs +12 -12
  14. package/components/button/src/ctx.d.ts +7 -2
  15. package/components/button/src/index.vue.d.ts +36 -14
  16. package/components/card-input-collection/index.cjs +1 -1
  17. package/components/card-input-collection/index.mjs +136 -141
  18. package/components/card-input-collection/src/core.vue.d.ts +18 -7
  19. package/components/card-input-collection/src/ctx.d.ts +7 -2
  20. package/components/card-input-collection/src/index.vue.d.ts +18 -7
  21. package/components/cascader/index.cjs +1 -1
  22. package/components/cascader/index.mjs +38 -39
  23. package/components/cascader/src/ctx.d.ts +8 -3
  24. package/components/cascader/src/index.vue.d.ts +19 -8
  25. package/components/checkbox/src/ctx.d.ts +8 -3
  26. package/components/checkbox/src/index.vue.d.ts +43 -21
  27. package/components/{cloneDeep-DE0l40hv.mjs → cloneDeep-2YeQ7w2t.mjs} +10 -10
  28. package/components/cloneDeep-Btpy0oPF.js +1 -0
  29. package/components/collapse/index.cjs +1 -1
  30. package/components/collapse/index.mjs +19 -22
  31. package/components/collapse-item/index.cjs +1 -1
  32. package/components/collapse-item/index.mjs +21 -21
  33. package/components/collapse-item/src/index.vue.d.ts +2 -2
  34. package/components/color-picker/index.cjs +1 -1
  35. package/components/color-picker/index.mjs +26 -27
  36. package/components/color-picker/src/ctx.d.ts +7 -2
  37. package/components/color-picker/src/index.vue.d.ts +17 -6
  38. package/components/{style.css → components.css} +1 -1
  39. package/components/date-picker/index.cjs +1 -1
  40. package/components/date-picker/index.mjs +40 -41
  41. package/components/date-picker/src/ctx.d.ts +8 -3
  42. package/components/date-picker/src/index.vue.d.ts +17 -6
  43. package/components/date-picker-range/index.cjs +1 -1
  44. package/components/date-picker-range/index.mjs +17 -17
  45. package/components/date-picker-range/src/ctx.d.ts +14 -9
  46. package/components/date-picker-range/src/index.vue.d.ts +48 -26
  47. package/components/dialog/index.cjs +1 -1
  48. package/components/dialog/index.mjs +41 -52
  49. package/components/dialog/src/ctx.d.ts +1 -1
  50. package/components/dialog/src/index.vue.d.ts +1 -1
  51. package/components/dialog-input-collection/index.cjs +1 -1
  52. package/components/dialog-input-collection/index.mjs +124 -122
  53. package/components/dialog-input-collection/src/ctx.d.ts +7 -2
  54. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -1
  55. package/components/dialog-input-collection/src/index.vue.d.ts +17 -6
  56. package/components/download-plus/index.cjs +1 -1
  57. package/components/download-plus/index.mjs +193 -202
  58. package/components/download-plus/src/ctx.d.ts +7 -2
  59. package/components/download-plus/src/index.vue.d.ts +32 -10
  60. package/components/editable-text/index.cjs +1 -1
  61. package/components/editable-text/index.mjs +72 -75
  62. package/components/editable-text/src/ctx.d.ts +7 -2
  63. package/components/editable-text/src/index.vue.d.ts +18 -7
  64. package/components/el-slider/index.cjs +1 -1
  65. package/components/el-slider/index.mjs +230 -233
  66. package/components/el-slider/src/composables/index.cjs +1 -1
  67. package/components/el-slider/src/composables/index.mjs +1 -1
  68. package/components/el-slider/src/slider-core.vue.d.ts +3 -3
  69. package/components/esri-input-geojson/index.cjs +1 -5
  70. package/components/esri-input-geojson/index.mjs +59 -68
  71. package/components/esri-input-geojson/src/append.vue.d.ts +2 -2
  72. package/components/esri-input-geojson/src/ctx.d.ts +9 -4
  73. package/components/esri-input-geojson/src/index.vue.d.ts +65 -30
  74. package/components/fieldset/src/index.vue.d.ts +1 -1
  75. package/components/form/index.cjs +1 -1
  76. package/components/form/index.mjs +96 -101
  77. package/components/form/src/ctx.d.ts +2 -2
  78. package/components/form/src/index.vue.d.ts +4 -4
  79. package/components/form/src/use.d.ts +2 -2
  80. package/components/form-item/index.cjs +1 -1
  81. package/components/form-item/index.mjs +179 -107
  82. package/components/form-item/src/core.vue.d.ts +7 -3
  83. package/components/form-item/src/ctx.d.ts +7 -1
  84. package/components/form-item/src/index.vue.d.ts +13 -2
  85. package/components/form-item/src/use.d.ts +11 -0
  86. package/components/form-item-renderer/index.cjs +1 -1
  87. package/components/form-item-renderer/index.d.ts +1 -0
  88. package/components/form-item-renderer/index.mjs +85 -78
  89. package/components/form-item-renderer/src/use.d.ts +3 -0
  90. package/components/forms-provider/index.cjs +1 -1
  91. package/components/forms-provider/index.mjs +18 -21
  92. package/components/index-BIo_4rr_.mjs +18620 -0
  93. package/components/index-Bc7UifHG.js +1 -0
  94. package/components/index-D0D9ABpH.js +108 -0
  95. package/components/{index-CeHbpfCD.mjs → index-DCNYT7Wv.mjs} +0 -1
  96. package/components/information-collection/index.cjs +1 -1
  97. package/components/information-collection/index.mjs +32 -38
  98. package/components/information-collection/src/ctx.d.ts +7 -2
  99. package/components/information-collection/src/index.vue.d.ts +17 -6
  100. package/components/information-tag/index.cjs +1 -1
  101. package/components/information-tag/index.mjs +9 -12
  102. package/components/information-tag/src/index.vue.d.ts +1 -1
  103. package/components/input/index.cjs +1 -1
  104. package/components/input/index.mjs +27 -27
  105. package/components/input/src/ctx.d.ts +9 -4
  106. package/components/input/src/index.vue.d.ts +35 -13
  107. package/components/input-array/index.cjs +1 -1
  108. package/components/input-array/index.mjs +71 -74
  109. package/components/input-array/src/ctx.d.ts +7 -2
  110. package/components/input-array/src/index.vue.d.ts +18 -7
  111. package/components/input-collection/index.cjs +1 -1
  112. package/components/input-collection/index.mjs +121 -126
  113. package/components/input-collection/src/core.vue.d.ts +17 -6
  114. package/components/input-collection/src/ctx.d.ts +7 -2
  115. package/components/input-collection/src/index.vue.d.ts +17 -6
  116. package/components/input-file/src/index.vue.d.ts +19 -8
  117. package/components/input-link/index.cjs +1 -1
  118. package/components/input-link/index.mjs +1 -1
  119. package/components/input-link/src/ctx.d.ts +7 -2
  120. package/components/input-link/src/index.vue.d.ts +54 -21
  121. package/components/input-number/index.cjs +1 -1
  122. package/components/input-number/index.mjs +30 -33
  123. package/components/input-number/src/ctx.d.ts +8 -3
  124. package/components/input-number/src/index.vue.d.ts +33 -11
  125. package/components/input-tag/index.cjs +1 -1
  126. package/components/input-tag/index.mjs +24 -24
  127. package/components/input-tag/src/ctx.d.ts +9 -4
  128. package/components/input-tag/src/index.vue.d.ts +33 -11
  129. package/components/monaco-editor/src/ctx.d.ts +8 -3
  130. package/components/monaco-editor/src/index.vue.d.ts +38 -16
  131. package/components/radio/src/ctx.d.ts +7 -2
  132. package/components/radio/src/index.vue.d.ts +40 -18
  133. package/components/radio/src/wraper.vue.d.ts +22 -11
  134. package/components/renderer-data/index.cjs +1 -1
  135. package/components/renderer-data/index.mjs +14 -17
  136. package/components/select/index.cjs +1 -1
  137. package/components/select/index.mjs +167 -131
  138. package/components/select/src/core.vue.d.ts +96 -69
  139. package/components/select/src/ctx.d.ts +9 -4
  140. package/components/select/src/index.vue.d.ts +53 -42
  141. package/components/slider/index.cjs +1 -1
  142. package/components/slider/index.mjs +30 -31
  143. package/components/slider/src/ctx.d.ts +7 -2
  144. package/components/slider/src/index.vue.d.ts +18 -7
  145. package/components/switch/src/ctx.d.ts +7 -2
  146. package/components/switch/src/index.vue.d.ts +18 -7
  147. package/components/tables-select/index.cjs +1 -1
  148. package/components/tables-select/index.mjs +4 -4
  149. package/components/tables-select/src/ctx.d.ts +68 -68
  150. package/components/tables-select/src/index.vue.d.ts +52 -420
  151. package/components/template-instances-provider/index.cjs +1 -1
  152. package/components/template-instances-provider/index.mjs +11 -17
  153. package/components/templates-default/src/index.vue.d.ts +404 -185
  154. package/components/templates-esri/src/index.vue.d.ts +65 -30
  155. package/components/templates-variant/src/index.vue.d.ts +48 -26
  156. package/components/time-picker/index.cjs +1 -1
  157. package/components/time-picker/index.mjs +38 -39
  158. package/components/time-picker/src/ctx.d.ts +8 -3
  159. package/components/time-picker/src/index.vue.d.ts +17 -6
  160. package/components/upload/index.cjs +1 -1
  161. package/components/upload/index.mjs +244 -253
  162. package/components/upload/src/ctx.d.ts +8 -3
  163. package/components/upload/src/file.vue.d.ts +3 -3
  164. package/components/upload/src/index.vue.d.ts +37 -15
  165. package/components/upload/src/wraper.vue.d.ts +19 -8
  166. package/components/upload-plus/index.cjs +7 -15
  167. package/components/upload-plus/index.mjs +1879 -1897
  168. package/components/upload-plus/src/ctx.d.ts +7 -2
  169. package/components/upload-plus/src/index.vue.d.ts +18 -7
  170. package/components/use-watch-C3iIa2DX.js +1 -0
  171. package/components/use-watch-Dp64x0si.mjs +411 -0
  172. package/components/van-cascader/src/ctx.d.ts +7 -2
  173. package/components/van-cascader/src/index.vue.d.ts +19 -8
  174. package/components/var-datetime-picker/src/ctx.d.ts +7 -2
  175. package/components/var-datetime-picker/src/index.vue.d.ts +30 -8
  176. package/components/vditor/src/ctx.d.ts +7 -2
  177. package/components/vditor/src/index.vue.d.ts +41 -19
  178. package/composables/element-plus/index.cjs +1 -1
  179. package/composables/element-plus/index.mjs +10 -10
  180. package/composables/form-mitt/index.mjs +1 -1
  181. package/composables/index.cjs +1 -1
  182. package/composables/index.mjs +53 -53
  183. package/index.css +1 -1
  184. package/locale/index.cjs +1 -1
  185. package/locale/index.mjs +8 -5
  186. package/locale/lang/ar.d.ts +1 -0
  187. package/locale/lang/en.d.ts +1 -0
  188. package/locale/lang/zh-cn.d.ts +1 -0
  189. package/package.json +9 -1
  190. package/shared/element-plus/ctx.d.ts +16 -16
  191. package/shared/types/source/index.d.ts +5 -0
  192. package/shared/upload/index.cjs +1 -1
  193. package/shared/upload/index.mjs +166 -165
  194. package/components/cloneDeep-DaYwfXwD.js +0 -1
  195. package/components/index-BBriTmQP.js +0 -1
  196. package/components/use-watch-Bfrz9pv_.js +0 -1
  197. package/components/use-watch-t49wP7jy.mjs +0 -414
@@ -1 +1 @@
1
- "use strict";var N=Object.defineProperty;var U=(e,o,c)=>o in e?N(e,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[o]=c;var R=(e,o,c)=>U(e,typeof o!="symbol"?o+"":o,c);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@vunk/form/components/form-item"),t=require("vue"),$=require("@skzz/platform/api/basic"),q=require("@skzz/platform/shared/fetch/platform"),C=require("element-plus"),x=require("@vunk/core/shared/utils-fetch"),V=require("../index-BNPcMpOO.js"),H=require("@vunk/core/composables"),T=require("../index-BBriTmQP.js"),M=require("@vunk/core/shared/utils-class"),O=require("@vunk/form/composables/element-plus"),j=require("../_plugin-vue_export-helper-BHFhmbuH.js"),A={...P._VkfFormItemCtx.props,fileId:{type:String,default:""},url:{type:String,default:void 0},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},G={"update:fileStatus":null};var r=(e=>(e.wait="wait",e.doPause="doPause",e.pause="pause",e.doDownload="doDownload",e.downloading="downloading",e.error="error",e.done="done",e))(r||{});const F=new x.RestFetch({baseURL:q.restFetch.baseURL,presetRequestInit:e=>{const o=e.headers,c=V.getToken();return c&&o.set("Token",c),e}}),X=(e,o)=>new Promise((c,h)=>{var b;const n=new XMLHttpRequest;let y=`${F.baseURL}/file/downloadByRange?fileId=${e.fileId}`;e.fileServiceType&&(y+=`&fileServiceType=${e.fileServiceType}`,n.setRequestHeader("fileServiceType",e.fileServiceType)),o!=null&&o.onprogress&&(n.onprogress=o==null?void 0:o.onprogress),n.open("GET",y,!0),n.responseType="blob",n.setRequestHeader("Token",V.getToken()),n.setRequestHeader("tenant","default"),n.setRequestHeader("application","platform"),n.setRequestHeader("Content-Range",`bytes=${e.start}-${e.end}`),n.setRequestHeader("Accept-Ranges","bytes"),n.onreadystatechange=l=>{const w=l.target;if(n.readyState===4)if(n.status===200||n.status===206){if(o!=null&&o.xhrs){const u=o.xhrs.findIndex(g=>g===n);o.xhrs.splice(u,1)}c({data:w.response})}else n.status===500&&h(w.response)},n.onerror=()=>{h(n.response)};try{n.send()}catch(l){h(l)}(b=o==null?void 0:o.xhrs)==null||b.push(n)}),J=t.defineComponent({name:"VkfDownloadPlus",components:{VkfFormItem:P.VkfFormItem,ElButtonGroup:C.ElButtonGroup,ElButton:C.ElButton,ElInput:C.ElInput},props:A,emits:G,setup(e,{emit:o}){const c=P._VkfFormItemCtx.createBindProps(e),{tr:h}=O.useLocale();t.watchEffect(()=>{F.baseURL=e.url||q.restFetch.baseURL});const n=t.ref();y(),t.watch(()=>e.fileId,y);function y(){e.fileId&&$.rFile({fileId:e.fileId}).then(a=>{n.value=a})}const b=t.computed(()=>u.value===r.error?T.circle_close_filled_default:T.download_default),l=t.ref([]),w=t.ref([]),u=H.useModelComputed({default:r.wait,key:"fileStatus"},e,o),g=()=>{if(!n.value)return;const a=n.value.size,k=n.value.id,I=Math.ceil(a/e.chunkSize);l.value=Array.from({length:I},(v,s)=>{const i=s*e.chunkSize,f=Math.min(i+e.chunkSize,a)-1;let S={};return l.value[s]&&l.value[s].start===i&&l.value[s].end===f&&l.value[s].status===r.done&&(S=l.value[s]),{start:i,end:f,index:s,status:r.wait,fileId:k,fileServiceType:e.fileServiceType,progress:0,...S}}),u.value=r.downloading;const _=l.value.filter(v=>v.status===r.wait||v.status===r.error);m(_).then(()=>{const v=l.value.map(s=>s.data);return new Blob(v,{type:"application/octet-stream"})}).then(v=>{var f;const s=URL.createObjectURL(v),i=document.createElement("a");i.href=s,i.download=((f=n.value)==null?void 0:f.realName)||h("vkf.downloadPlus.unknownFile","未知文件"),i.click(),URL.revokeObjectURL(s)}).then(()=>{u.value=r.done}).catch(()=>{u.value=r.error,C.ElMessage.error(h("vkf.downloadPlus.downloadFailed","下载失败"))})};t.watch(()=>u.value,a=>{a===r.doDownload&&g()});function m(a,k=4,I=10){return new Promise((_,v)=>{const s=a.length;let i=0;if(s===0)return _(void 0);const f=[],S=async()=>{for(;i<s&&k>0;){k--;const z=a.findIndex(d=>d.status===r.wait||d.status===r.error),p=a[z];p&&(p.status=r.downloading,X(p,{onprogress(d){p.progress=parseInt(d.loaded/d.total*100+"")},xhrs:w.value}).then(d=>{p.status=r.done,p.data=d.data,k++,i++}).then(()=>{i===s?_(void 0):S()}).catch(()=>{p.status=r.error;const d=p.index;if(typeof f[d]!="number"&&(f[d]=0),f[d]++,console.warn(d,p,f[d],"次报错"),p.progress=-1,f[d]>=I)return v();k++,S()}))}};S()})}const B=()=>{w.value.forEach(a=>{a.abort()}),w.value=[],u.value=r.pause};t.watch(()=>u.value,a=>{a===r.doPause&&B()}),t.onBeforeUnmount(()=>{B()});class D extends M.ToggleHandler{constructor(I){super();R(this,"listener");this.listener=I}add(){window.addEventListener("online",this.listener),this.removeHandler=()=>{window.removeEventListener("online",this.listener)}}}const E=new D(()=>{u.value===r.error&&(u.value=r.doDownload)});return E.add(),t.onBeforeUnmount(()=>{E.remove()}),{formItemBindProps:c,fileInfo:n,handleDownload:g,handlePause:B,Status:r,chunks:l,fileStatus:u,filePrefixIcon:b,tr:h}}}),K={class:"vkf-download-plus-main"},Q={class:"vkf-download-plus-label"},W={key:0,class:"vkf-download-plus-cube-x"};function Y(e,o,c,h,n,y){const b=t.resolveComponent("ElInput"),l=t.resolveComponent("el-button"),w=t.resolveComponent("el-button-group"),u=t.resolveComponent("VkfFormItem");return t.openBlock(),t.createBlock(u,t.mergeProps(e.formItemBindProps,{class:"vkf-download-plus"}),{default:t.withCtx(()=>{var g;return[t.createElementVNode("div",K,[t.createElementVNode("label",Q,[t.createVNode(b,{class:t.normalizeClass({"is-error":e.fileStatus===e.Status.error}),"prefix-icon":e.filePrefixIcon,"model-value":(g=e.fileInfo)==null?void 0:g.realName,readonly:""},null,8,["class","prefix-icon","model-value"]),e.fileStatus===e.Status.downloading||e.fileStatus===e.Status.pause?(t.openBlock(),t.createElementBlock("div",W,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.chunks,m=>(t.openBlock(),t.createElementBlock("div",{key:m.fileId+"-"+m.index,class:t.normalizeClass(["vkf-download-plus-cube",{error:m.status==e.Status.error}]),style:t.normalizeStyle({width:100/e.chunks.length+"%"})},[t.createElementVNode("div",{class:t.normalizeClass({uploading:m.progress>0&&m.progress<100,success:m.progress==100}),style:t.normalizeStyle({height:m.progress+"%"})},null,6)],6))),128))])):t.createCommentVNode("",!0)]),t.createVNode(w,{class:"vkf-download-plus-btng"},{default:t.withCtx(()=>[e.fileStatus===e.Status.downloading?(t.openBlock(),t.createBlock(l,{key:0,type:"danger",onClick:e.handlePause},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.tr("vkf.common.pause","暂停")),1)]),_:1},8,["onClick"])):(t.openBlock(),t.createBlock(l,{key:1,type:"primary",onClick:e.handleDownload},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.tr("vkf.common.download","下载")),1)]),_:1},8,["onClick"]))]),_:1})])]}),_:1},16)}const L=j._export_sfc(J,[["render",Y]]),Z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfDownloadPlus=L;exports.__VkfDownloadPlus=Z;exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("@vunk/form/components/form-item"),e=require("vue"),z=require("@skzz/platform/api/basic"),R=require("@skzz/platform/shared/fetch/platform"),I=require("element-plus"),N=require("@vunk/core/shared/utils-fetch"),T=require("../index-BNPcMpOO.js"),U=require("@vunk/core/composables"),E=require("../index-Bc7UifHG.js"),$=require("@vunk/core/shared/utils-class"),x=require("@vunk/form/composables/element-plus"),H=require("../_plugin-vue_export-helper-BHFhmbuH.js"),M={...B._VkfFormItemCtx.props,fileId:{type:String,default:""},url:{type:String,default:void 0},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},O={"update:fileStatus":null};var n=(t=>(t.wait="wait",t.doPause="doPause",t.pause="pause",t.doDownload="doDownload",t.downloading="downloading",t.error="error",t.done="done",t))(n||{});const q=new N.RestFetch({baseURL:R.restFetch.baseURL,presetRequestInit:t=>{const i=t.headers,w=T.getToken();return w&&i.set("Token",w),t}}),j=(t,i)=>new Promise((w,m)=>{const o=new XMLHttpRequest;let y=`${q.baseURL}/file/downloadByRange?fileId=${t.fileId}`;t.fileServiceType&&(y+=`&fileServiceType=${t.fileServiceType}`,o.setRequestHeader("fileServiceType",t.fileServiceType)),i?.onprogress&&(o.onprogress=i?.onprogress),o.open("GET",y,!0),o.responseType="blob",o.setRequestHeader("Token",T.getToken()),o.setRequestHeader("tenant","default"),o.setRequestHeader("application","platform"),o.setRequestHeader("Content-Range",`bytes=${t.start}-${t.end}`),o.setRequestHeader("Accept-Ranges","bytes"),o.onreadystatechange=g=>{const l=g.target;if(o.readyState===4)if(o.status===200||o.status===206){if(i?.xhrs){const k=i.xhrs.findIndex(a=>a===o);i.xhrs.splice(k,1)}w({data:l.response})}else o.status===500&&m(l.response)},o.onerror=()=>{m(o.response)};try{o.send()}catch(g){m(g)}i?.xhrs?.push(o)}),A=e.defineComponent({name:"VkfDownloadPlus",components:{VkfFormItem:B.VkfFormItem,ElButtonGroup:I.ElButtonGroup,ElButton:I.ElButton,ElInput:I.ElInput},props:M,emits:O,setup(t,{emit:i}){const w=B._VkfFormItemCtx.createBindProps(t),{tr:m}=x.useLocale();e.watchEffect(()=>{q.baseURL=t.url||R.restFetch.baseURL});const o=e.ref();y(),e.watch(()=>t.fileId,y);function y(){t.fileId&&z.rFile({fileId:t.fileId}).then(s=>{o.value=s})}const g=e.computed(()=>a.value===n.error?E.circle_close_filled_default:E.download_default),l=e.ref([]),k=e.ref([]),a=U.useModelComputed({default:n.wait,key:"fileStatus"},t,i),c=()=>{if(!o.value)return;const s=o.value.size,v=o.value.id,C=Math.ceil(s/t.chunkSize);l.value=Array.from({length:C},(p,r)=>{const d=r*t.chunkSize,h=Math.min(d+t.chunkSize,s)-1;let b={};return l.value[r]&&l.value[r].start===d&&l.value[r].end===h&&l.value[r].status===n.done&&(b=l.value[r]),{start:d,end:h,index:r,status:n.wait,fileId:v,fileServiceType:t.fileServiceType,progress:0,...b}}),a.value=n.downloading;const S=l.value.filter(p=>p.status===n.wait||p.status===n.error);F(S).then(()=>{const p=l.value.map(r=>r.data);return new Blob(p,{type:"application/octet-stream"})}).then(p=>{const r=URL.createObjectURL(p),d=document.createElement("a");d.href=r,d.download=o.value?.realName||m("vkf.downloadPlus.unknownFile","未知文件"),d.click(),URL.revokeObjectURL(r)}).then(()=>{a.value=n.done}).catch(()=>{a.value=n.error,I.ElMessage.error(m("vkf.downloadPlus.downloadFailed","下载失败"))})};e.watch(()=>a.value,s=>{s===n.doDownload&&c()});function F(s,v=4,C=10){return new Promise((S,p)=>{const r=s.length;let d=0;if(r===0)return S(void 0);const h=[],b=async()=>{for(;d<r&&v>0;){v--;const D=s.findIndex(u=>u.status===n.wait||u.status===n.error),f=s[D];f&&(f.status=n.downloading,j(f,{onprogress(u){f.progress=parseInt(u.loaded/u.total*100+"")},xhrs:k.value}).then(u=>{f.status=n.done,f.data=u.data,v++,d++}).then(()=>{d===r?S(void 0):b()}).catch(()=>{f.status=n.error;const u=f.index;if(typeof h[u]!="number"&&(h[u]=0),h[u]++,console.warn(u,f,h[u],"次报错"),f.progress=-1,h[u]>=C)return p();v++,b()}))}};b()})}const _=()=>{k.value.forEach(s=>{s.abort()}),k.value=[],a.value=n.pause};e.watch(()=>a.value,s=>{s===n.doPause&&_()}),e.onBeforeUnmount(()=>{_()});class L extends $.ToggleHandler{listener;constructor(v){super(),this.listener=v}add(){window.addEventListener("online",this.listener),this.removeHandler=()=>{window.removeEventListener("online",this.listener)}}}const P=new L(()=>{a.value===n.error&&(a.value=n.doDownload)});return P.add(),e.onBeforeUnmount(()=>{P.remove()}),{formItemBindProps:w,fileInfo:o,handleDownload:c,handlePause:_,Status:n,chunks:l,fileStatus:a,filePrefixIcon:g,tr:m}}}),G={class:"vkf-download-plus-main"},X={class:"vkf-download-plus-label"},J={key:0,class:"vkf-download-plus-cube-x"};function K(t,i,w,m,o,y){const g=e.resolveComponent("ElInput"),l=e.resolveComponent("el-button"),k=e.resolveComponent("el-button-group"),a=e.resolveComponent("VkfFormItem");return e.openBlock(),e.createBlock(a,e.mergeProps(t.formItemBindProps,{class:"vkf-download-plus"}),{default:e.withCtx(()=>[e.createElementVNode("div",G,[e.createElementVNode("label",X,[e.createVNode(g,{class:e.normalizeClass({"is-error":t.fileStatus===t.Status.error}),"prefix-icon":t.filePrefixIcon,"model-value":t.fileInfo?.realName,readonly:""},null,8,["class","prefix-icon","model-value"]),t.fileStatus===t.Status.downloading||t.fileStatus===t.Status.pause?(e.openBlock(),e.createElementBlock("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.chunks,c=>(e.openBlock(),e.createElementBlock("div",{key:c.fileId+"-"+c.index,class:e.normalizeClass(["vkf-download-plus-cube",{error:c.status==t.Status.error}]),style:e.normalizeStyle({width:100/t.chunks.length+"%"})},[e.createElementVNode("div",{class:e.normalizeClass({uploading:c.progress>0&&c.progress<100,success:c.progress==100}),style:e.normalizeStyle({height:c.progress+"%"})},null,6)],6))),128))])):e.createCommentVNode("",!0)]),e.createVNode(k,{class:"vkf-download-plus-btng"},{default:e.withCtx(()=>[t.fileStatus===t.Status.downloading?(e.openBlock(),e.createBlock(l,{key:0,type:"danger",onClick:t.handlePause},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tr("vkf.common.pause","暂停")),1)]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(l,{key:1,type:"primary",onClick:t.handleDownload},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tr("vkf.common.download","下载")),1)]),_:1},8,["onClick"]))]),_:1})])]),_:1},16)}const V=H._export_sfc(A,[["render",K]]),Q=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfDownloadPlus=V;exports.__VkfDownloadPlus=Q;exports.default=V;
@@ -1,20 +1,17 @@
1
- var X = Object.defineProperty;
2
- var J = (e, o, u) => o in e ? X(e, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : e[o] = u;
3
- var U = (e, o, u) => J(e, typeof o != "symbol" ? o + "" : o, u);
4
- import { _VkfFormItemCtx as M, VkfFormItem as K } from "@vunk/form/components/form-item";
5
- import { defineComponent as Q, watchEffect as W, ref as C, watch as L, computed as Y, onBeforeUnmount as $, resolveComponent as R, openBlock as S, createBlock as E, mergeProps as Z, withCtx as P, createElementVNode as F, createVNode as z, normalizeClass as B, createElementBlock as D, Fragment as ee, renderList as oe, normalizeStyle as H, createCommentVNode as te, createTextVNode as q, toDisplayString as N } from "vue";
6
- import { rFile as ne } from "@skzz/platform/api/basic";
7
- import { restFetch as O } from "@skzz/platform/shared/fetch/platform";
8
- import { ElInput as re, ElButton as se, ElButtonGroup as le, ElMessage as ae } from "element-plus";
9
- import { RestFetch as de } from "@vunk/core/shared/utils-fetch";
10
- import { g as x } from "../index-DJv1MwwH.mjs";
11
- import { useModelComputed as ue } from "@vunk/core/composables";
12
- import { b as ie, f as fe } from "../index-CeHbpfCD.mjs";
13
- import { ToggleHandler as ce } from "@vunk/core/shared/utils-class";
14
- import { useLocale as pe } from "@vunk/form/composables/element-plus";
15
- import { _ as me } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
16
- const ve = {
17
- ...M.props,
1
+ import { _VkfFormItemCtx as q, VkfFormItem as G } from "@vunk/form/components/form-item";
2
+ import { defineComponent as X, watchEffect as J, ref as T, watch as C, computed as K, onBeforeUnmount as V, resolveComponent as I, openBlock as b, createBlock as L, mergeProps as Q, withCtx as _, createElementVNode as E, createVNode as U, normalizeClass as F, createElementBlock as B, Fragment as W, renderList as Y, normalizeStyle as $, createCommentVNode as Z, createTextVNode as z, toDisplayString as H } from "vue";
3
+ import { rFile as ee } from "@skzz/platform/api/basic";
4
+ import { restFetch as N } from "@skzz/platform/shared/fetch/platform";
5
+ import { ElInput as te, ElButton as oe, ElButtonGroup as ne, ElMessage as re } from "element-plus";
6
+ import { RestFetch as se } from "@vunk/core/shared/utils-fetch";
7
+ import { g as M } from "../index-DJv1MwwH.mjs";
8
+ import { useModelComputed as le } from "@vunk/core/composables";
9
+ import { b as ae, f as de } from "../index-DCNYT7Wv.mjs";
10
+ import { ToggleHandler as ie } from "@vunk/core/shared/utils-class";
11
+ import { useLocale as ue } from "@vunk/form/composables/element-plus";
12
+ import { _ as fe } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
13
+ const ce = {
14
+ ...q.props,
18
15
  fileId: {
19
16
  type: String,
20
17
  default: ""
@@ -42,164 +39,161 @@ const ve = {
42
39
  type: String,
43
40
  default: void 0
44
41
  }
45
- }, he = {
42
+ }, pe = {
46
43
  "update:fileStatus": null
47
44
  };
48
- var n = /* @__PURE__ */ ((e) => (e.wait = "wait", e.doPause = "doPause", e.pause = "pause", e.doDownload = "doDownload", e.downloading = "downloading", e.error = "error", e.done = "done", e))(n || {});
49
- const A = new de({
50
- baseURL: O.baseURL,
45
+ var o = /* @__PURE__ */ ((e) => (e.wait = "wait", e.doPause = "doPause", e.pause = "pause", e.doDownload = "doDownload", e.downloading = "downloading", e.error = "error", e.done = "done", e))(o || {});
46
+ const O = new se({
47
+ baseURL: N.baseURL,
51
48
  presetRequestInit: (e) => {
52
- const o = e.headers, u = x();
53
- return u && o.set("Token", u), e;
49
+ const d = e.headers, h = M();
50
+ return h && d.set("Token", h), e;
54
51
  }
55
- }), we = (e, o) => new Promise((u, v) => {
56
- var y;
52
+ }), me = (e, d) => new Promise((h, p) => {
57
53
  const t = new XMLHttpRequest();
58
- let k = `${A.baseURL}/file/downloadByRange?fileId=${e.fileId}`;
59
- e.fileServiceType && (k += `&fileServiceType=${e.fileServiceType}`, t.setRequestHeader("fileServiceType", e.fileServiceType)), o != null && o.onprogress && (t.onprogress = o == null ? void 0 : o.onprogress), t.open("GET", k, !0), t.responseType = "blob", t.setRequestHeader("Token", x()), t.setRequestHeader("tenant", "default"), t.setRequestHeader("application", "platform"), t.setRequestHeader("Content-Range", `bytes=${e.start}-${e.end}`), t.setRequestHeader("Accept-Ranges", "bytes"), t.onreadystatechange = (r) => {
60
- const h = r.target;
54
+ let k = `${O.baseURL}/file/downloadByRange?fileId=${e.fileId}`;
55
+ e.fileServiceType && (k += `&fileServiceType=${e.fileServiceType}`, t.setRequestHeader("fileServiceType", e.fileServiceType)), d?.onprogress && (t.onprogress = d?.onprogress), t.open("GET", k, !0), t.responseType = "blob", t.setRequestHeader("Token", M()), t.setRequestHeader("tenant", "default"), t.setRequestHeader("application", "platform"), t.setRequestHeader("Content-Range", `bytes=${e.start}-${e.end}`), t.setRequestHeader("Accept-Ranges", "bytes"), t.onreadystatechange = (w) => {
56
+ const r = w.target;
61
57
  if (t.readyState === 4)
62
58
  if (t.status === 200 || t.status === 206) {
63
- if (o != null && o.xhrs) {
64
- const a = o.xhrs.findIndex((w) => w === t);
65
- o.xhrs.splice(a, 1);
59
+ if (d?.xhrs) {
60
+ const g = d.xhrs.findIndex((l) => l === t);
61
+ d.xhrs.splice(g, 1);
66
62
  }
67
- u({
68
- data: h.response
63
+ h({
64
+ data: r.response
69
65
  });
70
- } else t.status === 500 && v(h.response);
66
+ } else t.status === 500 && p(r.response);
71
67
  }, t.onerror = () => {
72
- v(t.response);
68
+ p(t.response);
73
69
  };
74
70
  try {
75
71
  t.send();
76
- } catch (r) {
77
- v(r);
72
+ } catch (w) {
73
+ p(w);
78
74
  }
79
- (y = o == null ? void 0 : o.xhrs) == null || y.push(t);
80
- }), ge = Q({
75
+ d?.xhrs?.push(t);
76
+ }), ve = X({
81
77
  name: "VkfDownloadPlus",
82
78
  components: {
83
- VkfFormItem: K,
84
- ElButtonGroup: le,
85
- ElButton: se,
86
- ElInput: re
79
+ VkfFormItem: G,
80
+ ElButtonGroup: ne,
81
+ ElButton: oe,
82
+ ElInput: te
87
83
  },
88
- props: ve,
89
- emits: he,
90
- setup(e, { emit: o }) {
91
- const u = M.createBindProps(e), { tr: v } = pe();
92
- W(() => {
93
- A.baseURL = e.url || O.baseURL;
84
+ props: ce,
85
+ emits: pe,
86
+ setup(e, { emit: d }) {
87
+ const h = q.createBindProps(e), { tr: p } = ue();
88
+ J(() => {
89
+ O.baseURL = e.url || N.baseURL;
94
90
  });
95
- const t = C();
96
- k(), L(() => e.fileId, k);
91
+ const t = T();
92
+ k(), C(() => e.fileId, k);
97
93
  function k() {
98
- e.fileId && ne({
94
+ e.fileId && ee({
99
95
  fileId: e.fileId
100
- }).then((l) => {
101
- t.value = l;
96
+ }).then((s) => {
97
+ t.value = s;
102
98
  });
103
99
  }
104
- const y = Y(() => a.value === n.error ? ie : fe), r = C([]), h = C([]), a = ue({
105
- default: n.wait,
100
+ const w = K(() => l.value === o.error ? ae : de), r = T([]), g = T([]), l = le({
101
+ default: o.wait,
106
102
  key: "fileStatus"
107
- }, e, o), w = () => {
103
+ }, e, d), u = () => {
108
104
  if (!t.value)
109
105
  return;
110
- const l = t.value.size, g = t.value.id, I = Math.ceil(l / e.chunkSize);
111
- r.value = Array.from({ length: I }, (m, s) => {
112
- const i = s * e.chunkSize, f = Math.min(
106
+ const s = t.value.size, m = t.value.id, P = Math.ceil(s / e.chunkSize);
107
+ r.value = Array.from({ length: P }, (c, n) => {
108
+ const i = n * e.chunkSize, v = Math.min(
113
109
  i + e.chunkSize,
114
- l
110
+ s
115
111
  ) - 1;
116
- let b = {};
117
- return r.value[s] && r.value[s].start === i && r.value[s].end === f && r.value[s].status === n.done && (b = r.value[s]), {
112
+ let y = {};
113
+ return r.value[n] && r.value[n].start === i && r.value[n].end === v && r.value[n].status === o.done && (y = r.value[n]), {
118
114
  start: i,
119
- end: f,
120
- index: s,
121
- status: n.wait,
122
- fileId: g,
115
+ end: v,
116
+ index: n,
117
+ status: o.wait,
118
+ fileId: m,
123
119
  fileServiceType: e.fileServiceType,
124
120
  progress: 0,
125
- ...b
121
+ ...y
126
122
  };
127
- }), a.value = n.downloading;
128
- const _ = r.value.filter(
129
- (m) => m.status === n.wait || m.status === n.error
123
+ }), l.value = o.downloading;
124
+ const S = r.value.filter(
125
+ (c) => c.status === o.wait || c.status === o.error
130
126
  );
131
- p(_).then(() => {
132
- const m = r.value.map((s) => s.data);
127
+ x(S).then(() => {
128
+ const c = r.value.map((n) => n.data);
133
129
  return new Blob(
134
- m,
130
+ c,
135
131
  { type: "application/octet-stream" }
136
132
  );
137
- }).then((m) => {
138
- var f;
139
- const s = URL.createObjectURL(m), i = document.createElement("a");
140
- i.href = s, i.download = ((f = t.value) == null ? void 0 : f.realName) || v("vkf.downloadPlus.unknownFile", "未知文件"), i.click(), URL.revokeObjectURL(s);
133
+ }).then((c) => {
134
+ const n = URL.createObjectURL(c), i = document.createElement("a");
135
+ i.href = n, i.download = t.value?.realName || p("vkf.downloadPlus.unknownFile", "未知文件"), i.click(), URL.revokeObjectURL(n);
141
136
  }).then(() => {
142
- a.value = n.done;
137
+ l.value = o.done;
143
138
  }).catch(() => {
144
- a.value = n.error, ae.error(v("vkf.downloadPlus.downloadFailed", "下载失败"));
139
+ l.value = o.error, re.error(p("vkf.downloadPlus.downloadFailed", "下载失败"));
145
140
  });
146
141
  };
147
- L(() => a.value, (l) => {
148
- l === n.doDownload && w();
142
+ C(() => l.value, (s) => {
143
+ s === o.doDownload && u();
149
144
  });
150
- function p(l, g = 4, I = 10) {
151
- return new Promise((_, m) => {
152
- const s = l.length;
145
+ function x(s, m = 4, P = 10) {
146
+ return new Promise((S, c) => {
147
+ const n = s.length;
153
148
  let i = 0;
154
- if (s === 0)
155
- return _(void 0);
156
- const f = [], b = async () => {
157
- for (; i < s && g > 0; ) {
158
- g--;
159
- const G = l.findIndex(
160
- (d) => d.status === n.wait || d.status === n.error
161
- ), c = l[G];
162
- c && (c.status = n.downloading, we(c, {
163
- onprogress(d) {
164
- c.progress = parseInt(d.loaded / d.total * 100 + "");
149
+ if (n === 0)
150
+ return S(void 0);
151
+ const v = [], y = async () => {
152
+ for (; i < n && m > 0; ) {
153
+ m--;
154
+ const j = s.findIndex(
155
+ (a) => a.status === o.wait || a.status === o.error
156
+ ), f = s[j];
157
+ f && (f.status = o.downloading, me(f, {
158
+ onprogress(a) {
159
+ f.progress = parseInt(a.loaded / a.total * 100 + "");
165
160
  },
166
- xhrs: h.value
167
- }).then((d) => {
168
- c.status = n.done, c.data = d.data, g++, i++;
161
+ xhrs: g.value
162
+ }).then((a) => {
163
+ f.status = o.done, f.data = a.data, m++, i++;
169
164
  }).then(() => {
170
- i === s ? _(void 0) : b();
165
+ i === n ? S(void 0) : y();
171
166
  }).catch(() => {
172
- c.status = n.error;
173
- const d = c.index;
174
- if (typeof f[d] != "number" && (f[d] = 0), f[d]++, console.warn(
175
- d,
176
- c,
177
- f[d],
167
+ f.status = o.error;
168
+ const a = f.index;
169
+ if (typeof v[a] != "number" && (v[a] = 0), v[a]++, console.warn(
170
+ a,
171
+ f,
172
+ v[a],
178
173
  "次报错"
179
- ), c.progress = -1, f[d] >= I)
180
- return m();
181
- g++, b();
174
+ ), f.progress = -1, v[a] >= P)
175
+ return c();
176
+ m++, y();
182
177
  }));
183
178
  }
184
179
  };
185
- b();
180
+ y();
186
181
  });
187
182
  }
188
- const T = () => {
189
- h.value.forEach((l) => {
190
- l.abort();
191
- }), h.value = [], a.value = n.pause;
183
+ const R = () => {
184
+ g.value.forEach((s) => {
185
+ s.abort();
186
+ }), g.value = [], l.value = o.pause;
192
187
  };
193
- L(() => a.value, (l) => {
194
- l === n.doPause && T();
195
- }), $(() => {
196
- T();
188
+ C(() => l.value, (s) => {
189
+ s === o.doPause && R();
190
+ }), V(() => {
191
+ R();
197
192
  });
198
- class j extends ce {
199
- constructor(I) {
200
- super();
201
- U(this, "listener");
202
- this.listener = I;
193
+ class A extends ie {
194
+ listener;
195
+ constructor(m) {
196
+ super(), this.listener = m;
203
197
  }
204
198
  add() {
205
199
  window.addEventListener("online", this.listener), this.removeHandler = () => {
@@ -207,100 +201,97 @@ const A = new de({
207
201
  };
208
202
  }
209
203
  }
210
- const V = new j(() => {
211
- a.value === n.error && (a.value = n.doDownload);
204
+ const D = new A(() => {
205
+ l.value === o.error && (l.value = o.doDownload);
212
206
  });
213
- return V.add(), $(() => {
214
- V.remove();
207
+ return D.add(), V(() => {
208
+ D.remove();
215
209
  }), {
216
- formItemBindProps: u,
210
+ formItemBindProps: h,
217
211
  fileInfo: t,
218
- handleDownload: w,
219
- handlePause: T,
220
- Status: n,
212
+ handleDownload: u,
213
+ handlePause: R,
214
+ Status: o,
221
215
  chunks: r,
222
- fileStatus: a,
223
- filePrefixIcon: y,
224
- tr: v
216
+ fileStatus: l,
217
+ filePrefixIcon: w,
218
+ tr: p
225
219
  };
226
220
  }
227
- }), ke = { class: "vkf-download-plus-main" }, ye = { class: "vkf-download-plus-label" }, be = {
221
+ }), he = { class: "vkf-download-plus-main" }, we = { class: "vkf-download-plus-label" }, ge = {
228
222
  key: 0,
229
223
  class: "vkf-download-plus-cube-x"
230
224
  };
231
- function Se(e, o, u, v, t, k) {
232
- const y = R("ElInput"), r = R("el-button"), h = R("el-button-group"), a = R("VkfFormItem");
233
- return S(), E(a, Z(e.formItemBindProps, { class: "vkf-download-plus" }), {
234
- default: P(() => {
235
- var w;
236
- return [
237
- F("div", ke, [
238
- F("label", ye, [
239
- z(y, {
240
- class: B({
241
- "is-error": e.fileStatus === e.Status.error
242
- }),
243
- "prefix-icon": e.filePrefixIcon,
244
- "model-value": (w = e.fileInfo) == null ? void 0 : w.realName,
245
- readonly: ""
246
- }, null, 8, ["class", "prefix-icon", "model-value"]),
247
- e.fileStatus === e.Status.downloading || e.fileStatus === e.Status.pause ? (S(), D("div", be, [
248
- (S(!0), D(ee, null, oe(e.chunks, (p) => (S(), D("div", {
249
- key: p.fileId + "-" + p.index,
250
- class: B(["vkf-download-plus-cube", {
251
- error: p.status == e.Status.error
252
- }]),
253
- style: H({
254
- width: 100 / e.chunks.length + "%"
225
+ function ke(e, d, h, p, t, k) {
226
+ const w = I("ElInput"), r = I("el-button"), g = I("el-button-group"), l = I("VkfFormItem");
227
+ return b(), L(l, Q(e.formItemBindProps, { class: "vkf-download-plus" }), {
228
+ default: _(() => [
229
+ E("div", he, [
230
+ E("label", we, [
231
+ U(w, {
232
+ class: F({
233
+ "is-error": e.fileStatus === e.Status.error
234
+ }),
235
+ "prefix-icon": e.filePrefixIcon,
236
+ "model-value": e.fileInfo?.realName,
237
+ readonly: ""
238
+ }, null, 8, ["class", "prefix-icon", "model-value"]),
239
+ e.fileStatus === e.Status.downloading || e.fileStatus === e.Status.pause ? (b(), B("div", ge, [
240
+ (b(!0), B(W, null, Y(e.chunks, (u) => (b(), B("div", {
241
+ key: u.fileId + "-" + u.index,
242
+ class: F(["vkf-download-plus-cube", {
243
+ error: u.status == e.Status.error
244
+ }]),
245
+ style: $({
246
+ width: 100 / e.chunks.length + "%"
247
+ })
248
+ }, [
249
+ E("div", {
250
+ class: F({
251
+ uploading: u.progress > 0 && u.progress < 100,
252
+ success: u.progress == 100
253
+ }),
254
+ style: $({
255
+ height: u.progress + "%"
255
256
  })
256
- }, [
257
- F("div", {
258
- class: B({
259
- uploading: p.progress > 0 && p.progress < 100,
260
- success: p.progress == 100
261
- }),
262
- style: H({
263
- height: p.progress + "%"
264
- })
265
- }, null, 6)
266
- ], 6))), 128))
267
- ])) : te("", !0)
257
+ }, null, 6)
258
+ ], 6))), 128))
259
+ ])) : Z("", !0)
260
+ ]),
261
+ U(g, { class: "vkf-download-plus-btng" }, {
262
+ default: _(() => [
263
+ e.fileStatus === e.Status.downloading ? (b(), L(r, {
264
+ key: 0,
265
+ type: "danger",
266
+ onClick: e.handlePause
267
+ }, {
268
+ default: _(() => [
269
+ z(H(e.tr("vkf.common.pause", "暂停")), 1)
270
+ ]),
271
+ _: 1
272
+ }, 8, ["onClick"])) : (b(), L(r, {
273
+ key: 1,
274
+ type: "primary",
275
+ onClick: e.handleDownload
276
+ }, {
277
+ default: _(() => [
278
+ z(H(e.tr("vkf.common.download", "下载")), 1)
279
+ ]),
280
+ _: 1
281
+ }, 8, ["onClick"]))
268
282
  ]),
269
- z(h, { class: "vkf-download-plus-btng" }, {
270
- default: P(() => [
271
- e.fileStatus === e.Status.downloading ? (S(), E(r, {
272
- key: 0,
273
- type: "danger",
274
- onClick: e.handlePause
275
- }, {
276
- default: P(() => [
277
- q(N(e.tr("vkf.common.pause", "暂停")), 1)
278
- ]),
279
- _: 1
280
- }, 8, ["onClick"])) : (S(), E(r, {
281
- key: 1,
282
- type: "primary",
283
- onClick: e.handleDownload
284
- }, {
285
- default: P(() => [
286
- q(N(e.tr("vkf.common.download", "下载")), 1)
287
- ]),
288
- _: 1
289
- }, 8, ["onClick"]))
290
- ]),
291
- _: 1
292
- })
293
- ])
294
- ];
295
- }),
283
+ _: 1
284
+ })
285
+ ])
286
+ ]),
296
287
  _: 1
297
288
  }, 16);
298
289
  }
299
- const $e = /* @__PURE__ */ me(ge, [["render", Se]]), ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
290
+ const Be = /* @__PURE__ */ fe(ve, [["render", ke]]), De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
300
291
  __proto__: null
301
292
  }, Symbol.toStringTag, { value: "Module" }));
302
293
  export {
303
- $e as VkfDownloadPlus,
304
- ze as __VkfDownloadPlus,
305
- $e as default
294
+ Be as VkfDownloadPlus,
295
+ De as __VkfDownloadPlus,
296
+ Be as default
306
297
  };
@@ -30,6 +30,8 @@ export declare const props: {
30
30
  default: undefined;
31
31
  };
32
32
  required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
33
+ error: StringConstructor;
34
+ prop: null;
33
35
  labelPosition: {
34
36
  type: PropType<"left" | "right" | "top" | "start" | "end">;
35
37
  default: undefined;
@@ -67,12 +69,16 @@ export declare const props: {
67
69
  type: BooleanConstructor;
68
70
  default: boolean;
69
71
  };
70
- prop: null;
71
72
  defaultModelValue: null;
72
73
  labelTipProps: {
73
74
  type: PropType<import("element-plus").UseTooltipProps>;
74
75
  default: () => {};
75
76
  };
77
+ ai: {
78
+ type: PropType<import("../../ai-provider").AiConfig>;
79
+ default: undefined;
80
+ };
81
+ aiOutput: null;
76
82
  label: StringConstructor;
77
83
  labelWidth: {
78
84
  readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -86,7 +92,6 @@ export declare const props: {
86
92
  readonly validator: ((val: unknown) => boolean) | undefined;
87
93
  __epPropKey: true;
88
94
  };
89
- error: StringConstructor;
90
95
  validateStatus: {
91
96
  readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
92
97
  readonly required: false;