sohelp-eleplus 1.1.26 → 1.1.28

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 (205) hide show
  1. package/components.js +1 -0
  2. package/icons/flag/README.md +2 -2
  3. package/icons/flag/index.js +0 -1
  4. package/package.json +1 -1
  5. package/sohelp-ace-editor/README.md +32 -42
  6. package/sohelp-ace-editor/index.vue +166 -156
  7. package/sohelp-api-doc/README.md +36 -0
  8. package/sohelp-api-doc/index.vue +160 -0
  9. package/sohelp-application-select/README.md +9 -7
  10. package/sohelp-application-select/index.vue +10 -13
  11. package/sohelp-autocode/README.md +14 -26
  12. package/sohelp-calendar-view/README.md +9 -7
  13. package/sohelp-calendar-view/index.vue +10 -9
  14. package/sohelp-card/README.md +15 -17
  15. package/sohelp-card/index.vue +1 -1
  16. package/sohelp-card-view/README.md +9 -7
  17. package/sohelp-card-view/index.vue +10 -9
  18. package/sohelp-condition/README.md +29 -49
  19. package/sohelp-condition/index.vue +2 -1
  20. package/sohelp-country-select/README.md +15 -123
  21. package/sohelp-country-select/index.vue +1 -1
  22. package/sohelp-cry-input/README.md +19 -195
  23. package/sohelp-cry-input/index.vue +6 -2
  24. package/sohelp-date/README.md +12 -15
  25. package/sohelp-datetime/README.md +15 -17
  26. package/sohelp-datetime-picker/README.md +18 -18
  27. package/sohelp-datetime-picker/index.vue +11 -4
  28. package/sohelp-datetime-range/README.md +20 -23
  29. package/sohelp-demo-block/README.md +43 -0
  30. package/sohelp-demo-block/index.vue +229 -0
  31. package/sohelp-dict/README.md +28 -23
  32. package/sohelp-dict/index.vue +17 -17
  33. package/sohelp-drawer/README.md +28 -26
  34. package/sohelp-drop-card/README.md +29 -28
  35. package/sohelp-drop-card/index.vue +0 -1
  36. package/sohelp-dyn-select/README.md +31 -16
  37. package/sohelp-dyn-select/index.vue +65 -67
  38. package/sohelp-dyn-tree/README.md +26 -20
  39. package/sohelp-dyn-tree/index.vue +2 -2
  40. package/sohelp-dyn-tree-select/README.md +28 -19
  41. package/sohelp-dyn-tree-select/index.vue +23 -7
  42. package/sohelp-entity-form/README.md +65 -30
  43. package/sohelp-entity-form/index.vue +3 -2
  44. package/sohelp-entity-grid/README.md +13 -11
  45. package/sohelp-entity-grid/index.vue +1 -1
  46. package/sohelp-file-upload/README.md +25 -27
  47. package/sohelp-file-upload/index.vue +1 -1
  48. package/sohelp-filter-scheme/README.md +34 -30
  49. package/sohelp-filter-scheme/index.vue +2 -2
  50. package/sohelp-grid/README.md +52 -33
  51. package/sohelp-grid/index.vue +41 -39
  52. package/sohelp-grid/js/SohelpGridConfig.js +3 -3
  53. package/sohelp-grid/js/useSohelpGridConfig.js +4 -6
  54. package/sohelp-grid-select/README.md +32 -27
  55. package/sohelp-grid-select/index.vue +6 -5
  56. package/sohelp-grid-view/README.md +51 -22
  57. package/sohelp-grid-view-select/README.md +33 -25
  58. package/sohelp-grid-view-select/index.vue +2 -1
  59. package/sohelp-group-view/README.md +14 -4
  60. package/sohelp-group-view/index.vue +10 -9
  61. package/sohelp-icon-select/README.md +14 -12
  62. package/sohelp-image-upload/README.md +27 -27
  63. package/sohelp-image-upload/index.vue +2 -2
  64. package/sohelp-import/README.md +25 -24
  65. package/sohelp-input/README.md +27 -11
  66. package/sohelp-input/index.vue +15 -2
  67. package/sohelp-input-tag/README.md +53 -0
  68. package/sohelp-input-tag/index.vue +337 -0
  69. package/sohelp-modal/README.md +42 -16
  70. package/sohelp-modal/index.vue +21 -4
  71. package/sohelp-modal-select/README.md +745 -0
  72. package/sohelp-modal-select/index.vue +705 -0
  73. package/sohelp-module/README.md +24 -13
  74. package/sohelp-number-input/README.md +15 -8
  75. package/sohelp-number-input/index.vue +3 -0
  76. package/sohelp-number-range/README.md +22 -12
  77. package/sohelp-number-range/index.vue +3 -11
  78. package/sohelp-org-modal-select/README.md +47 -0
  79. package/sohelp-org-modal-select/index.vue +411 -0
  80. package/sohelp-org-select/README.md +23 -10
  81. package/sohelp-org-select/index.vue +41 -24
  82. package/sohelp-org-tree/README.md +19 -7
  83. package/sohelp-org-tree/index.vue +1 -2
  84. package/sohelp-org-tree-select/README.md +22 -11
  85. package/sohelp-org-tree-select/index.vue +1 -2
  86. package/sohelp-org-user-tree/README.md +19 -7
  87. package/sohelp-org-user-tree/index.vue +1 -2
  88. package/sohelp-org-user-tree-select/README.md +8 -3
  89. package/sohelp-org-user-tree-select/index.vue +8 -7
  90. package/sohelp-page/README.md +20 -11
  91. package/sohelp-page/index.vue +1 -1
  92. package/sohelp-pagination/README.md +14 -6
  93. package/sohelp-pagination/index.vue +1 -1
  94. package/sohelp-power/README.md +34 -19
  95. package/sohelp-power/index.vue +2 -2
  96. package/sohelp-pro-form/README.md +64 -21
  97. package/sohelp-pro-layout/README.md +10 -4
  98. package/sohelp-pro-layout/index.vue +8 -7
  99. package/sohelp-pro-table/README.md +30 -6
  100. package/sohelp-process/README.md +26 -13
  101. package/sohelp-process/index.vue +6 -6
  102. package/sohelp-rate/README.md +24 -12
  103. package/sohelp-rate/index.vue +5 -1
  104. package/sohelp-relation/README.md +10 -4
  105. package/sohelp-relation/index.vue +8 -7
  106. package/sohelp-relation-modal-select/README.md +41 -0
  107. package/sohelp-relation-modal-select/index.vue +70 -0
  108. package/sohelp-rich-text/README.md +29 -11
  109. package/sohelp-rich-text/index.vue +21 -20
  110. package/sohelp-richtext/README.md +12 -2
  111. package/sohelp-richtext/index.vue +8 -6
  112. package/sohelp-role-modal-select/README.md +45 -0
  113. package/sohelp-role-modal-select/index.vue +111 -0
  114. package/sohelp-role-select/README.md +18 -10
  115. package/sohelp-role-select/index.vue +36 -27
  116. package/sohelp-search/README.md +12 -4
  117. package/sohelp-search/index.vue +2 -2
  118. package/sohelp-search-pro-form/README.md +15 -1
  119. package/sohelp-search-pro-form/index.vue +2 -1
  120. package/sohelp-select/README.md +31 -30
  121. package/sohelp-select/index.vue +79 -84
  122. package/sohelp-split-panel/README.md +17 -18
  123. package/sohelp-switch/README.md +21 -19
  124. package/sohelp-switch/index.vue +34 -33
  125. package/sohelp-table/README.md +35 -27
  126. package/sohelp-table/index.vue +110 -109
  127. package/sohelp-table-select/README.md +55 -0
  128. package/sohelp-tenant-select/README.md +19 -18
  129. package/sohelp-tenant-select/index.vue +105 -109
  130. package/sohelp-text/README.md +16 -10
  131. package/sohelp-text/index.vue +5 -5
  132. package/sohelp-textarea-input/README.md +19 -12
  133. package/sohelp-time/README.md +11 -10
  134. package/sohelp-tree/README.md +24 -19
  135. package/sohelp-tree/index.vue +21 -23
  136. package/sohelp-tree-select/README.md +23 -10
  137. package/sohelp-user-modal-select/README.md +739 -0
  138. package/sohelp-user-modal-select/index.vue +87 -0
  139. package/sohelp-user-select/README.md +26 -15
  140. package/sohelp-user-select/index.vue +6 -2
  141. package/sohelp-user-tag/README.md +5 -7
  142. package/sohelp-user-tag/index.vue +8 -8
  143. package/sohelp-user-tree/README.md +5 -8
  144. package/sohelp-user-tree/index.vue +8 -7
  145. package/sohelp-vform-drawer/README.md +36 -18
  146. package/sohelp-vform-drawer/index.vue +2 -2
  147. package/sohelp-vform-eleplus/README.md +33 -31
  148. package/sohelp-vform-eleplus/index.vue +2 -2
  149. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +461 -461
  150. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +418 -418
  151. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -72
  152. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -7
  153. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -67
  154. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -7
  155. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -72
  156. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -7
  157. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -68
  158. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -7
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -732
  160. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -726
  161. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -7
  162. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -7
  163. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -29
  164. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -7
  165. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -3047
  166. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -7
  167. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -673
  168. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -7
  169. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -37
  170. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -7
  171. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -714
  172. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -726
  173. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -7
  174. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -7
  175. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -29
  176. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -7
  177. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -3047
  178. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -7
  179. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -673
  180. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -7
  181. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -37
  182. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -7
  183. package/sohelp-vform-modal/README.md +36 -18
  184. package/sohelp-vform-modal/index.vue +2 -2
  185. package/sohelp-vform-select/README.md +9 -7
  186. package/sohelp-vform-select/index.vue +8 -7
  187. package/sohelp-vxe-grid/DefaultGridOptions.js +5 -3
  188. package/sohelp-vxe-grid/DefaultProps.js +0 -1
  189. package/sohelp-vxe-grid/README.md +540 -35
  190. package/sohelp-vxe-grid/SohelpGridConfig.js +8 -6
  191. package/sohelp-vxe-grid/index.vue +141 -94
  192. package/sohelp-vxe-grid-select/README.md +41 -26
  193. package/sohelp-vxe-table/README.md +23 -20
  194. package/sohelp-vxe-table/index.vue +5 -4
  195. package/sohelp-workflow/README.md +21 -17
  196. package/sohelp-workflow/index.vue +25 -22
  197. package/sohelp-workflow-drawer/README.md +41 -28
  198. package/sohelp-workflow-drawer/components/table.vue +7 -1
  199. package/sohelp-workflow-drawer/index.vue +86 -71
  200. package/sohelp-workflow-drawer/js/index.js +15 -13
  201. package/style/index.scss +0 -0
  202. package/utils/safe-eval.js +89 -0
  203. package/sohelp-dyn-select/props.js +0 -67
  204. package/sohelp-user-select/index.vue~ +0 -53
  205. package/sohelp-user-select/props.js +0 -71
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <sohelp-modal-select v-bind="$attrs" :labelField="labelField" :valueField="valueField" :gridProps="mergedGridProps"
3
+ :selectionTemplate="selectionTemplate" :modalProps="mergedModalProps"></sohelp-modal-select>
4
+ </template>
5
+
6
+ <script>
7
+ export default {
8
+ name: 'SohelpUserModalSelect'
9
+ };
10
+ </script>
11
+
12
+ <script setup>
13
+ import { computed } from 'vue';
14
+
15
+ import SohelpModalSelect from '../sohelp-modal-select/index.vue';
16
+
17
+ const defaultGridProps = {
18
+ url: '/admin/system/user/page',
19
+ gridOptions: {
20
+ columns: [
21
+ {
22
+ field: 'user_name',
23
+ title: '用户姓名',
24
+ width: 120
25
+ },
26
+ {
27
+ field: 'login_name',
28
+ title: '登录账户',
29
+ width: 200
30
+ },
31
+ {
32
+ field: 'nickname',
33
+ title: '昵称',
34
+ width: 120
35
+ }
36
+ ]
37
+ }
38
+ };
39
+
40
+ const props = defineProps({
41
+ gridProps: {
42
+ type: Object,
43
+ default: () => ({})
44
+ },
45
+ modalProps: {
46
+ type: Object,
47
+ default: () => ({})
48
+ },
49
+ valueField: {
50
+ type: String,
51
+ default: 'id'
52
+ },
53
+ labelField: {
54
+ type: String,
55
+ default: 'user_name'
56
+ },
57
+ selectionTemplate: {
58
+ type: String,
59
+ default: '${user_name}-${login_name}'
60
+ }
61
+ });
62
+
63
+ const mergedGridProps = computed(() => {
64
+ const { gridProps } = props;
65
+ return {
66
+ url: gridProps?.url ?? defaultGridProps.url,
67
+ gridOptions: gridProps?.gridOptions ?? defaultGridProps.gridOptions
68
+ };
69
+ });
70
+
71
+ const mergedModalProps = computed(() => {
72
+ return {
73
+ title: '选择用户',
74
+ ...props.modalProps,
75
+ width: props.modalProps?.width || 800,
76
+ };
77
+ });
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ </script>
@@ -1,22 +1,33 @@
1
- # SohelpUserSelect
1
+ # SohelpUserSelect 用户选择器
2
2
 
3
- A specialized selection component for selecting users, built on top of `sohelp-dyn-select`.
3
+ 基于 `sohelp-dyn-select` 封装的用户选择组件,预设了用户列表接口地址和字段映射,开箱即用。
4
4
 
5
- ## Props
6
-
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `datasource` | `Array`, `Function`, `Promise` | Required | The data source for user options. |
10
- | `url` | `String` | `'/engine/web/user/list'` | The default URL for fetching user data. |
11
- | `labelField` | `String` | `'user_name'` | The field name for the user label. |
12
- | `valueField` | `String` | `'id'` | The field name for the user value. |
13
- | `modelValue` | `String`, `Number`, `Array` | `""` | The selected value (v-model). |
14
- | `...` | - | - | Supports all `sohelp-dyn-select` props. |
15
-
16
- ## Usage
5
+ ## 基础用法
17
6
 
18
7
  ```vue
19
8
  <template>
20
- <sohelp-user-select v-model="userId" :datasource="users" />
9
+ <sohelp-user-select v-model="userId" />
21
10
  </template>
11
+
12
+ <script setup>
13
+ import { ref } from 'vue';
14
+
15
+ const userId = ref('');
16
+ </script>
22
17
  ```
18
+
19
+ ## 属性 (Props)
20
+
21
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
22
+ | :--- | :--- | :--- | :--- | :--- |
23
+ | modelValue | String / Number / Array | `''` | 否 | 绑定值(v-model) |
24
+ | datasource | Array / Function / Promise | `undefined` | 否 | 自定义数据源,优先级高于 url |
25
+ | url | String | `'/engine/web/user/list'` | 否 | 用户列表接口地址 |
26
+ | labelField | String | `'user_name'` | 否 | 显示文本字段名 |
27
+ | valueField | String | `'id'` | 否 | 值字段名 |
28
+
29
+ > 同时支持所有 `sohelp-dyn-select` 和 `el-select` 原生属性,通过 `v-bind="$attrs"` 透传。
30
+
31
+ ## 公开方法 (Expose)
32
+
33
+ 组件通过 `defineExpose({})` 暴露,当前无额外公开方法。
@@ -18,7 +18,7 @@
18
18
  const props = defineProps({
19
19
  datasource: {
20
20
  type: [Array, Function, Promise],
21
- required: true
21
+ default: undefined
22
22
  },
23
23
  url: {
24
24
  type: String,
@@ -41,4 +41,8 @@
41
41
  name: 'SohelpUserSelect'
42
42
  };
43
43
  </script>
44
- <style></style>
44
+ <style>
45
+ .sohelp-user-select{
46
+ width: 100%;
47
+ }
48
+ </style>
@@ -1,15 +1,13 @@
1
- # SohelpUserTag
1
+ # SohelpUserTag 用户头像标签
2
2
 
3
- A component to display user information (Avatar + Nickname). Falls back to default company LOGO if no info is provided.
3
+ 用户头像标签组件,显示用户头像和昵称,无头像时显示公司 LOGO(待实现)。
4
4
 
5
- ## Description
6
-
7
- Displays user avatar and nickname. Currently a placeholder/simple implementation.
8
-
9
- ## Usage
5
+ ## 基础用法
10
6
 
11
7
  ```vue
12
8
  <template>
13
9
  <sohelp-user-tag />
14
10
  </template>
15
11
  ```
12
+
13
+ > 该组件当前为占位状态,功能待实现。
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div>头像+nickname,如果没有显示默认公司LOGO</div>
2
+ <div class="sohelp-user-tag">
3
+ <!-- TODO: 待实现 - 用户头像标签(头像+昵称,无头像显示公司LOGO) -->
4
+ <el-empty description="用户头像标签 - 待实现" />
5
+ </div>
3
6
  </template>
7
+ <script setup>
8
+ // TODO: 待实现
9
+ </script>
4
10
  <script>
5
- export default {
6
- name: "SohelpUserTag"
7
- }
11
+ export default { name: 'SohelpUserTag' };
8
12
  </script>
9
-
10
- <style scoped>
11
-
12
- </style>
@@ -1,15 +1,12 @@
1
- # SohelpUserTree
1
+ # SohelpUserTree 用户树
2
2
 
3
- A specialized tree component for displaying users, inheriting from `SohelpTree`.
3
+ 用户树组件,用于以树形结构展示和选择用户。当前版本为占位组件,功能待实现。
4
4
 
5
- ## Description
6
-
7
- Intended for user selection in a tree structure. Currently a wrapper/placeholder inheriting from `SohelpTree`.
8
-
9
- ## Usage
5
+ ## 基础用法
10
6
 
11
7
  ```vue
12
8
  <template>
13
- <sohelp-user-tree :data="userData" />
9
+ <!-- 当前版本为占位组件,功能待实现 -->
10
+ <sohelp-user-tree />
14
11
  </template>
15
12
  ```
@@ -1,11 +1,12 @@
1
1
  <template>
2
- <div>SohelpUserTree用户弹窗是继承SohelpTree</div>
2
+ <div class="sohelp-user-tree">
3
+ <!-- TODO: 待实现 - 用户树选择弹窗(继承SohelpTree) -->
4
+ <el-empty description="用户树选择弹窗 - 待实现" />
5
+ </div>
3
6
  </template>
7
+ <script setup>
8
+ // TODO: 待实现
9
+ </script>
4
10
  <script>
5
- export default {
6
- name: "SohelpUserTree"
7
- }
11
+ export default { name: 'SohelpUserTree' };
8
12
  </script>
9
- <style scoped>
10
-
11
- </style>
@@ -1,25 +1,43 @@
1
- # SohelpVformDrawer
1
+ # SohelpVformDrawer 表单抽屉
2
2
 
3
- A drawer component that renders a VForm based on configuration, wrapping `sohelp-vform-eleplus`.
3
+ 基于 `sohelp-drawer` `sohelp-vform-eleplus` 封装的表单抽屉组件,在抽屉中加载动态表单。
4
4
 
5
- ## Props
6
-
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `refid` | `String` | Required | The configuration ID for the form. |
10
- | `...` | - | - | Supports all `sohelp-drawer` props. |
11
-
12
- ## Methods
13
-
14
- | Name | Description |
15
- | :--- | :--- |
16
- | `getFormJson()` | Returns the form JSON configuration. |
17
- | `getFormData()` | Returns the current form data. |
18
-
19
- ## Usage
5
+ ## 基础用法
20
6
 
21
7
  ```vue
22
8
  <template>
23
- <sohelp-vform-drawer refid="form_config_id" v-model="visible" />
9
+ <sohelp-vform-drawer ref="vformDrawerRef" refid="myForm" />
24
10
  </template>
11
+
12
+ <script setup>
13
+ import { ref } from 'vue';
14
+ const vformDrawerRef = ref(null);
15
+
16
+ // 获取表单 JSON 配置
17
+ const json = vformDrawerRef.value?.getFormJson();
18
+ // 获取表单数据
19
+ const data = vformDrawerRef.value?.getFormData();
20
+ </script>
25
21
  ```
22
+
23
+ ## 属性 (Props)
24
+
25
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
26
+ | --- | --- | --- | --- | --- |
27
+ | refid | String | - | 是 | 表单引用 ID,用于加载对应的 vform 配置 |
28
+
29
+ > 支持透传 `sohelp-vform-eleplus` 的所有属性。
30
+
31
+ ## 插槽 (Slots)
32
+
33
+ | 插槽名 | 说明 |
34
+ | --- | --- |
35
+ | default | 自定义表单内容,透传至 sohelp-vform-eleplus |
36
+ | footer | 自定义底部操作区域 |
37
+
38
+ ## 公开方法 (Expose)
39
+
40
+ | 方法名 | 返回值 | 说明 |
41
+ | --- | --- | --- |
42
+ | getFormJson() | Object | 获取表单的 JSON 配置 |
43
+ | getFormData() | Object | 获取表单当前数据 |
@@ -2,7 +2,7 @@
2
2
  <sohelp-drawer>
3
3
  <sohelp-vform v-bind="$attrs" :refid="refid" ref="sohelpVformRef">
4
4
  <slot>
5
- <template v-for="(slotProps, slotName) in $scopedSlots" :key="slotName">
5
+ <template v-for="(slotProps, slotName) in $slots" :key="slotName">
6
6
  <slot :name="slotName" v-bind="slotProps" />
7
7
  </template>
8
8
  </slot>
@@ -25,7 +25,7 @@ export default {
25
25
  required: true
26
26
  }
27
27
  },
28
- setup(props, {emits, attrs}) {
28
+ setup(props, {emit, attrs}) {
29
29
  const sohelpVformRef = ref(null);
30
30
  const getFormJson =()=>{
31
31
  return sohelpVformRef.value.getFormJson();
@@ -1,39 +1,41 @@
1
- # SohelpVformEleplus
1
+ # SohelpVformEleplus 可视化表单渲染器
2
2
 
3
- A core component for rendering dynamic forms using VForm and `moduleCache`. Supports toolbars, dynamic loading, and integration with the global configuration.
3
+ 基于 VFormRender 封装的动态表单渲染组件,通过 `refid` 从模块缓存加载表单布局配置,支持工具栏按钮和自定义脚本执行。
4
4
 
5
- ## Props
5
+ ## 基础用法
6
6
 
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `refid` | `String` | `''` | The configuration ID for the form layout. |
10
- | `moduleType` | `String` | `'tab'` | The display mode/style (e.g., 'tab'). |
11
- | `title` | `String` | `''` | The title of the form/page. |
12
- | `modelValue` | `Object` | `{}` | The form data object (v-model). |
13
- | `data` | `Object` | `{}` | Additional data context. |
14
-
15
- ## Methods
7
+ ```vue
8
+ <template>
9
+ <sohelp-vform-eleplus
10
+ refid="my_form_layout"
11
+ v-model="formData"
12
+ v-model:data="extraData"
13
+ title="表单标题"
14
+ />
15
+ </template>
16
16
 
17
- | Name | Description |
18
- | :--- | :--- |
19
- | `loadConfig(refid)` | Loads the form configuration by ID. |
20
- | `setFormJson(json)` | Sets the form JSON configuration manually. |
21
- | `setFormData(data)` | Sets the form data. |
22
- | `setModelValue(value)` | Sets the model value. |
23
- | `getFormData(validate)` | Retrieves the form data, optionally validating it. |
24
- | `toolbarButtonClick(config)` | Handles toolbar button clicks and executes configured handlers. |
17
+ <script setup>
18
+ import { ref } from 'vue';
19
+ const formData = ref({});
20
+ const extraData = ref({});
21
+ </script>
22
+ ```
25
23
 
26
- ## Features
24
+ ## 属性 (Props)
27
25
 
28
- - **Dynamic Configuration**: Loads form layout and toolbar from `moduleCache`.
29
- - **Toolbar Support**: Renders a toolbar with customizable buttons and handlers.
30
- - **VForm Integration**: Wraps `VFormRender` for powerful form capabilities.
31
- - **Global Config**: Respects global size settings.
26
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
27
+ | --- | --- | --- | --- | --- |
28
+ | refid | String | '' | | 表单布局配置 ID,用于从模块缓存加载配置 |
29
+ | moduleType | String | 'tab' | 否 | 显示模式/样式类名,影响工具栏和主体布局方向 |
30
+ | title | String | '' | 否 | 表单页面标题 |
31
+ | modelValue | Object | {} | 否 | 表单数据对象,支持 v-model |
32
+ | data | Object | {} | 否 | 附加数据上下文,支持 v-model:data |
32
33
 
33
- ## Usage
34
+ ## 公开方法 (Expose)
34
35
 
35
- ```vue
36
- <template>
37
- <sohelp-vform-eleplus refid="my_form_config" v-model="formData" />
38
- </template>
39
- ```
36
+ - `loadConfig(refid)` - 根据配置 ID 加载表单布局
37
+ - `setFormJson(json)` - 手动设置 VForm JSON 配置
38
+ - `setFormData(data)` - 设置表单数据
39
+ - `setModelValue(value)` - 设置 modelValue
40
+ - `getFormData(validate?)` - 获取表单数据,可选是否验证(默认 true)
41
+ - `toolbarButtonClick(config)` - 手动触发工具栏按钮点击事件
@@ -28,6 +28,7 @@
28
28
  <script setup>
29
29
  import { defineProps, getCurrentInstance, inject, onMounted, reactive, ref, watch } from 'vue';
30
30
  import { moduleCache } from '../cache/ModuleCache.js';
31
+ import { safeFunctionExec } from '../utils/safe-eval.js';
31
32
  import { useRoute } from 'vue-router';
32
33
  import { ElMessage } from 'element-plus';
33
34
  import { usePageTab } from '@/utils/use-page-tab.js';
@@ -154,8 +155,7 @@
154
155
  $param: route.query,
155
156
  $config: config
156
157
  };
157
- const func = new Function('modelValue', config.handler);
158
- func.call(scope, modelValue.value || {});
158
+ safeFunctionExec(config.handler, ['modelValue'], [modelValue.value || {}], scope);
159
159
  } catch (e) {
160
160
  console.error('工具栏按钮单击事件出错:' + props.refid, e);
161
161
  ElMessage.error(e);