@maketribe/ms-app 3.0.38 → 3.0.39
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/package.json +2 -2
- 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,20 +0,0 @@
|
|
|
1
|
-
import { ExtractPropTypes } from "vue";
|
|
2
|
-
import { RolePermissionConfigTable } from "../../dataview";
|
|
3
|
-
import { buildProps } from "@maketribe/utils";
|
|
4
|
-
|
|
5
|
-
export const rolePermissionConfigProps = buildProps({
|
|
6
|
-
rolePermissionConfigTable: {
|
|
7
|
-
type: RolePermissionConfigTable,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
} as const);
|
|
11
|
-
|
|
12
|
-
export type RolePermissionConfigProps = ExtractPropTypes<
|
|
13
|
-
typeof rolePermissionConfigProps
|
|
14
|
-
>;
|
|
15
|
-
|
|
16
|
-
export const rolePermissionConfigEmits = {
|
|
17
|
-
roleChange: (id: any) => true,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type RolePermissionConfigEmits = typeof rolePermissionConfigEmits;
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Fragment,
|
|
3
|
-
computed,
|
|
4
|
-
defineComponent,
|
|
5
|
-
reactive,
|
|
6
|
-
unref,
|
|
7
|
-
watch,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import {
|
|
10
|
-
ElTable,
|
|
11
|
-
ElTableColumn,
|
|
12
|
-
ElCheckbox,
|
|
13
|
-
ElTooltip,
|
|
14
|
-
ElCard,
|
|
15
|
-
ElButton,
|
|
16
|
-
ElAlert,
|
|
17
|
-
} from "element-plus";
|
|
18
|
-
import { postTraverse } from "@maketribe/utils";
|
|
19
|
-
import { RoleMenuNode, RolePermissionPointDefine } from "../../dataview";
|
|
20
|
-
import { useI18n } from "../../composables";
|
|
21
|
-
import {
|
|
22
|
-
rolePermissionConfigEmits,
|
|
23
|
-
rolePermissionConfigProps,
|
|
24
|
-
} from "./role-permission-config-options";
|
|
25
|
-
|
|
26
|
-
type RowInfo = {
|
|
27
|
-
roleMenus: RoleMenuNode[];
|
|
28
|
-
permissionPoints: RolePermissionPointDefine[];
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type CellInfo = { row: RowInfo; rowIndex: number; columnIndex: number };
|
|
32
|
-
|
|
33
|
-
export default defineComponent({
|
|
34
|
-
name: "MKRolePermissionConfig",
|
|
35
|
-
props: rolePermissionConfigProps,
|
|
36
|
-
emits: rolePermissionConfigEmits,
|
|
37
|
-
setup(props, { emit }) {
|
|
38
|
-
const i18n = useI18n()!;
|
|
39
|
-
|
|
40
|
-
const rolePermissionConfigTable = computed(
|
|
41
|
-
() => props.rolePermissionConfigTable
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const loading = computed(() => unref(rolePermissionConfigTable).loading);
|
|
45
|
-
|
|
46
|
-
const rootRoleMenuNodes = computed(() =>
|
|
47
|
-
unref(rolePermissionConfigTable).getRootRoleMenuNodes()
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const list = computed(() => {
|
|
51
|
-
const _rootRoleMenuNodes = unref(rootRoleMenuNodes);
|
|
52
|
-
|
|
53
|
-
const list: RowInfo[] = [];
|
|
54
|
-
|
|
55
|
-
postTraverse<RoleMenuNode>(_rootRoleMenuNodes, (roleMenu, ancestors) => {
|
|
56
|
-
if (!roleMenu.children.length) {
|
|
57
|
-
list.push({
|
|
58
|
-
roleMenus: [...ancestors],
|
|
59
|
-
permissionPoints: roleMenu.permissionPoints,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return list;
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const maxMenuColumns = computed(() => {
|
|
68
|
-
const _list = unref(list);
|
|
69
|
-
|
|
70
|
-
return Math.max(..._list.map((item) => item.roleMenus.length), 0);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const handleSpanMethod = ({
|
|
74
|
-
row,
|
|
75
|
-
rowIndex,
|
|
76
|
-
columnIndex,
|
|
77
|
-
}: CellInfo): [number, number] => {
|
|
78
|
-
const _maxMenuColumns = unref(maxMenuColumns);
|
|
79
|
-
|
|
80
|
-
let columnSpan = 1;
|
|
81
|
-
|
|
82
|
-
if (row.roleMenus.length < _maxMenuColumns) {
|
|
83
|
-
if (row.roleMenus.length - 1 === columnIndex) {
|
|
84
|
-
columnSpan = _maxMenuColumns - columnIndex;
|
|
85
|
-
} else if (
|
|
86
|
-
columnIndex < _maxMenuColumns &&
|
|
87
|
-
columnIndex >= row.roleMenus.length
|
|
88
|
-
) {
|
|
89
|
-
columnSpan = 0;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
let rowSpan = 1;
|
|
94
|
-
|
|
95
|
-
const _list = unref(list);
|
|
96
|
-
|
|
97
|
-
if (columnIndex < _maxMenuColumns) {
|
|
98
|
-
const bothExisting: boolean = !!(
|
|
99
|
-
_list[rowIndex]?.roleMenus?.[columnIndex] &&
|
|
100
|
-
_list[rowIndex - 1]?.roleMenus?.[columnIndex]
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
if (
|
|
104
|
-
// 第一行
|
|
105
|
-
rowIndex === 0 ||
|
|
106
|
-
// 两条记录都存在,且前一条和当前记录不一致
|
|
107
|
-
(bothExisting &&
|
|
108
|
-
_list[rowIndex].roleMenus[columnIndex].id !==
|
|
109
|
-
_list[rowIndex - 1].roleMenus[columnIndex].id)
|
|
110
|
-
) {
|
|
111
|
-
let count = 1;
|
|
112
|
-
|
|
113
|
-
for (let i = rowIndex + 1; i < _list.length; i++) {
|
|
114
|
-
if (
|
|
115
|
-
_list[rowIndex].roleMenus[columnIndex]?.id !==
|
|
116
|
-
_list[i].roleMenus[columnIndex]?.id
|
|
117
|
-
) {
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
count++;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
rowSpan = count;
|
|
124
|
-
} else if (bothExisting) {
|
|
125
|
-
// 两条记录都存在切记录一致
|
|
126
|
-
rowSpan = 0;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return [rowSpan, columnSpan];
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const saveRolePermission = async () => {
|
|
134
|
-
props.rolePermissionConfigTable.submitPermission();
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
watch(
|
|
138
|
-
computed(() => props.rolePermissionConfigTable),
|
|
139
|
-
async (rolePermissionConfigTable) => {
|
|
140
|
-
await rolePermissionConfigTable.init();
|
|
141
|
-
await rolePermissionConfigTable.load();
|
|
142
|
-
},
|
|
143
|
-
{ immediate: true }
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
return () => {
|
|
147
|
-
const menuColumnVnodes = new Array(unref(maxMenuColumns))
|
|
148
|
-
.fill(0)
|
|
149
|
-
.map((_, i) => {
|
|
150
|
-
return (
|
|
151
|
-
<ElTableColumn
|
|
152
|
-
label={i18n.translate("mk.rolePermissionConfig.tableMenuHeader", {
|
|
153
|
-
level: i + 1,
|
|
154
|
-
})}
|
|
155
|
-
v-slots={{
|
|
156
|
-
default: ({ row }: { row: RowInfo }) => {
|
|
157
|
-
const roleMenu = row.roleMenus[i];
|
|
158
|
-
|
|
159
|
-
if (!roleMenu) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return (
|
|
164
|
-
<ElTooltip content={roleMenu.title} placement="top">
|
|
165
|
-
<ElCheckbox
|
|
166
|
-
class="role-permission-config__menu"
|
|
167
|
-
modelValue={roleMenu.selected}
|
|
168
|
-
indeterminate={roleMenu.indeterminate}
|
|
169
|
-
onUpdate:modelValue={() =>
|
|
170
|
-
unref(rolePermissionConfigTable).toggleRoleMenu(
|
|
171
|
-
roleMenu
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
>
|
|
175
|
-
{roleMenu.title}
|
|
176
|
-
</ElCheckbox>
|
|
177
|
-
</ElTooltip>
|
|
178
|
-
);
|
|
179
|
-
},
|
|
180
|
-
}}
|
|
181
|
-
/>
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
return (
|
|
186
|
-
<ElCard
|
|
187
|
-
v-slots={{
|
|
188
|
-
header: () => {
|
|
189
|
-
return (
|
|
190
|
-
<div class="header-box">
|
|
191
|
-
<div class="header-box-main">
|
|
192
|
-
<ElAlert
|
|
193
|
-
title={
|
|
194
|
-
props.rolePermissionConfigTable.hasChange()
|
|
195
|
-
? `当前【 ${rolePermissionConfigTable.value.currentRoleDesc} 】权限已发生改变,保存后生效!`
|
|
196
|
-
: `当前【 ${rolePermissionConfigTable.value.currentRoleDesc} 】权限无任何改变!`
|
|
197
|
-
}
|
|
198
|
-
showIcon
|
|
199
|
-
type={
|
|
200
|
-
props.rolePermissionConfigTable.hasChange()
|
|
201
|
-
? "warning"
|
|
202
|
-
: "info"
|
|
203
|
-
}
|
|
204
|
-
closable={false}
|
|
205
|
-
/>
|
|
206
|
-
</div>
|
|
207
|
-
<div class="header-box-tools">
|
|
208
|
-
<ElButton
|
|
209
|
-
onClick={saveRolePermission}
|
|
210
|
-
type="primary"
|
|
211
|
-
disabled={!props.rolePermissionConfigTable.hasChange()}
|
|
212
|
-
>
|
|
213
|
-
{i18n.translate("mk.dataForm.saveButton")}
|
|
214
|
-
</ElButton>
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
);
|
|
218
|
-
},
|
|
219
|
-
}}
|
|
220
|
-
>
|
|
221
|
-
<ElTable
|
|
222
|
-
class="role-permission-config"
|
|
223
|
-
data={unref(list)}
|
|
224
|
-
border
|
|
225
|
-
spanMethod={handleSpanMethod}
|
|
226
|
-
v-loading={unref(loading)}
|
|
227
|
-
>
|
|
228
|
-
{menuColumnVnodes}
|
|
229
|
-
|
|
230
|
-
<ElTableColumn
|
|
231
|
-
label={i18n.translate(
|
|
232
|
-
"mk.rolePermissionConfig.tablePermissionPointHeader"
|
|
233
|
-
)}
|
|
234
|
-
minWidth="300px"
|
|
235
|
-
v-slots={{
|
|
236
|
-
default: ({ row }: { row: RowInfo }) => {
|
|
237
|
-
const permissionPointVnodes = row.permissionPoints.map(
|
|
238
|
-
(permissionPoint) => {
|
|
239
|
-
return (
|
|
240
|
-
<ElTooltip
|
|
241
|
-
content={permissionPoint.name}
|
|
242
|
-
placement="top"
|
|
243
|
-
>
|
|
244
|
-
<ElCheckbox
|
|
245
|
-
class="role-permission-config__permission-point"
|
|
246
|
-
modelValue={permissionPoint.selected}
|
|
247
|
-
onUpdate:modelValue={() => {
|
|
248
|
-
unref(
|
|
249
|
-
rolePermissionConfigTable
|
|
250
|
-
).toggleRolePermissionPoint(permissionPoint);
|
|
251
|
-
}}
|
|
252
|
-
>
|
|
253
|
-
{permissionPoint.name}
|
|
254
|
-
</ElCheckbox>
|
|
255
|
-
</ElTooltip>
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
return <Fragment>{permissionPointVnodes}</Fragment>;
|
|
261
|
-
},
|
|
262
|
-
}}
|
|
263
|
-
/>
|
|
264
|
-
</ElTable>
|
|
265
|
-
</ElCard>
|
|
266
|
-
);
|
|
267
|
-
};
|
|
268
|
-
},
|
|
269
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ExtractPropTypes } from "vue";
|
|
2
|
-
import { buildProps } from "@maketribe/utils";
|
|
3
|
-
|
|
4
|
-
export const svgIconProps = buildProps({
|
|
5
|
-
iconClass: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: true,
|
|
8
|
-
},
|
|
9
|
-
className: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: "",
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export type SvgIconProps = ExtractPropTypes<typeof svgIconProps>;
|
|
16
|
-
|
|
17
|
-
export const svgIconEmits = {
|
|
18
|
-
click: (e: MouseEvent) => true,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type SvgIconEmits = typeof svgIconEmits;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { computed, defineComponent, unref } from "vue";
|
|
2
|
-
import * as icons from "@element-plus/icons-vue";
|
|
3
|
-
import { svgIconEmits, svgIconProps } from "./svg-icon-options";
|
|
4
|
-
import { ElIcon } from "element-plus";
|
|
5
|
-
|
|
6
|
-
export default defineComponent({
|
|
7
|
-
name: "MKSvgIcon",
|
|
8
|
-
props: svgIconProps,
|
|
9
|
-
emits: svgIconEmits,
|
|
10
|
-
setup(props, { emit }) {
|
|
11
|
-
const iconNames = Object.keys(icons);
|
|
12
|
-
|
|
13
|
-
const iconName = computed(() => `#icon-${props.iconClass}`);
|
|
14
|
-
const iconClass = computed(() =>
|
|
15
|
-
props.className ? `mk-svg-icon ${props.className}` : "mk-svg-icon"
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const isElIcon = computed(() =>
|
|
19
|
-
props.iconClass ? unref(iconNames).includes(props.iconClass) : false
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const handleClick = (e: MouseEvent) => {
|
|
23
|
-
emit("click", e);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return () => {
|
|
27
|
-
if (unref(isElIcon)) {
|
|
28
|
-
const Icon = icons[props.iconClass as keyof typeof icons];
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<i class={unref(iconClass)} onClick={handleClick}>
|
|
32
|
-
<ElIcon>
|
|
33
|
-
<Icon />
|
|
34
|
-
</ElIcon>
|
|
35
|
-
</i>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<i class={unref(iconClass)} onClick={handleClick}>
|
|
41
|
-
<svg>
|
|
42
|
-
<use xlinkHref={unref(iconName)} />
|
|
43
|
-
</svg>
|
|
44
|
-
</i>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
defineComponent,
|
|
4
|
-
renderSlot,
|
|
5
|
-
unref,
|
|
6
|
-
useSlots,
|
|
7
|
-
watch,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import { useRouter } from "vue-router";
|
|
10
|
-
import { Components } from "@maketribe/dm";
|
|
11
|
-
import { MSAppClient } from "../../core";
|
|
12
|
-
import { MKConfigProvider } from "../config-provider";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 路由变动的几种情况,
|
|
16
|
-
* 1.点击菜单跳转陆游
|
|
17
|
-
* 2.特定业务逻辑需要跳转路由
|
|
18
|
-
* 3.返回上一页
|
|
19
|
-
* 4.刷新页面
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export default defineComponent({
|
|
23
|
-
name: "MKSystemProvider",
|
|
24
|
-
setup() {
|
|
25
|
-
const vueRouter = useRouter();
|
|
26
|
-
|
|
27
|
-
const msAppClient = MSAppClient.instance!;
|
|
28
|
-
|
|
29
|
-
const ready = computed(() => msAppClient.ready);
|
|
30
|
-
|
|
31
|
-
const slots = useSlots();
|
|
32
|
-
|
|
33
|
-
watch(
|
|
34
|
-
computed(() => unref(vueRouter.currentRoute)),
|
|
35
|
-
(route) => {
|
|
36
|
-
const userSession = msAppClient.userSession;
|
|
37
|
-
|
|
38
|
-
if (!userSession) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const router = userSession.router;
|
|
43
|
-
const menu = userSession.menu;
|
|
44
|
-
const tabs = userSession.tabs;
|
|
45
|
-
|
|
46
|
-
const routeInfo = router.getRouteByName(route.name as string);
|
|
47
|
-
|
|
48
|
-
if (!routeInfo) {
|
|
49
|
-
menu.setCurrentMenuNode(null);
|
|
50
|
-
tabs.setCurrentTab(null);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const menuNode = menu.findMenuNodeByID(routeInfo.menuId);
|
|
55
|
-
|
|
56
|
-
if (!menuNode) {
|
|
57
|
-
menu.setCurrentMenuNode(null);
|
|
58
|
-
tabs.setCurrentTab(null);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
menu.setCurrentMenuNode(menuNode);
|
|
63
|
-
|
|
64
|
-
const tab =
|
|
65
|
-
tabs.findTabByID(route.fullPath) ??
|
|
66
|
-
tabs.createTab({
|
|
67
|
-
id: route.fullPath,
|
|
68
|
-
title: routeInfo.title,
|
|
69
|
-
affix: !!route.matched?.[route.matched?.length - 1]?.meta?.affix,
|
|
70
|
-
realRoute: route,
|
|
71
|
-
route: routeInfo,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
tabs.switchTab(tab);
|
|
75
|
-
},
|
|
76
|
-
{ immediate: true }
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
return () => {
|
|
80
|
-
return (
|
|
81
|
-
<MKConfigProvider
|
|
82
|
-
dataTableComponents={msAppClient.dataTableComponents as Components}
|
|
83
|
-
dataFormComponents={msAppClient.dataFormComponents as Components}
|
|
84
|
-
dataFilterComponents={msAppClient.dataFilterComponents as Components}
|
|
85
|
-
whereFilterComponents={
|
|
86
|
-
msAppClient.whereFilterComponents as Components
|
|
87
|
-
}
|
|
88
|
-
i18n={msAppClient.i18n}
|
|
89
|
-
>
|
|
90
|
-
{renderSlot(slots, "default")}
|
|
91
|
-
</MKConfigProvider>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { MKMaterialSelect } from "../../material-select";
|
|
2
|
-
import { MaterialType } from "../../../dataview";
|
|
3
|
-
import { UploadContext, UploadResult } from "./UploadContext";
|
|
4
|
-
|
|
5
|
-
export type MaterialUploadContextOptions = {
|
|
6
|
-
allowMaterialTypeValues?: MaterialType["value"][];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export class MaterialUploadContext extends UploadContext {
|
|
10
|
-
allowMaterialTypeValues: MaterialType["value"][];
|
|
11
|
-
|
|
12
|
-
constructor(options: MaterialUploadContextOptions = {}) {
|
|
13
|
-
super();
|
|
14
|
-
|
|
15
|
-
this.allowMaterialTypeValues = options.allowMaterialTypeValues || [];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
setAllowMaterialTypeValues(allowMaterialTypeValues: MaterialType["value"][]) {
|
|
19
|
-
this.allowMaterialTypeValues = allowMaterialTypeValues;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async selectFile(): Promise<UploadResult> {
|
|
23
|
-
const materialSelectResult = await MKMaterialSelect({
|
|
24
|
-
allowMaterialTypeValues: this.allowMaterialTypeValues,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
success: true,
|
|
29
|
-
path: materialSelectResult.path,
|
|
30
|
-
msg: "",
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { InjectionKey } from "vue";
|
|
2
|
-
|
|
3
|
-
export type UploadResult = {
|
|
4
|
-
success: boolean;
|
|
5
|
-
path: string;
|
|
6
|
-
msg: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export interface UploadContextCtx {
|
|
10
|
-
uploadContext: UploadContext;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const UploadContextCtxKey = Symbol(
|
|
14
|
-
"UploadContextCtxKey"
|
|
15
|
-
) as InjectionKey<UploadContextCtx>;
|
|
16
|
-
|
|
17
|
-
export class UploadContext {
|
|
18
|
-
selectFile(): Promise<UploadResult> {
|
|
19
|
-
throw new Error();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { WebFileUpload } from "@maketribe/request";
|
|
2
|
-
import { UploadContext, UploadResult } from "./UploadContext";
|
|
3
|
-
import { MSAppClient } from "../../../core";
|
|
4
|
-
|
|
5
|
-
export type WebFileUploadContextOptions = {
|
|
6
|
-
webFileUpload?: WebFileUpload;
|
|
7
|
-
accept?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export class WebFileUploadContext extends UploadContext {
|
|
11
|
-
webFileUpload: WebFileUpload;
|
|
12
|
-
accept: string;
|
|
13
|
-
|
|
14
|
-
constructor(options: WebFileUploadContextOptions = {}) {
|
|
15
|
-
super();
|
|
16
|
-
|
|
17
|
-
this.accept = options.accept || "";
|
|
18
|
-
|
|
19
|
-
this.webFileUpload =
|
|
20
|
-
options.webFileUpload ??
|
|
21
|
-
new WebFileUpload({
|
|
22
|
-
httpRequest: MSAppClient.instance!.httpRequest,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
setAccept(accept: string) {
|
|
27
|
-
this.accept = accept;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
setWebFileUpload(webFileUpload: WebFileUpload) {
|
|
31
|
-
this.webFileUpload = webFileUpload;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async selectFile(): Promise<UploadResult> {
|
|
35
|
-
const input = document.createElement("input");
|
|
36
|
-
|
|
37
|
-
input.type = "file";
|
|
38
|
-
|
|
39
|
-
if (this.accept) {
|
|
40
|
-
input.accept = this.accept;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
Object.assign(input.style, {
|
|
44
|
-
width: "1px",
|
|
45
|
-
height: "1px",
|
|
46
|
-
display: "none",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const file: File | null = await new Promise((resolve) => {
|
|
50
|
-
const handleFileChange = (event: Event) => {
|
|
51
|
-
const files = input.files;
|
|
52
|
-
|
|
53
|
-
input.parentElement?.removeChild(input);
|
|
54
|
-
|
|
55
|
-
resolve(files?.length ? files[0] : null);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
input.addEventListener("change", handleFileChange);
|
|
59
|
-
|
|
60
|
-
document.body.append(input);
|
|
61
|
-
|
|
62
|
-
input.click();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (!file) {
|
|
66
|
-
return { success: true, path: "", msg: "" };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const response = await this.webFileUpload.upload(file);
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
success: response.data.code === 200,
|
|
73
|
-
path: response.data.data.path,
|
|
74
|
-
msg: response.data.msg,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./UploadContext";
|
|
2
|
-
export * from "./WebFileUploadContext";
|
|
3
|
-
export * from "./MaterialUploadContext";
|
|
4
|
-
export * from "./material-upload-context";
|
|
5
|
-
export * from "./material-upload-context-options";
|
|
6
|
-
export * from "./web-file-upload-context";
|
|
7
|
-
export * from "./web-file-upload-context-options";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ExtractPropTypes } from "vue";
|
|
2
|
-
import { buildProps } from "@maketribe/utils";
|
|
3
|
-
import { MaterialType } from "../../../dataview";
|
|
4
|
-
|
|
5
|
-
export const materialUploadContextProps = buildProps({
|
|
6
|
-
allowMaterialTypeValues: {
|
|
7
|
-
type: Array<MaterialType["value"]>,
|
|
8
|
-
},
|
|
9
|
-
} as const);
|
|
10
|
-
|
|
11
|
-
export type MaterialUploadContextProps = ExtractPropTypes<
|
|
12
|
-
typeof materialUploadContextProps
|
|
13
|
-
>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { computed, defineComponent, inject, unref, watch } from "vue";
|
|
2
|
-
import { materialUploadContextProps } from "./material-upload-context-options";
|
|
3
|
-
import { MaterialUploadContext } from "./MaterialUploadContext";
|
|
4
|
-
import { UploadContextCtxKey } from "./UploadContext";
|
|
5
|
-
import { withInstall } from "@maketribe/utils";
|
|
6
|
-
|
|
7
|
-
const _MaterialUploadContext = defineComponent({
|
|
8
|
-
name: "MKMaterialUploadContext",
|
|
9
|
-
props: materialUploadContextProps,
|
|
10
|
-
inheritAttrs: false,
|
|
11
|
-
setup(props, { slots }) {
|
|
12
|
-
const allowMaterialTypeValues = computed(
|
|
13
|
-
() => props.allowMaterialTypeValues
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const materialUploadContext = new MaterialUploadContext({
|
|
17
|
-
allowMaterialTypeValues: unref(allowMaterialTypeValues) ?? [],
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
watch(allowMaterialTypeValues, (allowMaterialTypeValues) => {
|
|
21
|
-
materialUploadContext.setAllowMaterialTypeValues(
|
|
22
|
-
allowMaterialTypeValues ?? []
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
inject(UploadContextCtxKey, { uploadContext: materialUploadContext });
|
|
27
|
-
|
|
28
|
-
return () => {
|
|
29
|
-
return slots.default?.();
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const MKMaterialUploadContext = withInstall(_MaterialUploadContext);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ExtractPropTypes } from "vue";
|
|
2
|
-
import { buildProps } from "@maketribe/utils";
|
|
3
|
-
import { WebFileUpload } from "@maketribe/request";
|
|
4
|
-
|
|
5
|
-
export const webFileUploadContextProps = buildProps({
|
|
6
|
-
accept: {
|
|
7
|
-
type: String,
|
|
8
|
-
},
|
|
9
|
-
webFileUpload: {
|
|
10
|
-
type: WebFileUpload,
|
|
11
|
-
},
|
|
12
|
-
} as const);
|
|
13
|
-
|
|
14
|
-
export type WebFileUploadContextProps = ExtractPropTypes<
|
|
15
|
-
typeof webFileUploadContextProps
|
|
16
|
-
>;
|