|
34 | 34 | thinkingItems: [ |
35 | 35 | { |
36 | 36 | id: 1, |
37 | | - title: "第一步", |
38 | | - thinkTitle: "理解问题", |
39 | | - thinkContent: "分析用户需求的核心要点", |
40 | | - status: "success", |
| 37 | + title: '第一步', |
| 38 | + thinkTitle: '理解问题', |
| 39 | + thinkContent: '分析用户需求的核心要点', |
| 40 | + status: 'success', |
41 | 41 | }, |
42 | 42 | { |
43 | 43 | id: 2, |
44 | | - title: "第二步", |
45 | | - thinkTitle: "收集信息", |
46 | | - thinkContent: "从知识库中检索相关信息", |
47 | | - status: "success", |
| 44 | + title: '第二步', |
| 45 | + thinkTitle: '收集信息', |
| 46 | + thinkContent: '从知识库中检索相关信息', |
| 47 | + status: 'success', |
48 | 48 | }, |
49 | 49 | { |
50 | 50 | id: 3, |
51 | | - title: "第三步", |
52 | | - thinkTitle: "生成回答", |
53 | | - thinkContent: "基于收集的信息构建回答", |
54 | | - status: "loading", |
| 51 | + title: '第三步', |
| 52 | + thinkTitle: '生成回答', |
| 53 | + thinkContent: '基于收集的信息构建回答', |
| 54 | + status: 'loading', |
55 | 55 | }, |
56 | 56 | ], |
57 | 57 | }; |
|
75 | 75 | :thinking-items="thinkingItems" |
76 | 76 | :line-gradient="true" |
77 | 77 | dot-size="small" |
| 78 | + @handle-expand="expandChange" |
78 | 79 | /> |
79 | 80 | </div> |
80 | 81 | </template> |
|
86 | 87 | thinkingItems: [ |
87 | 88 | { |
88 | 89 | id: 1, |
89 | | - title: "分析阶段", |
90 | | - thinkTitle: "问题分解", |
91 | | - thinkContent: "将复杂问题拆解为多个子问题", |
| 90 | + title: '分析阶段', |
| 91 | + thinkTitle: '问题分解', |
| 92 | + thinkContent: '将复杂问题拆解为多个子问题', |
92 | 93 | isCanExpand: true, |
93 | 94 | isDefaultExpand: true, |
94 | | - status: "success", |
| 95 | + status: 'success', |
95 | 96 | }, |
96 | 97 | { |
97 | 98 | id: 2, |
98 | | - title: "推理阶段", |
99 | | - thinkTitle: "逻辑推理", |
100 | | - thinkContent: "基于子问题逐步推导解决方案", |
| 99 | + title: '推理阶段', |
| 100 | + thinkTitle: '逻辑推理', |
| 101 | + thinkContent: '基于子问题逐步推导解决方案', |
101 | 102 | isCanExpand: true, |
102 | | - status: "success", |
| 103 | + status: 'success', |
103 | 104 | }, |
104 | 105 | ], |
105 | 106 | }; |
106 | 107 | }, |
| 108 | + methods: { |
| 109 | + testHandleExpand(item) { |
| 110 | + console.log(item); |
| 111 | + }, |
| 112 | + change(item) { |
| 113 | + console.log('change', item); |
| 114 | + }, |
| 115 | + }, |
107 | 116 | }; |
108 | 117 | </script> |
109 | 118 | ``` |
|
133 | 142 | return { |
134 | 143 | customStatusEnum: { |
135 | 144 | loading: { |
136 | | - value: "processing", |
137 | | - type: "primary", |
| 145 | + value: 'processing', |
| 146 | + type: 'primary', |
138 | 147 | }, |
139 | 148 | error: { |
140 | | - value: "failed", |
141 | | - type: "danger", |
| 149 | + value: 'failed', |
| 150 | + type: 'danger', |
142 | 151 | }, |
143 | 152 | success: { |
144 | | - value: "completed", |
145 | | - type: "success", |
| 153 | + value: 'completed', |
| 154 | + type: 'success', |
146 | 155 | }, |
147 | 156 | }, |
148 | 157 | thinkingItems: [ |
149 | 158 | { |
150 | 159 | id: 1, |
151 | | - title: "数据收集", |
152 | | - status: "completed", |
153 | | - thinkTitle: "收集用户数据", |
154 | | - thinkContent: "从数据库获取用户历史记录", |
| 160 | + title: '数据收集', |
| 161 | + status: 'completed', |
| 162 | + thinkTitle: '收集用户数据', |
| 163 | + thinkContent: '从数据库获取用户历史记录', |
155 | 164 | }, |
156 | 165 | { |
157 | 166 | id: 2, |
158 | | - title: "分析处理", |
159 | | - status: "processing", |
160 | | - thinkTitle: "分析用户行为", |
161 | | - thinkContent: "使用机器学习模型分析用户偏好", |
| 167 | + title: '分析处理', |
| 168 | + status: 'processing', |
| 169 | + thinkTitle: '分析用户行为', |
| 170 | + thinkContent: '使用机器学习模型分析用户偏好', |
162 | 171 | }, |
163 | 172 | { |
164 | 173 | id: 3, |
165 | | - title: "生成结果", |
166 | | - status: "failed", |
167 | | - thinkTitle: "生成推荐", |
168 | | - thinkContent: "由于数据不足,无法生成准确推荐", |
| 174 | + title: '生成结果', |
| 175 | + status: 'failed', |
| 176 | + thinkTitle: '生成推荐', |
| 177 | + thinkContent: '由于数据不足,无法生成准确推荐', |
169 | 178 | }, |
170 | 179 | ], |
171 | 180 | }; |
@@ -213,14 +222,8 @@ thinkingItems 数组中每个对象可包含以下字段: |
213 | 222 | | iconColor | 节点图标颜色(dotIsIcon 为 true 时生效) | String | '' | |
214 | 223 | | iconSize | 节点图标大小(dotIsIcon 为 true 时生效) | String | 'normal'/'large' | |
215 | 224 |
|
216 | | -## 方法 |
217 | | - |
218 | | -| 方法名 | 说明 | 参数 | 返回值 | |
219 | | -| ------------ | ------------------------- | ---------------- | ------ | |
220 | | -| handleExpand | 处理折叠面板展开/收起事件 | item: 当前思考项 | - | |
221 | | - |
222 | 225 | ## 事件 |
223 | 226 |
|
224 | | -| 事件名 | 说明 | 回调参数 | |
225 | | -| ------------ | ------------------------- | -------------- | |
226 | | -| handleExpand | 当思考项被展开/收起时触发 | 当前思考项对象 | |
| 227 | +| 事件名 | 说明 | 回调参数 | |
| 228 | +| ------------- | ------------------------- | -------------- | |
| 229 | +| handle-expand | 当思考项被展开/收起时触发 | 当前思考项对象 | |
0 commit comments