@maketribe/ms-app 3.0.38 → 3.0.40
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/dist/cjs/core/UserInfo.d.ts +1 -1
- package/dist/cjs/core/UserInfo.js +2 -1
- package/dist/cjs/core/UserInfo.js.map +1 -1
- package/dist/esm/core/UserInfo.d.ts +1 -1
- package/dist/esm/core/UserInfo.js +2 -1
- package/dist/esm/core/UserInfo.js.map +1 -1
- package/dist/style/index.css +1 -1
- package/dist/style/layouts/default/header.css +1 -1
- package/dist/style/layouts/default/index.css +1 -1
- package/dist/style/layouts/index.css +1 -1
- package/dist/style/src/layouts/default/header.scss +1 -0
- package/package.json +1 -1
- package/src/components/button/button-options.ts +0 -22
- package/src/components/button/button.tsx +0 -37
- package/src/components/button/index.ts +0 -7
- package/src/components/column-components/column-action/column-action-options.ts +0 -11
- package/src/components/column-components/column-action/column-action.tsx +0 -36
- package/src/components/column-components/column-action/index.ts +0 -4
- package/src/components/column-components/column-date/column-date-options.ts +0 -12
- package/src/components/column-components/column-date/column-date.tsx +0 -47
- package/src/components/column-components/column-date/index.ts +0 -6
- package/src/components/column-components/column-image/column-image-options.ts +0 -9
- package/src/components/column-components/column-image/column-image.tsx +0 -20
- package/src/components/column-components/column-image/index.ts +0 -4
- package/src/components/column-components/column-json/column-json-options.ts +0 -13
- package/src/components/column-components/column-json/column-json.tsx +0 -41
- package/src/components/column-components/column-json/index.ts +0 -8
- package/src/components/column-components/column-link/column-link-options.ts +0 -34
- package/src/components/column-components/column-link/column-link.tsx +0 -27
- package/src/components/column-components/column-link/index.ts +0 -7
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text-options.ts +0 -12
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text.tsx +0 -22
- package/src/components/column-components/column-object-mapping-text/index.ts +0 -6
- package/src/components/column-components/column-select/column-select-header-options.ts +0 -8
- package/src/components/column-components/column-select/column-select-header.tsx +0 -57
- package/src/components/column-components/column-select/column-select-options.ts +0 -9
- package/src/components/column-components/column-select/column-select.tsx +0 -74
- package/src/components/column-components/column-select/index.ts +0 -5
- package/src/components/column-components/column-switch/column-switch-options.ts +0 -16
- package/src/components/column-components/column-switch/column-switch.tsx +0 -37
- package/src/components/column-components/column-switch/index.ts +0 -6
- package/src/components/column-components/column-tag/column-tag-options.ts +0 -42
- package/src/components/column-components/column-tag/column-tag.tsx +0 -59
- package/src/components/column-components/column-tag/index.ts +0 -6
- package/src/components/column-components/column-text/column-text-options.ts +0 -10
- package/src/components/column-components/column-text/column-text.tsx +0 -18
- package/src/components/column-components/column-text/index.ts +0 -6
- package/src/components/column-components/index.ts +0 -10
- package/src/components/condition-components/condition-date/condition-date-options.ts +0 -25
- package/src/components/condition-components/condition-date/condition-date.tsx +0 -70
- package/src/components/condition-components/condition-date/index.ts +0 -7
- package/src/components/condition-components/condition-input/condition-input-options.ts +0 -10
- package/src/components/condition-components/condition-input/condition-input.tsx +0 -41
- package/src/components/condition-components/condition-input/index.ts +0 -7
- package/src/components/condition-components/condition-number/condition-number-options.ts +0 -22
- package/src/components/condition-components/condition-number/condition-number.tsx +0 -74
- package/src/components/condition-components/condition-number/index.ts +0 -7
- package/src/components/condition-components/condition-select/condition-select-options.ts +0 -31
- package/src/components/condition-components/condition-select/condition-select.tsx +0 -56
- package/src/components/condition-components/condition-select/index.ts +0 -7
- package/src/components/condition-components/index.ts +0 -4
- package/src/components/config-provider/config-provider-options.ts +0 -24
- package/src/components/config-provider/config-provider.tsx +0 -21
- package/src/components/config-provider/constants.ts +0 -8
- package/src/components/config-provider/index.ts +0 -9
- package/src/components/config-provider/use-global-config.ts +0 -70
- package/src/components/data-model/data-filter-form/composables/index.ts +0 -1
- package/src/components/data-model/data-filter-form/composables/use-condition.ts +0 -68
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item-options.ts +0 -11
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item.tsx +0 -183
- package/src/components/data-model/data-filter-form/data-filter-form-item/index.ts +0 -7
- package/src/components/data-model/data-filter-form/data-filter-form-options.ts +0 -15
- package/src/components/data-model/data-filter-form/data-filter-form.tsx +0 -103
- package/src/components/data-model/data-filter-form/index.ts +0 -13
- package/src/components/data-model/data-filter-form/operator-options.ts +0 -48
- package/src/components/data-model/data-filter-form/token.ts +0 -30
- package/src/components/data-model/data-filter-popover/data-filter-popover-options.ts +0 -6
- package/src/components/data-model/data-filter-popover/data-filter-popover.tsx +0 -52
- package/src/components/data-model/data-filter-popover/index.ts +0 -8
- package/src/components/data-model/data-form/composables/index.ts +0 -1
- package/src/components/data-model/data-form/composables/use-form-item.ts +0 -40
- package/src/components/data-model/data-form/data-form-item/data-form-item-options.ts +0 -11
- package/src/components/data-model/data-form/data-form-item/data-form-item.tsx +0 -140
- package/src/components/data-model/data-form/data-form-item/index.ts +0 -6
- package/src/components/data-model/data-form/data-form-options.ts +0 -43
- package/src/components/data-model/data-form/data-form.tsx +0 -113
- package/src/components/data-model/data-form/index.ts +0 -13
- package/src/components/data-model/data-form/token.ts +0 -16
- package/src/components/data-model/data-form/views/form/form-options.ts +0 -16
- package/src/components/data-model/data-form/views/form/form.tsx +0 -206
- package/src/components/data-model/data-form/views/form/index.ts +0 -6
- package/src/components/data-model/data-form/views/form-view/form-view-options.ts +0 -17
- package/src/components/data-model/data-form/views/form-view/form-view.tsx +0 -68
- package/src/components/data-model/data-form/views/form-view/index.ts +0 -6
- package/src/components/data-model/data-form/views/index.ts +0 -2
- package/src/components/data-model/data-form-page/data-form-page-options.ts +0 -20
- package/src/components/data-model/data-form-page/data-form-page.tsx +0 -57
- package/src/components/data-model/data-form-page/index.ts +0 -7
- package/src/components/data-model/data-table/composables/index.ts +0 -1
- package/src/components/data-model/data-table/composables/use-column.ts +0 -23
- package/src/components/data-model/data-table/data-table-column/data-table-column-options.ts +0 -11
- package/src/components/data-model/data-table/data-table-column/data-table-column.tsx +0 -18
- package/src/components/data-model/data-table/data-table-column/index.ts +0 -7
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component-options.ts +0 -13
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component.tsx +0 -38
- package/src/components/data-model/data-table/data-table-column-component/index.ts +0 -7
- package/src/components/data-model/data-table/data-table-options.ts +0 -24
- package/src/components/data-model/data-table/data-table.tsx +0 -102
- package/src/components/data-model/data-table/index.ts +0 -17
- package/src/components/data-model/data-table/token.ts +0 -10
- package/src/components/data-model/data-table/views/index.ts +0 -5
- package/src/components/data-model/data-table/views/table/index.ts +0 -8
- package/src/components/data-model/data-table/views/table/table-options.ts +0 -12
- package/src/components/data-model/data-table/views/table/table.tsx +0 -98
- package/src/components/data-model/data-table/views/table-tree/index.ts +0 -8
- package/src/components/data-model/data-table/views/table-tree/table-tree-options.ts +0 -12
- package/src/components/data-model/data-table/views/table-tree/table-tree.tsx +0 -104
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item-options.ts +0 -34
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item.tsx +0 -97
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/index.ts +0 -5
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search.tsx +0 -40
- package/src/components/data-model/data-table/views/table-view/classify-search/index.ts +0 -7
- package/src/components/data-model/data-table/views/table-view/index.ts +0 -8
- package/src/components/data-model/data-table/views/table-view/table-view-options.ts +0 -13
- package/src/components/data-model/data-table/views/table-view/table-view.tsx +0 -126
- package/src/components/data-model/data-table/views/tree/index.ts +0 -8
- package/src/components/data-model/data-table/views/tree/tree-options.ts +0 -14
- package/src/components/data-model/data-table/views/tree/tree.tsx +0 -131
- package/src/components/data-model/data-table/views/tree-view/index.ts +0 -8
- package/src/components/data-model/data-table/views/tree-view/tree-view-options.ts +0 -16
- package/src/components/data-model/data-table/views/tree-view/tree-view.tsx +0 -81
- package/src/components/data-model/data-table-page/data-table-page-options.ts +0 -11
- package/src/components/data-model/data-table-page/data-table-page.tsx +0 -26
- package/src/components/data-model/data-table-page/index.ts +0 -6
- package/src/components/data-model/data-table-pagination/data-table-pagination-options.ts +0 -14
- package/src/components/data-model/data-table-pagination/data-table-pagination.tsx +0 -22
- package/src/components/data-model/data-table-pagination/index.ts +0 -7
- package/src/components/data-model/filter-panel/composables/index.ts +0 -1
- package/src/components/data-model/filter-panel/composables/use-condition.ts +0 -66
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item-options.ts +0 -11
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item.tsx +0 -187
- package/src/components/data-model/filter-panel/filter-panel-item/index.ts +0 -7
- package/src/components/data-model/filter-panel/filter-panel-options.ts +0 -15
- package/src/components/data-model/filter-panel/filter-panel.tsx +0 -102
- package/src/components/data-model/filter-panel/index.ts +0 -11
- package/src/components/data-model/filter-panel/operator-options.ts +0 -48
- package/src/components/data-model/filter-panel/token.ts +0 -17
- package/src/components/data-model/index.ts +0 -5
- package/src/components/data-select/data-select-options.ts +0 -43
- package/src/components/data-select/data-select.tsx +0 -87
- package/src/components/data-select/index.ts +0 -7
- package/src/components/data-table-select/data-table-select-options.ts +0 -43
- package/src/components/data-table-select/data-table-select.tsx +0 -190
- package/src/components/data-table-select/index.ts +0 -6
- package/src/components/data-table-select-dialog/data-table-select-dialog-options.ts +0 -33
- package/src/components/data-table-select-dialog/data-table-select-dialog.tsx +0 -154
- package/src/components/data-table-select-dialog/index.ts +0 -7
- package/src/components/file-view/file-view-options.ts +0 -8
- package/src/components/file-view/file-view.tsx +0 -40
- package/src/components/file-view/index.ts +0 -7
- package/src/components/form-components/form-data-select/form-data-select-options.ts +0 -23
- package/src/components/form-components/form-data-select/form-data-select.tsx +0 -28
- package/src/components/form-components/form-data-select/index.ts +0 -7
- package/src/components/form-components/form-data-table-select/form-data-table-select-options.ts +0 -19
- package/src/components/form-components/form-data-table-select/form-data-table-select.tsx +0 -32
- package/src/components/form-components/form-data-table-select/index.ts +0 -7
- package/src/components/form-components/form-date-picker/form-date-picker-options.ts +0 -18
- package/src/components/form-components/form-date-picker/form-date-picker.tsx +0 -49
- package/src/components/form-components/form-date-picker/index.ts +0 -8
- package/src/components/form-components/form-detail/form-detail-options.ts +0 -15
- package/src/components/form-components/form-detail/form-detail.tsx +0 -112
- package/src/components/form-components/form-detail/index.ts +0 -7
- package/src/components/form-components/form-detail-select/form-detail-select-options.ts +0 -39
- package/src/components/form-components/form-detail-select/form-detail-select.tsx +0 -68
- package/src/components/form-components/form-detail-select/index.ts +0 -5
- package/src/components/form-components/form-icon-select/form-icon-select-options.ts +0 -9
- package/src/components/form-components/form-icon-select/form-icon-select.tsx +0 -71
- package/src/components/form-components/form-icon-select/index.ts +0 -5
- package/src/components/form-components/form-image-upload/form-image-upload-options.ts +0 -11
- package/src/components/form-components/form-image-upload/form-image-upload.tsx +0 -22
- package/src/components/form-components/form-image-upload/index.ts +0 -5
- package/src/components/form-components/form-radio-box/form-radio-box-options.ts +0 -32
- package/src/components/form-components/form-radio-box/form-radio-box.tsx +0 -83
- package/src/components/form-components/form-radio-box/index.ts +0 -7
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor-options.ts +0 -6
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor.tsx +0 -22
- package/src/components/form-components/form-rich-text-editor/index.ts +0 -7
- package/src/components/form-components/index.ts +0 -9
- package/src/components/image-select/image-select-option.ts +0 -11
- package/src/components/image-select/image-select.tsx +0 -44
- package/src/components/image-select/index.ts +0 -6
- package/src/components/image-view/image-view-options.ts +0 -14
- package/src/components/image-view/image-view.tsx +0 -30
- package/src/components/image-view/index.ts +0 -7
- package/src/components/index.ts +0 -23
- package/src/components/json-editor/index.ts +0 -8
- package/src/components/json-editor/json-editor-options.ts +0 -21
- package/src/components/json-editor/json-editor.tsx +0 -28
- package/src/components/markdown-editor/index.ts +0 -10
- package/src/components/markdown-editor/markdown-editor-options.ts +0 -17
- package/src/components/markdown-editor/markdown-editor.tsx +0 -136
- package/src/components/material-list/index.ts +0 -7
- package/src/components/material-list/material-group-form-popover.vue +0 -78
- package/src/components/material-list/material-group.vue +0 -145
- package/src/components/material-list/material-item.vue +0 -26
- package/src/components/material-list/material-list-options.ts +0 -24
- package/src/components/material-list/material-list.vue +0 -153
- package/src/components/material-select/index.ts +0 -17
- package/src/components/material-select/material-select-api.ts +0 -55
- package/src/components/material-select/material-select-options.ts +0 -22
- package/src/components/material-select/material-select-type.ts +0 -21
- package/src/components/material-select/material-select.tsx +0 -106
- package/src/components/pagination/index.ts +0 -7
- package/src/components/pagination/pagination-options.tsx +0 -30
- package/src/components/pagination/pagination.tsx +0 -41
- package/src/components/rich-text-editor/index.ts +0 -10
- package/src/components/rich-text-editor/langs/zh-Hans.js +0 -1
- package/src/components/rich-text-editor/rich-text-editor-options.ts +0 -21
- package/src/components/rich-text-editor/rich-text-editor.tsx +0 -111
- package/src/components/role-permission-config/index.ts +0 -7
- package/src/components/role-permission-config/role-permission-config-options.ts +0 -20
- package/src/components/role-permission-config/role-permission-config.tsx +0 -269
- package/src/components/svg-icon/index.ts +0 -5
- package/src/components/svg-icon/svg-icon-options.ts +0 -21
- package/src/components/svg-icon/svg-icon.tsx +0 -48
- package/src/components/system-provider/index.ts +0 -5
- package/src/components/system-provider/system-provider.tsx +0 -95
- package/src/components/upload-file/context/MaterialUploadContext.ts +0 -33
- package/src/components/upload-file/context/UploadContext.ts +0 -21
- package/src/components/upload-file/context/WebFileUploadContext.ts +0 -77
- package/src/components/upload-file/context/index.ts +0 -7
- package/src/components/upload-file/context/material-upload-context-options.ts +0 -13
- package/src/components/upload-file/context/material-upload-context.tsx +0 -34
- package/src/components/upload-file/context/web-file-upload-context-options.ts +0 -16
- package/src/components/upload-file/context/web-file-upload-context.tsx +0 -37
- package/src/components/upload-file/index.ts +0 -11
- package/src/components/upload-file/ui/index.ts +0 -1
- package/src/components/upload-file/ui/upload-image/index.ts +0 -7
- package/src/components/upload-file/ui/upload-image/upload-image-options.ts +0 -25
- package/src/components/upload-file/ui/upload-image/upload-image.tsx +0 -337
- package/src/components/upload-file/upload-file-options.ts +0 -22
- package/src/components/upload-file/upload-file.tsx +0 -69
- package/src/components/verify-dialog/index.ts +0 -5
- package/src/components/verify-dialog/verify-dialog-option.ts +0 -24
- package/src/components/verify-dialog/verify-dialog.tsx +0 -179
- package/src/components/video-view/index.ts +0 -7
- package/src/components/video-view/video-view-options.ts +0 -10
- package/src/components/video-view/video-view.tsx +0 -115
- package/src/composables/create-data-form.ts +0 -6
- package/src/composables/create-data-table.ts +0 -8
- package/src/composables/index.ts +0 -17
- package/src/composables/on-tab-before-close.ts +0 -8
- package/src/composables/on-tab-before-switch.ts +0 -8
- package/src/composables/on-tab-refresh.ts +0 -8
- package/src/composables/use-column-component.ts +0 -184
- package/src/composables/use-current-tab.ts +0 -4
- package/src/composables/use-http-request.ts +0 -5
- package/src/composables/use-i18n.ts +0 -7
- package/src/composables/use-ms-app-client.ts +0 -10
- package/src/composables/use-user-info.ts +0 -4
- package/src/constants/index.ts +0 -6
- package/src/constants/log.ts +0 -5
- package/src/constants/menu.ts +0 -5
- package/src/constants/pattern.ts +0 -4
- package/src/constants/region.ts +0 -6
- package/src/constants/route.ts +0 -4
- package/src/constants/token.ts +0 -5
- package/src/core/DataModelDefines.ts +0 -72
- package/src/core/MSAppClient.ts +0 -260
- package/src/core/PageManager.ts +0 -169
- package/src/core/PermissionPointManager.ts +0 -26
- package/src/core/Router.ts +0 -150
- package/src/core/UserInfo.ts +0 -66
- package/src/core/UserSession.ts +0 -215
- package/src/core/component/ConfigComponents.ts +0 -32
- package/src/core/component/DataFilterComponents.ts +0 -40
- package/src/core/component/DataFormComponents.ts +0 -93
- package/src/core/component/DataTableComponents.ts +0 -91
- package/src/core/component/MaterialComponents.ts +0 -32
- package/src/core/component/index.ts +0 -5
- package/src/core/index.ts +0 -11
- package/src/core/menu/Menu.ts +0 -143
- package/src/core/menu/MenuNode.ts +0 -53
- package/src/core/menu/index.ts +0 -2
- package/src/core/resolver/ITypeResolver.ts +0 -5
- package/src/core/tabs/Tab.ts +0 -59
- package/src/core/tabs/Tabs.ts +0 -187
- package/src/core/tabs/index.ts +0 -2
- package/src/dataview/config/ConfigForm.ts +0 -142
- package/src/dataview/config/ConfigTable.ts +0 -72
- package/src/dataview/config/index.ts +0 -2
- package/src/dataview/deny-ip-access-list/DenyIPAccessListForm.ts +0 -33
- package/src/dataview/deny-ip-access-list/DenyIPAccessListTable.ts +0 -84
- package/src/dataview/deny-ip-access-list/index.ts +0 -2
- package/src/dataview/department/DepartmentForm.ts +0 -41
- package/src/dataview/department/DepartmentTable.ts +0 -64
- package/src/dataview/department/DepartmentTree.ts +0 -47
- package/src/dataview/department/index.ts +0 -3
- package/src/dataview/index.ts +0 -11
- package/src/dataview/ip-white-list/IPWhitelistForm.ts +0 -38
- package/src/dataview/ip-white-list/IPWhitelistTable.ts +0 -81
- package/src/dataview/ip-white-list/index.ts +0 -2
- package/src/dataview/log/index.ts +0 -4
- package/src/dataview/log/local-log/LocalLogTree.ts +0 -77
- package/src/dataview/log/local-log/index.ts +0 -1
- package/src/dataview/log/login-log/LoginLogTable.ts +0 -55
- package/src/dataview/log/login-log/index.ts +0 -1
- package/src/dataview/log/operate-log/OperateLogTable.ts +0 -20
- package/src/dataview/log/operate-log/index.ts +0 -1
- package/src/dataview/log/request-log/RequestLogTable.ts +0 -82
- package/src/dataview/log/request-log/index.ts +0 -1
- package/src/dataview/material/MaterialForm.ts +0 -49
- package/src/dataview/material/MaterialMan.ts +0 -203
- package/src/dataview/material/MaterialTable.ts +0 -125
- package/src/dataview/material/index.ts +0 -4
- package/src/dataview/material/material-group/MaterialGroupForm.ts +0 -27
- package/src/dataview/material/material-group/MaterialGroupTable.ts +0 -57
- package/src/dataview/material/material-group/MaterialGroupTree.ts +0 -72
- package/src/dataview/material/material-group/index.ts +0 -3
- package/src/dataview/member/MemberForm.ts +0 -124
- package/src/dataview/member/MemberTable.tsx +0 -263
- package/src/dataview/member/index.ts +0 -2
- package/src/dataview/member/member-role/MemberRoleTable.ts +0 -23
- package/src/dataview/menu/MenuForm.ts +0 -192
- package/src/dataview/menu/MenuTable.ts +0 -40
- package/src/dataview/menu/MenuTree.ts +0 -112
- package/src/dataview/menu/index.ts +0 -4
- package/src/dataview/menu/permission-point/PermissionPointDefineForm.ts +0 -30
- package/src/dataview/menu/permission-point/PermissionPointDefineTable.ts +0 -32
- package/src/dataview/menu/permission-point/index.ts +0 -2
- package/src/dataview/region/RegionForm.ts +0 -52
- package/src/dataview/region/RegionTable.ts +0 -64
- package/src/dataview/region/index.ts +0 -2
- package/src/dataview/role/RoleForm.ts +0 -34
- package/src/dataview/role/RolePermissionConfigTable.ts +0 -476
- package/src/dataview/role/RoleTable.ts +0 -70
- package/src/dataview/role/index.ts +0 -5
- package/src/dataview/role/role-permission-point/RolePermissionPointTable.ts +0 -29
- package/src/dataview/role/role-permission-point/index.ts +0 -1
- package/src/dataview/role/role-route/RoleRouteTable.ts +0 -30
- package/src/dataview/role/role-route/index.ts +0 -1
- package/src/dataview/route/RouteForm.ts +0 -94
- package/src/dataview/route/RouteTable.ts +0 -73
- package/src/dataview/route/index.ts +0 -2
- package/src/define-data-form.ts +0 -12
- package/src/define-data-table.ts +0 -12
- package/src/define-data-tree.ts +0 -12
- package/src/index.ts +0 -19
- package/src/init-application.ts +0 -83
- package/src/installer.ts +0 -73
- package/src/layouts/components/bar/index.tsx +0 -102
- package/src/layouts/components/dialogs/dialogs.tsx +0 -100
- package/src/layouts/components/dialogs/index.ts +0 -5
- package/src/layouts/components/header/index.tsx +0 -23
- package/src/layouts/components/header/tools.tsx +0 -60
- package/src/layouts/components/index.ts +0 -3
- package/src/layouts/components/lock/index.ts +0 -5
- package/src/layouts/components/lock/lock.tsx +0 -92
- package/src/layouts/components/menu/index.tsx +0 -61
- package/src/layouts/components/menu/menu-item.tsx +0 -63
- package/src/layouts/container/default.tsx +0 -85
- package/src/layouts/index.ts +0 -6
- package/src/layouts/layout.tsx +0 -11
- package/src/message-impl/DialogerImpl.ts +0 -84
- package/src/message-impl/MessagerImpl.ts +0 -17
- package/src/message-impl/NotificationerImpl.ts +0 -17
- package/src/message-impl/index.ts +0 -3
- package/src/page/index/404.vue +0 -3
- package/src/page/index/dv/default/add.vue +0 -50
- package/src/page/index/dv/default/edit.vue +0 -56
- package/src/page/index/dv/default/single/list/dialog.vue +0 -155
- package/src/page/index/dv/default/single/list/normal.vue +0 -128
- package/src/page/index/dv/default/single/table-tree/dialog.vue +0 -60
- package/src/page/index/dv/default/single/tree/dialog.vue +0 -174
- package/src/page/index/dv/default/table.vue +0 -52
- package/src/page/index/dv/local-log/index.vue +0 -98
- package/src/page/index/dv/ms-member/index.vue +0 -33
- package/src/page/index/dv/ms-role/index.vue +0 -32
- package/src/page/index/material/index.vue +0 -16
- package/src/page/index.vue +0 -9
- package/src/page/login/index.vue +0 -196
- package/src/page/signup/index.vue +0 -157
- package/src/router-middleware/auth.ts +0 -31
- package/src/router-middleware/index.ts +0 -1
- package/src/tokens/index.ts +0 -1
- package/src/tokens/ms-app-client.ts +0 -10
- package/src/utils.ts +0 -233
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DefaultSingleListDialogPage :data-table="roleTable" />
|
|
3
|
-
|
|
4
|
-
<ElDialog v-model="isShowDialog" appendToBody width="80%">
|
|
5
|
-
<MKRolePermissionConfig
|
|
6
|
-
:rolePermissionConfigTable="rolePermissionConfigTable"
|
|
7
|
-
/>
|
|
8
|
-
</ElDialog>
|
|
9
|
-
</template>
|
|
10
|
-
<script setup lang="ts">
|
|
11
|
-
import { reactive, ref } from "vue";
|
|
12
|
-
import { ElDialog } from "element-plus";
|
|
13
|
-
import DefaultSingleListDialogPage from "../default/single/list/dialog.vue";
|
|
14
|
-
import { RoleTable, RolePermissionConfigTable } from "../../../../dataview";
|
|
15
|
-
import { MKRolePermissionConfig } from "../../../../components";
|
|
16
|
-
import { DataModelDefines } from "../../../../core";
|
|
17
|
-
|
|
18
|
-
const roleTable = reactive(
|
|
19
|
-
DataModelDefines.instance.getDataTable("ms-role")!
|
|
20
|
-
) as RoleTable;
|
|
21
|
-
const rolePermissionConfigTable = reactive(
|
|
22
|
-
new RolePermissionConfigTable()
|
|
23
|
-
) as RolePermissionConfigTable;
|
|
24
|
-
|
|
25
|
-
const isShowDialog = ref(false);
|
|
26
|
-
|
|
27
|
-
roleTable.configRolePermissionEvent.on(({ item }) => {
|
|
28
|
-
rolePermissionConfigTable.selectRolePermission(item);
|
|
29
|
-
|
|
30
|
-
isShowDialog.value = true;
|
|
31
|
-
});
|
|
32
|
-
</script>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<MKMaterialList :material-man="materialMan" />
|
|
3
|
-
</template>
|
|
4
|
-
<script setup lang="ts">
|
|
5
|
-
import { reactive } from "vue";
|
|
6
|
-
import { MaterialMan } from "../../../dataview";
|
|
7
|
-
import { MKMaterialList } from "../../../components";
|
|
8
|
-
import { MSAppClient, MaterialComponents } from "../../../core";
|
|
9
|
-
|
|
10
|
-
const materialMan = reactive(
|
|
11
|
-
new MaterialMan({
|
|
12
|
-
components: new MaterialComponents(),
|
|
13
|
-
httpRequest: MSAppClient.instance!.httpRequest,
|
|
14
|
-
})
|
|
15
|
-
) as MaterialMan;
|
|
16
|
-
</script>
|
package/src/page/index.vue
DELETED
package/src/page/login/index.vue
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="login-wrap">
|
|
3
|
-
<div class="login-bg">
|
|
4
|
-
<div class="login-bg-block"></div>
|
|
5
|
-
<div class="login-bg-block"></div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="login-root">
|
|
8
|
-
<div class="login-main">
|
|
9
|
-
<div class="form-container">
|
|
10
|
-
<div class="form-wrap">
|
|
11
|
-
<div class="form-title" v-if="!forgotPassword">
|
|
12
|
-
账号登录
|
|
13
|
-
<span class="notify">
|
|
14
|
-
没有账号?<ElButton
|
|
15
|
-
link
|
|
16
|
-
class="operaBtn"
|
|
17
|
-
@click="router.push('/signup')"
|
|
18
|
-
>
|
|
19
|
-
申请使用
|
|
20
|
-
</ElButton>
|
|
21
|
-
</span>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="form-title" v-else>账号重置</div>
|
|
24
|
-
<ElForm
|
|
25
|
-
:model="loginFormData"
|
|
26
|
-
:rules="rules"
|
|
27
|
-
size="large"
|
|
28
|
-
ref="formEl"
|
|
29
|
-
@submit.native.prevent
|
|
30
|
-
>
|
|
31
|
-
<ElFormItem prop="account">
|
|
32
|
-
<ElInput
|
|
33
|
-
v-model="loginFormData.account"
|
|
34
|
-
placeholder="帐号"
|
|
35
|
-
@keyup.enter.native.prevent="verifyHandle"
|
|
36
|
-
/>
|
|
37
|
-
</ElFormItem>
|
|
38
|
-
<ElFormItem prop="password" v-if="!forgotPassword">
|
|
39
|
-
<ElInput
|
|
40
|
-
v-model="loginFormData.password"
|
|
41
|
-
type="password"
|
|
42
|
-
placeholder="密码"
|
|
43
|
-
@keyup.enter.native.prevent="verifyHandle"
|
|
44
|
-
/>
|
|
45
|
-
</ElFormItem>
|
|
46
|
-
<ElFormItem>
|
|
47
|
-
<ElRow style="width: 100%">
|
|
48
|
-
<ElCol :span="12">
|
|
49
|
-
<ElButton
|
|
50
|
-
link
|
|
51
|
-
class="operaBtn"
|
|
52
|
-
@click="forgotPassword = !forgotPassword"
|
|
53
|
-
>{{
|
|
54
|
-
forgotPassword ? "返回登陆" : "忘记密码?"
|
|
55
|
-
}}</ElButton
|
|
56
|
-
>
|
|
57
|
-
</ElCol>
|
|
58
|
-
</ElRow>
|
|
59
|
-
</ElFormItem>
|
|
60
|
-
<ElFormItem>
|
|
61
|
-
<ElButton
|
|
62
|
-
type="primary"
|
|
63
|
-
style="width: 100%"
|
|
64
|
-
:loading="loading"
|
|
65
|
-
@click="verifyHandle"
|
|
66
|
-
:disabled="loginDisabled"
|
|
67
|
-
v-if="!forgotPassword"
|
|
68
|
-
>
|
|
69
|
-
登陆
|
|
70
|
-
</ElButton>
|
|
71
|
-
<ElButton
|
|
72
|
-
type="primary"
|
|
73
|
-
style="width: 100%"
|
|
74
|
-
:loading="loading"
|
|
75
|
-
@click="verifyHandle"
|
|
76
|
-
:disabled="resetDisabled"
|
|
77
|
-
v-else
|
|
78
|
-
>
|
|
79
|
-
重置
|
|
80
|
-
</ElButton>
|
|
81
|
-
</ElFormItem>
|
|
82
|
-
</ElForm>
|
|
83
|
-
<ElDivider></ElDivider>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<MKVerifyDialog
|
|
91
|
-
ref="verifyDialog"
|
|
92
|
-
:scene="scene"
|
|
93
|
-
v-model:visible="verifyVisible"
|
|
94
|
-
v-if="verifyVisible"
|
|
95
|
-
@confirm="handleLogin"
|
|
96
|
-
/>
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<script setup lang="ts">
|
|
100
|
-
import { ElMessage, ElForm, ElFormItem } from "element-plus";
|
|
101
|
-
import { useMSAppClient } from "../../composables";
|
|
102
|
-
import { MKVerifyDialog } from "../../components";
|
|
103
|
-
import { Ref, computed, reactive, ref } from "vue";
|
|
104
|
-
import { useRouter } from "vue-router";
|
|
105
|
-
|
|
106
|
-
defineOptions({
|
|
107
|
-
mkRoute: {
|
|
108
|
-
name: "login",
|
|
109
|
-
path: "/login",
|
|
110
|
-
meta: {
|
|
111
|
-
isAuthorization: false,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const verifyDialog: Ref<{ fail: () => void } | null> = ref(null);
|
|
117
|
-
|
|
118
|
-
// 记住登陆状态
|
|
119
|
-
const rememberLoginState = ref(false);
|
|
120
|
-
|
|
121
|
-
const formEl: Ref<any> = ref(null);
|
|
122
|
-
|
|
123
|
-
const system = useMSAppClient()!;
|
|
124
|
-
|
|
125
|
-
const router = useRouter();
|
|
126
|
-
|
|
127
|
-
const loading = ref(false);
|
|
128
|
-
|
|
129
|
-
const loginDisabled = computed(
|
|
130
|
-
() => !loginFormData.account || !loginFormData.password
|
|
131
|
-
);
|
|
132
|
-
const resetDisabled = computed(() => !loginFormData.account);
|
|
133
|
-
|
|
134
|
-
const forgotPassword = ref(false);
|
|
135
|
-
const scene = computed(() =>
|
|
136
|
-
forgotPassword.value ? "ModifyPassword" : "Login"
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const rules = {
|
|
140
|
-
account: [{ required: true, message: "账号必填" }],
|
|
141
|
-
password: [{ required: true, message: "密码必填" }],
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const loginFormData = reactive({
|
|
145
|
-
account: "",
|
|
146
|
-
password: "",
|
|
147
|
-
vCode: "code",
|
|
148
|
-
});
|
|
149
|
-
const verifyVisible = ref(false);
|
|
150
|
-
|
|
151
|
-
const verifyHandle = async () => {
|
|
152
|
-
const result = await formEl.value?.validate();
|
|
153
|
-
if (!result) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
verifyVisible.value = true;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const handleLogin = async (v: string) => {
|
|
160
|
-
loginFormData.vCode = v;
|
|
161
|
-
try {
|
|
162
|
-
loading.value = true;
|
|
163
|
-
if (forgotPassword.value) {
|
|
164
|
-
const { data } = await system.modifyPassword(
|
|
165
|
-
loginFormData.account,
|
|
166
|
-
loginFormData.vCode
|
|
167
|
-
);
|
|
168
|
-
if (data.code !== 200) {
|
|
169
|
-
ElMessage.error(data.msg || "重置邮箱失败!");
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
ElMessage.success("重置密码邮件已发送到邮箱");
|
|
173
|
-
forgotPassword.value = false;
|
|
174
|
-
} else {
|
|
175
|
-
const { data } = await system.login(
|
|
176
|
-
loginFormData.account,
|
|
177
|
-
loginFormData.password,
|
|
178
|
-
loginFormData.vCode
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
if (data.code !== 200) {
|
|
182
|
-
ElMessage.error(data.msg || "登录失败!");
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
verifyVisible.value = false;
|
|
186
|
-
|
|
187
|
-
router.push({ path: "/" });
|
|
188
|
-
}
|
|
189
|
-
} catch (e) {
|
|
190
|
-
ElMessage.error("登录失败");
|
|
191
|
-
} finally {
|
|
192
|
-
verifyVisible.value = false;
|
|
193
|
-
loading.value = false;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
</script>
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="login-wrap">
|
|
3
|
-
<div class="login-bg">
|
|
4
|
-
<div class="login-bg-block"></div>
|
|
5
|
-
<div class="login-bg-block"></div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="login-root">
|
|
8
|
-
<div class="login-main">
|
|
9
|
-
<div class="form-container">
|
|
10
|
-
<div class="form-wrap">
|
|
11
|
-
<div class="form-title" v-if="!forgotPassword">
|
|
12
|
-
账号注册
|
|
13
|
-
<span class="notify">
|
|
14
|
-
已有账号?<ElButton
|
|
15
|
-
link
|
|
16
|
-
class="operaBtn"
|
|
17
|
-
@click="router.push('/login')"
|
|
18
|
-
>
|
|
19
|
-
返回登录
|
|
20
|
-
</ElButton>
|
|
21
|
-
</span>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="form-title" v-else>账号重置</div>
|
|
24
|
-
<ElForm
|
|
25
|
-
:model="signFormData"
|
|
26
|
-
:rules="rules"
|
|
27
|
-
size="large"
|
|
28
|
-
ref="formEl"
|
|
29
|
-
>
|
|
30
|
-
<ElFormItem prop="account">
|
|
31
|
-
<ElInput v-model="signFormData.account" placeholder="帐号" />
|
|
32
|
-
</ElFormItem>
|
|
33
|
-
<ElFormItem prop="email">
|
|
34
|
-
<ElInput v-model="signFormData.email" placeholder="邮箱" />
|
|
35
|
-
</ElFormItem>
|
|
36
|
-
<ElFormItem prop="name">
|
|
37
|
-
<ElInput v-model="signFormData.name" placeholder="姓名" />
|
|
38
|
-
</ElFormItem>
|
|
39
|
-
<ElFormItem prop="nickName">
|
|
40
|
-
<ElInput v-model="signFormData.nickName" placeholder="昵称" />
|
|
41
|
-
</ElFormItem>
|
|
42
|
-
<ElFormItem prop="phone">
|
|
43
|
-
<ElInput v-model="signFormData.phone" placeholder="手机号" />
|
|
44
|
-
</ElFormItem>
|
|
45
|
-
|
|
46
|
-
<ElFormItem>
|
|
47
|
-
<ElButton
|
|
48
|
-
type="primary"
|
|
49
|
-
style="width: 100%"
|
|
50
|
-
:loading="loading"
|
|
51
|
-
@click="verifyHandle"
|
|
52
|
-
>
|
|
53
|
-
提交申请
|
|
54
|
-
</ElButton>
|
|
55
|
-
</ElFormItem>
|
|
56
|
-
</ElForm>
|
|
57
|
-
<ElDivider></ElDivider>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<MKVerifyDialog
|
|
65
|
-
:scene="scene"
|
|
66
|
-
v-model:visible="verifyVisible"
|
|
67
|
-
v-if="verifyVisible"
|
|
68
|
-
@verifySuccessful="handleSign"
|
|
69
|
-
/>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<script setup lang="ts">
|
|
73
|
-
import { Ref, computed, reactive, ref } from "vue";
|
|
74
|
-
import { useRouter } from "vue-router";
|
|
75
|
-
import { FormRules } from "element-plus";
|
|
76
|
-
import { Messager } from "@maketribe/dm";
|
|
77
|
-
import { useHttpRequest } from "../../composables";
|
|
78
|
-
import { MKVerifyDialog } from "../../components";
|
|
79
|
-
|
|
80
|
-
defineOptions({
|
|
81
|
-
mkRoute: {
|
|
82
|
-
name: "signup",
|
|
83
|
-
path: "/signup",
|
|
84
|
-
meta: {
|
|
85
|
-
isAuthorization: false,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const formEl: Ref<any> = ref(null);
|
|
91
|
-
|
|
92
|
-
const router = useRouter();
|
|
93
|
-
|
|
94
|
-
const httpRequest = useHttpRequest()!;
|
|
95
|
-
|
|
96
|
-
const loading = ref(false);
|
|
97
|
-
|
|
98
|
-
const verifyVisible = ref(false);
|
|
99
|
-
|
|
100
|
-
const forgotPassword = ref(false);
|
|
101
|
-
const scene = computed(() =>
|
|
102
|
-
forgotPassword.value ? "ModifyPassword" : "Login"
|
|
103
|
-
);
|
|
104
|
-
const rules: FormRules = {
|
|
105
|
-
account: [{ required: true, message: "账号必填" }],
|
|
106
|
-
email: [
|
|
107
|
-
{
|
|
108
|
-
required: true,
|
|
109
|
-
trigger: "change",
|
|
110
|
-
validator: (rule, value, callback) => {
|
|
111
|
-
if (!value) {
|
|
112
|
-
callback(new Error("邮箱必填"));
|
|
113
|
-
} else if (
|
|
114
|
-
!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)
|
|
115
|
-
) {
|
|
116
|
-
callback(new Error("邮箱规则不符"));
|
|
117
|
-
} else {
|
|
118
|
-
callback();
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
name: [{ required: true, message: "姓名必填" }],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const verifyHandle = async () => {
|
|
127
|
-
const result = await formEl.value.validate();
|
|
128
|
-
if (!result) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
verifyVisible.value = true;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const signFormData = reactive({
|
|
135
|
-
account: "",
|
|
136
|
-
email: "",
|
|
137
|
-
name: "",
|
|
138
|
-
nickName: "",
|
|
139
|
-
phone: "",
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const handleSign = async (v: string) => {
|
|
143
|
-
const result = await httpRequest.post(
|
|
144
|
-
"/api/dv/ms-member/apply/account",
|
|
145
|
-
signFormData
|
|
146
|
-
);
|
|
147
|
-
if (result.data.code != 200) {
|
|
148
|
-
Messager.instance.error(result.data.msg || "注册失败");
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
verifyVisible.value = false;
|
|
152
|
-
Messager.instance.success({ message: "注册成功,请联系管理员通过验证" });
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// 记住登陆状态
|
|
156
|
-
const rememberLoginState = ref(false);
|
|
157
|
-
</script>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { RouteLocationNormalized, RouteLocationRaw } from "vue-router";
|
|
2
|
-
import type { MSAppClient } from "../core";
|
|
3
|
-
|
|
4
|
-
export const authBeforeEach = async (
|
|
5
|
-
msAppClient: MSAppClient,
|
|
6
|
-
to: RouteLocationNormalized,
|
|
7
|
-
from: RouteLocationNormalized
|
|
8
|
-
): Promise<RouteLocationRaw | void> => {
|
|
9
|
-
if (to.meta.isAuthorization === false) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let userSession = msAppClient.userSession;
|
|
14
|
-
|
|
15
|
-
if (!userSession) {
|
|
16
|
-
try {
|
|
17
|
-
await msAppClient.loadCurrentUserSession();
|
|
18
|
-
|
|
19
|
-
userSession = msAppClient.userSession;
|
|
20
|
-
|
|
21
|
-
if (!userSession) {
|
|
22
|
-
return { name: "login" };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 因为登陆成功会添加用户可以访问的路由,这里给到vue-router去重新resolve
|
|
26
|
-
return { path: to.fullPath };
|
|
27
|
-
} catch (e) {
|
|
28
|
-
return { name: "login" };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./auth";
|
package/src/tokens/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ms-app-client";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { InjectionKey } from "vue";
|
|
2
|
-
import { MSAppClient } from "../core";
|
|
3
|
-
|
|
4
|
-
export interface MSAppClientContext {
|
|
5
|
-
msAppClient: MSAppClient;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const MSAPPCLIENT_CONTEXT_KEY: InjectionKey<MSAppClientContext> = Symbol(
|
|
9
|
-
"msAppClientContextKey"
|
|
10
|
-
);
|
package/src/utils.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { encodePath } from "ufo";
|
|
2
|
-
|
|
3
|
-
enum SegmentParserState {
|
|
4
|
-
initial,
|
|
5
|
-
static,
|
|
6
|
-
dynamic,
|
|
7
|
-
optional,
|
|
8
|
-
catchall,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface ScannedFile {
|
|
12
|
-
path: string;
|
|
13
|
-
module: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
enum SegmentTokenType {
|
|
17
|
-
static,
|
|
18
|
-
dynamic,
|
|
19
|
-
optional,
|
|
20
|
-
catchall,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface SegmentToken {
|
|
24
|
-
type: SegmentTokenType;
|
|
25
|
-
value: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function generateRoutesFromFiles(files: ScannedFile[]) {
|
|
29
|
-
const routes: any[] = [];
|
|
30
|
-
|
|
31
|
-
for (const file of files) {
|
|
32
|
-
const segments = file.path.split("/");
|
|
33
|
-
|
|
34
|
-
const route: Record<string, any> = {
|
|
35
|
-
meta: {},
|
|
36
|
-
...file.module.mkRoute,
|
|
37
|
-
key: "",
|
|
38
|
-
path: "",
|
|
39
|
-
component: async () => file.module,
|
|
40
|
-
children: [],
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
let parent = routes;
|
|
44
|
-
|
|
45
|
-
for (const segment of segments) {
|
|
46
|
-
const tokens = parseSegment(segment);
|
|
47
|
-
const segmentName = tokens.map(({ value }) => value).join("");
|
|
48
|
-
|
|
49
|
-
route.key += (route.key && "/") + segmentName;
|
|
50
|
-
|
|
51
|
-
const path = route.path + getRoutePath(tokens).replace(/\/index$/, "/");
|
|
52
|
-
const child = parent.find(
|
|
53
|
-
(parentRoute) =>
|
|
54
|
-
parentRoute.key === route.key && parentRoute.path === path
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
if (child && child.children) {
|
|
58
|
-
parent = child.children;
|
|
59
|
-
route.path = "";
|
|
60
|
-
} else if (segmentName === "index" && !route.path) {
|
|
61
|
-
route.path += "/";
|
|
62
|
-
} else if (segmentName !== "index") {
|
|
63
|
-
route.path += getRoutePath(tokens);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
route.path = file.module.mkRoute?.path || route.path;
|
|
68
|
-
|
|
69
|
-
parent.push(route);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return prepareRoutes(routes);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function getRoutePath(tokens: SegmentToken[]) {
|
|
76
|
-
return tokens.reduce((path, token) => {
|
|
77
|
-
return (
|
|
78
|
-
path +
|
|
79
|
-
(token.type === SegmentTokenType.optional
|
|
80
|
-
? `:${token.value}?`
|
|
81
|
-
: token.type === SegmentTokenType.dynamic
|
|
82
|
-
? `:${token.value}()`
|
|
83
|
-
: token.type === SegmentTokenType.catchall
|
|
84
|
-
? `:${token.value}(.*)*`
|
|
85
|
-
: encodePath(token.value).replace(/:/g, "\\:"))
|
|
86
|
-
);
|
|
87
|
-
}, "/");
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const PARAM_CHAR_RE = /[\w\d_.]/;
|
|
91
|
-
|
|
92
|
-
function parseSegment(segment: string) {
|
|
93
|
-
let state: SegmentParserState = SegmentParserState.initial;
|
|
94
|
-
|
|
95
|
-
let i = 0;
|
|
96
|
-
|
|
97
|
-
let buffer = "";
|
|
98
|
-
const tokens: SegmentToken[] = [];
|
|
99
|
-
|
|
100
|
-
function consumeBuffer() {
|
|
101
|
-
if (!buffer) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (state === SegmentParserState.initial) {
|
|
106
|
-
throw new Error("错误的状态");
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
tokens.push({
|
|
110
|
-
type:
|
|
111
|
-
state === SegmentParserState.static
|
|
112
|
-
? SegmentTokenType.static
|
|
113
|
-
: state === SegmentParserState.dynamic
|
|
114
|
-
? SegmentTokenType.dynamic
|
|
115
|
-
: state === SegmentParserState.optional
|
|
116
|
-
? SegmentTokenType.optional
|
|
117
|
-
: SegmentTokenType.catchall,
|
|
118
|
-
value: buffer,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
buffer = "";
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
while (i < segment.length) {
|
|
125
|
-
const c = segment[i];
|
|
126
|
-
|
|
127
|
-
switch (state) {
|
|
128
|
-
case SegmentParserState.initial:
|
|
129
|
-
buffer = "";
|
|
130
|
-
|
|
131
|
-
if (c === "[") {
|
|
132
|
-
state = SegmentParserState.dynamic;
|
|
133
|
-
} else {
|
|
134
|
-
i--;
|
|
135
|
-
state = SegmentParserState.static;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
break;
|
|
139
|
-
case SegmentParserState.static:
|
|
140
|
-
if (c === "[") {
|
|
141
|
-
consumeBuffer();
|
|
142
|
-
state = SegmentParserState.dynamic;
|
|
143
|
-
} else {
|
|
144
|
-
buffer += c;
|
|
145
|
-
}
|
|
146
|
-
break;
|
|
147
|
-
case SegmentParserState.catchall:
|
|
148
|
-
case SegmentParserState.dynamic:
|
|
149
|
-
case SegmentParserState.optional:
|
|
150
|
-
if (buffer === "...") {
|
|
151
|
-
buffer = "";
|
|
152
|
-
state = SegmentParserState.catchall;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (c === "[" && state === SegmentParserState.dynamic) {
|
|
156
|
-
state = SegmentParserState.optional;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (
|
|
160
|
-
c === "]" &&
|
|
161
|
-
(state !== SegmentParserState.optional || segment[i - 1] === "]")
|
|
162
|
-
) {
|
|
163
|
-
if (!buffer) {
|
|
164
|
-
throw new Error("空参数");
|
|
165
|
-
}
|
|
166
|
-
consumeBuffer();
|
|
167
|
-
state = SegmentParserState.initial;
|
|
168
|
-
} else if (PARAM_CHAR_RE.test(c)) {
|
|
169
|
-
buffer += c;
|
|
170
|
-
}
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
i++;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (state === SegmentParserState.dynamic) {
|
|
178
|
-
throw new Error(`Unfinished param "${buffer}"`);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
consumeBuffer();
|
|
182
|
-
|
|
183
|
-
return tokens;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function findRouteByKey(key: string, routes: any[]): any | undefined {
|
|
187
|
-
for (const route of routes) {
|
|
188
|
-
if (route.key === key) {
|
|
189
|
-
return route;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return findRouteByKey(key, routes);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function prepareRoutes(routes: any[], parent?: any, keys = new Set<string>()) {
|
|
196
|
-
for (const route of routes) {
|
|
197
|
-
// Remove -index
|
|
198
|
-
if (route.key) {
|
|
199
|
-
route.key = route.key.replace(/\/index$/, "").replace(/\//g, "-");
|
|
200
|
-
|
|
201
|
-
if (keys.has(route.key)) {
|
|
202
|
-
const existingRoute = findRouteByKey(route.key, routes);
|
|
203
|
-
const extra = existingRoute?.name
|
|
204
|
-
? `is the same as \`${existingRoute.file}\``
|
|
205
|
-
: "is a duplicate";
|
|
206
|
-
console.warn(
|
|
207
|
-
`Route name generated for \`${route.file}\` ${extra}. You may wish to set a custom name using \`definePageMeta\` within the page file.`
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
route.path = route.path.replace(/\/\//g, "/");
|
|
213
|
-
|
|
214
|
-
// Remove leading / if children route
|
|
215
|
-
if (parent && route.path.startsWith("/")) {
|
|
216
|
-
route.path = route.path.slice(1);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (route.children?.length) {
|
|
220
|
-
route.children = prepareRoutes(route.children, route, keys);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// if (route.children?.find((childRoute: any) => childRoute.path === "")) {
|
|
224
|
-
// delete route.key;
|
|
225
|
-
// }
|
|
226
|
-
|
|
227
|
-
if (route.key) {
|
|
228
|
-
keys.add(route.key);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
return routes;
|
|
233
|
-
}
|