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
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 如何安装
|
|
2
|
+
* 1) npm install sohelp-eleplus@1.1.13
|
|
3
|
+
* 2) npm install sohelp-eleplus
|
|
4
|
+
|
|
5
|
+
# 相关依赖
|
|
6
|
+
* 1) Element-Plus
|
|
7
|
+
* 2) Admin-Element-Plus
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# 如何开发调试
|
|
11
|
+
|
|
12
|
+
通过npm link进行安装关联
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
# 关联连接
|
|
16
|
+
npm link sohelp-eleplus
|
|
17
|
+
|
|
18
|
+
# 导入组件库
|
|
19
|
+
import SohelpEleplus from 'sohelp-eleplus';
|
|
20
|
+
|
|
21
|
+
# 导入样式
|
|
22
|
+
import 'sohelp-eleplus/style/index.scss';
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# 全局安装注册组件库
|
|
26
|
+
app.use(SohelpEleplus);
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# 如何发布
|
|
33
|
+
* 1) npm set config=https://registry.npmjs.org
|
|
34
|
+
* 2) npm login //#Enter username, password and two-factor authentication password
|
|
35
|
+
* 3) npm publish
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getDictData } from '../http/DictHttp.js';
|
|
2
|
+
import { ElMessage } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 字典缓存
|
|
6
|
+
*/
|
|
7
|
+
export class DictCache {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.cache = new Map(); // 使用 Map 作为缓存存储结构
|
|
10
|
+
this.initPromise = null; // 防止并发重复请求
|
|
11
|
+
}
|
|
12
|
+
//初始化字典数据
|
|
13
|
+
async init() {
|
|
14
|
+
if (this.initPromise) return this.initPromise;
|
|
15
|
+
this.initPromise = getDictData()
|
|
16
|
+
.then((data) => {
|
|
17
|
+
this.setData(data);
|
|
18
|
+
})
|
|
19
|
+
.catch((msg) => {
|
|
20
|
+
ElMessage.error(msg);
|
|
21
|
+
});
|
|
22
|
+
await this.initPromise;
|
|
23
|
+
this.initPromise = null;
|
|
24
|
+
}
|
|
25
|
+
//设置字典数据
|
|
26
|
+
setData(data) {
|
|
27
|
+
for (let key in data) {
|
|
28
|
+
this.set(key, data[key]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// 设置缓存
|
|
32
|
+
set(key, value) {
|
|
33
|
+
this.cache.set(key, value);
|
|
34
|
+
}
|
|
35
|
+
// 获取缓存
|
|
36
|
+
async get(key) {
|
|
37
|
+
if (this.cache.size === 0) {
|
|
38
|
+
await this.init();
|
|
39
|
+
}
|
|
40
|
+
return this.cache.has(key) ? this.cache.get(key) : null;
|
|
41
|
+
}
|
|
42
|
+
// 检查缓存是否存在
|
|
43
|
+
has(key) {
|
|
44
|
+
return this.cache.has(key);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 删除缓存
|
|
48
|
+
delete(key) {
|
|
49
|
+
this.cache.delete(key);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 清空缓存
|
|
53
|
+
clear() {
|
|
54
|
+
this.cache.clear();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const dictCache = new DictCache();
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
// ModuleCache.js
|
|
2
|
+
import { getModule, saveGridFilter } from "../http/ModuleHttp.js";
|
|
3
|
+
import { ElMessage } from "element-plus";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 模块缓存
|
|
7
|
+
*/
|
|
8
|
+
class ModuleCache {
|
|
9
|
+
constructor() {
|
|
10
|
+
// 使用 Map 作为缓存模块存储结构
|
|
11
|
+
this.moduleCache = new Map();
|
|
12
|
+
this.layoutCache = new Map();
|
|
13
|
+
this.gridCache = new Map();
|
|
14
|
+
this.entityFormCache = new Map();
|
|
15
|
+
this.entityGridCache = new Map();
|
|
16
|
+
this.workflowCache = new Map();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 异步初始化函数
|
|
21
|
+
*
|
|
22
|
+
* @param {string} refid - 模块的引用标识符
|
|
23
|
+
* @returns {Promise<void>} 返回一个Promise,表示初始化操作完成
|
|
24
|
+
* @throws {Error} 如果获取模块数据时出错,则抛出错误
|
|
25
|
+
*/
|
|
26
|
+
async init(refid) {
|
|
27
|
+
if (!refid) return;
|
|
28
|
+
const moduleRefid = refid.split("!")[0];
|
|
29
|
+
const moduleData = await getModule(moduleRefid).catch((err) => {
|
|
30
|
+
ElMessage.error(err.message || `获取${refid}失败`);
|
|
31
|
+
});
|
|
32
|
+
if (!moduleData) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
/**初始化模块信息*/
|
|
36
|
+
this.setModule(moduleRefid, refid);
|
|
37
|
+
|
|
38
|
+
/**初始化模块布局*/
|
|
39
|
+
const layoutList = moduleData?.layout;
|
|
40
|
+
if (layoutList) {
|
|
41
|
+
for (const key in layoutList) {
|
|
42
|
+
const layout = layoutList[key];
|
|
43
|
+
if (!layout || !layout.refid) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
this.setLayout(layout.refid, layout);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**初始化数据列表*/
|
|
51
|
+
const gridList = moduleData?.grid;
|
|
52
|
+
if (gridList) {
|
|
53
|
+
for (const key in gridList) {
|
|
54
|
+
const grid = gridList[key];
|
|
55
|
+
if (!grid || !grid.refid) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
this.setGrid(grid.refid, grid);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/**初始化实体表单*/
|
|
64
|
+
const entityForm = moduleData?.entityForm;
|
|
65
|
+
if (entityForm) {
|
|
66
|
+
for (const key in entityForm) {
|
|
67
|
+
const form = entityForm[key];
|
|
68
|
+
if (form && form.refid) {
|
|
69
|
+
this.setEntityForm(form.refid, form);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
/**初始化工作流列表*/
|
|
76
|
+
const workflowList = moduleData?.workflow;
|
|
77
|
+
if (workflowList) {
|
|
78
|
+
for (const key in workflowList) {
|
|
79
|
+
const workflow = workflowList[key];
|
|
80
|
+
if (!workflow || !workflow.refid) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
this.setWorkflow(workflow.refid, workflow);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 设置布局缓存
|
|
91
|
+
*
|
|
92
|
+
* @param {string} refid - 布局的唯一标识符
|
|
93
|
+
* @param {any} value - 需要缓存的布局数据
|
|
94
|
+
* @returns {void} 无返回值
|
|
95
|
+
*/
|
|
96
|
+
setLayout(refid, value) {
|
|
97
|
+
if (!refid) return;
|
|
98
|
+
this.layoutCache.set(refid, value);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 设置模块的值
|
|
103
|
+
*
|
|
104
|
+
* @param {string} refid - 模块的引用ID,格式为模块名+'!'+模块引用值
|
|
105
|
+
* @param {any} value - 需要设置的值
|
|
106
|
+
*/
|
|
107
|
+
setModule(refid, value) {
|
|
108
|
+
if (!refid) return;
|
|
109
|
+
const moduleName = refid.split("!")[0];
|
|
110
|
+
this.moduleCache.set(moduleName, value);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 设置工作流程
|
|
115
|
+
*
|
|
116
|
+
* @param {string} refid 引用ID
|
|
117
|
+
* @param {any} value 值
|
|
118
|
+
*/
|
|
119
|
+
setWorkflow(refid, value) {
|
|
120
|
+
if (!refid) return;
|
|
121
|
+
this.workflowCache.set(refid, value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 设置网格缓存
|
|
126
|
+
*
|
|
127
|
+
* @param refid 网格引用ID
|
|
128
|
+
* @param value 要设置的值
|
|
129
|
+
*/
|
|
130
|
+
setGrid(refid, value) {
|
|
131
|
+
if (!refid) return;
|
|
132
|
+
this.gridCache.set(refid, value);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 设置实体表单的值
|
|
139
|
+
*
|
|
140
|
+
* @param {string} refid - 实体引用ID
|
|
141
|
+
* @param {any} value - 要设置的值
|
|
142
|
+
* @returns {void} 无返回值
|
|
143
|
+
*/
|
|
144
|
+
setEntityForm(refid, value) {
|
|
145
|
+
if (!refid) return;
|
|
146
|
+
this.entityFormCache.set(refid, value);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
//获取缓存
|
|
151
|
+
async getModule(refid) {
|
|
152
|
+
const moduleRef = refid.split("!")[0];
|
|
153
|
+
if (!this.hasModule(refid)) {
|
|
154
|
+
await this.init(moduleRef);
|
|
155
|
+
}
|
|
156
|
+
return this.moduleCache.has(moduleRef) ? this.moduleCache.get(moduleRef) : null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 根据引用ID获取网格数据
|
|
161
|
+
*
|
|
162
|
+
* @param {string} refid - 引用ID
|
|
163
|
+
* @returns {Object|null} 如果缓存中存在对应的网格数据,则返回该数据;否则返回null
|
|
164
|
+
*/
|
|
165
|
+
async getGrid(refid) {
|
|
166
|
+
if (!this.hasModule(refid)) {
|
|
167
|
+
await this.init(refid);
|
|
168
|
+
}
|
|
169
|
+
return this.gridCache.has(refid) ? this.gridCache.get(refid) : null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 异步获取工作流
|
|
174
|
+
*
|
|
175
|
+
* @param refid 工作流唯一标识符
|
|
176
|
+
* @returns 如果工作流存在,则返回工作流数据;否则返回 null
|
|
177
|
+
*/
|
|
178
|
+
async getWorkflow(refid) {
|
|
179
|
+
if (!this.hasWorkflow(refid)) {
|
|
180
|
+
await this.init(refid);
|
|
181
|
+
}
|
|
182
|
+
return this.workflowCache.has(refid) ? this.workflowCache.get(refid) : null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 异步获取布局信息
|
|
187
|
+
*
|
|
188
|
+
* @param refid 模块引用ID
|
|
189
|
+
* @returns 如果布局信息已缓存,则返回布局信息;否则返回null
|
|
190
|
+
*/
|
|
191
|
+
async getLayout(refid) {
|
|
192
|
+
if (!this.hasModule(refid)) {
|
|
193
|
+
await this.init(refid);
|
|
194
|
+
}
|
|
195
|
+
return this.layoutCache.has(refid) ? this.layoutCache.get(refid) : null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 获取实体表单
|
|
202
|
+
*
|
|
203
|
+
* @param {string} refid 引用ID
|
|
204
|
+
* @returns {Object|null} 返回实体表单对象,如果不存在则返回null
|
|
205
|
+
*/
|
|
206
|
+
async getEntityForm(refid) {
|
|
207
|
+
const _refid = (refid.indexOf("!")===-1)? refid+"!default":refid;
|
|
208
|
+
if (!this.hasModule(refid)) {
|
|
209
|
+
await this.init(refid);
|
|
210
|
+
}
|
|
211
|
+
return this.entityFormCache.has(_refid) ? this.entityFormCache.get(_refid) : null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* 判断是否存在指定模块
|
|
216
|
+
*
|
|
217
|
+
* @param {string} refid - 模块的唯一标识符
|
|
218
|
+
* @returns {boolean} - 如果存在指定模块则返回true,否则返回false
|
|
219
|
+
*/
|
|
220
|
+
hasModule(refid) {
|
|
221
|
+
if (!refid) return false;
|
|
222
|
+
if (typeof refid === "object") refid = refid.toString();
|
|
223
|
+
const moduleRefId = refid.split("!")[0];
|
|
224
|
+
return this.moduleCache.has(moduleRefId);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* 判断指定的 refid 是否存在于网格缓存中
|
|
229
|
+
*
|
|
230
|
+
* @param {string} refid - 网格的唯一标识符
|
|
231
|
+
* @returns {boolean} 如果 refid 存在于网格缓存中,则返回 true;否则返回 false
|
|
232
|
+
*/
|
|
233
|
+
hasGrid(refid) {
|
|
234
|
+
return this.gridCache.has(refid);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* 判断工作流缓存中是否存在指定ID的工作流
|
|
239
|
+
*
|
|
240
|
+
* @param refid 工作流ID
|
|
241
|
+
* @returns 布尔值,如果缓存中存在指定ID的工作流则返回true,否则返回false
|
|
242
|
+
*/
|
|
243
|
+
hasWorkflow(refid) {
|
|
244
|
+
return this.workflowCache.has(refid);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* 判断指定引用ID是否存在于布局缓存中
|
|
249
|
+
*
|
|
250
|
+
* @param {string} refid 引用ID
|
|
251
|
+
* @returns {boolean} 如果布局缓存中存在指定引用ID,则返回true;否则返回false
|
|
252
|
+
*/
|
|
253
|
+
hasLayout(refid) {
|
|
254
|
+
return this.layoutCache.has(refid);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* 删除指定布局缓存
|
|
260
|
+
*
|
|
261
|
+
* @param {string} refid - 要删除的布局缓存的引用ID
|
|
262
|
+
*/
|
|
263
|
+
deleteLayout(refid) {
|
|
264
|
+
this.layoutCache.delete(refid);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 删除网格
|
|
269
|
+
*
|
|
270
|
+
* @param {string} refid - 要删除的网格的唯一标识符
|
|
271
|
+
*/
|
|
272
|
+
deleteGrid(refid) {
|
|
273
|
+
this.layoutCache.delete(refid);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* 删除指定模块
|
|
278
|
+
*
|
|
279
|
+
* @param {string} refid - 模块的唯一标识符
|
|
280
|
+
*/
|
|
281
|
+
deleteModule(refid) {
|
|
282
|
+
this.moduleCache.delete(refid.split("!")[0]);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* 清空缓存
|
|
287
|
+
*
|
|
288
|
+
* 清除模块缓存、网格缓存和布局缓存
|
|
289
|
+
*/
|
|
290
|
+
clear() {
|
|
291
|
+
// 清空模块缓存
|
|
292
|
+
this.moduleCache.clear();
|
|
293
|
+
|
|
294
|
+
// 清空网格缓存
|
|
295
|
+
this.gridCache.clear();
|
|
296
|
+
|
|
297
|
+
// 清空布局缓存
|
|
298
|
+
this.layoutCache.clear();
|
|
299
|
+
|
|
300
|
+
// 清空实体网格缓存
|
|
301
|
+
this.entityGridCache.clear();
|
|
302
|
+
|
|
303
|
+
// 清空实体表单缓存
|
|
304
|
+
this.entityFormCache.clear();
|
|
305
|
+
|
|
306
|
+
// 清空工作流缓存
|
|
307
|
+
this.workflowCache.clear();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* 保存筛选字段
|
|
312
|
+
*
|
|
313
|
+
* @param {Object} filter 筛选条件对象
|
|
314
|
+
* @returns {Promise<any>} 保存筛选字段的结果
|
|
315
|
+
*/
|
|
316
|
+
async saveFilterFields(filter) {
|
|
317
|
+
return await saveGridFilter(filter);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// 创建一个新的ModuleCache实例,并将其导出为moduleCache
|
|
322
|
+
export const moduleCache = new ModuleCache();
|
package/components.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { default as SohelpDict } from './sohelp-dict/index.vue';
|
|
2
|
+
export { default as SohelpDynSelect } from './sohelp-dyn-select/index.vue';
|
|
3
|
+
export { default as SohelpOrgSelect } from './sohelp-org-select/index.vue';
|
|
4
|
+
export { default as SohelpRoleSelect } from './sohelp-role-select/index.vue';
|
|
5
|
+
export { default as SohelpSelect } from './sohelp-select/index.vue';
|
|
6
|
+
export { default as SohelpGridSelect } from './sohelp-grid-select/index.vue';
|
|
7
|
+
export { default as SohelpProTable } from './sohelp-pro-table/index.vue';
|
|
8
|
+
export { default as SohelpText } from './sohelp-text/index.vue';
|
|
9
|
+
export { default as SohelpUserSelect } from './sohelp-user-select/index.vue';
|
|
10
|
+
|
|
11
|
+
export { default as SohelpDynTreeSelect } from './sohelp-dyn-tree-select/index.vue';
|
|
12
|
+
export { default as SohelpDynTree } from './sohelp-dyn-tree/index.vue';
|
|
13
|
+
export { default as SohelpOrgTreeSelect } from './sohelp-org-tree-select/index.vue';
|
|
14
|
+
export { default as SohelpTreeSelect } from './sohelp-tree-select/index.vue';
|
|
15
|
+
export { default as SohelpTree } from './sohelp-tree/index.vue';
|
|
16
|
+
|
|
17
|
+
export { default as SohelpCryInput } from './sohelp-cry-input/index.vue';
|
|
18
|
+
export { default as SohelpDate } from './sohelp-date/index.vue';
|
|
19
|
+
export { default as SohelpDatetimeRange } from './sohelp-datetime-range/index.vue';
|
|
20
|
+
export { default as SohelpDatetime } from './sohelp-datetime/index.vue';
|
|
21
|
+
export { default as SohelpDatetimePicker } from './sohelp-datetime-picker/index.vue';
|
|
22
|
+
export { default as SohelpInput } from './sohelp-input/index.vue';
|
|
23
|
+
export { default as SohelpNumberInput } from './sohelp-number-input/index.vue';
|
|
24
|
+
export { default as SohelpNumberRange } from './sohelp-number-range/index.vue';
|
|
25
|
+
export { default as SohelpSwitch } from './sohelp-switch/index.vue';
|
|
26
|
+
export { default as SohelpTextareaInput } from './sohelp-textarea-input/index.vue';
|
|
27
|
+
|
|
28
|
+
export { default as SohelpDropCard } from './sohelp-drop-card/index.vue';
|
|
29
|
+
export { default as SohelpEntityForm } from './sohelp-entity-form/index.vue';
|
|
30
|
+
export { default as SohelpGrid } from './sohelp-grid/index.vue';
|
|
31
|
+
export { default as SohelpGridViewSelect } from './sohelp-grid-view-select/index.vue';
|
|
32
|
+
export { default as SohelpGridView } from './sohelp-grid-view/index.vue';
|
|
33
|
+
export { default as SohelpRate } from './sohelp-rate/index.vue';
|
|
34
|
+
export { default as SohelpProcess } from './sohelp-process/index.vue';
|
|
35
|
+
export { default as SohelpVxeGrid } from './sohelp-vxe-grid/index.vue';
|
|
36
|
+
export { default as SohelpWorkflow } from './sohelp-workflow/index.vue';
|
|
37
|
+
export { default as SohelpImageUpload } from './sohelp-image-upload/index.vue';
|
|
38
|
+
export { default as SohelpFileUpload } from './sohelp-file-upload/index.vue';
|
|
39
|
+
export { default as SohelpSplitPanel } from './sohelp-split-panel/index.vue';
|
|
40
|
+
export { default as SohelpRichText } from './sohelp-rich-text/index.vue';
|
|
41
|
+
export { default as SohelpAutocode } from './sohelp-autocode/index.vue';
|
|
42
|
+
export { default as SohelpDrawer } from './sohelp-drawer/index.vue';
|
|
43
|
+
export { default as SohelpTenantSelect } from './sohelp-tenant-select/index.vue';
|
|
44
|
+
export { default as SohelpVxeGridSelect } from './sohelp-vxe-grid-select/index.vue';
|
|
45
|
+
export { default as SohelpIconSelect } from './sohelp-icon-select/index.vue';
|
|
46
|
+
export { default as SohelpModal } from './sohelp-modal/index.vue';
|
package/core-export.js
ADDED
package/http/CrudHttp.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 引擎操作
|
|
3
|
+
*/
|
|
4
|
+
import SohelpHttp from "./SohelpHttp";
|
|
5
|
+
|
|
6
|
+
export const CrudHttp = {
|
|
7
|
+
/**
|
|
8
|
+
* 表单初始化数据
|
|
9
|
+
* @param refid
|
|
10
|
+
* @param params
|
|
11
|
+
* @param callback
|
|
12
|
+
*/
|
|
13
|
+
initial: function(refid, params = {}, callback) {
|
|
14
|
+
params["refid"] = refid;
|
|
15
|
+
return SohelpHttp.get("/engine/web/crud/initial", params,callback);
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* 根据ID获取某一行数据
|
|
19
|
+
* @param refid
|
|
20
|
+
* @param params
|
|
21
|
+
* @param callback
|
|
22
|
+
*/
|
|
23
|
+
getById: function(refid, params = {}, callback) {
|
|
24
|
+
params["refid"] = refid;
|
|
25
|
+
return SohelpHttp.get("/engine/web/crud/getById", params,callback)
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* 根据ID,获取主体数据和外键数据
|
|
29
|
+
* @param refid
|
|
30
|
+
* @param params
|
|
31
|
+
* @param callback
|
|
32
|
+
*/
|
|
33
|
+
detail: function(refid, params = {}, callback) {
|
|
34
|
+
params["refid"] = refid;
|
|
35
|
+
return SohelpHttp.get("/engine/web/crud/detail", params,callback);
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 根据外键分页读取数据列表
|
|
39
|
+
* @param refid 网格列表
|
|
40
|
+
* @param data
|
|
41
|
+
* @param callback
|
|
42
|
+
*/
|
|
43
|
+
pageByFk: function(refid, params = {}, callback) {
|
|
44
|
+
params["refid"] = refid;
|
|
45
|
+
return SohelpHttp.get("/engine/web/crud/pageByFk", params,callback)
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* 保存单据
|
|
49
|
+
* @param refid 模块地址
|
|
50
|
+
* @param data 数据对象
|
|
51
|
+
* @param callback 回调函数
|
|
52
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
53
|
+
*/
|
|
54
|
+
save: function(refid, data = {}, callback) {
|
|
55
|
+
data["refid"] = refid;
|
|
56
|
+
return SohelpHttp.post("/engine/web/crud/save", data,callback);
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* 创建单据
|
|
60
|
+
* @param refid 模块地址
|
|
61
|
+
* @param data 数据对象
|
|
62
|
+
* @param callback 回调函数
|
|
63
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
64
|
+
*/
|
|
65
|
+
create: function(refid, data = {}, callback) {
|
|
66
|
+
data["refid"] = refid;
|
|
67
|
+
return SohelpHttp.post("/engine/web/crud/create", data,callback);
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* 更新单据
|
|
71
|
+
* @param refid 模块地址
|
|
72
|
+
* @param data 数据对象
|
|
73
|
+
* @param callback 回调函数
|
|
74
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
75
|
+
*/
|
|
76
|
+
update: function(refid, data = {}, callback) {
|
|
77
|
+
data["refid"] = refid;
|
|
78
|
+
return SohelpHttp.post("/engine/web/crud/update", data,callback)
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* 删除单据
|
|
82
|
+
* @param refid 模块地址
|
|
83
|
+
* @param data 数据对象
|
|
84
|
+
* @param callback 回调函数
|
|
85
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
86
|
+
*/
|
|
87
|
+
delete: function(refid, data = {}, callback) {
|
|
88
|
+
data["refid"] = refid;
|
|
89
|
+
return SohelpHttp.post("/engine/web/crud/delete", data,callback)
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* 单据分页
|
|
93
|
+
* @param refid 模块地址
|
|
94
|
+
* @param params 数据对象
|
|
95
|
+
* @param callback 回调函数
|
|
96
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
97
|
+
*/
|
|
98
|
+
page: async function(refid, params = {}, callback) {
|
|
99
|
+
params["refid"] = refid;
|
|
100
|
+
return SohelpHttp.get("/engine/web/crud/page", params,callback);
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* 单据详情
|
|
104
|
+
* @param refid 模块地址
|
|
105
|
+
* @param params 数据对象
|
|
106
|
+
* @param callback 回调函数
|
|
107
|
+
* @returns {Promise<axios.AxiosResponse<any>>}
|
|
108
|
+
*/
|
|
109
|
+
detail: async function(refid, params = {}, callback) {
|
|
110
|
+
params["refid"] = refid;
|
|
111
|
+
return SohelpHttp.get("/engine/web/crud/detail", params,callback);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default CrudHttp;
|
package/http/DictHttp.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 获取界面配置
|
|
5
|
+
* @param refid
|
|
6
|
+
* @returns {Promise<*>}
|
|
7
|
+
*/
|
|
8
|
+
export async function getLayout(refid) {
|
|
9
|
+
const res = await SohelpHttp.get("/engine/web/layout/read", {refid});
|
|
10
|
+
if (res.meta.success) {
|
|
11
|
+
return res.data;
|
|
12
|
+
}
|
|
13
|
+
return Promise.reject(new Error(res.meta.message));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 获取界面配置
|
|
18
|
+
* @param refid
|
|
19
|
+
* @returns {Promise<*>}
|
|
20
|
+
*/
|
|
21
|
+
export async function getModule(refid) {
|
|
22
|
+
const res = await SohelpHttp.get("/engine/web/module/read", {refid});
|
|
23
|
+
if (res.meta.success) {
|
|
24
|
+
return res.data;
|
|
25
|
+
}
|
|
26
|
+
return Promise.reject(new Error(res.meta.message));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 保存属性配置
|
|
32
|
+
* @param {*} data
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export async function saveGridFilter(data) {
|
|
36
|
+
const res = await SohelpHttp.post('/engine/web/module/grid/save', data);
|
|
37
|
+
if (res.meta.success) {
|
|
38
|
+
return res;
|
|
39
|
+
}
|
|
40
|
+
return Promise.reject(new Error(res.meta.message));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 重置列设置
|
|
46
|
+
* @param {*} refid
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export async function resetCommonConfig(refid) {
|
|
50
|
+
const res = await SohelpHttp.post('/engine/web/module/grid/resetCommonConfig', refid);
|
|
51
|
+
if (res.meta.success) {
|
|
52
|
+
return res.meta.message;
|
|
53
|
+
}
|
|
54
|
+
return Promise.reject(new Error(res.meta.message));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 更新列设置
|
|
59
|
+
* @param {*} refid
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
export async function updateCommonConfig(data) {
|
|
63
|
+
const res = await SohelpHttp.post('/engine/web/module/grid/updateCommonConfig', data);
|
|
64
|
+
if (res.meta.success) {
|
|
65
|
+
return res.meta.message;
|
|
66
|
+
}
|
|
67
|
+
return Promise.reject(new Error(res.meta.message));
|
|
68
|
+
}
|