Browse Source

fix(web): 孩子管理改名为成员管理(全部显示文案)+ 确认表格自然高度

用户诉求:孩子管理应改为"成员管理"(全部地方);孩子管理表格显示高度问题。

改名(只改显示文案,路由path=/children、组件名Children、权限标识family:children均不变):
- FamilyWorkbench.vue 工作台导航按钮/模块映射/注释(4处)
- Layout.vue 侧边菜单 label(1处)
- router/index.js 路由 meta.title(1处)
- Children.vue PageHeader title(1处)
- api/admin.js 注释(1处)
- sixState契约测试的文案描述(2处,断言逻辑activeModule==children不变)

高度:ChildrenPanel表格上一轮已去掉height=100%(table-full=width:100%无高度限制),
RED契约「ChildrenPanel表格无height限制」验证✓通过,确认已正常显示全。

TDD:新增契约「工作台显示成员管理而非孩子管理」+「ChildrenPanel无高度限制」;
RED前者失败后者通过→GREEN两项全部通过。(契约文件其余4个历史RED用例与本次无关)

部署:前端app.797d984b.js;admin/cart/new-chunk 200。
Xiaogang Liao 5 hours ago
parent
commit
52c7f0c94d

+ 14 - 0
cfc-web/src/__tests__/views/FamilyWorkbench.workbenchRedesign.contract.spec.js

@@ -226,3 +226,17 @@ describe('admin.family.workbenchRedesign 契约(TDD RED:实现未落地)',
       expect(src.includes('wb-table-wrap')).toBe(true)
     })
   })
+
+
+  describe('§修复: 孩子管理改名为成员管理 + 表格自然高度', () => {
+    it('工作台导航与模块映射显示「成员管理」而非「孩子管理」', () => {
+      const src = readFileSync(resolve(__dirname, '../../../src/views/FamilyWorkbench.vue'), 'utf8')
+      expect(src.includes('成员管理')).toBe(true)
+      expect(src.includes('孩子管理')).toBe(false)
+    })
+    it('ChildrenPanel 表格无 height 限制(自然高度显示全)', () => {
+      const src = readFileSync(resolve(__dirname, '../../../src/views/admin/ChildrenPanel.vue'), 'utf8')
+      expect(src.includes('height="100%"')).toBe(false)
+      expect(src.includes('max-height')).toBe(false)
+    })
+  })

+ 2 - 2
cfc-web/src/__tests__/views/FamilyWorkbench.workbenchRedesign.sixState.contract.spec.js

@@ -8,7 +8,7 @@ import { getFamilyTasks, getFamilyOverview, getFamilyMemberList, proxyParseRepor
 //   §1 方向声明(方向 A · 左竖向导航工作台)、§7 IA(新增管理能力 + 信息架构重组)
 // 溯源·设计:同文档 §6.2 导航角标(6px 圆点、非数字红点)、§6.3 面板错误态「不清空已渲染表格」、
 //   §6.4 表单抽屉「校验错误就近字段下方,不弹全局 message」、§6.6 指标曲线面积渐变到 rgba(11,95,204,0.08)、
-//   §7.1 模块清单①孩子管理为首项、§8 五态定义
+//   §7.1 模块清单①成员管理为首项、§8 五态定义
 // 风格参照:cfc-web/src/views/admin/review/__tests__/ActivityAudit.spec.js
 //   (@vue/test-utils shallowMount + ElementUI stubs + jest.mock API,纯组件级无后端依赖)
 // 说明:本套件只断言契约行为,不修改任何 src/main 实现;当前实现未完整覆盖,预期失败(红)。
@@ -104,7 +104,7 @@ describe('admin.family.workbenchRedesign §6/§7/§8 契约(TDD RED:预期
   })
 
   describe('§7.1 / §10 单一导航轴', () => {
-    it('默认选中 §7.1 清单首项「孩子管理」,而非中间的报告', async () => {
+    it('默认选中 §7.1 清单首项「成员管理」,而非中间的报告', async () => {
       const wrapper = mountPage()
       await flush(wrapper)
       expect(wrapper.vm.activeModule).toBe('children')

+ 1 - 1
cfc-web/src/api/admin.js

@@ -214,7 +214,7 @@ export function deleteTaskTemplate(id) {
   })
 }
 
-// 孩子管理
+// 成员管理
 export function getChildrenList(params) {
   return request({
     url: '/api/admin/children',

+ 1 - 1
cfc-web/src/router/index.js

@@ -59,7 +59,7 @@ const routes = [
         path: 'children',
         name: 'Children',
         component: () => import('@/views/Children.vue'),
-        meta: { title: '孩子管理', perm: 'family:children' }
+        meta: { title: '成员管理', perm: 'family:children' }
       },
       {
         path: 'family-metric-agg-config',

+ 1 - 1
cfc-web/src/views/Children.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page-container">
     <el-card>
-      <PageHeader slot="header" title="孩子管理">
+      <PageHeader slot="header" title="成员管理">
         <el-button type="primary" size="small" @click="handleRefresh" :loading="loading">刷新</el-button>
       </PageHeader>
 

+ 4 - 4
cfc-web/src/views/FamilyWorkbench.vue

@@ -49,7 +49,7 @@
         <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'cf' }" @click="selectModule('cf')">CF值</button>
 
         <div class="wb-nav-group">成长与激励</div>
-        <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'children' }" @click="selectModule('children')">孩子管理</button>
+        <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'children' }" @click="selectModule('children')">成员管理</button>
         <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'points' }" @click="selectModule('points')">积分记录</button>
         <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'wishes' }" @click="selectModule('wishes')">心愿</button>
         <button type="button" class="wb-nav-item" :class="{ 'is-active': activeModule === 'rewards' }" @click="selectModule('rewards')">奖励</button>
@@ -411,7 +411,7 @@ const KPI_DEFS = [
 ]
 
 const MODULE_TITLES = {
-  children: "孩子管理",
+  children: "成员管理",
   reports: "报告",
   plans: "方案",
   tasks: "任务",
@@ -458,7 +458,7 @@ export default {
   data() {
     return {
       familyId: Number(this.$route.params.id),
-      // 单一导航状态源(§7.1 清单首项:孩子管理)
+      // 单一导航状态源(§7.1 清单首项:成员管理)
       activeModule: "children",
       family: {},
       cardsLoading: true,
@@ -533,7 +533,7 @@ export default {
     activeCard() {
       return this.cards.find((c) => c.key === this.activeModule) || null
     },
-    // 默认模块(孩子管理)无统计卡:曲线取首张有 series 的卡作总览趋势,
+    // 默认模块(成员管理)无统计卡:曲线取首张有 series 的卡作总览趋势,
     // 保证首屏面板仍呈现 sparkline(§6.6),选中 KPI 模块后改用该模块自身 series。
     curveCard() {
       if (this.activeCard && this.activeCard.series && this.activeCard.series.length) return this.activeCard

+ 1 - 1
cfc-web/src/views/Layout.vue

@@ -179,7 +179,7 @@ export default {
         { title: '家庭运营', icon: 'el-icon-s-custom', perm: 'family:*',
           children: [
             { path: '/families', label: '家庭列表', icon: 'el-icon-s-custom', perm: 'family:list,family:read,family:bound' },
-            { path: '/children', label: '孩子管理', icon: 'el-icon-user-solid', perm: 'family:children,family:read,family:bound' },
+            { path: '/children', label: '成员管理', icon: 'el-icon-user-solid', perm: 'family:children,family:read,family:bound' },
             { path: '/points', label: '积分管理', icon: 'el-icon-s-finance', perm: 'family:points' },
             { path: '/points-log', label: '积分记录', icon: 'el-icon-document', perm: 'family:points,family:bound' },
             { path: '/wishes', label: '心愿管理', icon: 'el-icon-star-off', perm: 'family:wishes' },