@maketribe/ms-app 3.0.29 → 3.0.31
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/package.json +39 -42
- package/src/components/button/button-options.ts +22 -0
- package/src/components/button/button.tsx +37 -0
- package/src/components/button/index.ts +7 -0
- package/src/components/column-components/column-action/column-action-options.ts +11 -0
- package/src/components/column-components/column-action/column-action.tsx +36 -0
- package/src/components/column-components/column-action/index.ts +4 -0
- package/src/components/column-components/column-date/column-date-options.ts +12 -0
- package/src/components/column-components/column-date/column-date.tsx +47 -0
- package/src/components/column-components/column-date/index.ts +6 -0
- package/src/components/column-components/column-image/column-image-options.ts +9 -0
- package/src/components/column-components/column-image/column-image.tsx +20 -0
- package/src/components/column-components/column-image/index.ts +4 -0
- package/src/components/column-components/column-json/column-json-options.ts +13 -0
- package/src/components/column-components/column-json/column-json.tsx +41 -0
- package/src/components/column-components/column-json/index.ts +8 -0
- package/src/components/column-components/column-link/column-link-options.ts +34 -0
- package/src/components/column-components/column-link/column-link.tsx +27 -0
- package/src/components/column-components/column-link/index.ts +7 -0
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text-options.ts +12 -0
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text.tsx +22 -0
- package/src/components/column-components/column-object-mapping-text/index.ts +6 -0
- package/src/components/column-components/column-select/column-select-header-options.ts +8 -0
- package/src/components/column-components/column-select/column-select-header.tsx +57 -0
- package/src/components/column-components/column-select/column-select-options.ts +9 -0
- package/src/components/column-components/column-select/column-select.tsx +74 -0
- package/src/components/column-components/column-select/index.ts +5 -0
- package/src/components/column-components/column-switch/column-switch-options.ts +16 -0
- package/src/components/column-components/column-switch/column-switch.tsx +37 -0
- package/src/components/column-components/column-switch/index.ts +6 -0
- package/src/components/column-components/column-tag/column-tag-options.ts +42 -0
- package/src/components/column-components/column-tag/column-tag.tsx +59 -0
- package/src/components/column-components/column-tag/index.ts +6 -0
- package/src/components/column-components/column-text/column-text-options.ts +10 -0
- package/src/components/column-components/column-text/column-text.tsx +18 -0
- package/src/components/column-components/column-text/index.ts +6 -0
- package/src/components/column-components/index.ts +10 -0
- package/src/components/condition-components/condition-date/condition-date-options.ts +21 -0
- package/src/components/condition-components/condition-date/condition-date.tsx +68 -0
- package/src/components/condition-components/condition-date/index.ts +7 -0
- package/src/components/condition-components/condition-input/condition-input-options.ts +10 -0
- package/src/components/condition-components/condition-input/condition-input.tsx +41 -0
- package/src/components/condition-components/condition-input/index.ts +7 -0
- package/src/components/condition-components/condition-number/condition-number-options.ts +22 -0
- package/src/components/condition-components/condition-number/condition-number.tsx +74 -0
- package/src/components/condition-components/condition-number/index.ts +7 -0
- package/src/components/condition-components/condition-select/condition-select-options.ts +31 -0
- package/src/components/condition-components/condition-select/condition-select.tsx +56 -0
- package/src/components/condition-components/condition-select/index.ts +7 -0
- package/src/components/condition-components/index.ts +4 -0
- package/src/components/config-provider/config-provider-options.ts +24 -0
- package/src/components/config-provider/config-provider.tsx +21 -0
- package/src/components/config-provider/constants.ts +8 -0
- package/src/components/config-provider/index.ts +9 -0
- package/src/components/config-provider/use-global-config.ts +70 -0
- package/src/components/data-model/data-filter-form/composables/index.ts +1 -0
- package/src/components/data-model/data-filter-form/composables/use-condition.ts +68 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item-options.ts +11 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item.tsx +183 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/index.ts +7 -0
- package/src/components/data-model/data-filter-form/data-filter-form-options.ts +15 -0
- package/src/components/data-model/data-filter-form/data-filter-form.tsx +103 -0
- package/src/components/data-model/data-filter-form/index.ts +13 -0
- package/src/components/data-model/data-filter-form/operator-options.ts +48 -0
- package/src/components/data-model/data-filter-form/token.ts +30 -0
- package/src/components/data-model/data-filter-popover/data-filter-popover-options.ts +6 -0
- package/src/components/data-model/data-filter-popover/data-filter-popover.tsx +52 -0
- package/src/components/data-model/data-filter-popover/index.ts +8 -0
- package/src/components/data-model/data-form/composables/index.ts +1 -0
- package/src/components/data-model/data-form/composables/use-form-item.ts +40 -0
- package/src/components/data-model/data-form/data-form-item/data-form-item-options.ts +11 -0
- package/src/components/data-model/data-form/data-form-item/data-form-item.tsx +140 -0
- package/src/components/data-model/data-form/data-form-item/index.ts +6 -0
- package/src/components/data-model/data-form/data-form-options.ts +43 -0
- package/src/components/data-model/data-form/data-form.tsx +113 -0
- package/src/components/data-model/data-form/index.ts +13 -0
- package/src/components/data-model/data-form/token.ts +16 -0
- package/src/components/data-model/data-form/views/form/form-options.ts +16 -0
- package/src/components/data-model/data-form/views/form/form.tsx +206 -0
- package/src/components/data-model/data-form/views/form/index.ts +6 -0
- package/src/components/data-model/data-form/views/form-view/form-view-options.ts +17 -0
- package/src/components/data-model/data-form/views/form-view/form-view.tsx +68 -0
- package/src/components/data-model/data-form/views/form-view/index.ts +6 -0
- package/src/components/data-model/data-form/views/index.ts +2 -0
- package/src/components/data-model/data-form-page/data-form-page-options.ts +20 -0
- package/src/components/data-model/data-form-page/data-form-page.tsx +57 -0
- package/src/components/data-model/data-form-page/index.ts +7 -0
- package/src/components/data-model/data-table/composables/index.ts +1 -0
- package/src/components/data-model/data-table/composables/use-column.ts +23 -0
- package/src/components/data-model/data-table/data-table-column/data-table-column-options.ts +11 -0
- package/src/components/data-model/data-table/data-table-column/data-table-column.tsx +18 -0
- package/src/components/data-model/data-table/data-table-column/index.ts +7 -0
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component-options.ts +13 -0
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component.tsx +38 -0
- package/src/components/data-model/data-table/data-table-column-component/index.ts +7 -0
- package/src/components/data-model/data-table/data-table-options.ts +24 -0
- package/src/components/data-model/data-table/data-table.tsx +102 -0
- package/src/components/data-model/data-table/index.ts +17 -0
- package/src/components/data-model/data-table/token.ts +10 -0
- package/src/components/data-model/data-table/views/index.ts +5 -0
- package/src/components/data-model/data-table/views/table/index.ts +8 -0
- package/src/components/data-model/data-table/views/table/table-options.ts +12 -0
- package/src/components/data-model/data-table/views/table/table.tsx +98 -0
- package/src/components/data-model/data-table/views/table-tree/index.ts +8 -0
- package/src/components/data-model/data-table/views/table-tree/table-tree-options.ts +12 -0
- package/src/components/data-model/data-table/views/table-tree/table-tree.tsx +104 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item-options.ts +34 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item.tsx +97 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/index.ts +5 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search.tsx +40 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/index.ts +7 -0
- package/src/components/data-model/data-table/views/table-view/index.ts +8 -0
- package/src/components/data-model/data-table/views/table-view/table-view-options.ts +13 -0
- package/src/components/data-model/data-table/views/table-view/table-view.tsx +126 -0
- package/src/components/data-model/data-table/views/tree/index.ts +8 -0
- package/src/components/data-model/data-table/views/tree/tree-options.ts +14 -0
- package/src/components/data-model/data-table/views/tree/tree.tsx +131 -0
- package/src/components/data-model/data-table/views/tree-view/index.ts +8 -0
- package/src/components/data-model/data-table/views/tree-view/tree-view-options.ts +16 -0
- package/src/components/data-model/data-table/views/tree-view/tree-view.tsx +81 -0
- package/src/components/data-model/data-table-page/data-table-page-options.ts +11 -0
- package/src/components/data-model/data-table-page/data-table-page.tsx +26 -0
- package/src/components/data-model/data-table-page/index.ts +6 -0
- package/src/components/data-model/data-table-pagination/data-table-pagination-options.ts +14 -0
- package/src/components/data-model/data-table-pagination/data-table-pagination.tsx +22 -0
- package/src/components/data-model/data-table-pagination/index.ts +7 -0
- package/src/components/data-model/filter-panel/composables/index.ts +1 -0
- package/src/components/data-model/filter-panel/composables/use-condition.ts +66 -0
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item-options.ts +11 -0
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item.tsx +187 -0
- package/src/components/data-model/filter-panel/filter-panel-item/index.ts +7 -0
- package/src/components/data-model/filter-panel/filter-panel-options.ts +15 -0
- package/src/components/data-model/filter-panel/filter-panel.tsx +102 -0
- package/src/components/data-model/filter-panel/index.ts +11 -0
- package/src/components/data-model/filter-panel/operator-options.ts +48 -0
- package/src/components/data-model/filter-panel/token.ts +17 -0
- package/src/components/data-model/index.ts +5 -0
- package/src/components/data-select/data-select-options.ts +43 -0
- package/src/components/data-select/data-select.tsx +87 -0
- package/src/components/data-select/index.ts +7 -0
- package/src/components/data-table-select/data-table-select-options.ts +43 -0
- package/src/components/data-table-select/data-table-select.tsx +190 -0
- package/src/components/data-table-select/index.ts +6 -0
- package/src/components/data-table-select-dialog/data-table-select-dialog-options.ts +33 -0
- package/src/components/data-table-select-dialog/data-table-select-dialog.tsx +154 -0
- package/src/components/data-table-select-dialog/index.ts +7 -0
- package/src/components/file-view/file-view-options.ts +8 -0
- package/src/components/file-view/file-view.tsx +40 -0
- package/src/components/file-view/index.ts +7 -0
- package/src/components/form-components/form-data-select/form-data-select-options.ts +23 -0
- package/src/components/form-components/form-data-select/form-data-select.tsx +28 -0
- package/src/components/form-components/form-data-select/index.ts +7 -0
- package/src/components/form-components/form-data-table-select/form-data-table-select-options.ts +19 -0
- package/src/components/form-components/form-data-table-select/form-data-table-select.tsx +32 -0
- package/src/components/form-components/form-data-table-select/index.ts +7 -0
- package/src/components/form-components/form-date-picker/form-date-picker-options.ts +18 -0
- package/src/components/form-components/form-date-picker/form-date-picker.tsx +49 -0
- package/src/components/form-components/form-date-picker/index.ts +8 -0
- package/src/components/form-components/form-detail/form-detail-options.ts +15 -0
- package/src/components/form-components/form-detail/form-detail.tsx +112 -0
- package/src/components/form-components/form-detail/index.ts +7 -0
- package/src/components/form-components/form-detail-select/form-detail-select-options.ts +39 -0
- package/src/components/form-components/form-detail-select/form-detail-select.tsx +68 -0
- package/src/components/form-components/form-detail-select/index.ts +5 -0
- package/src/components/form-components/form-icon-select/form-icon-select-options.ts +9 -0
- package/src/components/form-components/form-icon-select/form-icon-select.tsx +71 -0
- package/src/components/form-components/form-icon-select/index.ts +5 -0
- package/src/components/form-components/form-image-upload/form-image-upload-options.ts +11 -0
- package/src/components/form-components/form-image-upload/form-image-upload.tsx +22 -0
- package/src/components/form-components/form-image-upload/index.ts +5 -0
- package/src/components/form-components/form-radio-box/form-radio-box-options.ts +32 -0
- package/src/components/form-components/form-radio-box/form-radio-box.tsx +83 -0
- package/src/components/form-components/form-radio-box/index.ts +7 -0
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor-options.ts +6 -0
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor.tsx +22 -0
- package/src/components/form-components/form-rich-text-editor/index.ts +7 -0
- package/src/components/form-components/index.ts +9 -0
- package/src/components/image-select/image-select-option.ts +11 -0
- package/src/components/image-select/image-select.tsx +44 -0
- package/src/components/image-select/index.ts +6 -0
- package/src/components/image-view/image-view-options.ts +14 -0
- package/src/components/image-view/image-view.tsx +30 -0
- package/src/components/image-view/index.ts +7 -0
- package/src/components/index.ts +23 -0
- package/src/components/json-editor/index.ts +8 -0
- package/src/components/json-editor/json-editor-options.ts +21 -0
- package/src/components/json-editor/json-editor.tsx +28 -0
- package/src/components/markdown-editor/index.ts +10 -0
- package/src/components/markdown-editor/markdown-editor-options.ts +17 -0
- package/src/components/markdown-editor/markdown-editor.tsx +136 -0
- package/src/components/material-list/index.ts +7 -0
- package/src/components/material-list/material-group-form-popover.vue +78 -0
- package/src/components/material-list/material-group.vue +145 -0
- package/src/components/material-list/material-item.vue +26 -0
- package/src/components/material-list/material-list-options.ts +24 -0
- package/src/components/material-list/material-list.vue +153 -0
- package/src/components/material-select/index.ts +17 -0
- package/src/components/material-select/material-select-api.ts +55 -0
- package/src/components/material-select/material-select-options.ts +22 -0
- package/src/components/material-select/material-select-type.ts +21 -0
- package/src/components/material-select/material-select.tsx +106 -0
- package/src/components/pagination/index.ts +7 -0
- package/src/components/pagination/pagination-options.tsx +30 -0
- package/src/components/pagination/pagination.tsx +41 -0
- package/src/components/rich-text-editor/index.ts +10 -0
- package/src/components/rich-text-editor/langs/zh-Hans.js +1 -0
- package/src/components/rich-text-editor/rich-text-editor-options.ts +21 -0
- package/src/components/rich-text-editor/rich-text-editor.tsx +111 -0
- package/src/components/role-permission-config/index.ts +7 -0
- package/src/components/role-permission-config/role-permission-config-options.ts +20 -0
- package/src/components/role-permission-config/role-permission-config.tsx +269 -0
- package/src/components/svg-icon/index.ts +5 -0
- package/src/components/svg-icon/svg-icon-options.ts +21 -0
- package/src/components/svg-icon/svg-icon.tsx +48 -0
- package/src/components/system-provider/index.ts +5 -0
- package/src/components/system-provider/system-provider.tsx +95 -0
- package/src/components/upload-file/context/MaterialUploadContext.ts +33 -0
- package/src/components/upload-file/context/UploadContext.ts +21 -0
- package/src/components/upload-file/context/WebFileUploadContext.ts +77 -0
- package/src/components/upload-file/context/index.ts +7 -0
- package/src/components/upload-file/context/material-upload-context-options.ts +13 -0
- package/src/components/upload-file/context/material-upload-context.tsx +34 -0
- package/src/components/upload-file/context/web-file-upload-context-options.ts +16 -0
- package/src/components/upload-file/context/web-file-upload-context.tsx +37 -0
- package/src/components/upload-file/index.ts +11 -0
- package/src/components/upload-file/ui/index.ts +1 -0
- package/src/components/upload-file/ui/upload-image/index.ts +7 -0
- package/src/components/upload-file/ui/upload-image/upload-image-options.ts +25 -0
- package/src/components/upload-file/ui/upload-image/upload-image.tsx +337 -0
- package/src/components/upload-file/upload-file-options.ts +22 -0
- package/src/components/upload-file/upload-file.tsx +69 -0
- package/src/components/verify-dialog/index.ts +5 -0
- package/src/components/verify-dialog/verify-dialog-option.ts +24 -0
- package/src/components/verify-dialog/verify-dialog.tsx +179 -0
- package/src/components/video-view/index.ts +7 -0
- package/src/components/video-view/video-view-options.ts +10 -0
- package/src/components/video-view/video-view.tsx +115 -0
- package/src/composables/create-data-form.ts +6 -0
- package/src/composables/create-data-table.ts +8 -0
- package/src/composables/index.ts +17 -0
- package/src/composables/on-tab-before-close.ts +8 -0
- package/src/composables/on-tab-before-switch.ts +8 -0
- package/src/composables/on-tab-refresh.ts +8 -0
- package/src/composables/use-column-component.ts +184 -0
- package/src/composables/use-current-tab.ts +4 -0
- package/src/composables/use-http-request.ts +5 -0
- package/src/composables/use-i18n.ts +7 -0
- package/src/composables/use-ms-app-client.ts +10 -0
- package/src/composables/use-user-info.ts +4 -0
- package/src/constants/index.ts +6 -0
- package/src/constants/log.ts +5 -0
- package/src/constants/menu.ts +5 -0
- package/src/constants/pattern.ts +4 -0
- package/src/constants/region.ts +6 -0
- package/src/constants/route.ts +4 -0
- package/src/constants/token.ts +5 -0
- package/src/core/DataModelDefines.ts +72 -0
- package/src/core/MSAppClient.ts +260 -0
- package/src/core/PageManager.ts +169 -0
- package/src/core/PermissionPointManager.ts +26 -0
- package/src/core/Router.ts +150 -0
- package/src/core/UserInfo.ts +66 -0
- package/src/core/UserSession.ts +215 -0
- package/src/core/component/ConfigComponents.ts +32 -0
- package/src/core/component/DataFilterComponents.ts +40 -0
- package/src/core/component/DataFormComponents.ts +93 -0
- package/src/core/component/DataTableComponents.ts +91 -0
- package/src/core/component/MaterialComponents.ts +32 -0
- package/src/core/component/index.ts +5 -0
- package/src/core/index.ts +11 -0
- package/src/core/menu/Menu.ts +143 -0
- package/src/core/menu/MenuNode.ts +53 -0
- package/src/core/menu/index.ts +2 -0
- package/src/core/resolver/ITypeResolver.ts +5 -0
- package/src/core/tabs/Tab.ts +59 -0
- package/src/core/tabs/Tabs.ts +187 -0
- package/src/core/tabs/index.ts +2 -0
- package/src/dataview/config/ConfigForm.ts +142 -0
- package/src/dataview/config/ConfigTable.ts +72 -0
- package/src/dataview/config/index.ts +2 -0
- package/src/dataview/deny-ip-access-list/DenyIPAccessListForm.ts +33 -0
- package/src/dataview/deny-ip-access-list/DenyIPAccessListTable.ts +84 -0
- package/src/dataview/deny-ip-access-list/index.ts +2 -0
- package/src/dataview/department/DepartmentForm.ts +41 -0
- package/src/dataview/department/DepartmentTable.ts +64 -0
- package/src/dataview/department/DepartmentTree.ts +47 -0
- package/src/dataview/department/index.ts +3 -0
- package/src/dataview/index.ts +11 -0
- package/src/dataview/ip-white-list/IPWhitelistForm.ts +38 -0
- package/src/dataview/ip-white-list/IPWhitelistTable.ts +81 -0
- package/src/dataview/ip-white-list/index.ts +2 -0
- package/src/dataview/log/index.ts +4 -0
- package/src/dataview/log/local-log/LocalLogTree.ts +77 -0
- package/src/dataview/log/local-log/index.ts +1 -0
- package/src/dataview/log/login-log/LoginLogTable.ts +55 -0
- package/src/dataview/log/login-log/index.ts +1 -0
- package/src/dataview/log/operate-log/OperateLogTable.ts +20 -0
- package/src/dataview/log/operate-log/index.ts +1 -0
- package/src/dataview/log/request-log/RequestLogTable.ts +82 -0
- package/src/dataview/log/request-log/index.ts +1 -0
- package/src/dataview/material/MaterialForm.ts +49 -0
- package/src/dataview/material/MaterialMan.ts +203 -0
- package/src/dataview/material/MaterialTable.ts +125 -0
- package/src/dataview/material/index.ts +4 -0
- package/src/dataview/material/material-group/MaterialGroupForm.ts +27 -0
- package/src/dataview/material/material-group/MaterialGroupTable.ts +57 -0
- package/src/dataview/material/material-group/MaterialGroupTree.ts +71 -0
- package/src/dataview/material/material-group/index.ts +3 -0
- package/src/dataview/member/MemberForm.ts +124 -0
- package/src/dataview/member/MemberTable.tsx +257 -0
- package/src/dataview/member/index.ts +2 -0
- package/src/dataview/member/member-role/MemberRoleTable.ts +23 -0
- package/src/dataview/menu/MenuForm.ts +192 -0
- package/src/dataview/menu/MenuTable.ts +40 -0
- package/src/dataview/menu/MenuTree.ts +112 -0
- package/src/dataview/menu/index.ts +4 -0
- package/src/dataview/menu/permission-point/PermissionPointDefineForm.ts +30 -0
- package/src/dataview/menu/permission-point/PermissionPointDefineTable.ts +32 -0
- package/src/dataview/menu/permission-point/index.ts +2 -0
- package/src/dataview/region/RegionForm.ts +52 -0
- package/src/dataview/region/RegionTable.ts +64 -0
- package/src/dataview/region/index.ts +2 -0
- package/src/dataview/role/RoleForm.ts +34 -0
- package/src/dataview/role/RolePermissionConfigTable.ts +476 -0
- package/src/dataview/role/RoleTable.ts +70 -0
- package/src/dataview/role/index.ts +5 -0
- package/src/dataview/role/role-permission-point/RolePermissionPointTable.ts +29 -0
- package/src/dataview/role/role-permission-point/index.ts +1 -0
- package/src/dataview/role/role-route/RoleRouteTable.ts +30 -0
- package/src/dataview/role/role-route/index.ts +1 -0
- package/src/dataview/route/RouteForm.ts +94 -0
- package/src/dataview/route/RouteTable.ts +73 -0
- package/src/dataview/route/index.ts +2 -0
- package/src/define-data-form.ts +12 -0
- package/src/define-data-table.ts +12 -0
- package/src/define-data-tree.ts +12 -0
- package/src/index.ts +19 -0
- package/src/init-application.ts +83 -0
- package/src/installer.ts +73 -0
- package/src/layouts/components/bar/index.tsx +102 -0
- package/src/layouts/components/dialogs/dialogs.tsx +100 -0
- package/src/layouts/components/dialogs/index.ts +5 -0
- package/src/layouts/components/header/index.tsx +18 -0
- package/src/layouts/components/header/tools.tsx +55 -0
- package/src/layouts/components/index.ts +3 -0
- package/src/layouts/components/lock/index.ts +5 -0
- package/src/layouts/components/lock/lock.tsx +92 -0
- package/src/layouts/components/menu/index.tsx +61 -0
- package/src/layouts/components/menu/menu-item.tsx +63 -0
- package/src/layouts/container/default.tsx +85 -0
- package/src/layouts/index.ts +6 -0
- package/src/layouts/layout.tsx +11 -0
- package/src/message-impl/DialogerImpl.ts +84 -0
- package/src/message-impl/MessagerImpl.ts +17 -0
- package/src/message-impl/NotificationerImpl.ts +17 -0
- package/src/message-impl/index.ts +3 -0
- package/src/page/index/404.vue +3 -0
- package/src/page/index/dv/default/add.vue +50 -0
- package/src/page/index/dv/default/edit.vue +56 -0
- package/src/page/index/dv/default/single/list/dialog.vue +155 -0
- package/src/page/index/dv/default/single/list/normal.vue +128 -0
- package/src/page/index/dv/default/single/table-tree/dialog.vue +60 -0
- package/src/page/index/dv/default/single/tree/dialog.vue +174 -0
- package/src/page/index/dv/default/table.vue +52 -0
- package/src/page/index/dv/local-log/index.vue +98 -0
- package/src/page/index/dv/ms-member/index.vue +33 -0
- package/src/page/index/dv/ms-role/index.vue +32 -0
- package/src/page/index/material/index.vue +16 -0
- package/src/page/index.vue +9 -0
- package/src/page/login/index.vue +196 -0
- package/src/page/signup/index.vue +157 -0
- package/src/router-middleware/auth.ts +31 -0
- package/src/router-middleware/index.ts +1 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/ms-app-client.ts +10 -0
- package/src/utils.ts +233 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DataTable, DataTableOptions, TableColumn } from "@maketribe/dm";
|
|
2
|
+
|
|
3
|
+
export type RolePermissionPoint = {
|
|
4
|
+
id: string;
|
|
5
|
+
permissionPointDefId: string;
|
|
6
|
+
roleId: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export class RolePermissionPointTable extends DataTable<RolePermissionPoint> {
|
|
10
|
+
constructor(options: DataTableOptions = {}) {
|
|
11
|
+
super({
|
|
12
|
+
name: "ms-role-permission-point",
|
|
13
|
+
...options,
|
|
14
|
+
interfaceURL: {
|
|
15
|
+
list: `/api/dv/ms-role-permission-point/allList`,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
protected async initialize() {
|
|
21
|
+
await super.initialize();
|
|
22
|
+
|
|
23
|
+
this.setColumns([
|
|
24
|
+
new TableColumn({ name: "id", visible: false }),
|
|
25
|
+
new TableColumn({ name: "roleId" }),
|
|
26
|
+
new TableColumn({ name: "permissionPointDefId" }),
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RolePermissionPointTable";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DataTable, DataTableOptions, TableColumn } from "@maketribe/dm";
|
|
2
|
+
|
|
3
|
+
export type RoleRoute = {
|
|
4
|
+
id: string;
|
|
5
|
+
roleId: string;
|
|
6
|
+
routeId: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export class RoleRouteTable extends DataTable<RoleRoute> {
|
|
10
|
+
constructor(options: DataTableOptions = {}) {
|
|
11
|
+
super({
|
|
12
|
+
name: "ms-role-route",
|
|
13
|
+
...options,
|
|
14
|
+
|
|
15
|
+
interfaceURL: {
|
|
16
|
+
list: `/api/dv/ms-role-route/allList`,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected async initialize() {
|
|
22
|
+
await super.initialize();
|
|
23
|
+
|
|
24
|
+
this.setColumns([
|
|
25
|
+
new TableColumn({ name: "id", visible: false }),
|
|
26
|
+
new TableColumn({ name: "roleId" }),
|
|
27
|
+
new TableColumn({ name: "routeId" }),
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RoleRouteTable";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DataForm, DataFormOptions, FormColumn } from "@maketribe/dm";
|
|
2
|
+
import { defineDataForm } from "../../define-data-form";
|
|
3
|
+
import { RouteType } from "../../constants";
|
|
4
|
+
import { MenuTable } from "../menu/MenuTable";
|
|
5
|
+
|
|
6
|
+
export type RouteResult = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
title: string;
|
|
10
|
+
type: number;
|
|
11
|
+
menuId: string;
|
|
12
|
+
iconName: string;
|
|
13
|
+
route?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type Route = {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
title: string;
|
|
20
|
+
type: RouteType;
|
|
21
|
+
menuId: string;
|
|
22
|
+
iconName: string;
|
|
23
|
+
route: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export class RouteForm extends DataForm<RouteResult, Route> {
|
|
27
|
+
constructor(options: DataFormOptions = {}) {
|
|
28
|
+
super({ name: "ms-route", ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
protected async initialize() {
|
|
32
|
+
await super.initialize();
|
|
33
|
+
|
|
34
|
+
this.setColumns([
|
|
35
|
+
new FormColumn({ name: "id", label: "编号" }),
|
|
36
|
+
new FormColumn({ name: "name", label: "路由名", required: true }),
|
|
37
|
+
new FormColumn({ name: "title", label: "路由描述", required: true }),
|
|
38
|
+
new FormColumn({
|
|
39
|
+
name: "menuId",
|
|
40
|
+
label: "所属菜单",
|
|
41
|
+
componentInfo: "MKFormDataTableSelect",
|
|
42
|
+
required: true,
|
|
43
|
+
componentProps: {
|
|
44
|
+
labelFieldName: "title",
|
|
45
|
+
dataTable: new MenuTable({ pageSize: 10 }),
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
new FormColumn({
|
|
49
|
+
name: "iconName",
|
|
50
|
+
label: "图标",
|
|
51
|
+
componentInfo: "MKFormIconSelect",
|
|
52
|
+
}),
|
|
53
|
+
new FormColumn({ name: "route", label: "路径" }),
|
|
54
|
+
new FormColumn({
|
|
55
|
+
name: "type",
|
|
56
|
+
label: "路由类型",
|
|
57
|
+
defaultValue: RouteType.ROUTE,
|
|
58
|
+
componentInfo: "MKFormDataSelect",
|
|
59
|
+
required: true,
|
|
60
|
+
componentProps: {
|
|
61
|
+
options: [
|
|
62
|
+
{ value: RouteType.ROUTE, label: "站内路由" },
|
|
63
|
+
{ value: RouteType.LINK, label: "站外链接" },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
formatSubmitData(data: any) {
|
|
71
|
+
const type = Number.parseInt(data.type);
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
...data,
|
|
75
|
+
iconName: data.iconName || null,
|
|
76
|
+
type: Number.isNaN(type) ? RouteType.ROUTE : type,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
formatItem(item: RouteResult): Route {
|
|
81
|
+
return {
|
|
82
|
+
id: item.id,
|
|
83
|
+
name: item.name || "",
|
|
84
|
+
title: item.title || "",
|
|
85
|
+
type:
|
|
86
|
+
`${item.type}` === RouteType.ROUTE ? RouteType.ROUTE : RouteType.LINK,
|
|
87
|
+
menuId: item.menuId,
|
|
88
|
+
iconName: item.iconName || "",
|
|
89
|
+
route: item.route || "",
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
defineDataForm(RouteForm);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataTable,
|
|
3
|
+
DataTableOptions,
|
|
4
|
+
TableColumn,
|
|
5
|
+
FilterColumn,
|
|
6
|
+
TableActionColumn,
|
|
7
|
+
} from "@maketribe/dm";
|
|
8
|
+
import { defineDataTable } from "../../define-data-table";
|
|
9
|
+
import { Route, RouteResult } from "./RouteForm";
|
|
10
|
+
import { RouteType } from "../../constants";
|
|
11
|
+
|
|
12
|
+
export class RouteTable extends DataTable<RouteResult, Route> {
|
|
13
|
+
constructor(options: DataTableOptions = {}) {
|
|
14
|
+
super({ name: "ms-route", ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected async initialize() {
|
|
18
|
+
await super.initialize();
|
|
19
|
+
|
|
20
|
+
this.dataFilter.setColumns([
|
|
21
|
+
new FilterColumn({
|
|
22
|
+
name: "name",
|
|
23
|
+
label: "路由名",
|
|
24
|
+
componentInfo: "MKConditionInput",
|
|
25
|
+
}),
|
|
26
|
+
new FilterColumn({
|
|
27
|
+
name: "title",
|
|
28
|
+
label: "路由描述",
|
|
29
|
+
componentInfo: "MKConditionInput",
|
|
30
|
+
}),
|
|
31
|
+
new FilterColumn({
|
|
32
|
+
name: "type",
|
|
33
|
+
label: "路由类型",
|
|
34
|
+
componentInfo: "MKConditionSelect",
|
|
35
|
+
componentProps: {
|
|
36
|
+
options: [
|
|
37
|
+
{ value: 0, label: "站内路由" },
|
|
38
|
+
{ value: 1, label: "站外链接" },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
this.setColumns([
|
|
45
|
+
new TableColumn({ name: "name", label: "路由名" }),
|
|
46
|
+
new TableColumn({ name: "title", label: "路由描述" }),
|
|
47
|
+
new TableColumn({ name: "route", label: "路径" }),
|
|
48
|
+
new TableColumn({
|
|
49
|
+
name: "type",
|
|
50
|
+
label: "路由类型",
|
|
51
|
+
componentInfo: "MKColumnObjectMappingText",
|
|
52
|
+
componentProps: {
|
|
53
|
+
mapping: { 0: "站内路由", 1: "站外链接" },
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
new TableActionColumn(),
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
formatItem(item: RouteResult): Route {
|
|
61
|
+
return {
|
|
62
|
+
id: item.id,
|
|
63
|
+
name: item.name || "",
|
|
64
|
+
title: item.title || "",
|
|
65
|
+
type: item.type === 0 ? RouteType.ROUTE : RouteType.LINK,
|
|
66
|
+
menuId: item.menuId,
|
|
67
|
+
iconName: item.iconName || "",
|
|
68
|
+
route: item.route || "",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
defineDataTable(RouteTable);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataFormClass, DataModelDefines } from "./core";
|
|
2
|
+
|
|
3
|
+
export const defineDataForm = <T extends DataFormClass>(
|
|
4
|
+
DataFormClass: T
|
|
5
|
+
): T => {
|
|
6
|
+
DataModelDefines.instance.registerDataFormDefine(
|
|
7
|
+
new DataFormClass({}).name,
|
|
8
|
+
DataFormClass
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
return DataFormClass;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataModelDefines, DataTableClass } from "./core";
|
|
2
|
+
|
|
3
|
+
export const defineDataTable = <T extends DataTableClass>(
|
|
4
|
+
DataTableClass: T
|
|
5
|
+
): T => {
|
|
6
|
+
DataModelDefines.instance.registerDataTableDefine(
|
|
7
|
+
new DataTableClass({}).name,
|
|
8
|
+
DataTableClass
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
return DataTableClass;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataTreeClass, DataModelDefines } from "./core";
|
|
2
|
+
|
|
3
|
+
export const defineDataTree = <T extends DataTreeClass>(
|
|
4
|
+
DataTreeClass: T
|
|
5
|
+
): T => {
|
|
6
|
+
DataModelDefines.instance.registerDataTreeDefine(
|
|
7
|
+
new DataTreeClass({}).name,
|
|
8
|
+
DataTreeClass
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
return DataTreeClass;
|
|
12
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * from "./dataview";
|
|
3
|
+
|
|
4
|
+
export * from "./core";
|
|
5
|
+
|
|
6
|
+
import { installer } from "./installer";
|
|
7
|
+
|
|
8
|
+
export * from "./layouts";
|
|
9
|
+
export * from "./composables";
|
|
10
|
+
export * from "./components";
|
|
11
|
+
export * from "./tokens";
|
|
12
|
+
|
|
13
|
+
export const install = installer.install;
|
|
14
|
+
export const version = installer.version;
|
|
15
|
+
|
|
16
|
+
export * from "./init-application";
|
|
17
|
+
export * from "./define-data-table";
|
|
18
|
+
export * from "./define-data-form";
|
|
19
|
+
export * from "./define-data-tree";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { App, reactive } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
createRouter,
|
|
4
|
+
createWebHashHistory,
|
|
5
|
+
Router as VueRouter,
|
|
6
|
+
} from "vue-router";
|
|
7
|
+
import { MSAppClient } from "./core";
|
|
8
|
+
import { HttpRequest, WebHttpRequest } from "@maketribe/request";
|
|
9
|
+
import { MSAPPCLIENT_CONTEXT_KEY } from "./tokens";
|
|
10
|
+
|
|
11
|
+
import { generateRoutesFromFiles } from "./utils";
|
|
12
|
+
import {
|
|
13
|
+
DataFilterComponents,
|
|
14
|
+
DataFormComponents,
|
|
15
|
+
DataTableComponents,
|
|
16
|
+
} from "./core";
|
|
17
|
+
|
|
18
|
+
export type InitMsApplicationOptions = {
|
|
19
|
+
routes: any;
|
|
20
|
+
vueRouter?: VueRouter;
|
|
21
|
+
app: App;
|
|
22
|
+
appID: string;
|
|
23
|
+
logo?: string;
|
|
24
|
+
projectName: string;
|
|
25
|
+
locale?: string;
|
|
26
|
+
httpRequest?: HttpRequest;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const initApplication = async (options: InitMsApplicationOptions) => {
|
|
30
|
+
const app = options.app;
|
|
31
|
+
|
|
32
|
+
const vueRouter =
|
|
33
|
+
options.vueRouter ??
|
|
34
|
+
createRouter({
|
|
35
|
+
history: createWebHashHistory(),
|
|
36
|
+
routes: [],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const msAppClient = reactive(
|
|
40
|
+
new MSAppClient({
|
|
41
|
+
appID: options!.appID,
|
|
42
|
+
logo: options!.logo ?? "",
|
|
43
|
+
projectName: options!.projectName,
|
|
44
|
+
httpRequest: options.httpRequest ?? new WebHttpRequest(),
|
|
45
|
+
origin: location.origin,
|
|
46
|
+
locale: options!.locale,
|
|
47
|
+
vueRouter,
|
|
48
|
+
dataTableComponents: new DataTableComponents(),
|
|
49
|
+
dataFormComponents: new DataFormComponents(),
|
|
50
|
+
dataFilterComponents: new DataFilterComponents(),
|
|
51
|
+
whereFilterComponents: new DataFilterComponents(),
|
|
52
|
+
})
|
|
53
|
+
) as unknown as MSAppClient;
|
|
54
|
+
|
|
55
|
+
app.provide(MSAPPCLIENT_CONTEXT_KEY, { msAppClient });
|
|
56
|
+
|
|
57
|
+
MSAppClient.instance = msAppClient;
|
|
58
|
+
|
|
59
|
+
(window as any).msAppClient = msAppClient;
|
|
60
|
+
|
|
61
|
+
const routes = generateRoutesFromFiles(
|
|
62
|
+
Object.keys(options.routes).map((key) => {
|
|
63
|
+
return {
|
|
64
|
+
path: key.replace(/^\.\/pages\/(.+)\.vue$/, (_, g) => g),
|
|
65
|
+
module: options.routes[key]?.default || options.routes[key],
|
|
66
|
+
};
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
for (const route of routes) {
|
|
71
|
+
if (route.key.startsWith("index")) {
|
|
72
|
+
msAppClient.pageManager.addExtendsPage(route);
|
|
73
|
+
} else {
|
|
74
|
+
msAppClient.pageManager.addNormalPage(route);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
await msAppClient.init();
|
|
79
|
+
|
|
80
|
+
app.use(msAppClient.vueRouter);
|
|
81
|
+
|
|
82
|
+
return msAppClient;
|
|
83
|
+
};
|
package/src/installer.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Plugin } from "vue";
|
|
2
|
+
import { makeInstaller } from "@maketribe/utils";
|
|
3
|
+
import { Dialoger, Messager, Notificationer } from "@maketribe/dm";
|
|
4
|
+
import { DialogerImpl, MessagerImpl, NotificationerImpl } from "./message-impl";
|
|
5
|
+
import {
|
|
6
|
+
ConfigProviderContext,
|
|
7
|
+
MKConfigProvider,
|
|
8
|
+
MKDataForm,
|
|
9
|
+
MKDataFormPage,
|
|
10
|
+
MKDataTable,
|
|
11
|
+
MKDataTablePage,
|
|
12
|
+
MKImageView,
|
|
13
|
+
MKSvgIcon,
|
|
14
|
+
MKVideoView,
|
|
15
|
+
provideGlobalConfig,
|
|
16
|
+
MKDataTableSelect,
|
|
17
|
+
MKDataTableSelectDialog,
|
|
18
|
+
MKPagination,
|
|
19
|
+
MKDataTablePagination,
|
|
20
|
+
MKMarkdownEditor,
|
|
21
|
+
MKRichTextEditor,
|
|
22
|
+
MKMaterialList,
|
|
23
|
+
MKMaterialSelect,
|
|
24
|
+
MKSystemProvider,
|
|
25
|
+
MKRolePermissionConfig,
|
|
26
|
+
MKImageSelect,
|
|
27
|
+
MKVerifyDialog,
|
|
28
|
+
MKUploadFile,
|
|
29
|
+
MKUploadImage,
|
|
30
|
+
MKWebFileUploadContext,
|
|
31
|
+
MKMaterialUploadContext,
|
|
32
|
+
} from "./components";
|
|
33
|
+
|
|
34
|
+
const components: Plugin[] = [
|
|
35
|
+
MKConfigProvider,
|
|
36
|
+
MKDataForm,
|
|
37
|
+
MKDataFormPage,
|
|
38
|
+
MKDataTable,
|
|
39
|
+
MKDataTablePage,
|
|
40
|
+
MKImageView,
|
|
41
|
+
MKSvgIcon,
|
|
42
|
+
MKVideoView,
|
|
43
|
+
MKDataTableSelect,
|
|
44
|
+
MKDataTableSelectDialog,
|
|
45
|
+
MKPagination,
|
|
46
|
+
MKDataTablePagination,
|
|
47
|
+
MKMarkdownEditor,
|
|
48
|
+
MKRichTextEditor,
|
|
49
|
+
MKMaterialList,
|
|
50
|
+
MKMaterialSelect,
|
|
51
|
+
MKSystemProvider,
|
|
52
|
+
MKRolePermissionConfig,
|
|
53
|
+
MKImageSelect,
|
|
54
|
+
MKVerifyDialog,
|
|
55
|
+
MKUploadFile,
|
|
56
|
+
MKUploadImage,
|
|
57
|
+
MKWebFileUploadContext,
|
|
58
|
+
MKMaterialUploadContext,
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
export const installer = makeInstaller<ConfigProviderContext>(
|
|
62
|
+
components,
|
|
63
|
+
"1.0.0-dev",
|
|
64
|
+
(app, version, options) => {
|
|
65
|
+
if (options) {
|
|
66
|
+
provideGlobalConfig(options, app, true);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Messager.implInstance = new MessagerImpl();
|
|
70
|
+
Dialoger.implInstance = new DialogerImpl();
|
|
71
|
+
Notificationer.implInstance = new NotificationerImpl();
|
|
72
|
+
}
|
|
73
|
+
);
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { computed, defineComponent, unref } from "vue";
|
|
2
|
+
import { MKSvgIcon } from "../../../components";
|
|
3
|
+
import { MSAppClient, MenuNode } from "../../../core";
|
|
4
|
+
import { MenuType } from "../../../constants";
|
|
5
|
+
|
|
6
|
+
export const MKBar = defineComponent({
|
|
7
|
+
name: "MKBar",
|
|
8
|
+
props: {
|
|
9
|
+
barItem: {
|
|
10
|
+
type: MenuNode,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
setup(props) {
|
|
14
|
+
const msAppClient = MSAppClient.instance!;
|
|
15
|
+
const userSession = msAppClient.userSession!;
|
|
16
|
+
const menu = userSession.menu;
|
|
17
|
+
const vueRouter = msAppClient.vueRouter;
|
|
18
|
+
// const router = userSession.router;
|
|
19
|
+
|
|
20
|
+
const currentBarItem = computed(() => props.barItem);
|
|
21
|
+
|
|
22
|
+
const handleBarItemClick = (barItem: MenuNode) => {
|
|
23
|
+
let target: MenuNode | null = barItem;
|
|
24
|
+
|
|
25
|
+
if (barItem.children.length) {
|
|
26
|
+
target = menu.getFirstLeafMenuNode(barItem.children);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!target) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (target?.route) {
|
|
34
|
+
vueRouter.push({ name: target.route.name });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
const barItems = menu.rootMenus
|
|
40
|
+
.filter((rootMenu) => rootMenu.type !== "3")
|
|
41
|
+
.map((rootMenu) => (
|
|
42
|
+
<div
|
|
43
|
+
class={[
|
|
44
|
+
"mk-bar__item",
|
|
45
|
+
rootMenu.children.length ? "has-children" : "",
|
|
46
|
+
unref(currentBarItem)?.id === rootMenu.id ? "is-active" : "",
|
|
47
|
+
]}
|
|
48
|
+
onClick={() => handleBarItemClick(rootMenu)}
|
|
49
|
+
>
|
|
50
|
+
<div class="mk-bar__item-button">
|
|
51
|
+
<MKSvgIcon iconClass={rootMenu.iconName} />
|
|
52
|
+
</div>
|
|
53
|
+
<div class="mk-bar__item-title">{rootMenu.title} </div>
|
|
54
|
+
</div>
|
|
55
|
+
));
|
|
56
|
+
|
|
57
|
+
const systemSettingNode = menu.rootMenus.find(
|
|
58
|
+
(rootMenu) => rootMenu.type === MenuType.SystemSettings
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const footer = systemSettingNode?.children.length ? (
|
|
62
|
+
<div class="mk-bar__footer">
|
|
63
|
+
<div
|
|
64
|
+
class={[
|
|
65
|
+
"mk-bar__item",
|
|
66
|
+
"mk-bar__settings",
|
|
67
|
+
systemSettingNode.children.length ? "has-children" : "",
|
|
68
|
+
unref(currentBarItem)?.id === systemSettingNode.id
|
|
69
|
+
? "is-active"
|
|
70
|
+
: "",
|
|
71
|
+
]}
|
|
72
|
+
onClick={() => handleBarItemClick(systemSettingNode)}
|
|
73
|
+
>
|
|
74
|
+
<div class="mk-bar__item-button">
|
|
75
|
+
<MKSvgIcon iconClass={systemSettingNode.iconName} />
|
|
76
|
+
</div>
|
|
77
|
+
<div class="mk-bar__item-title">{systemSettingNode.title} </div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
) : null;
|
|
81
|
+
|
|
82
|
+
const logo = msAppClient.logo ? (
|
|
83
|
+
<div class="mk-bar__logo">
|
|
84
|
+
<div
|
|
85
|
+
class="mk-logo"
|
|
86
|
+
style={{ backgroundImage: `url(${msAppClient.logo})` }}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
) : null;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div class="mk-bar">
|
|
93
|
+
{logo}
|
|
94
|
+
|
|
95
|
+
<div class="mk-bar__items">{barItems}</div>
|
|
96
|
+
|
|
97
|
+
{footer}
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Fragment, Ref, defineComponent, ref, unref } from "vue";
|
|
2
|
+
import { DialogInstance, Dialoger } from "@maketribe/dm";
|
|
3
|
+
import { DialogerImpl } from "../../../message-impl";
|
|
4
|
+
import { isFunction } from "lodash-es";
|
|
5
|
+
import { ElButton, ElDialog } from "element-plus";
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: "MKDialogs",
|
|
9
|
+
setup(props) {
|
|
10
|
+
const dialogInstances: Ref<DialogInstance[]> = ref([]);
|
|
11
|
+
|
|
12
|
+
const dialogImplInstance = Dialoger.implInstance as DialogerImpl | null;
|
|
13
|
+
|
|
14
|
+
if (
|
|
15
|
+
dialogImplInstance?.dialogInstanceCreateEvent &&
|
|
16
|
+
isFunction(dialogImplInstance.dialogInstanceCreateEvent.on)
|
|
17
|
+
) {
|
|
18
|
+
dialogImplInstance.dialogInstanceCreateEvent.on((dialogInstance) => {
|
|
19
|
+
dialogInstance.destroyEvent.on(() => {
|
|
20
|
+
const index = dialogInstances.value.findIndex(
|
|
21
|
+
(instance) => dialogInstance.id === instance.id
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (index === -1) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
dialogInstances.value.splice(index, 1);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
dialogInstances.value.push(dialogInstance);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const handleCancel = async (dialogInstance: DialogInstance) => {
|
|
36
|
+
if (
|
|
37
|
+
isFunction(dialogInstance.onCancel)
|
|
38
|
+
? (await dialogInstance.onCancel()) === false
|
|
39
|
+
: false
|
|
40
|
+
) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
dialogInstance.visible = false;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const handleConfirm = async (dialogInstance: DialogInstance) => {
|
|
48
|
+
if (
|
|
49
|
+
isFunction(dialogInstance.onConfirm)
|
|
50
|
+
? (await dialogInstance.onConfirm()) === false
|
|
51
|
+
: false
|
|
52
|
+
) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dialogInstance.visible = false;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
const dialogs = unref(dialogInstances).map((dialogInstance) => {
|
|
61
|
+
return (
|
|
62
|
+
<ElDialog
|
|
63
|
+
modelValue={dialogInstance.visible}
|
|
64
|
+
onUpdate:modelValue={(visible: boolean) =>
|
|
65
|
+
(dialogInstance.visible = visible)
|
|
66
|
+
}
|
|
67
|
+
appendToBody
|
|
68
|
+
destroyOnClose={true}
|
|
69
|
+
width={dialogInstance.width}
|
|
70
|
+
v-slots={{
|
|
71
|
+
header: () =>
|
|
72
|
+
isFunction(dialogInstance.header)
|
|
73
|
+
? dialogInstance.header?.()
|
|
74
|
+
: dialogInstance.title || "",
|
|
75
|
+
default: () => dialogInstance.body(),
|
|
76
|
+
footer: () =>
|
|
77
|
+
isFunction(dialogInstance.footer) ? (
|
|
78
|
+
dialogInstance.footer?.()
|
|
79
|
+
) : (
|
|
80
|
+
<Fragment>
|
|
81
|
+
<ElButton onClick={() => handleCancel(dialogInstance)}>
|
|
82
|
+
{dialogInstance.cancelButtonText ?? "取消"}
|
|
83
|
+
</ElButton>
|
|
84
|
+
<ElButton
|
|
85
|
+
type="primary"
|
|
86
|
+
onClick={() => handleConfirm(dialogInstance)}
|
|
87
|
+
>
|
|
88
|
+
{dialogInstance.confirmButtonText ?? "确认"}
|
|
89
|
+
</ElButton>
|
|
90
|
+
</Fragment>
|
|
91
|
+
),
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
return <Fragment>{dialogs}</Fragment>;
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { MKHeaderTools } from "./tools";
|
|
3
|
+
|
|
4
|
+
export const MKHeader = defineComponent({
|
|
5
|
+
name: "MKHeader",
|
|
6
|
+
setup() {
|
|
7
|
+
return () => {
|
|
8
|
+
return (
|
|
9
|
+
<div class="mk-header">
|
|
10
|
+
<div class="mk-header__main"></div>
|
|
11
|
+
<div class="mk-header__tools">
|
|
12
|
+
<MKHeaderTools />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
});
|