cx-chat 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/i18n-cn-gloss-comments.mdc +31 -0
- package/.cursor/rules/list-page-view-pageconfig.mdc +32 -0
- package/.cursor/rules/no-over-defensive-programming.mdc +90 -0
- package/.cursor/rules/requirement-description-for-agent.mdc +33 -0
- package/.cursor/rules/use-showToast-not-antd-message.mdc +28 -0
- package/.docker/Dockerfile +7 -0
- package/.env +9 -0
- package/.env.development +7 -0
- package/.env.production +7 -0
- package/.gitlab-ci/docker-build.yaml +28 -0
- package/.gitlab-ci/k8s-deploy-dev-master.yaml +42 -0
- package/.gitlab-ci/npm-build.yaml +17 -0
- package/.gitlab-ci.yml +8 -0
- package/.k8s/0-namespace.yaml +6 -0
- package/.k8s/1-configmap-web.yaml +7 -0
- package/.k8s/1-nginx-conf-dev.yaml +110 -0
- package/.k8s/2-deployment.yaml +27 -0
- package/.k8s/3-service.yaml +16 -0
- package/.k8s/4-ingress-dev.yaml +30 -0
- package/.lingma/rules/use-showToast-not-antd-message.md +34 -0
- package/.nginx/nginx.conf +52 -0
- package/.prettierrc +9 -0
- package/README.md +1 -0
- package/eslint.config.js +32 -0
- package/index.html +13 -0
- package/package.json +67 -0
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/public/vite.svg +1 -0
- package/src/App.tsx +96 -0
- package/src/_doc/0.docs-overview.md +28 -0
- package/src/_doc/cx-ui/0.docs-overview.md +30 -0
- package/src/_doc/cx-ui/comp.1.cx-ui-overview.md +82 -0
- package/src/_doc/cx-ui/comp.2.cx-modal.md +82 -0
- package/src/_doc/cx-ui/comp.3.cx-button.md +89 -0
- package/src/_doc/cx-ui/comp.4.cx-form.md +72 -0
- package/src/_doc/cx-ui/comp.5.cx-fields.md +76 -0
- package/src/_doc/cx-ui/comp.6.cx-tag.md +57 -0
- package/src/_doc/cx-ui/comp.7.cx-empty-state.md +29 -0
- package/src/_doc/meta/0.docs-overview.md +24 -0
- package/src/_doc/meta/comp.1.enum-runtime.md +33 -0
- package/src/_doc/meta/comp.2.dict-runtime.md +39 -0
- package/src/_doc/router/0.docs-overview.md +14 -0
- package/src/_doc/router/guide.1.menu-component-config.md +181 -0
- package/src/_doc/router/guide.2.router-auto-registration.md +114 -0
- package/src/_doc/table-view/0.docs-overview.md +30 -0
- package/src/_doc/table-view/comp.1.table-view.md +542 -0
- package/src/_doc/table-view/props.1.create-table-view-config.md +193 -0
- package/src/_doc/table-view/props.2.table-view-search-fields.md +106 -0
- package/src/api/_mock/README.md +340 -0
- package/src/api/_mock/api.ts +1642 -0
- package/src/api/_mock/bundle-shim.ts +16 -0
- package/src/api/_mock/handler-shim.ts +6 -0
- package/src/api/_mock/handler.ts +458 -0
- package/src/api/_mock/index.ts +711 -0
- package/src/api/_mock/interceptor.ts +15 -0
- package/src/api/_mock/mod.ts +12 -0
- package/src/api/_mock/utils.ts +65 -0
- package/src/api/base/memory.js +24 -0
- package/src/api/chat.js +210 -0
- package/src/api/common/auth.js +70 -0
- package/src/api/menus/business-rules.js +76 -0
- package/src/api/menus/feedback.js +102 -0
- package/src/api/menus/knowledge.js +159 -0
- package/src/api/menus/model-metadata/manage.js +70 -0
- package/src/api/menus/model-metadata/role.js +50 -0
- package/src/api/menus/model-metadata/training-detail-mock-data.js +569 -0
- package/src/api/menus/model-metadata/training.js +28 -0
- package/src/api/menus/skill.js +40 -0
- package/src/api/system/agent-config.js +16 -0
- package/src/api/system/department.js +94 -0
- package/src/api/system/dict.js +86 -0
- package/src/api/system/menu.js +37 -0
- package/src/api/system/permission.js +26 -0
- package/src/api/system/role.js +34 -0
- package/src/api/system/sys-config.js +16 -0
- package/src/api/system/sys-log.js +17 -0
- package/src/api/system/user.js +75 -0
- package/src/api/upload.js +39 -0
- package/src/assets/react.svg +1 -0
- package/src/components/auth/current-user-avatar.tsx +77 -0
- package/src/components/common/code-view.tsx +149 -0
- package/src/components/common/detail-link.tsx +67 -0
- package/src/components/common/error-boundary.tsx +98 -0
- package/src/components/common/language-switcher.tsx +91 -0
- package/src/components/common/lite-table/index.tsx +135 -0
- package/src/components/common/md-editor.tsx +126 -0
- package/src/components/common/modal/confirm-dialog.tsx +113 -0
- package/src/components/common/modal/dep-user-select-multi.tsx +324 -0
- package/src/components/common/modal/dep-user-select.tsx +249 -0
- package/src/components/common/modal/user-select-multi.tsx +266 -0
- package/src/components/common/pagination.tsx +472 -0
- package/src/components/common/path.tsx +175 -0
- package/src/components/common/system-logo-mark.tsx +48 -0
- package/src/components/cx-ui/button/index.less +208 -0
- package/src/components/cx-ui/button/index.tsx +611 -0
- package/src/components/cx-ui/checkbox/index.tsx +78 -0
- package/src/components/cx-ui/date-picker/index.less +17 -0
- package/src/components/cx-ui/date-picker/index.tsx +193 -0
- package/src/components/cx-ui/drawer/index.tsx +47 -0
- package/src/components/cx-ui/empty-state/index.tsx +20 -0
- package/src/components/cx-ui/floating-shell/CxFloatingShell.tsx +89 -0
- package/src/components/cx-ui/floating-shell/cx-floating-shell.less +283 -0
- package/src/components/cx-ui/floating-shell/has-floating-value.ts +41 -0
- package/src/components/cx-ui/form/CxForm.tsx +15 -0
- package/src/components/cx-ui/form/index.tsx +20 -0
- package/src/components/cx-ui/form-item/index.less +26 -0
- package/src/components/cx-ui/form-item/index.tsx +36 -0
- package/src/components/cx-ui/index.ts +70 -0
- package/src/components/cx-ui/input/auto-complete.tsx +134 -0
- package/src/components/cx-ui/input/index.tsx +259 -0
- package/src/components/cx-ui/input-number/index.jsx +66 -0
- package/src/components/cx-ui/modal/index.jsx +212 -0
- package/src/components/cx-ui/modal/index.less +144 -0
- package/src/components/cx-ui/modal/useCxModal.ts +125 -0
- package/src/components/cx-ui/multi-select/index.jsx +74 -0
- package/src/components/cx-ui/multi-select/index.less +40 -0
- package/src/components/cx-ui/multi-select/index2.tsx +361 -0
- package/src/components/cx-ui/radio/index.tsx +33 -0
- package/src/components/cx-ui/range-picker/index.less +65 -0
- package/src/components/cx-ui/range-picker/index.tsx +219 -0
- package/src/components/cx-ui/select/index.less +34 -0
- package/src/components/cx-ui/select/index.tsx +196 -0
- package/src/components/cx-ui/skeleton/index.tsx +12 -0
- package/src/components/cx-ui/steps/index.tsx +14 -0
- package/src/components/cx-ui/styles/_tokens.less +79 -0
- package/src/components/cx-ui/styles/index.less +246 -0
- package/src/components/cx-ui/switch/index.less +106 -0
- package/src/components/cx-ui/switch/index.tsx +120 -0
- package/src/components/cx-ui/table/index.less +160 -0
- package/src/components/cx-ui/table/index.tsx +152 -0
- package/src/components/cx-ui/tabs/index.less +15 -0
- package/src/components/cx-ui/tabs/index.tsx +34 -0
- package/src/components/cx-ui/tag/index.less +51 -0
- package/src/components/cx-ui/tag/index.tsx +140 -0
- package/src/components/cx-ui/timeline/index.tsx +14 -0
- package/src/components/cx-ui/tooltip/index.tsx +67 -0
- package/src/components/cx-ui/tree/index.tsx +193 -0
- package/src/components/cx-ui/tree-select/index.jsx +91 -0
- package/src/components/cx-ui/tree-select/index.less +27 -0
- package/src/components/cx-ui/upload-file/index.less +223 -0
- package/src/components/cx-ui/upload-file/index.tsx +640 -0
- package/src/components/cx-ui/upload-img/index.tsx +291 -0
- package/src/components/layout/components/Header.tsx +216 -0
- package/src/components/layout/components/Sidebar.tsx +717 -0
- package/src/components/layout/index.tsx +95 -0
- package/src/components/table-view/components/search-area.tsx +411 -0
- package/src/components/table-view/components/table-view-config.tsx +528 -0
- package/src/components/table-view/components/table-view.types.ts +478 -0
- package/src/components/table-view/components/tree-api-normalize.ts +38 -0
- package/src/components/table-view/components/tree-data-annotate.ts +31 -0
- package/src/components/table-view/components/tree-sidebar.tsx +74 -0
- package/src/components/table-view/index.tsx +61 -0
- package/src/components/table-view/list-page-view.tsx +1049 -0
- package/src/components/table-view/select-table-view.tsx +1094 -0
- package/src/components/table-view/styles/select-table-view.less +51 -0
- package/src/config/default-system-name.ts +9 -0
- package/src/config/system.ts +165 -0
- package/src/constants/countryCodes.ts +3 -0
- package/src/contexts/AuthContext.tsx +256 -0
- package/src/contexts/ChatContext.tsx +839 -0
- package/src/contexts/MenuContext.tsx +62 -0
- package/src/contexts/ToastContext.tsx +181 -0
- package/src/hooks/useCopyToClipboard.ts +47 -0
- package/src/hooks/useModalSubmit.ts +104 -0
- package/src/hooks/useRouter.ts +240 -0
- package/src/hooks/useStepForm.ts +46 -0
- package/src/hooks/useStickyHeader.ts +42 -0
- package/src/hooks/useThreadActions.ts +105 -0
- package/src/hooks/useUserPreferences.ts +101 -0
- package/src/http/axios.js +372 -0
- package/src/http/mock.interceptor.ts +9 -0
- package/src/http/obfuscationKey.ts +41 -0
- package/src/i18n.ts +60 -0
- package/src/index.js +1 -0
- package/src/index.less +169 -0
- package/src/locales/en/auth.ts +70 -0
- package/src/locales/en/base/memory.ts +28 -0
- package/src/locales/en/base/settings.ts +41 -0
- package/src/locales/en/chat.ts +40 -0
- package/src/locales/en/common.ts +173 -0
- package/src/locales/en/enum.ts +27 -0
- package/src/locales/en/menus/business-rules.ts +48 -0
- package/src/locales/en/menus/feedback.ts +62 -0
- package/src/locales/en/menus/knowledge.ts +120 -0
- package/src/locales/en/menus/model-metadata/index.ts +10 -0
- package/src/locales/en/menus/model-metadata/manage.ts +151 -0
- package/src/locales/en/menus/model-metadata/role.ts +48 -0
- package/src/locales/en/menus/model-metadata/training.ts +65 -0
- package/src/locales/en/menus/skill.ts +34 -0
- package/src/locales/en/system/agent-config.ts +34 -0
- package/src/locales/en/system/department.ts +68 -0
- package/src/locales/en/system/dict.ts +44 -0
- package/src/locales/en/system/menu.ts +45 -0
- package/src/locales/en/system/permission.ts +89 -0
- package/src/locales/en/system/role.ts +25 -0
- package/src/locales/en/system/sys-config.ts +33 -0
- package/src/locales/en/system/sys-log.ts +38 -0
- package/src/locales/en/system/user.ts +113 -0
- package/src/locales/en.ts +68 -0
- package/src/locales/zh/auth.ts +70 -0
- package/src/locales/zh/base/memory.ts +29 -0
- package/src/locales/zh/base/settings.ts +41 -0
- package/src/locales/zh/chat.ts +47 -0
- package/src/locales/zh/common.ts +178 -0
- package/src/locales/zh/enum.ts +28 -0
- package/src/locales/zh/menus/business-rules.ts +47 -0
- package/src/locales/zh/menus/feedback.ts +62 -0
- package/src/locales/zh/menus/knowledge.ts +117 -0
- package/src/locales/zh/menus/model-metadata/index.ts +10 -0
- package/src/locales/zh/menus/model-metadata/manage.ts +151 -0
- package/src/locales/zh/menus/model-metadata/role.ts +47 -0
- package/src/locales/zh/menus/model-metadata/training.ts +64 -0
- package/src/locales/zh/menus/skill.ts +34 -0
- package/src/locales/zh/system/agent-config.ts +33 -0
- package/src/locales/zh/system/department.ts +69 -0
- package/src/locales/zh/system/dict.ts +44 -0
- package/src/locales/zh/system/menu.ts +47 -0
- package/src/locales/zh/system/permission.ts +94 -0
- package/src/locales/zh/system/role.ts +25 -0
- package/src/locales/zh/system/sys-config.ts +32 -0
- package/src/locales/zh/system/sys-log.ts +38 -0
- package/src/locales/zh/system/user.ts +114 -0
- package/src/locales/zh.ts +67 -0
- package/src/main.tsx +50 -0
- package/src/meta/const/index.ts +40 -0
- package/src/meta/index-dict.ts +56 -0
- package/src/meta/index-enum.ts +95 -0
- package/src/meta/index.ts +14 -0
- package/src/meta/module/dict-data/runtime.ts +199 -0
- package/src/meta/module/dict-data/types.ts +17 -0
- package/src/meta/module/enum-data/runtime.ts +75 -0
- package/src/meta/module/enum-data/types.ts +18 -0
- package/src/router/index.tsx +312 -0
- package/src/styles/AntdThemeProvider.tsx +40 -0
- package/src/styles/antd-theme.ts +20 -0
- package/src/styles/global.less +107 -0
- package/src/styles/variable.less +103 -0
- package/src/types/feedback.ts +43 -0
- package/src/types/index.ts +85 -0
- package/src/types/menu.ts +43 -0
- package/src/utils/aesUtil.ts +123 -0
- package/src/utils/chatUtils.ts +524 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/crypto.ts +164 -0
- package/src/utils/date.ts +72 -0
- package/src/utils/file-icons.tsx +79 -0
- package/src/utils/index.ts +168 -0
- package/src/utils/markdown-math-plugins.ts +21 -0
- package/src/utils/menuI18n.ts +305 -0
- package/src/utils/menuRouteRegistry.ts +78 -0
- package/src/utils/permission-crud.ts +147 -0
- package/src/utils/routeConfig.ts +350 -0
- package/src/utils/storage.ts +135 -0
- package/src/utils/toastBridge.ts +26 -0
- package/src/utils/url.ts +38 -0
- package/src/utils/validation.ts +16 -0
- package/src/views/auth/auth-code/index.less +169 -0
- package/src/views/auth/auth-code/index.module.less +174 -0
- package/src/views/auth/auth-code/index.tsx +233 -0
- package/src/views/auth/login.tsx +498 -0
- package/src/views/auth/register.tsx +388 -0
- package/src/views/base/memory/index.tsx +136 -0
- package/src/views/base/memory/modal/detail-modal.tsx +89 -0
- package/src/views/base/memory/modal/submit-modal.tsx +134 -0
- package/src/views/base/settings/index.tsx +657 -0
- package/src/views/chat/chat.less +323 -0
- package/src/views/chat/components/chat-input.tsx +298 -0
- package/src/views/chat/components/header-thread-title.tsx +210 -0
- package/src/views/chat/components/message-list/content-answer.tsx +100 -0
- package/src/views/chat/components/message-list/content-question.tsx +18 -0
- package/src/views/chat/components/message-list/index.tsx +520 -0
- package/src/views/chat/components/message-list/message-item.tsx +199 -0
- package/src/views/chat/components/message-list/preparation-demo-items.ts +147 -0
- package/src/views/chat/components/message-list/preparation-steps.tsx +506 -0
- package/src/views/chat/components/message-list/suggestion-list.tsx +36 -0
- package/src/views/chat/components/message-list/thinking-process.tsx +49 -0
- package/src/views/chat/components/message-list/toolbar.tsx +224 -0
- package/src/views/chat/components/message-list/use-message-list-scroll.ts +214 -0
- package/src/views/chat/components/references-knowledge/context.tsx +57 -0
- package/src/views/chat/components/references-knowledge/index.ts +9 -0
- package/src/views/chat/components/references-knowledge/modal/knowledge-detail-drawer.tsx +556 -0
- package/src/views/chat/components/references-knowledge/modal/knowledge-doc-detail-drawer.tsx +529 -0
- package/src/views/chat/components/references-knowledge/panel.tsx +115 -0
- package/src/views/chat/hooks/use-chat-common.ts +19 -0
- package/src/views/chat/index-session.tsx +647 -0
- package/src/views/chat/index.tsx +127 -0
- package/src/views/page-error/401.tsx +56 -0
- package/src/views/page-error/404.tsx +56 -0
- package/src/views/page-menus/business-rules/index.tsx +376 -0
- package/src/views/page-menus/business-rules/modal/detail-modal.tsx +186 -0
- package/src/views/page-menus/business-rules/modal/scope-modal.tsx +272 -0
- package/src/views/page-menus/business-rules/modal/submit-modal.tsx +142 -0
- package/src/views/page-menus/feedback/components/feedback-dataset-list.tsx +471 -0
- package/src/views/page-menus/feedback/index.tsx +166 -0
- package/src/views/page-menus/feedback/modal/export-feedback-modal.tsx +367 -0
- package/src/views/page-menus/knowledge/components/doc-editor-by-type.tsx +32 -0
- package/src/views/page-menus/knowledge/components/doc-editor-type-file.tsx +330 -0
- package/src/views/page-menus/knowledge/detail.tsx +600 -0
- package/src/views/page-menus/knowledge/index.tsx +337 -0
- package/src/views/page-menus/knowledge/modal/detail-modal.tsx +618 -0
- package/src/views/page-menus/knowledge/modal/doc-detail-modal.tsx +550 -0
- package/src/views/page-menus/knowledge/modal/doc-parse.ts +99 -0
- package/src/views/page-menus/knowledge/modal/doc-submit-modal.tsx +349 -0
- package/src/views/page-menus/knowledge/modal/doc-type-picker-modal.tsx +88 -0
- package/src/views/page-menus/knowledge/modal/knowledge-user-select-modal.tsx +283 -0
- package/src/views/page-menus/knowledge/modal/submit-modal.tsx +179 -0
- package/src/views/page-menus/model-metadata/manage/components/metadata-detail-schema-tab.tsx +114 -0
- package/src/views/page-menus/model-metadata/manage/components/step1-basic-info.tsx +232 -0
- package/src/views/page-menus/model-metadata/manage/components/step2-schema.tsx +316 -0
- package/src/views/page-menus/model-metadata/manage/components/step3-permissions.tsx +134 -0
- package/src/views/page-menus/model-metadata/manage/components/step4-documents.tsx +134 -0
- package/src/views/page-menus/model-metadata/manage/components/step5-example-sql.tsx +101 -0
- package/src/views/page-menus/model-metadata/manage/components/submit-add.tsx +338 -0
- package/src/views/page-menus/model-metadata/manage/components/submit-edit.tsx +276 -0
- package/src/views/page-menus/model-metadata/manage/detail.tsx +298 -0
- package/src/views/page-menus/model-metadata/manage/hooks/model-metadata-submit-shared.ts +113 -0
- package/src/views/page-menus/model-metadata/manage/hooks/use-model-metadata-item-state.ts +20 -0
- package/src/views/page-menus/model-metadata/manage/index.tsx +304 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/table-schema.ts +374 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-detail-tabs.tsx +151 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-submit-tabs.tsx +423 -0
- package/src/views/page-menus/model-metadata/manage/modal/detail-modal.tsx +218 -0
- package/src/views/page-menus/model-metadata/manage/modal/submit-modal.tsx +261 -0
- package/src/views/page-menus/model-metadata/manage/modal/table-detail-modal.tsx +196 -0
- package/src/views/page-menus/model-metadata/manage/modal/table-submit-modal.tsx +229 -0
- package/src/views/page-menus/model-metadata/manage/submit.tsx +31 -0
- package/src/views/page-menus/model-metadata/role/index.tsx +207 -0
- package/src/views/page-menus/model-metadata/role/modal/detail-modal.tsx +97 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-modal.tsx +254 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-panel.tsx +393 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-utils.ts +120 -0
- package/src/views/page-menus/model-metadata/role/modal/role-permission-assign-panel.tsx +698 -0
- package/src/views/page-menus/model-metadata/role/modal/role-permission-modal.tsx +237 -0
- package/src/views/page-menus/model-metadata/role/modal/submit-modal.tsx +135 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/index.ts +4 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/node-card.tsx +72 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-lines.ts +196 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-list.tsx +153 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/timeline.tsx +103 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/types.ts +82 -0
- package/src/views/page-menus/model-metadata/training/detail.tsx +159 -0
- package/src/views/page-menus/model-metadata/training/index.tsx +236 -0
- package/src/views/page-menus/model-metadata/training/modal/update-detail-modal.tsx +154 -0
- package/src/views/page-menus/skill/index.tsx +201 -0
- package/src/views/page-menus/skill/modal/detail-modal.tsx +156 -0
- package/src/views/page-menus/skill/modal/submit-modal.tsx +214 -0
- package/src/views/page-system/agent-config/index.tsx +370 -0
- package/src/views/page-system/department/departmentFormShared.ts +36 -0
- package/src/views/page-system/department/index.tsx +541 -0
- package/src/views/page-system/department/modal/detail-modal.tsx +94 -0
- package/src/views/page-system/department/modal/member-role-modal.tsx +128 -0
- package/src/views/page-system/department/modal/submit-modal.tsx +265 -0
- package/src/views/page-system/dict/index.tsx +440 -0
- package/src/views/page-system/dict/modal/cate-submit-modal.tsx +315 -0
- package/src/views/page-system/dict/modal/submit-modal.tsx +184 -0
- package/src/views/page-system/logs/components/index.ts +3 -0
- package/src/views/page-system/logs/components/log-message-demo.tsx +30 -0
- package/src/views/page-system/logs/components/log-message-stream.ts +184 -0
- package/src/views/page-system/logs/components/message-list/content-answer.tsx +100 -0
- package/src/views/page-system/logs/components/message-list/content-question.tsx +18 -0
- package/src/views/page-system/logs/components/message-list/index.tsx +515 -0
- package/src/views/page-system/logs/components/message-list/message-item.tsx +193 -0
- package/src/views/page-system/logs/components/message-list/preparation-demo-items.ts +147 -0
- package/src/views/page-system/logs/components/message-list/preparation-steps.tsx +506 -0
- package/src/views/page-system/logs/components/message-list/suggestion-list.tsx +36 -0
- package/src/views/page-system/logs/components/message-list/thinking-process.tsx +49 -0
- package/src/views/page-system/logs/components/message-list/toolbar.tsx +134 -0
- package/src/views/page-system/logs/components/message-list/use-message-list-scroll.ts +214 -0
- package/src/views/page-system/logs/components/message-modal.tsx +239 -0
- package/src/views/page-system/logs/index.tsx +132 -0
- package/src/views/page-system/logs/modal/detail-modal.tsx +157 -0
- package/src/views/page-system/menu/components/menuFormShared.ts +283 -0
- package/src/views/page-system/menu/index.less +12 -0
- package/src/views/page-system/menu/index.tsx +410 -0
- package/src/views/page-system/menu/modal/icon-modal.less +51 -0
- package/src/views/page-system/menu/modal/icon-modal.tsx +87 -0
- package/src/views/page-system/menu/modal/submit-modal.tsx +263 -0
- package/src/views/page-system/permission/index.tsx +562 -0
- package/src/views/page-system/permission/modal/detail-modal.tsx +179 -0
- package/src/views/page-system/permission/modal/submit-modal.less +146 -0
- package/src/views/page-system/permission/modal/submit-modal.tsx +650 -0
- package/src/views/page-system/role/index.tsx +163 -0
- package/src/views/page-system/role/modal/detail-modal.tsx +127 -0
- package/src/views/page-system/role/modal/permission-assign-group-rules.ts +86 -0
- package/src/views/page-system/role/modal/permission-modal.tsx +111 -0
- package/src/views/page-system/role/modal/role-modal-shell-styles.ts +21 -0
- package/src/views/page-system/role/modal/role-permission-assign-panel.tsx +916 -0
- package/src/views/page-system/role/modal/role-permission-assign-shared.ts +1047 -0
- package/src/views/page-system/role/modal/submit-modal.tsx +193 -0
- package/src/views/page-system/sys-config/index.tsx +294 -0
- package/src/views/page-system/user/components/user-role-column.tsx +87 -0
- package/src/views/page-system/user/index.tsx +439 -0
- package/src/views/page-system/user/modal/assign-roles-modal.tsx +389 -0
- package/src/views/page-system/user/modal/detail-modal.tsx +72 -0
- package/src/views/page-system/user/modal/modal-style/submit-modal.less +40 -0
- package/src/views/page-system/user/modal/submit-modal.less +40 -0
- package/src/views/page-system/user/modal/submit-modal.tsx +287 -0
- package/src/views/page-system/user/userFormShared.ts +51 -0
- package/tailwind.config.js +17 -0
- package/tsconfig.app.json +48 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +264 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Tooltip, type TooltipProps } from 'antd'
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import type { CSSProperties, ReactNode } from 'react'
|
|
4
|
+
|
|
5
|
+
type LooseTooltipStyles = Record<string, CSSProperties | undefined>
|
|
6
|
+
type LooseTooltipClassNames = Record<string, string | undefined>
|
|
7
|
+
|
|
8
|
+
export type CxTooltipTone = 'default' | 'primary' | 'success' | 'warning' | 'danger'
|
|
9
|
+
|
|
10
|
+
const TONE_BG: Record<CxTooltipTone, string> = {
|
|
11
|
+
default: '#1f1f1f',
|
|
12
|
+
primary: '#2563eb',
|
|
13
|
+
success: '#15803d',
|
|
14
|
+
warning: '#b45309',
|
|
15
|
+
danger: '#dc2626',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type CxTooltipProps = Omit<
|
|
19
|
+
TooltipProps,
|
|
20
|
+
'color' | 'overlayInnerStyle' | 'overlayClassName' | 'title'
|
|
21
|
+
> & {
|
|
22
|
+
title: ReactNode
|
|
23
|
+
/** Tooltip 背景语义色,便于与操作类型区分 */
|
|
24
|
+
tone?: CxTooltipTone
|
|
25
|
+
overlayInnerStyle?: CSSProperties
|
|
26
|
+
overlayClassName?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 基于 antd Tooltip 的封装,统一字号与类名前缀,后续可在 `cx-tooltip` 上覆写样式。
|
|
31
|
+
*/
|
|
32
|
+
export function CxTooltip({
|
|
33
|
+
title,
|
|
34
|
+
tone = 'default',
|
|
35
|
+
overlayInnerStyle,
|
|
36
|
+
overlayClassName,
|
|
37
|
+
mouseEnterDelay = 0.35,
|
|
38
|
+
children,
|
|
39
|
+
classNames: userClassNames,
|
|
40
|
+
styles: userStyles,
|
|
41
|
+
...rest
|
|
42
|
+
}: CxTooltipProps) {
|
|
43
|
+
const ucn = userClassNames as LooseTooltipClassNames | undefined
|
|
44
|
+
const ust = userStyles as LooseTooltipStyles | undefined
|
|
45
|
+
return (
|
|
46
|
+
<Tooltip
|
|
47
|
+
title={title}
|
|
48
|
+
color={TONE_BG[tone]}
|
|
49
|
+
mouseEnterDelay={mouseEnterDelay}
|
|
50
|
+
classNames={{
|
|
51
|
+
...ucn,
|
|
52
|
+
root: clsx('cx-tooltip', overlayClassName, ucn?.root),
|
|
53
|
+
}}
|
|
54
|
+
styles={{
|
|
55
|
+
...ust,
|
|
56
|
+
container: {
|
|
57
|
+
fontSize: 12,
|
|
58
|
+
lineHeight: 1.4,
|
|
59
|
+
...(overlayInnerStyle ?? {}),
|
|
60
|
+
...ust?.container,
|
|
61
|
+
},
|
|
62
|
+
}}
|
|
63
|
+
{...rest}>
|
|
64
|
+
{children}
|
|
65
|
+
</Tooltip>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { MenuTreeItem } from '@/types/menu'
|
|
2
|
+
import { getMenuNodeIcon } from '@/utils'
|
|
3
|
+
import { getMenuDisplayName } from '@/utils/menuI18n'
|
|
4
|
+
import { ChevronDown, ChevronRight } from 'lucide-react'
|
|
5
|
+
import React, { useMemo } from 'react'
|
|
6
|
+
import { useTranslation } from 'react-i18next'
|
|
7
|
+
import { CxCheckbox } from '../checkbox'
|
|
8
|
+
|
|
9
|
+
export type CxTreeFieldNames = {
|
|
10
|
+
id?: string
|
|
11
|
+
children?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type CxTreeSameNodeReselect = 'keep' | 'deselect'
|
|
15
|
+
|
|
16
|
+
export type CxTreeProps = {
|
|
17
|
+
treeData: any[]
|
|
18
|
+
fieldNames?: CxTreeFieldNames
|
|
19
|
+
/** 与现有 tree-sidebar 一致:受控展开 */
|
|
20
|
+
expandedKeys: Set<string | number> | ReadonlyArray<string | number>
|
|
21
|
+
selectedKey?: string | number | null
|
|
22
|
+
onSelect?: (key: string | number | null, node: any | null) => void
|
|
23
|
+
onToggleExpand?: (key: string | number, e?: React.MouseEvent) => void
|
|
24
|
+
/** 为 true 时在行首渲染勾选框;仅操作勾选框会触发 onCheck,与选中行分离 */
|
|
25
|
+
checkable?: boolean
|
|
26
|
+
checkedKeys?: Set<string | number> | ReadonlyArray<string | number>
|
|
27
|
+
onCheck?: (key: string | number, checked: boolean, node: any) => void
|
|
28
|
+
/** 覆盖默认菜单标题(默认走 getMenuDisplayName) */
|
|
29
|
+
renderLabel?: (node: any) => React.ReactNode
|
|
30
|
+
className?: string
|
|
31
|
+
emptyText?: React.ReactNode
|
|
32
|
+
/**
|
|
33
|
+
* `keep`(默认):已选中节点再次点击仍回调选中;
|
|
34
|
+
* `deselect`:再次点击当前选中节点回调 `(null, null)` 用于取消选中
|
|
35
|
+
*/
|
|
36
|
+
sameNodeReselect?: CxTreeSameNodeReselect
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function toSet(
|
|
40
|
+
keys: Set<string | number> | ReadonlyArray<string | number> | undefined,
|
|
41
|
+
): Set<string | number> {
|
|
42
|
+
if (!keys) return new Set()
|
|
43
|
+
return keys instanceof Set ? keys : new Set(keys)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 纯展示树:缩进、间距、展开图标、文件夹图标与 `tree-sidebar` 菜单样式对齐。
|
|
48
|
+
*/
|
|
49
|
+
export function CxTree({
|
|
50
|
+
treeData,
|
|
51
|
+
fieldNames,
|
|
52
|
+
expandedKeys,
|
|
53
|
+
selectedKey,
|
|
54
|
+
onSelect,
|
|
55
|
+
onToggleExpand,
|
|
56
|
+
checkable = false,
|
|
57
|
+
checkedKeys,
|
|
58
|
+
onCheck,
|
|
59
|
+
renderLabel,
|
|
60
|
+
className,
|
|
61
|
+
emptyText,
|
|
62
|
+
sameNodeReselect = 'keep',
|
|
63
|
+
}: CxTreeProps) {
|
|
64
|
+
const { t, i18n } = useTranslation()
|
|
65
|
+
const idKey = fieldNames?.id ?? 'id'
|
|
66
|
+
const childrenKey = fieldNames?.children ?? 'children'
|
|
67
|
+
|
|
68
|
+
const expandSet = useMemo(() => toSet(expandedKeys), [expandedKeys])
|
|
69
|
+
const checkSet = useMemo(() => toSet(checkedKeys), [checkedKeys])
|
|
70
|
+
|
|
71
|
+
const formatNodeLabel = (node: any): React.ReactNode => {
|
|
72
|
+
if (renderLabel) return renderLabel(node)
|
|
73
|
+
return getMenuDisplayName(node as MenuTreeItem, t, i18n.language)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const renderTreeNode = (node: any, level = 0): React.JSX.Element => {
|
|
77
|
+
const children = node[childrenKey] as any[] | undefined
|
|
78
|
+
const hasChildren = !!children?.length
|
|
79
|
+
const key = node[idKey]
|
|
80
|
+
const isExpanded = expandSet.has(key)
|
|
81
|
+
const isSelected =
|
|
82
|
+
selectedKey != null &&
|
|
83
|
+
key != null &&
|
|
84
|
+
String(selectedKey) === String(key)
|
|
85
|
+
const isChecked = checkSet.has(key)
|
|
86
|
+
const nodeSelectable = node.selectable !== false
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div key={String(key)}>
|
|
90
|
+
<div
|
|
91
|
+
className={`
|
|
92
|
+
group flex items-center px-2 py-1.5 rounded-md text-sm transition-colors
|
|
93
|
+
${
|
|
94
|
+
isSelected
|
|
95
|
+
? 'bg-blue-50 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 font-medium'
|
|
96
|
+
: nodeSelectable
|
|
97
|
+
? 'hover:bg-gray-100 dark:hover:bg-gray-700/50 text-gray-700 dark:text-gray-300'
|
|
98
|
+
: 'text-gray-500 dark:text-gray-400'
|
|
99
|
+
}
|
|
100
|
+
`}
|
|
101
|
+
style={{ paddingLeft: `${level * 16 + 8}px` }}>
|
|
102
|
+
<button
|
|
103
|
+
type="button"
|
|
104
|
+
className={`mr-1 shrink-0 p-0.5 rounded-sm hover:bg-gray-200 dark:hover:bg-gray-700 ${
|
|
105
|
+
hasChildren ? 'visible' : 'invisible'
|
|
106
|
+
}`}
|
|
107
|
+
onClick={(e) => hasChildren && onToggleExpand?.(key, e)}>
|
|
108
|
+
{isExpanded ? (
|
|
109
|
+
<ChevronDown size={14} />
|
|
110
|
+
) : (
|
|
111
|
+
<ChevronRight size={14} />
|
|
112
|
+
)}
|
|
113
|
+
</button>
|
|
114
|
+
|
|
115
|
+
<div
|
|
116
|
+
role={nodeSelectable ? 'button' : undefined}
|
|
117
|
+
tabIndex={nodeSelectable ? 0 : undefined}
|
|
118
|
+
className={`flex min-w-0 flex-1 items-center ${
|
|
119
|
+
nodeSelectable
|
|
120
|
+
? 'cursor-pointer'
|
|
121
|
+
: 'cursor-default pointer-events-none select-none'
|
|
122
|
+
}`}
|
|
123
|
+
onClick={() => {
|
|
124
|
+
if (!nodeSelectable) return
|
|
125
|
+
if (
|
|
126
|
+
sameNodeReselect === 'deselect' &&
|
|
127
|
+
selectedKey != null &&
|
|
128
|
+
String(selectedKey) === String(key)
|
|
129
|
+
) {
|
|
130
|
+
onSelect?.(null, null)
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
onSelect?.(key, node)
|
|
134
|
+
}}
|
|
135
|
+
onKeyDown={(e) => {
|
|
136
|
+
if (!nodeSelectable) return
|
|
137
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
138
|
+
e.preventDefault()
|
|
139
|
+
if (
|
|
140
|
+
sameNodeReselect === 'deselect' &&
|
|
141
|
+
selectedKey != null &&
|
|
142
|
+
String(selectedKey) === String(key)
|
|
143
|
+
) {
|
|
144
|
+
onSelect?.(null, null)
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
onSelect?.(key, node)
|
|
148
|
+
}
|
|
149
|
+
}}>
|
|
150
|
+
<div className="mr-2 shrink-0 text-gray-400 dark:text-gray-500">
|
|
151
|
+
{getMenuNodeIcon(node as MenuTreeItem, isExpanded, isSelected)}
|
|
152
|
+
</div>
|
|
153
|
+
{checkable && (
|
|
154
|
+
<span
|
|
155
|
+
className="mr-1.5 flex shrink-0 items-center"
|
|
156
|
+
onClick={(e) => e.stopPropagation()}
|
|
157
|
+
onMouseDown={(e) => e.stopPropagation()}>
|
|
158
|
+
<CxCheckbox
|
|
159
|
+
checked={isChecked}
|
|
160
|
+
size="md"
|
|
161
|
+
onChange={(next) => onCheck?.(key, next, node)}
|
|
162
|
+
/>
|
|
163
|
+
</span>
|
|
164
|
+
)}
|
|
165
|
+
<span className="truncate">{formatNodeLabel(node)}</span>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
{hasChildren && isExpanded && (
|
|
170
|
+
<div className="ml-4 border-l border-gray-200 dark:border-gray-700">
|
|
171
|
+
{children!.map((child) => renderTreeNode(child, level + 1))}
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!treeData?.length) {
|
|
179
|
+
return (
|
|
180
|
+
<div className="p-4 text-center text-sm text-gray-400 dark:text-gray-500">
|
|
181
|
+
{emptyText ?? t('common.no_data')}
|
|
182
|
+
</div>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<div className={className}>
|
|
188
|
+
{treeData.map((n) => renderTreeNode(n))}
|
|
189
|
+
</div>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export default CxTree
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TreeSelect } from 'antd';
|
|
3
|
+
import { CxEmptyState } from '../empty-state';
|
|
4
|
+
import './index.less';
|
|
5
|
+
|
|
6
|
+
/** 有子节点的树节点 key,用于「全部展开」 */
|
|
7
|
+
function collectExpandableKeys(treeData) {
|
|
8
|
+
const keys = [];
|
|
9
|
+
const walk = (nodes) => {
|
|
10
|
+
if (!Array.isArray(nodes)) return;
|
|
11
|
+
for (const node of nodes) {
|
|
12
|
+
const children = node.children;
|
|
13
|
+
if (Array.isArray(children) && children.length > 0) {
|
|
14
|
+
const k = node.key != null ? node.key : node.value;
|
|
15
|
+
if (k != null) keys.push(k);
|
|
16
|
+
walk(children);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
walk(treeData);
|
|
21
|
+
return keys;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {import('antd').TreeSelectProps & { variant?: 'cxForm' | 'cxSearch' }} props
|
|
26
|
+
* - variant: cxForm 表单下拉(42px,默认)| cxSearch 搜索下拉(40px)
|
|
27
|
+
* - treeDefaultExpandAll:树数据异步更新时 rc 仅初次挂载生效,此处随 treeData 同步展开
|
|
28
|
+
*/
|
|
29
|
+
const CxTreeSelect = ({
|
|
30
|
+
variant = 'cxForm',
|
|
31
|
+
style = undefined,
|
|
32
|
+
treeData,
|
|
33
|
+
treeDefaultExpandAll,
|
|
34
|
+
treeExpandedKeys,
|
|
35
|
+
onTreeExpand,
|
|
36
|
+
notFoundContent,
|
|
37
|
+
...props
|
|
38
|
+
}) => {
|
|
39
|
+
const height = variant === 'cxSearch' ? 40 : 42;
|
|
40
|
+
|
|
41
|
+
const expandableKeys = React.useMemo(
|
|
42
|
+
() => collectExpandableKeys(treeData),
|
|
43
|
+
[treeData],
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const isExpandedControlled = treeExpandedKeys !== undefined;
|
|
47
|
+
const useInternalExpandAll = Boolean(treeDefaultExpandAll) && !isExpandedControlled;
|
|
48
|
+
|
|
49
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = React.useState([]);
|
|
50
|
+
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
if (!useInternalExpandAll) return;
|
|
53
|
+
setInternalExpandedKeys(expandableKeys);
|
|
54
|
+
}, [useInternalExpandAll, expandableKeys]);
|
|
55
|
+
|
|
56
|
+
const treeNotFoundContent =
|
|
57
|
+
notFoundContent === undefined
|
|
58
|
+
? <CxEmptyState message="暂无数据" />
|
|
59
|
+
: notFoundContent;
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<TreeSelect
|
|
63
|
+
{...props}
|
|
64
|
+
treeData={treeData}
|
|
65
|
+
treeDefaultExpandAll={useInternalExpandAll ? false : treeDefaultExpandAll}
|
|
66
|
+
treeExpandedKeys={
|
|
67
|
+
useInternalExpandAll ? internalExpandedKeys : treeExpandedKeys
|
|
68
|
+
}
|
|
69
|
+
onTreeExpand={
|
|
70
|
+
useInternalExpandAll
|
|
71
|
+
? (keys) => {
|
|
72
|
+
setInternalExpandedKeys(keys);
|
|
73
|
+
onTreeExpand?.(keys);
|
|
74
|
+
}
|
|
75
|
+
: onTreeExpand
|
|
76
|
+
}
|
|
77
|
+
size='large'
|
|
78
|
+
notFoundContent={treeNotFoundContent}
|
|
79
|
+
className='cx-tree-select'
|
|
80
|
+
classNames={{ popup: 'cx-tree-select-dropdown' }}
|
|
81
|
+
style={{
|
|
82
|
+
height,
|
|
83
|
+
boxSizing: 'border-box',
|
|
84
|
+
borderRadius: 8,
|
|
85
|
+
...(style || {}),
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default CxTreeSelect;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.cx-tree-select-dropdown {
|
|
2
|
+
.ant-select-tree-treenode {
|
|
3
|
+
min-height: 36px;
|
|
4
|
+
border-radius: 6px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ant-select-tree-node-content-wrapper {
|
|
8
|
+
min-height: 36px !important;
|
|
9
|
+
line-height: 34px !important;
|
|
10
|
+
border-radius: 6px;
|
|
11
|
+
font-size: 14px !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ant-select-tree-node-content-wrapper:hover {
|
|
15
|
+
background-color: var(--cx-option-hover-bg) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ant-select-tree-node-selected {
|
|
19
|
+
background-color: var(--cx-option-selected-bg) !important;
|
|
20
|
+
color: var(--cx-option-selected-text) !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ant-select-tree-node-selected:hover {
|
|
24
|
+
background-color: var(--cx-option-selected-bg) !important;
|
|
25
|
+
color: var(--cx-option-selected-text) !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
.cx-upload-file-root {
|
|
2
|
+
width: 100%;
|
|
3
|
+
|
|
4
|
+
.ant-upload-wrapper,
|
|
5
|
+
.ant-upload-list,
|
|
6
|
+
.ant-upload-list-item,
|
|
7
|
+
.ant-upload-list-item-container {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// 清掉 Upload 列表默认的上下间距,避免在 Table 单元格里出现“底部空白”
|
|
12
|
+
.ant-upload-list {
|
|
13
|
+
margin: 0 !important;
|
|
14
|
+
padding: 0 !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// antd 会在 list 非空时强行给 picture-card list 设置 min-height(dev 环境用 :where(.css-dev-only-...) 包裹)
|
|
18
|
+
// 这里统一按 thumbSize 覆盖,避免底部被撑出空白
|
|
19
|
+
.ant-upload-wrapper.ant-upload-picture-card-wrapper
|
|
20
|
+
.ant-upload-list.ant-upload-list-picture-card:not(:empty),
|
|
21
|
+
.ant-upload-wrapper.ant-upload-picture-circle-wrapper
|
|
22
|
+
.ant-upload-list.ant-upload-list-picture-card:not(:empty),
|
|
23
|
+
.ant-upload-wrapper.ant-upload-picture-card-wrapper
|
|
24
|
+
.ant-upload-list.ant-upload-list-picture-circle:not(:empty),
|
|
25
|
+
.ant-upload-wrapper.ant-upload-picture-circle-wrapper
|
|
26
|
+
.ant-upload-list.ant-upload-list-picture-circle:not(:empty) {
|
|
27
|
+
min-height: var(--cx-upload-thumb-size, 104px) !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 缩略图尺寸:上传位 + 已上传项容器统一
|
|
31
|
+
.ant-upload-list-picture-card {
|
|
32
|
+
// 容器本身不要默认 padding/margin
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
padding: 0 !important;
|
|
35
|
+
|
|
36
|
+
.ant-upload-list-item-container,
|
|
37
|
+
.ant-upload-select {
|
|
38
|
+
width: var(--cx-upload-thumb-size, 104px);
|
|
39
|
+
height: var(--cx-upload-thumb-size, 104px);
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// antd 默认会给每个 item/上传位加 margin,导致视觉尺寸不一致,这里统一清掉
|
|
44
|
+
.ant-upload-list-item-container {
|
|
45
|
+
margin: 0 !important;
|
|
46
|
+
padding: 0 !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ant-upload-select {
|
|
50
|
+
margin: 0 !important;
|
|
51
|
+
padding: 0 !important;
|
|
52
|
+
min-height: var(--cx-upload-thumb-size, 104px) !important;
|
|
53
|
+
height: var(--cx-upload-thumb-size, 104px) !important;
|
|
54
|
+
line-height: var(--cx-upload-thumb-size, 104px) !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ant-upload-select .ant-upload {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
margin: 0 !important;
|
|
61
|
+
padding: 0 !important;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
min-height: 0 !important;
|
|
64
|
+
line-height: var(--cx-upload-thumb-size, 104px) !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 已上传项本体也清掉默认边距,确保和上传位同盒模型
|
|
68
|
+
.ant-upload-list-item {
|
|
69
|
+
margin: 0 !important;
|
|
70
|
+
padding: 0 !important;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
box-shadow: none !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ant-upload-list-item:hover {
|
|
76
|
+
border-color: transparent !important;
|
|
77
|
+
box-shadow: none !important;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cx-upload-file-picture-list-wrap {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
gap: 10px;
|
|
86
|
+
width: 100%;
|
|
87
|
+
|
|
88
|
+
.ant-upload-wrapper {
|
|
89
|
+
width: var(--cx-upload-thumb-size, 104px);
|
|
90
|
+
height: var(--cx-upload-thumb-size, 104px);
|
|
91
|
+
flex: 0 0 var(--cx-upload-thumb-size, 104px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.is-empty {
|
|
95
|
+
.ant-upload-wrapper {
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: auto;
|
|
98
|
+
flex: 1 1 auto;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cx-upload-file-list {
|
|
103
|
+
flex: 1 1 auto;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 右侧文件名列表:纯文本,无边框
|
|
108
|
+
.cx-upload-file-list-item {
|
|
109
|
+
border: none;
|
|
110
|
+
background: transparent;
|
|
111
|
+
padding: 0;
|
|
112
|
+
height: var(--cx-upload-thumb-size, 104px);
|
|
113
|
+
align-items: center;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.cx-upload-file-card {
|
|
118
|
+
.cx-upload-file-card-mask {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transition: opacity 0.2s;
|
|
121
|
+
z-index: 3;
|
|
122
|
+
background: rgba(0, 0, 0, 0.6);
|
|
123
|
+
|
|
124
|
+
.ant-btn {
|
|
125
|
+
color: #fff;
|
|
126
|
+
background: transparent;
|
|
127
|
+
border: none !important;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
box-shadow: none;
|
|
130
|
+
padding: 6px;
|
|
131
|
+
line-height: 1;
|
|
132
|
+
outline: none !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ant-btn:hover {
|
|
136
|
+
color: #fff;
|
|
137
|
+
background: transparent;
|
|
138
|
+
opacity: 1;
|
|
139
|
+
text-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
outline: none !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ant-btn:active {
|
|
145
|
+
color: #fff;
|
|
146
|
+
background: transparent;
|
|
147
|
+
box-shadow: none;
|
|
148
|
+
border-color: transparent;
|
|
149
|
+
outline: none !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ant-btn:focus,
|
|
153
|
+
.ant-btn:focus-visible {
|
|
154
|
+
outline: none;
|
|
155
|
+
box-shadow: none;
|
|
156
|
+
border-color: transparent;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// 去掉 antd 的 hover/click 状态层(避免出现“一闪的边框/波纹”)
|
|
160
|
+
.ant-btn::before,
|
|
161
|
+
.ant-btn::after {
|
|
162
|
+
display: none !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 图标更明显:放大 + 投影描边
|
|
166
|
+
.anticon {
|
|
167
|
+
font-size: 18px;
|
|
168
|
+
filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.55));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
.cx-upload-file-card-mask {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.cx-upload-file-list {
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: column;
|
|
182
|
+
gap: 6px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cx-upload-file-list-item {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
gap: 8px;
|
|
189
|
+
padding: 6px 8px;
|
|
190
|
+
border: 1px solid rgba(5, 5, 5, 0.06);
|
|
191
|
+
border-radius: 6px;
|
|
192
|
+
background: #fff;
|
|
193
|
+
|
|
194
|
+
.cx-upload-file-list-actions {
|
|
195
|
+
opacity: 0;
|
|
196
|
+
transition: opacity 0.15s;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:hover {
|
|
200
|
+
.cx-upload-file-list-actions {
|
|
201
|
+
opacity: 1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cx-upload-file-list-name {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
flex: 1 1 auto;
|
|
210
|
+
min-width: 0;
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
text-overflow: ellipsis;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
height: 100%;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.cx-upload-file-list-actions {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: 2px;
|
|
221
|
+
flex: 0 0 auto;
|
|
222
|
+
}
|
|
223
|
+
|