add popover

This commit is contained in:
Fine 2022-11-09 18:11:25 +08:00
parent 690dacddb3
commit 63f9833899
2 changed files with 37 additions and 7 deletions

View File

@ -47,7 +47,7 @@ export default function useLegendProcess(legend?: LegendOptions) {
for (const [key, value] of keys.entries()) {
const item: { [key: string]: unknown } = {
name: value,
linear: data[value],
topN: data[value],
};
if (legend) {
if (legend.min) {

View File

@ -29,10 +29,24 @@ limitations under the License. -->
</tr>
<tr class="col-item" v-for="(item, index) in tableData" :key="index">
<td class="header-cell">
<div class="cell">
<el-popover placement="bottom" :width="100" trigger="click">
<template #reference>
<div class="cell name">
<Icon iconName="circle" :style="`color: ${colors[index]};`" />
<i style="font-style: normal">{{ item.name }}</i>
<i>{{ item.name }}</i>
</div>
</template>
<div>
<div
class="value"
v-for="(value, index) in item.topN"
:key="index"
>
<span>{{ index }}</span>
<span>{{ value }}</span>
</div>
</div>
</el-popover>
</td>
<td v-for="h in headerRow" :key="h.value">
<div class="cell">{{ item[h.value] }}</div>
@ -95,6 +109,10 @@ table {
text-overflow: ellipsis;
vertical-align: middle;
width: 100px;
&.header-cell {
width: 150px;
}
}
}
@ -106,9 +124,21 @@ table {
word-break: break-all;
line-height: 23px;
padding: 0 5px;
i {
font-style: normal;
}
}
.header-cell {
width: 150px;
.value {
span {
display: inline-block;
padding: 5px;
width: 50px;
}
}
.name {
cursor: pointer;
}
</style>