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,379 @@
1
+ <script setup>
2
+ import { computed, reactive, ref, watch } from 'vue';
3
+ import { useMobile } from '@/utils/use-mobile';
4
+ import SohelpFilter from './filter/index.vue';
5
+ import SohelpGrid from '@/components/sohelp-eleplus/sohelp-grid/index.vue';
6
+ // 属性映射
7
+ const propertiesMap = ref({});
8
+ const { mobile } = useMobile();
9
+
10
+ // grid配置
11
+ const props = defineProps({
12
+ refid: { type: String, default: '' },
13
+ autoLoad: { type: Boolean, default: true },
14
+ filterValue: {
15
+ type: Object,
16
+ default: () => ({
17
+ keywords: '',
18
+ power: 0,
19
+ filter: [],
20
+ scheme: '',
21
+ sort: '',
22
+ order: ''
23
+ })
24
+ }
25
+ });
26
+
27
+ const emit = defineEmits([
28
+ 'menuRightClick',
29
+ 'toolbarButtonClick',
30
+ 'operationButtonClick',
31
+ 'changeFilterScheme',
32
+ 'editClosed',
33
+ 'currentColumnChange'
34
+ ]);
35
+
36
+ // grid实例
37
+ const sohelpGridRef = ref(null);
38
+
39
+ const filterValue = defineModel('filterValue', {
40
+ type: Object,
41
+ default: () => ({
42
+ keywords: '',
43
+ power: 0,
44
+ filter: [],
45
+ scheme: '',
46
+ sort: '',
47
+ order: ''
48
+ })
49
+ });
50
+
51
+ const _filterValue = ref(filterValue.value);
52
+
53
+ /**是否显示高级过滤,默认为关闭高级过滤 */
54
+ const splitConfig = reactive({
55
+ size: 'auto',
56
+ space: '10px',
57
+ allowCollapse: false,
58
+ resizable: false,
59
+ reverse: false,
60
+ vertical: true,
61
+ style: {
62
+ height: '100%'
63
+ },
64
+ customStyle: {
65
+ overflow: 'hidden'
66
+ }
67
+ });
68
+
69
+ const sohelpConfig = defineModel('config', {
70
+ type: Object,
71
+ default: () => ({
72
+ filter: {
73
+ config: {}
74
+ }
75
+ })
76
+ });
77
+
78
+ /**
79
+ * 分割器配置
80
+ */
81
+ const getSplitConfig = computed(() => {
82
+ if (sohelpConfig.value.filter?.config) {
83
+ const visible = sohelpConfig.value?.filter?.config?.visibleFilter || false;
84
+ const position = sohelpConfig.value?.filter?.config?.filterPosition || 'NONE';
85
+
86
+ splitConfig.reverse = position !== 'TOP';
87
+ splitConfig.vertical = position === 'TOP';
88
+ splitConfig.resizable = visible;
89
+ splitConfig.size = {
90
+ TOP: 'auto',
91
+ MODAL: '0',
92
+ NONE: '0',
93
+ RIGHT: '260PX'
94
+ }[position];
95
+
96
+ if (!visible) {
97
+ splitConfig.size = '0';
98
+ }
99
+ if (mobile.value && position === 'RIGHT') {
100
+ splitConfig.allowCollapse = true;
101
+ } else {
102
+ splitConfig.allowCollapse = false;
103
+ }
104
+ return splitConfig;
105
+ }
106
+ });
107
+
108
+ //工具栏按钮点击事件
109
+ const toolbarButtonClick = (config) => {
110
+ emit('toolbarButtonClick', config);
111
+ };
112
+ //右击菜单按钮点击事件
113
+ const menuRightClick = (config) => {
114
+ emit('menuRightClick', config);
115
+ };
116
+ //操作按钮点击事件
117
+ const operationButtonClick = (config) => {
118
+ emit('operationButtonClick', config);
119
+ };
120
+ //编辑后事件
121
+ const editClosed = (props) => {
122
+ emit('editClosed', props);
123
+ };
124
+
125
+ const currentColumnChange = (props) => {
126
+ emit('currentColumnChange', props);
127
+ };
128
+
129
+ /**
130
+ * 查询数据
131
+ * @param param 区分是高级筛选,还是列筛选
132
+ */
133
+ const reload = (param = {}, callback) => {
134
+ sohelpGridRef.value.reload(param, callback);
135
+ };
136
+ const load = (param = {}, callback) => {
137
+ sohelpGridRef.value.load(param, callback);
138
+ };
139
+ const refresh = () => {
140
+ sohelpGridRef.value.refresh();
141
+ };
142
+
143
+ const changeFilterScheme = (schemeValue, filterValue) => {
144
+ emit('changeFilterScheme', schemeValue, filterValue);
145
+ };
146
+ /**
147
+ * 关闭高级筛选面板
148
+ */
149
+ const closeFilter = () => {
150
+ sohelpConfig.value.filter.config.visibleFilter = false;
151
+ };
152
+ /**
153
+ * 显示高级筛选
154
+ */
155
+ const showFilter = () => {
156
+ sohelpConfig.value.filter.config.visibleFilter = !(sohelpConfig.value.filter?.config?.visibleFilter ?? false);
157
+ };
158
+ /**
159
+ * 重置查询
160
+ */
161
+ const resetFilter = () => {
162
+ sohelpGridRef.value?.resetFilter();
163
+ };
164
+ /**
165
+ * 查询数据
166
+ */
167
+ const filter = (val) => {
168
+ sohelpGridRef.value.reload({});
169
+ };
170
+
171
+ const getCrudUpdater = () => {
172
+ return sohelpGridRef.value?.getCrudUpdater();
173
+ };
174
+ //保存配置后,自动重新加载一次
175
+ const save = () => {
176
+ sohelpGridRef.value?.loadConfig();
177
+ };
178
+
179
+ const validate = async () => {
180
+ const $grid = sohelpGridRef.value;
181
+ if ($grid) {
182
+ const errMap = await $grid?.validate();
183
+ if (errMap) {
184
+ return Promise.reject(errMap);
185
+ }
186
+ return Promise.resolve();
187
+ }
188
+ };
189
+
190
+ const getSelection = () => {
191
+ return sohelpGridRef.value?.selections;
192
+ };
193
+
194
+ watch(
195
+ _filterValue,
196
+ (val) => {
197
+ Object.assign(filterValue.value, val);
198
+ },
199
+ {
200
+ immediate: true,
201
+ deep: true
202
+ }
203
+ );
204
+
205
+ defineExpose({
206
+ getSelection,
207
+ getCrudUpdater,
208
+ reload,
209
+ load,
210
+ refresh,
211
+ validate
212
+ });
213
+ </script>
214
+ <script>
215
+ export default {
216
+ name: 'SohelpGridView'
217
+ };
218
+ </script>
219
+ <template>
220
+ <div class="sohelp-grid-view">
221
+ <ele-split-panel v-bind="getSplitConfig" flex-table>
222
+ <!--高级筛选-->
223
+ <sohelp-filter
224
+ @change="change"
225
+ v-if="sohelpConfig.filter?.config?.visibleFilter"
226
+ @filter="filter"
227
+ @close="closeFilter"
228
+ @save="save"
229
+ v-model:filterValue="_filterValue"
230
+ v-model:config="sohelpConfig"
231
+ @reset="resetFilter"
232
+ @change-filter-scheme="changeFilterScheme"
233
+ :propertiesMap="propertiesMap"
234
+ >
235
+ </sohelp-filter>
236
+ <template #body>
237
+ <!--数据列表-->
238
+ <sohelp-grid
239
+ ref="sohelpGridRef"
240
+ :refid="refid"
241
+ v-model:config="sohelpConfig"
242
+ @resetFilter="resetFilter"
243
+ v-model:propertiesMap="propertiesMap"
244
+ v-model:filterValue="_filterValue"
245
+ :autoLoad="autoLoad"
246
+ @showFilter="showFilter"
247
+ @menuRightClick="menuRightClick"
248
+ @toolbarButtonClick="toolbarButtonClick"
249
+ @operationButtonClick="operationButtonClick"
250
+ @editClosed="editClosed"
251
+ @currentColumnChange="currentColumnChange"
252
+ ></sohelp-grid>
253
+ </template>
254
+ </ele-split-panel>
255
+ </div>
256
+ </template>
257
+ <style lang="scss" scoped>
258
+ .sohelp-grid-view {
259
+ padding: 0px;
260
+ display: flex;
261
+ height: 100%;
262
+ flex-direction: column;
263
+
264
+ .toolbar-box {
265
+ display: flex;
266
+ gap: 10px;
267
+ flex-wrap: wrap;
268
+
269
+ .tools-btns {
270
+ display: flex;
271
+ gap: 10px;
272
+ margin-right: 10px;
273
+
274
+ .el-button {
275
+ margin-left: 0 !important;
276
+ }
277
+ }
278
+ }
279
+
280
+ .ele-split-panel {
281
+ :deep(.ele-split-panel-side) {
282
+ border: none !important;
283
+ }
284
+ }
285
+
286
+ .vxe-grid {
287
+ height: 100%;
288
+
289
+ :deep(.vxe-grid--layout-body-content-wrapper) {
290
+ display: flex;
291
+ flex-direction: column;
292
+
293
+ .vxe-grid--table-container {
294
+ flex: 1;
295
+ }
296
+ }
297
+
298
+ :deep(.col--SohelpImageUpload) {
299
+ .vxe-cell--wrapper {
300
+ overflow: initial !important;
301
+ }
302
+ }
303
+
304
+ :deep(.vxe-table--render-default) {
305
+ .vxe-body--row.row--stripe > .vxe-body--column {
306
+ // background-color: transparent;
307
+ }
308
+ }
309
+ }
310
+ }
311
+
312
+ .sort-list :deep(.el-button:focus),
313
+ .sort-list :deep(.el-button:hover) {
314
+ background-color: #e8f1ff !important;
315
+ color: #1677ff !important;
316
+ }
317
+
318
+ .filter-header {
319
+ border-bottom: 1px solid #ddd;
320
+ display: flex;
321
+ width: 100%;
322
+ height: 35px;
323
+ line-height: 40px;
324
+ box-sizing: border-box;
325
+ margin: 0 0 0 10px;
326
+ }
327
+
328
+ .sohelp-grid-view.right {
329
+ .ele-split-panel {
330
+ :deep(.ele-split-panel-side) {
331
+ height: 100% !important;
332
+ border: 0;
333
+ display: flex;
334
+ flex-direction: column;
335
+ border-left: 1px solid #ddd !important;
336
+ }
337
+ }
338
+ }
339
+
340
+ :deep(.tooltip-btn) {
341
+ margin-left: 5px;
342
+ height: 22px;
343
+ line-height: 22px;
344
+ margin-top: 2px;
345
+ padding: 0px 5px !important;
346
+ }
347
+
348
+ :deep(.vxe-cell--wrapper) {
349
+ height: 100%;
350
+ }
351
+
352
+ .textarea-reference {
353
+ display: flex;
354
+ height: 100%;
355
+ }
356
+
357
+ :deep(.ele-split-panel.is-vertical) {
358
+ .ele-split-panel-wrap > .ele-split-panel-space .ele-split-resize-line::after {
359
+ background: #eee;
360
+ }
361
+ }
362
+
363
+ .condition-box {
364
+ padding: 10px;
365
+ }
366
+
367
+ .sohelp-filter-card.right {
368
+ height: 100%;
369
+ overflow: hidden;
370
+
371
+ :deep(.ele-card-header) {
372
+ min-width: 230px;
373
+ }
374
+
375
+ :deep(.ele-card-body) {
376
+ height: 100% !important;
377
+ }
378
+ }
379
+ </style>
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <!-- 输入框组件,用于展示已选中的标签项,并提供打开选择弹窗的按钮 -->
3
+ <el-input >
4
+ <!-- 前缀插槽:显示当前已选中项的标签列表 -->
5
+ <template #prefix>
6
+ <el-tag v-for="item in _data" :key="item.id" closable @close="handleClose(item)">{{ item[labelField] }}</el-tag>
7
+ </template>
8
+ <!-- 后缀插槽:添加按钮,点击后打开数据选择弹窗 -->
9
+ <template #append>
10
+ <el-button icon="Plus" @click="showDialog" />
11
+ </template>
12
+ </el-input>
13
+ <!-- 数据选择弹窗组件 -->
14
+ <ele-modal title="选择数据" v-model="visible" maxable>
15
+ <!-- 表格视图组件,用于展示可选项 -->
16
+ <sohelp-grid-view :refid="refid" ref="tableRef" />
17
+ <!-- 弹窗底部操作按钮区域 -->
18
+ <template #footer>
19
+ <el-button @click="cancel">取消</el-button>
20
+ <el-button type="primary" @click="confirm">确定</el-button>
21
+ </template>
22
+ </ele-modal>
23
+ </template>
24
+ <script setup>
25
+ import { computed, ref } from "vue";
26
+
27
+ /**
28
+ * 组件属性定义
29
+ * @property {Array|String} modelValue - 当前绑定的值(支持单选或多选)
30
+ * @property {String} refid - 必填字段,标识引用ID
31
+ * @property {Boolean} multiple - 是否允许多选,默认为false
32
+ * @property {Object|Array} data - 已选中的数据对象或数组
33
+ * @property {String} labelField - 显示文本对应的字段名,默认"label"
34
+ * @property {String} valueField - 值字段名,默认"id"
35
+ */
36
+ const props = defineProps({
37
+ modelValue: {
38
+ type: [String, Array],
39
+ default: () => []
40
+ },
41
+ refid: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ multiple: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ data: [Object, Array],
50
+ labelField: {
51
+ type: String,
52
+ default: "label"
53
+ },
54
+ valueField: {
55
+ type: String,
56
+ default: "id"
57
+ }
58
+
59
+ });
60
+ /**
61
+ * 创建一个ref对象,用于存储表格视图组件的引用
62
+ */
63
+ const tableRef = ref(null);
64
+
65
+ /**
66
+ * 定义事件发射器
67
+ * @event update:modelValue - 更新modelValue时触发
68
+ * @event update:data - 更新data时触发
69
+ * @event confirm - 用户确认选择时触发
70
+ */
71
+ const emit = defineEmits(["update:modelValue", "update:data", "confirm","show"]);
72
+
73
+ // 控制弹窗是否可见的状态变量
74
+ const visible = ref(false);
75
+
76
+ /**
77
+ * 打开对话框
78
+ */
79
+ const showDialog = () => {
80
+ visible.value = true;
81
+ };
82
+
83
+ /**
84
+ * 计算属性:处理传入的数据格式统一转换为数组形式
85
+ * @returns {Array} 返回标准化后的数组数据
86
+ */
87
+ const _data = computed(() => {
88
+ return props.data?.constructor === Object ? [props.data] : props.data;
89
+ });
90
+
91
+ /**
92
+ * 关闭标签
93
+ * @param tag - 被关闭的标签项
94
+ */
95
+ const handleClose = (tag) => {
96
+ if(props.multiple) {
97
+ props.data.splice(props.data.indexOf(tag), 1);
98
+ }else{
99
+ emit("update:modelValue", null);
100
+ emit("update:data", null);
101
+ }
102
+ };
103
+
104
+ /**
105
+ * 取消操作并关闭弹窗
106
+ */
107
+ const cancel = () => {
108
+ visible.value = false;
109
+ };
110
+
111
+ /**
112
+ * 确认选择操作
113
+ * 根据multiple属性决定是单选还是多选模式,
114
+ * 并通过emit更新modelValue、data以及发送confirm事件
115
+ */
116
+ const confirm = () => {
117
+ const rows = tableRef.value.getSelection();
118
+ if (props.multiple) {
119
+ let _data = [];
120
+ for (let i = 0; i < rows.length; i++) {
121
+ let obj = {};
122
+ obj[props.valueField] = rows[i][props.valueField];
123
+ obj[props.labelField] = rows[i][props.labelField];
124
+ _data.push(obj);
125
+ }
126
+ emit("update:modelValue", _data.map((item) => item[props.valueField]));
127
+ emit("update:data", _data);
128
+ emit("confirm", rows);
129
+ } else {
130
+ emit("update:modelValue", rows.length > 0 ? rows[0][props.valueField] : null);
131
+ emit("update:data", rows[0]);
132
+ emit("confirm", rows[0]);
133
+ }
134
+ visible.value = false;
135
+ };
136
+
137
+ </script>
138
+ <style scoped>
139
+
140
+ </style>
141
+
@@ -0,0 +1,11 @@
1
+ <script setup>
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <div>按状态分组视图</div>
7
+ </template>
8
+
9
+ <style scoped lang="scss">
10
+
11
+ </style>
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <el-select
3
+ v-model="modelValue"
4
+ placeholder="请选择图标"
5
+ filterable
6
+ class="sohelp-icon-select"
7
+ width="100%"
8
+ style="min-width: 60px"
9
+ clearable
10
+ >
11
+ <template #prefix>
12
+ <el-icon :size="14" color="#666" style="margin-right: 5px">
13
+ <component :is="ElementPlusIcons[modelValue]" v-if="ElementPlusIcons[modelValue]" />
14
+ <component :is="EleAdminPlusIcons[modelValue]" v-else-if="EleAdminPlusIcons[modelValue]" />
15
+ <span :class="modelValue" v-else></span>
16
+ </el-icon>
17
+ </template>
18
+ <el-option-group v-for="group in iconData" :key="group.label" :label="group.label">
19
+ <div class="icon-box">
20
+ <el-option
21
+ v-for="item in group.options"
22
+ :key="item.value"
23
+ :label="item.label"
24
+ :value="item.value"
25
+ class="icon-item"
26
+ >
27
+ <el-tooltip :content="item.label" placement="top">
28
+ <el-icon :size="16" color="#666">
29
+ <component :is="ElementPlusIcons[item.value]" v-if="ElementPlusIcons[item.value]" />
30
+ <component :is="EleAdminPlusIcons[item.value]" v-else-if="EleAdminPlusIcons[item.value]" />
31
+ <span :class="item.value" v-else></span>
32
+ </el-icon>
33
+ </el-tooltip>
34
+ </el-option>
35
+ </div>
36
+ </el-option-group>
37
+ </el-select>
38
+ </template>
39
+
40
+ <script setup>
41
+ import { ref } from 'vue';
42
+ import * as ElementPlusIcons from '@element-plus/icons-vue';
43
+ import * as EleAdminPlusIcons from '@/components/icons';
44
+ import { VxeIcon } from './vxeui-icon.js';
45
+ const modelValue = defineModel('modelValue');
46
+ const iconData = ref([]);
47
+
48
+ // 创建一个通用函数来生成选项数据
49
+ const generateOptions = (icons) => {
50
+ return Object.keys(icons).map((key) => ({
51
+ label: key,
52
+ value: key
53
+ }));
54
+ };
55
+
56
+ // 初始化图标数据
57
+ iconData.value = [
58
+ {
59
+ label: 'ElementPlus',
60
+ options: generateOptions(ElementPlusIcons)
61
+ },
62
+ {
63
+ label: 'EleAdminPlus',
64
+ options: generateOptions(EleAdminPlusIcons)
65
+ },
66
+ {
67
+ label: 'VxeUI',
68
+ options: generateOptions(VxeIcon)
69
+ }
70
+ ];
71
+ console.log(iconData.value);
72
+ </script>
73
+ <script>
74
+ export default {
75
+ name: 'SohelpIconSelect'
76
+ };
77
+ </script>
78
+ <style lang="scss">
79
+ .icon-box {
80
+ box-sizing: border-box;
81
+ padding: 10px;
82
+ display: flex;
83
+ align-items: center;
84
+ gap: 8px;
85
+ width: 100%;
86
+ height: auto;
87
+ flex-wrap: wrap;
88
+ .icon-item {
89
+ width: 36px !important;
90
+ height: 36px !important;
91
+ border: 1px solid #eee;
92
+ padding: 0 8px !important;
93
+ text-align: center !important;
94
+ }
95
+ }
96
+ </style>