@maketribe/ms-app 3.0.29 → 3.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +39 -42
- package/src/components/button/button-options.ts +22 -0
- package/src/components/button/button.tsx +37 -0
- package/src/components/button/index.ts +7 -0
- package/src/components/column-components/column-action/column-action-options.ts +11 -0
- package/src/components/column-components/column-action/column-action.tsx +36 -0
- package/src/components/column-components/column-action/index.ts +4 -0
- package/src/components/column-components/column-date/column-date-options.ts +12 -0
- package/src/components/column-components/column-date/column-date.tsx +47 -0
- package/src/components/column-components/column-date/index.ts +6 -0
- package/src/components/column-components/column-image/column-image-options.ts +9 -0
- package/src/components/column-components/column-image/column-image.tsx +20 -0
- package/src/components/column-components/column-image/index.ts +4 -0
- package/src/components/column-components/column-json/column-json-options.ts +13 -0
- package/src/components/column-components/column-json/column-json.tsx +41 -0
- package/src/components/column-components/column-json/index.ts +8 -0
- package/src/components/column-components/column-link/column-link-options.ts +34 -0
- package/src/components/column-components/column-link/column-link.tsx +27 -0
- package/src/components/column-components/column-link/index.ts +7 -0
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text-options.ts +12 -0
- package/src/components/column-components/column-object-mapping-text/column-object-mapping-text.tsx +22 -0
- package/src/components/column-components/column-object-mapping-text/index.ts +6 -0
- package/src/components/column-components/column-select/column-select-header-options.ts +8 -0
- package/src/components/column-components/column-select/column-select-header.tsx +57 -0
- package/src/components/column-components/column-select/column-select-options.ts +9 -0
- package/src/components/column-components/column-select/column-select.tsx +74 -0
- package/src/components/column-components/column-select/index.ts +5 -0
- package/src/components/column-components/column-switch/column-switch-options.ts +16 -0
- package/src/components/column-components/column-switch/column-switch.tsx +37 -0
- package/src/components/column-components/column-switch/index.ts +6 -0
- package/src/components/column-components/column-tag/column-tag-options.ts +42 -0
- package/src/components/column-components/column-tag/column-tag.tsx +59 -0
- package/src/components/column-components/column-tag/index.ts +6 -0
- package/src/components/column-components/column-text/column-text-options.ts +10 -0
- package/src/components/column-components/column-text/column-text.tsx +18 -0
- package/src/components/column-components/column-text/index.ts +6 -0
- package/src/components/column-components/index.ts +10 -0
- package/src/components/condition-components/condition-date/condition-date-options.ts +21 -0
- package/src/components/condition-components/condition-date/condition-date.tsx +68 -0
- package/src/components/condition-components/condition-date/index.ts +7 -0
- package/src/components/condition-components/condition-input/condition-input-options.ts +10 -0
- package/src/components/condition-components/condition-input/condition-input.tsx +41 -0
- package/src/components/condition-components/condition-input/index.ts +7 -0
- package/src/components/condition-components/condition-number/condition-number-options.ts +22 -0
- package/src/components/condition-components/condition-number/condition-number.tsx +74 -0
- package/src/components/condition-components/condition-number/index.ts +7 -0
- package/src/components/condition-components/condition-select/condition-select-options.ts +31 -0
- package/src/components/condition-components/condition-select/condition-select.tsx +56 -0
- package/src/components/condition-components/condition-select/index.ts +7 -0
- package/src/components/condition-components/index.ts +4 -0
- package/src/components/config-provider/config-provider-options.ts +24 -0
- package/src/components/config-provider/config-provider.tsx +21 -0
- package/src/components/config-provider/constants.ts +8 -0
- package/src/components/config-provider/index.ts +9 -0
- package/src/components/config-provider/use-global-config.ts +70 -0
- package/src/components/data-model/data-filter-form/composables/index.ts +1 -0
- package/src/components/data-model/data-filter-form/composables/use-condition.ts +68 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item-options.ts +11 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/data-filter-form-item.tsx +183 -0
- package/src/components/data-model/data-filter-form/data-filter-form-item/index.ts +7 -0
- package/src/components/data-model/data-filter-form/data-filter-form-options.ts +15 -0
- package/src/components/data-model/data-filter-form/data-filter-form.tsx +103 -0
- package/src/components/data-model/data-filter-form/index.ts +13 -0
- package/src/components/data-model/data-filter-form/operator-options.ts +48 -0
- package/src/components/data-model/data-filter-form/token.ts +30 -0
- package/src/components/data-model/data-filter-popover/data-filter-popover-options.ts +6 -0
- package/src/components/data-model/data-filter-popover/data-filter-popover.tsx +52 -0
- package/src/components/data-model/data-filter-popover/index.ts +8 -0
- package/src/components/data-model/data-form/composables/index.ts +1 -0
- package/src/components/data-model/data-form/composables/use-form-item.ts +40 -0
- package/src/components/data-model/data-form/data-form-item/data-form-item-options.ts +11 -0
- package/src/components/data-model/data-form/data-form-item/data-form-item.tsx +140 -0
- package/src/components/data-model/data-form/data-form-item/index.ts +6 -0
- package/src/components/data-model/data-form/data-form-options.ts +43 -0
- package/src/components/data-model/data-form/data-form.tsx +113 -0
- package/src/components/data-model/data-form/index.ts +13 -0
- package/src/components/data-model/data-form/token.ts +16 -0
- package/src/components/data-model/data-form/views/form/form-options.ts +16 -0
- package/src/components/data-model/data-form/views/form/form.tsx +206 -0
- package/src/components/data-model/data-form/views/form/index.ts +6 -0
- package/src/components/data-model/data-form/views/form-view/form-view-options.ts +17 -0
- package/src/components/data-model/data-form/views/form-view/form-view.tsx +68 -0
- package/src/components/data-model/data-form/views/form-view/index.ts +6 -0
- package/src/components/data-model/data-form/views/index.ts +2 -0
- package/src/components/data-model/data-form-page/data-form-page-options.ts +20 -0
- package/src/components/data-model/data-form-page/data-form-page.tsx +57 -0
- package/src/components/data-model/data-form-page/index.ts +7 -0
- package/src/components/data-model/data-table/composables/index.ts +1 -0
- package/src/components/data-model/data-table/composables/use-column.ts +23 -0
- package/src/components/data-model/data-table/data-table-column/data-table-column-options.ts +11 -0
- package/src/components/data-model/data-table/data-table-column/data-table-column.tsx +18 -0
- package/src/components/data-model/data-table/data-table-column/index.ts +7 -0
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component-options.ts +13 -0
- package/src/components/data-model/data-table/data-table-column-component/data-table-column-component.tsx +38 -0
- package/src/components/data-model/data-table/data-table-column-component/index.ts +7 -0
- package/src/components/data-model/data-table/data-table-options.ts +24 -0
- package/src/components/data-model/data-table/data-table.tsx +102 -0
- package/src/components/data-model/data-table/index.ts +17 -0
- package/src/components/data-model/data-table/token.ts +10 -0
- package/src/components/data-model/data-table/views/index.ts +5 -0
- package/src/components/data-model/data-table/views/table/index.ts +8 -0
- package/src/components/data-model/data-table/views/table/table-options.ts +12 -0
- package/src/components/data-model/data-table/views/table/table.tsx +98 -0
- package/src/components/data-model/data-table/views/table-tree/index.ts +8 -0
- package/src/components/data-model/data-table/views/table-tree/table-tree-options.ts +12 -0
- package/src/components/data-model/data-table/views/table-tree/table-tree.tsx +104 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item-options.ts +34 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/classify-search-item.tsx +97 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search-item/index.ts +5 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/classify-search.tsx +40 -0
- package/src/components/data-model/data-table/views/table-view/classify-search/index.ts +7 -0
- package/src/components/data-model/data-table/views/table-view/index.ts +8 -0
- package/src/components/data-model/data-table/views/table-view/table-view-options.ts +13 -0
- package/src/components/data-model/data-table/views/table-view/table-view.tsx +126 -0
- package/src/components/data-model/data-table/views/tree/index.ts +8 -0
- package/src/components/data-model/data-table/views/tree/tree-options.ts +14 -0
- package/src/components/data-model/data-table/views/tree/tree.tsx +131 -0
- package/src/components/data-model/data-table/views/tree-view/index.ts +8 -0
- package/src/components/data-model/data-table/views/tree-view/tree-view-options.ts +16 -0
- package/src/components/data-model/data-table/views/tree-view/tree-view.tsx +81 -0
- package/src/components/data-model/data-table-page/data-table-page-options.ts +11 -0
- package/src/components/data-model/data-table-page/data-table-page.tsx +26 -0
- package/src/components/data-model/data-table-page/index.ts +6 -0
- package/src/components/data-model/data-table-pagination/data-table-pagination-options.ts +14 -0
- package/src/components/data-model/data-table-pagination/data-table-pagination.tsx +22 -0
- package/src/components/data-model/data-table-pagination/index.ts +7 -0
- package/src/components/data-model/filter-panel/composables/index.ts +1 -0
- package/src/components/data-model/filter-panel/composables/use-condition.ts +66 -0
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item-options.ts +11 -0
- package/src/components/data-model/filter-panel/filter-panel-item/filter-panel-item.tsx +187 -0
- package/src/components/data-model/filter-panel/filter-panel-item/index.ts +7 -0
- package/src/components/data-model/filter-panel/filter-panel-options.ts +15 -0
- package/src/components/data-model/filter-panel/filter-panel.tsx +102 -0
- package/src/components/data-model/filter-panel/index.ts +11 -0
- package/src/components/data-model/filter-panel/operator-options.ts +48 -0
- package/src/components/data-model/filter-panel/token.ts +17 -0
- package/src/components/data-model/index.ts +5 -0
- package/src/components/data-select/data-select-options.ts +43 -0
- package/src/components/data-select/data-select.tsx +87 -0
- package/src/components/data-select/index.ts +7 -0
- package/src/components/data-table-select/data-table-select-options.ts +43 -0
- package/src/components/data-table-select/data-table-select.tsx +190 -0
- package/src/components/data-table-select/index.ts +6 -0
- package/src/components/data-table-select-dialog/data-table-select-dialog-options.ts +33 -0
- package/src/components/data-table-select-dialog/data-table-select-dialog.tsx +154 -0
- package/src/components/data-table-select-dialog/index.ts +7 -0
- package/src/components/file-view/file-view-options.ts +8 -0
- package/src/components/file-view/file-view.tsx +40 -0
- package/src/components/file-view/index.ts +7 -0
- package/src/components/form-components/form-data-select/form-data-select-options.ts +23 -0
- package/src/components/form-components/form-data-select/form-data-select.tsx +28 -0
- package/src/components/form-components/form-data-select/index.ts +7 -0
- package/src/components/form-components/form-data-table-select/form-data-table-select-options.ts +19 -0
- package/src/components/form-components/form-data-table-select/form-data-table-select.tsx +32 -0
- package/src/components/form-components/form-data-table-select/index.ts +7 -0
- package/src/components/form-components/form-date-picker/form-date-picker-options.ts +18 -0
- package/src/components/form-components/form-date-picker/form-date-picker.tsx +49 -0
- package/src/components/form-components/form-date-picker/index.ts +8 -0
- package/src/components/form-components/form-detail/form-detail-options.ts +15 -0
- package/src/components/form-components/form-detail/form-detail.tsx +112 -0
- package/src/components/form-components/form-detail/index.ts +7 -0
- package/src/components/form-components/form-detail-select/form-detail-select-options.ts +39 -0
- package/src/components/form-components/form-detail-select/form-detail-select.tsx +68 -0
- package/src/components/form-components/form-detail-select/index.ts +5 -0
- package/src/components/form-components/form-icon-select/form-icon-select-options.ts +9 -0
- package/src/components/form-components/form-icon-select/form-icon-select.tsx +71 -0
- package/src/components/form-components/form-icon-select/index.ts +5 -0
- package/src/components/form-components/form-image-upload/form-image-upload-options.ts +11 -0
- package/src/components/form-components/form-image-upload/form-image-upload.tsx +22 -0
- package/src/components/form-components/form-image-upload/index.ts +5 -0
- package/src/components/form-components/form-radio-box/form-radio-box-options.ts +32 -0
- package/src/components/form-components/form-radio-box/form-radio-box.tsx +83 -0
- package/src/components/form-components/form-radio-box/index.ts +7 -0
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor-options.ts +6 -0
- package/src/components/form-components/form-rich-text-editor/form-rich-text-editor.tsx +22 -0
- package/src/components/form-components/form-rich-text-editor/index.ts +7 -0
- package/src/components/form-components/index.ts +9 -0
- package/src/components/image-select/image-select-option.ts +11 -0
- package/src/components/image-select/image-select.tsx +44 -0
- package/src/components/image-select/index.ts +6 -0
- package/src/components/image-view/image-view-options.ts +14 -0
- package/src/components/image-view/image-view.tsx +30 -0
- package/src/components/image-view/index.ts +7 -0
- package/src/components/index.ts +23 -0
- package/src/components/json-editor/index.ts +8 -0
- package/src/components/json-editor/json-editor-options.ts +21 -0
- package/src/components/json-editor/json-editor.tsx +28 -0
- package/src/components/markdown-editor/index.ts +10 -0
- package/src/components/markdown-editor/markdown-editor-options.ts +17 -0
- package/src/components/markdown-editor/markdown-editor.tsx +136 -0
- package/src/components/material-list/index.ts +7 -0
- package/src/components/material-list/material-group-form-popover.vue +78 -0
- package/src/components/material-list/material-group.vue +145 -0
- package/src/components/material-list/material-item.vue +26 -0
- package/src/components/material-list/material-list-options.ts +24 -0
- package/src/components/material-list/material-list.vue +153 -0
- package/src/components/material-select/index.ts +17 -0
- package/src/components/material-select/material-select-api.ts +55 -0
- package/src/components/material-select/material-select-options.ts +22 -0
- package/src/components/material-select/material-select-type.ts +21 -0
- package/src/components/material-select/material-select.tsx +106 -0
- package/src/components/pagination/index.ts +7 -0
- package/src/components/pagination/pagination-options.tsx +30 -0
- package/src/components/pagination/pagination.tsx +41 -0
- package/src/components/rich-text-editor/index.ts +10 -0
- package/src/components/rich-text-editor/langs/zh-Hans.js +1 -0
- package/src/components/rich-text-editor/rich-text-editor-options.ts +21 -0
- package/src/components/rich-text-editor/rich-text-editor.tsx +111 -0
- package/src/components/role-permission-config/index.ts +7 -0
- package/src/components/role-permission-config/role-permission-config-options.ts +20 -0
- package/src/components/role-permission-config/role-permission-config.tsx +269 -0
- package/src/components/svg-icon/index.ts +5 -0
- package/src/components/svg-icon/svg-icon-options.ts +21 -0
- package/src/components/svg-icon/svg-icon.tsx +48 -0
- package/src/components/system-provider/index.ts +5 -0
- package/src/components/system-provider/system-provider.tsx +95 -0
- package/src/components/upload-file/context/MaterialUploadContext.ts +33 -0
- package/src/components/upload-file/context/UploadContext.ts +21 -0
- package/src/components/upload-file/context/WebFileUploadContext.ts +77 -0
- package/src/components/upload-file/context/index.ts +7 -0
- package/src/components/upload-file/context/material-upload-context-options.ts +13 -0
- package/src/components/upload-file/context/material-upload-context.tsx +34 -0
- package/src/components/upload-file/context/web-file-upload-context-options.ts +16 -0
- package/src/components/upload-file/context/web-file-upload-context.tsx +37 -0
- package/src/components/upload-file/index.ts +11 -0
- package/src/components/upload-file/ui/index.ts +1 -0
- package/src/components/upload-file/ui/upload-image/index.ts +7 -0
- package/src/components/upload-file/ui/upload-image/upload-image-options.ts +25 -0
- package/src/components/upload-file/ui/upload-image/upload-image.tsx +337 -0
- package/src/components/upload-file/upload-file-options.ts +22 -0
- package/src/components/upload-file/upload-file.tsx +69 -0
- package/src/components/verify-dialog/index.ts +5 -0
- package/src/components/verify-dialog/verify-dialog-option.ts +24 -0
- package/src/components/verify-dialog/verify-dialog.tsx +179 -0
- package/src/components/video-view/index.ts +7 -0
- package/src/components/video-view/video-view-options.ts +10 -0
- package/src/components/video-view/video-view.tsx +115 -0
- package/src/composables/create-data-form.ts +6 -0
- package/src/composables/create-data-table.ts +8 -0
- package/src/composables/index.ts +17 -0
- package/src/composables/on-tab-before-close.ts +8 -0
- package/src/composables/on-tab-before-switch.ts +8 -0
- package/src/composables/on-tab-refresh.ts +8 -0
- package/src/composables/use-column-component.ts +184 -0
- package/src/composables/use-current-tab.ts +4 -0
- package/src/composables/use-http-request.ts +5 -0
- package/src/composables/use-i18n.ts +7 -0
- package/src/composables/use-ms-app-client.ts +10 -0
- package/src/composables/use-user-info.ts +4 -0
- package/src/constants/index.ts +6 -0
- package/src/constants/log.ts +5 -0
- package/src/constants/menu.ts +5 -0
- package/src/constants/pattern.ts +4 -0
- package/src/constants/region.ts +6 -0
- package/src/constants/route.ts +4 -0
- package/src/constants/token.ts +5 -0
- package/src/core/DataModelDefines.ts +72 -0
- package/src/core/MSAppClient.ts +260 -0
- package/src/core/PageManager.ts +169 -0
- package/src/core/PermissionPointManager.ts +26 -0
- package/src/core/Router.ts +150 -0
- package/src/core/UserInfo.ts +66 -0
- package/src/core/UserSession.ts +215 -0
- package/src/core/component/ConfigComponents.ts +32 -0
- package/src/core/component/DataFilterComponents.ts +40 -0
- package/src/core/component/DataFormComponents.ts +93 -0
- package/src/core/component/DataTableComponents.ts +91 -0
- package/src/core/component/MaterialComponents.ts +32 -0
- package/src/core/component/index.ts +5 -0
- package/src/core/index.ts +11 -0
- package/src/core/menu/Menu.ts +143 -0
- package/src/core/menu/MenuNode.ts +53 -0
- package/src/core/menu/index.ts +2 -0
- package/src/core/resolver/ITypeResolver.ts +5 -0
- package/src/core/tabs/Tab.ts +59 -0
- package/src/core/tabs/Tabs.ts +187 -0
- package/src/core/tabs/index.ts +2 -0
- package/src/dataview/config/ConfigForm.ts +142 -0
- package/src/dataview/config/ConfigTable.ts +72 -0
- package/src/dataview/config/index.ts +2 -0
- package/src/dataview/deny-ip-access-list/DenyIPAccessListForm.ts +33 -0
- package/src/dataview/deny-ip-access-list/DenyIPAccessListTable.ts +84 -0
- package/src/dataview/deny-ip-access-list/index.ts +2 -0
- package/src/dataview/department/DepartmentForm.ts +41 -0
- package/src/dataview/department/DepartmentTable.ts +64 -0
- package/src/dataview/department/DepartmentTree.ts +47 -0
- package/src/dataview/department/index.ts +3 -0
- package/src/dataview/index.ts +11 -0
- package/src/dataview/ip-white-list/IPWhitelistForm.ts +38 -0
- package/src/dataview/ip-white-list/IPWhitelistTable.ts +81 -0
- package/src/dataview/ip-white-list/index.ts +2 -0
- package/src/dataview/log/index.ts +4 -0
- package/src/dataview/log/local-log/LocalLogTree.ts +77 -0
- package/src/dataview/log/local-log/index.ts +1 -0
- package/src/dataview/log/login-log/LoginLogTable.ts +55 -0
- package/src/dataview/log/login-log/index.ts +1 -0
- package/src/dataview/log/operate-log/OperateLogTable.ts +20 -0
- package/src/dataview/log/operate-log/index.ts +1 -0
- package/src/dataview/log/request-log/RequestLogTable.ts +82 -0
- package/src/dataview/log/request-log/index.ts +1 -0
- package/src/dataview/material/MaterialForm.ts +49 -0
- package/src/dataview/material/MaterialMan.ts +203 -0
- package/src/dataview/material/MaterialTable.ts +125 -0
- package/src/dataview/material/index.ts +4 -0
- package/src/dataview/material/material-group/MaterialGroupForm.ts +27 -0
- package/src/dataview/material/material-group/MaterialGroupTable.ts +57 -0
- package/src/dataview/material/material-group/MaterialGroupTree.ts +71 -0
- package/src/dataview/material/material-group/index.ts +3 -0
- package/src/dataview/member/MemberForm.ts +124 -0
- package/src/dataview/member/MemberTable.tsx +257 -0
- package/src/dataview/member/index.ts +2 -0
- package/src/dataview/member/member-role/MemberRoleTable.ts +23 -0
- package/src/dataview/menu/MenuForm.ts +192 -0
- package/src/dataview/menu/MenuTable.ts +40 -0
- package/src/dataview/menu/MenuTree.ts +112 -0
- package/src/dataview/menu/index.ts +4 -0
- package/src/dataview/menu/permission-point/PermissionPointDefineForm.ts +30 -0
- package/src/dataview/menu/permission-point/PermissionPointDefineTable.ts +32 -0
- package/src/dataview/menu/permission-point/index.ts +2 -0
- package/src/dataview/region/RegionForm.ts +52 -0
- package/src/dataview/region/RegionTable.ts +64 -0
- package/src/dataview/region/index.ts +2 -0
- package/src/dataview/role/RoleForm.ts +34 -0
- package/src/dataview/role/RolePermissionConfigTable.ts +476 -0
- package/src/dataview/role/RoleTable.ts +70 -0
- package/src/dataview/role/index.ts +5 -0
- package/src/dataview/role/role-permission-point/RolePermissionPointTable.ts +29 -0
- package/src/dataview/role/role-permission-point/index.ts +1 -0
- package/src/dataview/role/role-route/RoleRouteTable.ts +30 -0
- package/src/dataview/role/role-route/index.ts +1 -0
- package/src/dataview/route/RouteForm.ts +94 -0
- package/src/dataview/route/RouteTable.ts +73 -0
- package/src/dataview/route/index.ts +2 -0
- package/src/define-data-form.ts +12 -0
- package/src/define-data-table.ts +12 -0
- package/src/define-data-tree.ts +12 -0
- package/src/index.ts +19 -0
- package/src/init-application.ts +83 -0
- package/src/installer.ts +73 -0
- package/src/layouts/components/bar/index.tsx +102 -0
- package/src/layouts/components/dialogs/dialogs.tsx +100 -0
- package/src/layouts/components/dialogs/index.ts +5 -0
- package/src/layouts/components/header/index.tsx +18 -0
- package/src/layouts/components/header/tools.tsx +55 -0
- package/src/layouts/components/index.ts +3 -0
- package/src/layouts/components/lock/index.ts +5 -0
- package/src/layouts/components/lock/lock.tsx +92 -0
- package/src/layouts/components/menu/index.tsx +61 -0
- package/src/layouts/components/menu/menu-item.tsx +63 -0
- package/src/layouts/container/default.tsx +85 -0
- package/src/layouts/index.ts +6 -0
- package/src/layouts/layout.tsx +11 -0
- package/src/message-impl/DialogerImpl.ts +84 -0
- package/src/message-impl/MessagerImpl.ts +17 -0
- package/src/message-impl/NotificationerImpl.ts +17 -0
- package/src/message-impl/index.ts +3 -0
- package/src/page/index/404.vue +3 -0
- package/src/page/index/dv/default/add.vue +50 -0
- package/src/page/index/dv/default/edit.vue +56 -0
- package/src/page/index/dv/default/single/list/dialog.vue +155 -0
- package/src/page/index/dv/default/single/list/normal.vue +128 -0
- package/src/page/index/dv/default/single/table-tree/dialog.vue +60 -0
- package/src/page/index/dv/default/single/tree/dialog.vue +174 -0
- package/src/page/index/dv/default/table.vue +52 -0
- package/src/page/index/dv/local-log/index.vue +98 -0
- package/src/page/index/dv/ms-member/index.vue +33 -0
- package/src/page/index/dv/ms-role/index.vue +32 -0
- package/src/page/index/material/index.vue +16 -0
- package/src/page/index.vue +9 -0
- package/src/page/login/index.vue +196 -0
- package/src/page/signup/index.vue +157 -0
- package/src/router-middleware/auth.ts +31 -0
- package/src/router-middleware/index.ts +1 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/ms-app-client.ts +10 -0
- package/src/utils.ts +233 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./upload-image";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from "vue";
|
|
2
|
+
import { buildProps } from "@maketribe/utils";
|
|
3
|
+
import { MaterialUploadContext, UploadContext } from "../../context";
|
|
4
|
+
|
|
5
|
+
export const uploadImageProps = buildProps({
|
|
6
|
+
uploadContext: {
|
|
7
|
+
type: UploadContext,
|
|
8
|
+
default: () => new MaterialUploadContext(),
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Array<String>],
|
|
12
|
+
},
|
|
13
|
+
multiple: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
} as const);
|
|
18
|
+
|
|
19
|
+
export type UploadImageProps = ExtractPropTypes<typeof uploadImageProps>;
|
|
20
|
+
|
|
21
|
+
export const uploadImageEmits = {
|
|
22
|
+
"update:modelValue": (path: string | string[]) => true,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type UploadImageEmits = typeof uploadImageEmits;
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
Ref,
|
|
4
|
+
VNode,
|
|
5
|
+
computed,
|
|
6
|
+
defineComponent,
|
|
7
|
+
ref,
|
|
8
|
+
unref,
|
|
9
|
+
watch,
|
|
10
|
+
} from "vue";
|
|
11
|
+
import { ElImage, ElTooltip, ElImageViewer } from "element-plus";
|
|
12
|
+
import { MKSvgIcon } from "../../../svg-icon";
|
|
13
|
+
import { MKUploadFile } from "../../upload-file";
|
|
14
|
+
import { uploadImageEmits, uploadImageProps } from "./upload-image-options";
|
|
15
|
+
import { UploadContext } from "../../context";
|
|
16
|
+
|
|
17
|
+
const MKUploadImageItem = defineComponent({
|
|
18
|
+
name: "MKUploadImageItem",
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "",
|
|
23
|
+
},
|
|
24
|
+
uploadContext: {
|
|
25
|
+
type: UploadContext,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue", "view", "delete"],
|
|
30
|
+
setup(props, { emit }) {
|
|
31
|
+
const uploadFileInstance: Ref<InstanceType<typeof MKUploadFile> | null> =
|
|
32
|
+
ref(null);
|
|
33
|
+
|
|
34
|
+
const imageInstance: Ref<InstanceType<typeof ElImage> | null> = ref(null);
|
|
35
|
+
|
|
36
|
+
const modelValue = computed({
|
|
37
|
+
get: () => props.modelValue as string,
|
|
38
|
+
set: (v: string) => {
|
|
39
|
+
emit("update:modelValue", v);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const handleUpdateModelValue = (v: string) => {
|
|
44
|
+
modelValue.value = v;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const handleClick = (event: MouseEvent) => {
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
|
|
50
|
+
if (unref(modelValue)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
unref(uploadFileInstance)?.handleUpload();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleView = (event: MouseEvent) => {
|
|
58
|
+
event.stopPropagation();
|
|
59
|
+
|
|
60
|
+
emit("view", unref(modelValue));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handleDelete = (event: MouseEvent) => {
|
|
64
|
+
event.stopPropagation();
|
|
65
|
+
|
|
66
|
+
// modelValue.value = "";
|
|
67
|
+
emit("delete", unref(modelValue));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
let content;
|
|
72
|
+
|
|
73
|
+
if (unref(modelValue)) {
|
|
74
|
+
content = (
|
|
75
|
+
<Fragment>
|
|
76
|
+
<ElImage
|
|
77
|
+
ref={
|
|
78
|
+
((el: InstanceType<typeof ElImage>) =>
|
|
79
|
+
(imageInstance.value = el)) as any
|
|
80
|
+
}
|
|
81
|
+
src={unref(modelValue)}
|
|
82
|
+
class="mk-upload-image-item__image"
|
|
83
|
+
fit="cover"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<div class="mk-upload-image-item__mask">
|
|
87
|
+
<ElTooltip content="查看">
|
|
88
|
+
<MKSvgIcon iconClass="View" onClick={handleView} />
|
|
89
|
+
</ElTooltip>
|
|
90
|
+
<ElTooltip content="删除">
|
|
91
|
+
<MKSvgIcon iconClass="Delete" onClick={handleDelete} />
|
|
92
|
+
</ElTooltip>
|
|
93
|
+
</div>
|
|
94
|
+
</Fragment>
|
|
95
|
+
);
|
|
96
|
+
} else {
|
|
97
|
+
content = <MKSvgIcon iconClass="Plus" />;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div class="mk-upload-image-item">
|
|
102
|
+
<MKUploadFile
|
|
103
|
+
modelValue={props.modelValue}
|
|
104
|
+
onUpdate:modelValue={handleUpdateModelValue}
|
|
105
|
+
uploadContext={props.uploadContext}
|
|
106
|
+
ref={
|
|
107
|
+
((el: InstanceType<typeof MKUploadFile>) =>
|
|
108
|
+
(uploadFileInstance.value = el)) as any
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<div class="mk-upload-image-item__wrapper" onClick={handleClick}>
|
|
112
|
+
{content}
|
|
113
|
+
</div>
|
|
114
|
+
</MKUploadFile>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export default defineComponent({
|
|
122
|
+
name: "MKUploadImage",
|
|
123
|
+
props: uploadImageProps,
|
|
124
|
+
emits: uploadImageEmits,
|
|
125
|
+
setup(props, { emit }) {
|
|
126
|
+
const modelValue = computed({
|
|
127
|
+
get: () => props.modelValue as string[] | string,
|
|
128
|
+
set: (v: string[] | string) => emit("update:modelValue", v),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const currentImageSrc: Ref<string> = ref("");
|
|
132
|
+
|
|
133
|
+
const multiple = computed(() => props.multiple);
|
|
134
|
+
|
|
135
|
+
const isShowImageViewer: Ref<boolean> = ref(false);
|
|
136
|
+
|
|
137
|
+
watch(
|
|
138
|
+
computed(() => [unref(modelValue), unref(multiple)]),
|
|
139
|
+
([value, multiple]) => {
|
|
140
|
+
if (multiple && !Array.isArray(value)) {
|
|
141
|
+
modelValue.value = [];
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{ immediate: true }
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const handleDelete = (src: string) => {
|
|
148
|
+
if (!unref(multiple)) {
|
|
149
|
+
modelValue.value = "";
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const index = unref(modelValue).indexOf(src);
|
|
154
|
+
|
|
155
|
+
if (index === -1) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
(modelValue.value as string[]).splice(index, 1);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const handleShowImageViewer = (src: string) => {
|
|
163
|
+
isShowImageViewer.value = true;
|
|
164
|
+
currentImageSrc.value = src;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const handleCloseImageViewer = () => {
|
|
168
|
+
isShowImageViewer.value = false;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const handleAppendImage = (src: string) => {
|
|
172
|
+
const _value = unref(modelValue);
|
|
173
|
+
|
|
174
|
+
if (Array.isArray(_value)) {
|
|
175
|
+
_value.push(src);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return () => {
|
|
180
|
+
const _multiple = unref(multiple);
|
|
181
|
+
|
|
182
|
+
let content;
|
|
183
|
+
|
|
184
|
+
if (!_multiple) {
|
|
185
|
+
content = (
|
|
186
|
+
<MKUploadImageItem
|
|
187
|
+
onView={handleShowImageViewer}
|
|
188
|
+
onDelete={handleDelete}
|
|
189
|
+
modelValue={unref(modelValue) as string}
|
|
190
|
+
onUpdate:modelValue={(value) => (modelValue.value = value)}
|
|
191
|
+
uploadContext={props.uploadContext}
|
|
192
|
+
/>
|
|
193
|
+
);
|
|
194
|
+
} else {
|
|
195
|
+
let images: VNode[] | null = null;
|
|
196
|
+
|
|
197
|
+
if (Array.isArray(unref(modelValue))) {
|
|
198
|
+
images = (unref(modelValue) as string[]).map((src) => (
|
|
199
|
+
<MKUploadImageItem
|
|
200
|
+
onView={handleShowImageViewer}
|
|
201
|
+
onDelete={handleDelete}
|
|
202
|
+
modelValue={src}
|
|
203
|
+
uploadContext={props.uploadContext}
|
|
204
|
+
/>
|
|
205
|
+
));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
content = (
|
|
209
|
+
<Fragment>
|
|
210
|
+
{images}
|
|
211
|
+
<MKUploadImageItem
|
|
212
|
+
onUpdate:modelValue={handleAppendImage}
|
|
213
|
+
uploadContext={props.uploadContext}
|
|
214
|
+
/>
|
|
215
|
+
</Fragment>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const imageViewer = unref(isShowImageViewer) ? (
|
|
220
|
+
<ElImageViewer
|
|
221
|
+
onClose={handleCloseImageViewer}
|
|
222
|
+
urlList={[unref(currentImageSrc)]}
|
|
223
|
+
/>
|
|
224
|
+
) : null;
|
|
225
|
+
|
|
226
|
+
return (
|
|
227
|
+
<div class="mk-upload-image">
|
|
228
|
+
{content}
|
|
229
|
+
{imageViewer}
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
// setup(props, { emit }) {
|
|
235
|
+
// const uploadFileInstance: Ref<InstanceType<typeof MKUploadFile> | null> =
|
|
236
|
+
// ref(null);
|
|
237
|
+
|
|
238
|
+
// const imageInstance: Ref<InstanceType<typeof ElImage> | null> = ref(null);
|
|
239
|
+
|
|
240
|
+
// const isShowImageViewer: Ref<boolean> = ref(false);
|
|
241
|
+
|
|
242
|
+
// const modelValue = computed({
|
|
243
|
+
// get: () => props.modelValue as string,
|
|
244
|
+
// set: (v: string) => {
|
|
245
|
+
// emit("update:modelValue", v);
|
|
246
|
+
// },
|
|
247
|
+
// });
|
|
248
|
+
|
|
249
|
+
// const handleUpdateModelValue = (v: string) => {
|
|
250
|
+
// modelValue.value = v;
|
|
251
|
+
// };
|
|
252
|
+
|
|
253
|
+
// const handleClick = (event: MouseEvent) => {
|
|
254
|
+
// event.stopPropagation();
|
|
255
|
+
|
|
256
|
+
// if (unref(modelValue)) {
|
|
257
|
+
// return;
|
|
258
|
+
// }
|
|
259
|
+
|
|
260
|
+
// unref(uploadFileInstance)?.handleUpload();
|
|
261
|
+
// };
|
|
262
|
+
|
|
263
|
+
// const handleView = (event: MouseEvent) => {
|
|
264
|
+
// event.stopPropagation();
|
|
265
|
+
|
|
266
|
+
// isShowImageViewer.value = true;
|
|
267
|
+
// };
|
|
268
|
+
|
|
269
|
+
// const handleCloseImageViewer = () => {
|
|
270
|
+
// isShowImageViewer.value = false;
|
|
271
|
+
// };
|
|
272
|
+
|
|
273
|
+
// const handleDelete = (event: MouseEvent) => {
|
|
274
|
+
// event.stopPropagation();
|
|
275
|
+
|
|
276
|
+
// modelValue.value = "";
|
|
277
|
+
// };
|
|
278
|
+
|
|
279
|
+
// return () => {
|
|
280
|
+
// let content;
|
|
281
|
+
|
|
282
|
+
// if (unref(modelValue)) {
|
|
283
|
+
// const imageViewer = unref(isShowImageViewer) ? (
|
|
284
|
+
// <ElImageViewer
|
|
285
|
+
// onClose={handleCloseImageViewer}
|
|
286
|
+
// urlList={[unref(modelValue)]}
|
|
287
|
+
// />
|
|
288
|
+
// ) : null;
|
|
289
|
+
|
|
290
|
+
// content = (
|
|
291
|
+
// <Fragment>
|
|
292
|
+
// <ElImage
|
|
293
|
+
// ref={
|
|
294
|
+
// ((el: InstanceType<typeof ElImage>) =>
|
|
295
|
+
// (imageInstance.value = el)) as any
|
|
296
|
+
// }
|
|
297
|
+
// src={unref(modelValue)}
|
|
298
|
+
// class="mk-upload-image__image"
|
|
299
|
+
// fit="cover"
|
|
300
|
+
// />
|
|
301
|
+
|
|
302
|
+
// {imageViewer}
|
|
303
|
+
|
|
304
|
+
// <div class="mk-upload-image__mask">
|
|
305
|
+
// <ElTooltip content="查看">
|
|
306
|
+
// <MKSvgIcon iconClass="View" onClick={handleView} />
|
|
307
|
+
// </ElTooltip>
|
|
308
|
+
// <ElTooltip content="删除">
|
|
309
|
+
// <MKSvgIcon iconClass="Delete" onClick={handleDelete} />
|
|
310
|
+
// </ElTooltip>
|
|
311
|
+
// </div>
|
|
312
|
+
// </Fragment>
|
|
313
|
+
// );
|
|
314
|
+
// } else {
|
|
315
|
+
// content = <MKSvgIcon iconClass="Plus" />;
|
|
316
|
+
// }
|
|
317
|
+
|
|
318
|
+
// return (
|
|
319
|
+
// <div class="mk-upload-image">
|
|
320
|
+
// <MKUploadFile
|
|
321
|
+
// modelValue={props.modelValue}
|
|
322
|
+
// onUpdate:modelValue={handleUpdateModelValue}
|
|
323
|
+
// uploadContext={props.uploadContext}
|
|
324
|
+
// ref={
|
|
325
|
+
// ((el: InstanceType<typeof MKUploadFile>) =>
|
|
326
|
+
// (uploadFileInstance.value = el)) as any
|
|
327
|
+
// }
|
|
328
|
+
// >
|
|
329
|
+
// <div class="mk-upload-image__wrapper" onClick={handleClick}>
|
|
330
|
+
// {content}
|
|
331
|
+
// </div>
|
|
332
|
+
// </MKUploadFile>
|
|
333
|
+
// </div>
|
|
334
|
+
// );
|
|
335
|
+
// };
|
|
336
|
+
// },
|
|
337
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExtractPropTypes } from "vue";
|
|
2
|
+
import { buildProps } from "@maketribe/utils";
|
|
3
|
+
import { UploadContext } from "./context";
|
|
4
|
+
import { MaterialUploadContext } from "./context/MaterialUploadContext";
|
|
5
|
+
|
|
6
|
+
export const uploadFileProps = buildProps({
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
},
|
|
10
|
+
uploadContext: {
|
|
11
|
+
type: UploadContext,
|
|
12
|
+
default: () => new MaterialUploadContext(),
|
|
13
|
+
},
|
|
14
|
+
} as const);
|
|
15
|
+
|
|
16
|
+
export type UploadFileProps = ExtractPropTypes<typeof uploadFileProps>;
|
|
17
|
+
|
|
18
|
+
export const uploadFileEmits = {
|
|
19
|
+
"update:modelValue": (path: string) => true,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type UploadFileEmits = typeof uploadFileEmits;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { computed, defineComponent, inject, unref } from "vue";
|
|
2
|
+
import { uploadFileEmits, uploadFileProps } from "./upload-file-options";
|
|
3
|
+
import { ElMessage } from "element-plus";
|
|
4
|
+
import { UploadContextCtxKey } from "./context";
|
|
5
|
+
import { withInstall } from "@maketribe/utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 文件上传
|
|
9
|
+
*
|
|
10
|
+
* 文件上传在本后台中有两大分类
|
|
11
|
+
* 1.直接上传文件
|
|
12
|
+
* 2.使用素材库文件
|
|
13
|
+
*
|
|
14
|
+
* 文件上传的界面交互又会分为几种情况
|
|
15
|
+
* 1.单文件上传(单文件上传,可能会根据。文件情况的不同,界面显示方式不一样)
|
|
16
|
+
* 2.多文件上传(多文件上传基于单文件的逻辑,不过是会变成多个文件)
|
|
17
|
+
*
|
|
18
|
+
* 希望文件交互组件不需要用了解是直接上传文件或使用素材库。
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const _UploadFile = defineComponent({
|
|
23
|
+
name: "MKUploadFile",
|
|
24
|
+
props: uploadFileProps,
|
|
25
|
+
emits: uploadFileEmits,
|
|
26
|
+
setup(props, { emit }) {
|
|
27
|
+
const uploadContextCtx = inject(UploadContextCtxKey, null);
|
|
28
|
+
|
|
29
|
+
const value = computed({
|
|
30
|
+
get: () => props.modelValue as string,
|
|
31
|
+
set: (v: string) => emit("update:modelValue", v),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const uploadContext = computed(
|
|
35
|
+
() => uploadContextCtx?.uploadContext || props.uploadContext
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const handleUpload = async () => {
|
|
39
|
+
try {
|
|
40
|
+
const uploadResult = await unref(uploadContext).selectFile();
|
|
41
|
+
|
|
42
|
+
if (uploadResult.success) {
|
|
43
|
+
value.value = uploadResult.path || value.value;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ElMessage.error(uploadResult.msg);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error(e);
|
|
50
|
+
ElMessage.error("网络异常");
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
handleUpload,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
render() {
|
|
59
|
+
const { handleUpload, $slots } = this;
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<span class="mk-upload-file" onClick={handleUpload}>
|
|
63
|
+
{$slots.default?.()}
|
|
64
|
+
</span>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const MKUploadFile = withInstall(_UploadFile);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExtractPropTypes } from "vue";
|
|
2
|
+
import { buildProps } from "@maketribe/utils";
|
|
3
|
+
|
|
4
|
+
export const verifyDialogProps = buildProps({
|
|
5
|
+
visible: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
scene: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
width: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "300px",
|
|
16
|
+
},
|
|
17
|
+
} as const);
|
|
18
|
+
|
|
19
|
+
export const verifyDialogEmits = {
|
|
20
|
+
"update:visible": (modelValue: any) => true,
|
|
21
|
+
|
|
22
|
+
confirm: (modelValue: any) => true,
|
|
23
|
+
};
|
|
24
|
+
export type VerifyDialogProps = ExtractPropTypes<typeof verifyDialogEmits>;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
unref,
|
|
5
|
+
ref,
|
|
6
|
+
onMounted,
|
|
7
|
+
watch,
|
|
8
|
+
Ref,
|
|
9
|
+
} from "vue";
|
|
10
|
+
import { ElDialog, ElSlider, ElButton } from "element-plus";
|
|
11
|
+
import { useHttpRequest } from "../../composables";
|
|
12
|
+
import { verifyDialogProps, verifyDialogEmits } from "./verify-dialog-option";
|
|
13
|
+
import { Disposable, createDisposable } from "@maketribe/utils";
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: "MKVerifyDialog",
|
|
17
|
+
props: verifyDialogProps,
|
|
18
|
+
emits: verifyDialogEmits,
|
|
19
|
+
// expose: ["fail"],
|
|
20
|
+
setup(props, { emit, expose }) {
|
|
21
|
+
const wrapperEl: Ref<HTMLElement | null> = ref(null);
|
|
22
|
+
const buttonEl: Ref<HTMLElement | null> = ref(null);
|
|
23
|
+
const grandEl: Ref<HTMLElement | null> = ref(null);
|
|
24
|
+
// 样式默认宽度是48px
|
|
25
|
+
let slideWidth: number = 48;
|
|
26
|
+
|
|
27
|
+
const isError = ref(false);
|
|
28
|
+
|
|
29
|
+
const deg = ref(0);
|
|
30
|
+
|
|
31
|
+
const httpRequest = useHttpRequest();
|
|
32
|
+
|
|
33
|
+
const imageUrl = ref("");
|
|
34
|
+
|
|
35
|
+
const imageStyle = computed(() => {
|
|
36
|
+
return {
|
|
37
|
+
backgroundImage: `url(${unref(imageUrl)})`,
|
|
38
|
+
transform: `rotate(-${unref(deg)}deg)`,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const visible = computed({
|
|
43
|
+
get: () => props.visible,
|
|
44
|
+
set: (v) => emit("update:visible", v),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const getImage = async () => {
|
|
48
|
+
const params = { scene: props.scene };
|
|
49
|
+
|
|
50
|
+
const response = await httpRequest!.get(
|
|
51
|
+
"/api/open/verification/rotation/image",
|
|
52
|
+
{
|
|
53
|
+
params,
|
|
54
|
+
responseType: "blob",
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return response.data ?? null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const handleSwitchConfirm = () => {
|
|
62
|
+
emit("confirm", unref(deg));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleMouseDown = (mouseDownEvent: MouseEvent) => {
|
|
66
|
+
if (unref(isError)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const disposable = new Disposable();
|
|
71
|
+
|
|
72
|
+
const totalWidth = unref(wrapperEl)!.getBoundingClientRect().width;
|
|
73
|
+
|
|
74
|
+
const handleMouseMove = (event: MouseEvent) => {
|
|
75
|
+
// 限定宽度范围
|
|
76
|
+
slideWidth = Math.min(
|
|
77
|
+
Math.max(event.clientX - mouseDownEvent.clientX + 48, 48),
|
|
78
|
+
totalWidth
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
deg.value = Math.floor(((slideWidth - 48) / (totalWidth - 48)) * 360);
|
|
82
|
+
|
|
83
|
+
unref(grandEl)!.style.width = `${slideWidth}px`;
|
|
84
|
+
unref(buttonEl)!.style.transform = `translateX(${slideWidth - 48}px)`;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleMouseUp = (event: MouseEvent) => {
|
|
88
|
+
if (deg.value !== 0) {
|
|
89
|
+
handleSwitchConfirm();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
disposable.dispose();
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
96
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
97
|
+
|
|
98
|
+
disposable.register(
|
|
99
|
+
createDisposable(() => {
|
|
100
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
101
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const reset = () => {
|
|
107
|
+
unref(grandEl)!.style.width = ``;
|
|
108
|
+
unref(buttonEl)!.style.transform = ``;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
expose({
|
|
112
|
+
fail: () => {
|
|
113
|
+
isError.value = true;
|
|
114
|
+
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
isError.value = false;
|
|
117
|
+
|
|
118
|
+
reset();
|
|
119
|
+
}, 1000);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
onMounted(() => {
|
|
124
|
+
watch(
|
|
125
|
+
visible,
|
|
126
|
+
async (visible, _, onCleanup) => {
|
|
127
|
+
if (visible) {
|
|
128
|
+
const blob = await getImage();
|
|
129
|
+
|
|
130
|
+
const url = URL.createObjectURL(blob);
|
|
131
|
+
imageUrl.value = url;
|
|
132
|
+
|
|
133
|
+
onCleanup(() => {
|
|
134
|
+
URL.revokeObjectURL(url);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{ immediate: true }
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
return () => {
|
|
142
|
+
return (
|
|
143
|
+
<ElDialog
|
|
144
|
+
modelValue={visible.value}
|
|
145
|
+
onUpdate:modelValue={(v: boolean) => (visible.value = v)}
|
|
146
|
+
modal-class="mk-verify-dialog"
|
|
147
|
+
width={props.width}
|
|
148
|
+
title="请完成下方验证后继续操作"
|
|
149
|
+
appendToBody
|
|
150
|
+
>
|
|
151
|
+
<div class="mk-verify-dialog__wrapper">
|
|
152
|
+
<div
|
|
153
|
+
class="mk-verify-dialog__image"
|
|
154
|
+
ref="imageEl"
|
|
155
|
+
style={imageStyle.value}
|
|
156
|
+
/>
|
|
157
|
+
<div class="mk-verify-dialog__coordinate" />
|
|
158
|
+
</div>
|
|
159
|
+
<div class={["mk-verify-switch", unref(isError) ? "is-error" : ""]}>
|
|
160
|
+
<div
|
|
161
|
+
class="mk-verify-switch__wrapper"
|
|
162
|
+
ref={((el: HTMLDivElement) => (wrapperEl.value = el)) as any}
|
|
163
|
+
>
|
|
164
|
+
<div
|
|
165
|
+
class="mk-verify-switch__button-grand"
|
|
166
|
+
ref={((el: HTMLDivElement) => (grandEl.value = el)) as any}
|
|
167
|
+
/>
|
|
168
|
+
<div
|
|
169
|
+
class="mk-verify-switch__button"
|
|
170
|
+
ref={((el: HTMLDivElement) => (buttonEl.value = el)) as any}
|
|
171
|
+
onMousedown={handleMouseDown}
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</ElDialog>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
});
|