sohelp-eleplus 1.1.13

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 (191) hide show
  1. package/README.md +7 -0
  2. package/cache/DictCache.js +58 -0
  3. package/cache/ModuleCache.js +352 -0
  4. package/components.js +45 -0
  5. package/core-export.js +4 -0
  6. package/http/CrudHttp.js +115 -0
  7. package/http/DictHttp.js +12 -0
  8. package/http/ModuleHttp.js +68 -0
  9. package/http/SohelpHttp.js +125 -0
  10. package/index.js +6 -0
  11. package/installer.js +8 -0
  12. package/lang/en_US.js +4 -0
  13. package/lang/zh_CN.js +4 -0
  14. package/lang/zh_TW.js +4 -0
  15. package/package.json +9 -0
  16. package/sohelp-ace-editor/index.vue +198 -0
  17. package/sohelp-application-select/index.vue +15 -0
  18. package/sohelp-autocode/index.vue +53 -0
  19. package/sohelp-calendar-view/index.vue +11 -0
  20. package/sohelp-card-view/index.vue +11 -0
  21. package/sohelp-condition/index.vue +210 -0
  22. package/sohelp-cry-input/index.vue +64 -0
  23. package/sohelp-date/index.vue +27 -0
  24. package/sohelp-datetime/index.vue +44 -0
  25. package/sohelp-datetime-picker/index.vue +86 -0
  26. package/sohelp-datetime-range/index.vue +59 -0
  27. package/sohelp-dict/index.vue +207 -0
  28. package/sohelp-dict/props.js +68 -0
  29. package/sohelp-drawer/index.vue +31 -0
  30. package/sohelp-drop-card/index.vue +94 -0
  31. package/sohelp-drop-card/props.js +68 -0
  32. package/sohelp-dyn-select/index.vue +99 -0
  33. package/sohelp-dyn-select/props.js +67 -0
  34. package/sohelp-dyn-tree/index.vue +82 -0
  35. package/sohelp-dyn-tree-select/index.vue +114 -0
  36. package/sohelp-entity-form/index.vue +524 -0
  37. package/sohelp-entity-grid/index.vue +30 -0
  38. package/sohelp-file-upload/index.vue +218 -0
  39. package/sohelp-filter-scheme/components/condition.vue +102 -0
  40. package/sohelp-filter-scheme/components/filter.vue +45 -0
  41. package/sohelp-filter-scheme/components/keywords.vue +15 -0
  42. package/sohelp-filter-scheme/components/scheme.vue +49 -0
  43. package/sohelp-filter-scheme/index.vue +113 -0
  44. package/sohelp-grid/SohelpGridConfig.js~ +408 -0
  45. package/sohelp-grid/components/filter-condition-item.vue +298 -0
  46. package/sohelp-grid/index.vue +1886 -0
  47. package/sohelp-grid/js/ConditionType.js +101 -0
  48. package/sohelp-grid/js/DefaultGridOptions.js +141 -0
  49. package/sohelp-grid/js/DefaultProps.js +27 -0
  50. package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
  51. package/sohelp-grid/js/SohelpGridConfig.js +101 -0
  52. package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
  53. package/sohelp-grid-select/index.vue +245 -0
  54. package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
  55. package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
  56. package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
  57. package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
  58. package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
  59. package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
  60. package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
  61. package/sohelp-grid-view/filter/config/index.vue +206 -0
  62. package/sohelp-grid-view/filter/filter-form.vue +427 -0
  63. package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
  64. package/sohelp-grid-view/filter/index.vue +160 -0
  65. package/sohelp-grid-view/index.vue +379 -0
  66. package/sohelp-grid-view-select/index.vue +141 -0
  67. package/sohelp-group-view/index.vue +11 -0
  68. package/sohelp-icon-select/index.vue +96 -0
  69. package/sohelp-icon-select/vxeui-icon.js +90 -0
  70. package/sohelp-image-upload/index.vue +286 -0
  71. package/sohelp-input/index.vue +39 -0
  72. package/sohelp-modal/index.vue +49 -0
  73. package/sohelp-module/index.vue +54 -0
  74. package/sohelp-module/useModalManager.js +89 -0
  75. package/sohelp-module/useSohelpModule.js +66 -0
  76. package/sohelp-number-input/index.vue +32 -0
  77. package/sohelp-number-range/index.vue +135 -0
  78. package/sohelp-org-select/index.vue +30 -0
  79. package/sohelp-org-tree/index.vue +18 -0
  80. package/sohelp-org-tree-select/index.vue +93 -0
  81. package/sohelp-org-user-tree/index.vue +26 -0
  82. package/sohelp-org-user-tree-select/index.vue +11 -0
  83. package/sohelp-pagination/index.vue +11 -0
  84. package/sohelp-power/index.vue +105 -0
  85. package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
  86. package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
  87. package/sohelp-pro-form/index.vue +257 -0
  88. package/sohelp-pro-form/util.js +140 -0
  89. package/sohelp-pro-layout/index.vue +11 -0
  90. package/sohelp-pro-table/index.vue +14 -0
  91. package/sohelp-process/index.vue +216 -0
  92. package/sohelp-rate/index.vue +56 -0
  93. package/sohelp-rate/props.js +71 -0
  94. package/sohelp-relation/index.vue +11 -0
  95. package/sohelp-rich-text/index.vue +242 -0
  96. package/sohelp-rich-text/util.js +231 -0
  97. package/sohelp-richtext/index.vue +10 -0
  98. package/sohelp-role-select/index.vue +33 -0
  99. package/sohelp-search/components/search-config.vue +0 -0
  100. package/sohelp-search/index.vue +49 -0
  101. package/sohelp-search-pro-form/index.vue +11 -0
  102. package/sohelp-select/index.vue +120 -0
  103. package/sohelp-split-panel/index.vue +15 -0
  104. package/sohelp-switch/index.vue +56 -0
  105. package/sohelp-table/index.vue +151 -0
  106. package/sohelp-tenant-select/index.vue +128 -0
  107. package/sohelp-text/index.vue +14 -0
  108. package/sohelp-textarea-input/index.vue +36 -0
  109. package/sohelp-time/index.vue +10 -0
  110. package/sohelp-tree/index.vue +37 -0
  111. package/sohelp-tree-select/index.vue +18 -0
  112. package/sohelp-user-select/index.vue +44 -0
  113. package/sohelp-user-select/index.vue~ +53 -0
  114. package/sohelp-user-select/props.js +71 -0
  115. package/sohelp-user-tag/index.vue +12 -0
  116. package/sohelp-user-tree/index.vue +11 -0
  117. package/sohelp-vform-drawer/index.vue +40 -0
  118. package/sohelp-vform-eleplus/favicon.ico +0 -0
  119. package/sohelp-vform-eleplus/index.vue +297 -0
  120. package/sohelp-vform-eleplus/preview.html +91 -0
  121. package/sohelp-vform-eleplus/render.es.js +72433 -0
  122. package/sohelp-vform-eleplus/render.style.css +16 -0
  123. package/sohelp-vform-eleplus/render.umd.js +57 -0
  124. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
  125. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
  126. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
  127. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
  128. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
  129. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
  130. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
  131. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
  132. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
  133. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
  134. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
  135. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
  136. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
  137. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
  138. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
  139. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
  140. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  141. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
  142. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
  143. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
  144. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
  145. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
  146. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
  147. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
  148. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
  149. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
  150. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
  151. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
  152. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
  153. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  154. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
  155. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
  156. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
  157. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
  158. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
  160. package/sohelp-vform-modal/index.vue +41 -0
  161. package/sohelp-vform-select/index.vue +11 -0
  162. package/sohelp-vform-vant/favicon.ico +0 -0
  163. package/sohelp-vform-vant/render.es.js +14608 -0
  164. package/sohelp-vform-vant/render.style.css +1 -0
  165. package/sohelp-vform-vant/render.umd.js +22 -0
  166. package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
  167. package/sohelp-vxe-grid/DefaultProps.js +37 -0
  168. package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
  169. package/sohelp-vxe-grid/index.vue +518 -0
  170. package/sohelp-vxe-grid-select/index.vue +148 -0
  171. package/sohelp-vxe-table/index.vue +184 -0
  172. package/sohelp-workflow/index.vue +495 -0
  173. package/sohelp-workflow/nodeWrap.vue +53 -0
  174. package/sohelp-workflow/nodes/addNode.vue +27 -0
  175. package/sohelp-workflow/nodes/approver.vue +125 -0
  176. package/sohelp-workflow/nodes/branch.vue +434 -0
  177. package/sohelp-workflow/nodes/promoter.vue +80 -0
  178. package/sohelp-workflow/nodes/send.vue +95 -0
  179. package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
  180. package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
  181. package/sohelp-workflow-drawer/components/form.vue +79 -0
  182. package/sohelp-workflow-drawer/components/table.vue +153 -0
  183. package/sohelp-workflow-drawer/components/timeline.vue +189 -0
  184. package/sohelp-workflow-drawer/components/workflow.vue +68 -0
  185. package/sohelp-workflow-drawer/index.vue +311 -0
  186. package/sohelp-workflow-drawer/js/index.js +119 -0
  187. package/style/index.scss +0 -0
  188. package/utils/ProFormConvertUtil.js +76 -0
  189. package/utils/core.js +310 -0
  190. package/utils/use-form-data.js +48 -0
  191. package/utils/use-mobile.js +43 -0
@@ -0,0 +1,90 @@
1
+ export const VxeIcon = {
2
+ 'vxe-icon-arrow-down': 'vxe-icon-arrow-down',
3
+ 'vxe-icon-spinner': 'vxe-icon-spinner',
4
+ 'vxe-icon-spinner roll': 'vxe-icon-spinner roll',
5
+ 'vxe-icon-question-circle-fill': 'vxe-icon-question-circle-fill',
6
+ 'vxe-icon-arrow-down rotate180': 'vxe-icon-arrow-down rotate180',
7
+ 'vxe-icon-caret-down rotate180': 'vxe-icon-caret-down rotate180',
8
+ 'vxe-icon-caret-down': 'vxe-icon-caret-down',
9
+ 'vxe-icon-add': 'vxe-icon-add',
10
+ 'vxe-icon-home-page': 'vxe-icon-home-page',
11
+ 'vxe-icon-end-page': 'vxe-icon-end-page',
12
+ 'vxe-icon-arrow-double-left': 'vxe-icon-arrow-double-left',
13
+ 'vxe-icon-arrow-double-right': 'vxe-icon-arrow-double-right',
14
+ 'vxe-icon-arrow-left': 'vxe-icon-arrow-left',
15
+ 'vxe-icon-arrow-right': 'vxe-icon-arrow-right',
16
+ 'vxe-icon-ellipsis-h': 'vxe-icon-ellipsis-h',
17
+ 'vxe-icon-radio-checked-fill': 'vxe-icon-radio-checked-fill',
18
+ 'vxe-icon-radio-unchecked': 'vxe-icon-radio-unchecked',
19
+ 'vxe-icon-checkbox-indeterminate-fill': 'vxe-icon-checkbox-indeterminate-fill',
20
+ 'vxe-icon-checkbox-checked-fill': 'vxe-icon-checkbox-checked-fill',
21
+ 'vxe-icon-checkbox-unchecked': 'vxe-icon-checkbox-unchecked',
22
+ 'vxe-icon-error-circle-fill': 'vxe-icon-error-circle-fill',
23
+ 'vxe-icon-search': 'vxe-icon-search',
24
+ 'vxe-icon-caret-up': 'vxe-icon-caret-up',
25
+ 'vxe-icon-minus': 'vxe-icon-minus',
26
+ 'vxe-icon-calendar': 'vxe-icon-calendar',
27
+ 'vxe-icon-eye-fill-close': 'vxe-icon-eye-fill-close',
28
+ 'vxe-icon-eye-fill': 'vxe-icon-eye-fill',
29
+ 'vxe-icon-recover': 'vxe-icon-recover',
30
+ 'vxe-icon-square': 'vxe-icon-square',
31
+ 'vxe-icon-maximize': 'vxe-icon-maximize',
32
+ 'vxe-icon-close': 'vxe-icon-close',
33
+ 'vxe-icon-info-circle-fill': 'vxe-icon-info-circle-fill',
34
+ 'vxe-icon-success-circle-fill': 'vxe-icon-success-circle-fill',
35
+ 'vxe-icon-warning-circle-fill': 'vxe-icon-warning-circle-fill',
36
+ 'vxe-icon-arrow-up rotate180': 'vxe-icon-arrow-up rotate180',
37
+ 'vxe-icon-arrow-up': 'vxe-icon-arrow-up',
38
+ 'vxe-icon-layout': 'vxe-icon-layout',
39
+ 'vxe-icon-pc': 'vxe-icon-pc',
40
+ 'vxe-icon-mobile': 'vxe-icon-mobile',
41
+ 'vxe-icon-edit': 'vxe-icon-edit',
42
+ 'vxe-icon-square-plus-fill': 'vxe-icon-square-plus-fill',
43
+ 'vxe-icon-copy': 'vxe-icon-copy',
44
+ 'vxe-icon-delete': 'vxe-icon-delete',
45
+ 'vxe-icon-swap': 'vxe-icon-swap',
46
+ 'vxe-icon-square-plus': 'vxe-icon-square-plus',
47
+ 'vxe-icon-square-minus': 'vxe-icon-square-minus',
48
+ 'vxe-icon-custom-column': 'vxe-icon-custom-column',
49
+ 'vxe-icon-menu': 'vxe-icon-menu',
50
+ 'vxe-icon-upload': 'vxe-icon-upload',
51
+ 'vxe-icon-download': 'vxe-icon-download',
52
+ 'vxe-icon-file': 'vxe-icon-file',
53
+ 'vxe-icon-file-excel': 'vxe-icon-file-excel',
54
+ 'vxe-icon-file-pdf': 'vxe-icon-file-pdf',
55
+ 'vxe-icon-file-image': 'vxe-icon-file-image',
56
+ 'vxe-icon-file-markdown': 'vxe-icon-file-markdown',
57
+ 'vxe-icon-file-ppt': 'vxe-icon-file-ppt',
58
+ 'vxe-icon-file-word': 'vxe-icon-file-word',
59
+ 'vxe-icon-file-zip': 'vxe-icon-file-zip',
60
+ 'vxe-icon-file-txt': 'vxe-icon-file-txt',
61
+ 'vxe-icon-pct-full': 'vxe-icon-pct-full',
62
+ 'vxe-icon-pct-1-1': 'vxe-icon-pct-1-1',
63
+ 'vxe-icon-search-zoom-out': 'vxe-icon-search-zoom-out',
64
+ 'vxe-icon-search-zoom-in': 'vxe-icon-search-zoom-in',
65
+ 'vxe-icon-rotate-left': 'vxe-icon-rotate-left',
66
+ 'vxe-icon-rotate-right': 'vxe-icon-rotate-right',
67
+ 'vxe-icon-print': 'vxe-icon-print',
68
+ 'vxe-icon-caret-right rotate90': 'vxe-icon-caret-right rotate90',
69
+ 'vxe-icon-caret-right': 'vxe-icon-caret-right',
70
+ 'vxe-icon-refresh': 'vxe-icon-refresh',
71
+ 'vxe-icon-refresh roll': 'vxe-icon-refresh roll',
72
+ 'vxe-icon-arrow-right rotate90': 'vxe-icon-arrow-right rotate90',
73
+ 'vxe-icon-empty': 'vxe-icon-empty',
74
+ 'vxe-icon-star-fill': 'vxe-icon-star-fill',
75
+ 'vxe-icon-star': 'vxe-icon-star',
76
+ 'vxe-icon-dropper': 'vxe-icon-dropper',
77
+ 'vxe-icon-funnel': 'vxe-icon-funnel',
78
+ 'vxe-icon-drag-handle': 'vxe-icon-drag-handle',
79
+ 'vxe-icon-sort': 'vxe-icon-sort',
80
+ 'vxe-icon-add-sub': 'vxe-icon-add-sub',
81
+ 'vxe-icon-no-drop': 'vxe-icon-no-drop',
82
+ 'vxe-icon-repeat': 'vxe-icon-repeat',
83
+ 'vxe-icon-repeat roll': 'vxe-icon-repeat roll',
84
+ 'vxe-icon-fullscreen': 'vxe-icon-fullscreen',
85
+ 'vxe-icon-minimize': 'vxe-icon-minimize',
86
+ 'vxe-icon-fixed-left': 'vxe-icon-fixed-left',
87
+ 'vxe-icon-fixed-left-fill': 'vxe-icon-fixed-left-fill',
88
+ 'vxe-icon-fixed-right': 'vxe-icon-fixed-right',
89
+ 'vxe-icon-fixed-right-fill': 'vxe-icon-fixed-right-fill'
90
+ };
@@ -0,0 +1,286 @@
1
+ <template>
2
+ <div class="sohelp-image-upload">
3
+ <vxe-upload
4
+ ref="vxeUploadRef"
5
+ v-model="fileList"
6
+ :upload-method="uploadMethod"
7
+ :before-remove-method="beforeRemoveMethod"
8
+ :before-download-method="beforeDownloadMethod"
9
+ :autoHiddenButton="!multiple"
10
+ show-download-button
11
+ mode="image"
12
+ :urlMode="true"
13
+ :showProgress="true"
14
+ :showButtonText="false"
15
+ :pasteToUpload="true"
16
+ :multiple="multiple"
17
+ :singleMode="!multiple"
18
+ :readonly="readonly"
19
+ :imageConfig="imageConfig"
20
+ :limitCount="limitCount"
21
+ :limitSize="limitSize"
22
+ :imageTypes="imageTypes"
23
+ :progressText="'{percent}%'"
24
+ :moreConfig="moreConfig"
25
+ ></vxe-upload>
26
+ </div>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { ref, watch } from 'vue';
31
+ import { ElMessage, ElMessageBox } from 'element-plus';
32
+ import { SohelpHttp } from '../core-export';
33
+ import { VxeUI } from 'vxe-pc-ui';
34
+
35
+ const modelValue = defineModel('modelValue');
36
+ /**
37
+ * 支持本地数据
38
+ * @type {ModelRef<Object | any[] | undefined, string>}
39
+ */
40
+ const data = defineModel('data', { type: [Object, Array], default: () => [] });
41
+
42
+ const imagePath = `${SohelpHttp.getBaseUrl()}/engine/web/file/image?id=`;
43
+ const props = defineProps({
44
+ /**
45
+ * 是否只读
46
+ */
47
+ readonly: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ /**
52
+ * 支持异步数据源
53
+ */
54
+ datasource: {
55
+ type: Function,
56
+ default: () => {}
57
+ },
58
+ /**
59
+ * 支持多个图片上传,默认单个图片
60
+ */
61
+ multiple: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ /**
66
+ * 单次上传9个图片
67
+ */
68
+ limitCount: {
69
+ type: Number,
70
+ default: 9
71
+ },
72
+ /**
73
+ * 每张图片不超过10M
74
+ */
75
+ limitSize: {
76
+ type: Number,
77
+ default: 10 //10Mb
78
+ },
79
+ /**
80
+ * 支持上传图片的类型
81
+ */
82
+ imageTypes: {
83
+ type: Object,
84
+ default: () => {
85
+ return ['jpg', 'jpeg', 'png', 'webp', 'bmp', 'gif'];
86
+ }
87
+ },
88
+ /**
89
+ * 图片参数配置
90
+ */
91
+ imageConfig: {
92
+ type: Object,
93
+ default: () => {
94
+ return {
95
+ width: 30,
96
+ height: 26
97
+ };
98
+ }
99
+ },
100
+ moreConfig: {
101
+ type: Object,
102
+ default: () => {
103
+ return {
104
+ maxCount: 1,
105
+ layout: 'horizontal'
106
+ };
107
+ }
108
+ }
109
+ });
110
+
111
+ const emit = defineEmits(['update:modelValue', 'update:data']);
112
+
113
+ const vxeUploadRef = ref(null);
114
+ const fileList = ref([]);
115
+ const originList = ref([]);
116
+
117
+ /**
118
+ * 下载
119
+ * @param param0
120
+ */
121
+ const beforeDownloadMethod = async ({ option }) => {
122
+ try {
123
+ const blob = await fetch(option.url).then((response) => response.blob());
124
+ await VxeUI.saveFile({
125
+ filename: option.name,
126
+ content: blob
127
+ });
128
+ VxeUI.modal.message({
129
+ content: '下载成功',
130
+ status: 'success'
131
+ });
132
+ } catch (e) {
133
+ VxeUI.modal.message({
134
+ content: '下载失败',
135
+ status: 'error'
136
+ });
137
+ }
138
+ return false;
139
+ };
140
+
141
+ /**
142
+ *
143
+ * @param param0 删除
144
+ */
145
+ const beforeRemoveMethod = async ({ option }) => {
146
+ try {
147
+ if (!option || !option.url || typeof option.url !== 'string') {
148
+ return false;
149
+ }
150
+
151
+ await ElMessageBox.confirm('确定要删除图片吗?', '系统提示', {
152
+ type: 'warning',
153
+ draggable: false
154
+ });
155
+
156
+ const urlObj = new URL(option.url);
157
+ const id = urlObj.searchParams.get('id');
158
+
159
+ if (!id) {
160
+ return false;
161
+ }
162
+
163
+ const res = await SohelpHttp.post('/engine/web/file/delete', { id: id });
164
+
165
+ if (res.meta.success) {
166
+ ElMessage.success(res.meta.message);
167
+ originList.value = originList.value.filter((item) => item.id !== id);
168
+ modelValue.value = '';
169
+ return true;
170
+ } else {
171
+ ElMessage.error(res.meta.message);
172
+ return false;
173
+ }
174
+ } catch (e) {
175
+ return false;
176
+ }
177
+ };
178
+
179
+ /**
180
+ * 上传
181
+ */
182
+ const uploadMethod = async ({ file }) => {
183
+ const formData = new FormData();
184
+ formData.append('files', file);
185
+
186
+ const res = await SohelpHttp.post('/engine/web/file/upload', formData);
187
+ if (res.meta.success && res.data.length > 0) {
188
+ originList.value.push({
189
+ name: file.name,
190
+ id: res.data[0]
191
+ });
192
+
193
+ modelValue.value = res.data[0];
194
+
195
+ return {
196
+ url: imagePath + res.data[0],
197
+ name: file.name
198
+ };
199
+ } else {
200
+ ElMessage.error(res.meta.message);
201
+ }
202
+ };
203
+
204
+ watch(
205
+ () => modelValue.value,
206
+ (val) => {
207
+ if (val && val !== '0' && val !== 0) {
208
+ const arr = Array.isArray(val) ? val : [val];
209
+ const v = Array.isArray(data.value) ? data.value : [data.value];
210
+ originList.value = arr.map((item) => {
211
+ const filename = v?.find((row) => row?.id === item)?.filename || '';
212
+ return {
213
+ id: item,
214
+ name: filename,
215
+ url: imagePath + item
216
+ };
217
+ });
218
+ fileList.value = originList.value;
219
+ }
220
+ },
221
+ {
222
+ immediate: true
223
+ }
224
+ );
225
+ </script>
226
+
227
+ <script>
228
+ export default {
229
+ name: 'SohelpImageUpload'
230
+ };
231
+ </script>
232
+ <style scoped lang="scss">
233
+ .sohelp-image-upload {
234
+ display: flex;
235
+ flex-wrap: nowrap;
236
+ flex-direction: column;
237
+ height: 100%;
238
+ box-sizing: border-box;
239
+
240
+ :deep(.vxe-upload) {
241
+ height: 100%;
242
+
243
+ .vxe-upload--image-wrapper {
244
+ height: 100%;
245
+ }
246
+
247
+ .vxe-upload--image-list {
248
+ height: 100%;
249
+ display: flex;
250
+ gap: 5px;
251
+
252
+ .vxe-upload--image-over-more {
253
+ padding: 0;
254
+ }
255
+
256
+ .vxe-upload--image-action {
257
+ padding: 0;
258
+ }
259
+
260
+ .vxe-upload--image-item {
261
+ padding: 0;
262
+ display: flex;
263
+
264
+ .vxe-upload--image-item-box {
265
+ img {
266
+ min-width: 100%;
267
+ min-height: 100%;
268
+ }
269
+ }
270
+
271
+ .vxe-upload--image-item-btn-wrapper {
272
+ width: 12px;
273
+ height: 12px;
274
+ overflow: hidden;
275
+ top: -3px;
276
+ }
277
+
278
+ .vxe-upload--image-item-remove-btn {
279
+ width: 12px;
280
+ height: 12px;
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ </style>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <el-input
3
+ v-bind="$attrs"
4
+ v-model="modelValue"
5
+ clearable
6
+ ref="inputRef"
7
+ :disabled="$attrs?.disabled || $attrs?.readonly"
8
+ >
9
+ <template v-for="(_, slot) in $slots" #[slot]="slotProps">
10
+ <slot :name="slot" v-bind="slotProps" />
11
+ </template>
12
+ </el-input>
13
+ </template>
14
+ <script setup>
15
+ import { nextTick, onMounted, ref } from 'vue';
16
+
17
+ const emit = defineEmits(['update:modelValue']);
18
+ const modelValue = defineModel('modelValue');
19
+ const props = defineProps({
20
+ autoFocus: {
21
+ type: Boolean,
22
+ default: false
23
+ }
24
+ });
25
+
26
+ const inputRef = ref(null);
27
+ onMounted(() => {
28
+ nextTick(() => {
29
+ if (props.autoFocus) {
30
+ inputRef.value.focus();
31
+ }
32
+ });
33
+ });
34
+ </script>
35
+ <script>
36
+ export default {
37
+ name: 'SohelpInput'
38
+ };
39
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <ele-modal v-bind="$attrs" v-model="modelValue">
3
+ <div class="modal__container">
4
+ <!-- 主内容插槽 -->
5
+ <slot>
6
+ <template v-for="(slotProps, slotName) in $scopedSlots" :key="slotName">
7
+ <slot :name="slotName" v-bind="slotProps" />
8
+ </template>
9
+ </slot>
10
+ <!-- 底部插槽 -->
11
+ <div class="modal__footer" v-if="showFooter">
12
+ <slot name="footer">
13
+ <el-button type="primary" @click="confirm">确认</el-button>
14
+ <el-button @click="cancel">关闭</el-button>
15
+ </slot>
16
+ </div>
17
+ </div>
18
+ </ele-modal>
19
+ </template>
20
+ <script setup>
21
+
22
+ const modelValue = defineModel("modelValue", { type: Boolean, default: false });
23
+ const emit = defineEmits("confirm","cancel");
24
+ const props = defineProps({
25
+ showFooter: {
26
+ type: Boolean,
27
+ default: true
28
+ }
29
+ });
30
+
31
+ const confirm = ()=>{
32
+ emit("confirm");
33
+ }
34
+ const cancel = ()=>{
35
+ modelValue.value = false;
36
+ emit("cancel");
37
+ }
38
+ </script>
39
+ <style scoped>
40
+ /* 可选:添加样式 */
41
+ .modal__container {
42
+ /* 样式定义 */
43
+ height: 100%;
44
+ }
45
+
46
+ .modal__footer {
47
+ /* 样式定义 */
48
+ }
49
+ </style>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <!-- 动态渲染多个el-modal -->
3
+ <sohelp-modal
4
+ maxable
5
+ multiple
6
+ resizable
7
+ v-for="[id, modal] in modals"
8
+ :key="id"
9
+ v-model="modal.visible"
10
+ v-bind="modal"
11
+ @close="closeModal(id)"
12
+ :bodyStyle="{ padding: 0, height: '100%', minHeight: '60vh', }"
13
+ :showFooter="false"
14
+ class="module-modal"
15
+ >
16
+ <sohelp-vform :refid="id" v-model="modal.params" v-model:data="modal.params" ref="vformRefs" moduleType="modal"></sohelp-vform>
17
+ </sohelp-modal>
18
+
19
+ <!-- 动态渲染多个el-drawer -->
20
+ <sohelp-drawer
21
+ v-for="[id, drawer] in drawers"
22
+ :key="id"
23
+ v-model="drawer.visible"
24
+ v-bind="drawer"
25
+ @close="closeDrawer(id)"
26
+ :bodyStyle="{ padding: 0, height: '100%', overflow: 'auto'}"
27
+ >
28
+ <sohelp-vform :refid="id" v-model="drawer.params.modelValue" v-model:data="drawer.params.data" moduleType="drawer"></sohelp-vform>
29
+ </sohelp-drawer>
30
+ </template>
31
+ <script>
32
+ export default {
33
+ name: 'SohelpModule'
34
+ };
35
+ </script>
36
+ <script setup>
37
+ import SohelpModal from '../sohelp-modal/index.vue';
38
+ import SohelpDrawer from '../sohelp-drawer/index.vue';
39
+ import SohelpVform from '../sohelp-vform-eleplus/index.vue';
40
+ import useModalManager from './useModalManager';
41
+ import { ref } from 'vue';
42
+
43
+ const { modals, drawers, openModal, closeModal, openDrawer, closeDrawer } = useModalManager();
44
+ const vformRefs = ref(null);
45
+
46
+ defineExpose({
47
+ openModal,
48
+ closeModal,
49
+ openDrawer,
50
+ closeDrawer
51
+ });
52
+ </script>
53
+
54
+ <style lang="scss" scoped></style>
@@ -0,0 +1,89 @@
1
+ import { ref } from 'vue'
2
+
3
+ export default function useModalManager() {
4
+ // 存储所有模态框实例
5
+ const modals = ref(new Map())
6
+ // 存储所有抽屉实例
7
+ const drawers = ref(new Map())
8
+
9
+ /**
10
+ * 打开模态框
11
+ * @param refid 模块地址
12
+ * @param params 数据对象
13
+ * @param props 属性
14
+ */
15
+ const openModal = (refid,params={}, props = {}) => {
16
+ modals.value.set(refid, {
17
+ visible: true,
18
+ ...props,
19
+ params:{...params}
20
+ })
21
+ }
22
+
23
+ /**
24
+ * 关闭对话框
25
+ * @param refid 模块地址
26
+ */
27
+ const closeModal = (refid) => {
28
+ if (modals.value.has(refid)) {
29
+ modals.value.set(refid, {
30
+ ...modals.value.get(refid),
31
+ visible: false
32
+ })
33
+ }
34
+ }
35
+
36
+ /**
37
+ * 打开抽屉
38
+ * @param refid 模块地址
39
+ * @param params 数据对象
40
+ * @param props 属性
41
+ */
42
+ const openDrawer = (refid, params={},props = {}) => {
43
+ drawers.value.set(refid, {
44
+ visible: true,
45
+ ...props,
46
+ params:{...params}
47
+ })
48
+ }
49
+
50
+ /**
51
+ * 关闭抽屉
52
+ * @param refid 模块地址
53
+ */
54
+ const closeDrawer = (refid) => {
55
+ if (drawers.value.has(refid)) {
56
+ drawers.value.set(refid, {
57
+ ...drawers.value.get(refid),
58
+ visible: false
59
+ })
60
+ }
61
+ }
62
+
63
+ /**
64
+ * 获取模态框状态
65
+ * @param refid 模块地址
66
+ */
67
+ const getModalState = (refid) => {
68
+ return modals.value.get(refid) || { visible: false }
69
+ }
70
+
71
+ /**
72
+ * 获取抽屉状态
73
+ * @param refid 模块地址
74
+ */
75
+ const getDrawerState = (refid) => {
76
+ return drawers.value.get(refid) || { visible: false }
77
+ }
78
+
79
+ return {
80
+ modals,
81
+ drawers,
82
+ openModal,
83
+ closeModal,
84
+ openDrawer,
85
+ closeDrawer,
86
+ getModalState,
87
+ getDrawerState
88
+ }
89
+ }
@@ -0,0 +1,66 @@
1
+ import { useRouter } from "vue-router";
2
+ import { usePageTab } from "@/utils/use-page-tab";
3
+
4
+ function objectToUrlParams(obj) {
5
+ if (!obj) {
6
+ return '';
7
+ }
8
+ return "&"+Object.keys(obj)
9
+ .map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`)
10
+ .join('&');
11
+ }
12
+
13
+ export function useSohelpModule(sohelpModuleRef) {
14
+ const { push } = useRouter();
15
+ return {
16
+ /**
17
+ * 打开抽屉
18
+ * @param refid 模块地址
19
+ * @param params 参数
20
+ * @param props 属性
21
+ */
22
+ openDrawer: (refid,params={}, props={}) => {
23
+ sohelpModuleRef.value.openDrawer(refid,params,props);
24
+ },
25
+ /**
26
+ *打开对话框
27
+ * @param refid 模块地址
28
+ * @param params
29
+ * @param props
30
+ */
31
+ openModal: (refid, params= {},props={},callback) => {
32
+ sohelpModuleRef.value.openModal(refid, params,props,callback);
33
+ },
34
+ /**
35
+ * 关闭对话框
36
+ * @param refid 模块地址
37
+ */
38
+ closeModal: (refid) => {
39
+ sohelpModuleRef.value.closeModal(refid);
40
+ },
41
+ /**
42
+ * 关闭抽屉
43
+ * @param refid 模块地址
44
+ */
45
+ closeDrawer: (refid) => {
46
+ sohelpModuleRef.value.closeDrawer(refid);
47
+ },
48
+ /**
49
+ * 打开标签页
50
+ * @param refid 模块地址
51
+ * @param params 数据对象
52
+ */
53
+ openTab: (refid, params) => {
54
+ delete params.refid;
55
+ push(`/vform?refid=${refid}${objectToUrlParams(params)}`);
56
+ },
57
+ /**
58
+ * 关闭标签页
59
+ * @param refid 模块地址
60
+ */
61
+ closeTab: (refid) => {
62
+ const { finishPageTab, setPageTabTitle,addPageTab } = usePageTab();
63
+ finishPageTab();
64
+ }
65
+ };
66
+ }
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <el-input-number
3
+ v-bind="$attrs"
4
+ controls-position="right"
5
+ ref="inputRef"
6
+ :disabled="$attrs?.disabled || $attrs?.readonly"
7
+ ></el-input-number>
8
+ </template>
9
+ <script setup>
10
+ import { nextTick, onMounted, ref } from 'vue';
11
+
12
+ const props = defineProps({
13
+ autoFocus: {
14
+ type: Boolean,
15
+ default: false
16
+ }
17
+ });
18
+
19
+ const inputRef = ref(null);
20
+ onMounted(() => {
21
+ nextTick(() => {
22
+ if (props.autoFocus) {
23
+ inputRef.value.focus();
24
+ }
25
+ });
26
+ });
27
+ </script>
28
+ <script>
29
+ export default {
30
+ name: 'SohelpNumberInput'
31
+ };
32
+ </script>