Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 79f247a

Browse files
committed
✨ feat: 丰富 stage 的数据结构
给stage 也添加 想法和痛点的数据
1 parent 705e67f commit 79f247a

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

packages/journey-map/schema/journey-map.schema.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"action",
1313
"chance",
1414
"emotion",
15-
"painSpot",
15+
"painPoint",
1616
"stage",
1717
"thought"
1818
],
@@ -50,7 +50,7 @@
5050
"emotion": {
5151
"type": "number"
5252
},
53-
"painSpot": {
53+
"painPoint": {
5454
"type": "number"
5555
},
5656
"stage": {
@@ -66,7 +66,7 @@
6666
"description": "用户行为类型",
6767
"properties": {
6868
"color": {
69-
"description": "action 的颜色",
69+
"description": "展示颜色",
7070
"type": "string"
7171
},
7272
"description": {
@@ -112,12 +112,26 @@
112112
"type": "array"
113113
},
114114
"color": {
115-
"description": "该阶段的颜色",
115+
"description": "展示颜色",
116116
"type": "string"
117117
},
118118
"name": {
119119
"description": "阶段名称",
120120
"type": "string"
121+
},
122+
"painPoints": {
123+
"description": "痛点",
124+
"items": {
125+
"type": "string"
126+
},
127+
"type": "array"
128+
},
129+
"thoughts": {
130+
"description": "想法",
131+
"items": {
132+
"type": "string"
133+
},
134+
"type": "array"
121135
}
122136
},
123137
"required": ["actions", "name"],

packages/journey-map/src/types/type.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,25 @@ export interface JourneyMapData<T extends string = string> {
3131
actions: Record<T, UserAction[]>;
3232
}
3333

34+
export interface CommonSection {
35+
/**
36+
* 展示颜色
37+
*/
38+
color?: string;
39+
/**
40+
* 想法
41+
*/
42+
thoughts?: string[];
43+
/**
44+
* 痛点
45+
*/
46+
painPoints?: string[];
47+
}
48+
3449
/**
3550
* 用户行为类型
3651
*/
37-
export interface UserAction {
52+
export interface UserAction extends CommonSection {
3853
/**
3954
* 行为名称
4055
*/
@@ -46,25 +61,10 @@ export interface UserAction {
4661
* @TJS-type integer
4762
*/
4863
emotion?: number;
49-
50-
/**
51-
* action 的颜色
52-
*/
53-
color?: string;
5464
/**
5565
* 说明
5666
*/
5767
description?: string;
58-
59-
/**
60-
* 想法
61-
*/
62-
thoughts?: string[];
63-
64-
/**
65-
* 痛点
66-
*/
67-
painPoints?: string[];
6868
}
6969

7070
export type SectionType =

packages/journey-map/src/types/yml.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
/**
22
* 阶段
33
*/
4-
import type { Config, JourneyMapData, UserAction } from './type';
4+
import type { CommonSection, Config, JourneyMapData, UserAction } from './type';
55

66
/**
77
* YML 的阶段类型
88
*/
9-
interface YMLStage {
9+
interface YMLStage extends CommonSection {
1010
/**
1111
* 阶段名称
1212
*/
1313
name: string;
14-
/**
15-
* 该阶段的颜色
16-
*/
17-
color?: string;
14+
1815
/**
1916
* 该阶段所有用户行为
2017
*/

0 commit comments

Comments
 (0)