Commit c2472302 authored by root's avatar root

update table style

parent 59e5be80
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
:style="[tableStyle]" :style="[tableStyle]"
> >
<view class="tr" v-if="elementInfo.table.tableHeader.showHeader"> <view class="tr" v-if="elementInfo.table.tableHeader.showHeader">
<view class="th" v-for="(item, index) in elementInfo.table.column" :key="index" :style="[thStyle]">{{item.title}}</view> <view :class="[elementInfo.table.column.length > 10 ? 'th' :'th-large']" v-for="(item, index) in elementInfo.table.column" :key="index" :style="[thStyle]">{{item.title}}</view>
</view> </view>
<view class="tr" v-for="(cell, cellIndex) in chartTables" :key="cellIndex" @tap="cellClick(cell)"> <view class="tr" v-for="(cell, cellIndex) in chartTables" :key="cellIndex" @tap="cellClick(cell)">
<view class="td" :style="[tdStyle]" v-for="(item, index) in elementInfo.table.column" :key="index"> <view :class="[elementInfo.table.column.length > 10 ? 'td' :'td-large']" :style="[tdStyle]" v-for="(item, index) in elementInfo.table.column" :key="index">
<template v-if="item.slots.customRender == 'rank'">{{index + 1}}</template> <template v-if="item.slots.customRender == 'rank'">{{index + 1}}</template>
<template v-else-if="item.slots.customRender == 'picture'"> <template v-else-if="item.slots.customRender == 'picture'">
<u-image <u-image
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</view> </view>
</template> </template>
<script> <script>
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
...@@ -56,9 +57,9 @@ ...@@ -56,9 +57,9 @@
const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table
const { backgroundColor } = this.elementInfo.table.tableCell const { backgroundColor } = this.elementInfo.table.tableCell
return { return {
'width': `${120 * this.elementInfo.table.column.length}rpx`, 'width': `${110 * this.elementInfo.table.column.length}rpx`,
'border-left': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none', 'border-left': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none',
'border-top': bordered ? `${frameStyle || 'solid'} ${frameWidth || 1}px ${frameColor || '#e4e7ed'}`: 'none', 'border-top': 'none',
'background-color': backgroundColor 'background-color': backgroundColor
} }
}, },
...@@ -184,7 +185,16 @@ ...@@ -184,7 +185,16 @@
flex-direction: row; flex-direction: row;
} }
.th { .th {
flex: 0 0 120rpx; flex: 0 0 110rpx;
font-size: 28rpx;
color: $u-main-color;
font-weight: bold;
padding: 10px 0px;
background-color: rgb(245, 246, 248);
}
.th-large {
flex: 0 0 240rpx;
font-size: 28rpx; font-size: 28rpx;
color: $u-main-color; color: $u-main-color;
font-weight: bold; font-weight: bold;
...@@ -192,7 +202,18 @@ ...@@ -192,7 +202,18 @@
background-color: rgb(245, 246, 248); background-color: rgb(245, 246, 248);
} }
.td{ .td{
flex: 0 0 120rpx; flex: 0 0 110rpx;
align-self: stretch;
padding: 10px 0px ;
font-size: 28rpx;
color: $u-content-color;
display: flex;
align-items: center;
justify-content: center;
}
.td-large{
flex: 0 0 240rpx;
align-self: stretch; align-self: stretch;
padding: 10px 0px ; padding: 10px 0px ;
font-size: 28rpx; font-size: 28rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment