cloud-web-corejs 1.1.0-dev.6 → 1.1.0-dev.61

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 (499) hide show
  1. package/README.md +38 -0
  2. package/bin/core-resources.js +16 -0
  3. package/bin/create-child-app.js +34 -0
  4. package/docs/child-app/README.md +95 -0
  5. package/docs/child-app/activiti-resources.md +63 -0
  6. package/docs/child-app/generate-prompt.md +55 -0
  7. package/docs/child-app/luckysheet-resources.md +80 -0
  8. package/docs/child-app/public-resources-plan.md +288 -0
  9. package/docs/child-app/resources-implementation.md +101 -0
  10. package/docs/child-app/tinymce-resources.md +88 -0
  11. package/docs/child-app/validation.md +34 -0
  12. package/docs/qiankun/346/216/245/345/205/245/345/215/217/350/256/256.md +298 -0
  13. package/docs/qiankun/350/257/246/346/203/205/346/211/277/350/275/275/345/255/220/345/272/224/347/224/250/345/257/271/346/216/245/346/270/205/345/215/225.md +111 -0
  14. package/package.json +29 -4
  15. package/resource-tools/index.js +126 -0
  16. package/src/app-bootstrap.js +531 -0
  17. package/src/app-bootstrap.sync.js +502 -0
  18. package/src/boot-assets.legacy.js +13 -0
  19. package/src/boot-assets.next.js +7 -0
  20. package/src/components/Qrcode/fileParse.vue +11 -0
  21. package/src/components/Tinymce/dynamicLoadScript.js +51 -59
  22. package/src/components/Tinymce/index.vue +382 -336
  23. package/src/components/Tinymce/mce-chrome.scss +150 -0
  24. package/src/components/VabUpload/image-viewer.vue +18 -10
  25. package/src/components/VabUpload/index.js +11 -4
  26. package/src/components/VabUpload/index.vue +1 -1
  27. package/src/components/VabUpload/mixins/fileLibraryDialog.js +2 -0
  28. package/src/components/VabUpload/mixins.js +72 -40
  29. package/src/components/VabUpload/partUploadConfig.js +95 -0
  30. package/src/components/VabUpload/privateProfileDialogMixins.js +2 -0
  31. package/src/components/VabUpload/style.scss +282 -0
  32. package/src/components/VabUpload/view.vue +19 -18
  33. package/src/components/baseArea/index.vue +2 -2
  34. package/src/components/baseInputExport/mixins.js +1 -6
  35. package/src/components/bizTab/BizTabListPage.vue +66 -33
  36. package/src/components/bizTab/README.md +3 -1
  37. package/src/components/bizTab/bizBillDetailMixin.js +2 -0
  38. package/src/components/code-editor/ace-chrome.scss +17 -0
  39. package/src/components/code-editor/index.vue +361 -340
  40. package/src/components/errorMsg/index.vue +142 -13
  41. package/src/components/errorMsg/mixins.js +53 -0
  42. package/src/components/excelExport/conditionExportConfig.js +112 -0
  43. package/src/components/excelExport/exportColumnMemory.js +118 -0
  44. package/src/components/excelExport/exportFieldDialog.vue +50 -38
  45. package/src/components/excelExport/exportType.js +8 -0
  46. package/src/components/excelExport/index.js +30 -13
  47. package/src/components/excelExport/index.vue +7 -1
  48. package/src/components/excelExport/mixins.js +782 -293
  49. package/src/components/excelImport/index.vue +156 -156
  50. package/src/components/excelImport/mixins.js +888 -834
  51. package/src/components/fileLibrary/mixins/indexMixins.js +2 -0
  52. package/src/components/fileLibrary/style.scss +579 -0
  53. package/src/components/formDialog/index.vue +11 -8
  54. package/src/components/hiprint/style.scss +188 -0
  55. package/src/components/hiprint/view/json-view.vue +4 -4
  56. package/src/components/jdPrint/mixins.js +2 -0
  57. package/src/components/jsonImport/index.vue +1 -1
  58. package/src/components/jsonImport/mixins.js +6 -10
  59. package/src/components/langImport/index.vue +1 -1
  60. package/src/components/langImport/mixins.js +6 -10
  61. package/src/components/luckysheet/loadResources.js +64 -0
  62. package/src/components/luckysheet/view.vue +239 -210
  63. package/src/components/mobile/buttonGroup/index.vue +1 -1
  64. package/src/components/mobile/wf/addTaskUserdialog.vue +100 -80
  65. package/src/components/mobile/wf/content.vue +1734 -1662
  66. package/src/components/mobile/wf/deleteTaskUserDialog.vue +73 -54
  67. package/src/components/mobile/wf/selectUserDialog.vue +118 -0
  68. package/src/components/mobile/wf/setCandidateDialog.vue +69 -48
  69. package/src/components/mobile/wf/urgingDialog.vue +75 -52
  70. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  71. package/src/components/obsUpload/index.js +4 -1
  72. package/src/components/obsUpload/index.vue +1 -1
  73. package/src/components/obsUpload/mixins.js +45 -15
  74. package/src/components/onlineTalk/index.vue +4 -4
  75. package/src/components/onlineTalk/mixins.js +21 -7
  76. package/src/components/table/index.js +96 -81
  77. package/src/components/table/plugins/cell-area/index.js +10 -3
  78. package/src/components/table/style.scss +1399 -0
  79. package/src/components/table/vxeFilter/mixin.js +28 -18
  80. package/src/components/wf/content.vue +3 -2
  81. package/src/components/wf/content2.vue +1 -1
  82. package/src/components/wf/style.scss +265 -0
  83. package/src/components/wf/wf.js +7 -0
  84. package/src/components/wf/wfActionItems.js +3 -0
  85. package/src/components/wf/wfStartDialog.vue +1 -0
  86. package/src/components/wf/wfTransferEnabled.js +54 -0
  87. package/src/components/wf/wfUtil.js +47 -29
  88. package/src/components/wf/wfVisibility.js +6 -0
  89. package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +64 -57
  90. package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +1 -1
  91. package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +1 -1
  92. package/src/components/xform/docs/2026-09 /345/212/250/346/200/201/345/255/227/346/256/265/350/247/204/345/210/231/344/270/216/346/265/201/347/250/213/346/216/247/345/210/266/346/211/247/350/241/214/351/241/272/345/272/217/350/220/275/345/234/260/346/226/271/346/241/210.md" +409 -0
  93. package/src/components/xform/docs/2026-09 /346/235/241/344/273/266/345/257/274/345/207/272/345/244/247/346/225/260/346/215/256/351/207/217/345/264/251/346/272/203/346/216/222/346/237/245.md" +389 -0
  94. package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/344/273/243/347/240/201/350/257/204/345/256/241.md" +255 -0
  95. package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/346/265/213/350/257/225/351/252/214/350/257/201/345/256/236/346/226/275/346/226/207/346/241/243.md" +595 -0
  96. package/src/components/xform/docs/2026-09 /347/274/226/350/276/221/350/241/250/350/241/214/345/206/205/344/277/235/345/255/230/346/240/241/351/252/214/350/214/203/345/233/264/344/270/216/345/210/227/345/277/205/345/241/253/350/247/243/346/236/220/344/277/256/345/244/215.md" +233 -0
  97. package/src/components/xform/docs/2026-09 /350/241/250/345/215/225/345/257/274/345/205/245/351/200/232/351/201/223/346/242/263/347/220/206/344/270/216/350/220/275/345/234/260/346/226/271/346/241/210.md" +745 -0
  98. package/src/components/xform/docs//346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206/344/270/216/344/277/256/345/244/215/350/220/275/345/234/260/346/226/271/346/241/210.md +324 -0
  99. package/src/components/xform/form-designer/designer.js +2133 -2100
  100. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +7 -0
  101. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -2
  102. package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +243 -227
  103. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +228 -207
  104. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +165 -136
  105. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +30 -4
  106. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +190 -185
  107. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +2657 -1774
  108. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +27 -4
  109. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +1 -1
  110. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  111. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +1 -1
  112. package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +1 -1
  113. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -1
  114. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
  115. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +1 -1
  116. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +1 -1
  117. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +1 -1
  118. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +1 -1
  119. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +1 -1
  120. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +1 -1
  121. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +1 -1
  122. package/src/components/xform/form-designer/form-widget/field-widget/descriptions-widget.vue +1 -1
  123. package/src/components/xform/form-designer/form-widget/field-widget/divider-widget.vue +1 -1
  124. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +1 -1
  125. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +1 -1
  126. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +35 -4
  127. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  128. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  129. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  130. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +64 -10
  131. package/src/components/xform/form-designer/form-widget/field-widget/file-upload-widget.vue +1 -1
  132. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +14 -4
  133. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +1 -1
  134. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +19 -6
  135. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +1 -1
  136. package/src/components/xform/form-designer/form-widget/field-widget/index.js +10 -1
  137. package/src/components/xform/form-designer/form-widget/field-widget/input-batch-widget.vue +1 -1
  138. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +29 -3
  139. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +1 -1
  140. package/src/components/xform/form-designer/form-widget/field-widget/news-list-widget.vue +1 -1
  141. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +1 -1
  142. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +1 -1
  143. package/src/components/xform/form-designer/form-widget/field-widget/picture-upload-widget.vue +1 -1
  144. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +1 -1
  145. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +1 -1
  146. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +1 -1
  147. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +1 -1
  148. package/src/components/xform/form-designer/form-widget/field-widget/rate-widget.vue +1 -1
  149. package/src/components/xform/form-designer/form-widget/field-widget/rich-editor-widget.vue +1 -1
  150. package/src/components/xform/form-designer/form-widget/field-widget/row-col-select-widget.vue +64 -0
  151. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +1 -1
  152. package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +1 -1
  153. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +1 -1
  154. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +1 -1
  155. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +6 -2
  156. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +1 -1
  157. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +1 -1
  158. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -145
  159. package/src/components/xform/form-designer/form-widget/field-widget/slider-widget.vue +1 -1
  160. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +1 -1
  161. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +1 -1
  162. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +1 -1
  163. package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +1 -1
  164. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +3 -2
  165. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +1 -1
  166. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +1 -1
  167. package/src/components/xform/form-designer/form-widget/field-widget/textarea-widget.vue +1 -1
  168. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +1 -1
  169. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +1 -1
  170. package/src/components/xform/form-designer/form-widget/field-widget/title-head-widget.vue +1 -1
  171. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +1 -1
  172. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -3
  173. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +25 -1
  174. package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +1 -1
  175. package/src/components/xform/form-designer/indexMixin.js +27 -0
  176. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +687 -602
  177. package/src/components/xform/form-designer/setting-panel/form-setting.vue +269 -36
  178. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +335 -12
  179. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +23 -7
  180. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +13 -1
  181. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +846 -860
  182. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-lazyRender-editor.vue +27 -0
  183. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabChange-editor.vue +28 -0
  184. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabClick-editor.vue +28 -0
  185. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +62 -1
  186. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +142 -2
  187. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/empty-number-input.vue +51 -0
  188. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +27 -2
  189. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +33 -3
  190. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +2 -4
  191. package/src/components/xform/form-designer/setting-panel/property-editor/suffixIconClickable-editor.vue +23 -0
  192. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +18 -4
  193. package/src/components/xform/form-designer/toolbar-panel/index.vue +884 -874
  194. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +13 -0
  195. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  196. package/src/components/xform/form-designer/widget-panel/indexMixin.js +15 -2
  197. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +152 -9
  198. package/src/components/xform/form-render/container-item/containerItemMixin.js +93 -8
  199. package/src/components/xform/form-render/container-item/data-table-item.vue +352 -347
  200. package/src/components/xform/form-render/container-item/data-table-mixin.js +7261 -5985
  201. package/src/components/xform/form-render/container-item/detail-h5-item.vue +48 -19
  202. package/src/components/xform/form-render/container-item/detail-item.vue +350 -446
  203. package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +55 -1
  204. package/src/components/xform/form-render/container-item/list-h5-item.vue +261 -178
  205. package/src/components/xform/form-render/container-item/panel-item.vue +1 -1
  206. package/src/components/xform/form-render/container-item/tab-item.vue +177 -129
  207. package/src/components/xform/form-render/fieldControlEngine.js +218 -0
  208. package/src/components/xform/form-render/fieldControlMixin.js +536 -0
  209. package/src/components/xform/form-render/index.vue +164 -153
  210. package/src/components/xform/form-render/indexMixin.js +5443 -5311
  211. package/src/components/xform/form-render/pageDialogScope.js +54 -0
  212. package/src/components/xform/icon-picker/index.vue +1 -1
  213. package/src/components/xform/lang/en-US.js +8 -0
  214. package/src/components/xform/lang/zh-CN.js +9 -0
  215. package/src/components/xform/mixins/businessLock.js +59 -0
  216. package/src/components/xform/mixins/defaultHandle.js +713 -707
  217. package/src/components/xform/mixins/scriptHttp.js +42 -21
  218. package/src/components/xform/mixins/wfStart.js +105 -0
  219. package/src/components/xform/mixins/wfVisibility.js +33 -0
  220. package/src/components/xform/styles/census.scss +288 -0
  221. package/src/components/xform/styles/containers.scss +215 -0
  222. package/src/components/xform/styles/designer.scss +904 -0
  223. package/src/components/xform/styles/detail-temp.scss +71 -0
  224. package/src/components/xform/styles/h5-designer.scss +191 -0
  225. package/src/components/xform/styles/h5-runtime.scss +520 -0
  226. package/src/components/xform/styles/h5.scss +836 -516
  227. package/src/components/xform/styles/skins.scss +398 -0
  228. package/src/components/xform/styles/table-layout.scss +91 -0
  229. package/src/components/xform/styles/titles.scss +255 -0
  230. package/src/components/xform/utils/dynamicSchemaUtil.js +385 -361
  231. package/src/components/xform/utils/fixedQueryUtil.js +29 -4
  232. package/src/components/xform/utils/serviceNameCache.js +69 -0
  233. package/src/components/xform/utils/tableColumnHelper.js +46 -4
  234. package/src/components/xform/utils/util.js +1776 -1708
  235. package/src/core-resources/css/h5.scss +548 -0
  236. package/src/core-resources/css/iconfont.css +1447 -0
  237. package/src/core-resources/font/iconfont.ttf +0 -0
  238. package/src/core-resources/font/iconfont.woff +0 -0
  239. package/src/core-resources/font/iconfont.woff2 +0 -0
  240. package/src/core-resources/images/default-header.png +0 -0
  241. package/src/core-resources/images/ico-default_wenjian.svg +1 -0
  242. package/src/core-resources/images/ico-excel.svg +1 -0
  243. package/src/core-resources/images/ico-ftl.svg +7 -0
  244. package/src/core-resources/images/ico-html.svg +1 -0
  245. package/src/core-resources/images/ico-java.svg +1 -0
  246. package/src/core-resources/images/ico-music.svg +1 -0
  247. package/src/core-resources/images/ico-pdf.svg +1 -0
  248. package/src/core-resources/images/ico-photo.svg +1 -0
  249. package/src/core-resources/images/ico-ppt.svg +1 -0
  250. package/src/core-resources/images/ico-psd.svg +1 -0
  251. package/src/core-resources/images/ico-service.png +0 -0
  252. package/src/core-resources/images/ico-txt.svg +1 -0
  253. package/src/core-resources/images/ico-video.svg +1 -0
  254. package/src/core-resources/images/ico-vue.svg +8 -0
  255. package/src/core-resources/images/ico-wenjianjia.svg +1 -0
  256. package/src/core-resources/images/ico-wrod.svg +1 -0
  257. package/src/core-resources/images/ico-xml.svg +1 -0
  258. package/src/core-resources/images/ico-yasuobao.svg +1 -0
  259. package/src/core-resources/images/icon-error.png +0 -0
  260. package/src/core-resources/images/icon-tips.png +0 -0
  261. package/src/core-resources/images/nodata.png +0 -0
  262. package/src/core-resources/images/nodata2.png +0 -0
  263. package/src/directive/append-to-body/index.js +48 -0
  264. package/src/directive/el-dialog-center/index.js +3 -2
  265. package/src/directive/el-drag-dialog/drag.js +33 -4
  266. package/src/icons/index.js +9 -0
  267. package/src/icons/svg/404.svg +1 -0
  268. package/src/icons/svg/alert.svg +1 -0
  269. package/src/icons/svg/bug.svg +1 -0
  270. package/src/icons/svg/button.svg +1 -0
  271. package/src/icons/svg/card.svg +1 -0
  272. package/src/icons/svg/cascader-field.svg +1 -0
  273. package/src/icons/svg/census.svg +1 -0
  274. package/src/icons/svg/chart.svg +1 -0
  275. package/src/icons/svg/checkbox-field.svg +1 -0
  276. package/src/icons/svg/clipboard.svg +1 -0
  277. package/src/icons/svg/color-field.svg +1 -0
  278. package/src/icons/svg/component.svg +1 -0
  279. package/src/icons/svg/custom-component.svg +1 -0
  280. package/src/icons/svg/dashboard.svg +1 -0
  281. package/src/icons/svg/data-table.svg +1 -0
  282. package/src/icons/svg/date-field.svg +1 -0
  283. package/src/icons/svg/date-range-field.svg +1 -0
  284. package/src/icons/svg/descriptions.svg +1 -0
  285. package/src/icons/svg/divider.svg +1 -0
  286. package/src/icons/svg/document.svg +1 -0
  287. package/src/icons/svg/documentation.svg +1 -0
  288. package/src/icons/svg/drag.svg +1 -0
  289. package/src/icons/svg/echart-category.svg +1 -0
  290. package/src/icons/svg/echart-pie.svg +1 -0
  291. package/src/icons/svg/echart.svg +1 -0
  292. package/src/icons/svg/edit.svg +1 -0
  293. package/src/icons/svg/education.svg +1 -0
  294. package/src/icons/svg/email.svg +1 -0
  295. package/src/icons/svg/example.svg +1 -0
  296. package/src/icons/svg/excel.svg +1 -0
  297. package/src/icons/svg/exit-fullscreen.svg +1 -0
  298. package/src/icons/svg/eye-open.svg +1 -0
  299. package/src/icons/svg/eye.svg +1 -0
  300. package/src/icons/svg/file-upload-field.svg +1 -0
  301. package/src/icons/svg/form.svg +1 -0
  302. package/src/icons/svg/fullscreen.svg +1 -0
  303. package/src/icons/svg/github.svg +1 -0
  304. package/src/icons/svg/grid.svg +1 -0
  305. package/src/icons/svg/guide.svg +1 -0
  306. package/src/icons/svg/html-text.svg +1 -0
  307. package/src/icons/svg/ico-more.svg +1 -0
  308. package/src/icons/svg/ico-wenjianjia.svg +1 -0
  309. package/src/icons/svg/icon.svg +1 -0
  310. package/src/icons/svg/input-batch.svg +1 -0
  311. package/src/icons/svg/international.svg +1 -0
  312. package/src/icons/svg/language.svg +1 -0
  313. package/src/icons/svg/link.svg +1 -0
  314. package/src/icons/svg/list-export.svg +1 -0
  315. package/src/icons/svg/list.svg +1 -0
  316. package/src/icons/svg/lock.svg +1 -0
  317. package/src/icons/svg/message.svg +1 -0
  318. package/src/icons/svg/money.svg +1 -0
  319. package/src/icons/svg/nested.svg +1 -0
  320. package/src/icons/svg/news-list.svg +1 -0
  321. package/src/icons/svg/node-tree.svg +1 -0
  322. package/src/icons/svg/number-field.svg +1 -0
  323. package/src/icons/svg/password.svg +1 -0
  324. package/src/icons/svg/pdf.svg +1 -0
  325. package/src/icons/svg/people.svg +1 -0
  326. package/src/icons/svg/peoples.svg +1 -0
  327. package/src/icons/svg/picture-upload-field.svg +1 -0
  328. package/src/icons/svg/qq.svg +1 -0
  329. package/src/icons/svg/query.svg +1 -0
  330. package/src/icons/svg/radio-field.svg +1 -0
  331. package/src/icons/svg/rate-field.svg +1 -0
  332. package/src/icons/svg/redo.svg +1 -0
  333. package/src/icons/svg/rich-editor-field.svg +1 -0
  334. package/src/icons/svg/search.svg +1 -0
  335. package/src/icons/svg/searchbox.svg +1 -0
  336. package/src/icons/svg/section.svg +1 -0
  337. package/src/icons/svg/select-field.svg +1 -0
  338. package/src/icons/svg/shopping.svg +1 -0
  339. package/src/icons/svg/size.svg +1 -0
  340. package/src/icons/svg/skill.svg +1 -0
  341. package/src/icons/svg/slider-field.svg +1 -0
  342. package/src/icons/svg/slot-component.svg +1 -0
  343. package/src/icons/svg/slot-field.svg +1 -0
  344. package/src/icons/svg/star.svg +1 -0
  345. package/src/icons/svg/static-text.svg +1 -0
  346. package/src/icons/svg/status.svg +1 -0
  347. package/src/icons/svg/sub-form.svg +1 -0
  348. package/src/icons/svg/switch-field.svg +1 -0
  349. package/src/icons/svg/tab.svg +1 -0
  350. package/src/icons/svg/table.svg +1 -0
  351. package/src/icons/svg/text-field.svg +1 -0
  352. package/src/icons/svg/text.svg +1 -0
  353. package/src/icons/svg/textarea-field.svg +1 -0
  354. package/src/icons/svg/theme.svg +1 -0
  355. package/src/icons/svg/time-field.svg +1 -0
  356. package/src/icons/svg/time-range-field.svg +1 -0
  357. package/src/icons/svg/tips-text.svg +1 -0
  358. package/src/icons/svg/title-head.svg +1 -0
  359. package/src/icons/svg/tree-pane.svg +1 -0
  360. package/src/icons/svg/tree-table.svg +1 -0
  361. package/src/icons/svg/tree.svg +1 -0
  362. package/src/icons/svg/undo.svg +1 -0
  363. package/src/icons/svg/uploadbox.svg +1 -0
  364. package/src/icons/svg/user.svg +1 -0
  365. package/src/icons/svg/vf-box.svg +1 -0
  366. package/src/icons/svg/vf-dialog.svg +1 -0
  367. package/src/icons/svg/vf-drawer.svg +1 -0
  368. package/src/icons/svg/vue-sfc.svg +1 -0
  369. package/src/icons/svg/wechat.svg +1 -0
  370. package/src/icons/svg/zip.svg +1 -0
  371. package/src/index.js +2 -510
  372. package/src/index.next.js +5 -0
  373. package/src/index.sync.js +5 -0
  374. package/src/layout/components/Sidebar/default.vue +1656 -1655
  375. package/src/layout/components/TagsView/index.vue +330 -323
  376. package/src/layout/components/TagsView/style.scss +92 -0
  377. package/src/layout/components/watermark/index.vue +1 -1
  378. package/src/layout/defaultLayout.vue +2 -2
  379. package/src/router/index.js +43 -48
  380. package/src/router/modules/customer.js +12 -0
  381. package/src/store/modules/settings.js +1 -1
  382. package/src/store/modules/tagsView.js +241 -217
  383. package/src/store/modules/user.js +16 -12
  384. package/src/styles/btn.scss +315 -0
  385. package/src/styles/dialog.scss +1710 -0
  386. package/src/styles/element-ui.scss +1076 -0
  387. package/src/styles/element-variables.scss +31 -0
  388. package/src/styles/global.scss +115 -0
  389. package/src/styles/index.scss +245 -0
  390. package/src/styles/layout-skins.scss +840 -0
  391. package/src/styles/legacy-base.scss +19 -0
  392. package/src/styles/menu-icons.scss +75 -0
  393. package/src/styles/mixin.scss +80 -0
  394. package/src/styles/nprogress.scss +14 -0
  395. package/src/styles/page-shell.scss +723 -0
  396. package/src/styles/sidebar.scss +296 -0
  397. package/src/styles/split-handle.scss +52 -0
  398. package/src/styles/theme-variables.scss +7 -0
  399. package/src/styles/transition.scss +48 -0
  400. package/src/styles/utilities.scss +253 -0
  401. package/src/styles/variables.scss +72 -0
  402. package/src/utils/baseDictsCache.js +197 -0
  403. package/src/utils/chunkLoadError.js +24 -0
  404. package/src/utils/featureResources.js +57 -0
  405. package/src/utils/importLimit.js +72 -0
  406. package/src/utils/pdfUtil.js +6 -1
  407. package/src/utils/request.js +149 -9
  408. package/src/utils/resolveViewComponent.js +45 -90
  409. package/src/utils/runtimeRecovery.js +105 -0
  410. package/src/utils/swiperLoader.js +20 -0
  411. package/src/utils/vab.js +1334 -1283
  412. package/src/utils/xlsxLoader.js +29 -0
  413. package/src/views/bd/setting/formVersion/compareContMixin.scss +1 -1
  414. package/src/views/bd/setting/form_template/edit.vue +378 -356
  415. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  416. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  417. package/src/views/bd/setting/form_template/list.vue +304 -303
  418. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  419. package/src/views/bd/setting/form_template/mixins/list.js +749 -721
  420. package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
  421. package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
  422. package/src/views/mobile/user/area/dialog.vue +1 -1
  423. package/src/views/mobile/user/user/dialog.vue +1 -1
  424. package/src/views/user/bill_setting/mixins/wf.js +8 -0
  425. package/src/views/user/bill_setting/render.vue +1 -1
  426. package/src/views/user/commMenu/index.vue +3 -1
  427. package/src/views/user/commMenu/style.scss +123 -0
  428. package/src/views/user/common_attribute/edit.vue +2 -0
  429. package/src/views/user/common_attribute/itemEdit.vue +2 -0
  430. package/src/views/user/file_view_ins/list.vue +970 -970
  431. package/src/views/user/form/form_template/list.vue +527 -506
  432. package/src/views/user/form/vform/designer.vue +823 -821
  433. package/src/views/user/form/view/list.vue +24 -1
  434. package/src/views/user/home/default.vue +1124 -1117
  435. package/src/views/user/home/default2.vue +12 -8
  436. package/src/views/user/home/index.vue +102 -102
  437. package/src/views/user/home/wjl/content.vue +1581 -1569
  438. package/src/views/user/intf_permission/edit.vue +230 -0
  439. package/src/views/user/intf_permission/list.vue +196 -0
  440. package/src/views/user/menuFallback/index.vue +23 -0
  441. package/src/views/user/notify_message/dialog.vue +139 -139
  442. package/src/views/user/outLink/form_view.vue +202 -202
  443. package/src/views/user/outLink/index.vue +110 -110
  444. package/src/views/user/role/edit.vue +4 -0
  445. package/src/views/user/role/role-box.scss +83 -0
  446. package/src/views/user/role/voc_edit.vue +4 -0
  447. package/src/views/user/user/list.vue +28 -6
  448. package/src/views/user/wf/iframe/index.vue +51 -51
  449. package/src/views/user/wf/iframe/index2.vue +64 -64
  450. package/src/views/user/wf/wf_diy_attribute/edit.vue +1 -1
  451. package/src/views/user/wf/wf_manage/list2.vue +871 -871
  452. package/src/views/user/wf/wf_manage/wfContentDialog.vue +177 -126
  453. package/src/views/user/wf/wf_obj_config/activiti_wf.vue +134 -133
  454. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
  455. package/src/views/user/wf/wf_obj_config/list.vue +747 -746
  456. package/src/views/user/wf/wf_obj_config/list_form.vue +374 -373
  457. package/templates/child-app/.env +3 -0
  458. package/templates/child-app/README.md +49 -0
  459. package/templates/child-app/app.config.js +6 -0
  460. package/templates/child-app/babel.config.js +1 -0
  461. package/templates/child-app/core-resources.config.js +15 -0
  462. package/templates/child-app/gitignore +7 -0
  463. package/templates/child-app/package.json +34 -0
  464. package/templates/child-app/public/index.html +12 -0
  465. package/templates/child-app/src/assets/401_images/401.gif +0 -0
  466. package/templates/child-app/src/assets/404_images/404.png +0 -0
  467. package/templates/child-app/src/assets/404_images/404_cloud.png +0 -0
  468. package/templates/child-app/src/assets/logo.png +0 -0
  469. package/templates/child-app/src/corejsConfig.js +2 -0
  470. package/templates/child-app/src/icons/index.js +2 -0
  471. package/templates/child-app/src/icons/svg/child-demo.svg +1 -0
  472. package/templates/child-app/src/layout/index.vue +4 -0
  473. package/templates/child-app/src/main.js +5 -0
  474. package/templates/child-app/src/prefixConfig.js +13 -0
  475. package/templates/child-app/src/resources/css/login.scss +29 -0
  476. package/templates/child-app/src/resources/images/bg-login5.jpg +0 -0
  477. package/templates/child-app/src/resources/images/home-img.png +0 -0
  478. package/templates/child-app/src/router/modules/customer.js +3 -0
  479. package/templates/child-app/src/settings.js +25 -0
  480. package/templates/child-app/src/styles/app.scss +2 -0
  481. package/templates/child-app/src/views/demo/detail.vue +19 -0
  482. package/templates/child-app/src/views/demo/list.vue +38 -0
  483. package/templates/child-app/src/views/user/login/index.vue +18 -0
  484. package/templates/child-app/vue.config.js +107 -0
  485. package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +0 -285
  486. package/src/components/xform/form-render/formDynamicFieldMixin.js +0 -131
  487. package/src/views/demo/bizTab/bill/billConfig.js +0 -41
  488. package/src/views/demo/bizTab/bill/detail.vue +0 -436
  489. package/src/views/demo/bizTab/bill/list.vue +0 -288
  490. package/src/views/demo/bizTab/bill/productDialog.vue +0 -176
  491. package/src/views/demo/bizTab/simple/billApi.js +0 -123
  492. package/src/views/demo/bizTab/simple/detail.vue +0 -407
  493. package/src/views/demo/bizTab/simple/list.vue +0 -217
  494. package/src/views/demo/bizTab/standalone/index.vue +0 -121
  495. package/src/views/demo/bizTab/wf/billConfig.js +0 -44
  496. package/src/views/demo/bizTab/wf/detail.vue +0 -661
  497. package/src/views/demo/bizTab/wf/list.vue +0 -242
  498. package/src/views/user/outLink/cc_form_view.vue +0 -188
  499. /package/src/{resources → core-resources}/js/base/common.js +0 -0
package/src/utils/vab.js CHANGED
@@ -1,1283 +1,1334 @@
1
- /**version-1.0*/
2
- let install = {};
3
-
4
- import request from "./request";
5
- import * as lodash from "lodash";
6
- import { Loading, Message, MessageBox, Notification, Form } from "element-ui";
7
- import store from "../store";
8
- import ElImageViewer from "../components/VabUpload/image-viewer";
9
-
10
- import { getToken } from "./auth";
11
- import XEUtils from "xe-utils";
12
-
13
- import prefixConfig from "@/prefixConfig.js";
14
- import moment from "moment";
15
- import { openView } from "./repeatOpen";
16
- import { assetUrl } from "./assetUrl";
17
-
18
- let imFun = {
19
- request,
20
- lodash,
21
- Loading,
22
- Message,
23
- MessageBox,
24
- Notification,
25
- Form,
26
- store,
27
- getToken,
28
- prefixConfig,
29
- };
30
-
31
- function reqImg(a) {
32
- /* webpack5 下 require 返回的是无原型的 Module 对象,直接当 src 用会崩,统一取真实 URL */
33
- return assetUrl(require("@/resources/images/" + a));
34
- }
35
-
36
- const FILE_ICON_NAME_MAP = {
37
- word: "ico-wrod.svg",
38
- excel: "ico-excel.svg",
39
- ppt: "ico-ppt.svg",
40
- pdf: "ico-pdf.svg",
41
- picture: "ico-photo.svg",
42
- video: "ico-video.svg",
43
- audio: "ico-music.svg",
44
- html: "ico-html.svg",
45
- txt: "ico-txt.svg",
46
- java: "ico-java.svg",
47
- vue: "ico-vue.svg",
48
- ftl: "ico-ftl.svg",
49
- xml: "ico-xml.svg",
50
- flash: "ico-flash.svg",
51
- zip: "ico-yasuobao.svg",
52
- exe: "ico-ext.svg",
53
- psd: "ico-psd.svg",
54
- folder: "ico-wenjianjia.svg",
55
- other: "ico-default_wenjian.svg",
56
- };
57
-
58
- const FILE_ICON_TYPE_MAP = {
59
- doc: "word",
60
- docx: "word",
61
- xls: "excel",
62
- xlsx: "excel",
63
- ppt: "ppt",
64
- pptx: "ppt",
65
- pdf: "pdf",
66
- jpg: "picture",
67
- jpeg: "picture",
68
- png: "picture",
69
- gif: "picture",
70
- mp3: "video",
71
- mp4: "video",
72
- mpg: "video",
73
- mkv: "video",
74
- rmvb: "video",
75
- avi: "video",
76
- mov: "video",
77
- wav: "audio",
78
- html: "html",
79
- htm: "html",
80
- txt: "txt",
81
- java: "java",
82
- vue: "vue",
83
- ftl: "ftl",
84
- xml: "xml",
85
- swf: "flash",
86
- zip: "zip",
87
- rar: "zip",
88
- "7z": "zip",
89
- // exe: 'exe',
90
- psd: "psd",
91
- };
92
-
93
- let typeList = [
94
- "doc",
95
- "docx",
96
- "xls",
97
- "xlsx",
98
- "ppt",
99
- "pptx",
100
- "csv",
101
- "wps",
102
- "dps",
103
- "et",
104
- "ett",
105
- "wpt",
106
- "vsd",
107
- "vsdx",
108
- "wmf",
109
- "emf",
110
- "psd",
111
- "eps",
112
- "pdf",
113
- "xmind",
114
- "obj",
115
- "3ds",
116
- "stl",
117
- "ply",
118
- "gltf",
119
- "glb",
120
- "off",
121
- "3dm",
122
- "fbx",
123
- "dae",
124
- "wrl",
125
- "3mf",
126
- "ifc",
127
- "brep",
128
- "step",
129
- "iges",
130
- "fcstd",
131
- "bim",
132
- "dwg",
133
- "dxf",
134
- "dwf",
135
- "iges",
136
- "igs",
137
- "dwt",
138
- "dng",
139
- "ifc",
140
- "dwfx",
141
- "stl",
142
- "cf2",
143
- "plt",
144
- "txt",
145
- "xml",
146
- "md",
147
- "java",
148
- "php",
149
- "py",
150
- "js",
151
- "css",
152
- "zip",
153
- "rar",
154
- "jar",
155
- "tar",
156
- "gzip",
157
- "7z",
158
- "mp3",
159
- "wav",
160
- "mp4",
161
- "flv",
162
- "avi",
163
- "mov",
164
- "rm",
165
- "mkv",
166
- "mpeg",
167
- "mpg",
168
- "rmvb",
169
- "wmv",
170
- "3gp",
171
- "swf",
172
- "drawio",
173
- "tif",
174
- "tiff",
175
- "jfif",
176
- "webp",
177
- "tga",
178
- "svg",
179
- "vue",
180
- "ftl",
181
- ];
182
-
183
- const accessToken = imFun.store.getters["user/token"];
184
-
185
- const loadingText = "";
186
- const messageDuration = 3000;
187
-
188
- install = (Vue, opts = {}) => {
189
- /**http请求*/
190
- let $http = async function (option) {
191
- option = option || {};
192
- if (!option.loadingTarget && this.$el) {
193
- option.loadingTarget = this.$el;
194
- }
195
- if (!option.vueTarget) {
196
- option.vueTarget = this;
197
- }
198
- if (option.sync === false) {
199
- return await imFun.request(option);
200
- } else {
201
- return imFun.request(option);
202
- }
203
- };
204
-
205
- Vue.prototype.$commonHttp = function (opts) {
206
- let defaultOption = {
207
- addCreateInfo: true,
208
- queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
209
- };
210
- let option = Object.assign({}, defaultOption, opts);
211
- if (opts.addCreateInfo === null || opts.addCreateInfo === undefined) {
212
- option.addCreateInfo = defaultOption.addCreateInfo;
213
- }
214
- if (
215
- opts.queryCreateInfo === null ||
216
- opts.queryCreateInfo === undefined ||
217
- opts.queryCreateInfo === true
218
- ) {
219
- option.queryCreateInfo = defaultOption.queryCreateInfo;
220
- }
221
- if (opts.queryCreateInfo === false) {
222
- option.queryCreateInfo = "0";
223
- }
224
- return this.$http(option);
225
- };
226
-
227
- Object.assign($http, imFun.request);
228
- $http.prototype = imFun.request.prototype;
229
- Vue.prototype.$http = $http;
230
-
231
- /* 通用打开菜单/路由:开关开启时以独立标签重复打开,否则按原逻辑跳转
232
- * 用法:this.$openView('/path') 或 this.$openView({ path, query }[, route]) */
233
- Vue.prototype.$openView = function (location, route) {
234
- return openView(this.$router, location, route);
235
- };
236
-
237
- /* 全局accessToken */
238
- Vue.prototype.$baseAccessToken = () => {
239
- return accessToken || imFun.getToken();
240
- };
241
-
242
- /* 全局加载层 */
243
- Vue.prototype.$baseLoading = function (option) {
244
- let d = this.$el;
245
- let loading;
246
- option = option || {};
247
- if (!option.index) {
248
- let opts = {
249
- lock: true,
250
- background: "hsla(0,0%,100%,.8)",
251
- target: d,
252
- };
253
- Object.assign(opts, option);
254
- loading = imFun.Loading.service(opts);
255
- } else {
256
- let opts = {
257
- lock: true,
258
- spinner: "vab-loading-type" + option.index,
259
- background: "hsla(0,0%,100%,.8)",
260
- target: d,
261
- };
262
- Object.assign(opts, option);
263
- loading = imFun.Loading.service(opts);
264
- }
265
- return loading;
266
- };
267
- /* 全局多彩加载层 */
268
- Vue.prototype.$baseColorfullLoading = function (index, text) {
269
- let loading;
270
- if (!index) {
271
- loading = imFun.Loading.service({
272
- lock: true,
273
- text: text || loadingText,
274
- spinner: "dots-loader",
275
- background: "hsla(0,0%,100%,.8)",
276
- target: this.target,
277
- fullscreen: true,
278
- });
279
- } else {
280
- switch (index) {
281
- case 1:
282
- index = "dots";
283
- break;
284
- case 2:
285
- index = "gauge";
286
- break;
287
- case 3:
288
- index = "inner-circles";
289
- break;
290
- case 4:
291
- index = "plus";
292
- break;
293
- }
294
- loading = imFun.Loading.service({
295
- lock: true,
296
- text: text || loadingText,
297
- spinner: index + "-loader",
298
- background: "hsla(0,0%,100%,.8)",
299
- target: this.target,
300
- });
301
- }
302
- return loading;
303
- };
304
- /* 全局Message */
305
- Vue.prototype.$baseMessage = ({ message, type, onClose }) => {
306
- imFun.Message({
307
- offset: 60,
308
- showClose: true,
309
- message: message,
310
- type: type,
311
- dangerouslyUseHTMLString: true,
312
- duration: messageDuration,
313
- onClose: onClose,
314
- });
315
- };
316
-
317
- /* 全局Alert */
318
- Vue.prototype.$baseAlert = function (content, title, callback) {
319
- imFun.MessageBox.alert(content, title || "提示", {
320
- confirmButtonText: "确定",
321
- dangerouslyUseHTMLString: true,
322
- target: this.$el,
323
- confirmButtonClass: "icondui",
324
- customClass: "dialog-style",
325
- callback: (action) => {
326
- if (callback) {
327
- callback();
328
- }
329
- },
330
- });
331
- };
332
-
333
- /* 全局Confirm */
334
- Vue.prototype.$baseConfirm = function (content, title) {
335
- return imFun.MessageBox.confirm(content, title || "提示", {
336
- confirmButtonText: "确定",
337
- cancelButtonText: "取消",
338
- closeOnClickModal: false,
339
- type: "warning",
340
- customClass: "dialog-style",
341
- cancelButtonClass: "iconguanbi",
342
- confirmButtonClass: "icondui",
343
- });
344
- };
345
-
346
- /* 全局Notification */
347
- Vue.prototype.$baseNotify = (message, title, type, position) => {
348
- imFun.Notification({
349
- title: title,
350
- message: message,
351
- position: position || "top-right",
352
- type: type || "success",
353
- duration: messageDuration,
354
- });
355
- };
356
-
357
- /* 全局TableHeight */
358
- Vue.prototype.$baseTableHeight = (formType) => {
359
- let height = window.innerHeight;
360
- let paddingHeight = 400;
361
- const formHeight = 50;
362
-
363
- if (true) {
364
- paddingHeight = 365;
365
- }
366
-
367
- if ("number" === typeof formType) {
368
- height = height - paddingHeight - formHeight * formType;
369
- } else {
370
- height = height - paddingHeight;
371
- }
372
- return height;
373
- };
374
-
375
- /* 全局map图层 */
376
- Vue.prototype.$baseMap = () => {
377
- return new maptalks.Map("map", {
378
- center: [116.41348403785, 39.910843952376],
379
- zoom: 12,
380
- minZoom: 1,
381
- maxZoom: 19,
382
- spatialReference: {
383
- projection: "baidu",
384
- },
385
- attribution: {
386
- content: "© vue-admin-beautiful",
387
- },
388
- baseLayer: new maptalks.TileLayer("base", {
389
- cssFilter: "sepia(100%) invert(90%)",
390
- urlTemplate:
391
- "http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",
392
- subdomains: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
393
- attribution:
394
- '&copy; <a target="_blank" href="http://map.baidu.com">Baidu</a>',
395
- }),
396
- });
397
- };
398
-
399
- /* 全局lodash */
400
- Vue.prototype.$baseLodash = imFun.lodash;
401
- /* 全局事件总线 */
402
- Vue.prototype.$baseEventBus = new Vue();
403
- /* 模板里 :src="$assetUrl(require(...))" 用,见 utils/assetUrl.js */
404
- Vue.prototype.$assetUrl = assetUrl;
405
-
406
- Vue.prototype.$commonFileUtil = {
407
- // 文件类型获取与判断接口
408
- getFileSuffix: function (name) {
409
- let i = name.lastIndexOf(".");
410
- if (i < 0) {
411
- // 默认是文本类型
412
- return "";
413
- }
414
- let suffix = name.substring(i + 1, name.length).toLowerCase();
415
- return suffix;
416
- },
417
- isBinary: function (suffix) {
418
- if (!suffix || suffix === "") {
419
- return false;
420
- }
421
- let fileTypeMap = {
422
- bin: true,
423
- exe: true,
424
- dll: true,
425
- so: true,
426
- lib: true,
427
- war: true,
428
- jar: true,
429
- };
430
- let type = fileTypeMap[suffix];
431
- if (undefined === type) {
432
- return false;
433
- }
434
- return true;
435
- },
436
- isPicture: function (suffix) {
437
- if (!suffix || suffix === "") {
438
- return false;
439
- }
440
-
441
- let fileTypeMap = {
442
- jpg: true,
443
- jpeg: true,
444
- png: true,
445
- gif: true,
446
- bmp: true,
447
- mpg: true,
448
- webp: true,
449
- };
450
-
451
- let type = fileTypeMap[suffix];
452
- if (undefined === type) {
453
- return false;
454
- }
455
-
456
- return true;
457
- },
458
- isVideo: function (suffix) {
459
- if (!suffix || suffix === "") {
460
- return false;
461
- }
462
- let fileTypeMap = {
463
- avi: true,
464
- mov: true,
465
- mpeg: true,
466
- mpg: true,
467
- mp4: true,
468
- rmvb: true,
469
- asf: true,
470
- flv: true,
471
- ogg: true,
472
- };
473
-
474
- let type = fileTypeMap[suffix];
475
- if (undefined === type) {
476
- return false;
477
- }
478
-
479
- return true;
480
- },
481
- isText: function (suffix) {
482
- if (!suffix || suffix === "") {
483
- return false;
484
- }
485
- let fileTypeMap = {
486
- txt: true,
487
- log: true,
488
- md: true,
489
- py: true,
490
- java: true,
491
- cpp: true,
492
- hpp: true,
493
- c: true,
494
- h: true,
495
- json: true,
496
- xml: true,
497
- html: true,
498
- sql: true,
499
- js: true,
500
- css: true,
501
- jsp: true,
502
- php: true,
503
- properties: true,
504
- conf: true,
505
- out: true,
506
- sh: true,
507
- bat: true,
508
- msg: true,
509
- cmake: true,
510
- yaml: true,
511
- yml: true,
512
- };
513
-
514
- let type = fileTypeMap[suffix];
515
- if (undefined === type) {
516
- return false;
517
- }
518
-
519
- return true;
520
- },
521
- isZip: function (suffix) {
522
- if (!suffix || suffix === "") {
523
- return false;
524
- }
525
- let fileTypeMap = {
526
- zip: true,
527
- war: true,
528
- rar: true,
529
- "7z": true,
530
- gz: true,
531
- tgz: true,
532
- xz: true,
533
- txz: true,
534
- bz2: true,
535
- tbz2: true,
536
- tar: true,
537
- };
538
-
539
- let type = fileTypeMap[suffix];
540
- if (undefined === type) {
541
- return false;
542
- }
543
-
544
- return true;
545
- },
546
- isOffice: function (suffix) {
547
- if (!suffix || suffix === "") {
548
- return false;
549
- }
550
- let fileTypeMap = {
551
- doc: true,
552
- docx: true,
553
- ppt: true,
554
- pptx: true,
555
- xls: true,
556
- xlsx: true,
557
- };
558
-
559
- let type = fileTypeMap[suffix];
560
- if (undefined === type) {
561
- return false;
562
- }
563
-
564
- return true;
565
- },
566
- isPdf: function (suffix) {
567
- if (!suffix || suffix === "") {
568
- return false;
569
- }
570
- let fileTypeMap = {
571
- pdf: true,
572
- };
573
-
574
- let type = fileTypeMap[suffix];
575
- if (undefined === type) {
576
- return false;
577
- }
578
-
579
- return true;
580
- },
581
- isPictureFile: function (fileName) {
582
- if (!fileName) return false;
583
- let typeStr = Object.prototype.toString.call(fileName);
584
- let suffix = null;
585
- if (typeStr === "[object Object]") {
586
- suffix = this.getFileSuffix(fileName.name);
587
- } else {
588
- suffix = this.getFileSuffix(fileName);
589
- }
590
- return this.isPicture(suffix);
591
- },
592
- isTextFile: function (fileName) {
593
- let suffix = this.getFileSuffix(fileName);
594
- return this.isText(suffix);
595
- },
596
- getShowUrl(url, showImagePreview) {
597
- let index = url.lastIndexOf("/");
598
- let filename;
599
- if (index >= 0) {
600
- filename = url.substring(url.lastIndexOf("/") + 1);
601
- } else {
602
- filename = url;
603
- }
604
-
605
- if (this.isPictureFile(filename) && showImagePreview !== false) {
606
- return url;
607
- } else {
608
- return this.getFileIconRequire(filename);
609
- }
610
- },
611
- resolveFileIconName: function (name, showType) {
612
- let iconType = this.getDiyFileIconType(name) || "other";
613
- if (showType) {
614
- iconType = showType;
615
- }
616
- return FILE_ICON_NAME_MAP[iconType];
617
- },
618
- getFileIconRequire: function (name, showType) {
619
- return reqImg(this.resolveFileIconName(name, showType));
620
- },
621
- getFileIconPath: function (name, showType) {
622
- return "/resources/images/" + this.resolveFileIconName(name, showType);
623
- },
624
- getDiyFileIconType: function (name) {
625
- let suffix = this.getFileSuffix(name);
626
- if (suffix === "") {
627
- // 默认是文本类型
628
- return "";
629
- }
630
-
631
- let iconType = FILE_ICON_TYPE_MAP[suffix];
632
- if (undefined === iconType) {
633
- return "";
634
- }
635
- return iconType;
636
- },
637
- getFileExtension(urlString) {
638
- if (!urlString) return null;
639
- const url = new URL(urlString);
640
- // 获取路径部分,例如 "/images/photo.jpg"
641
- const pathname = url.pathname;
642
-
643
- // 使用 lastIndexOf 找到最后一个点的位置
644
- const lastDotIndex = pathname.lastIndexOf(".");
645
-
646
- // 如果没有点,或者点在最后一位(即没有后缀),返回空字符串
647
- if (lastDotIndex === -1 || lastDotIndex === pathname.length - 1) {
648
- return "";
649
- }
650
-
651
- // 截取点之后的部分
652
- return pathname.slice(lastDotIndex + 1).toLowerCase();
653
- },
654
- downloadFile: function () {
655
- let filePath, name;
656
- let opts;
657
- if (typeof arguments[0] === "string") {
658
- filePath = arguments[0];
659
- name = arguments[1];
660
- } else {
661
- opts = arguments[0];
662
- filePath = opts.filePath;
663
- name = opts.name;
664
- }
665
- if (filePath) {
666
- let url = null;
667
- if (filePath.indexOf("?") >= 0) {
668
- url = filePath + "&_d=true";
669
- } else {
670
- url = filePath + "?_d=true";
671
- }
672
- if (name) {
673
- let fileSuffix = this.getFileExtension(filePath);
674
- if (fileSuffix && !name.endsWith("." + fileSuffix)) {
675
- name = name + "." + fileSuffix;
676
- }
677
-
678
- url += "&_n=" + encodeURIComponent(name);
679
- }
680
- // window.open(url);
681
- openInNewTab(url);
682
- }
683
- },
684
- isPreviewFile(fileName) {
685
- let fileSuffix = this.getFileSuffix(fileName);
686
- return typeList.includes(fileSuffix);
687
- },
688
- };
689
-
690
- Vue.prototype.$openFilePreview = function () {
691
- let filePath;
692
- let opts;
693
- if (typeof arguments[0] === "string") {
694
- filePath = arguments[0];
695
- } else {
696
- let attachment = arguments[0];
697
- filePath = attachment.domain + attachment.url;
698
- }
699
- let fileSuffix = this.$commonFileUtil.getFileSuffix(filePath);
700
- if (!typeList.includes(fileSuffix)) {
701
- return;
702
- }
703
-
704
- this.$http({
705
- url: USER_PREFIX + "/sf_common/getFilePreviewUrl",
706
- method: `post`,
707
- data: {
708
- url: filePath,
709
- },
710
- isLoading: true,
711
- success: (res) => {
712
- if (res.objx) {
713
- openInNewTab(res.objx);
714
- }
715
- },
716
- });
717
- };
718
-
719
- function openInNewTab(url) {
720
- if (!url) return;
721
- let a = document.createElement("a");
722
- a.href = url;
723
- a.target = "_blank";
724
- document.body.appendChild(a);
725
- a.click();
726
- document.body.removeChild(a);
727
- }
728
-
729
- Vue.prototype.$getFilePreviewUrl = async function (obj, callback) {
730
- let filePath;
731
- let opts;
732
- if (typeof obj === "string") {
733
- filePath = obj;
734
- } else {
735
- let attachment = obj;
736
- filePath = attachment.domain + attachment.url;
737
- }
738
- let fileSuffix = this.$commonFileUtil.getFileSuffix(filePath);
739
- /*if (!typeList.includes(fileSuffix)) {
740
- return;
741
- }*/
742
-
743
- return this.$http({
744
- url: USER_PREFIX + "/sf_common/getFilePreviewUrl",
745
- method: `post`,
746
- data: {
747
- url: filePath,
748
- },
749
- isLoading: true,
750
- success: (res) => {
751
- callback && callback(res.objx);
752
- },
753
- });
754
- };
755
-
756
- Vue.prototype.$baseFilePreview = function (attachment, index) {
757
- let that = this;
758
- let openImagePreView = function (attachments, index) {
759
- let pictureIndex = -1;
760
- let pictureDtoList = [];
761
- index = index || 0;
762
- attachments.forEach((item, i) => {
763
- let typeStr = Object.prototype.toString.call(item);
764
- if (typeStr === "[object Object]") {
765
- if (that.$commonFileUtil.isPictureFile(item.url)) {
766
- if (i <= index) {
767
- pictureIndex++;
768
- }
769
- pictureDtoList.push(item.domain + item.url);
770
- }
771
- } else {
772
- if (that.$commonFileUtil.isPictureFile(item)) {
773
- if (i <= index) {
774
- pictureIndex++;
775
- }
776
- pictureDtoList.push(item);
777
- }
778
- }
779
- });
780
-
781
- let a = Vue.extend(ElImageViewer);
782
- let instance = new a({
783
- propsData: {
784
- onClose: () => {
785
- dom.remove();
786
- },
787
- initialIndex: pictureIndex,
788
- urlList: pictureDtoList,
789
- },
790
- });
791
- let dom = instance.$mount().$el;
792
- document.body.append(dom);
793
- };
794
- let openPreview = function (attachment, index) {
795
- if (Array.isArray(attachment)) {
796
- let currentFile = attachment[index];
797
- let typeStr = Object.prototype.toString.call(currentFile);
798
- let url =
799
- typeStr === "[object Object]"
800
- ? currentFile.domain + currentFile.url
801
- : currentFile;
802
- if (that.$commonFileUtil.isPictureFile(url)) {
803
- openImagePreView(attachment, index);
804
- } else if (that.$commonFileUtil.isPreviewFile(url)) {
805
- that.$openFilePreview(url);
806
- }
807
- } else {
808
- let typeStr = Object.prototype.toString.call(attachment);
809
- let url =
810
- typeStr === "[object Object]"
811
- ? attachment.domain + attachment.url
812
- : attachment;
813
- if (that.$commonFileUtil.isPictureFile(url)) {
814
- openImagePreView([url], 0);
815
- } else if (that.$commonFileUtil.isPreviewFile(url)) {
816
- that.$openFilePreview(url);
817
- }
818
- }
819
- };
820
- openPreview(attachment, index);
821
- };
822
-
823
- Vue.prototype.$openEditView = function (key) {
824
- this[key] = false;
825
- setTimeout(() => {
826
- this[key] = true;
827
- }, 200);
828
- };
829
-
830
- Vue.prototype.$baseReload = function (param) {
831
- this.$emit("reload", this, param);
832
- };
833
-
834
- Vue.prototype.$reloadHandle = function (target, param) {
835
- let visibleKey = target.$attrs["visible-key"] || "showEdit";
836
- let parentTarget = target.$attrs["parent-target"] || target.$parent;
837
- let originTarget = parentTarget.$refs._viewDialog ? parentTarget : target;
838
- let updateParam =
839
- param !== null &&
840
- param !== undefined &&
841
- param.updateParam !== null &&
842
- param.updateParam !== undefined
843
- ? param.updateParam
844
- : {};
845
- for (let key in updateParam) {
846
- originTarget.$emit("update:" + key, updateParam[key]);
847
- }
848
- parentTarget[visibleKey] = false;
849
- return new Promise((resolve) => {
850
- setTimeout(() => {
851
- parentTarget[visibleKey] = true;
852
- parentTarget.$nextTick(resolve);
853
- }, 200);
854
- });
855
- };
856
-
857
- Vue.prototype.$baseStartPickerOptions = function (value, type) {
858
- return {
859
- disabledDate: (time) => {
860
- if (value !== null && value !== undefined && value !== "") {
861
- let date = new Date(value.replace(/-/g, "/"));
862
- if (!type || type === "date") {
863
- date.setDate(date.getDate() + 1);
864
- return time.getTime() >= date.getTime();
865
- } else if (type === "year") {
866
- return time.getYear() > date.getYear();
867
- } else if (type === "month") {
868
- date.setMonth(date.getMonth() + 1);
869
- return time.getTime() >= date.getTime();
870
- }
871
- } else {
872
- return false;
873
- }
874
- },
875
- };
876
- };
877
-
878
- Vue.prototype.$baseEndPickerOptions = function (value, format) {
879
- return {
880
- disabledDate: (time) => {
881
- if (value !== null && value !== undefined && value !== "") {
882
- let date = new Date(value.replace(/-/g, "/"));
883
- return time.getTime() < date.getTime();
884
- } else {
885
- return false;
886
- }
887
- },
888
- };
889
- };
890
-
891
- //除法
892
- function baseDiv() {
893
- let value = 0;
894
- if (arguments.length) {
895
- value = arguments[0];
896
- for (let i = 1; i < arguments.length; i++) {
897
- value = XEUtils.divide(value, arguments[i]);
898
- }
899
- }
900
- return value;
901
- }
902
-
903
- //乘法
904
- function baseMul() {
905
- let value = 0;
906
- if (arguments.length) {
907
- value = arguments[0];
908
- for (let i = 1; i < arguments.length; i++) {
909
- value = XEUtils.multiply(value, arguments[i]);
910
- }
911
- }
912
- return value;
913
- }
914
-
915
- //加法
916
- function baseAdd() {
917
- let value = 0;
918
- if (arguments.length) {
919
- value = arguments[0];
920
- for (let i = 1; i < arguments.length; i++) {
921
- value = XEUtils.add(value, arguments[i]);
922
- }
923
- }
924
- return value;
925
- }
926
-
927
- //减法
928
- function baseSub() {
929
- let value = 0;
930
- if (arguments.length) {
931
- value = arguments[0];
932
- for (let i = 1; i < arguments.length; i++) {
933
- value = XEUtils.subtract(value, arguments[i]);
934
- }
935
- }
936
- return value;
937
- }
938
-
939
- Vue.prototype.$baseAdd = baseAdd;
940
- Vue.prototype.$baseSub = baseSub;
941
- Vue.prototype.$baseMul = baseMul;
942
- Vue.prototype.$baseDiv = baseDiv;
943
-
944
- /**
945
- * 格式化数字为带千分位的字符串。
946
- *
947
- * @param {string | number} value - 输入值
948
- * @param {Object} [options={}] - 配置
949
- * @param {boolean} [options.fixed=false] -
950
- * - `true`: 启用定点精度处理 —— 使用 toFixed(digits) 四舍五入并补零到指定小数位。
951
- * - `false`(默认): 保留原始小数形式(不四舍五入、不补零、保留尾随零)。
952
- * @param {number} [options.digits=2] - 小数位数(仅在 fixed: true 时生效)
953
- * @param {string} [options.thousandsSeparator=','] - 千分位分隔符(始终生效)
954
- * @param {string} [options.decimalSeparator='.'] - 小数点符号
955
- * @returns {string}
956
- *
957
- * @example
958
- * // 默认:保留原始小数
959
- * formatNumber(0.2); // "0.2"
960
- * formatNumber("0.2000"); // "0.2000"
961
- *
962
- * // 启用定点精度处理
963
- * formatNumber(0.2, { fixed: true }); // "0.20"
964
- * formatNumber("123.456", { fixed: true, digits: 1 }); // "123.5"
965
- * formatNumber(1000, { fixed: true, digits: 0 }); // "1,000"
966
- */
967
- function formatNumber(value, options = {}) {
968
- if (value === null || value === undefined || value === "") {
969
- return "";
970
- }
971
-
972
- const {
973
- fixed = false,
974
- digits = 2,
975
- thousandsSeparator = ",",
976
- decimalSeparator = ".",
977
- } = options;
978
-
979
- const isNumber = typeof value === "number";
980
- let str = String(value).trim();
981
-
982
- // Normalize ".123" → "0.123"
983
- if (str.charCodeAt(0) === 46) {
984
- str = "0" + str;
985
- } else if (str.startsWith("-.")) {
986
- str = "-0." + str.slice(2);
987
- }
988
-
989
- let intPart, decPart, isNegative;
990
-
991
- if (fixed) {
992
- // ✅ 启用精度处理:toFixed + 补零
993
- const num = isNumber ? value : parseFloat(str);
994
- if (num !== num) return str;
995
-
996
- const fixedStr = num.toFixed(digits);
997
- const dotIndex = fixedStr.indexOf(".");
998
- intPart = dotIndex === -1 ? fixedStr : fixedStr.slice(0, dotIndex);
999
- decPart = dotIndex === -1 ? "" : fixedStr.slice(dotIndex + 1);
1000
- isNegative = intPart.charCodeAt(0) === 45;
1001
- if (isNegative) intPart = intPart.slice(1);
1002
- } else {
1003
- // 保留原始小数
1004
- let s = str;
1005
- isNegative = s.charCodeAt(0) === 45;
1006
- if (isNegative) s = s.slice(1);
1007
-
1008
- const dotIndex = s.indexOf(".");
1009
- intPart = dotIndex === -1 ? s : s.slice(0, dotIndex);
1010
- decPart = dotIndex === -1 ? "" : s.slice(dotIndex + 1);
1011
-
1012
- if (intPart === "") intPart = "0";
1013
- if (!/^\d+$/.test(intPart)) return str;
1014
- }
1015
-
1016
- // 千分位(始终应用)
1017
- let fmtInt = intPart;
1018
- if (intPart !== "0") {
1019
- let out = "";
1020
- for (let i = intPart.length - 1, c = 0; i >= 0; i--, c++) {
1021
- if (c > 0 && c % 3 === 0) out = thousandsSeparator + out;
1022
- out = intPart[i] + out;
1023
- }
1024
- fmtInt = out;
1025
- }
1026
-
1027
- // 拼接
1028
- let result = isNegative ? "-" + fmtInt : fmtInt;
1029
- if (decPart) {
1030
- result += decimalSeparator + decPart;
1031
- } else if (fixed && digits > 0) {
1032
- result += decimalSeparator + "0".repeat(digits);
1033
- }
1034
-
1035
- return result;
1036
- }
1037
- Vue.prototype.$formatNumber = formatNumber;
1038
-
1039
- /**
1040
- * 生成一个符合 RFC4122 标准的随机 UUID (v4)
1041
- * @returns {string} 格式为 "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" 的 UUID 字符串
1042
- */
1043
- function generateUUID() {
1044
- const buf = new Uint8Array(16);
1045
- crypto.getRandomValues(buf);
1046
- buf[6] = (buf[6] & 0x0f) | 0x40; // version 4
1047
- buf[8] = (buf[8] & 0x3f) | 0x80; // variant RFC4122
1048
- const hex = Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join(
1049
- ""
1050
- );
1051
- return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(
1052
- 12,
1053
- 16
1054
- )}-${hex.slice(16, 20)}-${hex.slice(20)}`;
1055
- }
1056
- Vue.prototype.$generateUUID = generateUUID;
1057
-
1058
- //数字精确位数
1059
- Vue.prototype.$currency = function (value, priceScale, priceRoundType) {
1060
- if (value !== null && value !== undefined) {
1061
- if (priceScale === null || priceScale === undefined) {
1062
- priceScale = 2;
1063
- }
1064
- if (priceRoundType === null || priceRoundType === undefined) {
1065
- priceRoundType = "roundHalfUp";
1066
- }
1067
- let price;
1068
- if (priceRoundType === "roundHalfUp") {
1069
- price = (
1070
- Math.round(value * Math.pow(10, priceScale)) /
1071
- Math.pow(10, priceScale)
1072
- ).toFixed(priceScale);
1073
- } else if (priceRoundType === "roundUp") {
1074
- price = (
1075
- Math.ceil(value * Math.pow(10, priceScale)) / Math.pow(10, priceScale)
1076
- ).toFixed(priceScale);
1077
- } else {
1078
- price = (
1079
- Math.floor(value * Math.pow(10, priceScale)) /
1080
- Math.pow(10, priceScale)
1081
- ).toFixed(priceScale);
1082
- }
1083
- return price;
1084
- }
1085
- };
1086
-
1087
- Vue.prototype.$getBaseDicts = async function (option) {
1088
- let isLoading = option.isLoading || false;
1089
- return this.$http({
1090
- url: USER_PREFIX + "/common_attribute/listItems",
1091
- method: `post`,
1092
- data: {
1093
- code: option.code,
1094
- enabled: true,
1095
- forCompany: true,
1096
- ...option.data,
1097
- },
1098
- isLoading: isLoading,
1099
- modalStrictly: true,
1100
- success: (res) => {
1101
- let dicts = res.objx || [];
1102
- let dictMap = {};
1103
- for (let item of dicts) {
1104
- dictMap[item.sn] = item.value;
1105
- }
1106
- /* dicts.forEach((item) => {
1107
- dictMap[item.sn] = item.value;
1108
- }); */
1109
- option.success &&
1110
- option.success({
1111
- dicts,
1112
- dictMap,
1113
- });
1114
- },
1115
- });
1116
- };
1117
-
1118
- imFun.Form.methods.$baseValidate = function (callback, opt) {
1119
- let that = this;
1120
- that.validate((valid, obj, c, d) => {
1121
- if (!valid && (!opt || opt.errorTip !== false)) {
1122
- this.$message({
1123
- message: this.$t2("必填项不能为空", "system.message.required"),
1124
- type: "error",
1125
- duration: 2000,
1126
- });
1127
- }
1128
- scrollToFirstError(that);
1129
- callback(valid, obj);
1130
- });
1131
- };
1132
-
1133
- function scrollToFirstError(formTarget) {
1134
- // 获取第一个验证失败的字段
1135
- // let formTarget = this.$refs['renderForm'];
1136
- const firstErrorField = Object.keys(formTarget.fields).find((key) => {
1137
- return formTarget.fields[key].validateState === "error";
1138
- });
1139
-
1140
- if (firstErrorField) {
1141
- const field = formTarget.fields[firstErrorField];
1142
-
1143
- let dom = field.$el;
1144
- if (dom) {
1145
- // 滚动到该字段位置
1146
- dom.scrollIntoView({
1147
- behavior: "smooth",
1148
- block: "center",
1149
- });
1150
-
1151
- // 添加高亮效果
1152
- dom.classList.add("highlight");
1153
-
1154
- // 3秒后移除高亮效果
1155
- setTimeout(() => {
1156
- dom.classList.remove("highlight");
1157
- }, 3000);
1158
- }
1159
- }
1160
- }
1161
-
1162
- Vue.prototype.$getBillInfo = async function (option) {
1163
- let defaultOption = {
1164
- url: null,
1165
- method: `post`,
1166
- data: {},
1167
- isLoading: true,
1168
- modalStrictly: true,
1169
- success: null,
1170
- };
1171
- let opt = Object.assign({}, defaultOption, option);
1172
- delete opt.wfConfig;
1173
- return this.$http({
1174
- ...opt,
1175
- success: (res, response) => {
1176
- option.success && option.success(res, response);
1177
- },
1178
- });
1179
- };
1180
-
1181
- Vue.prototype.$downloadByFileWhole = function (fileWhole, fileName) {
1182
- let that = this;
1183
- if (!fileWhole) {
1184
- this.$baseAlert("凭证信息不存在");
1185
- return;
1186
- }
1187
- let getDownloadDomian = function (callback) {
1188
- that.$http({
1189
- method: "post",
1190
- url: USER_PREFIX + "/common/fileDownloadUrl",
1191
- data: {},
1192
- isLoading: true,
1193
- success: (res) => {
1194
- callback(res.objx);
1195
- },
1196
- });
1197
- };
1198
- getDownloadDomian((domain) => {
1199
- if (fileName) {
1200
- fileWhole.fileName = fileName;
1201
- }
1202
- that.$http({
1203
- method: "post",
1204
- url: domain + "/docfile/download",
1205
- data: fileWhole,
1206
- isLoading: true,
1207
- success: (res) => {
1208
- // window.open(res.objx.url);
1209
- let url = res.objx.url;
1210
- openInNewTab(url);
1211
- },
1212
- });
1213
- });
1214
- };
1215
-
1216
- let isDef = function (value) {
1217
- return value !== undefined && value !== null;
1218
- };
1219
-
1220
- Vue.prototype.$t2 = function (defaultValue, path, values) {
1221
- let that = window.$vueRoot;
1222
- if (!that.hasOwnProperty("_i18n")) {
1223
- return defaultValue;
1224
- }
1225
- const i18n = that.$i18n;
1226
- path = path || defaultValue;
1227
- return i18n.te(path) ? i18n.t(path, values) : defaultValue;
1228
- };
1229
-
1230
- Vue.prototype.$t1 = function (path, values) {
1231
- let that = window.$vueRoot;
1232
- if (!that.hasOwnProperty("_i18n")) {
1233
- return path;
1234
- }
1235
- let lang = that.$i18n.locale;
1236
- const i18n = that.$i18n;
1237
- if (lang === "zh") {
1238
- let val = i18n._t(path, lang, { zh: { [path]: path } }, null, values);
1239
- return val;
1240
- } else {
1241
- if (!i18n.te(path)) {
1242
- return i18n._t(path, lang, { zh: { [path]: path } }, null, values);
1243
- } else {
1244
- return (
1245
- i18n.t(path, values) ||
1246
- i18n._t(path, lang, { zh: { [path]: path } }, null, values)
1247
- );
1248
- }
1249
- }
1250
- };
1251
-
1252
- Vue.prototype.$i18nVal = function (zhValue, enValue) {
1253
- let that = window.$vueRoot;
1254
- if (!that.hasOwnProperty("_i18n")) {
1255
- return zhValue;
1256
- }
1257
- let $i18n = that.$i18n;
1258
- let value = zhValue;
1259
- if ($i18n.locale === "zh") {
1260
- value = zhValue;
1261
- } else if ($i18n.locale === "en") {
1262
- value = enValue;
1263
- }
1264
- return value;
1265
- };
1266
-
1267
- Vue.prototype.$utcToLocal = function (utcTime) {
1268
- if (!utcTime) return utcTime;
1269
- let offsetHours = this.$store.getters.utcTransformOffset; // 时区偏移量,单位:小时
1270
- if (!offsetHours || offsetHours === 0) return utcTime;
1271
- let localTime = moment(utcTime).add(offsetHours, "hours");
1272
- return localTime.format("YYYY-MM-DD HH:mm:ss");
1273
- };
1274
-
1275
- Vue.prototype.$window = window;
1276
- };
1277
-
1278
- window && Object.assign(window, imFun.prefixConfig);
1279
- if (typeof window !== "undefined" && window.Vue) {
1280
- install(window.Vue);
1281
- }
1282
-
1283
- export default install;
1
+ /**version-1.0*/
2
+ let install = {};
3
+
4
+ import request from "./request";
5
+ import * as lodash from "lodash";
6
+ import { Loading, Message, MessageBox, Notification, Form } from "element-ui";
7
+ import store from "../store";
8
+ import ElImageViewer from "../components/VabUpload/image-viewer";
9
+
10
+ import { getToken } from "./auth";
11
+ import XEUtils from "xe-utils";
12
+
13
+ import prefixConfig from "@/prefixConfig.js";
14
+ import moment from "moment";
15
+ import { openView } from "./repeatOpen";
16
+ import { assetUrl } from "./assetUrl";
17
+ import {
18
+ buildBaseDictsKey,
19
+ invalidateBaseDicts,
20
+ loadBaseDicts,
21
+ toBaseDicts,
22
+ } from "./baseDictsCache";
23
+
24
+ let imFun = {
25
+ request,
26
+ lodash,
27
+ Loading,
28
+ Message,
29
+ MessageBox,
30
+ Notification,
31
+ Form,
32
+ store,
33
+ getToken,
34
+ prefixConfig,
35
+ };
36
+
37
+ const FILE_ICON_NAME_MAP = {
38
+ word: "ico-wrod.svg",
39
+ excel: "ico-excel.svg",
40
+ ppt: "ico-ppt.svg",
41
+ pdf: "ico-pdf.svg",
42
+ picture: "ico-photo.svg",
43
+ video: "ico-video.svg",
44
+ audio: "ico-music.svg",
45
+ html: "ico-html.svg",
46
+ txt: "ico-txt.svg",
47
+ java: "ico-java.svg",
48
+ vue: "ico-vue.svg",
49
+ ftl: "ico-ftl.svg",
50
+ xml: "ico-xml.svg",
51
+ flash: "ico-default_wenjian.svg",
52
+ zip: "ico-yasuobao.svg",
53
+ exe: "ico-default_wenjian.svg",
54
+ psd: "ico-psd.svg",
55
+ folder: "ico-wenjianjia.svg",
56
+ other: "ico-default_wenjian.svg",
57
+ };
58
+
59
+ // 使用静态 require 建立明确的资源依赖图,避免动态目录 require 把业务图片一并打包。
60
+ // webpack4/5 的返回值差异统一由 assetUrl 处理。
61
+ const FILE_ICON_MODULE_MAP = {
62
+ "ico-wrod.svg": require("@base/core-resources/images/ico-wrod.svg"),
63
+ "ico-excel.svg": require("@base/core-resources/images/ico-excel.svg"),
64
+ "ico-ppt.svg": require("@base/core-resources/images/ico-ppt.svg"),
65
+ "ico-pdf.svg": require("@base/core-resources/images/ico-pdf.svg"),
66
+ "ico-photo.svg": require("@base/core-resources/images/ico-photo.svg"),
67
+ "ico-video.svg": require("@base/core-resources/images/ico-video.svg"),
68
+ "ico-music.svg": require("@base/core-resources/images/ico-music.svg"),
69
+ "ico-html.svg": require("@base/core-resources/images/ico-html.svg"),
70
+ "ico-txt.svg": require("@base/core-resources/images/ico-txt.svg"),
71
+ "ico-java.svg": require("@base/core-resources/images/ico-java.svg"),
72
+ "ico-vue.svg": require("@base/core-resources/images/ico-vue.svg"),
73
+ "ico-ftl.svg": require("@base/core-resources/images/ico-ftl.svg"),
74
+ "ico-xml.svg": require("@base/core-resources/images/ico-xml.svg"),
75
+ "ico-yasuobao.svg": require("@base/core-resources/images/ico-yasuobao.svg"),
76
+ "ico-psd.svg": require("@base/core-resources/images/ico-psd.svg"),
77
+ "ico-wenjianjia.svg": require("@base/core-resources/images/ico-wenjianjia.svg"),
78
+ "ico-default_wenjian.svg": require("@base/core-resources/images/ico-default_wenjian.svg"),
79
+ };
80
+
81
+ function reqImg(name) {
82
+ const mod = FILE_ICON_MODULE_MAP[name] || FILE_ICON_MODULE_MAP[FILE_ICON_NAME_MAP.other];
83
+ return assetUrl(mod);
84
+ }
85
+
86
+ const FILE_ICON_TYPE_MAP = {
87
+ doc: "word",
88
+ docx: "word",
89
+ xls: "excel",
90
+ xlsx: "excel",
91
+ ppt: "ppt",
92
+ pptx: "ppt",
93
+ pdf: "pdf",
94
+ jpg: "picture",
95
+ jpeg: "picture",
96
+ png: "picture",
97
+ gif: "picture",
98
+ mp3: "video",
99
+ mp4: "video",
100
+ mpg: "video",
101
+ mkv: "video",
102
+ rmvb: "video",
103
+ avi: "video",
104
+ mov: "video",
105
+ wav: "audio",
106
+ html: "html",
107
+ htm: "html",
108
+ txt: "txt",
109
+ java: "java",
110
+ vue: "vue",
111
+ ftl: "ftl",
112
+ xml: "xml",
113
+ swf: "flash",
114
+ zip: "zip",
115
+ rar: "zip",
116
+ "7z": "zip",
117
+ // exe: 'exe',
118
+ psd: "psd",
119
+ };
120
+
121
+ let typeList = [
122
+ "doc",
123
+ "docx",
124
+ "xls",
125
+ "xlsx",
126
+ "ppt",
127
+ "pptx",
128
+ "csv",
129
+ "wps",
130
+ "dps",
131
+ "et",
132
+ "ett",
133
+ "wpt",
134
+ "vsd",
135
+ "vsdx",
136
+ "wmf",
137
+ "emf",
138
+ "psd",
139
+ "eps",
140
+ "pdf",
141
+ "xmind",
142
+ "obj",
143
+ "3ds",
144
+ "stl",
145
+ "ply",
146
+ "gltf",
147
+ "glb",
148
+ "off",
149
+ "3dm",
150
+ "fbx",
151
+ "dae",
152
+ "wrl",
153
+ "3mf",
154
+ "ifc",
155
+ "brep",
156
+ "step",
157
+ "iges",
158
+ "fcstd",
159
+ "bim",
160
+ "dwg",
161
+ "dxf",
162
+ "dwf",
163
+ "iges",
164
+ "igs",
165
+ "dwt",
166
+ "dng",
167
+ "ifc",
168
+ "dwfx",
169
+ "stl",
170
+ "cf2",
171
+ "plt",
172
+ "txt",
173
+ "xml",
174
+ "md",
175
+ "java",
176
+ "php",
177
+ "py",
178
+ "js",
179
+ "css",
180
+ "zip",
181
+ "rar",
182
+ "jar",
183
+ "tar",
184
+ "gzip",
185
+ "7z",
186
+ "mp3",
187
+ "wav",
188
+ "mp4",
189
+ "flv",
190
+ "avi",
191
+ "mov",
192
+ "rm",
193
+ "mkv",
194
+ "mpeg",
195
+ "mpg",
196
+ "rmvb",
197
+ "wmv",
198
+ "3gp",
199
+ "swf",
200
+ "drawio",
201
+ "tif",
202
+ "tiff",
203
+ "jfif",
204
+ "webp",
205
+ "tga",
206
+ "svg",
207
+ "vue",
208
+ "ftl",
209
+ ];
210
+
211
+ const accessToken = imFun.store.getters["user/token"];
212
+
213
+ const loadingText = "";
214
+ const messageDuration = 3000;
215
+
216
+ install = (Vue, opts = {}) => {
217
+ /**http请求*/
218
+ let $http = async function (option) {
219
+ option = option || {};
220
+ if (!option.loadingTarget && this.$el) {
221
+ option.loadingTarget = this.$el;
222
+ }
223
+ if (!option.vueTarget) {
224
+ option.vueTarget = this;
225
+ }
226
+ if (option.sync === false) {
227
+ return await imFun.request(option);
228
+ } else {
229
+ return imFun.request(option);
230
+ }
231
+ };
232
+
233
+ Vue.prototype.$commonHttp = function (opts) {
234
+ let defaultOption = {
235
+ addCreateInfo: true,
236
+ queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
237
+ };
238
+ let option = Object.assign({}, defaultOption, opts);
239
+ if (opts.addCreateInfo === null || opts.addCreateInfo === undefined) {
240
+ option.addCreateInfo = defaultOption.addCreateInfo;
241
+ }
242
+ if (
243
+ opts.queryCreateInfo === null ||
244
+ opts.queryCreateInfo === undefined ||
245
+ opts.queryCreateInfo === true
246
+ ) {
247
+ option.queryCreateInfo = defaultOption.queryCreateInfo;
248
+ }
249
+ if (opts.queryCreateInfo === false) {
250
+ option.queryCreateInfo = "0";
251
+ }
252
+ return this.$http(option);
253
+ };
254
+
255
+ Object.assign($http, imFun.request);
256
+ $http.prototype = imFun.request.prototype;
257
+ Vue.prototype.$http = $http;
258
+
259
+ /* 通用打开菜单/路由:开关开启时以独立标签重复打开,否则按原逻辑跳转
260
+ * 用法:this.$openView('/path') 或 this.$openView({ path, query }[, route]) */
261
+ Vue.prototype.$openView = function (location, route) {
262
+ return openView(this.$router, location, route);
263
+ };
264
+
265
+ /* 全局accessToken */
266
+ Vue.prototype.$baseAccessToken = () => {
267
+ return accessToken || imFun.getToken();
268
+ };
269
+
270
+ /* 全局加载层 */
271
+ Vue.prototype.$baseLoading = function (option) {
272
+ let d = this.$el;
273
+ let loading;
274
+ option = option || {};
275
+ if (!option.index) {
276
+ let opts = {
277
+ lock: true,
278
+ background: "hsla(0,0%,100%,.8)",
279
+ target: d,
280
+ };
281
+ Object.assign(opts, option);
282
+ loading = imFun.Loading.service(opts);
283
+ } else {
284
+ let opts = {
285
+ lock: true,
286
+ spinner: "vab-loading-type" + option.index,
287
+ background: "hsla(0,0%,100%,.8)",
288
+ target: d,
289
+ };
290
+ Object.assign(opts, option);
291
+ loading = imFun.Loading.service(opts);
292
+ }
293
+ return loading;
294
+ };
295
+ /* 全局多彩加载层 */
296
+ Vue.prototype.$baseColorfullLoading = function (index, text) {
297
+ let loading;
298
+ if (!index) {
299
+ loading = imFun.Loading.service({
300
+ lock: true,
301
+ text: text || loadingText,
302
+ spinner: "dots-loader",
303
+ background: "hsla(0,0%,100%,.8)",
304
+ target: this.target,
305
+ fullscreen: true,
306
+ });
307
+ } else {
308
+ switch (index) {
309
+ case 1:
310
+ index = "dots";
311
+ break;
312
+ case 2:
313
+ index = "gauge";
314
+ break;
315
+ case 3:
316
+ index = "inner-circles";
317
+ break;
318
+ case 4:
319
+ index = "plus";
320
+ break;
321
+ }
322
+ loading = imFun.Loading.service({
323
+ lock: true,
324
+ text: text || loadingText,
325
+ spinner: index + "-loader",
326
+ background: "hsla(0,0%,100%,.8)",
327
+ target: this.target,
328
+ });
329
+ }
330
+ return loading;
331
+ };
332
+ /* 全局Message */
333
+ Vue.prototype.$baseMessage = ({ message, type, onClose }) => {
334
+ imFun.Message({
335
+ offset: 60,
336
+ showClose: true,
337
+ message: message,
338
+ type: type,
339
+ dangerouslyUseHTMLString: true,
340
+ duration: messageDuration,
341
+ onClose: onClose,
342
+ });
343
+ };
344
+
345
+ /* 全局Alert */
346
+ Vue.prototype.$baseAlert = function (content, title, callback) {
347
+ imFun.MessageBox.alert(content, title || "提示", {
348
+ confirmButtonText: "确定",
349
+ dangerouslyUseHTMLString: true,
350
+ target: this.$el,
351
+ confirmButtonClass: "icondui",
352
+ customClass: "dialog-style",
353
+ callback: (action) => {
354
+ if (callback) {
355
+ callback();
356
+ }
357
+ },
358
+ });
359
+ };
360
+
361
+ /* 全局Confirm */
362
+ Vue.prototype.$baseConfirm = function (content, title) {
363
+ return imFun.MessageBox.confirm(content, title || "提示", {
364
+ confirmButtonText: "确定",
365
+ cancelButtonText: "取消",
366
+ closeOnClickModal: false,
367
+ type: "warning",
368
+ customClass: "dialog-style",
369
+ cancelButtonClass: "iconguanbi",
370
+ confirmButtonClass: "icondui",
371
+ });
372
+ };
373
+
374
+ /* 全局Notification */
375
+ Vue.prototype.$baseNotify = (message, title, type, position) => {
376
+ imFun.Notification({
377
+ title: title,
378
+ message: message,
379
+ position: position || "top-right",
380
+ type: type || "success",
381
+ duration: messageDuration,
382
+ });
383
+ };
384
+
385
+ /* 全局TableHeight */
386
+ Vue.prototype.$baseTableHeight = (formType) => {
387
+ let height = window.innerHeight;
388
+ let paddingHeight = 400;
389
+ const formHeight = 50;
390
+
391
+ if (true) {
392
+ paddingHeight = 365;
393
+ }
394
+
395
+ if ("number" === typeof formType) {
396
+ height = height - paddingHeight - formHeight * formType;
397
+ } else {
398
+ height = height - paddingHeight;
399
+ }
400
+ return height;
401
+ };
402
+
403
+ /* 全局map图层 */
404
+ Vue.prototype.$baseMap = () => {
405
+ return new maptalks.Map("map", {
406
+ center: [116.41348403785, 39.910843952376],
407
+ zoom: 12,
408
+ minZoom: 1,
409
+ maxZoom: 19,
410
+ spatialReference: {
411
+ projection: "baidu",
412
+ },
413
+ attribution: {
414
+ content: "&copy; vue-admin-beautiful",
415
+ },
416
+ baseLayer: new maptalks.TileLayer("base", {
417
+ cssFilter: "sepia(100%) invert(90%)",
418
+ urlTemplate:
419
+ "http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",
420
+ subdomains: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
421
+ attribution:
422
+ '&copy; <a target="_blank" href="http://map.baidu.com">Baidu</a>',
423
+ }),
424
+ });
425
+ };
426
+
427
+ /* 全局lodash */
428
+ Vue.prototype.$baseLodash = imFun.lodash;
429
+ /* 全局事件总线 */
430
+ Vue.prototype.$baseEventBus = new Vue();
431
+ /* 模板里 :src="$assetUrl(require(...))" 用,见 utils/assetUrl.js */
432
+ Vue.prototype.$assetUrl = assetUrl;
433
+
434
+ Vue.prototype.$commonFileUtil = {
435
+ // 文件类型获取与判断接口
436
+ getFileSuffix: function (name) {
437
+ let i = name.lastIndexOf(".");
438
+ if (i < 0) {
439
+ // 默认是文本类型
440
+ return "";
441
+ }
442
+ let suffix = name.substring(i + 1, name.length).toLowerCase();
443
+ return suffix;
444
+ },
445
+ isBinary: function (suffix) {
446
+ if (!suffix || suffix === "") {
447
+ return false;
448
+ }
449
+ let fileTypeMap = {
450
+ bin: true,
451
+ exe: true,
452
+ dll: true,
453
+ so: true,
454
+ lib: true,
455
+ war: true,
456
+ jar: true,
457
+ };
458
+ let type = fileTypeMap[suffix];
459
+ if (undefined === type) {
460
+ return false;
461
+ }
462
+ return true;
463
+ },
464
+ isPicture: function (suffix) {
465
+ if (!suffix || suffix === "") {
466
+ return false;
467
+ }
468
+
469
+ let fileTypeMap = {
470
+ jpg: true,
471
+ jpeg: true,
472
+ png: true,
473
+ gif: true,
474
+ bmp: true,
475
+ mpg: true,
476
+ webp: true,
477
+ };
478
+
479
+ let type = fileTypeMap[suffix];
480
+ if (undefined === type) {
481
+ return false;
482
+ }
483
+
484
+ return true;
485
+ },
486
+ isVideo: function (suffix) {
487
+ if (!suffix || suffix === "") {
488
+ return false;
489
+ }
490
+ let fileTypeMap = {
491
+ avi: true,
492
+ mov: true,
493
+ mpeg: true,
494
+ mpg: true,
495
+ mp4: true,
496
+ rmvb: true,
497
+ asf: true,
498
+ flv: true,
499
+ ogg: true,
500
+ };
501
+
502
+ let type = fileTypeMap[suffix];
503
+ if (undefined === type) {
504
+ return false;
505
+ }
506
+
507
+ return true;
508
+ },
509
+ isText: function (suffix) {
510
+ if (!suffix || suffix === "") {
511
+ return false;
512
+ }
513
+ let fileTypeMap = {
514
+ txt: true,
515
+ log: true,
516
+ md: true,
517
+ py: true,
518
+ java: true,
519
+ cpp: true,
520
+ hpp: true,
521
+ c: true,
522
+ h: true,
523
+ json: true,
524
+ xml: true,
525
+ html: true,
526
+ sql: true,
527
+ js: true,
528
+ css: true,
529
+ jsp: true,
530
+ php: true,
531
+ properties: true,
532
+ conf: true,
533
+ out: true,
534
+ sh: true,
535
+ bat: true,
536
+ msg: true,
537
+ cmake: true,
538
+ yaml: true,
539
+ yml: true,
540
+ };
541
+
542
+ let type = fileTypeMap[suffix];
543
+ if (undefined === type) {
544
+ return false;
545
+ }
546
+
547
+ return true;
548
+ },
549
+ isZip: function (suffix) {
550
+ if (!suffix || suffix === "") {
551
+ return false;
552
+ }
553
+ let fileTypeMap = {
554
+ zip: true,
555
+ war: true,
556
+ rar: true,
557
+ "7z": true,
558
+ gz: true,
559
+ tgz: true,
560
+ xz: true,
561
+ txz: true,
562
+ bz2: true,
563
+ tbz2: true,
564
+ tar: true,
565
+ };
566
+
567
+ let type = fileTypeMap[suffix];
568
+ if (undefined === type) {
569
+ return false;
570
+ }
571
+
572
+ return true;
573
+ },
574
+ isOffice: function (suffix) {
575
+ if (!suffix || suffix === "") {
576
+ return false;
577
+ }
578
+ let fileTypeMap = {
579
+ doc: true,
580
+ docx: true,
581
+ ppt: true,
582
+ pptx: true,
583
+ xls: true,
584
+ xlsx: true,
585
+ };
586
+
587
+ let type = fileTypeMap[suffix];
588
+ if (undefined === type) {
589
+ return false;
590
+ }
591
+
592
+ return true;
593
+ },
594
+ isPdf: function (suffix) {
595
+ if (!suffix || suffix === "") {
596
+ return false;
597
+ }
598
+ let fileTypeMap = {
599
+ pdf: true,
600
+ };
601
+
602
+ let type = fileTypeMap[suffix];
603
+ if (undefined === type) {
604
+ return false;
605
+ }
606
+
607
+ return true;
608
+ },
609
+ isPictureFile: function (fileName) {
610
+ if (!fileName) return false;
611
+ let typeStr = Object.prototype.toString.call(fileName);
612
+ let suffix = null;
613
+ if (typeStr === "[object Object]") {
614
+ suffix = this.getFileSuffix(fileName.name);
615
+ } else {
616
+ suffix = this.getFileSuffix(fileName);
617
+ }
618
+ return this.isPicture(suffix);
619
+ },
620
+ isTextFile: function (fileName) {
621
+ let suffix = this.getFileSuffix(fileName);
622
+ return this.isText(suffix);
623
+ },
624
+ getShowUrl(url, showImagePreview) {
625
+ let index = url.lastIndexOf("/");
626
+ let filename;
627
+ if (index >= 0) {
628
+ filename = url.substring(url.lastIndexOf("/") + 1);
629
+ } else {
630
+ filename = url;
631
+ }
632
+
633
+ if (this.isPictureFile(filename) && showImagePreview !== false) {
634
+ return url;
635
+ } else {
636
+ return this.getFileIconRequire(filename);
637
+ }
638
+ },
639
+ resolveFileIconName: function (name, showType) {
640
+ let iconType = this.getDiyFileIconType(name) || "other";
641
+ if (showType) {
642
+ iconType = showType;
643
+ }
644
+ return FILE_ICON_NAME_MAP[iconType] || FILE_ICON_NAME_MAP.other;
645
+ },
646
+ getFileIconRequire: function (name, showType) {
647
+ return reqImg(this.resolveFileIconName(name, showType));
648
+ },
649
+ getFileIconPath: function (name, showType) {
650
+ return this.getFileIconRequire(name, showType);
651
+ },
652
+ getDiyFileIconType: function (name) {
653
+ let suffix = this.getFileSuffix(name);
654
+ if (suffix === "") {
655
+ // 默认是文本类型
656
+ return "";
657
+ }
658
+
659
+ let iconType = FILE_ICON_TYPE_MAP[suffix];
660
+ if (undefined === iconType) {
661
+ return "";
662
+ }
663
+ return iconType;
664
+ },
665
+ getFileExtension(urlString) {
666
+ if (!urlString) return null;
667
+ const url = new URL(urlString);
668
+ // 获取路径部分,例如 "/images/photo.jpg"
669
+ const pathname = url.pathname;
670
+
671
+ // 使用 lastIndexOf 找到最后一个点的位置
672
+ const lastDotIndex = pathname.lastIndexOf(".");
673
+
674
+ // 如果没有点,或者点在最后一位(即没有后缀),返回空字符串
675
+ if (lastDotIndex === -1 || lastDotIndex === pathname.length - 1) {
676
+ return "";
677
+ }
678
+
679
+ // 截取点之后的部分
680
+ return pathname.slice(lastDotIndex + 1).toLowerCase();
681
+ },
682
+ downloadFile: function () {
683
+ let filePath, name;
684
+ let opts;
685
+ if (typeof arguments[0] === "string") {
686
+ filePath = arguments[0];
687
+ name = arguments[1];
688
+ } else {
689
+ opts = arguments[0];
690
+ filePath = opts.filePath;
691
+ name = opts.name;
692
+ }
693
+ if (filePath) {
694
+ let url = null;
695
+ if (filePath.indexOf("?") >= 0) {
696
+ url = filePath + "&_d=true";
697
+ } else {
698
+ url = filePath + "?_d=true";
699
+ }
700
+ if (name) {
701
+ let fileSuffix = this.getFileExtension(filePath);
702
+ if (fileSuffix && !name.endsWith("." + fileSuffix)) {
703
+ name = name + "." + fileSuffix;
704
+ }
705
+
706
+ url += "&_n=" + encodeURIComponent(name);
707
+ }
708
+ // window.open(url);
709
+ openInNewTab(url);
710
+ }
711
+ },
712
+ isPreviewFile(fileName) {
713
+ let fileSuffix = this.getFileSuffix(fileName);
714
+ return typeList.includes(fileSuffix);
715
+ },
716
+ };
717
+
718
+ Vue.prototype.$openFilePreview = function () {
719
+ let filePath;
720
+ let opts;
721
+ if (typeof arguments[0] === "string") {
722
+ filePath = arguments[0];
723
+ } else {
724
+ let attachment = arguments[0];
725
+ filePath = attachment.domain + attachment.url;
726
+ }
727
+ let fileSuffix = this.$commonFileUtil.getFileSuffix(filePath);
728
+ if (!typeList.includes(fileSuffix)) {
729
+ return;
730
+ }
731
+
732
+ this.$http({
733
+ url: USER_PREFIX + "/sf_common/getFilePreviewUrl",
734
+ method: `post`,
735
+ data: {
736
+ url: filePath,
737
+ },
738
+ isLoading: true,
739
+ success: (res) => {
740
+ if (res.objx) {
741
+ openInNewTab(res.objx);
742
+ }
743
+ },
744
+ });
745
+ };
746
+
747
+ function openInNewTab(url) {
748
+ if (!url) return;
749
+ let a = document.createElement("a");
750
+ a.href = url;
751
+ a.target = "_blank";
752
+ document.body.appendChild(a);
753
+ a.click();
754
+ document.body.removeChild(a);
755
+ }
756
+
757
+ Vue.prototype.$getFilePreviewUrl = async function (obj, callback) {
758
+ let filePath;
759
+ let opts;
760
+ if (typeof obj === "string") {
761
+ filePath = obj;
762
+ } else {
763
+ let attachment = obj;
764
+ filePath = attachment.domain + attachment.url;
765
+ }
766
+ let fileSuffix = this.$commonFileUtil.getFileSuffix(filePath);
767
+ /*if (!typeList.includes(fileSuffix)) {
768
+ return;
769
+ }*/
770
+
771
+ return this.$http({
772
+ url: USER_PREFIX + "/sf_common/getFilePreviewUrl",
773
+ method: `post`,
774
+ data: {
775
+ url: filePath,
776
+ },
777
+ isLoading: true,
778
+ success: (res) => {
779
+ callback && callback(res.objx);
780
+ },
781
+ });
782
+ };
783
+
784
+ Vue.prototype.$baseFilePreview = function (attachment, index) {
785
+ let that = this;
786
+ let openImagePreView = function (attachments, index) {
787
+ let pictureIndex = -1;
788
+ let pictureDtoList = [];
789
+ index = index || 0;
790
+ attachments.forEach((item, i) => {
791
+ let typeStr = Object.prototype.toString.call(item);
792
+ if (typeStr === "[object Object]") {
793
+ if (that.$commonFileUtil.isPictureFile(item.url)) {
794
+ if (i <= index) {
795
+ pictureIndex++;
796
+ }
797
+ pictureDtoList.push(item.domain + item.url);
798
+ }
799
+ } else {
800
+ if (that.$commonFileUtil.isPictureFile(item)) {
801
+ if (i <= index) {
802
+ pictureIndex++;
803
+ }
804
+ pictureDtoList.push(item);
805
+ }
806
+ }
807
+ });
808
+
809
+ let a = Vue.extend(ElImageViewer);
810
+ let instance = new a({
811
+ propsData: {
812
+ onClose: () => {
813
+ dom.remove();
814
+ },
815
+ initialIndex: pictureIndex,
816
+ urlList: pictureDtoList,
817
+ },
818
+ });
819
+ let dom = instance.$mount().$el;
820
+ document.body.append(dom);
821
+ };
822
+ let openPreview = function (attachment, index) {
823
+ if (Array.isArray(attachment)) {
824
+ let currentFile = attachment[index];
825
+ let typeStr = Object.prototype.toString.call(currentFile);
826
+ let url =
827
+ typeStr === "[object Object]"
828
+ ? currentFile.domain + currentFile.url
829
+ : currentFile;
830
+ if (that.$commonFileUtil.isPictureFile(url)) {
831
+ openImagePreView(attachment, index);
832
+ } else if (that.$commonFileUtil.isPreviewFile(url)) {
833
+ that.$openFilePreview(url);
834
+ }
835
+ } else {
836
+ let typeStr = Object.prototype.toString.call(attachment);
837
+ let url =
838
+ typeStr === "[object Object]"
839
+ ? attachment.domain + attachment.url
840
+ : attachment;
841
+ if (that.$commonFileUtil.isPictureFile(url)) {
842
+ openImagePreView([url], 0);
843
+ } else if (that.$commonFileUtil.isPreviewFile(url)) {
844
+ that.$openFilePreview(url);
845
+ }
846
+ }
847
+ };
848
+ openPreview(attachment, index);
849
+ };
850
+
851
+ Vue.prototype.$openEditView = function (key) {
852
+ this[key] = false;
853
+ setTimeout(() => {
854
+ this[key] = true;
855
+ }, 200);
856
+ };
857
+
858
+ Vue.prototype.$baseReload = function (param) {
859
+ this.$emit("reload", this, param);
860
+ };
861
+
862
+ Vue.prototype.$reloadHandle = function (target, param) {
863
+ let visibleKey = target.$attrs["visible-key"] || "showEdit";
864
+ let parentTarget = target.$attrs["parent-target"] || target.$parent;
865
+ let originTarget = parentTarget.$refs._viewDialog ? parentTarget : target;
866
+ let updateParam =
867
+ param !== null &&
868
+ param !== undefined &&
869
+ param.updateParam !== null &&
870
+ param.updateParam !== undefined
871
+ ? param.updateParam
872
+ : {};
873
+ for (let key in updateParam) {
874
+ originTarget.$emit("update:" + key, updateParam[key]);
875
+ }
876
+ parentTarget[visibleKey] = false;
877
+ return new Promise((resolve) => {
878
+ setTimeout(() => {
879
+ parentTarget[visibleKey] = true;
880
+ parentTarget.$nextTick(resolve);
881
+ }, 200);
882
+ });
883
+ };
884
+
885
+ Vue.prototype.$baseStartPickerOptions = function (value, type) {
886
+ return {
887
+ disabledDate: (time) => {
888
+ if (value !== null && value !== undefined && value !== "") {
889
+ let date = new Date(value.replace(/-/g, "/"));
890
+ if (!type || type === "date") {
891
+ date.setDate(date.getDate() + 1);
892
+ return time.getTime() >= date.getTime();
893
+ } else if (type === "year") {
894
+ return time.getYear() > date.getYear();
895
+ } else if (type === "month") {
896
+ date.setMonth(date.getMonth() + 1);
897
+ return time.getTime() >= date.getTime();
898
+ }
899
+ } else {
900
+ return false;
901
+ }
902
+ },
903
+ };
904
+ };
905
+
906
+ Vue.prototype.$baseEndPickerOptions = function (value, format) {
907
+ return {
908
+ disabledDate: (time) => {
909
+ if (value !== null && value !== undefined && value !== "") {
910
+ let date = new Date(value.replace(/-/g, "/"));
911
+ return time.getTime() < date.getTime();
912
+ } else {
913
+ return false;
914
+ }
915
+ },
916
+ };
917
+ };
918
+
919
+ //除法
920
+ function baseDiv() {
921
+ let value = 0;
922
+ if (arguments.length) {
923
+ value = arguments[0];
924
+ for (let i = 1; i < arguments.length; i++) {
925
+ value = XEUtils.divide(value, arguments[i]);
926
+ }
927
+ }
928
+ return value;
929
+ }
930
+
931
+ //乘法
932
+ function baseMul() {
933
+ let value = 0;
934
+ if (arguments.length) {
935
+ value = arguments[0];
936
+ for (let i = 1; i < arguments.length; i++) {
937
+ value = XEUtils.multiply(value, arguments[i]);
938
+ }
939
+ }
940
+ return value;
941
+ }
942
+
943
+ //加法
944
+ function baseAdd() {
945
+ let value = 0;
946
+ if (arguments.length) {
947
+ value = arguments[0];
948
+ for (let i = 1; i < arguments.length; i++) {
949
+ value = XEUtils.add(value, arguments[i]);
950
+ }
951
+ }
952
+ return value;
953
+ }
954
+
955
+ //减法
956
+ function baseSub() {
957
+ let value = 0;
958
+ if (arguments.length) {
959
+ value = arguments[0];
960
+ for (let i = 1; i < arguments.length; i++) {
961
+ value = XEUtils.subtract(value, arguments[i]);
962
+ }
963
+ }
964
+ return value;
965
+ }
966
+
967
+ Vue.prototype.$baseAdd = baseAdd;
968
+ Vue.prototype.$baseSub = baseSub;
969
+ Vue.prototype.$baseMul = baseMul;
970
+ Vue.prototype.$baseDiv = baseDiv;
971
+
972
+ /**
973
+ * 格式化数字为带千分位的字符串。
974
+ *
975
+ * @param {string | number} value - 输入值
976
+ * @param {Object} [options={}] - 配置
977
+ * @param {boolean} [options.fixed=false] -
978
+ * - `true`: 启用定点精度处理 —— 使用 toFixed(digits) 四舍五入并补零到指定小数位。
979
+ * - `false`(默认): 保留原始小数形式(不四舍五入、不补零、保留尾随零)。
980
+ * @param {number} [options.digits=2] - 小数位数(仅在 fixed: true 时生效)
981
+ * @param {string} [options.thousandsSeparator=','] - 千分位分隔符(始终生效)
982
+ * @param {string} [options.decimalSeparator='.'] - 小数点符号
983
+ * @returns {string}
984
+ *
985
+ * @example
986
+ * // 默认:保留原始小数
987
+ * formatNumber(0.2); // "0.2"
988
+ * formatNumber("0.2000"); // "0.2000"
989
+ *
990
+ * // 启用定点精度处理
991
+ * formatNumber(0.2, { fixed: true }); // "0.20"
992
+ * formatNumber("123.456", { fixed: true, digits: 1 }); // "123.5"
993
+ * formatNumber(1000, { fixed: true, digits: 0 }); // "1,000"
994
+ */
995
+ function formatNumber(value, options = {}) {
996
+ if (value === null || value === undefined || value === "") {
997
+ return "";
998
+ }
999
+
1000
+ const {
1001
+ fixed = false,
1002
+ digits = 2,
1003
+ thousandsSeparator = ",",
1004
+ decimalSeparator = ".",
1005
+ } = options;
1006
+
1007
+ const isNumber = typeof value === "number";
1008
+ let str = String(value).trim();
1009
+
1010
+ // Normalize ".123" → "0.123"
1011
+ if (str.charCodeAt(0) === 46) {
1012
+ str = "0" + str;
1013
+ } else if (str.startsWith("-.")) {
1014
+ str = "-0." + str.slice(2);
1015
+ }
1016
+
1017
+ let intPart, decPart, isNegative;
1018
+
1019
+ if (fixed) {
1020
+ // ✅ 启用精度处理:toFixed + 补零
1021
+ const num = isNumber ? value : parseFloat(str);
1022
+ if (num !== num) return str;
1023
+
1024
+ const fixedStr = num.toFixed(digits);
1025
+ const dotIndex = fixedStr.indexOf(".");
1026
+ intPart = dotIndex === -1 ? fixedStr : fixedStr.slice(0, dotIndex);
1027
+ decPart = dotIndex === -1 ? "" : fixedStr.slice(dotIndex + 1);
1028
+ isNegative = intPart.charCodeAt(0) === 45;
1029
+ if (isNegative) intPart = intPart.slice(1);
1030
+ } else {
1031
+ // 保留原始小数
1032
+ let s = str;
1033
+ isNegative = s.charCodeAt(0) === 45;
1034
+ if (isNegative) s = s.slice(1);
1035
+
1036
+ const dotIndex = s.indexOf(".");
1037
+ intPart = dotIndex === -1 ? s : s.slice(0, dotIndex);
1038
+ decPart = dotIndex === -1 ? "" : s.slice(dotIndex + 1);
1039
+
1040
+ if (intPart === "") intPart = "0";
1041
+ if (!/^\d+$/.test(intPart)) return str;
1042
+ }
1043
+
1044
+ // 千分位(始终应用)
1045
+ let fmtInt = intPart;
1046
+ if (intPart !== "0") {
1047
+ let out = "";
1048
+ for (let i = intPart.length - 1, c = 0; i >= 0; i--, c++) {
1049
+ if (c > 0 && c % 3 === 0) out = thousandsSeparator + out;
1050
+ out = intPart[i] + out;
1051
+ }
1052
+ fmtInt = out;
1053
+ }
1054
+
1055
+ // 拼接
1056
+ let result = isNegative ? "-" + fmtInt : fmtInt;
1057
+ if (decPart) {
1058
+ result += decimalSeparator + decPart;
1059
+ } else if (fixed && digits > 0) {
1060
+ result += decimalSeparator + "0".repeat(digits);
1061
+ }
1062
+
1063
+ return result;
1064
+ }
1065
+ Vue.prototype.$formatNumber = formatNumber;
1066
+
1067
+ /**
1068
+ * 生成一个符合 RFC4122 标准的随机 UUID (v4)
1069
+ * @returns {string} 格式为 "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" 的 UUID 字符串
1070
+ */
1071
+ function generateUUID() {
1072
+ const buf = new Uint8Array(16);
1073
+ crypto.getRandomValues(buf);
1074
+ buf[6] = (buf[6] & 0x0f) | 0x40; // version 4
1075
+ buf[8] = (buf[8] & 0x3f) | 0x80; // variant RFC4122
1076
+ const hex = Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join(
1077
+ ""
1078
+ );
1079
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(
1080
+ 12,
1081
+ 16
1082
+ )}-${hex.slice(16, 20)}-${hex.slice(20)}`;
1083
+ }
1084
+ Vue.prototype.$generateUUID = generateUUID;
1085
+
1086
+ //数字精确位数
1087
+ Vue.prototype.$currency = function (value, priceScale, priceRoundType) {
1088
+ if (value !== null && value !== undefined) {
1089
+ if (priceScale === null || priceScale === undefined) {
1090
+ priceScale = 2;
1091
+ }
1092
+ if (priceRoundType === null || priceRoundType === undefined) {
1093
+ priceRoundType = "roundHalfUp";
1094
+ }
1095
+ let price;
1096
+ if (priceRoundType === "roundHalfUp") {
1097
+ price = (
1098
+ Math.round(value * Math.pow(10, priceScale)) /
1099
+ Math.pow(10, priceScale)
1100
+ ).toFixed(priceScale);
1101
+ } else if (priceRoundType === "roundUp") {
1102
+ price = (
1103
+ Math.ceil(value * Math.pow(10, priceScale)) / Math.pow(10, priceScale)
1104
+ ).toFixed(priceScale);
1105
+ } else {
1106
+ price = (
1107
+ Math.floor(value * Math.pow(10, priceScale)) /
1108
+ Math.pow(10, priceScale)
1109
+ ).toFixed(priceScale);
1110
+ }
1111
+ return price;
1112
+ }
1113
+ };
1114
+
1115
+ /**
1116
+ * 取基础字典。走 utils/baseDictsCache:同 key 并发只发一条,TTL 内直接复用结果。
1117
+ *
1118
+ * option.success 从 $http 的 success 里挪了出来 —— 命中缓存时根本不会发请求,
1119
+ * 留在 $http 配置里就永远不会被调到。回调时机因此晚了一个微任务,对调用方
1120
+ * (普遍是把 dicts 赋给 Vue data)没有影响。
1121
+ *
1122
+ * 额外可选参数:
1123
+ * option.cache === false / option.force —— 跳过缓存强制重取
1124
+ * option.cacheTtl —— 覆盖默认 TTL(毫秒),传 0 则只去重不缓存
1125
+ */
1126
+ Vue.prototype.$getBaseDicts = async function (option) {
1127
+ let isLoading = option.isLoading || false;
1128
+ // listItems 带 forCompany: true 发,结果是按公司隔离的;切换公司不刷新页面,
1129
+ // 缓存 key 必须带上公司编码,否则会命中上一家公司的字典。
1130
+ let key = buildBaseDictsKey(
1131
+ imFun.store.getters.companyCode,
1132
+ option.code,
1133
+ option.data
1134
+ );
1135
+ return loadBaseDicts({
1136
+ key,
1137
+ code: option.code,
1138
+ ttl: option.cacheTtl,
1139
+ force: option.force === true || option.cache === false,
1140
+ request: () =>
1141
+ this.$http({
1142
+ url: USER_PREFIX + "/common_attribute/listItems",
1143
+ method: `post`,
1144
+ data: {
1145
+ code: option.code,
1146
+ enabled: true,
1147
+ forCompany: true,
1148
+ ...option.data,
1149
+ },
1150
+ isLoading: isLoading,
1151
+ modalStrictly: true,
1152
+ }),
1153
+ }).then((res) => {
1154
+ if (res && res.type === "success") {
1155
+ option.success && option.success(toBaseDicts(res));
1156
+ }
1157
+ return res;
1158
+ });
1159
+ };
1160
+
1161
+ /**
1162
+ * 失效基础字典缓存。不传 code 则整体清空。
1163
+ * 字典维护页保存后要调它,否则改完最长要等一个 TTL 才生效。
1164
+ */
1165
+ Vue.prototype.$invalidateBaseDicts = function (code) {
1166
+ invalidateBaseDicts(code);
1167
+ };
1168
+
1169
+ imFun.Form.methods.$baseValidate = function (callback, opt) {
1170
+ let that = this;
1171
+ that.validate((valid, obj, c, d) => {
1172
+ if (!valid && (!opt || opt.errorTip !== false)) {
1173
+ this.$message({
1174
+ message: this.$t2("必填项不能为空", "system.message.required"),
1175
+ type: "error",
1176
+ duration: 2000,
1177
+ });
1178
+ }
1179
+ scrollToFirstError(that);
1180
+ callback(valid, obj);
1181
+ });
1182
+ };
1183
+
1184
+ function scrollToFirstError(formTarget) {
1185
+ // 获取第一个验证失败的字段
1186
+ // let formTarget = this.$refs['renderForm'];
1187
+ const firstErrorField = Object.keys(formTarget.fields).find((key) => {
1188
+ return formTarget.fields[key].validateState === "error";
1189
+ });
1190
+
1191
+ if (firstErrorField) {
1192
+ const field = formTarget.fields[firstErrorField];
1193
+
1194
+ let dom = field.$el;
1195
+ if (dom) {
1196
+ // 滚动到该字段位置
1197
+ dom.scrollIntoView({
1198
+ behavior: "smooth",
1199
+ block: "center",
1200
+ });
1201
+
1202
+ // 添加高亮效果
1203
+ dom.classList.add("highlight");
1204
+
1205
+ // 3秒后移除高亮效果
1206
+ setTimeout(() => {
1207
+ dom.classList.remove("highlight");
1208
+ }, 3000);
1209
+ }
1210
+ }
1211
+ }
1212
+
1213
+ Vue.prototype.$getBillInfo = async function (option) {
1214
+ let defaultOption = {
1215
+ url: null,
1216
+ method: `post`,
1217
+ data: {},
1218
+ isLoading: true,
1219
+ modalStrictly: true,
1220
+ success: null,
1221
+ };
1222
+ let opt = Object.assign({}, defaultOption, option);
1223
+ delete opt.wfConfig;
1224
+ return this.$http({
1225
+ ...opt,
1226
+ success: (res, response) => {
1227
+ option.success && option.success(res, response);
1228
+ },
1229
+ });
1230
+ };
1231
+
1232
+ Vue.prototype.$downloadByFileWhole = function (fileWhole, fileName) {
1233
+ let that = this;
1234
+ if (!fileWhole) {
1235
+ this.$baseAlert("凭证信息不存在");
1236
+ return;
1237
+ }
1238
+ let getDownloadDomian = function (callback) {
1239
+ that.$http({
1240
+ method: "post",
1241
+ url: USER_PREFIX + "/common/fileDownloadUrl",
1242
+ data: {},
1243
+ isLoading: true,
1244
+ success: (res) => {
1245
+ callback(res.objx);
1246
+ },
1247
+ });
1248
+ };
1249
+ getDownloadDomian((domain) => {
1250
+ if (fileName) {
1251
+ fileWhole.fileName = fileName;
1252
+ }
1253
+ that.$http({
1254
+ method: "post",
1255
+ url: domain + "/docfile/download",
1256
+ data: fileWhole,
1257
+ isLoading: true,
1258
+ success: (res) => {
1259
+ // window.open(res.objx.url);
1260
+ let url = res.objx.url;
1261
+ openInNewTab(url);
1262
+ },
1263
+ });
1264
+ });
1265
+ };
1266
+
1267
+ let isDef = function (value) {
1268
+ return value !== undefined && value !== null;
1269
+ };
1270
+
1271
+ Vue.prototype.$t2 = function (defaultValue, path, values) {
1272
+ let that = window.$vueRoot;
1273
+ if (!that.hasOwnProperty("_i18n")) {
1274
+ return defaultValue;
1275
+ }
1276
+ const i18n = that.$i18n;
1277
+ path = path || defaultValue;
1278
+ return i18n.te(path) ? i18n.t(path, values) : defaultValue;
1279
+ };
1280
+
1281
+ Vue.prototype.$t1 = function (path, values) {
1282
+ let that = window.$vueRoot;
1283
+ if (!that.hasOwnProperty("_i18n")) {
1284
+ return path;
1285
+ }
1286
+ let lang = that.$i18n.locale;
1287
+ const i18n = that.$i18n;
1288
+ if (lang === "zh") {
1289
+ let val = i18n._t(path, lang, { zh: { [path]: path } }, null, values);
1290
+ return val;
1291
+ } else {
1292
+ if (!i18n.te(path)) {
1293
+ return i18n._t(path, lang, { zh: { [path]: path } }, null, values);
1294
+ } else {
1295
+ return (
1296
+ i18n.t(path, values) ||
1297
+ i18n._t(path, lang, { zh: { [path]: path } }, null, values)
1298
+ );
1299
+ }
1300
+ }
1301
+ };
1302
+
1303
+ Vue.prototype.$i18nVal = function (zhValue, enValue) {
1304
+ let that = window.$vueRoot;
1305
+ if (!that.hasOwnProperty("_i18n")) {
1306
+ return zhValue;
1307
+ }
1308
+ let $i18n = that.$i18n;
1309
+ let value = zhValue;
1310
+ if ($i18n.locale === "zh") {
1311
+ value = zhValue;
1312
+ } else if ($i18n.locale === "en") {
1313
+ value = enValue;
1314
+ }
1315
+ return value;
1316
+ };
1317
+
1318
+ Vue.prototype.$utcToLocal = function (utcTime) {
1319
+ if (!utcTime) return utcTime;
1320
+ let offsetHours = this.$store.getters.utcTransformOffset; // 时区偏移量,单位:小时
1321
+ if (!offsetHours || offsetHours === 0) return utcTime;
1322
+ let localTime = moment(utcTime).add(offsetHours, "hours");
1323
+ return localTime.format("YYYY-MM-DD HH:mm:ss");
1324
+ };
1325
+
1326
+ Vue.prototype.$window = window;
1327
+ };
1328
+
1329
+ window && Object.assign(window, imFun.prefixConfig);
1330
+ if (typeof window !== "undefined" && window.Vue) {
1331
+ install(window.Vue);
1332
+ }
1333
+
1334
+ export default install;