Browse Source

chore: 优化样式

master
kiki 2 years ago
parent
commit
fe4be0bda0
  1. 98
      src/views/data-view/components/data-view-table.vue

98
src/views/data-view/components/data-view-table.vue

@ -1,47 +1,51 @@
<template> <template>
<div <div class="outside">
class="data-view-table" <div class="backdrop">
:class="['data-view-table' + '--' + size]" <div
> class="data-view-table"
<div :class="['data-view-table' + '--' + size]"
class="data-view-table-header" >
:style="{ backgroundImage: `url(${DataViewTableHeaderBG})` }" <div
> class="data-view-table-header"
<span class="YouSheBiaoTiHei header-title">{{ title }}</span> :style="{ backgroundImage: `url(${DataViewTableHeaderBG})` }"
</div>
<table class="data-view-table-body">
<thead>
<tr class="data-view-table-body-header">
<th
class="data-view-table-body-header-item"
v-for="(column, index) of columns"
:key="column.key"
:style="{width: columnSizes[index] + '%'}"
> >
{{ column.label }} <span class="YouSheBiaoTiHei header-title">{{ title }}</span>
</th> </div>
</tr> <table class="data-view-table-body">
</thead> <thead>
<tbody ref="tbody" @mouseout="mouseleave" @mouseover="mouseenter"> <tr class="data-view-table-body-header">
<tr <th
v-for="(item, index) in data" class="data-view-table-body-header-item"
:key="index" v-for="(column, index) of columns"
class="data-view-table-body-item" :key="column.key"
:class="[ :style="{width: columnSizes[index] + '%'}"
>
{{ column.label }}
</th>
</tr>
</thead>
<tbody ref="tbody" @mouseout="mouseleave" @mouseover="mouseenter">
<tr
v-for="(item, index) in data"
:key="index"
class="data-view-table-body-item"
:class="[
index % 2 === 0 ? 'data-view-table-body-item--odd' : 'data-view-table-body-item--even', index % 2 === 0 ? 'data-view-table-body-item--odd' : 'data-view-table-body-item--even',
item.balanceWarning === 1 && 'data-view-table-body-item--warning' item.balanceWarning === 1 && 'data-view-table-body-item--warning'
]" ]"
> >
<td <td
v-for="(column, index) in columns" v-for="(column, index) in columns"
:key="column.key" :key="column.key"
:style="{width: columnSizes[index] + '%'}" :style="{width: columnSizes[index] + '%'}"
> >
{{ item[column.key] }} {{ item[column.key] }}
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</div>
</div> </div>
</template> </template>
@ -125,9 +129,25 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.outside {
height: 100%;
}
.backdrop {
width: 100%;
height: 100%;
/* 创建渐变色背景 */
background-image: linear-gradient(10.29deg, rgba(40, 85, 216, 0.8) 7.69%, rgba(17, 48, 128, 0) 63.53%);;
padding-left: 1px;
padding-right: 1px;
padding-bottom: 1px;
}
.data-view-table { .data-view-table {
background-color: #081a2c;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background-image: linear-gradient(10.29deg, rgb(56 87 174 / 12%) 7.69%, rgba(17, 48, 128, 0) 63.53%);;
table { table {
/*设置相邻单元格的边框间的距离*/ /*设置相邻单元格的边框间的距离*/

Loading…
Cancel
Save