sohelp-eleplus 1.1.1-8.beta.1
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.
- package/README.md +35 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +322 -0
- package/components.js +46 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +206 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +50 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1965 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +145 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +525 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +446 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/icons/AnalysisOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ApplicationOutlined.vue +21 -0
- package/sohelp-icon-select/icons/AppstoreAddOutlined.vue +28 -0
- package/sohelp-icon-select/icons/AppstoreOutlined.vue +30 -0
- package/sohelp-icon-select/icons/ArrowDown.vue +21 -0
- package/sohelp-icon-select/icons/ArrowDownOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowLeft.vue +21 -0
- package/sohelp-icon-select/icons/ArrowLeftOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowRight.vue +21 -0
- package/sohelp-icon-select/icons/ArrowRightOutlined.vue +20 -0
- package/sohelp-icon-select/icons/ArrowUp.vue +21 -0
- package/sohelp-icon-select/icons/ArrowUpOutlined.vue +20 -0
- package/sohelp-icon-select/icons/BellOutlined.vue +21 -0
- package/sohelp-icon-select/icons/BookOutlined.vue +21 -0
- package/sohelp-icon-select/icons/CalendarOutlined.vue +19 -0
- package/sohelp-icon-select/icons/CaretDownFilled.vue +13 -0
- package/sohelp-icon-select/icons/CaretUpFilled.vue +13 -0
- package/sohelp-icon-select/icons/CheckCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/CheckCircleOutlined.vue +23 -0
- package/sohelp-icon-select/icons/CheckOutlined.vue +20 -0
- package/sohelp-icon-select/icons/CityOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ClockCircleOutlined.vue +23 -0
- package/sohelp-icon-select/icons/CloseCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/CloseCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CloseOutlined.vue +20 -0
- package/sohelp-icon-select/icons/CloudUploadOutlined.vue +23 -0
- package/sohelp-icon-select/icons/ClusterOutlined.vue +21 -0
- package/sohelp-icon-select/icons/CodeOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ColumnHeightOutlined.vue +18 -0
- package/sohelp-icon-select/icons/CompassOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CompressOutlined.vue +23 -0
- package/sohelp-icon-select/icons/ConnectionOutlined.vue +24 -0
- package/sohelp-icon-select/icons/ControlOutlined.vue +27 -0
- package/sohelp-icon-select/icons/CopyOutlined.vue +22 -0
- package/sohelp-icon-select/icons/CpuOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DashboardOutlined.vue +26 -0
- package/sohelp-icon-select/icons/DatabaseOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DeleteOutlined.vue +22 -0
- package/sohelp-icon-select/icons/DesktopOutlined.vue +19 -0
- package/sohelp-icon-select/icons/DownloadOutlined.vue +21 -0
- package/sohelp-icon-select/icons/DragOutlined.vue +22 -0
- package/sohelp-icon-select/icons/EditOutlined.vue +21 -0
- package/sohelp-icon-select/icons/EllipsisOutlined.vue +15 -0
- package/sohelp-icon-select/icons/EnvironmentOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ExclamationCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/ExpandOutlined.vue +23 -0
- package/sohelp-icon-select/icons/FileOutlined.vue +22 -0
- package/sohelp-icon-select/icons/FilterFilled.vue +15 -0
- package/sohelp-icon-select/icons/FolderAddOutlined.vue +20 -0
- package/sohelp-icon-select/icons/FolderOutlined.vue +19 -0
- package/sohelp-icon-select/icons/FormOutlined.vue +20 -0
- package/sohelp-icon-select/icons/FullscreenExitOutlined.vue +16 -0
- package/sohelp-icon-select/icons/FullscreenOutlined.vue +16 -0
- package/sohelp-icon-select/icons/FundOutlined.vue +20 -0
- package/sohelp-icon-select/icons/GlobalOutlined.vue +15 -0
- package/sohelp-icon-select/icons/HolderOutlined.vue +18 -0
- package/sohelp-icon-select/icons/HomeOutlined.vue +19 -0
- package/sohelp-icon-select/icons/IdcardOutlined.vue +25 -0
- package/sohelp-icon-select/icons/InfoCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/LinkOutlined.vue +15 -0
- package/sohelp-icon-select/icons/LoadingDotOutlined.vue +21 -0
- package/sohelp-icon-select/icons/LoadingOutlined.vue +19 -0
- package/sohelp-icon-select/icons/LockOutlined.vue +21 -0
- package/sohelp-icon-select/icons/LogOutlined.vue +22 -0
- package/sohelp-icon-select/icons/LogoutOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MailOutlined.vue +19 -0
- package/sohelp-icon-select/icons/MenuFoldOutlined.vue +17 -0
- package/sohelp-icon-select/icons/MenuUnfoldOutlined.vue +17 -0
- package/sohelp-icon-select/icons/MessageOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MinusCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/MobileOutlined.vue +20 -0
- package/sohelp-icon-select/icons/MoonOutlined.vue +21 -0
- package/sohelp-icon-select/icons/MoreOutlined.vue +15 -0
- package/sohelp-icon-select/icons/PauseFilled.vue +14 -0
- package/sohelp-icon-select/icons/PieChartOutlined.vue +20 -0
- package/sohelp-icon-select/icons/PlayFilled.vue +13 -0
- package/sohelp-icon-select/icons/PlusCircleOutlined.vue +22 -0
- package/sohelp-icon-select/icons/PlusOutlined.vue +19 -0
- package/sohelp-icon-select/icons/ProtectOutlined.vue +21 -0
- package/sohelp-icon-select/icons/QuestionCircleFilled.vue +15 -0
- package/sohelp-icon-select/icons/QuestionCircleOutlined.vue +25 -0
- package/sohelp-icon-select/icons/ReloadOutlined.vue +22 -0
- package/sohelp-icon-select/icons/SearchOutlined.vue +21 -0
- package/sohelp-icon-select/icons/SettingOutlined.vue +24 -0
- package/sohelp-icon-select/icons/ShoppingOutlined.vue +19 -0
- package/sohelp-icon-select/icons/SortOutlined.vue +21 -0
- package/sohelp-icon-select/icons/StarFilled.vue +15 -0
- package/sohelp-icon-select/icons/StepBackwardFilled.vue +17 -0
- package/sohelp-icon-select/icons/StepForwardFilled.vue +17 -0
- package/sohelp-icon-select/icons/SuitcaseOutlined.vue +19 -0
- package/sohelp-icon-select/icons/SunOutlined.vue +29 -0
- package/sohelp-icon-select/icons/SwapOutlined.vue +21 -0
- package/sohelp-icon-select/icons/SyncOutlined.vue +21 -0
- package/sohelp-icon-select/icons/TableOutlined.vue +19 -0
- package/sohelp-icon-select/icons/TagOutlined.vue +20 -0
- package/sohelp-icon-select/icons/TimerOutlined.vue +22 -0
- package/sohelp-icon-select/icons/UndoOutlined.vue +22 -0
- package/sohelp-icon-select/icons/UnlockOutlined.vue +21 -0
- package/sohelp-icon-select/icons/UploadOutlined.vue +21 -0
- package/sohelp-icon-select/icons/UserOutlined.vue +21 -0
- package/sohelp-icon-select/icons/VerticalAlignMiddleOutlined.vue +15 -0
- package/sohelp-icon-select/icons/VerticalLeftOutlined.vue +13 -0
- package/sohelp-icon-select/icons/VerticalRightOutlined.vue +13 -0
- package/sohelp-icon-select/icons/WarningOutlined.vue +21 -0
- package/sohelp-icon-select/icons/ZoomInOutlined.vue +22 -0
- package/sohelp-icon-select/icons/ZoomOutOutlined.vue +22 -0
- package/sohelp-icon-select/icons/index.js +106 -0
- package/sohelp-icon-select/icons/index.ts +106 -0
- package/sohelp-icon-select/index.vue +95 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +72 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +64 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +90 -0
- package/sohelp-vxe-grid/DefaultProps.js +27 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +143 -0
- package/sohelp-vxe-grid/index.vue +475 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +78 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- 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>
|