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,68 @@
1
+ /**
2
+ * 属性
3
+ */
4
+ export const prop = {
5
+ dict: {
6
+ type: String,
7
+ required: true
8
+ },
9
+
10
+ type: {
11
+ type: String,
12
+ default: 'select'
13
+ },
14
+
15
+ mappingFields:{
16
+ type: Object,
17
+ default: () => {
18
+ return {
19
+ label: 'label',
20
+ value: 'value'
21
+ }
22
+ }
23
+ },
24
+
25
+ width: {
26
+ type: String,
27
+ default: '200px'
28
+ },
29
+
30
+ placeholder: {
31
+ type: String,
32
+ default: '请选择'
33
+ },
34
+ modelValue: {
35
+ type: Array || String || Number,
36
+ default: String,
37
+ required: true
38
+ },
39
+ filterable: {
40
+ type: Boolean,
41
+ default: true
42
+ },
43
+ clearable: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ size: {
52
+ type: String,
53
+ validator: function (value) {
54
+ return ['large', 'default', 'small', ''].includes(value);
55
+ },
56
+ default: 'default'
57
+ },
58
+ multiple: {
59
+ type: Boolean,
60
+ default: false
61
+ }
62
+ };
63
+
64
+ /**
65
+ * 事件
66
+ */
67
+
68
+ export const emit = ['update:modelValue','change'];
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <div class="sohelp-dyn-select" v-if="selectData">
3
+ <ele-text v-if="readonly">
4
+ <ele-text>
5
+ {{ getLabel }}
6
+ </ele-text>
7
+ </ele-text>
8
+ <sohelp-select
9
+ v-else
10
+ v-model="value"
11
+ :datasource="selectData"
12
+ v-bind="$attrs"
13
+ :labelField="labelField"
14
+ :valueField="valueField"
15
+ />
16
+
17
+ </div>
18
+ </template>
19
+ <script>
20
+ import { computed, reactive, ref, onMounted, watch } from 'vue';
21
+ import { ElMessage } from 'element-plus';
22
+ import SohelpSelect from '../sohelp-select/index.vue';
23
+
24
+ export default {
25
+ name: 'SohelpDynSelect',
26
+ components: { SohelpSelect },
27
+ props: {
28
+ datasource: {
29
+ type: [Array, Function, Promise],
30
+ required: true
31
+ },
32
+ url: {
33
+ type: String,
34
+ required: true
35
+ },
36
+ readonly: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ labelField: String,
41
+ valueField: String,
42
+ modelValue: [String, Number, Array, Object]
43
+ },
44
+ setup(props, { emit, attrs }) {
45
+ const value = ref('');
46
+ const selectData = ref(null);
47
+
48
+ onMounted(async () => {
49
+ if (Array.isArray(props.datasource)) {
50
+ selectData.value = props.datasource;
51
+ } else if (typeof props.datasource === 'function') {
52
+ const result = await props.datasource();
53
+ selectData.value = result;
54
+ } else if (props.datasource instanceof Promise) {
55
+ const result = await props.datasource;
56
+ selectData.value = result;
57
+ } else {
58
+ load();
59
+ }
60
+ });
61
+
62
+ const load = async () => {
63
+ if (props.url && props?.url?.length > 0) {
64
+ const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
65
+ ElMessage.error(err.message || 'error');
66
+ });
67
+
68
+ if (res?.data?.length > 0) {
69
+ selectData.value = res.data;
70
+ }
71
+ }
72
+ };
73
+
74
+ /**
75
+ * 获取label
76
+ */
77
+ const getLabel = computed(() => {
78
+ return selectData.value.find((item) => item.id === props.modelValue)?.[props.labelField];
79
+ });
80
+
81
+ watch(
82
+ () => props.modelValue,
83
+ (val) => {
84
+ value.value = val;
85
+ },{
86
+ immediate: true,
87
+ deep: true
88
+ }
89
+ );
90
+
91
+ return {
92
+ value,
93
+ getLabel,
94
+ selectData
95
+ };
96
+ }
97
+ };
98
+ </script>
99
+ <style></style>
@@ -0,0 +1,67 @@
1
+ /**
2
+ * 属性
3
+ */
4
+ export const prop = {
5
+ url: {
6
+ type: String,
7
+ required: true
8
+ },
9
+
10
+
11
+ mappingFields:{
12
+ type: Object,
13
+ default: () => {
14
+ return {
15
+ label: 'label',
16
+ value: 'value'
17
+ }
18
+ }
19
+ },
20
+
21
+ width: {
22
+ type: String,
23
+ default: '200px'
24
+ },
25
+
26
+ placeholder: {
27
+ type: String,
28
+ default: '请选择'
29
+ },
30
+ modelValue: {
31
+ type: Array || String || Number,
32
+ required: true
33
+ },
34
+ filterable: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ clearable: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ disabled: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ size: {
47
+ type: String,
48
+ validator: function (value) {
49
+ return ['large', 'default', 'small', ''].includes(value);
50
+ },
51
+ default: 'default'
52
+ },
53
+ multiple: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ type: {
58
+ type: String,
59
+ default: 'select'
60
+ }
61
+ };
62
+
63
+ /**
64
+ * 事件
65
+ */
66
+
67
+ export const emit = ['update:modelValue','change'];
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <sohelp-tree
3
+ v-bind="$attrs"
4
+ :data="dataValue"
5
+ :props="defaultProps"
6
+ @node-click="handleNodeClick"
7
+ ></sohelp-tree>
8
+ </template>
9
+ <script>
10
+ import { onMounted, ref } from 'vue';
11
+ import SohelpTree from '../sohelp-tree/index.vue';
12
+ import { toTree } from '../utils/core.js';
13
+ export default {
14
+ name: 'SohelpDynTree',
15
+ components: {SohelpTree},
16
+ props: {
17
+ url: {
18
+ type: String,
19
+ required: true
20
+ },
21
+ valueField: {
22
+ type: String,
23
+ default: 'id'
24
+ },
25
+ labelField: {
26
+ type: String,
27
+ default: 'org_name'
28
+ },
29
+ parentField: {
30
+ type: String,
31
+ default: 'parent_id'
32
+ }
33
+ },
34
+ emits: ['node-click'],
35
+ setup(props, { emit }) {
36
+ const dataValue = ref([]);
37
+ onMounted(async () => {
38
+ if (props.url && props?.url?.length > 0) {
39
+ const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
40
+ ElMessage.error(err.message || 'error');
41
+ });
42
+ if (res?.data) {
43
+ if (res?.data.length > 0) {
44
+ // 根据数据构建树形结构
45
+ const { labelField, valueField, parentField } = props;
46
+ let data = toTree({
47
+ data: res.data.map((item) => ({
48
+ label: item[labelField] ?? '',
49
+ id: item[valueField] ?? '',
50
+ parent_id: item[parentField] ?? ''
51
+ })),
52
+ idField: valueField,
53
+ parentIdField: parentField,
54
+ childrenField: 'children',
55
+ labelField
56
+ });
57
+ dataValue.value = data;
58
+ }
59
+ }
60
+ } else {
61
+ dataValue.value = [];
62
+ }
63
+ });
64
+
65
+ const defaultProps = {
66
+ children: 'children',
67
+ label: 'label'
68
+ };
69
+
70
+ const handleNodeClick = (data, node, el) => {
71
+ emit('node-click', data, node, el);
72
+ };
73
+
74
+ return {
75
+ dataValue,
76
+ handleNodeClick,
77
+ defaultProps
78
+ };
79
+ }
80
+ };
81
+ </script>
82
+ <style scoped></style>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <ele-tree-select
3
+ ref="dynTreeSelectRef"
4
+ v-bind="$attrs"
5
+ v-model="selectedValue"
6
+ :tree-props="treeProps"
7
+ @change="handleChange"
8
+ />
9
+ </template>
10
+ <script>
11
+ import { reactive, onMounted, ref } from 'vue';
12
+ import { toTree } from '../utils/core.js';
13
+
14
+ export default {
15
+ name: 'SohelpDynTreeSelect',
16
+ props: {
17
+ url: {
18
+ type: String,
19
+ default: '/engine/web/org/list',
20
+ required: true
21
+ },
22
+ valueField: {
23
+ type: String,
24
+ default: 'id'
25
+ },
26
+ labelField: {
27
+ type: String,
28
+ default: 'org_name'
29
+ },
30
+ parentField: {
31
+ type: String,
32
+ default: 'parent_id'
33
+ },
34
+ highlightCurrent: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ expandOnClickNode: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ defaultExpandedKeys: {
43
+ type: Array,
44
+ default: []
45
+ },
46
+ checkStrictly: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ height: {
51
+ type: String,
52
+ default: '255'
53
+ },
54
+ modelValue: {
55
+ type: [String, Number, Array],
56
+ required: true
57
+ }
58
+ },
59
+ emits: ['update:modelValue'],
60
+ setup(props, { emit, attrs }) {
61
+ const treeProps = reactive({
62
+ height: 255,
63
+ data: [],
64
+ expandOnclickNode: false,
65
+ highlightCurrent: false,
66
+ checkStrictly: false,
67
+ defaultExpandedKeys: [],
68
+ checkOnClickNode: true,
69
+ nodeKey: 'id'
70
+ });
71
+
72
+ const selectedValue = ref();
73
+
74
+ onMounted(async () => {
75
+ // 初始化树形结构数据
76
+ treeProps.height = Number(props.height);
77
+ treeProps.expandOnclickNode = props.expandOnClickNode;
78
+ treeProps.highlightCurrent = props.highlightCurrent;
79
+ treeProps.checkStrictly = props.checkStrictly;
80
+ treeProps.defaultExpandedKeys =
81
+ props.defaultExpandedKeys?.length > 0 ? props.defaultExpandedKeys.split(',').filter((item) => item) : [];
82
+
83
+ if (props.url && props?.url?.length > 0) {
84
+ const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
85
+ ElMessage.error(err.message || 'error');
86
+ });
87
+ if (res?.data) {
88
+ if (res?.data.length > 0) {
89
+ // 根据数据构建树形结构
90
+ const { labelField, valueField, parentField } = props;
91
+ treeProps.data = toTree({
92
+ data: res.data.map((item) => ({
93
+ label: item[labelField] ?? '',
94
+ id: item[valueField] ?? '',
95
+ parent_id: item[parentField] ?? ''
96
+ })),
97
+ idField: valueField,
98
+ parentIdField: parentField,
99
+ childrenField: 'children',
100
+ labelField
101
+ });
102
+ }
103
+ }
104
+ }
105
+ });
106
+
107
+ return {
108
+ treeProps,
109
+ selectedValue
110
+ };
111
+ }
112
+ };
113
+ </script>
114
+ <style></style>