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,257 @@
1
+ <!-- 高级表单 -->
2
+ <template>
3
+ <ElForm
4
+ ref="formRef"
5
+ :model="model"
6
+ :labelWidth="labelWidth"
7
+ :statusIcon="statusIcon"
8
+ :size="size"
9
+ :readonly="readonly"
10
+ :disabled="disabled || readonly"
11
+ @submit.prevent=""
12
+ >
13
+ <slot name="topExtra"></slot>
14
+ <template v-if="!grid">
15
+ <template v-for="item in items">
16
+ <ProFormItem
17
+ v-if="item.prop"
18
+ :key="item.key ?? item.prop"
19
+ :item="item"
20
+ :model="model"
21
+ :rules="rules"
22
+ :data="data[item.prop]"
23
+ :disabled="disabled"
24
+ :readonly="readonly"
25
+ :ref="(el) => setFormItemRef(el, item.prop)"
26
+ @updateValue="(value) => updateValue(item.prop, value)"
27
+ >
28
+ <template
29
+ v-for="name in Object.keys($slots).filter(
30
+ (k) => !['default', 'footer', 'topExtra', 'bottomExtra'].includes(k)
31
+ )"
32
+ #[name]="slotProps"
33
+ >
34
+ <slot :name="name" v-bind="slotProps || {}"></slot>
35
+ </template>
36
+ </ProFormItem>
37
+ </template>
38
+ <ProFormFooter
39
+ v-if="footer"
40
+ :footerProps="footerProps"
41
+ :footerSlots="footerSlots"
42
+ :submitText="submitText"
43
+ :resetText="resetText"
44
+ @submit="submit"
45
+ @reset="reset"
46
+ >
47
+ <template
48
+ v-for="name in Object.keys($slots).filter((k) => !['default', 'topExtra', 'bottomExtra'].includes(k))"
49
+ #[name]="slotProps"
50
+ >
51
+ <slot :name="name" v-bind="slotProps || {}"></slot>
52
+ </template>
53
+ </ProFormFooter>
54
+ </template>
55
+ <ElRow v-else v-bind="rowProps">
56
+ <template v-for="item in items">
57
+ <ElCol
58
+ v-if="item.prop"
59
+ :key="item.key ?? item.prop"
60
+ v-bind="{
61
+ ...(grid === true ? { span: 12 } : grid),
62
+ ...(item.colProps || {})
63
+ }"
64
+ >
65
+ <ProFormItem
66
+ :item="item"
67
+ :model="model"
68
+ :rules="rules"
69
+ :data="data[item.prop]"
70
+ :disabled="disabled"
71
+ :readonly="readonly"
72
+ :ref="(el) => setFormItemRef(el, item.prop)"
73
+ @updateValue="(value) => updateValue(item.prop, value)"
74
+ >
75
+ <template
76
+ v-for="name in Object.keys($slots).filter(
77
+ (k) => !['default', 'footer', 'topExtra', 'bottomExtra'].includes(k)
78
+ )"
79
+ #[name]="slotProps"
80
+ >
81
+ <slot :name="name" v-bind="slotProps || {}"></slot>
82
+ </template>
83
+ </ProFormItem>
84
+ </ElCol>
85
+ </template>
86
+ <ElCol v-if="footer" v-bind="footerColProps || {}">
87
+ <ProFormFooter
88
+ :footerProps="footerProps"
89
+ :footerSlots="footerSlots"
90
+ :submitText="submitText"
91
+ :resetText="resetText"
92
+ @submit="submit"
93
+ @reset="reset"
94
+ >
95
+ <template
96
+ v-for="name in Object.keys($slots).filter((k) => !['default', 'topExtra', 'bottomExtra'].includes(k))"
97
+ #[name]="slotProps"
98
+ >
99
+ <slot :name="name" v-bind="slotProps || {}"></slot>
100
+ </template>
101
+ </ProFormFooter>
102
+ </ElCol>
103
+ </ElRow>
104
+ <slot name="bottomExtra"></slot>
105
+ </ElForm>
106
+ </template>
107
+
108
+ <script setup>
109
+ import { ref } from 'vue';
110
+ import ProFormItem from './components/pro-form-item.vue';
111
+ import ProFormFooter from './components/pro-form-footer.vue';
112
+
113
+ const props = defineProps({
114
+ data: Object,
115
+ /** 表单数据 */
116
+ model: {
117
+ type: Object,
118
+ required: true
119
+ },
120
+ /** 验证规则 */
121
+ rules: Object,
122
+ /** 标签长度 */
123
+ labelWidth: {
124
+ type: [String, Number],
125
+ default: '80px'
126
+ },
127
+ /** 是否显示校验结果图标 */
128
+ statusIcon: Boolean,
129
+ /** 尺寸 */
130
+ size: String,
131
+ /** 是否禁用 */
132
+ disabled: Boolean,
133
+ /** 表单项 */
134
+ items: {
135
+ type: Array,
136
+ required: true
137
+ },
138
+ /** 是否栅格布局 */
139
+ grid: [Boolean, Object],
140
+ /** ElRow属性 */
141
+ rowProps: Object,
142
+ /** 是否需要底栏 */
143
+ footer: Boolean,
144
+ /** 底栏ElFormItem属性 */
145
+ footerProps: Object,
146
+ /** 底栏ElFormItem插槽 */
147
+ footerSlots: Object,
148
+ /** 底栏ElCol属性 */
149
+ footerColProps: {
150
+ type: Object,
151
+ default: () => {
152
+ return { span: 24 };
153
+ }
154
+ },
155
+ /** 提交按钮文本 */
156
+ submitText: {
157
+ type: String,
158
+ default: '提交'
159
+ },
160
+ /** 重置按钮文本 */
161
+ resetText: {
162
+ type: String,
163
+ default: '重置'
164
+ },
165
+ readonly: {
166
+ type: Boolean,
167
+ default: false
168
+ }
169
+ });
170
+
171
+ const emit = defineEmits(['updateValue', 'submit', 'reset']);
172
+
173
+ /** 表单实例 */
174
+ const formRef = ref(null);
175
+
176
+ /** 更新值 */
177
+ const updateValue = (prop, value) => {
178
+ emit('updateValue', prop, value);
179
+ };
180
+
181
+ const formItems = ref({}); // 使用对象存储确保唯一性
182
+
183
+ const setFormItemRef = (el, prop) => {
184
+ if (el) {
185
+ formItems.value[prop] = el;
186
+ }
187
+ };
188
+
189
+ const getRef = (propName) => {
190
+ return formItems.value[propName];
191
+ };
192
+
193
+ /** 提交 */
194
+ const submit = () => {
195
+ formRef.value?.validate?.((valid) => {
196
+ if (valid) {
197
+ emit('submit', props.model);
198
+ }
199
+ });
200
+ };
201
+
202
+ /** 重置 */
203
+ const reset = () => {
204
+ resetFields();
205
+ emit('reset');
206
+ };
207
+
208
+ /** 验证表单 */
209
+ const validate = () => {
210
+ if (!formRef.value) {
211
+ throw new Error('formRef is null');
212
+ }
213
+ return formRef.value.validate();
214
+ };
215
+
216
+ /** 验证表单某个字段 */
217
+ const validateField = (props, callback) => {
218
+ if (!formRef.value) {
219
+ throw new Error('formRef is null');
220
+ }
221
+ return formRef.value.validateField(props, callback);
222
+ };
223
+
224
+ /** 重置表单 */
225
+ const resetFields = (props) => {
226
+ if (!formRef.value) {
227
+ throw new Error('formRef is null');
228
+ }
229
+ return formRef.value.resetFields(props);
230
+ };
231
+
232
+ /** 滚动到指定字段 */
233
+ const scrollToField = (prop) => {
234
+ if (!formRef.value) {
235
+ throw new Error('formRef is null');
236
+ }
237
+ return formRef.value.scrollToField(prop);
238
+ };
239
+
240
+ /** 清理表单验证信息 */
241
+ const clearValidate = (props) => {
242
+ if (!formRef.value) {
243
+ throw new Error('formRef is null');
244
+ }
245
+ return formRef.value.clearValidate(props);
246
+ };
247
+
248
+ defineExpose({
249
+ formRef,
250
+ validate,
251
+ validateField,
252
+ resetFields,
253
+ scrollToField,
254
+ clearValidate,
255
+ getRef
256
+ });
257
+ </script>
@@ -0,0 +1,140 @@
1
+ /**
2
+ * 表单数据类型为字符串的组件类型
3
+ */
4
+ export const stringTypes = [
5
+ 'input',
6
+ 'textarea',
7
+ 'date',
8
+ 'datetime',
9
+ 'time',
10
+ 'timeSelect',
11
+ 'autocomplete',
12
+ 'editor'
13
+ ];
14
+
15
+ /**
16
+ * 表单数据类型为数字的组件类型
17
+ */
18
+ export const numberTypes = [
19
+ 'select',
20
+ 'radio',
21
+ 'radioButton',
22
+ 'checkbox',
23
+ 'checkboxButton',
24
+ 'switch',
25
+ 'inputNumber',
26
+ 'rate',
27
+ 'slider',
28
+ 'tableSelect'
29
+ ];
30
+
31
+ /**
32
+ * 表单数据类型为数组的组件类型
33
+ */
34
+ export const arrayTypes = [
35
+ 'multipleSelect',
36
+ 'checkbox',
37
+ 'checkboxButton',
38
+ 'daterange',
39
+ 'datetimerange',
40
+ 'timerange',
41
+ 'cascader',
42
+ 'sliderRange',
43
+ 'treeMultipleSelect',
44
+ 'virtualTreeMultipleSelect',
45
+ 'tableMultipleSelect',
46
+ 'multipleCheckCard',
47
+ 'editTag',
48
+ 'dictCheckbox',
49
+ 'dictMultipleSelect',
50
+ 'regions'
51
+ ];
52
+
53
+ /**
54
+ * 表单验证规则使用blur触发的组件类型
55
+ */
56
+ export const blurTypes = ['input', 'textarea'];
57
+
58
+ /**
59
+ * 选择类型的组件类型
60
+ */
61
+ export const selectTypes = [
62
+ 'select',
63
+ 'multipleSelect',
64
+ 'radio',
65
+ 'radioButton',
66
+ 'checkbox',
67
+ 'checkboxButton',
68
+ 'date',
69
+ 'datetime',
70
+ 'daterange',
71
+ 'datetimerange',
72
+ 'time',
73
+ 'timerange',
74
+ 'timeSelect',
75
+ 'switch',
76
+ 'cascader',
77
+ 'rate',
78
+ 'slider',
79
+ 'sliderRange',
80
+ 'treeSelect',
81
+ 'tableMultipleSelect',
82
+ 'virtualTreeSelect',
83
+ 'virtualTreeMultipleSelect',
84
+ 'tableSelect',
85
+ 'tableMultipleSelect',
86
+ 'checkCard',
87
+ 'multipleCheckCard',
88
+ 'dictRadio',
89
+ 'dictSelect',
90
+ 'dictCheckbox',
91
+ 'dictMultipleSelect',
92
+ 'regions'
93
+ ];
94
+
95
+ /**
96
+ * 上传类型的组件类型
97
+ */
98
+ export const uploadTypes = ['imageUpload', 'fileUpload'];
99
+
100
+ /**
101
+ * 获取验证规则值类型
102
+ * @param type 组件类型
103
+ */
104
+ export function getRuleType(type) {
105
+ if (type) {
106
+ if (arrayTypes.includes(type)) {
107
+ return 'array';
108
+ }
109
+ if (numberTypes.includes(type)) {
110
+ return 'number';
111
+ }
112
+ }
113
+ return 'string';
114
+ }
115
+
116
+ /**
117
+ * 获取验证规则触发类型
118
+ * @param type 组件类型
119
+ */
120
+ export function getRuleTrigger(type) {
121
+ return type && blurTypes.includes(type) ? 'blur' : 'change';
122
+ }
123
+
124
+ /**
125
+ * 获取验证规则提示文本
126
+ * @param type 组件类型
127
+ * @param label 表单项标题
128
+ */
129
+ export function getRuleMessage(type, label) {
130
+ const text = label ?? '';
131
+ if (type) {
132
+ if (selectTypes.includes(type)) {
133
+ return `请选择${text}`;
134
+ }
135
+ if (uploadTypes.includes(type)) {
136
+ return `请上传${text}`;
137
+ }
138
+ }
139
+ return `请输入${text}`;
140
+ }
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div>界面布局SohelpProLayout是继承EleProLayout</div>
3
+ </template>
4
+ <script>
5
+ export default {
6
+ name: "SohelpProLayout"
7
+ }
8
+ </script>
9
+ <style scoped>
10
+
11
+ </style>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <ele-pro-table v-bind="$attrs">
3
+ <template v-for="(_, slot) in $slots" #[slot]="slotProps">
4
+ <slot :name="slot" v-bind="slotProps" />
5
+ </template>
6
+ </ele-pro-table>
7
+ </template>
8
+
9
+ <script setup>
10
+
11
+ </script>
12
+ <style scoped lang="scss">
13
+
14
+ </style>
@@ -0,0 +1,216 @@
1
+ <template>
2
+ <div class="sohelp-progress-c">
3
+ <view class="sohelp-progress-wrap">
4
+ <view class="sohelp-progress-box" ref="progressBox" @mousedown="onDragStart" @touchstart="onDragStart">
5
+ <view class="sohelp-progress" :style="style"></view>
6
+ <!-- 拖拽句柄 -->
7
+ <div
8
+ v-if="!props.readonly"
9
+ class="sohelp-progress-handle"
10
+ :style="handleStyle"
11
+ @mousedown.stop="onHandleDown"
12
+ @touchstart.stop="onHandleDown"
13
+ ></div>
14
+ </view>
15
+ <view class="percent">{{ Number(value) || 0 }}%</view>
16
+ </view>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ import { computed, ref, watch, onBeforeUnmount } from 'vue';
22
+
23
+ const emit = defineEmits(['update:modelValue']);
24
+ const props = defineProps({
25
+ readonly: {
26
+ type: Boolean,
27
+ default: false
28
+ },
29
+ height: {
30
+ type: [Number, String],
31
+ default: 8
32
+ },
33
+ modelValue: {
34
+ type: [String, Number],
35
+ default: 0
36
+ },
37
+ color: {
38
+ type: String,
39
+ default: '#35b558'
40
+ },
41
+ // 动画延迟秒数
42
+ delay: {
43
+ type: Number,
44
+ default: 1
45
+ },
46
+ // 持续时间
47
+ duration: {
48
+ type: Number,
49
+ default: 1
50
+ },
51
+ // 是否开启动画
52
+ animate: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ // 动画轨迹
57
+ track: {
58
+ type: String,
59
+ default: 'ease-out'
60
+ },
61
+ margin: {
62
+ type: String,
63
+ default: '10px 0'
64
+ },
65
+ // 显示百分比
66
+ showPercent: {
67
+ type: Boolean,
68
+ default: false
69
+ }
70
+ });
71
+
72
+ const progressBox = ref(null);
73
+ const dragging = ref(false);
74
+
75
+ const value = ref(Number(props.modelValue) || 0);
76
+
77
+ const handleStyle = computed(() => ({
78
+ left: `calc(${value.value}% - 7px)`
79
+ }));
80
+
81
+ // 拖拽相关
82
+ const getPercent = (e) => {
83
+ let clientX = e.touches ? e.touches[0].clientX : e.clientX;
84
+ const rect = progressBox.value.getBoundingClientRect();
85
+ let percent = ((clientX - rect.left) / rect.width) * 100;
86
+ percent = Math.round(percent); // step 1
87
+ percent = Math.max(0, Math.min(100, percent));
88
+ return percent;
89
+ };
90
+
91
+ const onDragStart = (e) => {
92
+ if (props.readonly) return;
93
+ dragging.value = true; // 保证拖动时立即生效
94
+ updateValue(getPercent(e));
95
+ window.addEventListener('mousemove', onDragging);
96
+ window.addEventListener('mouseup', onDragEnd);
97
+ window.addEventListener('touchmove', onDragging);
98
+ window.addEventListener('touchend', onDragEnd);
99
+ };
100
+
101
+ const onHandleDown = (e) => {
102
+ dragging.value = true;
103
+ onDragStart(e);
104
+ };
105
+
106
+ const onDragging = (e) => {
107
+ if (!dragging.value && e.type !== 'mousemove' && e.type !== 'touchmove') return;
108
+ updateValue(getPercent(e));
109
+ };
110
+
111
+ const onDragEnd = () => {
112
+ dragging.value = false;
113
+ window.removeEventListener('mousemove', onDragging);
114
+ window.removeEventListener('mouseup', onDragEnd);
115
+ window.removeEventListener('touchmove', onDragging);
116
+ window.removeEventListener('touchend', onDragEnd);
117
+ };
118
+
119
+ const updateValue = (val) => {
120
+ val = Math.max(0, Math.min(100, Math.round(val)));
121
+ value.value = val;
122
+ emit('update:modelValue', val);
123
+ };
124
+
125
+ onBeforeUnmount(() => {
126
+ onDragEnd();
127
+ });
128
+
129
+ const style = computed(() => {
130
+ const obj = {
131
+ width: value.value + '%',
132
+ backgroundColor: props.color
133
+ };
134
+
135
+ obj.transition = dragging.value ? 'none' : `width ${props.duration}s ${props.track}`; // 不要加 delay
136
+
137
+ return obj;
138
+ });
139
+
140
+ watch(
141
+ () => props.modelValue,
142
+ (val) => {
143
+ value.value = val;
144
+ }
145
+ );
146
+ </script>
147
+
148
+ <script>
149
+ export default {
150
+ name: 'SohelpProcess'
151
+ };
152
+ </script>
153
+
154
+ <style lang="scss" scoped>
155
+ .readonly {
156
+ width: 100% !important;
157
+ .el-input-number {
158
+ width: 100%;
159
+ }
160
+ }
161
+
162
+ .sohelp-progress-wrap {
163
+ display: flex;
164
+ align-items: center;
165
+ justify-content: flex-start;
166
+ width: 100%;
167
+
168
+ .sohelp-progress-box {
169
+ position: relative;
170
+ width: 100%;
171
+ height: 8px;
172
+ background: #ccc;
173
+ border-radius: 16px;
174
+ border: 1px solid #ddd;
175
+ margin: 10px 5px 10px 10px;
176
+
177
+ .sohelp-progress {
178
+ position: absolute;
179
+ display: block;
180
+ width: 0%;
181
+ left: 0;
182
+ top: 0;
183
+ bottom: 0;
184
+ margin: auto 0;
185
+ height: 100%;
186
+ border-radius: 8px;
187
+ transition: width 0.3s ease;
188
+ }
189
+ }
190
+
191
+ .percent {
192
+ margin-left: 10px;
193
+ font-size: 14px;
194
+ flex: 1;
195
+ min-width: 40px;
196
+ }
197
+ }
198
+ .sohelp-progress-handle {
199
+ position: absolute;
200
+ top: 50%;
201
+ transform: translateY(-50%);
202
+ height: 100%; // 继承父节点高度
203
+ aspect-ratio: 1 / 1; // 保持正方形
204
+ padding: 3px;
205
+ background: #fff;
206
+ border: 2px solid #35b558; // 建议加上边框更明显
207
+ border-radius: 50%;
208
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
209
+ cursor: move;
210
+ z-index: 2;
211
+ transition: box-shadow 0.2s;
212
+ &:active {
213
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
214
+ }
215
+ }
216
+ </style>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div class="sohelp-rate">
3
+ <ele-text v-if="type === 'select'">
4
+ <sohelp-select :datasource="datasource" v-model="value" v-bind="$attrs" />
5
+ </ele-text>
6
+ <el-rate v-model="value" v-else v-bind="$attrs" :texts="['1 分', '2 分', '3 分', '4 分', '5 分']" show-text></el-rate>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import { reactive, ref, watch } from 'vue';
11
+ import SohelpDynSelect from '../sohelp-dyn-select/index.vue';
12
+ export default {
13
+ name: 'SohelpRate',
14
+ components: { SohelpDynSelect },
15
+ props: {
16
+ type: {
17
+ type: String,
18
+ default: "rate"
19
+ },
20
+ modelValue: [Number, String, Array]
21
+ },
22
+ emit: ['update:modelValue'],
23
+ setup(props, { emit, attrs }) {
24
+ const datasource = Array.from({ length: 5 }, (_, i) => ({
25
+ label: '*'.repeat(i + 1),
26
+ value: String(i + 1)
27
+ }));
28
+
29
+ const value = ref('');
30
+
31
+ watch(
32
+ () => props.modelValue,
33
+ (val) => {
34
+ value.value = val;
35
+ },
36
+ {
37
+ immediate: true
38
+ }
39
+ );
40
+
41
+ return {
42
+ value,
43
+ datasource
44
+ };
45
+ }
46
+ };
47
+ </script>
48
+ <style lang="scss" scoped>
49
+
50
+ .sohelp-rate{
51
+ .el-rate{
52
+ margin-top: 0;
53
+ }
54
+ }
55
+
56
+ </style>