npmapps 1.0.21 → 1.0.23
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/app/Wscats.vue-1.0.26.vsix +0 -0
- package/app/febean.vue-format-0.1.8.vsix +0 -0
- package/app/wujie-vue3-child/.claude/settings.local.json +8 -0
- package/app/wujie-vue3-child/.vscode/extensions.json +3 -0
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +427 -0
- package/app/wujie-vue3-child/README.md +5 -0
- package/app/wujie-vue3-child/index.html +13 -0
- package/app/wujie-vue3-child/package-lock.json +5744 -0
- package/app/wujie-vue3-child/package.json +28 -0
- package/app/wujie-vue3-child/public/vite.svg +1 -0
- package/app/wujie-vue3-child/src/App.vue +130 -0
- package/app/wujie-vue3-child/src/assets/vue.svg +1 -0
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +43 -0
- package/app/wujie-vue3-child/src/components/tags-view.vue +193 -0
- package/app/wujie-vue3-child/src/components/tags-view1.vue +131 -0
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +11 -0
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +28 -0
- package/app/wujie-vue3-child/src/main.js +15 -0
- package/app/wujie-vue3-child/src/router/index.js +104 -0
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +34 -0
- package/app/wujie-vue3-child/src/style.css +4 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +836 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +728 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +687 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +560 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +570 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +330 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +378 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +228 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +399 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +252 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +585 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +331 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +392 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +39 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +248 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +194 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +1459 -0
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +301 -0
- package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.jsx +28 -4
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +32 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +121 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +76 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +104 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +75 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +12 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +62 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +43 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +29 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +5 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +58 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +85 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +92 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +56 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +40 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +53 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +106 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +132 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +176 -0
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +96 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +162 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +16 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +29 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +25 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +106 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +164 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +182 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +203 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +145 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +126 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +67 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +105 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +81 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +47 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +64 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +85 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +39 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +44 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +83 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +101 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +50 -0
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +25 -0
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +117 -0
- package/app/wujie-vue3-child/src/views/home.vue +53 -0
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +169 -0
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +69 -0
- package/app/wujie-vue3-child/src/views/jsx/com.vue +44 -0
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +66 -0
- package/app/wujie-vue3-child/src/views/jsx/index.vue +72 -0
- package/app/wujie-vue3-child/src/views/jsx/props.vue +33 -0
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +225 -0
- package/app/wujie-vue3-child/src/views/phone-code.vue +318 -0
- package/app/wujie-vue3-child/src/views/router-jump.vue +123 -0
- package/app/wujie-vue3-child/src/views/test.vue +192 -0
- package/app/wujie-vue3-child/vite.config.js +15 -0
- package/package.json +1 -1
- package/app/aiCoach/index.jsx +0 -20
- package/npmapps-1.0.20.tgz +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.module.scss +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.jsx +0 -0
- /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.module.scss +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
# 项目记忆文件 - wujie-vue3-child
|
|
2
|
+
|
|
3
|
+
## 项目概述
|
|
4
|
+
|
|
5
|
+
**项目名称**: wujie-vue3-child
|
|
6
|
+
**项目类型**: Vue 3 微前端子应用
|
|
7
|
+
**构建工具**: Vite 6.0.5
|
|
8
|
+
**开发端口**: 3001
|
|
9
|
+
|
|
10
|
+
这是一个基于 Vue3 + Vite 的微前端子应用,使用无界(wujie)框架集成到主应用中。项目采用现代化技术栈,实现了智能教练业务系统。
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 核心技术栈
|
|
15
|
+
|
|
16
|
+
### 框架与构建
|
|
17
|
+
- **Vue 3.5.13** - Composition API
|
|
18
|
+
- **Vite 6.0.5** - 现代化构建工具
|
|
19
|
+
- **Vue Router 4.5.0** - 路由管理
|
|
20
|
+
- **Pinia 2.3.0** - 状态管理
|
|
21
|
+
- **Element Plus 2.9.1** - UI 组件库
|
|
22
|
+
|
|
23
|
+
### 工具库
|
|
24
|
+
- **ECharts 6.0.0** - 数据可视化
|
|
25
|
+
- **Day.js 1.11.13** - 日期处理
|
|
26
|
+
- **Lodash 4.17.21** - 工具函数
|
|
27
|
+
- **vuedraggable 4.1.0** - 拖拽功能
|
|
28
|
+
- **Sass 1.83.0** - CSS 预处理器
|
|
29
|
+
|
|
30
|
+
### 特色能力
|
|
31
|
+
- **JSX 支持** - 通过 @vitejs/plugin-vue-jsx
|
|
32
|
+
- **CSS Modules** - 样式模块化隔离
|
|
33
|
+
- **微前端通信** - 基于 wujie 事件总线
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 项目结构
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
src/
|
|
41
|
+
├── assets/ # 资源文件
|
|
42
|
+
├── components/ # 公共组件
|
|
43
|
+
│ └── tags-view.vue # 标签页管理(可拖拽)
|
|
44
|
+
├── hooks/ # 组合式 API 钩子
|
|
45
|
+
│ ├── useClickOutside.js # 点击外部检测
|
|
46
|
+
│ └── useTableDragSort.js # 表格拖拽排序
|
|
47
|
+
├── router/ # 路由配置
|
|
48
|
+
├── store/ # Pinia 状态管理
|
|
49
|
+
│ └── tagsViewStroe.js # 标签页状态
|
|
50
|
+
├── views/ # 页面视图
|
|
51
|
+
│ ├── aiCoach/ # 🎯 智能教练核心模块
|
|
52
|
+
│ │ ├── collapseExpand/ # 可拖拽折叠列表
|
|
53
|
+
│ │ ├── dialogueSegment/ # 对话环节管理
|
|
54
|
+
│ │ ├── practiceStatus/ # 练习情况统计
|
|
55
|
+
│ │ │ └── components/ # 细粒度组件
|
|
56
|
+
│ │ │ ├── ChartsPanel/ # 图表面板
|
|
57
|
+
│ │ │ ├── DonutChart/ # 环形图
|
|
58
|
+
│ │ │ ├── echarts/ # ECharts 图表
|
|
59
|
+
│ │ │ ├── PracticeTable/ # 练习表格
|
|
60
|
+
│ │ │ ├── RankingList/ # 排名列表
|
|
61
|
+
│ │ │ └── StatCardsRow/ # 统计卡片
|
|
62
|
+
│ │ ├── reportDetail/ # ✨ 报告详情(新增)
|
|
63
|
+
│ │ │ ├── components/
|
|
64
|
+
│ │ │ │ ├── ScoreBadge/ # 分数徽章
|
|
65
|
+
│ │ │ │ ├── ReportHeader/ # 报告头部
|
|
66
|
+
│ │ │ │ ├── DimensionScores/ # 维度评分
|
|
67
|
+
│ │ │ │ ├── ComprehensiveEvaluation/ # 综合评价
|
|
68
|
+
│ │ │ │ ├── RoleInfo/ # 角色信息
|
|
69
|
+
│ │ │ │ ├── DialogueBubble/ # 对话气泡
|
|
70
|
+
│ │ │ │ ├── SubDimensionItem/ # 子维度项
|
|
71
|
+
│ │ │ │ └── DimensionDetail/ # 维度详情
|
|
72
|
+
│ │ │ ├── index.jsx
|
|
73
|
+
│ │ │ └── index.module.scss
|
|
74
|
+
│ │ └── scriptTable/ # 脚本表格
|
|
75
|
+
│ ├── jsx/ # JSX 示例
|
|
76
|
+
│ ├── child-to-parent.vue # 子→父通信
|
|
77
|
+
│ ├── parent-to-child.vue # 父→子通信
|
|
78
|
+
│ ├── router-jump.vue # 路由跳转
|
|
79
|
+
│ ├── phone-code.vue # 验证码组件
|
|
80
|
+
│ └── home.vue # 首页
|
|
81
|
+
├── App.vue
|
|
82
|
+
└── main.js
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 核心功能模块
|
|
88
|
+
|
|
89
|
+
### 1. 智能教练 (aiCoach)
|
|
90
|
+
|
|
91
|
+
**入口**: `/ai-coach`
|
|
92
|
+
**文件**: `src/views/aiCoach/index.jsx`
|
|
93
|
+
|
|
94
|
+
#### 对话环节 (dialogueSegment)
|
|
95
|
+
- 管理多个对话环节,每个环节包含:
|
|
96
|
+
- 环节标题和目标描述
|
|
97
|
+
- 问答脚本 (qaScripts)
|
|
98
|
+
- 主动脚本 (proactiveScript)
|
|
99
|
+
- 支持拖拽排序、添加/删除、AI 生成话术
|
|
100
|
+
|
|
101
|
+
#### 练习情况 (practiceStatus)
|
|
102
|
+
**计划统计标签页**:
|
|
103
|
+
- 6 个统计卡片:总学员、完成率、平均练习次数等
|
|
104
|
+
- 进度环形图 + 时长/分数排名图
|
|
105
|
+
- 学员练习明细表格(分页)
|
|
106
|
+
- 支持部门和职务筛选
|
|
107
|
+
|
|
108
|
+
**剧本统计标签页**:
|
|
109
|
+
- 展示剧本相关统计
|
|
110
|
+
|
|
111
|
+
**技术特点**:
|
|
112
|
+
- 同时支持 CSS 和 ECharts 两种图表渲染方式
|
|
113
|
+
- 高度模块化组件设计,每个 UI 区块对应一个组件
|
|
114
|
+
- 使用 CSS Modules 实现样式隔离
|
|
115
|
+
|
|
116
|
+
#### 报告详情 (reportDetail) ✨ 新增
|
|
117
|
+
|
|
118
|
+
**入口**: `/ai-coach` → "报告详情" 标签页
|
|
119
|
+
**文件**: `src/views/aiCoach/reportDetail/index.jsx`
|
|
120
|
+
|
|
121
|
+
**页面结构**(垂直滚动布局):
|
|
122
|
+
|
|
123
|
+
1. **报告头部区域**:
|
|
124
|
+
- 左侧:报告标题、时间、轮次、时长
|
|
125
|
+
- 右侧:六边形分数徽章(显示得分和达标状态)
|
|
126
|
+
- 支持"中途退出"标签显示
|
|
127
|
+
|
|
128
|
+
2. **总览区域**(左右两栏):
|
|
129
|
+
- 左侧:陪练报告
|
|
130
|
+
- 5个维度评分进度条(话术准确度、语言组织、需求倾听记录、产品介绍解答、产品推荐促成)
|
|
131
|
+
- 进度条颜色根据得分自动分级(绿色/橙色/红色)
|
|
132
|
+
- 底部显示"0分-通过-满分"标注
|
|
133
|
+
- 陪练角色信息卡片
|
|
134
|
+
- 右侧:综合评价文字
|
|
135
|
+
|
|
136
|
+
3. **话术准确度详情**:
|
|
137
|
+
- 维度标题栏(icon + 名称 + 得分)
|
|
138
|
+
- 高分话术示例
|
|
139
|
+
- 对话气泡(客户问题 + AI回答)
|
|
140
|
+
- 得分卡片:
|
|
141
|
+
- 总分显示(带表情)
|
|
142
|
+
- 得分明细(关键词、语义准确等)
|
|
143
|
+
- 关键词标签展示
|
|
144
|
+
- 指导建议
|
|
145
|
+
|
|
146
|
+
4. **语言组织详情**:
|
|
147
|
+
- 维度标题栏
|
|
148
|
+
- 说明文字
|
|
149
|
+
- 3个子维度评分:
|
|
150
|
+
- 易于理解(进度条 + 评价)
|
|
151
|
+
- 逻辑性(进度条 + 评价)
|
|
152
|
+
- 亲和力(进度条 + 评价)
|
|
153
|
+
|
|
154
|
+
**组件列表**(8个子组件):
|
|
155
|
+
- `ScoreBadge` - 六边形分数徽章,支持达标/未达标状态
|
|
156
|
+
- `ReportHeader` - 报告头部,橙色渐变背景
|
|
157
|
+
- `DimensionScores` - 维度评分进度条列表
|
|
158
|
+
- `ComprehensiveEvaluation` - 综合评价文字区域
|
|
159
|
+
- `RoleInfo` - 陪练角色信息卡片
|
|
160
|
+
- `DialogueBubble` - 对话气泡(含得分卡片)
|
|
161
|
+
- `SubDimensionItem` - 子维度评分项
|
|
162
|
+
- `DimensionDetail` - 维度详情容器(支持对话和子维度两种类型)
|
|
163
|
+
|
|
164
|
+
**数据结构**:
|
|
165
|
+
```javascript
|
|
166
|
+
// 头部数据
|
|
167
|
+
{ title, isQuit, practiceTime, rounds, duration, score, isPassed }
|
|
168
|
+
|
|
169
|
+
// 维度数据
|
|
170
|
+
{ name, score, total, color } // color: green|orange|red
|
|
171
|
+
|
|
172
|
+
// 对话数据
|
|
173
|
+
{ question, answer, score }
|
|
174
|
+
|
|
175
|
+
// 子维度数据
|
|
176
|
+
{ name, score, total, comment }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**设计特点**:
|
|
180
|
+
- 完整还原UI设计,垂直滚动布局
|
|
181
|
+
- 所有组件使用 CSS Modules 样式隔离
|
|
182
|
+
- 完整的模拟数据,方便开发和调试
|
|
183
|
+
- 高度组件化,易于复用和维护
|
|
184
|
+
|
|
185
|
+
### 2. 微前端通信
|
|
186
|
+
|
|
187
|
+
#### 全局事件总线
|
|
188
|
+
```javascript
|
|
189
|
+
window.$wujie?.bus
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### 通信方式
|
|
193
|
+
1. **子→父通信**: `$emit('child-event', data)`
|
|
194
|
+
2. **父→子通信**: `$on('vue3-child-message', callback)`
|
|
195
|
+
3. **跨应用路由跳转**: `$emit('router-jump', { app, path, query })`
|
|
196
|
+
|
|
197
|
+
### 3. 其他功能
|
|
198
|
+
- **标签页管理**: 可拖拽的多标签页系统
|
|
199
|
+
- **验证码输入**: 6 位验证码组件,支持自动跳转
|
|
200
|
+
- **JSX 示例**: 按钮下拉框、对话框等
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 路由配置
|
|
205
|
+
|
|
206
|
+
| 路径 | 名称 | 组件 | 说明 |
|
|
207
|
+
|------|------|------|------|
|
|
208
|
+
| `/` | home | Home | 首页 |
|
|
209
|
+
| `/contact/child-to-parent` | child-to-parent | ChildToParent | 子通知父 |
|
|
210
|
+
| `/contact/parent-to-child` | parent-to-child | ParentToChild | 父通知子 |
|
|
211
|
+
| `/phone-code` | phone-code | PhoneCode | 验证码 |
|
|
212
|
+
| `/router-jump` | router-jump | RouterJump | 路由跳转 |
|
|
213
|
+
| `/jsx` | jsx | index.vue | JSX示例 |
|
|
214
|
+
| `/ai-coach` | ai-coach | index.jsx | 智能教练 |
|
|
215
|
+
| `/test` | test | Test | 测试页面 |
|
|
216
|
+
|
|
217
|
+
**路由模式**: History 模式
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 状态管理
|
|
222
|
+
|
|
223
|
+
### tagsViewStore
|
|
224
|
+
|
|
225
|
+
**文件**: `src/store/tagsViewStroe.js`
|
|
226
|
+
|
|
227
|
+
**State**:
|
|
228
|
+
- `tagsViewList`: 标签页列表
|
|
229
|
+
|
|
230
|
+
**Actions**:
|
|
231
|
+
- `addTagsView(tag)` - 添加标签页
|
|
232
|
+
- `removeTagsView(tag)` - 移除标签页
|
|
233
|
+
- `removeOtherTagsView(tag)` - 移除其他标签页
|
|
234
|
+
- `clearTagsView()` - 清空所有标签页
|
|
235
|
+
- `setTagsViewList(tagsList)` - 设置标签页列表
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 核心组件
|
|
240
|
+
|
|
241
|
+
### 1. tags-view.vue
|
|
242
|
+
**路径**: `src/components/tags-view.vue`
|
|
243
|
+
|
|
244
|
+
**功能**:
|
|
245
|
+
- 标签页视图管理
|
|
246
|
+
- 使用 vuedraggable 实现拖拽排序
|
|
247
|
+
- 支持右键菜单(关闭标签/关闭其他/关闭所有)
|
|
248
|
+
- 监听路由变化自动添加标签
|
|
249
|
+
- 使用 lodash throttle 优化性能
|
|
250
|
+
|
|
251
|
+
### 2. CollapseExpand
|
|
252
|
+
**路径**: `src/views/aiCoach/collapseExpand/index.jsx`
|
|
253
|
+
|
|
254
|
+
**功能**:
|
|
255
|
+
- 可拖拽的折叠展开列表组件
|
|
256
|
+
- 基于 Element Plus el-collapse 封装
|
|
257
|
+
- 支持自定义标题和内容插槽
|
|
258
|
+
- 支持删除操作(带确认)
|
|
259
|
+
|
|
260
|
+
### 3. ScriptTable
|
|
261
|
+
**路径**: `src/views/aiCoach/scriptTable/index.jsx`
|
|
262
|
+
|
|
263
|
+
**功能**:
|
|
264
|
+
- 脚本表格组件
|
|
265
|
+
- 支持问答脚本和主动脚本切换
|
|
266
|
+
- 使用 Sortable.js 实现表格行拖拽排序
|
|
267
|
+
- 包含 InputColumn 子组件用于单元格编辑
|
|
268
|
+
|
|
269
|
+
### 4. PracticeStatus 组件群
|
|
270
|
+
**路径**: `src/views/aiCoach/practiceStatus/components/`
|
|
271
|
+
|
|
272
|
+
**设计原则**: 高度模块化,单一职责
|
|
273
|
+
|
|
274
|
+
**组件列表**:
|
|
275
|
+
- `StatCardsRow` - 统计卡片行
|
|
276
|
+
- `ChartsPanel` - 图表面板容器
|
|
277
|
+
- `DonutChart` / `EchartsDonut` - 环形图(CSS/ECharts双实现)
|
|
278
|
+
- `RankBarChart` / `EchartsRankBar` - 排名柱状图(CSS/ECharts双实现)
|
|
279
|
+
- `RankingGroup` - 排名组容器
|
|
280
|
+
- `RankingList` - 排名列表
|
|
281
|
+
- `PracticeTable` - 练习明细表格
|
|
282
|
+
- `ScriptStatsPanel` - 剧本统计面板
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 自定义 Hooks
|
|
287
|
+
|
|
288
|
+
### useClickOutside
|
|
289
|
+
**路径**: `src/hooks/useClickOutside.js`
|
|
290
|
+
|
|
291
|
+
**功能**: 检测点击元素外部区域
|
|
292
|
+
|
|
293
|
+
**参数**:
|
|
294
|
+
- `elRef` - 目标元素引用
|
|
295
|
+
- `handler` - 点击外部时的回调函数
|
|
296
|
+
|
|
297
|
+
**特点**: 自动管理事件监听器的添加和移除
|
|
298
|
+
|
|
299
|
+
### useTableDragSort
|
|
300
|
+
**路径**: `src/hooks/useTableDragSort.js`
|
|
301
|
+
|
|
302
|
+
**功能**: Element Plus 表格拖拽排序
|
|
303
|
+
|
|
304
|
+
**特点**:
|
|
305
|
+
- 基于 Sortable.js 封装
|
|
306
|
+
- 支持指定拖拽手柄
|
|
307
|
+
- 自动管理实例销毁
|
|
308
|
+
- 响应式数据同步
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 代码组织方式
|
|
313
|
+
|
|
314
|
+
### 组件编写风格
|
|
315
|
+
- **SFC (`.vue`)**: 简单页面和表单类组件,使用 `<script setup>`
|
|
316
|
+
- **JSX (`.jsx`)**: 复杂动态组件和条件渲染多的组件
|
|
317
|
+
|
|
318
|
+
### 样式组织
|
|
319
|
+
- **全局样式**: `src/style.css`(极简,仅重置)
|
|
320
|
+
- **SFC组件**: 使用 `<style scoped>`
|
|
321
|
+
- **JSX组件**: 使用 CSS Modules (`.module.scss`)
|
|
322
|
+
|
|
323
|
+
### 模块化设计
|
|
324
|
+
- 按功能模块划分目录
|
|
325
|
+
- 单一职责原则:每个组件只负责一个 UI 区块
|
|
326
|
+
- 通用组件放在 `components/`,业务组件放在 `views/` 对应模块下
|
|
327
|
+
|
|
328
|
+
### 数据流
|
|
329
|
+
- **Props Down, Events Up** 原则
|
|
330
|
+
- 使用 Pinia 管理跨组件状态
|
|
331
|
+
- 父组件准备数据,子组件通过 props 接收
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 技术亮点
|
|
336
|
+
|
|
337
|
+
1. ✅ **Vue3 Composition API** - 全面使用组合式 API
|
|
338
|
+
2. ✅ **JSX 支持** - 复杂组件使用 JSX 提高开发效率
|
|
339
|
+
3. ✅ **CSS Modules** - 样式模块化和命名空间隔离
|
|
340
|
+
4. ✅ **拖拽功能** - vuedraggable + Sortable.js
|
|
341
|
+
5. ✅ **微前端通信** - 基于 wujie 事件总线
|
|
342
|
+
6. ✅ **图表双模式** - 同时支持 CSS 和 ECharts
|
|
343
|
+
7. ✅ **组件化设计** - 高度模块化,职责清晰
|
|
344
|
+
8. ✅ **自定义 Hooks** - 封装可复用的组合式逻辑
|
|
345
|
+
9. ✅ **Pinia 状态管理** - Vue3 官方推荐方案
|
|
346
|
+
10. ✅ **Element Plus** - 成熟 UI 组件库
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 最近更新
|
|
351
|
+
|
|
352
|
+
根据 Git 提交记录:
|
|
353
|
+
|
|
354
|
+
1. **重构练习状态页面** - 将组件拆分为独立模块
|
|
355
|
+
2. **支持隐藏图例** - 优化图表按钮样式
|
|
356
|
+
3. **调整环形图** - 半径和标签显示样式优化
|
|
357
|
+
4. **添加 ECharts 图表** - 支持切换显示
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## 关键文件路径
|
|
362
|
+
|
|
363
|
+
**配置文件**:
|
|
364
|
+
- `package.json` - 项目依赖配置
|
|
365
|
+
- `vite.config.js` - Vite 构建配置
|
|
366
|
+
- `index.html` - HTML 入口
|
|
367
|
+
|
|
368
|
+
**核心文件**:
|
|
369
|
+
- `src/main.js` - 应用入口
|
|
370
|
+
- `src/App.vue` - 根组件
|
|
371
|
+
- `src/router/index.js` - 路由配置
|
|
372
|
+
- `src/store/tagsViewStroe.js` - 状态管理
|
|
373
|
+
|
|
374
|
+
**核心业务**:
|
|
375
|
+
- `src/views/aiCoach/index.jsx` - 智能教练主入口
|
|
376
|
+
- `src/views/aiCoach/dialogueSegment/index.jsx` - 对话环节
|
|
377
|
+
- `src/views/aiCoach/practiceStatus/index.jsx` - 练习情况
|
|
378
|
+
|
|
379
|
+
**公共组件**:
|
|
380
|
+
- `src/components/tags-view.vue` - 标签页管理
|
|
381
|
+
- `src/hooks/useClickOutside.js` - 点击外部检测
|
|
382
|
+
- `src/hooks/useTableDragSort.js` - 表格拖拽
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 开发建议
|
|
387
|
+
|
|
388
|
+
### 添加新功能时
|
|
389
|
+
1. 确定功能属于哪个模块,放在对应的 `views/` 子目录
|
|
390
|
+
2. 如果是复杂的动态组件,考虑使用 JSX
|
|
391
|
+
3. 如果组件较复杂,拆分为多个子组件,放在 `components/` 子目录
|
|
392
|
+
4. 使用 CSS Modules 避免样式冲突
|
|
393
|
+
5. 跨组件状态考虑在 `store/` 中添加新的 store
|
|
394
|
+
|
|
395
|
+
### 组件设计原则
|
|
396
|
+
- **单一职责**: 每个组件只负责一个功能
|
|
397
|
+
- **Props 类型定义**: 使用 PropTypes 或 TypeScript 定义 props
|
|
398
|
+
- **事件命名**: 使用 kebab-case,如 `update:modelValue`
|
|
399
|
+
- **样式隔离**: JSX 组件使用 CSS Modules,SFC 使用 scoped
|
|
400
|
+
|
|
401
|
+
### 性能优化
|
|
402
|
+
- 列表渲染使用 `:key`
|
|
403
|
+
- 大数据表格考虑虚拟滚动
|
|
404
|
+
- 复杂计算使用 `computed`
|
|
405
|
+
- 防抖节流使用 lodash 的 `debounce` / `throttle`
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## 常见问题
|
|
410
|
+
|
|
411
|
+
### 微前端通信不生效
|
|
412
|
+
检查 `window.$wujie` 是否存在,确保在主应用中正确加载子应用
|
|
413
|
+
|
|
414
|
+
### 拖拽功能异常
|
|
415
|
+
检查是否正确引入 `vuedraggable` 和 `Sortable.js`,确保数据使用 `v-model` 双向绑定
|
|
416
|
+
|
|
417
|
+
### 路由跳转 404
|
|
418
|
+
确认路由配置中的 path 和 name 正确,检查是否使用 History 模式
|
|
419
|
+
|
|
420
|
+
### 样式不生效
|
|
421
|
+
- SFC: 检查是否添加 `scoped` 属性
|
|
422
|
+
- JSX: 检查 CSS Modules 导入和类名使用是否正确
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
**最后更新**: 2026-01-10
|
|
427
|
+
**维护者**: AI Assistant
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Vue 3 + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + Vue</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.js"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|