cx-chat 0.0.2 → 0.0.3
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/cx-chat.css +1 -0
- package/dist/cx-chat.es.js +97326 -0
- package/dist/cx-chat.umd.js +734 -0
- package/package.json +21 -1
- package/.cursor/rules/i18n-cn-gloss-comments.mdc +0 -31
- package/.cursor/rules/list-page-view-pageconfig.mdc +0 -32
- package/.cursor/rules/no-over-defensive-programming.mdc +0 -90
- package/.cursor/rules/requirement-description-for-agent.mdc +0 -33
- package/.cursor/rules/use-showToast-not-antd-message.mdc +0 -28
- package/.docker/Dockerfile +0 -7
- package/.env +0 -9
- package/.env.development +0 -7
- package/.env.production +0 -7
- package/.gitlab-ci/docker-build.yaml +0 -28
- package/.gitlab-ci/k8s-deploy-dev-master.yaml +0 -42
- package/.gitlab-ci/npm-build.yaml +0 -17
- package/.gitlab-ci.yml +0 -8
- package/.k8s/0-namespace.yaml +0 -6
- package/.k8s/1-configmap-web.yaml +0 -7
- package/.k8s/1-nginx-conf-dev.yaml +0 -110
- package/.k8s/2-deployment.yaml +0 -27
- package/.k8s/3-service.yaml +0 -16
- package/.k8s/4-ingress-dev.yaml +0 -30
- package/.lingma/rules/use-showToast-not-antd-message.md +0 -34
- package/.nginx/nginx.conf +0 -52
- package/.prettierrc +0 -9
- package/eslint.config.js +0 -32
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -96
- package/src/_doc/0.docs-overview.md +0 -28
- package/src/_doc/cx-ui/0.docs-overview.md +0 -30
- package/src/_doc/cx-ui/comp.1.cx-ui-overview.md +0 -82
- package/src/_doc/cx-ui/comp.2.cx-modal.md +0 -82
- package/src/_doc/cx-ui/comp.3.cx-button.md +0 -89
- package/src/_doc/cx-ui/comp.4.cx-form.md +0 -72
- package/src/_doc/cx-ui/comp.5.cx-fields.md +0 -76
- package/src/_doc/cx-ui/comp.6.cx-tag.md +0 -57
- package/src/_doc/cx-ui/comp.7.cx-empty-state.md +0 -29
- package/src/_doc/meta/0.docs-overview.md +0 -24
- package/src/_doc/meta/comp.1.enum-runtime.md +0 -33
- package/src/_doc/meta/comp.2.dict-runtime.md +0 -39
- package/src/_doc/router/0.docs-overview.md +0 -14
- package/src/_doc/router/guide.1.menu-component-config.md +0 -181
- package/src/_doc/router/guide.2.router-auto-registration.md +0 -114
- package/src/_doc/table-view/0.docs-overview.md +0 -30
- package/src/_doc/table-view/comp.1.table-view.md +0 -542
- package/src/_doc/table-view/props.1.create-table-view-config.md +0 -193
- package/src/_doc/table-view/props.2.table-view-search-fields.md +0 -106
- package/src/api/_mock/README.md +0 -340
- package/src/api/_mock/api.ts +0 -1642
- package/src/api/_mock/bundle-shim.ts +0 -16
- package/src/api/_mock/handler-shim.ts +0 -6
- package/src/api/_mock/handler.ts +0 -458
- package/src/api/_mock/index.ts +0 -711
- package/src/api/_mock/interceptor.ts +0 -15
- package/src/api/_mock/mod.ts +0 -12
- package/src/api/_mock/utils.ts +0 -65
- package/src/api/base/memory.js +0 -24
- package/src/api/chat.js +0 -210
- package/src/api/common/auth.js +0 -70
- package/src/api/menus/business-rules.js +0 -76
- package/src/api/menus/feedback.js +0 -102
- package/src/api/menus/knowledge.js +0 -159
- package/src/api/menus/model-metadata/manage.js +0 -70
- package/src/api/menus/model-metadata/role.js +0 -50
- package/src/api/menus/model-metadata/training-detail-mock-data.js +0 -569
- package/src/api/menus/model-metadata/training.js +0 -28
- package/src/api/menus/skill.js +0 -40
- package/src/api/system/agent-config.js +0 -16
- package/src/api/system/department.js +0 -94
- package/src/api/system/dict.js +0 -86
- package/src/api/system/menu.js +0 -37
- package/src/api/system/permission.js +0 -26
- package/src/api/system/role.js +0 -34
- package/src/api/system/sys-config.js +0 -16
- package/src/api/system/sys-log.js +0 -17
- package/src/api/system/user.js +0 -75
- package/src/api/upload.js +0 -39
- package/src/assets/react.svg +0 -1
- package/src/components/auth/current-user-avatar.tsx +0 -77
- package/src/components/common/code-view.tsx +0 -149
- package/src/components/common/detail-link.tsx +0 -67
- package/src/components/common/error-boundary.tsx +0 -98
- package/src/components/common/language-switcher.tsx +0 -91
- package/src/components/common/lite-table/index.tsx +0 -135
- package/src/components/common/md-editor.tsx +0 -126
- package/src/components/common/modal/confirm-dialog.tsx +0 -113
- package/src/components/common/modal/dep-user-select-multi.tsx +0 -324
- package/src/components/common/modal/dep-user-select.tsx +0 -249
- package/src/components/common/modal/user-select-multi.tsx +0 -266
- package/src/components/common/pagination.tsx +0 -472
- package/src/components/common/path.tsx +0 -175
- package/src/components/common/system-logo-mark.tsx +0 -48
- package/src/components/cx-ui/button/index.less +0 -208
- package/src/components/cx-ui/button/index.tsx +0 -611
- package/src/components/cx-ui/checkbox/index.tsx +0 -78
- package/src/components/cx-ui/date-picker/index.less +0 -17
- package/src/components/cx-ui/date-picker/index.tsx +0 -193
- package/src/components/cx-ui/drawer/index.tsx +0 -47
- package/src/components/cx-ui/empty-state/index.tsx +0 -20
- package/src/components/cx-ui/floating-shell/CxFloatingShell.tsx +0 -89
- package/src/components/cx-ui/floating-shell/cx-floating-shell.less +0 -283
- package/src/components/cx-ui/floating-shell/has-floating-value.ts +0 -41
- package/src/components/cx-ui/form/CxForm.tsx +0 -15
- package/src/components/cx-ui/form/index.tsx +0 -20
- package/src/components/cx-ui/form-item/index.less +0 -26
- package/src/components/cx-ui/form-item/index.tsx +0 -36
- package/src/components/cx-ui/index.ts +0 -70
- package/src/components/cx-ui/input/auto-complete.tsx +0 -134
- package/src/components/cx-ui/input/index.tsx +0 -259
- package/src/components/cx-ui/input-number/index.jsx +0 -66
- package/src/components/cx-ui/modal/index.jsx +0 -212
- package/src/components/cx-ui/modal/index.less +0 -144
- package/src/components/cx-ui/modal/useCxModal.ts +0 -125
- package/src/components/cx-ui/multi-select/index.jsx +0 -74
- package/src/components/cx-ui/multi-select/index.less +0 -40
- package/src/components/cx-ui/multi-select/index2.tsx +0 -361
- package/src/components/cx-ui/radio/index.tsx +0 -33
- package/src/components/cx-ui/range-picker/index.less +0 -65
- package/src/components/cx-ui/range-picker/index.tsx +0 -219
- package/src/components/cx-ui/select/index.less +0 -34
- package/src/components/cx-ui/select/index.tsx +0 -196
- package/src/components/cx-ui/skeleton/index.tsx +0 -12
- package/src/components/cx-ui/steps/index.tsx +0 -14
- package/src/components/cx-ui/styles/_tokens.less +0 -79
- package/src/components/cx-ui/styles/index.less +0 -246
- package/src/components/cx-ui/switch/index.less +0 -106
- package/src/components/cx-ui/switch/index.tsx +0 -120
- package/src/components/cx-ui/table/index.less +0 -160
- package/src/components/cx-ui/table/index.tsx +0 -152
- package/src/components/cx-ui/tabs/index.less +0 -15
- package/src/components/cx-ui/tabs/index.tsx +0 -34
- package/src/components/cx-ui/tag/index.less +0 -51
- package/src/components/cx-ui/tag/index.tsx +0 -140
- package/src/components/cx-ui/timeline/index.tsx +0 -14
- package/src/components/cx-ui/tooltip/index.tsx +0 -67
- package/src/components/cx-ui/tree/index.tsx +0 -193
- package/src/components/cx-ui/tree-select/index.jsx +0 -91
- package/src/components/cx-ui/tree-select/index.less +0 -27
- package/src/components/cx-ui/upload-file/index.less +0 -223
- package/src/components/cx-ui/upload-file/index.tsx +0 -640
- package/src/components/cx-ui/upload-img/index.tsx +0 -291
- package/src/components/layout/components/Header.tsx +0 -216
- package/src/components/layout/components/Sidebar.tsx +0 -717
- package/src/components/layout/index.tsx +0 -95
- package/src/components/table-view/components/search-area.tsx +0 -411
- package/src/components/table-view/components/table-view-config.tsx +0 -528
- package/src/components/table-view/components/table-view.types.ts +0 -478
- package/src/components/table-view/components/tree-api-normalize.ts +0 -38
- package/src/components/table-view/components/tree-data-annotate.ts +0 -31
- package/src/components/table-view/components/tree-sidebar.tsx +0 -74
- package/src/components/table-view/index.tsx +0 -61
- package/src/components/table-view/list-page-view.tsx +0 -1049
- package/src/components/table-view/select-table-view.tsx +0 -1094
- package/src/components/table-view/styles/select-table-view.less +0 -51
- package/src/config/default-system-name.ts +0 -9
- package/src/config/system.ts +0 -165
- package/src/constants/countryCodes.ts +0 -3
- package/src/contexts/AuthContext.tsx +0 -256
- package/src/contexts/ChatContext.tsx +0 -839
- package/src/contexts/MenuContext.tsx +0 -62
- package/src/contexts/ToastContext.tsx +0 -181
- package/src/hooks/useCopyToClipboard.ts +0 -47
- package/src/hooks/useModalSubmit.ts +0 -104
- package/src/hooks/useRouter.ts +0 -240
- package/src/hooks/useStepForm.ts +0 -46
- package/src/hooks/useStickyHeader.ts +0 -42
- package/src/hooks/useThreadActions.ts +0 -105
- package/src/hooks/useUserPreferences.ts +0 -101
- package/src/http/axios.js +0 -372
- package/src/http/mock.interceptor.ts +0 -9
- package/src/http/obfuscationKey.ts +0 -41
- package/src/i18n.ts +0 -60
- package/src/index.js +0 -1
- package/src/index.less +0 -169
- package/src/locales/en/auth.ts +0 -70
- package/src/locales/en/base/memory.ts +0 -28
- package/src/locales/en/base/settings.ts +0 -41
- package/src/locales/en/chat.ts +0 -40
- package/src/locales/en/common.ts +0 -173
- package/src/locales/en/enum.ts +0 -27
- package/src/locales/en/menus/business-rules.ts +0 -48
- package/src/locales/en/menus/feedback.ts +0 -62
- package/src/locales/en/menus/knowledge.ts +0 -120
- package/src/locales/en/menus/model-metadata/index.ts +0 -10
- package/src/locales/en/menus/model-metadata/manage.ts +0 -151
- package/src/locales/en/menus/model-metadata/role.ts +0 -48
- package/src/locales/en/menus/model-metadata/training.ts +0 -65
- package/src/locales/en/menus/skill.ts +0 -34
- package/src/locales/en/system/agent-config.ts +0 -34
- package/src/locales/en/system/department.ts +0 -68
- package/src/locales/en/system/dict.ts +0 -44
- package/src/locales/en/system/menu.ts +0 -45
- package/src/locales/en/system/permission.ts +0 -89
- package/src/locales/en/system/role.ts +0 -25
- package/src/locales/en/system/sys-config.ts +0 -33
- package/src/locales/en/system/sys-log.ts +0 -38
- package/src/locales/en/system/user.ts +0 -113
- package/src/locales/en.ts +0 -68
- package/src/locales/zh/auth.ts +0 -70
- package/src/locales/zh/base/memory.ts +0 -29
- package/src/locales/zh/base/settings.ts +0 -41
- package/src/locales/zh/chat.ts +0 -47
- package/src/locales/zh/common.ts +0 -178
- package/src/locales/zh/enum.ts +0 -28
- package/src/locales/zh/menus/business-rules.ts +0 -47
- package/src/locales/zh/menus/feedback.ts +0 -62
- package/src/locales/zh/menus/knowledge.ts +0 -117
- package/src/locales/zh/menus/model-metadata/index.ts +0 -10
- package/src/locales/zh/menus/model-metadata/manage.ts +0 -151
- package/src/locales/zh/menus/model-metadata/role.ts +0 -47
- package/src/locales/zh/menus/model-metadata/training.ts +0 -64
- package/src/locales/zh/menus/skill.ts +0 -34
- package/src/locales/zh/system/agent-config.ts +0 -33
- package/src/locales/zh/system/department.ts +0 -69
- package/src/locales/zh/system/dict.ts +0 -44
- package/src/locales/zh/system/menu.ts +0 -47
- package/src/locales/zh/system/permission.ts +0 -94
- package/src/locales/zh/system/role.ts +0 -25
- package/src/locales/zh/system/sys-config.ts +0 -32
- package/src/locales/zh/system/sys-log.ts +0 -38
- package/src/locales/zh/system/user.ts +0 -114
- package/src/locales/zh.ts +0 -67
- package/src/main.tsx +0 -50
- package/src/meta/const/index.ts +0 -40
- package/src/meta/index-dict.ts +0 -56
- package/src/meta/index-enum.ts +0 -95
- package/src/meta/index.ts +0 -14
- package/src/meta/module/dict-data/runtime.ts +0 -199
- package/src/meta/module/dict-data/types.ts +0 -17
- package/src/meta/module/enum-data/runtime.ts +0 -75
- package/src/meta/module/enum-data/types.ts +0 -18
- package/src/router/index.tsx +0 -312
- package/src/styles/AntdThemeProvider.tsx +0 -40
- package/src/styles/antd-theme.ts +0 -20
- package/src/styles/global.less +0 -107
- package/src/styles/variable.less +0 -103
- package/src/types/feedback.ts +0 -43
- package/src/types/index.ts +0 -85
- package/src/types/menu.ts +0 -43
- package/src/utils/aesUtil.ts +0 -123
- package/src/utils/chatUtils.ts +0 -524
- package/src/utils/cn.ts +0 -6
- package/src/utils/crypto.ts +0 -164
- package/src/utils/date.ts +0 -72
- package/src/utils/file-icons.tsx +0 -79
- package/src/utils/index.ts +0 -168
- package/src/utils/markdown-math-plugins.ts +0 -21
- package/src/utils/menuI18n.ts +0 -305
- package/src/utils/menuRouteRegistry.ts +0 -78
- package/src/utils/permission-crud.ts +0 -147
- package/src/utils/routeConfig.ts +0 -350
- package/src/utils/storage.ts +0 -135
- package/src/utils/toastBridge.ts +0 -26
- package/src/utils/url.ts +0 -38
- package/src/utils/validation.ts +0 -16
- package/src/views/auth/auth-code/index.less +0 -169
- package/src/views/auth/auth-code/index.module.less +0 -174
- package/src/views/auth/auth-code/index.tsx +0 -233
- package/src/views/auth/login.tsx +0 -498
- package/src/views/auth/register.tsx +0 -388
- package/src/views/base/memory/index.tsx +0 -136
- package/src/views/base/memory/modal/detail-modal.tsx +0 -89
- package/src/views/base/memory/modal/submit-modal.tsx +0 -134
- package/src/views/base/settings/index.tsx +0 -657
- package/src/views/chat/chat.less +0 -323
- package/src/views/chat/components/chat-input.tsx +0 -298
- package/src/views/chat/components/header-thread-title.tsx +0 -210
- package/src/views/chat/components/message-list/content-answer.tsx +0 -100
- package/src/views/chat/components/message-list/content-question.tsx +0 -18
- package/src/views/chat/components/message-list/index.tsx +0 -520
- package/src/views/chat/components/message-list/message-item.tsx +0 -199
- package/src/views/chat/components/message-list/preparation-demo-items.ts +0 -147
- package/src/views/chat/components/message-list/preparation-steps.tsx +0 -506
- package/src/views/chat/components/message-list/suggestion-list.tsx +0 -36
- package/src/views/chat/components/message-list/thinking-process.tsx +0 -49
- package/src/views/chat/components/message-list/toolbar.tsx +0 -224
- package/src/views/chat/components/message-list/use-message-list-scroll.ts +0 -214
- package/src/views/chat/components/references-knowledge/context.tsx +0 -57
- package/src/views/chat/components/references-knowledge/index.ts +0 -9
- package/src/views/chat/components/references-knowledge/modal/knowledge-detail-drawer.tsx +0 -556
- package/src/views/chat/components/references-knowledge/modal/knowledge-doc-detail-drawer.tsx +0 -529
- package/src/views/chat/components/references-knowledge/panel.tsx +0 -115
- package/src/views/chat/hooks/use-chat-common.ts +0 -19
- package/src/views/chat/index-session.tsx +0 -647
- package/src/views/chat/index.tsx +0 -127
- package/src/views/page-error/401.tsx +0 -56
- package/src/views/page-error/404.tsx +0 -56
- package/src/views/page-menus/business-rules/index.tsx +0 -376
- package/src/views/page-menus/business-rules/modal/detail-modal.tsx +0 -186
- package/src/views/page-menus/business-rules/modal/scope-modal.tsx +0 -272
- package/src/views/page-menus/business-rules/modal/submit-modal.tsx +0 -142
- package/src/views/page-menus/feedback/components/feedback-dataset-list.tsx +0 -471
- package/src/views/page-menus/feedback/index.tsx +0 -166
- package/src/views/page-menus/feedback/modal/export-feedback-modal.tsx +0 -367
- package/src/views/page-menus/knowledge/components/doc-editor-by-type.tsx +0 -32
- package/src/views/page-menus/knowledge/components/doc-editor-type-file.tsx +0 -330
- package/src/views/page-menus/knowledge/detail.tsx +0 -600
- package/src/views/page-menus/knowledge/index.tsx +0 -337
- package/src/views/page-menus/knowledge/modal/detail-modal.tsx +0 -618
- package/src/views/page-menus/knowledge/modal/doc-detail-modal.tsx +0 -550
- package/src/views/page-menus/knowledge/modal/doc-parse.ts +0 -99
- package/src/views/page-menus/knowledge/modal/doc-submit-modal.tsx +0 -349
- package/src/views/page-menus/knowledge/modal/doc-type-picker-modal.tsx +0 -88
- package/src/views/page-menus/knowledge/modal/knowledge-user-select-modal.tsx +0 -283
- package/src/views/page-menus/knowledge/modal/submit-modal.tsx +0 -179
- package/src/views/page-menus/model-metadata/manage/components/metadata-detail-schema-tab.tsx +0 -114
- package/src/views/page-menus/model-metadata/manage/components/step1-basic-info.tsx +0 -232
- package/src/views/page-menus/model-metadata/manage/components/step2-schema.tsx +0 -316
- package/src/views/page-menus/model-metadata/manage/components/step3-permissions.tsx +0 -134
- package/src/views/page-menus/model-metadata/manage/components/step4-documents.tsx +0 -134
- package/src/views/page-menus/model-metadata/manage/components/step5-example-sql.tsx +0 -101
- package/src/views/page-menus/model-metadata/manage/components/submit-add.tsx +0 -338
- package/src/views/page-menus/model-metadata/manage/components/submit-edit.tsx +0 -276
- package/src/views/page-menus/model-metadata/manage/detail.tsx +0 -298
- package/src/views/page-menus/model-metadata/manage/hooks/model-metadata-submit-shared.ts +0 -113
- package/src/views/page-menus/model-metadata/manage/hooks/use-model-metadata-item-state.ts +0 -20
- package/src/views/page-menus/model-metadata/manage/index.tsx +0 -304
- package/src/views/page-menus/model-metadata/manage/modal/components/table-schema.ts +0 -374
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-detail-tabs.tsx +0 -151
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-submit-tabs.tsx +0 -423
- package/src/views/page-menus/model-metadata/manage/modal/detail-modal.tsx +0 -218
- package/src/views/page-menus/model-metadata/manage/modal/submit-modal.tsx +0 -261
- package/src/views/page-menus/model-metadata/manage/modal/table-detail-modal.tsx +0 -196
- package/src/views/page-menus/model-metadata/manage/modal/table-submit-modal.tsx +0 -229
- package/src/views/page-menus/model-metadata/manage/submit.tsx +0 -31
- package/src/views/page-menus/model-metadata/role/index.tsx +0 -207
- package/src/views/page-menus/model-metadata/role/modal/detail-modal.tsx +0 -97
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-modal.tsx +0 -254
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-panel.tsx +0 -393
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-utils.ts +0 -120
- package/src/views/page-menus/model-metadata/role/modal/role-permission-assign-panel.tsx +0 -698
- package/src/views/page-menus/model-metadata/role/modal/role-permission-modal.tsx +0 -237
- package/src/views/page-menus/model-metadata/role/modal/submit-modal.tsx +0 -135
- package/src/views/page-menus/model-metadata/training/components/detail-records/index.ts +0 -4
- package/src/views/page-menus/model-metadata/training/components/detail-records/node-card.tsx +0 -72
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-lines.ts +0 -196
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-list.tsx +0 -153
- package/src/views/page-menus/model-metadata/training/components/detail-records/timeline.tsx +0 -103
- package/src/views/page-menus/model-metadata/training/components/detail-records/types.ts +0 -82
- package/src/views/page-menus/model-metadata/training/detail.tsx +0 -159
- package/src/views/page-menus/model-metadata/training/index.tsx +0 -236
- package/src/views/page-menus/model-metadata/training/modal/update-detail-modal.tsx +0 -154
- package/src/views/page-menus/skill/index.tsx +0 -201
- package/src/views/page-menus/skill/modal/detail-modal.tsx +0 -156
- package/src/views/page-menus/skill/modal/submit-modal.tsx +0 -214
- package/src/views/page-system/agent-config/index.tsx +0 -370
- package/src/views/page-system/department/departmentFormShared.ts +0 -36
- package/src/views/page-system/department/index.tsx +0 -541
- package/src/views/page-system/department/modal/detail-modal.tsx +0 -94
- package/src/views/page-system/department/modal/member-role-modal.tsx +0 -128
- package/src/views/page-system/department/modal/submit-modal.tsx +0 -265
- package/src/views/page-system/dict/index.tsx +0 -440
- package/src/views/page-system/dict/modal/cate-submit-modal.tsx +0 -315
- package/src/views/page-system/dict/modal/submit-modal.tsx +0 -184
- package/src/views/page-system/logs/components/index.ts +0 -3
- package/src/views/page-system/logs/components/log-message-demo.tsx +0 -30
- package/src/views/page-system/logs/components/log-message-stream.ts +0 -184
- package/src/views/page-system/logs/components/message-list/content-answer.tsx +0 -100
- package/src/views/page-system/logs/components/message-list/content-question.tsx +0 -18
- package/src/views/page-system/logs/components/message-list/index.tsx +0 -515
- package/src/views/page-system/logs/components/message-list/message-item.tsx +0 -193
- package/src/views/page-system/logs/components/message-list/preparation-demo-items.ts +0 -147
- package/src/views/page-system/logs/components/message-list/preparation-steps.tsx +0 -506
- package/src/views/page-system/logs/components/message-list/suggestion-list.tsx +0 -36
- package/src/views/page-system/logs/components/message-list/thinking-process.tsx +0 -49
- package/src/views/page-system/logs/components/message-list/toolbar.tsx +0 -134
- package/src/views/page-system/logs/components/message-list/use-message-list-scroll.ts +0 -214
- package/src/views/page-system/logs/components/message-modal.tsx +0 -239
- package/src/views/page-system/logs/index.tsx +0 -132
- package/src/views/page-system/logs/modal/detail-modal.tsx +0 -157
- package/src/views/page-system/menu/components/menuFormShared.ts +0 -283
- package/src/views/page-system/menu/index.less +0 -12
- package/src/views/page-system/menu/index.tsx +0 -410
- package/src/views/page-system/menu/modal/icon-modal.less +0 -51
- package/src/views/page-system/menu/modal/icon-modal.tsx +0 -87
- package/src/views/page-system/menu/modal/submit-modal.tsx +0 -263
- package/src/views/page-system/permission/index.tsx +0 -562
- package/src/views/page-system/permission/modal/detail-modal.tsx +0 -179
- package/src/views/page-system/permission/modal/submit-modal.less +0 -146
- package/src/views/page-system/permission/modal/submit-modal.tsx +0 -650
- package/src/views/page-system/role/index.tsx +0 -163
- package/src/views/page-system/role/modal/detail-modal.tsx +0 -127
- package/src/views/page-system/role/modal/permission-assign-group-rules.ts +0 -86
- package/src/views/page-system/role/modal/permission-modal.tsx +0 -111
- package/src/views/page-system/role/modal/role-modal-shell-styles.ts +0 -21
- package/src/views/page-system/role/modal/role-permission-assign-panel.tsx +0 -916
- package/src/views/page-system/role/modal/role-permission-assign-shared.ts +0 -1047
- package/src/views/page-system/role/modal/submit-modal.tsx +0 -193
- package/src/views/page-system/sys-config/index.tsx +0 -294
- package/src/views/page-system/user/components/user-role-column.tsx +0 -87
- package/src/views/page-system/user/index.tsx +0 -439
- package/src/views/page-system/user/modal/assign-roles-modal.tsx +0 -389
- package/src/views/page-system/user/modal/detail-modal.tsx +0 -72
- package/src/views/page-system/user/modal/modal-style/submit-modal.less +0 -40
- package/src/views/page-system/user/modal/submit-modal.less +0 -40
- package/src/views/page-system/user/modal/submit-modal.tsx +0 -287
- package/src/views/page-system/user/userFormShared.ts +0 -51
- package/tailwind.config.js +0 -17
- package/tsconfig.app.json +0 -48
- package/tsconfig.json +0 -11
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -272
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/vite.svg +0 -0
package/src/router/index.tsx
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { Spin } from 'antd'
|
|
2
|
-
import React, { type ReactNode } from 'react'
|
|
3
|
-
import { Navigate, type RouteObject } from 'react-router-dom'
|
|
4
|
-
|
|
5
|
-
import { useAuth } from '@/contexts/AuthContext'
|
|
6
|
-
import { useMenu } from '@/contexts/MenuContext'
|
|
7
|
-
import type { MenuTreeItem } from '@/types/menu'
|
|
8
|
-
import {
|
|
9
|
-
registerAdminMenuRoute,
|
|
10
|
-
resetMenuRouteRegistry,
|
|
11
|
-
} from '@/utils/menuRouteRegistry'
|
|
12
|
-
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
// 懒加载页面(按:认证 → 主布局业务 → 全局错误 → 管理端显式入口)
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
|
|
17
|
-
// 认证
|
|
18
|
-
const LoginPage = React.lazy(() => import('@/views/auth/login'))
|
|
19
|
-
const RegisterPage = React.lazy(() => import('@/views/auth/register'))
|
|
20
|
-
|
|
21
|
-
// 主布局内
|
|
22
|
-
const ChatNewPage = React.lazy(() => import('@/views/chat'))
|
|
23
|
-
const ChatSessionPage = React.lazy( () => import('@/views/chat/index-session'))
|
|
24
|
-
const MemoryPage = React.lazy(() => import('@/views/base/memory'))
|
|
25
|
-
const SettingsPage = React.lazy(() => import('@/views/base/settings'))
|
|
26
|
-
|
|
27
|
-
// 全局错误页
|
|
28
|
-
const Route401Page = React.lazy(() => import('@/views/page-error/401'))
|
|
29
|
-
const Route404Page = React.lazy(() => import('@/views/page-error/404'))
|
|
30
|
-
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
// 动态菜单:glob 扫描 views/**/index.tsx,与菜单 component 路径对齐
|
|
33
|
-
// ---------------------------------------------------------------------------
|
|
34
|
-
|
|
35
|
-
const menuPageModules = import.meta.glob('../views/**/index.tsx')
|
|
36
|
-
const submitPageModules = import.meta.glob('../views/**/submit.tsx')
|
|
37
|
-
const detailPageModules = import.meta.glob('../views/**/detail.tsx')
|
|
38
|
-
|
|
39
|
-
const componentMap: Record<string, React.ComponentType<any>> = {}
|
|
40
|
-
|
|
41
|
-
/** 将 glob loader 转为 React.lazy 组件(模块必须 default export 组件)。 */
|
|
42
|
-
function createLazyPageComponent(path: string, loader: () => Promise<unknown>) {
|
|
43
|
-
return React.lazy(async () => {
|
|
44
|
-
const mod: any = await loader()
|
|
45
|
-
const Comp = mod?.default
|
|
46
|
-
if (!Comp) {
|
|
47
|
-
if (import.meta.env.DEV) {
|
|
48
|
-
console.error('[Router] 页面组件缺少 default export:', path, mod)
|
|
49
|
-
}
|
|
50
|
-
const Fallback: React.FC = () => (
|
|
51
|
-
<div style={{ padding: 16 }}>
|
|
52
|
-
页面加载失败:组件导出异常
|
|
53
|
-
</div>
|
|
54
|
-
)
|
|
55
|
-
return { default: Fallback }
|
|
56
|
-
}
|
|
57
|
-
return { default: Comp }
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// 注册 index.tsx
|
|
62
|
-
Object.entries(menuPageModules).forEach(([path, loader]) => {
|
|
63
|
-
const componentPath = path
|
|
64
|
-
.replace(/^\.\.\/views/, '')
|
|
65
|
-
.replace('/index.tsx', '')
|
|
66
|
-
.replace(/^\//, '') // 移除前导斜杠
|
|
67
|
-
const lazyComponent = createLazyPageComponent(path, loader as any)
|
|
68
|
-
componentMap[componentPath] = lazyComponent
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
// 注册 submit.tsx
|
|
72
|
-
Object.entries(submitPageModules).forEach(([path, loader]) => {
|
|
73
|
-
const componentPath = path
|
|
74
|
-
.replace(/^\.\.\/views/, '')
|
|
75
|
-
.replace('/submit.tsx', '')
|
|
76
|
-
.replace(/^\//, '') // 移除前导斜杠
|
|
77
|
-
const lazyComponent = createLazyPageComponent(path, loader as any)
|
|
78
|
-
componentMap[`${componentPath}/submit`] = lazyComponent
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// 注册 detail.tsx
|
|
82
|
-
Object.entries(detailPageModules).forEach(([path, loader]) => {
|
|
83
|
-
const componentPath = path
|
|
84
|
-
.replace(/^\.\.\/views/, '')
|
|
85
|
-
.replace('/detail.tsx', '')
|
|
86
|
-
.replace(/^\//, '') // 移除前导斜杠
|
|
87
|
-
const lazyComponent = createLazyPageComponent(path, loader as any)
|
|
88
|
-
componentMap[`${componentPath}/detail`] = lazyComponent
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
// 调试日志已移除:避免控制台刷屏
|
|
92
|
-
|
|
93
|
-
// ---------------------------------------------------------------------------
|
|
94
|
-
// 工具与类型
|
|
95
|
-
// ---------------------------------------------------------------------------
|
|
96
|
-
|
|
97
|
-
export function withPageFallback(node: React.ReactNode) {
|
|
98
|
-
return (
|
|
99
|
-
<React.Suspense
|
|
100
|
-
fallback={
|
|
101
|
-
<div className="flex h-screen items-center justify-center">
|
|
102
|
-
<Spin size="large" />
|
|
103
|
-
</div>
|
|
104
|
-
}>
|
|
105
|
-
{node}
|
|
106
|
-
</React.Suspense>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export type RouteConfig = {
|
|
111
|
-
path?: string
|
|
112
|
-
index?: boolean
|
|
113
|
-
element: ReactNode
|
|
114
|
-
children?: RouteConfig[]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function toRouteObjects(configs: RouteConfig[]): RouteObject[] {
|
|
118
|
-
return configs.map((config) => {
|
|
119
|
-
if (config.index) {
|
|
120
|
-
return {
|
|
121
|
-
index: true,
|
|
122
|
-
element: config.element,
|
|
123
|
-
} as RouteObject
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
path: config.path,
|
|
127
|
-
element: config.element,
|
|
128
|
-
children: config.children ? toRouteObjects(config.children) : undefined,
|
|
129
|
-
} as RouteObject
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// ---------------------------------------------------------------------------
|
|
134
|
-
// 静态路由(顺序与 App 中 routeConfigs 拼接一致:公开 → 401 → 主布局 → 404)
|
|
135
|
-
// ---------------------------------------------------------------------------
|
|
136
|
-
|
|
137
|
-
/** 无需登录 */
|
|
138
|
-
export const ROUTES_PUBLIC: RouteConfig[] = [
|
|
139
|
-
{ path: '/login', element: withPageFallback(<LoginPage />) },
|
|
140
|
-
{ path: '/register', element: withPageFallback(<RegisterPage />) },
|
|
141
|
-
]
|
|
142
|
-
|
|
143
|
-
export const ROUTE_401: RouteConfig = {
|
|
144
|
-
path: '/401',
|
|
145
|
-
element: withPageFallback(<Route401Page />),
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 主布局 children(相对 path)
|
|
150
|
-
* 顺序:默认重定向 → 新对话 → 具体会话 → 其它业务
|
|
151
|
-
*/
|
|
152
|
-
export const ROUTES_MAIN_CHILD: RouteConfig[] = [
|
|
153
|
-
{ index: true, element: <Navigate to="/chat" replace /> },
|
|
154
|
-
{ path: 'chat', element: withPageFallback(<ChatNewPage />) },
|
|
155
|
-
{
|
|
156
|
-
path: 'chat/:sessionId',
|
|
157
|
-
element: withPageFallback(<ChatSessionPage />),
|
|
158
|
-
},
|
|
159
|
-
{ path: 'memories', element: withPageFallback(<MemoryPage />) },
|
|
160
|
-
{ path: 'settings', element: withPageFallback(<SettingsPage />) },
|
|
161
|
-
]
|
|
162
|
-
|
|
163
|
-
export const ROUTE_404: RouteConfig = {
|
|
164
|
-
path: '*',
|
|
165
|
-
element: withPageFallback(<Route404Page />),
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** 菜单尚未注入动态路由时,用全屏加载替代 404,避免刷新深层链接瞬间落到通配 404 */
|
|
169
|
-
export const ROUTE_BOOT: RouteConfig = {
|
|
170
|
-
path: '*',
|
|
171
|
-
element: (
|
|
172
|
-
<div className="flex h-screen items-center justify-center">
|
|
173
|
-
<Spin size="large" />
|
|
174
|
-
</div>
|
|
175
|
-
),
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// ---------------------------------------------------------------------------
|
|
179
|
-
// 动态菜单路由 + 登录守卫
|
|
180
|
-
// ---------------------------------------------------------------------------
|
|
181
|
-
|
|
182
|
-
export function generateAdminRoutes(menus: MenuTreeItem[]): RouteConfig[] {
|
|
183
|
-
const flattenMenus = (menuList: MenuTreeItem[]): MenuTreeItem[] => {
|
|
184
|
-
const result: MenuTreeItem[] = []
|
|
185
|
-
menuList.forEach((menu) => {
|
|
186
|
-
if (menu.component && menu.component !== 'Main' && menu.path) {
|
|
187
|
-
result.push({
|
|
188
|
-
...menu,
|
|
189
|
-
path: menu.path.replace(/^\//, ''),
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
if (menu.children && menu.children.length > 0) {
|
|
193
|
-
result.push(...flattenMenus(menu.children))
|
|
194
|
-
}
|
|
195
|
-
})
|
|
196
|
-
return result
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const routes: RouteConfig[] = []
|
|
200
|
-
resetMenuRouteRegistry()
|
|
201
|
-
|
|
202
|
-
flattenMenus(menus).forEach((route) => {
|
|
203
|
-
// 清理 component 路径:移除前导斜杠和 /index 后缀
|
|
204
|
-
let rawComponent = route.component || ''
|
|
205
|
-
|
|
206
|
-
// 跳过无效的路径
|
|
207
|
-
if (!rawComponent || rawComponent === '/' || rawComponent === 'Main' || rawComponent === 'Root') {
|
|
208
|
-
return
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// 标准化路径:移除前导斜杠
|
|
212
|
-
let componentPath = rawComponent.replace(/^\//, '')
|
|
213
|
-
|
|
214
|
-
// 尝试多种路径组合
|
|
215
|
-
if (!componentMap[componentPath]) {
|
|
216
|
-
componentPath = `${componentPath}/index`
|
|
217
|
-
}
|
|
218
|
-
if (!componentMap[componentPath]) {
|
|
219
|
-
componentPath = rawComponent.replace(/^\//, '').replace(/\/index$/, '')
|
|
220
|
-
}
|
|
221
|
-
if (!componentMap[componentPath]) {
|
|
222
|
-
componentPath = rawComponent.replace(/^\//, '').replace(/\/index$/, '') + '/index'
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const Component = componentMap[componentPath]
|
|
226
|
-
if (!Component) {
|
|
227
|
-
return
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const hasDetail = !!componentMap[`${componentPath}/detail`]
|
|
231
|
-
const hasSubmit = !!componentMap[`${componentPath}/submit`]
|
|
232
|
-
|
|
233
|
-
let basePath = route.path
|
|
234
|
-
if (basePath.endsWith('/index')) {
|
|
235
|
-
basePath = basePath.slice(0, -'/index'.length)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const listPath = route.path.startsWith('/') ? route.path : `/${route.path}`
|
|
239
|
-
|
|
240
|
-
registerAdminMenuRoute({
|
|
241
|
-
basePath,
|
|
242
|
-
listPath,
|
|
243
|
-
menuCode: route.code,
|
|
244
|
-
hasDetail,
|
|
245
|
-
hasSubmit,
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
// 添加主路由 - 完全按配置的 path
|
|
249
|
-
routes.push({
|
|
250
|
-
path: route.path,
|
|
251
|
-
element: withPageFallback(<Component />),
|
|
252
|
-
})
|
|
253
|
-
|
|
254
|
-
// 自动注册 submit/detail 路由(basePath 已含去掉 /index)
|
|
255
|
-
|
|
256
|
-
// 自动注册 submit 路由
|
|
257
|
-
const submitComponentPath = `${componentPath}/submit`
|
|
258
|
-
if (componentMap[submitComponentPath]) {
|
|
259
|
-
const SubmitComponent = componentMap[submitComponentPath]
|
|
260
|
-
// 先注册带 id,避免与无参 `submit` 产生匹配歧义(RR6/7)
|
|
261
|
-
routes.push({
|
|
262
|
-
path: `${basePath}/submit/:id`,
|
|
263
|
-
element: withPageFallback(<SubmitComponent />),
|
|
264
|
-
})
|
|
265
|
-
routes.push({
|
|
266
|
-
path: `${basePath}/submit`,
|
|
267
|
-
element: withPageFallback(<SubmitComponent />),
|
|
268
|
-
})
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// 自动注册 detail 路由
|
|
272
|
-
const detailComponentPath = `${componentPath}/detail`
|
|
273
|
-
if (componentMap[detailComponentPath]) {
|
|
274
|
-
const DetailComponent = componentMap[detailComponentPath]
|
|
275
|
-
routes.push({
|
|
276
|
-
path: `${basePath}/detail/:id`,
|
|
277
|
-
element: withPageFallback(<DetailComponent />),
|
|
278
|
-
})
|
|
279
|
-
}
|
|
280
|
-
})
|
|
281
|
-
return routes
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export const ProtectedRoute: React.FC<{ children: React.ReactNode }> = ({
|
|
285
|
-
children,
|
|
286
|
-
}) => {
|
|
287
|
-
const { isAuthenticated, isLoading } = useAuth()
|
|
288
|
-
const { isLoading: isMenuLoading } = useMenu()
|
|
289
|
-
|
|
290
|
-
if (isLoading) {
|
|
291
|
-
return (
|
|
292
|
-
<div className="flex h-screen items-center justify-center">
|
|
293
|
-
<Spin size="large" />
|
|
294
|
-
</div>
|
|
295
|
-
)
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (!isAuthenticated) {
|
|
299
|
-
return <Navigate to="/login" />
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// 登录态下:等待菜单就绪后再放行(避免先跳转再补菜单导致空白/闪烁)
|
|
303
|
-
if (isMenuLoading) {
|
|
304
|
-
return (
|
|
305
|
-
<div className="flex h-screen items-center justify-center">
|
|
306
|
-
<Spin size="large" />
|
|
307
|
-
</div>
|
|
308
|
-
)
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
return <>{children}</>
|
|
312
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ConfigProvider, theme as antdThemePreset } from 'antd'
|
|
2
|
-
import React, { useEffect, useState } from 'react'
|
|
3
|
-
import { antdTheme } from './antd-theme'
|
|
4
|
-
|
|
5
|
-
function readHtmlDark(): boolean {
|
|
6
|
-
return document.documentElement.classList.contains('dark')
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 随 `document.documentElement` 的 `dark` class 切换 antd 明/暗算法;
|
|
11
|
-
* 与 `useUserPreferences`、Tailwind `dark:`、variable.less 中 `html.dark` 一致。
|
|
12
|
-
*/
|
|
13
|
-
export function AntdThemeProvider({
|
|
14
|
-
children,
|
|
15
|
-
}: {
|
|
16
|
-
children: React.ReactNode
|
|
17
|
-
}) {
|
|
18
|
-
const [isDark, setIsDark] = useState(readHtmlDark)
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
const el = document.documentElement
|
|
22
|
-
const sync = () => setIsDark(el.classList.contains('dark'))
|
|
23
|
-
sync()
|
|
24
|
-
const mo = new MutationObserver(sync)
|
|
25
|
-
mo.observe(el, { attributes: true, attributeFilter: ['class'] })
|
|
26
|
-
return () => mo.disconnect()
|
|
27
|
-
}, [])
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<ConfigProvider
|
|
31
|
-
theme={{
|
|
32
|
-
...antdTheme,
|
|
33
|
-
algorithm: isDark
|
|
34
|
-
? antdThemePreset.darkAlgorithm
|
|
35
|
-
: antdThemePreset.defaultAlgorithm,
|
|
36
|
-
}}>
|
|
37
|
-
{children}
|
|
38
|
-
</ConfigProvider>
|
|
39
|
-
)
|
|
40
|
-
}
|
package/src/styles/antd-theme.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ThemeConfig } from 'antd'
|
|
2
|
-
|
|
3
|
-
import { TAG_COLOR } from '@/meta/const'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Ant Design 全局 Design Token(由 AntdThemeProvider 注入)
|
|
7
|
-
* 种子色来自 `@/meta/const` 的 `TAG_COLOR`;`variable.less` 中 `@antd-*` 须与之一致。
|
|
8
|
-
* 明暗切换由 Provider 设置 `darkAlgorithm` / `defaultAlgorithm`,会重算背景/边框等派生 token。
|
|
9
|
-
*/
|
|
10
|
-
export const antdTheme: ThemeConfig = {
|
|
11
|
-
token: {
|
|
12
|
-
colorPrimary: TAG_COLOR.info,
|
|
13
|
-
colorSuccess: TAG_COLOR.success,
|
|
14
|
-
colorWarning: TAG_COLOR.warning,
|
|
15
|
-
colorError: TAG_COLOR.error,
|
|
16
|
-
colorInfo: TAG_COLOR.info,
|
|
17
|
-
colorLink: TAG_COLOR.info,
|
|
18
|
-
borderRadius: 8,
|
|
19
|
-
},
|
|
20
|
-
}
|
package/src/styles/global.less
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全局公共样式(与页面/组件解耦,由 index.less 引入)
|
|
3
|
-
* 第三方组件覆盖、无作用域的全局规则可放此处。
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* KaTeX:在 Tailwind Typography prose 内避免被裁切;暗色下与正文对比度一致 */
|
|
7
|
-
|
|
8
|
-
.group {
|
|
9
|
-
.prose {
|
|
10
|
-
max-width: 80%;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.prose .katex {
|
|
15
|
-
max-width: 100%;
|
|
16
|
-
overflow-x: auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.prose-invert .katex,
|
|
20
|
-
.dark .prose .katex {
|
|
21
|
-
color: #e5e7eb;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* form 表单项 label 与控件间距(全局) */
|
|
25
|
-
.ant-form-item-label {
|
|
26
|
-
padding-bottom: 0 !important;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* antd 默认字体栈(需要按 antd 的基准字体显示时使用) */
|
|
30
|
-
.font-antd {
|
|
31
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
32
|
-
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
|
|
33
|
-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* CxModal 内容区撑满壳(与 modalConfig.styles 里 container/body flex 配合)
|
|
38
|
-
* content / container / body:纵向 flex;container padding:0 消除 footer 下白边。
|
|
39
|
-
*/
|
|
40
|
-
.cx-modal-content-fill-struct(@root) {
|
|
41
|
-
.@{root} .ant-modal-content {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
min-height: 0;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
max-height: inherit;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.@{root} .ant-modal-container {
|
|
50
|
-
padding: 0 !important;
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
height: min(95dvh, 95vh) !important;
|
|
55
|
-
max-height: min(95dvh, 95vh);
|
|
56
|
-
min-height: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.@{root} .ant-modal-body {
|
|
60
|
-
overflow: hidden !important;
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
flex: 1 1 0%;
|
|
64
|
-
min-height: 0;
|
|
65
|
-
max-height: none !important;
|
|
66
|
-
padding: 20px 32px;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.cx-modal-content-fill-form(@root) {
|
|
71
|
-
.@{root} .ant-modal-body form.ant-form {
|
|
72
|
-
display: flex !important;
|
|
73
|
-
flex-direction: column !important;
|
|
74
|
-
flex: 1 1 0% !important;
|
|
75
|
-
min-height: 0 !important;
|
|
76
|
-
align-self: stretch;
|
|
77
|
-
width: 100%;
|
|
78
|
-
max-height: none;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* 角色权限分配 */
|
|
84
|
-
.cx-modal-content-fill-struct(~"cx-modal-role-assign");
|
|
85
|
-
.cx-modal-content-fill-form(~"cx-modal-role-assign");
|
|
86
|
-
|
|
87
|
-
.cx-modal-role-assign .ant-modal-body form.ant-form {
|
|
88
|
-
/* 2px 边框 + 焦点 ring 画在控件盒外时,避免被本层 overflow 裁切 */
|
|
89
|
-
padding: 4px;
|
|
90
|
-
box-sizing: border-box;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* 固定视口高 + 头/体/脚布局:文档提交/详情、技能详情等共用 rootClassName */
|
|
94
|
-
.cx-modal-content-fill-struct(~"cx-modal-content-fill");
|
|
95
|
-
.cx-modal-content-fill-form(~"cx-modal-content-fill");
|
|
96
|
-
|
|
97
|
-
.cx-modal-content-fill.scroll {
|
|
98
|
-
.ant-modal-body {
|
|
99
|
-
overflow-y: auto !important;
|
|
100
|
-
overflow-x: hidden !important;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.ant-modal-body form.ant-form {
|
|
104
|
-
overflow: visible !important;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
package/src/styles/variable.less
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全局设计色(Less 变量 + CSS 自定义属性)
|
|
3
|
-
* - `@antd-*` / `@cx-*`:供本仓库 .less 引用(需 @import 本文件)
|
|
4
|
-
* - `:root` / `html.dark`:Cx 系列与任意 CSS 使用 `var(--cx-*)`、`var(--antd-*)`
|
|
5
|
-
*
|
|
6
|
-
* 暗色主题:`useUserPreferences` 等在 `document.documentElement` 上切换 `class="dark"`;
|
|
7
|
-
* Tailwind `dark:` 与下文 `html.dark` 选择器均依赖于此。
|
|
8
|
-
* Ant Design:`AntdThemeProvider` 根据 `html.dark` 切换 `darkAlgorithm`,与 Cx 变量并行生效。
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// ----- Ant Design seed(与 antd-theme.ts 同步)-----
|
|
12
|
-
@antd-color-primary: #2563eb;
|
|
13
|
-
@antd-color-primary-hover: #1d4ed8;
|
|
14
|
-
@antd-color-primary-active: #1e40af;
|
|
15
|
-
|
|
16
|
-
@antd-color-success: #22c55e;
|
|
17
|
-
@antd-color-warning: #f59e0b;
|
|
18
|
-
@antd-color-error: #ef4444;
|
|
19
|
-
@antd-color-info: @antd-color-primary;
|
|
20
|
-
|
|
21
|
-
@antd-color-link: @antd-color-primary;
|
|
22
|
-
|
|
23
|
-
@antd-border-radius: 8px;
|
|
24
|
-
|
|
25
|
-
// ----- Cx 组件用 Less 别名(可选,与 CSS 变量一致)-----
|
|
26
|
-
@cx-option-hover-bg-light: #f3f4f6;
|
|
27
|
-
@cx-option-selected-bg-light: #eff6ff;
|
|
28
|
-
@cx-danger-border-light: #fecaca;
|
|
29
|
-
@cx-danger-text-light: #dc2626;
|
|
30
|
-
@cx-danger-hover-bg-light: #fef2f2;
|
|
31
|
-
|
|
32
|
-
:root {
|
|
33
|
-
--ant-font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
34
|
-
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
|
|
35
|
-
|
|
36
|
-
--antd-color-primary: @antd-color-primary;
|
|
37
|
-
--antd-color-primary-hover: @antd-color-primary-hover;
|
|
38
|
-
--antd-color-primary-active: @antd-color-primary-active;
|
|
39
|
-
--antd-color-success: @antd-color-success;
|
|
40
|
-
--antd-color-warning: @antd-color-warning;
|
|
41
|
-
--antd-color-error: @antd-color-error;
|
|
42
|
-
--antd-color-info: @antd-color-info;
|
|
43
|
-
--antd-color-link: @antd-color-link;
|
|
44
|
-
--antd-border-radius: @antd-border-radius;
|
|
45
|
-
|
|
46
|
-
--brand-primary: @antd-color-primary;
|
|
47
|
-
|
|
48
|
-
/* Cx:主按钮实心(与 antd 主色一致) */
|
|
49
|
-
--cx-color-primary-solid: var(--antd-color-primary);
|
|
50
|
-
--cx-color-primary-solid-hover: var(--antd-color-primary-hover);
|
|
51
|
-
--cx-color-primary-solid-active: var(--antd-color-primary-active);
|
|
52
|
-
|
|
53
|
-
/* Cx:主色阴影(随主色变化) */
|
|
54
|
-
--cx-shadow-primary-sm: 0 1px 2px 0 color-mix(in srgb, var(--antd-color-primary) 15%, transparent);
|
|
55
|
-
--cx-shadow-primary-md:
|
|
56
|
-
0 4px 6px -1px color-mix(in srgb, var(--antd-color-primary) 20%, transparent),
|
|
57
|
-
0 2px 4px -2px color-mix(in srgb, var(--antd-color-primary) 20%, transparent);
|
|
58
|
-
|
|
59
|
-
/* Cx:下拉 / 树选项 */
|
|
60
|
-
--cx-option-hover-bg: @cx-option-hover-bg-light;
|
|
61
|
-
--cx-option-selected-bg: @cx-option-selected-bg-light;
|
|
62
|
-
--cx-option-selected-text: var(--antd-color-primary-hover);
|
|
63
|
-
|
|
64
|
-
/* Cx:空心 danger */
|
|
65
|
-
--cx-danger-outlined-bg: #fff;
|
|
66
|
-
--cx-danger-outlined-border: @cx-danger-border-light;
|
|
67
|
-
--cx-danger-outlined-text: @cx-danger-text-light;
|
|
68
|
-
--cx-danger-outlined-hover-bg: @cx-danger-hover-bg-light;
|
|
69
|
-
|
|
70
|
-
/* Cx:text 类型按钮 hover 底 */
|
|
71
|
-
--cx-text-btn-hover-bg: #f3f4f6;
|
|
72
|
-
|
|
73
|
-
/* Cx:多选「全选」链色 */
|
|
74
|
-
--cx-accent-link: var(--antd-color-primary-hover);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* antd 运行时会用 `.css-var-xxxx` 作用域类注入变量;在该作用域下同步覆盖 */
|
|
78
|
-
[class^='css-var-'],
|
|
79
|
-
[class*=' css-var-'] {
|
|
80
|
-
--ant-font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
81
|
-
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
html.dark {
|
|
85
|
-
--brand-primary: @antd-color-primary;
|
|
86
|
-
|
|
87
|
-
--cx-shadow-primary-sm: 0 1px 2px 0 color-mix(in srgb, var(--antd-color-primary) 28%, transparent);
|
|
88
|
-
--cx-shadow-primary-md:
|
|
89
|
-
0 4px 6px -1px color-mix(in srgb, var(--antd-color-primary) 35%, transparent),
|
|
90
|
-
0 2px 4px -2px color-mix(in srgb, var(--antd-color-primary) 30%, transparent);
|
|
91
|
-
|
|
92
|
-
--cx-option-hover-bg: #374151;
|
|
93
|
-
--cx-option-selected-bg: color-mix(in srgb, var(--antd-color-primary) 22%, transparent);
|
|
94
|
-
--cx-option-selected-text: #93c5fd;
|
|
95
|
-
|
|
96
|
-
--cx-danger-outlined-bg: #374151;
|
|
97
|
-
--cx-danger-outlined-border: rgb(127 29 29 / 0.3);
|
|
98
|
-
--cx-danger-outlined-text: #f87171;
|
|
99
|
-
--cx-danger-outlined-hover-bg: rgb(127 29 29 / 0.1);
|
|
100
|
-
|
|
101
|
-
--cx-text-btn-hover-bg: #374151;
|
|
102
|
-
--cx-accent-link: #93c5fd;
|
|
103
|
-
}
|
package/src/types/feedback.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** 审核状态:0=待审核、1=已通过、2=已拒绝 */
|
|
2
|
-
export type ReviewStatus = 0 | 1 | 2
|
|
3
|
-
|
|
4
|
-
/** 列表筛选:空字符串表示全部 */
|
|
5
|
-
export type FeedbackStatusFilter = ReviewStatus | ''
|
|
6
|
-
|
|
7
|
-
/** 将接口或表单中的状态转为 i18n 后缀(pending / approved / rejected) */
|
|
8
|
-
export function feedbackStatusI18nKey(
|
|
9
|
-
status: unknown,
|
|
10
|
-
): 'pending' | 'approved' | 'rejected' {
|
|
11
|
-
if (status === 0 || status === '0') return 'pending'
|
|
12
|
-
if (status === 1 || status === '1') return 'approved'
|
|
13
|
-
if (status === 2 || status === '2') return 'rejected'
|
|
14
|
-
return 'pending'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** 是否为待审核(兼容数字或字符串枚举) */
|
|
18
|
-
export function isFeedbackPending(status: unknown): boolean {
|
|
19
|
-
return status === 0 || status === '0'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface FeedbackDatasetItem {
|
|
23
|
-
id: string
|
|
24
|
-
messageId: string
|
|
25
|
-
userId: string
|
|
26
|
-
userName: string
|
|
27
|
-
question: string
|
|
28
|
-
answer: string
|
|
29
|
-
status: ReviewStatus
|
|
30
|
-
/** 评价类型:10=赞、20=踩 */
|
|
31
|
-
evaluationType: 10 | 20
|
|
32
|
-
createTime: string
|
|
33
|
-
updateTime: string
|
|
34
|
-
reviewBy?: string
|
|
35
|
-
reviewTime?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface FeedbackUpdate {
|
|
39
|
-
question?: string
|
|
40
|
-
answer?: string
|
|
41
|
-
status?: ReviewStatus
|
|
42
|
-
evaluationType?: 10 | 20
|
|
43
|
-
}
|