style(AI): 优化 treasureBox 组件中的表格样式

-调整表格边框颜色和样式
- 优化表格单元格样式,包括背景色、文字颜色等
- 添加表格行交替背景色
- 移除多余的 inline 样式,使用 CSS 类名管理样式
This commit is contained in:
陈昱达
2025-06-10 14:25:16 +08:00
parent 848cf7679b
commit 42430eac00
2 changed files with 41 additions and 7 deletions

View File

@@ -17,10 +17,10 @@
<!-- </van-collapse>-->
<!-- -->
<table style='border-color :#87a2d0;text-align: left;border-radius:8px;overflow: hidden ' cellspacing='1' cellpadding='1' >
<tr v-for='item in knowledge' >
<th style='width: 120px;background: #87a2d0 ;color:#fff;text-align: center' class='fs12 fw600'>{{item.title}}</th>
<th style='padding: 5px 8px; color:#fff;background: #87a2d0;font-weight: unset;gap:5px' class='fs12 flex '>
<table style='border :1px solid #b6ccd9;text-align: left;border-radius:8px;overflow: hidden ' cellspacing='0' cellpadding='0' class='my-table' >
<tr v-for='item in knowledge'>
<th class='fs12 fw600'>{{item.title}}</th>
<th class='fs12 flex '>
<span v-for="(it, index) in item.list" :key="index" :title="item.title" class='cells'>
{{ it.title}}
</span>
@@ -174,4 +174,38 @@ $primary-trans-color: #87a2d0;
align-items: center;
}
.my-table{
tr{
padding: 6px 8px;
}
tr:nth-child(2n){
background: #e9f3ff;
}
tr:last-child{
th{
border-bottom: none;
}
}
th:nth-child(1){
padding: 6px 8px;
width:80px;
background: #2976e8 ;
color:#fff;
text-align: center;
//border-right:1px solid #b6ccd9;
border-bottom:1px solid #b6ccd9;
}
th:nth-child(2){
padding: 6px 8px;
color:#253243;
font-weight: unset;
gap:5px;
border-bottom:1px solid #b6ccd9
}
}
</style>

View File

@@ -317,7 +317,7 @@ export default {
const cleanLine = line.replace(/^data:\s*/, '')
if (!cleanLine) return null
const data = JSON.parse(cleanLine)
// console.log(data)
console.log(data)
if (data.answer) {
this.answerMap += data.answer
}
@@ -343,8 +343,8 @@ export default {
this.messageStatus = 'stop'
}
// console.log(answer)
// console.log(this.currentMessage)
console.log(answer)
console.log(this.currentMessage)
if (!this.currentMessage || !answer) return
const mode = this.isThink ? 'think' : 'text'
this.currentMessage[mode] += answer