cloud-web-corejs 1.0.54-dev.57 → 1.0.54-dev.571

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 (471) hide show
  1. package/package.json +21 -13
  2. package/src/App.vue +30 -34
  3. package/src/api/user.js +16 -0
  4. package/src/components/Qrcode/fileParse.vue +0 -1
  5. package/src/components/Tinymce/index.vue +112 -71
  6. package/src/components/VabUpload/image-viewer.vue +2 -2
  7. package/src/components/VabUpload/index.js +49 -1
  8. package/src/components/VabUpload/mixins.js +1822 -2
  9. package/src/components/VabUpload/propertiesDialog.vue +1 -1
  10. package/src/components/VabUpload/view.vue +209 -120
  11. package/src/components/advancedSearchDialog/mixins.js +28 -1
  12. package/src/components/base-textarea/index.vue +104 -0
  13. package/src/components/baseAlert/index.js +44 -1
  14. package/src/components/baseAlert/index.vue +23 -19
  15. package/src/components/baseAlert/mixins.js +61 -1
  16. package/src/components/baseAttachment/index.vue +49 -40
  17. package/src/components/baseAttachment/install.js +21 -5
  18. package/src/components/baseAttachment/mixins.js +310 -1
  19. package/src/components/baseInputBatch/mixins.js +58 -1
  20. package/src/components/baseInputExport/index.vue +19 -12
  21. package/src/components/baseInputExport/mixins.js +391 -1
  22. package/src/components/baseTabs/mixins.js +166 -1
  23. package/src/components/cnPrint/index.js +44 -1
  24. package/src/components/cnPrint/mixins.js +189 -1
  25. package/src/components/code-editor/index.vue +102 -63
  26. package/src/components/confirmDialog/index.js +41 -1
  27. package/src/components/confirmDialog/index.vue +24 -17
  28. package/src/components/confirmDialog/mixins.js +31 -1
  29. package/src/components/errorMsg/index.js +44 -1
  30. package/src/components/errorMsg/index.vue +78 -70
  31. package/src/components/errorMsg/mixins.js +101 -5
  32. package/src/components/excelExport/button.vue +57 -4
  33. package/src/components/excelExport/exportFieldDialog.vue +215 -81
  34. package/src/components/excelExport/index.js +6 -6
  35. package/src/components/excelExport/index.vue +56 -2
  36. package/src/components/excelExport/mixins.js +3 -2
  37. package/src/components/excelImport/index.js +13 -13
  38. package/src/components/excelImport/mixins.js +2 -1
  39. package/src/components/fileLibrary/fileObjAuthDialog.vue +179 -89
  40. package/src/components/fileLibrary/fileObjAuthEditDialog.vue +6 -0
  41. package/src/components/fileLibrary/filterDialog.vue +454 -0
  42. package/src/components/fileLibrary/index.vue +605 -262
  43. package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
  44. package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
  45. package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
  46. package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +339 -211
  47. package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +31 -27
  48. package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +4 -4
  49. package/src/components/fileLibrary/mixins/indexMixins.js +220 -101
  50. package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
  51. package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -3
  52. package/src/components/fileLibrary/propertiesDialog.vue +113 -74
  53. package/src/components/fileLibrary/shareDialog.vue +1 -1
  54. package/src/components/formOplog/mixins.js +77 -1
  55. package/src/components/hiprint/css/bootstrap.min.css +6 -0
  56. package/src/components/hiprint/fonts/glyphicons-halflings-regular.eot +0 -0
  57. package/src/components/hiprint/fonts/glyphicons-halflings-regular.svg +288 -0
  58. package/src/components/hiprint/fonts/glyphicons-halflings-regular.ttf +0 -0
  59. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff +0 -0
  60. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff2 +0 -0
  61. package/src/components/hiprint/hiprint.bundle.js +7 -2
  62. package/src/components/hiprint/view/design/index.vue +140 -47
  63. package/src/components/hiprint/view/design/mixins.js +611 -1
  64. package/src/components/hiprint/view/design/preview.vue +75 -52
  65. package/src/components/hiprint/view/json-view.vue +31 -31
  66. package/src/components/jdPrint/index.js +44 -1
  67. package/src/components/jdPrint/mixins.js +208 -1
  68. package/src/components/jsonImport/index.js +187 -17
  69. package/src/components/jsonImport/mixins.js +333 -1
  70. package/src/components/langImport/index.js +80 -1
  71. package/src/components/langImport/mixins.js +500 -16
  72. package/src/components/langTag/mixins/addButton.js +51 -5
  73. package/src/components/langTag/mixins/deleteButton.js +55 -5
  74. package/src/components/langTag/mixins/view.js +47 -5
  75. package/src/components/luckysheet/dialog.vue +159 -0
  76. package/src/components/luckysheet/export.js +595 -0
  77. package/src/components/luckysheet/fileUtils.js +147 -0
  78. package/src/components/luckysheet/index.js +72 -0
  79. package/src/components/luckysheet/templateJson.js +12078 -0
  80. package/src/components/luckysheet/view.vue +210 -0
  81. package/src/components/obsUpload/index.js +34 -0
  82. package/src/components/obsUpload/index.vue +231 -0
  83. package/src/components/obsUpload/mixins.js +1476 -0
  84. package/src/components/onlineTalk/mixins.js +852 -1
  85. package/src/components/oplogTable/mixins.js +83 -4
  86. package/src/components/pddPrint/index.js +44 -1
  87. package/src/components/pddPrint/mixins.js +252 -1
  88. package/src/components/projectTag/mixins/addButton.js +52 -1
  89. package/src/components/projectTag/mixins/deleteButton.js +52 -1
  90. package/src/components/projectTag/mixins/view.js +43 -1
  91. package/src/components/scriptDescription/button.vue +12 -4
  92. package/src/components/scriptDescription/mixins.js +30 -1
  93. package/src/components/scriptTest/mixins.js +90 -1
  94. package/src/components/statusTag/mixins.js +66 -1
  95. package/src/components/table/CellSlot.vue +1 -0
  96. package/src/components/table/config.js +1 -1
  97. package/src/components/table/index.js +12 -11
  98. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
  99. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
  100. package/src/components/table/tableForm.vue +99 -63
  101. package/src/components/table/tableFormMixin.js +1 -1
  102. package/src/components/table/util/index.js +335 -0
  103. package/src/components/table/vxeFilter/index.js +1 -1
  104. package/src/components/table/vxeFilter/mixin.js +6 -6
  105. package/src/components/tempStorage/index.vue +76 -55
  106. package/src/components/tempStorage/tempStorageDialog.vue +179 -54
  107. package/src/components/vb-tabs/x-tabs.vue +56 -30
  108. package/src/components/vipPrint/index.js +44 -1
  109. package/src/components/vipPrint/mixins.js +268 -1
  110. package/src/components/wf/addOpinionButton.vue +57 -0
  111. package/src/components/wf/content.vue +834 -362
  112. package/src/components/wf/mixins/addOpinionButton.js +53 -0
  113. package/src/components/wf/mixins/setCandidateButton.js +161 -0
  114. package/src/components/wf/mixins/setCandidateDialog.js +213 -1
  115. package/src/components/wf/mixins/setCandidateDialog2.js +252 -0
  116. package/src/components/wf/mixins/wfFlowEleScriptDialog.js +131 -0
  117. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +69 -0
  118. package/src/components/wf/setCandidateButton.vue +40 -0
  119. package/src/components/wf/setCandidateDialog.vue +10 -0
  120. package/src/components/wf/setCandidateDialog2.vue +105 -0
  121. package/src/components/wf/wf.js +2156 -1
  122. package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
  123. package/src/components/wf/wfStartDialog.vue +66 -42
  124. package/src/components/wf/wfTaskUserRangeDialog.vue +65 -0
  125. package/src/components/wf/wfUtil.js +279 -1
  126. package/src/components/xform/form-designer/designer.js +5 -3
  127. package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +434 -0
  128. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +1 -1
  129. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +9 -8
  130. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -1
  131. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +3 -3
  132. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
  133. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
  134. package/src/components/xform/form-designer/form-widget/dialog/exportDialog.vue +13 -0
  135. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +301 -0
  136. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +82 -49
  137. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +5 -1
  138. package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
  139. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +38 -7
  140. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +9 -903
  141. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +196 -73
  142. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +2 -2
  143. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  144. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +32 -4
  145. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
  146. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
  147. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +40 -28
  148. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +18 -7
  149. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
  150. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +95 -0
  151. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +14 -2
  152. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +30 -4
  153. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
  154. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +77 -0
  155. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +106 -0
  156. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +25 -997
  157. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +705 -379
  158. package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +964 -0
  159. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +6 -2
  160. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +22 -11
  161. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +90 -0
  162. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
  163. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +40 -10
  164. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +58 -91
  165. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +8 -1
  166. package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +179 -0
  167. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
  168. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +114 -81
  169. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +186 -0
  170. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +55 -28
  171. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +119 -0
  172. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +154 -47
  173. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +26 -6
  174. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +2 -2
  175. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +86 -0
  176. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +92 -0
  177. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +24 -9
  178. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
  179. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
  180. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +12 -1
  181. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +8 -3
  182. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +31 -17
  183. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +38 -37
  184. package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +99 -0
  185. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +147 -0
  186. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +106 -33
  187. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +2 -2
  188. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +3 -171
  189. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +191 -66
  190. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +753 -0
  191. package/src/components/xform/form-designer/form-widget/indexMixin.js +1 -1
  192. package/src/components/xform/form-designer/indexMixin.js +3 -772
  193. package/src/components/xform/form-designer/refMixinDesign.js +1 -28
  194. package/src/components/xform/form-designer/setting-panel/form-setting.vue +978 -169
  195. package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
  196. package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
  197. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +537 -302
  198. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +4 -4
  199. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +3 -3
  200. package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
  201. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +6 -0
  202. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +28 -0
  203. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
  204. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +125 -0
  205. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +953 -1042
  206. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +432 -0
  207. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
  208. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +1127 -520
  209. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +2 -2
  210. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-pane/detail-pane-editor.vue +3 -3
  211. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
  212. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
  213. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
  214. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +0 -8
  215. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +31 -2
  216. package/src/components/xform/form-designer/setting-panel/property-editor/copyButton-editor.vue +36 -0
  217. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
  218. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
  219. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +32 -0
  220. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -7
  221. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +35 -20
  222. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +64 -5
  223. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +27 -0
  224. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
  225. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
  226. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +25 -0
  227. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +5 -5
  228. package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
  229. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +77 -20
  230. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -0
  231. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +44 -15
  232. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -0
  233. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
  234. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/preWrap-editor.vue +23 -0
  235. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
  236. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +67 -41
  237. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +56 -0
  238. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +71 -0
  239. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +24 -8
  240. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +13 -1
  241. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +33 -1
  242. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +66 -0
  243. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +89 -19
  244. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +137 -0
  245. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +721 -466
  246. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +20 -11
  247. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +1 -1
  248. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
  249. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +1 -1
  250. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
  251. package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +19 -14
  252. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
  253. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +124 -50
  254. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
  255. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
  256. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +349 -0
  257. package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +10 -6
  258. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +3 -3
  259. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
  260. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +42 -0
  261. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +305 -19
  262. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +2 -2
  263. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +2 -2
  264. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +372 -50
  265. package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +263 -0
  266. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +35 -11
  267. package/src/components/xform/form-designer/toolbar-panel/index.vue +12 -11
  268. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -1
  269. package/src/components/xform/form-designer/widget-panel/index.vue +21 -1
  270. package/src/components/xform/form-designer/widget-panel/indexMixin.js +19 -18
  271. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1724 -917
  272. package/src/components/xform/form-render/container-item/containerItemMixin.js +12 -11
  273. package/src/components/xform/form-render/container-item/data-table-item.vue +206 -198
  274. package/src/components/xform/form-render/container-item/data-table-mixin.js +22 -1685
  275. package/src/components/xform/form-render/container-item/detail-pane-item.vue +17 -3
  276. package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
  277. package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
  278. package/src/components/xform/form-render/container-item/list-h5-item.vue +1 -9
  279. package/src/components/xform/form-render/container-item/list-h5-item2.vue +1 -8
  280. package/src/components/xform/form-render/container-item/tab-item.vue +62 -25
  281. package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
  282. package/src/components/xform/form-render/container-item/table-item.vue +4 -2
  283. package/src/components/xform/form-render/container-item/table2-cell-item.vue +53 -34
  284. package/src/components/xform/form-render/container-item/table2-item.vue +153 -92
  285. package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
  286. package/src/components/xform/form-render/dynamicDialogRender.js +1 -1
  287. package/src/components/xform/form-render/index.vue +77 -20
  288. package/src/components/xform/form-render/indexMixin.js +24 -12
  289. package/src/components/xform/form-render/refMixin.js +3 -3
  290. package/src/components/xform/lang/zh-CN.js +29 -4
  291. package/src/components/xform/mixins/defaultHandle.js +3 -2
  292. package/src/components/xform/mixins/scriptHttp.js +3 -1
  293. package/src/components/xform/utils/emitter.js +4 -4
  294. package/src/components/xform/utils/formHttp.js +162 -0
  295. package/src/components/xform/utils/format.js +41 -34
  296. package/src/components/xform/utils/formula-util.js +966 -0
  297. package/src/components/xform/utils/util.js +5 -1
  298. package/src/components/xform/utils/validators.js +2 -5
  299. package/src/components/xform/utils/vue2js-generator.js +2 -2
  300. package/src/components/xhsPrint/index.js +44 -1
  301. package/src/components/xhsPrint/mixins.js +269 -1
  302. package/src/directive/LimitNumber/index.js +125 -1
  303. package/src/directive/el-dialog-center/index.js +34 -1
  304. package/src/directive/el-drag-dialog/drag.js +86 -1
  305. package/src/directive/el-readonly/index.js +15 -1
  306. package/src/directive/permission/hasPermi.js +34 -1
  307. package/src/index.js +215 -190
  308. package/src/lang/index.js +56 -51
  309. package/src/lang/locale/en/login.js +20 -0
  310. package/src/lang/locale/zh/login.js +20 -0
  311. package/src/layout/components/AppMain.vue +8 -1
  312. package/src/layout/components/Sidebar/default.vue +1423 -1222
  313. package/src/layout/components/TagsView/index.vue +37 -12
  314. package/src/layout/components/createCompany/createCompanyDialog.vue +157 -0
  315. package/src/layout/components/extractedCode/createDialog.vue +92 -0
  316. package/src/layout/components/extractedCode/queryDialog.vue +96 -0
  317. package/src/layout/components/extractedCode/viewDialog.vue +193 -0
  318. package/src/layout/components/watermark/index.vue +83 -0
  319. package/src/layout/defaultLayout.vue +1 -1
  320. package/src/mixins/selectDialog/index.js +266 -1
  321. package/src/mixins/tableTree/index.js +199 -4
  322. package/src/mixins/wf/index.js +33 -1
  323. package/src/permission.js +135 -18
  324. package/src/resources/js/base/common.js +109 -109
  325. package/src/router/modules/customer.js +0 -15
  326. package/src/router/modules/system.js +4 -0
  327. package/src/store/config/index.js +667 -1
  328. package/src/store/getters.js +3 -1
  329. package/src/store/modules/permission.js +46 -41
  330. package/src/store/modules/settings.js +1 -1
  331. package/src/store/modules/tagsView.js +5 -8
  332. package/src/store/modules/user.js +10 -16
  333. package/src/utils/aes.js +2 -1
  334. package/src/utils/auth.js +1 -1
  335. package/src/utils/global.js +1 -1
  336. package/src/utils/index.js +2 -3
  337. package/src/utils/keepAlive.js +1 -1
  338. package/src/utils/pddLog.js +92 -0
  339. package/src/utils/pdfUtil.js +71 -0
  340. package/src/utils/request.js +1 -1
  341. package/src/utils/vab.js +19 -27
  342. package/src/utils/validate.js +1 -1
  343. package/src/utils/wf.js +4 -4
  344. package/src/views/bd/setting/bd_attach_setting/edit.vue +5 -5
  345. package/src/views/bd/setting/bd_attach_setting/list.vue +28 -55
  346. package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +4 -5
  347. package/src/views/bd/setting/bd_attach_setting/mixins/list.js +1 -1
  348. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -0
  349. package/src/views/bd/setting/bd_company_env/edit.vue +193 -0
  350. package/src/views/bd/setting/bd_company_env/list.vue +175 -0
  351. package/src/views/bd/setting/config_manage/list.vue +83 -0
  352. package/src/views/bd/setting/form_import_log/edit.vue +127 -0
  353. package/src/views/bd/setting/form_import_log/list.vue +206 -0
  354. package/src/views/bd/setting/form_script/edit.vue +9 -0
  355. package/src/views/bd/setting/form_script/edit1.vue +36 -3
  356. package/src/views/bd/setting/form_script/form_list.vue +99 -37
  357. package/src/views/bd/setting/form_script/list1.vue +181 -118
  358. package/src/views/bd/setting/form_script/mixins/dialog.js +1 -7
  359. package/src/views/bd/setting/form_script/mixins/edit.js +1 -7
  360. package/src/views/bd/setting/form_script/mixins/edit1.js +1 -9
  361. package/src/views/bd/setting/form_script/mixins/form_list.js +1 -14
  362. package/src/views/bd/setting/form_script/mixins/list.js +1 -8
  363. package/src/views/bd/setting/form_script/mixins/list1.js +1 -14
  364. package/src/views/bd/setting/form_script/mixins/list2.js +1 -5
  365. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +1 -0
  366. package/src/views/bd/setting/form_script/mixins/preformDialog.js +1 -3
  367. package/src/views/bd/setting/form_script/otherAuthDialog.vue +83 -0
  368. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +2 -2
  369. package/src/views/bd/setting/form_template/edit.vue +22 -1
  370. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
  371. package/src/views/bd/setting/form_template/list.vue +326 -214
  372. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +2 -277
  373. package/src/views/bd/setting/form_template/mixins/edit.js +10 -9
  374. package/src/views/bd/setting/form_template/mixins/list.js +25 -22
  375. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +7 -0
  376. package/src/views/bd/setting/form_template/mixins/wf_list.js +1 -423
  377. package/src/views/bd/setting/form_template/otherAuthDialog.vue +83 -0
  378. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +4 -4
  379. package/src/views/bd/setting/form_template/wf_list.vue +1 -1
  380. package/src/views/bd/setting/logic_param/edit.vue +146 -0
  381. package/src/views/bd/setting/logic_param/edit1.vue +106 -0
  382. package/src/views/bd/setting/logic_param/edit2.vue +139 -0
  383. package/src/views/bd/setting/logic_param/list.vue +74 -0
  384. package/src/views/bd/setting/logic_param/list1.vue +12 -0
  385. package/src/views/bd/setting/logic_param/list2.vue +12 -0
  386. package/src/views/bd/setting/logic_param/mixins/edit.js +3 -0
  387. package/src/views/bd/setting/logic_param/mixins/list.js +9 -0
  388. package/src/views/bd/setting/menu_kind/list.vue +172 -83
  389. package/src/views/bd/setting/menu_kind/mixins/authDialog.js +7 -7
  390. package/src/views/bd/setting/menu_kind/mixins/list.js +1 -1
  391. package/src/views/bd/setting/push_data/edit.vue +139 -0
  392. package/src/views/bd/setting/push_data/list.vue +283 -0
  393. package/src/views/bd/setting/push_data_h/edit.vue +153 -0
  394. package/src/views/bd/setting/push_data_h/list.vue +293 -0
  395. package/src/views/bd/setting/request_async_setting/edit.vue +320 -0
  396. package/src/views/bd/setting/request_async_setting/list.vue +372 -0
  397. package/src/views/bd/setting/request_setting/edit.vue +300 -0
  398. package/src/views/bd/setting/request_setting/list.vue +311 -0
  399. package/src/views/bd/setting/table_model/edit.vue +875 -426
  400. package/src/views/bd/setting/table_model/list.vue +190 -128
  401. package/src/views/bd/setting/table_model/mixins/dialog.js +1 -1
  402. package/src/views/bd/setting/table_model/mixins/edit copy.js +903 -0
  403. package/src/views/bd/setting/table_model/mixins/edit.js +14 -13
  404. package/src/views/bd/setting/table_model/mixins/list.js +14 -14
  405. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +7 -0
  406. package/src/views/bd/setting/table_model/otherAuthDialog.vue +83 -0
  407. package/src/views/user/access_log/list.vue +418 -349
  408. package/src/views/user/area/dialog.vue +223 -117
  409. package/src/views/user/area/list.vue +318 -0
  410. package/src/views/user/bill_setting/edit.vue +1 -1
  411. package/src/views/user/bill_setting/list.vue +1 -1
  412. package/src/views/user/common_attribute/itemEdit.vue +2 -2
  413. package/src/views/user/common_attribute/list.vue +5 -2
  414. package/src/views/user/common_script/edit.vue +1 -1
  415. package/src/views/user/common_script/list.vue +1 -1
  416. package/src/views/user/company_info/dialog.vue +195 -163
  417. package/src/views/user/company_info/edit.vue +1 -1
  418. package/src/views/user/extend_datasource/dialog.vue +4 -0
  419. package/src/views/user/extend_datasource/edit.vue +5 -1
  420. package/src/views/user/extend_datasource/list.vue +5 -1
  421. package/src/views/user/fieldTranslation/editDialog.vue +7 -7
  422. package/src/views/user/fieldTranslation/list.vue +32 -32
  423. package/src/views/user/form/vform/designer.vue +776 -749
  424. package/src/views/user/form/vform/out_render.vue +1 -1
  425. package/src/views/user/form/vform/render.vue +59 -37
  426. package/src/views/user/form/view/edit.vue +38 -37
  427. package/src/views/user/form/view/list.vue +261 -49
  428. package/src/views/user/home/default.vue +1026 -979
  429. package/src/views/user/home/dev.vue +29 -0
  430. package/src/views/user/home/index.vue +16 -6
  431. package/src/views/user/login/default.vue +165 -36
  432. package/src/views/user/login/index.vue +4 -6
  433. package/src/views/user/login/indexMixin.js +186 -9
  434. package/src/views/user/menu/list.vue +24 -1
  435. package/src/views/user/notify_message/dialog.vue +44 -22
  436. package/src/views/user/notify_template/edit.vue +188 -187
  437. package/src/views/user/notify_template/edit2.vue +176 -0
  438. package/src/views/user/notify_template/list.vue +4 -1
  439. package/src/views/user/notify_template/list2.vue +190 -0
  440. package/src/views/user/outLink/form_view.vue +211 -211
  441. package/src/views/user/outLink/index.vue +67 -11
  442. package/src/views/user/position/list.vue +4 -4
  443. package/src/views/user/project_tag/dialog.vue +9 -4
  444. package/src/views/user/project_tag/edit.vue +2 -2
  445. package/src/views/user/project_tag/list.vue +9 -4
  446. package/src/views/user/push_setting/list.vue +2 -2
  447. package/src/views/user/request_setting/edit.vue +258 -0
  448. package/src/views/user/request_setting/list.vue +248 -0
  449. package/src/views/user/role/authConfig.vue +89 -0
  450. package/src/views/user/role/dialog.vue +70 -48
  451. package/src/views/user/role/edit.vue +609 -429
  452. package/src/views/user/role/list.vue +4 -4
  453. package/src/views/user/sale_org/dialog.vue +1 -1
  454. package/src/views/user/sale_org/list.vue +4 -1
  455. package/src/views/user/user/dialog.vue +46 -23
  456. package/src/views/user/user/edit.vue +1290 -1021
  457. package/src/views/user/user/form_dialog.vue +158 -0
  458. package/src/views/user/user/form_info.vue +210 -0
  459. package/src/views/user/user/list.vue +652 -563
  460. package/src/views/user/user/modifyPasswordDialog.vue +64 -53
  461. package/src/views/user/wf/wfReport/index.vue +619 -0
  462. package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -0
  463. package/src/views/user/wf/wf_manage/list.vue +379 -250
  464. package/src/views/user/wf/wf_manage/wfContentDialog.vue +25 -22
  465. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +109 -0
  466. package/src/views/user/wf/wf_obj_config/itemEdit.vue +25 -1
  467. package/src/views/user/wf/wf_obj_config/list.vue +114 -9
  468. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +2 -2
  469. package/src/views/user/wf/wf_transfer_setting/edit.vue +282 -0
  470. package/src/views/user/wf/wf_transfer_setting/list.vue +319 -0
  471. package/src/utils/renderUtils.js +0 -76
@@ -0,0 +1,1476 @@
1
+ /**version-1.0*/
2
+ let tmixins;
3
+ import axios from "axios";
4
+ import SparkMD5 from "spark-md5";
5
+ import settingConfig from "@/settings.js";
6
+ import ObsClient from "esdk-obs-browserjs/src/obs";
7
+
8
+ let imFun = {
9
+ axios,
10
+ SparkMD5,
11
+ };
12
+
13
+ tmixins = {
14
+ props: {
15
+ auto: {
16
+ type: Boolean,
17
+ default: true,
18
+ },
19
+ url: {
20
+ type: String,
21
+ default: "/upload",
22
+ },
23
+ name: {
24
+ type: String,
25
+ default: "file",
26
+ },
27
+ limit: {
28
+ type: Number,
29
+ default: () => 100000,
30
+ },
31
+ size: {
32
+ type: Number,
33
+ default: 200,
34
+ },
35
+ accept: {
36
+ type: String,
37
+ default: "file",
38
+ },
39
+ chunkSize: {
40
+ type: Number,
41
+ default: 5, //5MB
42
+ },
43
+ confirmUpload: {
44
+ type: Function,
45
+ },
46
+ pickPrivateProfile: {
47
+ type: Boolean,
48
+ default: true,
49
+ },
50
+ multi: {
51
+ type: [String, Boolean],
52
+ default: true,
53
+ },
54
+ uploadingLimit: {
55
+ type: Number,
56
+ default: 5, //5MB
57
+ },
58
+ },
59
+ data() {
60
+ return {
61
+ show: false,
62
+ loading: false,
63
+ dialogVisible: false,
64
+ dialogImageUrl: "",
65
+ action: "",
66
+ headers: {},
67
+ fileList: [],
68
+ picture: "picture",
69
+ allImgNum: 0,
70
+ imgNum: 0,
71
+ imgSuccessNum: 0,
72
+ imgErrorNum: 0,
73
+ typeList: null,
74
+ title: this.$t2("上传", "components.VabUpload.title"),
75
+ dialogFormVisible: false,
76
+ data: {},
77
+ fileViewDialogVisible: false,
78
+ fileViewInfo: {},
79
+ total: 0,
80
+ video: null,
81
+ btn: false,
82
+ filePartMap: {},
83
+ uploading: false,
84
+ hasReadyFile: false,
85
+ showLocalUploadBtn: false,
86
+ showPrivateUploadBtn: false,
87
+ showPrivateProfileDialog: false,
88
+ pasteList: [],
89
+ pasteAreaStatus: false,
90
+ option: {},
91
+ editFileIndex: -1,
92
+ showFileNameDialog: false,
93
+ editFileName: null,
94
+ editFileSuffix: null,
95
+ beforeUploadFlag: false,
96
+ uploadUrl: null,
97
+
98
+ access_key_id: "HPUAQ1TAFXWGOKSNKCGW", // 你的ak
99
+ secret_access_key: "Ns1nwPwikK67Acbhj3wlfUambjbdroqpk0TFv7qg", // 你的sk
100
+ server: "https://obs.cn-south-1.myhuaweicloud.com", // 你的endPoint 记得加入https://
101
+ Bucket: "gztw-file01", // 你的桶名
102
+ };
103
+ },
104
+ beforeDestroy() {
105
+ this.removePasteEvent();
106
+ },
107
+ filters: {
108
+ btnText(btn) {
109
+ return btn
110
+ ? this.$t2("继续", "components.VabUpload.continue")
111
+ : this.$t2("暂停", "components.VabUpload.pause");
112
+ },
113
+ totalText(total) {
114
+ return total > 100 ? 100 : total;
115
+ },
116
+ },
117
+ computed: {
118
+ percentage() {
119
+ if (this.allImgNum == 0) return 0;
120
+ return ((this.imgNum / this.allImgNum, 2) * 100).toFixed(0);
121
+ },
122
+ fileMaxSize() {
123
+ return this.formatFileSize(this.size * 1024 * 1024);
124
+ },
125
+ errorQuantity() {
126
+ return this.fileList.filter((file) => file.status == "fail").length;
127
+ },
128
+ totalQuantity() {
129
+ return this.fileList.length;
130
+ },
131
+ successQuantity() {
132
+ return this.fileList.filter((file) => file.status == "success").length;
133
+ },
134
+ isMulti: function () {
135
+ let isMulti = true;
136
+ if (this.multi === "false" || this.multi === false || this.limit === 1) {
137
+ isMulti = false;
138
+ }
139
+ return isMulti;
140
+ },
141
+ },
142
+ methods: {
143
+ updateUploadingStatus() {
144
+ var target = this.$refs.upload;
145
+ let uploading, hasReadyFile;
146
+ if (target) {
147
+ var fileList = target.uploadFiles;
148
+ let n = fileList.find((item) => {
149
+ // return item.percentage != 100;
150
+ return item.status == "uploading" || item.status == "preUpload";
151
+ });
152
+ uploading = n == null ? false : true;
153
+
154
+ let readyFiles = fileList.filter((file) => file.status == "ready");
155
+ hasReadyFile = readyFiles.length > 0;
156
+ } else {
157
+ uploading = false;
158
+ hasReadyFile = false;
159
+ }
160
+
161
+ this.uploading = uploading;
162
+ this.hasReadyFile = hasReadyFile;
163
+ this.checkPreUploadList();
164
+ return uploading;
165
+ },
166
+ submitUpload() {
167
+ let successDone = () => {
168
+ this.$refs.upload.submit();
169
+ };
170
+ var files = this.$refs.upload.uploadFiles;
171
+ let readyFiles = files.filter((file) => file.status == "ready");
172
+ if (this.confirmUpload) {
173
+ if (readyFiles.length) {
174
+ this.confirmUpload({
175
+ files: files,
176
+ done: successDone,
177
+ });
178
+ }
179
+ } else {
180
+ successDone();
181
+ }
182
+ },
183
+ handleProgress(event, file, fileList) {
184
+ // this.loading = true
185
+ // this.show = true
186
+ },
187
+ handleChange(file, fileList) {
188
+ let maxSize = this.size * 1024 * 1024;
189
+ if (file.size > maxSize) {
190
+ fileList.map((item, index) => {
191
+ if (item === file) {
192
+ fileList.splice(index, 1);
193
+ }
194
+ });
195
+ this.fileList = fileList;
196
+ let errorText =
197
+ "文件[" + file.name + "]大小超出限制" + this.fileMaxSize;
198
+ this.$message({
199
+ message: this.$t2(errorText, "components.VabUpload.warnMsg1", {
200
+ fileName: file.name,
201
+ fileMaxSize: this.fileMaxSize,
202
+ }),
203
+ type: "error",
204
+ duration: 3 * 1000,
205
+ });
206
+ file.raw.status = "fail";
207
+ return false;
208
+ } else {
209
+ this.fileList = fileList;
210
+ this.allImgNum = fileList.length;
211
+ }
212
+ this.updateUploadingStatus();
213
+ },
214
+ handleSuccess(response, file, fileList) {
215
+ if (file.percentage == 100) {
216
+ this.imgNum = this.imgNum + 1;
217
+ this.imgSuccessNum = this.imgSuccessNum + 1;
218
+ }
219
+ if (fileList.length === this.imgNum) {
220
+ this.fileList = fileList;
221
+ }
222
+
223
+ setTimeout(() => {
224
+ this.loading = false;
225
+ this.show = false;
226
+ }, 1000);
227
+ this.updateUploadingStatus();
228
+ },
229
+ handleError(err, file, fileList) {
230
+ this.imgNum = this.imgNum + 1;
231
+ this.imgErrorNum = this.imgErrorNum + 1;
232
+ setTimeout(() => {
233
+ this.loading = false;
234
+ this.show = false;
235
+ }, 1000);
236
+ this.updateUploadingStatus();
237
+ },
238
+ handleRemove(file, fileList) {
239
+ this.imgNum = this.imgNum - 1;
240
+ this.allNum = this.allNum - 1;
241
+ this.updateUploadingStatus();
242
+ },
243
+ handlePreview(file) {
244
+ this.dialogImageUrl = file.url;
245
+ this.dialogVisible = true;
246
+ },
247
+ handleExceed(files, fileList) {
248
+ let errorMsg = `当前限制选择 ${this.limit} 个文件,本次选择了
249
+ ${files.length}
250
+ 个文件`;
251
+ this.$message({
252
+ message: this.$t2(errorMsg, "components.VabUpload.warnMsg2", {
253
+ limit: this.limit,
254
+ size: files.length,
255
+ }),
256
+ type: "error",
257
+ duration: 5 * 1000,
258
+ });
259
+ },
260
+ handleShow(option) {
261
+ this.getFileServerInfo(option,()=>{
262
+ this.title = this.$t2("上传", "components.VabUpload.title");
263
+ // this.data = data;
264
+ this.option = option;
265
+ this.clearFileInfo();
266
+ this.initPickUploadMode();
267
+ this.pasteAreaStatus = false;
268
+ this.dialogFormVisible = true;
269
+
270
+ this.removePasteEvent();
271
+ this.addPasteEvent();
272
+ })
273
+
274
+ },
275
+ addPasteEvent() {
276
+ document.addEventListener("click", this.blurPasteEvent);
277
+ document.addEventListener("paste", this.pasteEvent);
278
+ },
279
+ removePasteEvent() {
280
+ document.removeEventListener("click", this.blurPasteEvent);
281
+ document.removeEventListener("paste", this.pasteEvent);
282
+ },
283
+ blurPasteEvent() {
284
+ this.pasteAreaStatus = false;
285
+ },
286
+ handleClose() {
287
+ let target = this.$refs.upload;
288
+ (target.uploadFiles || []).forEach((uploadFile) => {
289
+ if (uploadFile.status == "uploading" || uploadFile.status == "ready") {
290
+ uploadFile.raw.abort &&
291
+ uploadFile.raw.abort(
292
+ this.$t2("取消上传", "components.VabUpload.cancelUpload")
293
+ );
294
+ }
295
+ });
296
+ this.picture = "picture";
297
+ this.clearFileInfo();
298
+ this.dialogFormVisible = false;
299
+ },
300
+ clearFileInfo() {
301
+ this.fileList = [];
302
+ this.allImgNum = 0;
303
+ this.imgNum = 0;
304
+ this.imgSuccessNum = 0;
305
+ this.imgErrorNum = 0;
306
+ },
307
+ initUploadUrl() {
308
+ let mineUploadUrl = window.BASE_FILEURL;
309
+ return this.$http({
310
+ url: mineUploadUrl,
311
+ method: "post",
312
+ data: {
313
+ isAuth: false,
314
+ },
315
+ success: (res) => {
316
+ this.uploadUrl = res.objx;
317
+ },
318
+ });
319
+ },
320
+ handleBeforeUpload(file, checkFile, callback) {
321
+ /*if (checkFile !== false) {
322
+ let target = this.$refs.upload;
323
+ let nFile = target.getFile(file);
324
+ if (!nFile) {
325
+ return false;
326
+ }
327
+ }
328
+ let mineUploadUrl = window.BASE_FILEURL;
329
+ return await this.$http({
330
+ url: mineUploadUrl,
331
+ method: 'post',
332
+ data: {
333
+ isAuth: false
334
+ },
335
+ success: res => {
336
+ this.uploadUrl = res.objx;
337
+ callback && callback()
338
+ }
339
+ });*/
340
+ callback && callback();
341
+ },
342
+ formatFileSize(fileSize) {
343
+ return formatFileSize(fileSize);
344
+ },
345
+ //自定义上传
346
+ async uploadSectionFile(param, isCustom, uploadConfig) {
347
+ if (!this.uploadUrl) {
348
+ await this.initUploadUrl();
349
+ }
350
+ let that = this;
351
+ var fileObj = param.file;
352
+
353
+ let source;
354
+
355
+ var form = new FormData();
356
+ // 文件对象
357
+ form.append("file", fileObj);
358
+
359
+ let target = that.$refs.upload;
360
+ let file = target ? target.getFile(fileObj) : null;
361
+ if (file) {
362
+ file.status = "uploading";
363
+ }
364
+
365
+ let isLoading = uploadConfig?.isLoading === true;
366
+ var uploadUrl = this.uploadUrl;
367
+ if (uploadUrl) {
368
+ var abort;
369
+ let config = {
370
+ isLoading: isLoading,
371
+ headers: {
372
+ "Content-Type": "multipart/form-data",
373
+ },
374
+ cancelToken: new imFun.axios.CancelToken(function executor(c) {
375
+ if (!isCustom) {
376
+ abort = c;
377
+ if (file) file.abort = c;
378
+ }
379
+ }),
380
+ onUploadProgress: (progressEvent) => {
381
+ if (isCustom || file) {
382
+ // progressEvent.loaded:已上传文件大小
383
+ // progressEvent.total:被上传文件的总大小
384
+ progressEvent.percent = Math.floor(
385
+ (progressEvent.loaded * 100) / progressEvent.total
386
+ );
387
+ if (!isCustom) {
388
+ param.onProgress(progressEvent, fileObj);
389
+ }
390
+ uploadConfig &&
391
+ uploadConfig.onProgress &&
392
+ uploadConfig.onProgress(progressEvent, fileObj);
393
+ }
394
+ },
395
+ failMsg: false,
396
+ }; //添加请求头
397
+
398
+ let req = this.$http
399
+ .post(uploadUrl, form, config)
400
+ .then((res1) => {
401
+ uploadConfig &&
402
+ uploadConfig.callback &&
403
+ uploadConfig.callback(res1, fileObj);
404
+ if (!isCustom) {
405
+ if (res1.type == "success") {
406
+ param.onSuccess(res1, fileObj);
407
+ } else {
408
+ // param.onError(new Error(res1.content || '上传异常'));
409
+ this.handleFileError(
410
+ new Error(
411
+ res1.content ||
412
+ this.$t2(
413
+ "上传异常",
414
+ "components.VabUpload.uploadException"
415
+ )
416
+ ),
417
+ fileObj
418
+ );
419
+ }
420
+ }
421
+ })
422
+ .catch((error, a, b, c) => {
423
+ // let {err} = error;
424
+ try {
425
+ // param.onError(err, fileObj);
426
+ if (!isCustom) {
427
+ this.handleFileError(error, fileObj);
428
+ }
429
+ uploadConfig &&
430
+ uploadConfig.error &&
431
+ uploadConfig.error(error, fileObj);
432
+ } catch (tt) {}
433
+ });
434
+ req.abort = () => {
435
+ abort(this.$t2("取消上传", "components.VabUpload.cancelUpload"));
436
+ };
437
+ //return req;
438
+ }
439
+ },
440
+ singerUpload(uploadConfig) {
441
+ let onUploadProgress = uploadConfig.onUploadProgress;
442
+ let success = uploadConfig.success;
443
+ let file = uploadConfig.file;
444
+ this.handleBeforeUpload(file, false, () => {
445
+ this.uploadSectionFile(
446
+ {
447
+ file: file,
448
+ },
449
+ true,
450
+ uploadConfig
451
+ );
452
+ });
453
+ },
454
+ //begin
455
+ fileParse(file, type = "base64", callback) {
456
+ /*return new Promise(resolve => {
457
+
458
+ });*/
459
+ let fileRead = new FileReader();
460
+ if (type === "base64") {
461
+ fileRead.readAsDataURL(file);
462
+ } else if (type === "buffer") {
463
+ fileRead.readAsArrayBuffer(file);
464
+ }
465
+ fileRead.onload = (ev) => {
466
+ callback(ev.target.result);
467
+ // resolve(ev.target.result);
468
+ };
469
+ },
470
+ changeFile(param) {
471
+ if (!param.file || param.file.status == "fail") return;
472
+
473
+ let target = this.$refs.upload;
474
+ if (!target) return;
475
+ let fileObj = target.getFile(param.file);
476
+ fileObj.status = "preUpload";
477
+ this.checkPreUploadList();
478
+ },
479
+ getFileServerInfoData(callback){
480
+ this.$http({
481
+ url: USER_PREFIX + "/logic_param/getFileServerInfo",
482
+ method: "post",
483
+ data: {paramCode: "obs"},
484
+ failMsg: false,
485
+ errorMsg: false,
486
+ modal: false,
487
+ success: (res) => {
488
+ if(res.objx){
489
+ callback && callback(res.objx);
490
+ }else{
491
+ callback && callback();
492
+ }
493
+ },
494
+ error: (err) => {
495
+ callback && callback();
496
+ }
497
+ })
498
+ },
499
+ getFileServerInfo(option,callback){
500
+ if(option.obsConfig){
501
+ let fileServerInfo = option.obsConfig;
502
+ this.initObsClient(fileServerInfo);
503
+ callback && callback();
504
+ }else{
505
+ this.getFileServerInfoData((res)=>{
506
+ if(res?.obsConfig){
507
+ let obsConfig = res.obsConfig;
508
+ let access_key_id = obsConfig.access_key_id;
509
+ if(access_key_id && access_key_id.indexOf("abc")===3){
510
+ access_key_id = access_key_id.replace("abc","");
511
+ }else{
512
+ this.$message.error(this.$t1("上传服务信息[access_key_id]数据异常"))
513
+ return
514
+ }
515
+ let secret_access_key = obsConfig.secret_access_key;
516
+ if(secret_access_key && secret_access_key.indexOf("abc")===3){
517
+ secret_access_key = secret_access_key.replace("abc","");
518
+ }else{
519
+ this.$message.error(this.$t1("上传服务信息[secret_access_key]数据异常"))
520
+ return
521
+ }
522
+ this.initObsClient({
523
+ ...obsConfig,
524
+ access_key_id,
525
+ secret_access_key
526
+ });
527
+ callback && callback();
528
+ }else{
529
+ this.$message.error(this.$t1("上传服务信息未维护"))
530
+ }
531
+ })
532
+ }
533
+ },
534
+ //obs begin
535
+ initObsClient(obsConfig) {
536
+ this.obsConfig = obsConfig;
537
+ this.obsClient = new ObsClient({
538
+ access_key_id: obsConfig.access_key_id,
539
+ secret_access_key: obsConfig.secret_access_key,
540
+ server: obsConfig.server,
541
+ // obsClient: ''
542
+ });
543
+ },
544
+ getBucket(){
545
+ return this.obsConfig.Bucket;
546
+ },
547
+ abortMultipartUpload(file, callback) {
548
+ if (file.uploadId && file.status == "uploading") {
549
+ this.obsClient
550
+ .abortMultipartUpload({
551
+ Bucket: this.getBucket(),
552
+ Key: file.obsKey,
553
+ UploadId: file.uploadId,
554
+ })
555
+ .then((result) => {
556
+ if (result.CommonMsg.Status < 300) {
557
+ callback && callback();
558
+ }
559
+ });
560
+ } else {
561
+ callback && callback();
562
+ }
563
+ },
564
+ createUUID() {
565
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
566
+ .replace(/[xy]/g, function (c) {
567
+ var r = (Math.random() * 16) | 0,
568
+ v = c == "x" ? r : (r & 0x3) | 0x8;
569
+ return v.toString(16);
570
+ })
571
+ .replaceAll("-", "");
572
+ },
573
+ handleUpload(file) {
574
+ let target = this.$refs.upload;
575
+ let fileObj = target.getFile(file);
576
+ fileObj.status = "uploading";
577
+ // this.initiateData.option = option;
578
+ this.fileUrl = "";
579
+ var _this = this;
580
+ let fileSuffix = this.$commonFileUtil.getFileSuffix(file.name);
581
+ let uuids = this.createUUID() + Date.now();
582
+ fileObj.obsKey = uuids + "." + fileSuffix;
583
+ const params = {
584
+ Bucket: this.getBucket(),
585
+ Key: fileObj.obsKey,
586
+ };
587
+ // let target = this.$refs.upload;
588
+ // let fileObj = target.getFile(option.file);
589
+ // fileObj.obsKey = uuids;
590
+ setTimeout(() => {
591
+ this.obsClient.initiateMultipartUpload(params).then((result) => {
592
+ if (result.CommonMsg.Status < 300) {
593
+ var uploadId = result.InterfaceResult.UploadId;
594
+ // _this.initiateData.uploadId = uploadId;
595
+ fileObj.uploadId = uploadId;
596
+ /*
597
+ * Step 2: upload a part
598
+ */
599
+ var etag = [];
600
+ var uploadPromise = new Promise((resolve) => {
601
+ var partLen = 5 * 1024 * 1024;
602
+ var count = Math.ceil(file.size / partLen);
603
+ var indexNum = 0;
604
+ this.uploadPartMethod(
605
+ file,
606
+ uploadId,
607
+ indexNum,
608
+ partLen,
609
+ etag,
610
+ count,
611
+ resolve
612
+ );
613
+ });
614
+ uploadPromise.then((result) => {
615
+ const paramsEnd = {
616
+ Bucket: this.getBucket(),
617
+ Key: fileObj.obsKey,
618
+ UploadId: uploadId,
619
+ Parts: etag.sort((a, b) => a.PartNumber - b.PartNumber),
620
+ };
621
+ this.obsClient
622
+ .completeMultipartUpload(paramsEnd)
623
+ .then((result) => {
624
+ if (result.CommonMsg.Status < 300) {
625
+ let fileUrl = _this.getImageUrl(file);
626
+ let fileData = this.parseFileUrl(fileUrl, file);
627
+ target.handleProgress({ percent: 100 }, file);
628
+
629
+ target.handleSuccess(
630
+ {
631
+ type: "success",
632
+ objx: fileData,
633
+ },
634
+ file
635
+ );
636
+ } else {
637
+ this.handleFileError(
638
+ new Error(
639
+ result.CommonMsg.Message ||
640
+ this.$t2(
641
+ "上传异常",
642
+ "components.VabUpload.uploadException"
643
+ )
644
+ ),
645
+ file
646
+ );
647
+ }
648
+ });
649
+ });
650
+ } else {
651
+ this.handleFileError(
652
+ new Error(
653
+ result.CommonMsg.Message ||
654
+ this.$t2("上传异常", "components.VabUpload.uploadException")
655
+ ),
656
+ file
657
+ );
658
+ }
659
+ });
660
+ }, 20);
661
+ },
662
+ parseFileUrl(fileUrl,file) {
663
+ if (!fileUrl) return null;
664
+ let result = null;
665
+
666
+ // 输入校验
667
+ if (typeof fileUrl !== "string") {
668
+ throw new TypeError("输入必须是字符串格式");
669
+ }
670
+ if (!fileUrl.trim()) {
671
+ throw new Error("URL不能为空");
672
+ }
673
+
674
+ // 基本URL格式验证
675
+ const urlRegex =
676
+ /^(https?:\/\/)?([\w.-]+)(:\d+)?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i;
677
+ if (!urlRegex.test(fileUrl)) {
678
+ throw new Error("无效的URL格式");
679
+ }
680
+
681
+ // 提取域名部分
682
+ const domainRegex = /^(https?:\/\/[^\/]+)/i;
683
+ const domainMatch = fileUrl.match(domainRegex);
684
+ if (!domainMatch) {
685
+ throw new Error("URL缺少协议或域名部分");
686
+ }
687
+ const domain = domainMatch[0];
688
+
689
+ // 提取完整路径
690
+ const url = fileUrl.substring(domain.length);
691
+ if (!url || url === "/") {
692
+ throw new Error("URL缺少文件路径部分");
693
+ }
694
+
695
+ // 提取带扩展名的文件名
696
+ const filenameRegex = /[^\/]+$/;
697
+ const filenameMatch = url.match(filenameRegex);
698
+ if (!filenameMatch) {
699
+ throw new Error("无法从路径中提取文件名");
700
+ }
701
+ const fullFilename = filenameMatch[0];
702
+
703
+ // 验证文件名格式(至少1字符+扩展名)
704
+ const nameFormat = /^.+\..+$/;
705
+ if (!nameFormat.test(fullFilename)) {
706
+ throw new Error(`无效的文件名格式: ${fullFilename}`);
707
+ }
708
+
709
+ // 修复点:更可靠的文件名和扩展名分离
710
+ const lastDotIndex = fullFilename.lastIndexOf(".");
711
+ const filenameBase = fullFilename.substring(0, lastDotIndex); // 点之前部分
712
+ const extension = fullFilename.substring(lastDotIndex + 1).toLowerCase(); // 点之后部分
713
+
714
+ // 扩展名验证
715
+ /* const validExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'bmp'];
716
+ if (!validExtensions.includes(extension)) {
717
+ throw new Error(`不支持的扩展名类型: ${extension}`);
718
+ } */
719
+
720
+ let thumbnail = null,
721
+ large = null,
722
+ medium = null,
723
+ source = null;
724
+ if (this.$commonFileUtil.isPicture(extension)) {
725
+ // thumbnail = url;
726
+ // large = url;
727
+ // medium = url;
728
+ source = url;
729
+ }
730
+
731
+ result = {
732
+ extension,
733
+ domain,
734
+ url,
735
+ thumbnail,
736
+ large,
737
+ medium,
738
+ source,
739
+ fileSize: file?file.size:0,
740
+ name: file?file.name:null
741
+ };
742
+
743
+ // 返回结构化对象
744
+ return result;
745
+ },
746
+ uploadPartMethod(file, UploadId, indexNum, partLen, etag, count, resolve) {
747
+ let target = this.$refs.upload;
748
+ let fileObj = target.getFile(file);
749
+ var _this = this;
750
+ this.obsClient
751
+ .uploadPart({
752
+ Bucket: this.getBucket(),
753
+ Key: fileObj.obsKey,
754
+ UploadId,
755
+ PartNumber: indexNum + 1,
756
+ SourceFile: file,
757
+ PartSize: partLen,
758
+ Offset: partLen * indexNum,
759
+ })
760
+ .then((result) => {
761
+ if (fileObj.status !== "uploading") {
762
+ return;
763
+ }
764
+ if (result.CommonMsg.Status < 300) {
765
+ etag.push({
766
+ ETag: result.InterfaceResult.ETag,
767
+ PartNumber: indexNum + 1,
768
+ });
769
+ indexNum++;
770
+ if (indexNum < count) {
771
+ let percentage = Math.ceil((indexNum / count) * 100);
772
+ // _this.percentage = Math.ceil((indexNum / count) * 100);
773
+ fileObj.percentage = percentage;
774
+ // option.file.percent = percentage;
775
+ // option.onProgress(option.file);
776
+
777
+ let progressEvent = document.createEvent("Event");
778
+ progressEvent.percent = percentage;
779
+ target.handleProgress(progressEvent, file);
780
+
781
+ _this.uploadPartMethod(
782
+ file,
783
+ UploadId,
784
+ indexNum,
785
+ partLen,
786
+ etag,
787
+ count,
788
+ resolve
789
+ );
790
+ }
791
+ if (indexNum == count) {
792
+ // _this.percentage = 100;
793
+ let percentage = 100;
794
+ fileObj.percentage = percentage;
795
+ /* option.file.percent = percentage;
796
+ option.onProgress(option.file); */
797
+
798
+ let progressEvent = document.createEvent("Event");
799
+ progressEvent.percent = percentage;
800
+ target.handleProgress(progressEvent, file);
801
+
802
+ resolve("任务完成");
803
+ }
804
+ } else {
805
+ this.handleFileError(
806
+ new Error(
807
+ result.CommonMsg.Message ||
808
+ this.$t2("上传异常", "components.VabUpload.uploadException")
809
+ ),
810
+ file
811
+ );
812
+ }
813
+ })
814
+ .catch((error) => {
815
+ this.handleFileError(error, file);
816
+ });
817
+ },
818
+ getImageUrl(file) {
819
+ let target = this.$refs.upload;
820
+ let fileObj = target.getFile(file);
821
+ let Bucket= this.getBucket();
822
+ let server = this.obsConfig.server
823
+ let arr = server.split("//")
824
+ let url = `${arr[0]}//${Bucket}.${arr[1]}/${fileObj.obsKey}`
825
+ // let url = `https://gztw-file01.obs.cn-south-1.myhuaweicloud.com/${fileObj.obsKey}`;
826
+ return url;
827
+ console.log(url);
828
+ /* let target = this.$refs.upload;
829
+ let fileObj = target.getFile(file);
830
+ const _this = this;
831
+ this.obsClient.getObject(
832
+ {
833
+ Bucket: this.getBucket(),
834
+ Key: fileObj.obsKey,
835
+ SaveByType: "file",
836
+ },
837
+ function (error, response) {
838
+ if (error) {
839
+ } else if (response.CommonMsg.Status < 300) {
840
+ const url = response.InterfaceResult.Content.SignedUrl;
841
+ console.log(url);
842
+ // this.imageUrl = url;
843
+ }
844
+ }
845
+ ); */
846
+ },
847
+ //obs end
848
+
849
+ checkPreUploadList() {
850
+ let uploadingLimit = this.option.uploadingLimit || this.uploadingLimit;
851
+ let target = this.$refs.upload;
852
+ let fileList1 = (target.uploadFiles || []).filter((item) => {
853
+ return item.status == "preUpload";
854
+ });
855
+ let fileList2 = (target.uploadFiles || []).filter((item) => {
856
+ return item.status == "uploading";
857
+ });
858
+ if (fileList2.length < uploadingLimit && fileList1.length > 0) {
859
+ let num = uploadingLimit - fileList2.length;
860
+ if (num) {
861
+ let toNum = Math.min(fileList1.length, num);
862
+ for (let i = 0; i < toNum; i++) {
863
+ let fileRaw = fileList1[i].raw;
864
+ // this.uploadFile(fileRaw);
865
+ this.handleUpload(fileRaw);
866
+ }
867
+ }
868
+ }
869
+ },
870
+ async uploadFile(file) {
871
+ if (!file || file.status == "fail") return;
872
+ let target = this.$refs.upload;
873
+ if (!target) return;
874
+ let fileObj = target.getFile(file);
875
+ if (fileObj.status != "preUpload") return;
876
+ if (!this.uploadUrl) {
877
+ await this.initUploadUrl();
878
+ }
879
+ this.total = 0;
880
+ target.handleProgress({ percent: 0 }, file);
881
+
882
+ // 解析为BUFFER数据
883
+ // 我们会把文件切片处理:把一个文件分割成为好几个部分(固定数量/固定大小)
884
+ // 每一个切片有自己的部分数据和自己的名字
885
+ // HASH_1.mp4
886
+ // HASH_2.mp4
887
+ // ...
888
+
889
+ this.fileParse(file, "buffer", (buffer) => {
890
+ let spark = new imFun.SparkMD5.ArrayBuffer(),
891
+ chunkSize = this.chunkSize * 1024 * 1024, // Read in chunks of 2MB
892
+ chunks = Math.ceil(file.size / chunkSize),
893
+ hash,
894
+ suffix;
895
+ spark.append(buffer);
896
+ hash = spark.end();
897
+ let nameSplit = /\.([0-9a-zA-Z]+)$/i.exec(file.name);
898
+
899
+ suffix = nameSplit && nameSplit.length > 1 ? nameSplit[1] : "";
900
+
901
+ let checkUrl = this.uploadUrl.replace(
902
+ "/docfile/upload",
903
+ "/docfile/check"
904
+ );
905
+ let checkData = {
906
+ name: file.name,
907
+ md5: hash,
908
+ };
909
+ let abort;
910
+ let checkReq = this.$http({
911
+ url: checkUrl,
912
+ method: "post",
913
+ cancelToken: new imFun.axios.CancelToken(function executor(c) {
914
+ abort = c;
915
+ file.abort = c;
916
+ }),
917
+ data: checkData,
918
+ failMsg: false,
919
+ modal: false,
920
+ callback: (res) => {
921
+ if (res.type == "success") {
922
+ let resData = res.objx || {};
923
+ let chunkParam = {
924
+ fullFile: file,
925
+ chunkSize: chunkSize,
926
+ chunks: chunks,
927
+ chunkIndex: 0,
928
+ md5: hash,
929
+ uuid: resData.uuid,
930
+ };
931
+ file.chunkParam = chunkParam;
932
+
933
+ this.sendRequest(file);
934
+ } else {
935
+ this.handleFileError(
936
+ new Error(
937
+ res.content ||
938
+ this.$t2("上传异常", "components.VabUpload.uploadException")
939
+ ),
940
+ file
941
+ );
942
+ }
943
+ },
944
+ error: (e) => {
945
+ this.handleFileError(e, file);
946
+ },
947
+ });
948
+ checkReq.abort = () => {
949
+ abort(this.$t2("取消上传", "components.VabUpload.cancelUpload"));
950
+ };
951
+ });
952
+ },
953
+ async sendRequest(fullFile) {
954
+ let that = this;
955
+ let uploadUrl = this.uploadUrl;
956
+ let chunkParam = fullFile.chunkParam;
957
+ let target = that.$refs.upload;
958
+ let abort;
959
+ let config = {
960
+ headers: {
961
+ "Content-Type": "multipart/form-data",
962
+ },
963
+ cancelToken: new imFun.axios.CancelToken(function executor(c) {
964
+ /* let target = that.$refs.upload;
965
+ let filem = target.getFile(file);
966
+ abort = c;
967
+ filem.abort = c; */
968
+ abort = c;
969
+ fullFile.abort = c;
970
+ }),
971
+ onUploadProgress: (progressEvent) => {
972
+ if (!target || !fullFile) return;
973
+ let file = target.getFile(fullFile);
974
+ if (file) {
975
+ // progressEvent.loaded:已上传文件大小
976
+ // progressEvent.total:被上传文件的总大小
977
+ let start = chunkParam.start;
978
+ let uploadedSize =
979
+ start +
980
+ Math.floor(
981
+ (chunkParam.currentSize * progressEvent.loaded) /
982
+ progressEvent.total
983
+ );
984
+ let percent = Math.floor((uploadedSize * 100) / fullFile.size);
985
+ if (percent == 100) {
986
+ percent = 99;
987
+ }
988
+ progressEvent.percent = percent;
989
+ target.handleProgress(progressEvent, fullFile);
990
+ }
991
+ },
992
+ failMsg: false,
993
+ modal: false,
994
+ }; //添加请求头
995
+
996
+ let chunkIndex = chunkParam.chunkIndex;
997
+ let chunkSize = chunkParam.chunkSize;
998
+ var start = chunkIndex * chunkSize,
999
+ end =
1000
+ start + chunkSize >= fullFile.size
1001
+ ? fullFile.size
1002
+ : start + chunkParam.chunkSize;
1003
+ chunkParam.currentSize = end - start;
1004
+ chunkParam.start = start;
1005
+ chunkParam.end = end;
1006
+
1007
+ let preFormData = {
1008
+ file: fullFile.slice(start, end),
1009
+ name: fullFile.name,
1010
+ chunks: chunkParam.chunks,
1011
+ chunk: chunkIndex,
1012
+ md5: chunkParam.md5,
1013
+ uuid: chunkParam.uuid,
1014
+ fileSize: fullFile.size,
1015
+ };
1016
+
1017
+ let formData = new FormData();
1018
+ Object.keys(preFormData).forEach((key) => {
1019
+ formData.append(key, preFormData[key]);
1020
+ });
1021
+
1022
+ let req = this.$http
1023
+ .post(uploadUrl, formData, config)
1024
+ .then((res1) => {
1025
+ if (res1.type == "success") {
1026
+ if (preFormData.chunk + 1 >= preFormData.chunks) {
1027
+ let mergeData = {};
1028
+ Object.keys(preFormData).forEach((key) => {
1029
+ if (key != "file" && key != "chunk") {
1030
+ mergeData[key] = preFormData[key];
1031
+ }
1032
+ });
1033
+ let _param = {
1034
+ mergeData: mergeData,
1035
+ chunkParam: chunkParam,
1036
+ };
1037
+ this.mergeFile(_param);
1038
+ } else {
1039
+ chunkParam.chunkIndex = chunkParam.chunkIndex + 1;
1040
+ this.sendRequest(fullFile);
1041
+ }
1042
+ } else {
1043
+ this.handleFileError(
1044
+ new Error(
1045
+ res1.content ||
1046
+ this.$t2("上传异常", "components.VabUpload.uploadException")
1047
+ ),
1048
+ fullFile
1049
+ );
1050
+ }
1051
+ return res1;
1052
+ })
1053
+ .catch((err) => {
1054
+ try {
1055
+ if (!abort) {
1056
+ this.handleFileError(err, fullFile);
1057
+ }
1058
+ } catch (tt) {}
1059
+ });
1060
+ req.abort = () => {
1061
+ abort(this.$t2("取消上传", "components.VabUpload.cancelUpload"));
1062
+ };
1063
+ },
1064
+ mergeFile(param) {
1065
+ let mergeData = param.mergeData;
1066
+ let chunkParam = param.chunkParam;
1067
+ let fullFile = chunkParam.fullFile;
1068
+ let mergeUrl = this.uploadUrl.replace(
1069
+ "/docfile/upload",
1070
+ "/docfile/merge"
1071
+ );
1072
+ let target = this.$refs.upload;
1073
+ this.$http({
1074
+ url: mergeUrl,
1075
+ method: "post",
1076
+ data: mergeData,
1077
+ failMsg: false,
1078
+ modal: false,
1079
+ cancelToken: new imFun.axios.CancelToken(function executor(c) {
1080
+ if (fullFile) fullFile.abort = c;
1081
+ }),
1082
+ callback: (res) => {
1083
+ if (!target || !fullFile) return;
1084
+ if (res.type == "success") {
1085
+ let file = target.getFile(fullFile);
1086
+ if (file) {
1087
+ target.handleProgress(
1088
+ {
1089
+ percent: 100,
1090
+ },
1091
+ fullFile
1092
+ );
1093
+ target.handleSuccess(res, fullFile);
1094
+ }
1095
+ } else {
1096
+ this.handleFileError(
1097
+ new Error(
1098
+ res.content ||
1099
+ this.$t2("上传异常", "components.VabUpload.uploadException")
1100
+ ),
1101
+ fullFile
1102
+ );
1103
+ }
1104
+ },
1105
+ error: (e) => {
1106
+ if (!target || !fullFile) return;
1107
+ if (fullFile) {
1108
+ let file = target.getFile(fullFile);
1109
+ if (file) {
1110
+ this.handleFileError(e, fullFile);
1111
+ }
1112
+ }
1113
+ },
1114
+ });
1115
+ },
1116
+ handleBtn() {
1117
+ let target = this.$refs.upload;
1118
+ let fileList = (target.uploadFiles || []).filter((item) => {
1119
+ return item.status == "uploading" || item.status == "ready";
1120
+ });
1121
+ if (this.btn) {
1122
+ //断点续传
1123
+ this.abort = false;
1124
+ this.btn = false;
1125
+ fileList.forEach((uploadFile) => {
1126
+ let nextChunk = uploadFile.raw.nextChunk;
1127
+ this.sendRequest(uploadFile.raw.partList, nextChunk);
1128
+ });
1129
+ } else {
1130
+ //暂停上传
1131
+ fileList.forEach((uploadFile) => {
1132
+ uploadFile.raw.abort(
1133
+ this.$t2("取消上传", "components.VabUpload.cancelUpload")
1134
+ );
1135
+ });
1136
+ this.btn = true;
1137
+ this.abort = true;
1138
+ }
1139
+ },
1140
+ //end
1141
+ getShowImage(file, fileName) {
1142
+ fileName = fileName || file.name;
1143
+ if (this.$commonFileUtil.isPictureFile(fileName)) {
1144
+ return file.showUrl || file.url;
1145
+ } else {
1146
+ return this.$commonFileUtil.getFileIconRequire(fileName);
1147
+ }
1148
+ },
1149
+ removeFile(sfile) {
1150
+ var target = this.$refs.upload;
1151
+ var index;
1152
+ var fileList = target.uploadFiles;
1153
+ for (let i = 0; i < fileList.length; i++) {
1154
+ let file = fileList[i];
1155
+ if (sfile.uid == file.uid) {
1156
+ index = i;
1157
+ if (sfile.status == "uploading") {
1158
+ // file.status == 'delete'
1159
+ //target.abort(file);
1160
+ this.abortMultipartUpload(file);
1161
+ /* file.raw.abort &&
1162
+ file.raw.abort(
1163
+ this.$t2("取消上传", "components.VabUpload.cancelUpload")
1164
+ ); */
1165
+ }
1166
+ break;
1167
+ }
1168
+ }
1169
+
1170
+ target.uploadFiles.splice(index, 1);
1171
+ this.handleChange(sfile, target.uploadFiles);
1172
+ },
1173
+ submitImage() {
1174
+ var target = this.$refs.upload;
1175
+ var fileList = target.uploadFiles;
1176
+ let fileInfos = [];
1177
+ let fileDatas = [];
1178
+ for (let i = 0; i < fileList.length; i++) {
1179
+ let file = fileList[i];
1180
+ if (file.status == "uploading") {
1181
+ this.$message({
1182
+ message: this.$t2(
1183
+ "文件上传中",
1184
+ "components.VabUpload.fileUploading"
1185
+ ),
1186
+ type: "error",
1187
+ duration: 2000,
1188
+ });
1189
+ return;
1190
+ }
1191
+ if (file.status == "success") {
1192
+ let fileData = file.response.objx;
1193
+ fileData.name = file.name;
1194
+ let fileInfo = {
1195
+ name: file.name,
1196
+ fileData: fileData,
1197
+ file: file.raw,
1198
+ };
1199
+ fileInfos.push(fileInfo);
1200
+ fileDatas.push(fileData);
1201
+ }
1202
+ }
1203
+ this.handleClose();
1204
+ this.$emit("callback", fileInfos, fileDatas);
1205
+ this.callback && this.callback(fileDatas, fileInfos);
1206
+ },
1207
+ showViewDialog(lineData) {
1208
+ var data = lineData.fileData ? lineData.fileData : lineData;
1209
+
1210
+ let thumbnail = data ? data.thumbnail || "" : "";
1211
+
1212
+ var realUrl = data.domain + data.url;
1213
+ var showUrl = "";
1214
+ let fileName = lineData ? lineData.name || "" : "";
1215
+ if (!this.$commonFileUtil.isPictureFile(fileName)) {
1216
+ showUrl = this.$commonFileUtil.getFileIconRequire(fileName);
1217
+ } else if (thumbnail) {
1218
+ showUrl = data.domain + thumbnail;
1219
+ } else {
1220
+ showUrl = data.domain + data.url;
1221
+ }
1222
+
1223
+ var preName = "";
1224
+ var suffix = "";
1225
+ var i = fileName.lastIndexOf(".");
1226
+ if (i >= 0) {
1227
+ suffix = fileName.substring(i + 1, fileName.length).toLowerCase();
1228
+ }
1229
+ this.fileViewInfo = {
1230
+ realUrl: realUrl,
1231
+ showUrl: showUrl,
1232
+ fileName: fileName,
1233
+ suffix: suffix,
1234
+ data: data,
1235
+ };
1236
+ this.fileViewDialogVisible = true;
1237
+ },
1238
+ getShowUrl(attachment, field) {
1239
+ let showUrl = null;
1240
+ let typeStr = Object.prototype.toString.call(attachment);
1241
+ if (typeStr == "[object Object]") {
1242
+ let showField = field ? field : "medium";
1243
+ let fullUrl =
1244
+ attachment.domain +
1245
+ (attachment[showField] ? attachment[showField] : attachment.url);
1246
+ showUrl = this.$commonFileUtil.getShowUrl(fullUrl);
1247
+ } else {
1248
+ showUrl = this.$commonFileUtil.getShowUrl(attachment);
1249
+ }
1250
+ return showUrl;
1251
+ },
1252
+ addPrivateFiles(rows) {
1253
+ var target = this.$refs.upload;
1254
+ let uploadFiles = target.uploadFiles;
1255
+ let sourceSns = uploadFiles
1256
+ .filter((row) => {
1257
+ return !!(
1258
+ row.response &&
1259
+ row.response.objx &&
1260
+ row.response.objx.sourceSn
1261
+ );
1262
+ })
1263
+ .map((row) => row.response.objx.sourceSn);
1264
+
1265
+ let newFiles = rows
1266
+ .filter((row) => !row.dirs && !sourceSns.includes(row.sn))
1267
+ .map((row) => {
1268
+ let item = {
1269
+ status: "success",
1270
+ name: row.fileName,
1271
+ size: row.fileSize,
1272
+ percentage: 100,
1273
+ uid: row.fileSn,
1274
+ raw: {
1275
+ lastModified: "",
1276
+ lastModifiedDate: new Date(),
1277
+ name: row.fileName,
1278
+ size: row.fileSize,
1279
+ type: "",
1280
+ uid: row.fileSn,
1281
+ webkitRelativePath: "",
1282
+ },
1283
+ response: {
1284
+ time: "",
1285
+ type: "success",
1286
+ objx: {
1287
+ thumbnail: row.thumbnail,
1288
+ extension: row.extension,
1289
+ large: row.large,
1290
+ fileSize: row.fileSize,
1291
+ domain: row.domain,
1292
+ source: row.source,
1293
+ medium: row.medium,
1294
+ url: row.url,
1295
+ sourceSn: row.sn,
1296
+ },
1297
+ content: "success",
1298
+ rmid: null,
1299
+ },
1300
+ url: row.domain + row.url,
1301
+ showUrl: this.getShowUrl(row),
1302
+ };
1303
+ return item;
1304
+ });
1305
+ uploadFiles.push(...newFiles);
1306
+ },
1307
+ confirmPrivateProfileDialog(rows) {
1308
+ this.addPrivateFiles(rows);
1309
+ },
1310
+ initPrivateUploadBt() {
1311
+ if (settingConfig.privateProfileCode && this.pickPrivateProfile) {
1312
+ this.$http({
1313
+ url: USER_PREFIX + "/file_store_area/getByCode",
1314
+ method: "post",
1315
+ data: { stringOne: settingConfig.privateProfileCode },
1316
+ failMsg: false,
1317
+ errorMsg: false,
1318
+ success: (res) => {
1319
+ this.showPrivateUploadBtn = res.objx ? true : false;
1320
+ },
1321
+ });
1322
+ } else {
1323
+ this.showPrivateUploadBtn = false;
1324
+ }
1325
+ },
1326
+ initPickUploadMode() {
1327
+ this.showLocalUploadBtn = false;
1328
+ this.showPrivateUploadBtn = false;
1329
+ this.$http({
1330
+ url: USER_PREFIX + "/system_parameter/getByCode",
1331
+ method: "post",
1332
+ data: { code: "pickUploadMode" },
1333
+ success: (res) => {
1334
+ let value = !res.objx || !res.objx.value ? "2" : res.objx.value;
1335
+ if (value == "0") {
1336
+ //启用本地上传,个人文档上传
1337
+ this.showLocalUploadBtn = true;
1338
+ this.initPrivateUploadBt();
1339
+ } else if (value == "1") {
1340
+ //启用个人文档上传
1341
+ this.initPrivateUploadBt();
1342
+ } else if (value == "2") {
1343
+ //启用本地上传
1344
+ this.showLocalUploadBtn = true;
1345
+ }
1346
+ },
1347
+ });
1348
+ },
1349
+ pasteEvent(e) {
1350
+ // e.preventDefault();
1351
+ e.stopPropagation();
1352
+ if (!this.pasteAreaStatus) {
1353
+ return;
1354
+ }
1355
+ if (!(e.clipboardData && e.clipboardData.items)) {
1356
+ return;
1357
+ }
1358
+ let files = Array.from(e.clipboardData.files);
1359
+ let getFileSuffix = this.$commonFileUtil.getFileSuffix;
1360
+ if (files.length) {
1361
+ let fileList = files.map((rawFile) => {
1362
+ let name = rawFile.name;
1363
+ let index = name.lastIndexOf(".");
1364
+ let fileSuffix = getFileSuffix(name);
1365
+ let fileName =
1366
+ index >= 0 ? name.substring(0, index).toString() : name.toString();
1367
+ let file = {
1368
+ name: rawFile.name,
1369
+ size: rawFile.size,
1370
+ raw: rawFile,
1371
+ showUrl: URL.createObjectURL(rawFile),
1372
+ fileName: fileName,
1373
+ fileSuffix: fileSuffix,
1374
+ };
1375
+ return file;
1376
+ });
1377
+ this.pasteList.push(...fileList);
1378
+ }
1379
+ },
1380
+ deletePasteFile(index) {
1381
+ this.pasteList.splice(index, 1);
1382
+ },
1383
+ confirmPasteFile() {
1384
+ let target = this.$refs.upload;
1385
+ let innerTarget = target.$refs["upload-inner"];
1386
+ let pasteList = this.$baseLodash.cloneDeep(this.pasteList);
1387
+ let files = pasteList.map((item) => {
1388
+ let name = item.name;
1389
+ let fileRaw = item.raw;
1390
+ fileRaw.fileName = name;
1391
+ return fileRaw;
1392
+ });
1393
+ innerTarget.uploadFiles(files);
1394
+ this.$nextTick(() => {
1395
+ target.uploadFiles.forEach((uploadFile) => {
1396
+ let fileRaw = uploadFile.raw;
1397
+ if (fileRaw.fileName) {
1398
+ uploadFile.name = fileRaw.fileName;
1399
+ delete fileRaw.fileName;
1400
+ }
1401
+ });
1402
+ });
1403
+ this.pasteList = [];
1404
+ },
1405
+ changeFileName(file) {
1406
+ if (file.fileSuffix) {
1407
+ file.name = (file.fileName + "." + file.fileSuffix).toString();
1408
+ } else {
1409
+ file.name = file.fileName.toString();
1410
+ }
1411
+ },
1412
+ handleFileError(err, rawFile) {
1413
+ let target = this.$refs.upload;
1414
+ if (!target) return;
1415
+ const file = target.getFile(rawFile);
1416
+ const fileList = target.uploadFiles;
1417
+
1418
+ file.status = "fail";
1419
+ file.failMsg = err && err.message ? err.message : null;
1420
+
1421
+ // fileList.splice(fileList.indexOf(file), 1);
1422
+
1423
+ target.onError(err, file, target.uploadFiles);
1424
+ target.onChange(file, target.uploadFiles);
1425
+ this.updateUploadingStatus();
1426
+ },
1427
+ choosePasteArea(e) {
1428
+ e.stopPropagation();
1429
+ this.pasteAreaStatus = true;
1430
+ },
1431
+ openFileNameDialog(row, index) {
1432
+ this.editFileName = row.fileName?.toString();
1433
+ this.editFileSuffix = row.fileSuffix?.toString();
1434
+ this.editFileIndex = index;
1435
+ this.showFileNameDialog = true;
1436
+ },
1437
+ confirmFileNameDialog() {
1438
+ if (!this.editFileName) {
1439
+ this.$message({
1440
+ message: this.$t2("文件名不能为空", "components.VabUpload.warnMsg3"),
1441
+ type: "error",
1442
+ showClose: true,
1443
+ duration: 3000,
1444
+ });
1445
+ return;
1446
+ }
1447
+ let editFileIndex = this.editFileIndex;
1448
+ let file = this.pasteList[editFileIndex];
1449
+ file.fileName = this.editFileName.toString();
1450
+ file.name = (file.fileName + "." + file.fileSuffix).toString();
1451
+ this.showFileNameDialog = false;
1452
+ },
1453
+ },
1454
+ };
1455
+
1456
+
1457
+ function formatFileSize(fileSize) {
1458
+ fileSize = fileSize || 0;
1459
+ if (fileSize < 1024) {
1460
+ return fileSize + "B";
1461
+ } else if (fileSize < 1024 * 1024) {
1462
+ var temp = fileSize / 1024;
1463
+ temp = temp.toFixed(2);
1464
+ return temp + "KB";
1465
+ } else if (fileSize < 1024 * 1024 * 1024) {
1466
+ var temp = fileSize / (1024 * 1024);
1467
+ temp = temp.toFixed(2);
1468
+ return temp + "MB";
1469
+ } else {
1470
+ var temp = fileSize / (1024 * 1024 * 1024);
1471
+ temp = temp.toFixed(2);
1472
+ return temp + "GB";
1473
+ }
1474
+ }``
1475
+
1476
+ export const mixins = tmixins;