sohelp-eleplus 1.1.27 → 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 (202) hide show
  1. package/components.js +1 -0
  2. package/package.json +2 -2
  3. package/sohelp-ace-editor/README.md +32 -42
  4. package/sohelp-ace-editor/index.vue +166 -156
  5. package/sohelp-api-doc/README.md +36 -0
  6. package/sohelp-api-doc/index.vue +160 -0
  7. package/sohelp-application-select/README.md +9 -7
  8. package/sohelp-application-select/index.vue +10 -13
  9. package/sohelp-autocode/README.md +14 -26
  10. package/sohelp-calendar-view/README.md +9 -7
  11. package/sohelp-calendar-view/index.vue +10 -9
  12. package/sohelp-card/README.md +15 -17
  13. package/sohelp-card/index.vue +1 -1
  14. package/sohelp-card-view/README.md +9 -7
  15. package/sohelp-card-view/index.vue +10 -9
  16. package/sohelp-condition/README.md +29 -49
  17. package/sohelp-condition/index.vue +2 -1
  18. package/sohelp-country-select/README.md +15 -123
  19. package/sohelp-cry-input/README.md +19 -195
  20. package/sohelp-cry-input/index.vue +5 -1
  21. package/sohelp-date/README.md +12 -15
  22. package/sohelp-datetime/README.md +15 -17
  23. package/sohelp-datetime-picker/README.md +18 -18
  24. package/sohelp-datetime-picker/index.vue +11 -4
  25. package/sohelp-datetime-range/README.md +20 -23
  26. package/sohelp-demo-block/README.md +43 -0
  27. package/sohelp-demo-block/index.vue +229 -0
  28. package/sohelp-dict/README.md +28 -23
  29. package/sohelp-dict/index.vue +17 -17
  30. package/sohelp-drawer/README.md +28 -26
  31. package/sohelp-drop-card/README.md +29 -28
  32. package/sohelp-drop-card/index.vue +0 -1
  33. package/sohelp-dyn-select/README.md +31 -16
  34. package/sohelp-dyn-select/index.vue +65 -67
  35. package/sohelp-dyn-tree/README.md +26 -20
  36. package/sohelp-dyn-tree/index.vue +2 -2
  37. package/sohelp-dyn-tree-select/README.md +28 -19
  38. package/sohelp-dyn-tree-select/index.vue +23 -7
  39. package/sohelp-entity-form/README.md +65 -30
  40. package/sohelp-entity-form/index.vue +3 -2
  41. package/sohelp-entity-grid/README.md +13 -11
  42. package/sohelp-entity-grid/index.vue +1 -1
  43. package/sohelp-file-upload/README.md +25 -27
  44. package/sohelp-file-upload/index.vue +1 -1
  45. package/sohelp-filter-scheme/README.md +34 -30
  46. package/sohelp-filter-scheme/index.vue +2 -2
  47. package/sohelp-grid/README.md +52 -33
  48. package/sohelp-grid/index.vue +2217 -2210
  49. package/sohelp-grid/js/SohelpGridConfig.js +3 -3
  50. package/sohelp-grid/js/useSohelpGridConfig.js +641 -642
  51. package/sohelp-grid-select/README.md +32 -27
  52. package/sohelp-grid-select/index.vue +6 -5
  53. package/sohelp-grid-view/README.md +51 -22
  54. package/sohelp-grid-view-select/README.md +33 -25
  55. package/sohelp-grid-view-select/index.vue +2 -1
  56. package/sohelp-group-view/README.md +14 -4
  57. package/sohelp-group-view/index.vue +10 -9
  58. package/sohelp-icon-select/README.md +14 -12
  59. package/sohelp-image-upload/README.md +27 -27
  60. package/sohelp-image-upload/index.vue +2 -2
  61. package/sohelp-import/README.md +25 -24
  62. package/sohelp-input/README.md +27 -11
  63. package/sohelp-input/index.vue +15 -2
  64. package/sohelp-input-tag/README.md +53 -0
  65. package/sohelp-input-tag/index.vue +337 -0
  66. package/sohelp-modal/README.md +42 -16
  67. package/sohelp-modal/index.vue +21 -4
  68. package/sohelp-modal-select/README.md +745 -0
  69. package/sohelp-modal-select/index.vue +705 -0
  70. package/sohelp-module/README.md +24 -13
  71. package/sohelp-number-input/README.md +15 -8
  72. package/sohelp-number-input/index.vue +3 -0
  73. package/sohelp-number-range/README.md +22 -12
  74. package/sohelp-number-range/index.vue +3 -11
  75. package/sohelp-org-modal-select/README.md +47 -0
  76. package/sohelp-org-modal-select/index.vue +411 -0
  77. package/sohelp-org-select/README.md +23 -10
  78. package/sohelp-org-select/index.vue +41 -24
  79. package/sohelp-org-tree/README.md +19 -7
  80. package/sohelp-org-tree/index.vue +1 -2
  81. package/sohelp-org-tree-select/README.md +22 -11
  82. package/sohelp-org-tree-select/index.vue +1 -2
  83. package/sohelp-org-user-tree/README.md +19 -7
  84. package/sohelp-org-user-tree/index.vue +1 -2
  85. package/sohelp-org-user-tree-select/README.md +8 -3
  86. package/sohelp-org-user-tree-select/index.vue +8 -7
  87. package/sohelp-page/README.md +20 -11
  88. package/sohelp-page/index.vue +1 -1
  89. package/sohelp-pagination/README.md +14 -6
  90. package/sohelp-pagination/index.vue +1 -1
  91. package/sohelp-power/README.md +34 -19
  92. package/sohelp-power/index.vue +2 -2
  93. package/sohelp-pro-form/README.md +64 -21
  94. package/sohelp-pro-layout/README.md +10 -4
  95. package/sohelp-pro-layout/index.vue +8 -7
  96. package/sohelp-pro-table/README.md +30 -6
  97. package/sohelp-process/README.md +26 -13
  98. package/sohelp-process/index.vue +6 -6
  99. package/sohelp-rate/README.md +24 -12
  100. package/sohelp-rate/index.vue +5 -1
  101. package/sohelp-relation/README.md +10 -4
  102. package/sohelp-relation/index.vue +8 -7
  103. package/sohelp-relation-modal-select/README.md +41 -0
  104. package/sohelp-relation-modal-select/index.vue +70 -0
  105. package/sohelp-rich-text/README.md +29 -11
  106. package/sohelp-rich-text/index.vue +21 -20
  107. package/sohelp-richtext/README.md +12 -2
  108. package/sohelp-richtext/index.vue +8 -6
  109. package/sohelp-role-modal-select/README.md +45 -0
  110. package/sohelp-role-modal-select/index.vue +111 -0
  111. package/sohelp-role-select/README.md +18 -10
  112. package/sohelp-role-select/index.vue +36 -27
  113. package/sohelp-search/README.md +12 -4
  114. package/sohelp-search/index.vue +2 -2
  115. package/sohelp-search-pro-form/README.md +15 -1
  116. package/sohelp-search-pro-form/index.vue +2 -1
  117. package/sohelp-select/README.md +31 -30
  118. package/sohelp-select/index.vue +79 -84
  119. package/sohelp-split-panel/README.md +17 -18
  120. package/sohelp-switch/README.md +21 -19
  121. package/sohelp-switch/index.vue +34 -33
  122. package/sohelp-table/README.md +35 -27
  123. package/sohelp-table/index.vue +110 -109
  124. package/sohelp-table-select/README.md +55 -0
  125. package/sohelp-tenant-select/README.md +19 -18
  126. package/sohelp-tenant-select/index.vue +105 -109
  127. package/sohelp-text/README.md +16 -10
  128. package/sohelp-text/index.vue +5 -5
  129. package/sohelp-textarea-input/README.md +19 -12
  130. package/sohelp-time/README.md +11 -10
  131. package/sohelp-tree/README.md +24 -19
  132. package/sohelp-tree/index.vue +21 -23
  133. package/sohelp-tree-select/README.md +23 -10
  134. package/sohelp-user-modal-select/README.md +739 -0
  135. package/sohelp-user-modal-select/index.vue +87 -0
  136. package/sohelp-user-select/README.md +26 -15
  137. package/sohelp-user-select/index.vue +6 -2
  138. package/sohelp-user-tag/README.md +5 -7
  139. package/sohelp-user-tag/index.vue +8 -8
  140. package/sohelp-user-tree/README.md +5 -8
  141. package/sohelp-user-tree/index.vue +8 -7
  142. package/sohelp-vform-drawer/README.md +36 -18
  143. package/sohelp-vform-drawer/index.vue +2 -2
  144. package/sohelp-vform-eleplus/README.md +33 -31
  145. package/sohelp-vform-eleplus/index.vue +2 -2
  146. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +461 -461
  147. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +418 -418
  148. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -72
  149. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -7
  150. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -67
  151. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -7
  152. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -72
  153. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -7
  154. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -68
  155. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -7
  156. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -732
  157. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -726
  158. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -7
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -7
  160. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -29
  161. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -7
  162. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -3047
  163. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -7
  164. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -673
  165. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -7
  166. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -37
  167. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -7
  168. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -714
  169. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -726
  170. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -7
  171. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -7
  172. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -29
  173. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -7
  174. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -3047
  175. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -7
  176. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -673
  177. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -7
  178. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -37
  179. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -7
  180. package/sohelp-vform-modal/README.md +36 -18
  181. package/sohelp-vform-modal/index.vue +2 -2
  182. package/sohelp-vform-select/README.md +9 -7
  183. package/sohelp-vform-select/index.vue +8 -7
  184. package/sohelp-vxe-grid/DefaultGridOptions.js +5 -3
  185. package/sohelp-vxe-grid/DefaultProps.js +0 -1
  186. package/sohelp-vxe-grid/README.md +540 -35
  187. package/sohelp-vxe-grid/SohelpGridConfig.js +8 -6
  188. package/sohelp-vxe-grid/index.vue +141 -94
  189. package/sohelp-vxe-grid-select/README.md +41 -26
  190. package/sohelp-vxe-table/README.md +23 -20
  191. package/sohelp-vxe-table/index.vue +5 -4
  192. package/sohelp-workflow/README.md +21 -17
  193. package/sohelp-workflow/index.vue +25 -22
  194. package/sohelp-workflow-drawer/README.md +41 -28
  195. package/sohelp-workflow-drawer/components/table.vue +158 -158
  196. package/sohelp-workflow-drawer/index.vue +86 -71
  197. package/sohelp-workflow-drawer/js/index.js +15 -13
  198. package/style/index.scss +0 -0
  199. package/utils/safe-eval.js +89 -0
  200. package/sohelp-dyn-select/props.js +0 -67
  201. package/sohelp-user-select/index.vue~ +0 -53
  202. package/sohelp-user-select/props.js +0 -71
@@ -1,36 +1,44 @@
1
- # SohelpTable
1
+ # SohelpTable 表格
2
2
 
3
- A powerful table component wrapper around `ele-pro-table` that integrates with `moduleCache` for configuration loading and supports remote data fetching.
3
+ 基于 ele-pro-table 封装的配置化表格组件。通过 `refid` 从后端加载表格列配置,自动渲染列定义、支持分页查询、选择行数据等功能,并内置序号列和多选列。
4
4
 
5
- ## Props
5
+ ## 基础用法
6
6
 
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `refid` | `String` | Required | The configuration ID for the grid layout. |
10
- | `url` | `String` | `""` | The data source URL for fetching table data. |
11
- | `where` | `Object` | `{}` | Additional query parameters for the data request. |
12
- | `...` | - | - | Supports all `ele-pro-table` props. |
7
+ ```vue
8
+ <template>
9
+ <sohelp-table ref="tableRef" refid="demo_table" url="/api/data/list">
10
+ <template #action="{ row }">
11
+ <el-button size="small" @click="handleEdit(row)">编辑</el-button>
12
+ </template>
13
+ </sohelp-table>
14
+ </template>
13
15
 
14
- ## Slots
16
+ <script setup>
17
+ import { ref } from 'vue';
18
+ const tableRef = ref(null);
19
+ </script>
20
+ ```
15
21
 
16
- | Name | Description |
17
- | :--- | :--- |
18
- | `toolbar` | Custom content for the table toolbar. Scope: `{ row }`. |
19
- | `action` | Custom content for the action column. Scope: `{ row }`. |
20
- | `...` | - | Passes through all slots supported by `ele-pro-table`. |
22
+ ## 属性 (Props)
21
23
 
22
- ## Methods
24
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
25
+ | --- | --- | --- | --- | --- |
26
+ | refid | String | `''` | 是 | 网格列表配置ID,用于从后端加载列配置 |
27
+ | url | String | `''` | 否 | 数据源请求URL |
28
+ | where | Object | `{}` | 否 | 额外的查询条件参数 |
23
29
 
24
- | Name | Description |
25
- | :--- | :--- |
26
- | `reload(param)` | Reloads the table data. |
27
- | `getData()` | Returns the current table data. |
28
- | `getTableRef()` | Returns the underlying table reference. |
30
+ ## 插槽 (Slots)
29
31
 
30
- ## Usage
32
+ | 插槽名 | 说明 |
33
+ | --- | --- |
34
+ | toolbar | 工具栏区域自定义内容,作用域参数: `{ row }` |
35
+ | action | 操作列自定义内容,作用域参数: `{ row }` |
36
+ | default | 默认插槽,透传到 ele-pro-table |
31
37
 
32
- ```vue
33
- <template>
34
- <sohelp-table refid="user_grid_config" url="/api/users" />
35
- </template>
36
- ```
38
+ ## 公开方法 (Expose)
39
+
40
+ - `reload(param)` - 重新加载表格数据
41
+ - `getData()` - 获取当前表格数据
42
+ - `getTableRef()` - 获取内部 ele-pro-table 实例引用
43
+ - `datasource` - 数据源函数
44
+ - `sohelpConfig` - 表格配置对象
@@ -12,7 +12,7 @@
12
12
  highlight-current-row
13
13
  >
14
14
  <slot>
15
- <template v-for="(slotProps, slotName) in $scopedSlots" :key="slotName">
15
+ <template v-for="(slotProps, slotName) in $slots" :key="slotName">
16
16
  <slot :name="slotName" v-bind="slotProps" />
17
17
  </template>
18
18
  </slot>
@@ -25,125 +25,126 @@
25
25
  </template>
26
26
  </ele-pro-table>
27
27
  </template>
28
- <script>
28
+ <script setup>
29
29
  import { reactive, ref } from 'vue';
30
30
  import { moduleCache } from '../cache/ModuleCache';
31
31
  import { EleMessage } from '@/components/ele-admin-plus/components';
32
32
 
33
- export default {
34
- name: 'SohelpTable',
35
- props: {
36
- /**网格列表配置ID*/
37
- refid: {
38
- type: String,
39
- default: '',
40
- required: true
41
- },
42
- /**数据源URL**/
43
- url: {
44
- type: String,
45
- default: ''
46
- },
47
- /**数据源URL**/
48
- where: {
49
- type: Object,
50
- default: {}
51
- }
33
+ const props = defineProps({
34
+ /**网格列表配置ID*/
35
+ refid: {
36
+ type: String,
37
+ default: '',
38
+ required: true
39
+ },
40
+ /**数据源URL**/
41
+ url: {
42
+ type: String,
43
+ default: ''
52
44
  },
53
- setup(props, { emit }) {
54
- /**列表实例*/
55
- const sohelpTableRef = ref(null);
56
- /**存储表格配置*/
57
- const sohelpConfig = reactive({});
58
- /**在放选中数据列表**/
59
- const selections = ref([]);
60
- /**默认加载数据**/
61
- const loadOnCreated = ref(false);
45
+ /**数据源URL**/
46
+ where: {
47
+ type: Object,
48
+ default: {}
49
+ }
50
+ });
62
51
 
63
- /**自定义列配置 **/
64
- const columns = reactive([
65
- {
66
- type: 'selection',
67
- columnKey: 'selection',
68
- width: 50,
69
- align: 'center',
70
- fixed: 'left'
71
- },
72
- {
73
- type: 'index',
74
- columnKey: 'index',
75
- width: 50,
76
- align: 'center',
77
- fixed: 'left'
78
- }
79
- ]);
52
+ /**列表实例*/
53
+ const sohelpTableRef = ref(null);
54
+ /**存储表格配置*/
55
+ const sohelpConfig = reactive({});
56
+ /**在放选中数据列表**/
57
+ const selections = ref([]);
58
+ /**默认加载数据**/
59
+ const loadOnCreated = ref(false);
80
60
 
81
- /** 表格数据源 */
82
- const datasource = async ({ page, limit, where, orders }) => {
83
- if (!loadOnCreated.value) {
84
- return { total: 0, results: [] };
85
- }
86
- const res = await SohelpHttp.get(props.url || sohelpConfig.requestValue, {
87
- page,
88
- limit,
89
- ...where,
90
- ...props.where,
91
- orders
92
- }).catch((e) => {
93
- EleMessage.error(e.message);
94
- });
95
- return res.data;
96
- };
61
+ /**自定义列配置 **/
62
+ const columns = reactive([
63
+ {
64
+ type: 'selection',
65
+ columnKey: 'selection',
66
+ width: 50,
67
+ align: 'center',
68
+ fixed: 'left'
69
+ },
70
+ {
71
+ type: 'index',
72
+ columnKey: 'index',
73
+ width: 50,
74
+ align: 'center',
75
+ fixed: 'left'
76
+ }
77
+ ]);
78
+
79
+ /** 表格数据源 */
80
+ const datasource = async ({ page, limit, where, orders }) => {
81
+ if (!loadOnCreated.value) {
82
+ return { total: 0, results: [] };
83
+ }
84
+ const res = await SohelpHttp.get(props.url || sohelpConfig.requestValue, {
85
+ page,
86
+ limit,
87
+ ...where,
88
+ ...props.where,
89
+ orders
90
+ }).catch((e) => {
91
+ EleMessage.error(e.message);
92
+ });
93
+ if (!res) return;
94
+ return res.data;
95
+ };
97
96
 
98
- /**根据配置列转成ProTable格式的列*/
99
- const switchProperty = (property) => {
100
- return {
101
- prop: property.name,
102
- columnKey: property.name,
103
- label: property.label,
104
- width: property.width || 100
105
- };
106
- };
97
+ /**根据配置列转成ProTable格式的列*/
98
+ const switchProperty = (property) => {
99
+ return {
100
+ prop: property.name,
101
+ columnKey: property.name,
102
+ label: property.label,
103
+ width: property.width || 100
104
+ };
105
+ };
107
106
 
108
- /***初始化网格列表配置**/
109
- const initProTableConfiguration = (cfg) => {
110
- loadOnCreated.value = true;
111
- reload();
112
- };
113
- /**获取列表配置*/
114
- moduleCache.getGrid(props.refid).then((data) => {
115
- Object.assign(sohelpConfig, { ...data });
116
- //初始化属性列表配置
117
- data.properties.map((property) => {
118
- columns.push(switchProperty(property));
119
- });
120
- /**添加操作列**/
121
- columns.push({
122
- field: 'action',
123
- label: '操作',
124
- width: 200,
125
- align: 'center',
126
- slot: 'action'
127
- });
128
- //初始化表格配置
129
- initProTableConfiguration();
130
- });
107
+ /***初始化网格列表配置**/
108
+ const initProTableConfiguration = (cfg) => {
109
+ loadOnCreated.value = true;
110
+ reload();
111
+ };
112
+ /**获取列表配置*/
113
+ moduleCache.getGrid(props.refid).then((data) => {
114
+ Object.assign(sohelpConfig, { ...data });
115
+ //初始化属性列表配置
116
+ data.properties.map((property) => {
117
+ columns.push(switchProperty(property));
118
+ });
119
+ /**添加操作列**/
120
+ columns.push({
121
+ field: 'action',
122
+ label: '操作',
123
+ width: 200,
124
+ align: 'center',
125
+ slot: 'action'
126
+ });
127
+ //初始化表格配置
128
+ initProTableConfiguration();
129
+ });
131
130
 
132
- const reload = (param) => {
133
- sohelpTableRef.value?.reload?.(param);
134
- };
135
- const getData = () => {
136
- return sohelpTableRef.value?.getData?.();
137
- };
138
- const getTableRef = () => {
139
- return sohelpTableRef.value?.getTableRef?.();
140
- };
131
+ const reload = (param) => {
132
+ sohelpTableRef.value?.reload?.(param);
133
+ };
134
+ const getData = () => {
135
+ return sohelpTableRef.value?.getData?.();
136
+ };
137
+ const getTableRef = () => {
138
+ return sohelpTableRef.value?.getTableRef?.();
139
+ };
141
140
 
142
- // defineExpose({
143
- // reload, getData,getTableRef,datasource
144
- // })
145
- return { columns, reload, getData, getTableRef, datasource, selections, sohelpTableRef, sohelpConfig };
146
- }
141
+ defineExpose({
142
+ reload, getData, getTableRef, datasource, sohelpConfig
143
+ });
144
+ </script>
145
+ <script>
146
+ export default {
147
+ name: 'SohelpTable'
147
148
  };
148
149
  </script>
149
150
  <style scoped></style>
@@ -0,0 +1,55 @@
1
+ # SohelpTableSelect 表格弹窗选择器
2
+
3
+ 基于 el-input、sohelp-modal 和 SohelpGridView 封装的弹窗表格选择组件。点击搜索图标弹出模态窗口,内嵌网格列表进行数据选择,支持单选和多选模式,多选时右侧显示已选列表面板。
4
+
5
+ ## 基础用法
6
+
7
+ ```vue
8
+ <template>
9
+ <sohelp-table-select
10
+ v-model="selectedValue"
11
+ v-model:data="selectedData"
12
+ refid="demo_grid"
13
+ labelField="name"
14
+ valueField="id"
15
+ :multiple="true"
16
+ title="选择用户"
17
+ />
18
+ </template>
19
+
20
+ <script setup>
21
+ import { ref } from 'vue';
22
+ const selectedValue = ref([]);
23
+ const selectedData = ref([]);
24
+ </script>
25
+ ```
26
+
27
+ ## 属性 (Props)
28
+
29
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
30
+ | --- | --- | --- | --- | --- |
31
+ | multiple | Boolean | `false` | 否 | 是否允许多选 |
32
+ | placeholder | String | `'请选择'` | 否 | 输入框占位文本 |
33
+ | title | String | `'请选择'` | 否 | 弹窗标题 |
34
+ | valueField | String | `'id'` | 否 | 值字段名 |
35
+ | labelField | String | `'label'` | 否 | 显示文本对应的字段名 |
36
+ | refid | String | `''` | 否 | 网格列表配置ID |
37
+
38
+ ## 双向绑定 (v-model)
39
+
40
+ | 属性名 | 类型 | 说明 |
41
+ | --- | --- | --- |
42
+ | modelValue | String / Array | 绑定值,单选时为字符串,多选时为数组 |
43
+ | data | Object / Array | 已选中的数据对象或数组 |
44
+
45
+ ## 事件 (Events)
46
+
47
+ | 事件名 | 回调参数 | 说明 |
48
+ | --- | --- | --- |
49
+ | change | (selectedList) | 确认选择后触发,参数为选中项列表 |
50
+
51
+ ## 插槽 (Slots)
52
+
53
+ | 插槽名 | 说明 |
54
+ | --- | --- |
55
+ | trigger | 自定义触发器区域,作用域参数: `{ selected }` |
@@ -1,22 +1,8 @@
1
- # SohelpTenantSelect
1
+ # SohelpTenantSelect 租户选择器
2
2
 
3
- A component for selecting tenants using a grid view (`sohelp-vxe-grid-select`). Fetches tenant data from the server.
3
+ 基于 `sohelp-vxe-grid-select` 封装的租户选择组件,以表格弹窗形式展示租户列表,支持分页和多选确认。
4
4
 
5
- ## Props
6
-
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `url` | `String` | `'/engine/web/tenant/page'` | The API URL to fetch tenant data. |
10
- | `title` | `String` | `'选择租户'` | The title of the selection dialog. |
11
- | `...` | - | - | Supports all `sohelp-vxe-grid-select` props. |
12
-
13
- ## Events
14
-
15
- | Name | Parameters | Description |
16
- | :--- | :--- | :--- |
17
- | `confirm` | `(rows: Array)` | Triggered when the user confirms the selection. Returns the selected rows. |
18
-
19
- ## Usage
5
+ ## 基础用法
20
6
 
21
7
  ```vue
22
8
  <template>
@@ -25,7 +11,22 @@ A component for selecting tenants using a grid view (`sohelp-vxe-grid-select`).
25
11
 
26
12
  <script setup>
27
13
  const handleConfirm = (rows) => {
28
- console.log('Selected tenants:', rows);
14
+ console.log('选中的租户:', rows);
29
15
  };
30
16
  </script>
31
17
  ```
18
+
19
+ ## 属性 (Props)
20
+
21
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
22
+ | :--- | :--- | :--- | :--- | :--- |
23
+ | url | String | `'/engine/web/tenant/page'` | 否 | 租户数据分页接口地址 |
24
+ | title | String | `'选择租户'` | 否 | 选择弹窗标题 |
25
+
26
+ > 同时支持所有 `sohelp-vxe-grid-select` 原生属性,通过 `v-bind="$attrs"` 透传。
27
+
28
+ ## 事件 (Events)
29
+
30
+ | 事件名 | 回调参数 | 说明 |
31
+ | :--- | :--- | :--- |
32
+ | confirm | `(rows: Array)` | 用户确认选择后触发,返回选中的行数据数组 |
@@ -1,126 +1,122 @@
1
1
  <template>
2
2
  <sohelp-vxe-grid-select label-field="tenant_name" :title="title" ref="vxeGridSelectRef" v-bind="$attrs" :gridOptions="gridOptions" @show="show" @confirm="confirm"></sohelp-vxe-grid-select>
3
3
  </template>
4
- <script>
4
+ <script setup>
5
5
  import SohelpVxeGridSelect from "../sohelp-vxe-grid-select/index.vue";
6
6
  import { nextTick, reactive, ref } from "vue";
7
7
  import { EleMessage } from "@/components/ele-admin-plus/components";
8
8
 
9
- export default {
10
- name: "SohelpTenantSelect",
11
- components: {SohelpVxeGridSelect},
12
- props:{
13
- url:{
14
- type:String,
15
- default:'/engine/web/tenant/page'
16
- },
17
- title:{
18
- type:String,
19
- default:'选择租户'
20
- }
21
-
9
+ const props = defineProps({
10
+ url:{
11
+ type:String,
12
+ default:'/engine/web/tenant/page'
22
13
  },
23
- setup(props,{emit}){
24
- const vxeGridSelectRef= ref();
25
- const show = (options) => {
26
- SohelpHttp.get(props.url,{}).then(res=>{
27
- if(res.meta.success){
28
- nextTick(()=>{
29
- gridOptions.pagerConfig.total = res.data.total;
30
- vxeGridSelectRef.value.$grid.loadData(res.data.results);
31
- })
14
+ title:{
15
+ type:String,
16
+ default:'选择租户'
17
+ }
18
+ });
19
+
20
+ const emit = defineEmits(['confirm']);
32
21
 
33
- }else{
34
- EleMessage.error(res.meta.message);
35
- }
22
+ const vxeGridSelectRef= ref();
23
+ const show = (options) => {
24
+ SohelpHttp.get(props.url,{}).then(res=>{
25
+ if(res.meta.success){
26
+ nextTick(()=>{
27
+ gridOptions.pagerConfig.total = res.data.total;
28
+ vxeGridSelectRef.value.$grid.loadData(res.data.results);
36
29
  })
37
- }
38
30
 
39
- const confirm = (rows) => {
40
- emit('confirm',rows);
31
+ }else{
32
+ EleMessage.error(res.meta.message);
41
33
  }
34
+ })
35
+ }
42
36
 
43
- /** 表格配置 */
44
- const gridOptions = reactive({
45
- customConfig: {
46
- placement: 'top-right' // 自定义列工具栏位置
47
- },
48
- rowConfig: {
49
- useKey: true,
50
- sHover: true,
51
- isCurrent: true
52
- },
53
- keyboardConfig: {
54
- isEdit: true,
55
- isArrow: true,
56
- isEnter: true,
57
- isTab: true,
58
- isDel: true,
59
- isBack: true
60
- },
61
- mouseConfig: {
62
- selected: false
63
- },
64
- checkboxConfig: {
65
- highlight: true,
66
- range: true
67
- },
68
- pagerConfig: {
69
- enabled: true,
70
- total: 0,
71
- currentPage: 1,
72
- pageSize: 50,
73
- align: 'center'
74
- },
75
- border: true,
76
- stripe: true,
77
- loading: false,
78
- minHeight: 200,
79
- maxHeight: '100%',
80
- size: 'mini',
81
- columnConfig: {
82
- resizable: true
83
- },
84
- columns: [
85
- { field: 'checkbox', fixed: 'left', type: 'checkbox', align: 'center', width: 40 },
86
- {
87
- type: 'seq',
88
- title: '#',
89
- fixe: 'left',
90
- align: 'center',
91
- width: 40
92
- },
93
- {
94
- title: 'id',
95
- width: 200,
96
- field: 'id',
97
- visible: false
98
- },
99
- {
100
- title: '租户',
101
- width: 200,
102
- field: 'tenant_name',
103
- showOverflow: 'tooltip'
104
- }, {
105
- title: '备注',
106
- minWidth: 200,
107
- field: 'comments',
108
- showOverflow: 'tooltip'
109
- }, {
110
- title: '创建日期',
111
- width: 160,
112
- field: 'create_time'
113
- }
114
- ],
115
- data: []
116
- });
117
-
118
-
119
-
120
- return {vxeGridSelectRef,gridOptions,show,confirm}
121
-
122
- }
37
+ const confirm = (rows) => {
38
+ emit('confirm',rows);
123
39
  }
40
+
41
+ /** 表格配置 */
42
+ const gridOptions = reactive({
43
+ customConfig: {
44
+ placement: 'top-right' // 自定义列工具栏位置
45
+ },
46
+ rowConfig: {
47
+ useKey: true,
48
+ sHover: true,
49
+ isCurrent: true
50
+ },
51
+ keyboardConfig: {
52
+ isEdit: true,
53
+ isArrow: true,
54
+ isEnter: true,
55
+ isTab: true,
56
+ isDel: true,
57
+ isBack: true
58
+ },
59
+ mouseConfig: {
60
+ selected: false
61
+ },
62
+ checkboxConfig: {
63
+ highlight: true,
64
+ range: true
65
+ },
66
+ pagerConfig: {
67
+ enabled: true,
68
+ total: 0,
69
+ currentPage: 1,
70
+ pageSize: 50,
71
+ align: 'center'
72
+ },
73
+ border: true,
74
+ stripe: true,
75
+ loading: false,
76
+ minHeight: 200,
77
+ maxHeight: '100%',
78
+ size: 'mini',
79
+ columnConfig: {
80
+ resizable: true
81
+ },
82
+ columns: [
83
+ { field: 'checkbox', fixed: 'left', type: 'checkbox', align: 'center', width: 40 },
84
+ {
85
+ type: 'seq',
86
+ title: '#',
87
+ fixed: 'left',
88
+ align: 'center',
89
+ width: 40
90
+ },
91
+ {
92
+ title: 'id',
93
+ width: 200,
94
+ field: 'id',
95
+ visible: false
96
+ },
97
+ {
98
+ title: '租户',
99
+ width: 200,
100
+ field: 'tenant_name',
101
+ showOverflow: 'tooltip'
102
+ }, {
103
+ title: '备注',
104
+ minWidth: 200,
105
+ field: 'comments',
106
+ showOverflow: 'tooltip'
107
+ }, {
108
+ title: '创建日期',
109
+ width: 160,
110
+ field: 'create_time'
111
+ }
112
+ ],
113
+ data: []
114
+ });
115
+ </script>
116
+ <script>
117
+ export default {
118
+ name: "SohelpTenantSelect"
119
+ };
124
120
  </script>
125
121
 
126
122
  <style scoped>
@@ -1,17 +1,23 @@
1
- # SohelpText
1
+ # SohelpText 文本展示
2
2
 
3
- A simple text display component that wraps `ele-text` and enables word limit display.
3
+ 基于 `ele-text` 封装的文本展示组件,默认开启字数统计显示。
4
4
 
5
- ## Props
6
-
7
- | Name | Type | Default | Description |
8
- | :--- | :--- | :--- | :--- |
9
- | `...` | - | - | Supports all `ele-text` props. |
10
-
11
- ## Usage
5
+ ## 基础用法
12
6
 
13
7
  ```vue
14
8
  <template>
15
- <sohelp-text>Some text content</sohelp-text>
9
+ <sohelp-text>这是一段文本内容</sohelp-text>
16
10
  </template>
17
11
  ```
12
+
13
+ ## 属性 (Props)
14
+
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
16
+ | :--- | :--- | :--- | :--- | :--- |
17
+ | - | - | - | - | 支持通过 `v-bind="$attrs"` 透传所有 `ele-text` 原生属性 |
18
+
19
+ ## 插槽 (Slots)
20
+
21
+ | 插槽名 | 说明 |
22
+ | :--- | :--- |
23
+ | default | 文本内容 |