npmapps 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/app/wujie-wk/dev.log +0 -1979
- package/app/wujie-wk/wujie-react-child/README.md +0 -126
- package/app/wujie-wk/wujie-react-child/eslint.config.js +0 -28
- package/app/wujie-wk/wujie-react-child/index.html +0 -13
- package/app/wujie-wk/wujie-react-child/package-lock.json +0 -4344
- package/app/wujie-wk/wujie-react-child/package.json +0 -32
- package/app/wujie-wk/wujie-react-child/public/vite.svg +0 -1
- package/app/wujie-wk/wujie-react-child/src/App.css +0 -0
- package/app/wujie-wk/wujie-react-child/src/App.tsx +0 -72
- package/app/wujie-wk/wujie-react-child/src/assets/react.svg +0 -1
- package/app/wujie-wk/wujie-react-child/src/components/FeatureCards.css +0 -63
- package/app/wujie-wk/wujie-react-child/src/components/FeatureCards.tsx +0 -112
- package/app/wujie-wk/wujie-react-child/src/components/LightCard/index.tsx +0 -36
- package/app/wujie-wk/wujie-react-child/src/components/LightCard/style.css +0 -20
- package/app/wujie-wk/wujie-react-child/src/hooks/use3DCard.ts +0 -53
- package/app/wujie-wk/wujie-react-child/src/hooks/useLightCard.ts +0 -141
- package/app/wujie-wk/wujie-react-child/src/index.css +0 -0
- package/app/wujie-wk/wujie-react-child/src/main.tsx +0 -8
- package/app/wujie-wk/wujie-react-child/src/pages/ChildToParent/index.css +0 -55
- package/app/wujie-wk/wujie-react-child/src/pages/ChildToParent/index.tsx +0 -88
- package/app/wujie-wk/wujie-react-child/src/pages/Css.tsx +0 -28
- package/app/wujie-wk/wujie-react-child/src/pages/Home.tsx +0 -72
- package/app/wujie-wk/wujie-react-child/src/pages/ParentToChild.css +0 -85
- package/app/wujie-wk/wujie-react-child/src/pages/ParentToChild.tsx +0 -119
- package/app/wujie-wk/wujie-react-child/src/pages/RouterJump/index.css +0 -61
- package/app/wujie-wk/wujie-react-child/src/pages/RouterJump/index.tsx +0 -87
- package/app/wujie-wk/wujie-react-child/src/router/index.tsx +0 -63
- package/app/wujie-wk/wujie-react-child/src/types/wujie.d.ts +0 -26
- package/app/wujie-wk/wujie-react-child/src/vite-env.d.ts +0 -1
- package/app/wujie-wk/wujie-react-child/tsconfig.app.json +0 -26
- package/app/wujie-wk/wujie-react-child/tsconfig.json +0 -7
- package/app/wujie-wk/wujie-react-child/tsconfig.node.json +0 -24
- package/app/wujie-wk/wujie-react-child/vite.config.ts +0 -10
- package/app/wujie-wk/wujie-vue3-child/.claude/settings.local.json +0 -8
- package/app/wujie-wk/wujie-vue3-child/.vscode/extensions.json +0 -3
- package/app/wujie-wk/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
- package/app/wujie-wk/wujie-vue3-child/README.md +0 -5
- package/app/wujie-wk/wujie-vue3-child/index.html +0 -13
- package/app/wujie-wk/wujie-vue3-child/package-lock.json +0 -5744
- package/app/wujie-wk/wujie-vue3-child/package.json +0 -28
- package/app/wujie-wk/wujie-vue3-child/public/vite.svg +0 -1
- package/app/wujie-wk/wujie-vue3-child/src/App.vue +0 -130
- package/app/wujie-wk/wujie-vue3-child/src/assets/vue.svg +0 -1
- package/app/wujie-wk/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
- package/app/wujie-wk/wujie-vue3-child/src/components/SmartAnchorTabs/index.jsx +0 -224
- package/app/wujie-wk/wujie-vue3-child/src/components/SmartAnchorTabs/style.css +0 -154
- package/app/wujie-wk/wujie-vue3-child/src/components/tags-view.vue +0 -193
- package/app/wujie-wk/wujie-vue3-child/src/components/tags-view1.vue +0 -131
- package/app/wujie-wk/wujie-vue3-child/src/directives/aiLoading.js +0 -182
- package/app/wujie-wk/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
- package/app/wujie-wk/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
- package/app/wujie-wk/wujie-vue3-child/src/main.js +0 -18
- package/app/wujie-wk/wujie-vue3-child/src/router/index.js +0 -104
- package/app/wujie-wk/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
- package/app/wujie-wk/wujie-vue3-child/src/style.css +0 -171
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -375
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
- package/app/wujie-wk/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
- package/app/wujie-wk/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
- package/app/wujie-wk/wujie-vue3-child/src/views/home.vue +0 -53
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/com.vue +0 -44
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/index.vue +0 -72
- package/app/wujie-wk/wujie-vue3-child/src/views/jsx/props.vue +0 -33
- package/app/wujie-wk/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
- package/app/wujie-wk/wujie-vue3-child/src/views/phone-code.vue +0 -318
- package/app/wujie-wk/wujie-vue3-child/src/views/router-jump.vue +0 -123
- package/app/wujie-wk/wujie-vue3-child/src/views/test.vue +0 -192
- package/app/wujie-wk/wujie-vue3-child/vite.config.js +0 -15
- package/app/wujie-wk/wujie-vue3-child copy/.vscode/extensions.json +0 -3
- package/app/wujie-wk/wujie-vue3-child copy/README.md +0 -5
- package/app/wujie-wk/wujie-vue3-child copy/index.html +0 -13
- package/app/wujie-wk/wujie-vue3-child copy/package-lock.json +0 -4617
- package/app/wujie-wk/wujie-vue3-child copy/package.json +0 -22
- package/app/wujie-wk/wujie-vue3-child copy/public/vite.svg +0 -1
- package/app/wujie-wk/wujie-vue3-child copy/src/App.vue +0 -124
- package/app/wujie-wk/wujie-vue3-child copy/src/assets/vue.svg +0 -1
- package/app/wujie-wk/wujie-vue3-child copy/src/components/HelloWorld.vue +0 -43
- package/app/wujie-wk/wujie-vue3-child copy/src/main.js +0 -12
- package/app/wujie-wk/wujie-vue3-child copy/src/router/index.js +0 -84
- package/app/wujie-wk/wujie-vue3-child copy/src/style.css +0 -4
- package/app/wujie-wk/wujie-vue3-child copy/src/views/child-to-parent.vue +0 -117
- package/app/wujie-wk/wujie-vue3-child copy/src/views/home.vue +0 -53
- package/app/wujie-wk/wujie-vue3-child copy/src/views/parent-to-child.vue +0 -225
- package/app/wujie-wk/wujie-vue3-child copy/src/views/phone-code.vue +0 -318
- package/app/wujie-wk/wujie-vue3-child copy/src/views/router-jump.vue +0 -115
- package/app/wujie-wk/wujie-vue3-child copy/src/views/test.vue +0 -192
- package/app/wujie-wk/wujie-vue3-child copy/vite.config.js +0 -10
- package/app/wujie-wk/wujie-vue3-main/.vscode/extensions.json +0 -3
- package/app/wujie-wk/wujie-vue3-main/README.md +0 -154
- package/app/wujie-wk/wujie-vue3-main/index.html +0 -13
- package/app/wujie-wk/wujie-vue3-main/package-lock.json +0 -4736
- package/app/wujie-wk/wujie-vue3-main/package.json +0 -25
- package/app/wujie-wk/wujie-vue3-main/public/vite.svg +0 -1
- package/app/wujie-wk/wujie-vue3-main/src/App.vue +0 -879
- package/app/wujie-wk/wujie-vue3-main/src/assets/vue.svg +0 -1
- package/app/wujie-wk/wujie-vue3-main/src/components/HelloWorld.vue +0 -43
- package/app/wujie-wk/wujie-vue3-main/src/components/WujieReact/index.vue +0 -20
- package/app/wujie-wk/wujie-vue3-main/src/components/WujieVue2/index.vue +0 -8
- package/app/wujie-wk/wujie-vue3-main/src/components/WujieVue3/index.vue +0 -8
- package/app/wujie-wk/wujie-vue3-main/src/components/WujieVue3Copy/index.vue +0 -8
- package/app/wujie-wk/wujie-vue3-main/src/main.js +0 -23
- package/app/wujie-wk/wujie-vue3-main/src/router/index.js +0 -88
- package/app/wujie-wk/wujie-vue3-main/src/store/useMicroAppStore.js +0 -66
- package/app/wujie-wk/wujie-vue3-main/src/style.css +0 -3
- package/app/wujie-wk/wujie-vue3-main/src/views/home.vue +0 -103
- package/app/wujie-wk/wujie-vue3-main/src/views/router-jump.vue +0 -159
- package/app/wujie-wk/wujie-vue3-main/src/views/test.vue +0 -125
- package/app/wujie-wk/wujie-vue3-main/src/views/vue3-child-msg.vue +0 -108
- package/app/wujie-wk/wujie-vue3-main/vite.config.js +0 -12
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wujie-react-child",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc -b && vite build",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"preview": "vite preview"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@types/react-router-dom": "^5.3.3",
|
|
14
|
-
"antd": "^5.24.0",
|
|
15
|
-
"react": "^19.0.0",
|
|
16
|
-
"react-dom": "^19.0.0",
|
|
17
|
-
"react-router-dom": "^7.1.5"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@eslint/js": "^9.19.0",
|
|
21
|
-
"@types/react": "^19.0.8",
|
|
22
|
-
"@types/react-dom": "^19.0.3",
|
|
23
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
24
|
-
"eslint": "^9.19.0",
|
|
25
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
26
|
-
"eslint-plugin-react-refresh": "^0.4.18",
|
|
27
|
-
"globals": "^15.14.0",
|
|
28
|
-
"typescript": "~5.7.2",
|
|
29
|
-
"typescript-eslint": "^8.22.0",
|
|
30
|
-
"vite": "^6.1.0"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// 导入必要的依赖和样式
|
|
2
|
-
import './App.css'
|
|
3
|
-
import { BrowserRouter, Routes, Route, useNavigate } from 'react-router-dom'
|
|
4
|
-
import { Menu } from 'antd'
|
|
5
|
-
import type { MenuProps } from 'antd'
|
|
6
|
-
import { useEffect, useState } from 'react'
|
|
7
|
-
import { routes,getMenuItems } from './router/index.tsx'
|
|
8
|
-
import type { WujieRouteJumpDataT } from './types/wujie'
|
|
9
|
-
|
|
10
|
-
// 应用内容组件
|
|
11
|
-
function AppContent() {
|
|
12
|
-
// 在组件挂载时初始化无界通信
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const wujie = window.$wujie;
|
|
15
|
-
if (wujie?.bus) {
|
|
16
|
-
// 监听其他应用发起的路由跳转事件
|
|
17
|
-
wujie.bus.$on('router-jump', (data: WujieRouteJumpDataT) => {
|
|
18
|
-
if (data.app === 'react-child') {
|
|
19
|
-
// 构建带查询参数的URL并进行导航
|
|
20
|
-
const queryString = data.query ? `?${new URLSearchParams(data.query as Record<string, string>).toString()}` : '';
|
|
21
|
-
navigate(`${data.path}${queryString}`);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
// 向主应用发送加载完成事件
|
|
25
|
-
wujie.bus.$emit('loaded', 'react-child');
|
|
26
|
-
} else {
|
|
27
|
-
console.warn('无界实例未正确初始化');
|
|
28
|
-
}
|
|
29
|
-
}, []);
|
|
30
|
-
|
|
31
|
-
// 菜单当前选中项状态
|
|
32
|
-
const [current, setCurrent] = useState('home');
|
|
33
|
-
const navigate = useNavigate();
|
|
34
|
-
|
|
35
|
-
// 菜单点击事件处理
|
|
36
|
-
const onClick: MenuProps['onClick'] = (e) => {
|
|
37
|
-
setCurrent(e.key);
|
|
38
|
-
navigate(e.key === 'home' ? '/' : `/${e.key}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// 渲染导航菜单和路由内容
|
|
42
|
-
return (
|
|
43
|
-
<>
|
|
44
|
-
<Menu
|
|
45
|
-
onClick={onClick}
|
|
46
|
-
selectedKeys={[current]}
|
|
47
|
-
mode="horizontal"
|
|
48
|
-
items={getMenuItems()}
|
|
49
|
-
/>
|
|
50
|
-
<Routes>
|
|
51
|
-
{routes.map(route => (
|
|
52
|
-
<Route
|
|
53
|
-
key={route.path}
|
|
54
|
-
path={route.path}
|
|
55
|
-
element={route.element}
|
|
56
|
-
/>
|
|
57
|
-
))}
|
|
58
|
-
</Routes>
|
|
59
|
-
</>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// 根组件
|
|
64
|
-
function App() {
|
|
65
|
-
return (
|
|
66
|
-
<BrowserRouter>
|
|
67
|
-
<AppContent />
|
|
68
|
-
</BrowserRouter>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export default App
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
.feature-cards-container {
|
|
2
|
-
padding: 24px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.feature-card {
|
|
6
|
-
height: 100%;
|
|
7
|
-
border: none;
|
|
8
|
-
border-radius: 12px;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.feature-card:hover {
|
|
14
|
-
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.feature-content {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: center;
|
|
21
|
-
text-align: center;
|
|
22
|
-
color: white;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.feature-icon {
|
|
26
|
-
font-size: 2.5rem;
|
|
27
|
-
margin-bottom: 16px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.feature-content h3 {
|
|
31
|
-
margin: 0 0 8px;
|
|
32
|
-
font-size: 1.25rem;
|
|
33
|
-
font-weight: 600;
|
|
34
|
-
color: white;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.feature-content p {
|
|
38
|
-
margin: 0;
|
|
39
|
-
font-size: 0.875rem;
|
|
40
|
-
opacity: 0.9;
|
|
41
|
-
color: white;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* 覆盖 Ant Design Card 的默认样式 */
|
|
45
|
-
.feature-card .ant-card-body {
|
|
46
|
-
padding: 24px;
|
|
47
|
-
height: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* 响应式调整 */
|
|
51
|
-
@media (max-width: 768px) {
|
|
52
|
-
.feature-icon {
|
|
53
|
-
font-size: 2rem;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.feature-content h3 {
|
|
57
|
-
font-size: 1.1rem;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.feature-content p {
|
|
61
|
-
font-size: 0.8rem;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Card, Row, Col } from 'antd';
|
|
3
|
-
import { use3DCard } from '../hooks/use3DCard';
|
|
4
|
-
import {
|
|
5
|
-
AppstoreOutlined,
|
|
6
|
-
ApiOutlined,
|
|
7
|
-
DatabaseOutlined,
|
|
8
|
-
ScheduleOutlined,
|
|
9
|
-
RobotOutlined,
|
|
10
|
-
CloudServerOutlined,
|
|
11
|
-
CodeOutlined,
|
|
12
|
-
SettingOutlined
|
|
13
|
-
} from '@ant-design/icons';
|
|
14
|
-
import './FeatureCards.css';
|
|
15
|
-
|
|
16
|
-
const FeatureCards: React.FC = () => {
|
|
17
|
-
const card1Ref = use3DCard({ sensitivity: 25 });
|
|
18
|
-
const card2Ref = use3DCard({ sensitivity: 25 });
|
|
19
|
-
const card3Ref = use3DCard({ sensitivity: 25 });
|
|
20
|
-
const card4Ref = use3DCard({ sensitivity: 25 });
|
|
21
|
-
const card5Ref = use3DCard({ sensitivity: 25 });
|
|
22
|
-
const card6Ref = use3DCard({ sensitivity: 25 });
|
|
23
|
-
const card7Ref = use3DCard({ sensitivity: 25 });
|
|
24
|
-
const card8Ref = use3DCard({ sensitivity: 25 });
|
|
25
|
-
|
|
26
|
-
const features = [
|
|
27
|
-
{
|
|
28
|
-
icon: <AppstoreOutlined className="feature-icon" />,
|
|
29
|
-
title: '插件系统',
|
|
30
|
-
description: '增强机器人的能力',
|
|
31
|
-
ref: card1Ref,
|
|
32
|
-
gradient: 'linear-gradient(135deg, #FF6B6B, #FF8E53)'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
icon: <ApiOutlined className="feature-icon" />,
|
|
36
|
-
title: '工作流',
|
|
37
|
-
description: '将想法转化为机器人技能',
|
|
38
|
-
ref: card2Ref,
|
|
39
|
-
gradient: 'linear-gradient(135deg, #4ECDC4, #556270)'
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
icon: <DatabaseOutlined className="feature-icon" />,
|
|
43
|
-
title: '长期记忆',
|
|
44
|
-
description: '持久化的数据存储能力',
|
|
45
|
-
ref: card3Ref,
|
|
46
|
-
gradient: 'linear-gradient(135deg, #6C5B7B, #C06C84)'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
icon: <ScheduleOutlined className="feature-icon" />,
|
|
50
|
-
title: '定时任务',
|
|
51
|
-
description: '自动化的对话触发',
|
|
52
|
-
ref: card4Ref,
|
|
53
|
-
gradient: 'linear-gradient(135deg, #3494E6, #EC6EAD)'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
icon: <RobotOutlined className="feature-icon" />,
|
|
57
|
-
title: 'AI 助手',
|
|
58
|
-
description: '智能对话与任务处理',
|
|
59
|
-
ref: card5Ref,
|
|
60
|
-
gradient: 'linear-gradient(135deg, #11998E, #38EF7D)'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
icon: <CloudServerOutlined className="feature-icon" />,
|
|
64
|
-
title: '云端部署',
|
|
65
|
-
description: '灵活的部署选项',
|
|
66
|
-
ref: card6Ref,
|
|
67
|
-
gradient: 'linear-gradient(135deg, #F857A6, #FF5858)'
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
icon: <CodeOutlined className="feature-icon" />,
|
|
71
|
-
title: '开发工具',
|
|
72
|
-
description: '完整的开发支持',
|
|
73
|
-
ref: card7Ref,
|
|
74
|
-
gradient: 'linear-gradient(135deg, #5433FF, #20BDFF)'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
icon: <SettingOutlined className="feature-icon" />,
|
|
78
|
-
title: '系统配置',
|
|
79
|
-
description: '灵活的系统设置',
|
|
80
|
-
ref: card8Ref,
|
|
81
|
-
gradient: 'linear-gradient(135deg, #A8E063, #56AB2F)'
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<div className="feature-cards-container">
|
|
87
|
-
<Row gutter={[24, 24]}>
|
|
88
|
-
{features.map((feature, index) => (
|
|
89
|
-
<Col xs={24} sm={12} md={8} lg={6} key={index}>
|
|
90
|
-
<Card
|
|
91
|
-
ref={feature.ref}
|
|
92
|
-
className="feature-card"
|
|
93
|
-
style={{
|
|
94
|
-
background: feature.gradient,
|
|
95
|
-
transition: 'transform 0.3s ease'
|
|
96
|
-
}}
|
|
97
|
-
hoverable
|
|
98
|
-
>
|
|
99
|
-
<div className="feature-content">
|
|
100
|
-
{feature.icon}
|
|
101
|
-
<h3>{feature.title}</h3>
|
|
102
|
-
<p>{feature.description}</p>
|
|
103
|
-
</div>
|
|
104
|
-
</Card>
|
|
105
|
-
</Col>
|
|
106
|
-
))}
|
|
107
|
-
</Row>
|
|
108
|
-
</div>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export default FeatureCards;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useLightCard } from '../../hooks/useLightCard';
|
|
3
|
-
import './style.css';
|
|
4
|
-
|
|
5
|
-
const LightCard: React.FC = () => {
|
|
6
|
-
const cardRefs = [
|
|
7
|
-
useLightCard(),
|
|
8
|
-
useLightCard({ light: { color: '#ffffff', width: 100 } }),
|
|
9
|
-
useLightCard({ light: { color: '#ffeb3b', width: 80, blur: 50 } }),
|
|
10
|
-
useLightCard({ light: { color: '#4caf50', width: 70, blur: 45 } }),
|
|
11
|
-
useLightCard({ light: { color: '#2196f3', width: 90, blur: 55 } }),
|
|
12
|
-
useLightCard({ light: { color: '#9c27b0', width: 85, blur: 48 } }),
|
|
13
|
-
useLightCard({ light: { color: '#e91e63', width: 75, blur: 42 } }),
|
|
14
|
-
useLightCard({ light: { color: '#ff5722', width: 95, blur: 52 } }),
|
|
15
|
-
useLightCard({ light: { color: '#00bcd4', width: 88, blur: 47 } }),
|
|
16
|
-
useLightCard({ light: { color: '#8bc34a', width: 82, blur: 44 } }),
|
|
17
|
-
useLightCard({ light: { color: '#ffc107', width: 78, blur: 46 } }),
|
|
18
|
-
useLightCard({ light: { color: '#795548', width: 92, blur: 51 } }),
|
|
19
|
-
useLightCard({ light: { color: '#607d8b', width: 86, blur: 49 } }),
|
|
20
|
-
useLightCard({ light: { color: '#f44336', width: 73, blur: 43 } }),
|
|
21
|
-
useLightCard({ light: { color: '#009688', width: 87, blur: 50 } }),
|
|
22
|
-
useLightCard({ light: { color: '#673ab7', width: 83, blur: 45 } }),
|
|
23
|
-
useLightCard({ light: { color: '#3f51b5', width: 77, blur: 48 } }),
|
|
24
|
-
useLightCard({ light: { color: '#ff9800', width: 89, blur: 53 } })
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="light-card-container">
|
|
29
|
-
{cardRefs.map((ref, index) => (
|
|
30
|
-
<div key={index} className="light-card-item" ref={ref.cardRef}></div>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default LightCard;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.light-card-container {
|
|
2
|
-
background: black;
|
|
3
|
-
width: 100%;
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
min-height: 100vh;
|
|
6
|
-
padding: 40px;
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: repeat(6, 1fr);
|
|
9
|
-
gap: 20px;
|
|
10
|
-
justify-items: center;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.light-card-item {
|
|
14
|
-
position: relative;
|
|
15
|
-
width: 220px;
|
|
16
|
-
height: 220px;
|
|
17
|
-
background: #1c1c1f;
|
|
18
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
19
|
-
transition: transform 0.3s ease;
|
|
20
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
interface Use3DCardProps {
|
|
4
|
-
sensitivity?: number;
|
|
5
|
-
resetOnLeave?: boolean;
|
|
6
|
-
perspective?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const use3DCard = ({
|
|
10
|
-
sensitivity = 35,
|
|
11
|
-
resetOnLeave = true,
|
|
12
|
-
perspective = 1000
|
|
13
|
-
}: Use3DCardProps = {}) => {
|
|
14
|
-
const cardRef = useRef<HTMLDivElement>(null);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const card = cardRef.current;
|
|
18
|
-
if (!card) return;
|
|
19
|
-
|
|
20
|
-
const handleMouseMove = (e: MouseEvent) => {
|
|
21
|
-
const rect = card.getBoundingClientRect();
|
|
22
|
-
const centerX = rect.left + rect.width / 2;
|
|
23
|
-
const centerY = rect.top + rect.height / 2;
|
|
24
|
-
const mouseX = e.clientX;
|
|
25
|
-
const mouseY = e.clientY;
|
|
26
|
-
|
|
27
|
-
const rotateX = ((mouseY - centerY) / sensitivity) * -1;
|
|
28
|
-
const rotateY = (mouseX - centerX) / sensitivity;
|
|
29
|
-
|
|
30
|
-
card.style.transform = `perspective(${perspective}px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const handleMouseLeave = () => {
|
|
34
|
-
if (resetOnLeave) {
|
|
35
|
-
card.style.transform = 'perspective(1000px) rotateX(0) rotateY(0)';
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
card.addEventListener('mousemove', handleMouseMove);
|
|
40
|
-
if (resetOnLeave) {
|
|
41
|
-
card.addEventListener('mouseleave', handleMouseLeave);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return () => {
|
|
45
|
-
card.removeEventListener('mousemove', handleMouseMove);
|
|
46
|
-
if (resetOnLeave) {
|
|
47
|
-
card.removeEventListener('mouseleave', handleMouseLeave);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}, [sensitivity, resetOnLeave, perspective]);
|
|
51
|
-
|
|
52
|
-
return cardRef;
|
|
53
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 光效卡片配置接口
|
|
5
|
-
* @interface LightOptions
|
|
6
|
-
* @property {Object} light - 光效相关配置
|
|
7
|
-
* @property {number} light.width - 光效宽度(像素)
|
|
8
|
-
* @property {number} light.height - 光效高度(像素)
|
|
9
|
-
* @property {string} light.color - 光效颜色
|
|
10
|
-
* @property {number} light.blur - 模糊程度(像素)
|
|
11
|
-
*/
|
|
12
|
-
interface LightOptions {
|
|
13
|
-
light?: {
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
color?: string;
|
|
17
|
-
blur?: number;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 光效卡片Hook
|
|
23
|
-
* 实现鼠标悬停时的光效和3D旋转效果
|
|
24
|
-
* @param {LightOptions} options - 光效配置选项
|
|
25
|
-
* @returns {Object} 返回包含cardRef的对象,用于绑定到DOM元素
|
|
26
|
-
*/
|
|
27
|
-
export const useLightCard = (options: LightOptions = {}) => {
|
|
28
|
-
// 卡片DOM引用
|
|
29
|
-
const cardRef = useRef<HTMLDivElement>(null);
|
|
30
|
-
// 光效DOM引用
|
|
31
|
-
const lightRef = useRef<HTMLDivElement | null>(null);
|
|
32
|
-
// 保存卡片原始overflow样式
|
|
33
|
-
let cardOverflow = '';
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
// 创建光效元素
|
|
37
|
-
lightRef.current = document.createElement('div');
|
|
38
|
-
// 解构配置参数,设置默认值
|
|
39
|
-
const { width = 60, height = 60, color = '#ff4132', blur = 40 } = options.light ?? {};
|
|
40
|
-
|
|
41
|
-
// 设置光效元素样式
|
|
42
|
-
if (lightRef.current) {
|
|
43
|
-
lightRef.current.style.position = 'absolute';
|
|
44
|
-
lightRef.current.style.width = `${width}px`;
|
|
45
|
-
lightRef.current.style.height = `${height}px`;
|
|
46
|
-
lightRef.current.style.background = color;
|
|
47
|
-
lightRef.current.style.filter = `blur(${blur}px)`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 设置卡片overflow为hidden,防止光效溢出
|
|
51
|
-
const setCardOverflowHidden = () => {
|
|
52
|
-
if (cardRef.current) {
|
|
53
|
-
cardOverflow = cardRef.current.style.overflow;
|
|
54
|
-
cardRef.current.style.overflow = 'hidden';
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// 恢复卡片原始overflow样式
|
|
59
|
-
const restoreCardOverflow = () => {
|
|
60
|
-
if (cardRef.current) {
|
|
61
|
-
cardRef.current.style.overflow = cardOverflow;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// 添加光效元素到卡片
|
|
66
|
-
const addLight = () => {
|
|
67
|
-
if (cardRef.current && lightRef.current) {
|
|
68
|
-
cardRef.current.appendChild(lightRef.current);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// 从卡片移除光效元素
|
|
73
|
-
const removeLight = () => {
|
|
74
|
-
if (cardRef.current && lightRef.current) {
|
|
75
|
-
cardRef.current.removeChild(lightRef.current);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// 鼠标进入事件处理
|
|
80
|
-
const handleMouseEnter = () => {
|
|
81
|
-
addLight();
|
|
82
|
-
setCardOverflowHidden();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// 鼠标移动事件处理
|
|
86
|
-
const handleMouseMove = (e: MouseEvent) => {
|
|
87
|
-
const { clientX, clientY } = e;
|
|
88
|
-
if (cardRef.current && lightRef.current) {
|
|
89
|
-
// 获取卡片和光效元素的位置信息
|
|
90
|
-
const { x, y } = cardRef.current.getBoundingClientRect();
|
|
91
|
-
const { width, height } = lightRef.current.getBoundingClientRect();
|
|
92
|
-
|
|
93
|
-
// 更新光效元素位置,跟随鼠标移动
|
|
94
|
-
lightRef.current.style.left = `${clientX - x - width / 2}px`;
|
|
95
|
-
lightRef.current.style.top = `${clientY - y - height / 2}px`;
|
|
96
|
-
|
|
97
|
-
// 3D旋转效果参数
|
|
98
|
-
const maxXRotation = 10; // 最大X轴旋转角度
|
|
99
|
-
const maxYRotation = 10; // 最大Y轴旋转角度
|
|
100
|
-
const rangeX = 200 / 2; // X轴旋转范围
|
|
101
|
-
const rangeY = 200 / 2; // Y轴旋转范围
|
|
102
|
-
|
|
103
|
-
// 计算旋转角度
|
|
104
|
-
const rotateX = ((clientX - x - rangeY) / rangeY) * maxXRotation;
|
|
105
|
-
const rotateY = -1 * ((clientY - y - rangeX) / rangeX) * maxYRotation;
|
|
106
|
-
|
|
107
|
-
// 应用3D变换
|
|
108
|
-
cardRef.current.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// 鼠标离开事件处理
|
|
113
|
-
const handleMouseLeave = () => {
|
|
114
|
-
removeLight();
|
|
115
|
-
restoreCardOverflow();
|
|
116
|
-
if (cardRef.current) {
|
|
117
|
-
// 重置3D变换
|
|
118
|
-
cardRef.current.style.transform = 'perspective(1000px) rotateX(0deg) rotateY(0deg)';
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// 绑定事件监听
|
|
123
|
-
const card = cardRef.current;
|
|
124
|
-
if (card) {
|
|
125
|
-
card.addEventListener('mouseenter', handleMouseEnter);
|
|
126
|
-
card.addEventListener('mousemove', handleMouseMove);
|
|
127
|
-
card.addEventListener('mouseleave', handleMouseLeave);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// 清理函数:移除事件监听
|
|
131
|
-
return () => {
|
|
132
|
-
if (card) {
|
|
133
|
-
card.removeEventListener('mouseenter', handleMouseEnter);
|
|
134
|
-
card.removeEventListener('mousemove', handleMouseMove);
|
|
135
|
-
card.removeEventListener('mouseleave', handleMouseLeave);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
}, [options.light]); // 依赖项:当light配置变化时重新执行
|
|
139
|
-
|
|
140
|
-
return { cardRef };
|
|
141
|
-
};
|
|
File without changes
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.child-to-parent {
|
|
2
|
-
padding: 20px;
|
|
3
|
-
max-width: 600px;
|
|
4
|
-
margin: 0 auto;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.child-to-parent h1 {
|
|
8
|
-
color: #333;
|
|
9
|
-
margin-bottom: 30px;
|
|
10
|
-
text-align: center;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.form-container {
|
|
14
|
-
background: #fff;
|
|
15
|
-
padding: 24px;
|
|
16
|
-
border-radius: 8px;
|
|
17
|
-
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* 自定义Ant Design组件样式 */
|
|
21
|
-
.form-container .ant-form-item-label > label {
|
|
22
|
-
color: #606266;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.form-container .ant-input,
|
|
26
|
-
.form-container .ant-select-selector,
|
|
27
|
-
.form-container .ant-input-number {
|
|
28
|
-
height: 36px;
|
|
29
|
-
border: 1px solid #dcdfe6;
|
|
30
|
-
border-radius: 4px;
|
|
31
|
-
transition: border-color 0.2s;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.form-container .ant-input:focus,
|
|
35
|
-
.form-container .ant-select-selector:focus,
|
|
36
|
-
.form-container .ant-input-number:focus {
|
|
37
|
-
border-color: #409eff;
|
|
38
|
-
box-shadow: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.form-container .ant-btn-primary {
|
|
42
|
-
height: 40px;
|
|
43
|
-
background-color: #409eff;
|
|
44
|
-
border: none;
|
|
45
|
-
border-radius: 4px;
|
|
46
|
-
transition: background-color 0.3s;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.form-container .ant-btn-primary:hover {
|
|
50
|
-
background-color: #66b1ff;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.form-container .ant-btn-primary:active {
|
|
54
|
-
background-color: #3a8ee6;
|
|
55
|
-
}
|