|
110 | 110 | label="错误等级" |
111 | 111 | prop="level" |
112 | 112 | width="120" |
113 | | - /> |
| 113 | + > |
| 114 | + <template #default="scope"> |
| 115 | + <el-tag |
| 116 | + effect="dark" |
| 117 | + :type="levelTagMap[scope.row.level] || 'info'" |
| 118 | + > |
| 119 | + {{ levelLabelMap[scope.row.level] || defaultLevelLabel }} |
| 120 | + </el-tag> |
| 121 | + </template> |
| 122 | + </el-table-column> |
114 | 123 |
|
115 | 124 | <el-table-column |
116 | 125 | align="left" |
117 | 126 | label="处理状态" |
118 | 127 | prop="status" |
119 | | - width="120" |
120 | | - /> |
| 128 | + width="140" |
| 129 | + > |
| 130 | + <template #default="scope"> |
| 131 | + <el-tag |
| 132 | + effect="light" |
| 133 | + :type="statusTagMap[scope.row.status] || 'info'" |
| 134 | + > |
| 135 | + {{ statusLabelMap[scope.row.status] || defaultStatusLabel }} |
| 136 | + </el-tag> |
| 137 | + </template> |
| 138 | + </el-table-column> |
121 | 139 |
|
122 | 140 | <el-table-column |
123 | 141 | align="left" |
|
148 | 166 | link |
149 | 167 | class="table-button" |
150 | 168 | @click="getSolution(scope.row.ID)" |
151 | | - ><el-icon><ai-gva /></el-icon |
152 | | - >方案</el-button |
153 | 169 | > |
| 170 | + <el-icon><ai-gva /></el-icon>方案 |
| 171 | + </el-button> |
154 | 172 | <el-button |
155 | 173 | type="primary" |
156 | 174 | link |
|
195 | 213 | {{ detailForm.form }} |
196 | 214 | </el-descriptions-item> |
197 | 215 | <el-descriptions-item label="错误等级"> |
198 | | - {{ detailForm.level }} |
| 216 | + <el-tag |
| 217 | + effect="dark" |
| 218 | + :type="levelTagMap[detailForm.level] || 'info'" |
| 219 | + > |
| 220 | + {{ levelLabelMap[detailForm.level] || defaultLevelLabel }} |
| 221 | + </el-tag> |
199 | 222 | </el-descriptions-item> |
200 | 223 | <el-descriptions-item label="处理状态"> |
201 | | - {{ detailForm.status || '未处理' }} |
| 224 | + <el-tag |
| 225 | + effect="light" |
| 226 | + :type="statusTagMap[detailForm.status] || 'info'" |
| 227 | + > |
| 228 | + {{ statusLabelMap[detailForm.status] || defaultStatusLabel }} |
| 229 | + </el-tag> |
202 | 230 | </el-descriptions-item> |
203 | 231 | <el-descriptions-item label="错误内容" :span="2"> |
204 | 232 | <pre class="whitespace-pre-wrap break-words">{{ detailForm.info }}</pre> |
|
248 | 276 | getTableData() |
249 | 277 | } |
250 | 278 |
|
251 | | - const getSolution = (id) =>{ |
252 | | - getSysErrorSolution({ id }).then((res) => { |
253 | | - if (res.code === 0) { |
254 | | - ElMessage({ type: 'success', message: res.msg || '处理已提交,1分钟后完成' }) |
255 | | - getTableData() |
| 279 | + const getSolution = async (id) => { |
| 280 | + const confirmed = await ElMessageBox.confirm( |
| 281 | + '日志将通过 AI-PATH 传输至 GVA AI 用于错误分析,并在 GVA 官方平台短暂存储作为 AI 上下文。是否确认进行 AI 处理?(此功能仅向授权用户开放)', |
| 282 | + '提示(Beta)', |
| 283 | + { |
| 284 | + confirmButtonText: '确认', |
| 285 | + cancelButtonText: '取消', |
| 286 | + type: 'warning' |
256 | 287 | } |
257 | | - }) |
| 288 | + ).catch(() => false) |
| 289 | + if (!confirmed) return |
| 290 | + const res = await getSysErrorSolution({ id }) |
| 291 | + if (res.code === 0) { |
| 292 | + ElMessage({ type: 'success', message: res.msg || '处理已提交,1分钟后完成' }) |
| 293 | + getTableData() |
| 294 | + } |
258 | 295 | } |
259 | 296 | // 搜索 |
260 | 297 | const onSubmit = () => { |
|
393 | 430 | detailShow.value = false |
394 | 431 | detailForm.value = {} |
395 | 432 | } |
396 | | -</script> |
397 | 433 |
|
398 | | -<style></style> |
| 434 | + const statusLabelMap = { |
| 435 | + 未处理: '未处理', |
| 436 | + 处理中: '处理中', |
| 437 | + 处理完成: '处理完成', |
| 438 | + 处理失败: '处理失败' |
| 439 | + } |
| 440 | + const statusTagMap = { |
| 441 | + 未处理: 'info', |
| 442 | + 处理中: 'warning', |
| 443 | + 处理完成: 'success', |
| 444 | + 处理失败: 'danger' |
| 445 | + } |
| 446 | + const defaultStatusLabel = '未处理' |
| 447 | +
|
| 448 | + const levelLabelMap = { |
| 449 | + fatal: '致命错误', |
| 450 | + error: '一般错误' |
| 451 | + } |
| 452 | + const levelTagMap = { |
| 453 | + fatal: 'danger', |
| 454 | + error: 'warning' |
| 455 | + } |
| 456 | + const defaultLevelLabel = '一般错误' |
| 457 | +</script> |
0 commit comments