Commit 76e208f5 authored by leon's avatar leon

feat: remove first content cell

parent 7bbbee95
...@@ -7,26 +7,20 @@ ...@@ -7,26 +7,20 @@
<view class="table" :style="tableStyle"> <view class="table" :style="tableStyle">
<view class="table-header"> <view class="table-header">
<view class="title-cell"> <view :class="[index === 0 ? 'title-cell' : 'content-cell']" v-for="(item, index) in elementInfo.table.column" :key="index">
<view v-for="(item, index) in elementInfo.table.column" :key="index"> <view :class="[index === 0 ? 'column' : 'cell']" >{{ item.title }}</view>
<view class="column" v-if ="item.title == 'Store' ">{{ item.title }}</view>
</view>
</view>
<view class="content-cell" v-for="(item, index) in elementInfo.table.column" :key="index">
<view class="cell" v-if ="item.title != 'Store' ">{{ item.title }}</view>
</view> </view>
</view> </view>
<view class="table-content" :style="tableStyle"> <view class="table-content" :style="tableStyle">
<view class="table-content__item" v-for="(cell, cellIndex) in chartTables" :key="cellIndex" @tap="cellClick(cell)" > <view class="table-content__item" v-for="(cell, cellIndex) in chartTables" :key="cellIndex" @tap="cellClick(cell)" >
<!-- <view class=""> -->
<view class="title-cell"> <view class="title-cell">
<view class="cell">{{ cell.shopName }}</view> <view class="cell">{{ cell.shopName }}</view>
</view> </view>
<view :class="[cellIndex %2 == 1 ? 'content-cell-bg' :'content-cell']" v-for="(item, index) in elementInfo.table.column" :key="index"> <view :class="[index === 0 ? 'empty-cell' : cellIndex %2 == 1 ? 'content-cell-bg' :'content-cell']" v-for="(item, index) in elementInfo.table.column" :key="index">
<view v-if="item.dataIndex != 'shopName'"> <view v-if="index != 0">
<template class="cell" v-if="item.slots.customRender == 'rank'">{{index + 1}}</template> <template class="cell" v-if="item.slots.customRender == 'rank'">{{index + 1}}</template>
<template class="cell" v-else-if="item.slots.customRender == 'picture'"> <template class="cell" v-else-if="item.slots.customRender == 'picture'">
<u-image <u-image
...@@ -48,6 +42,9 @@ ...@@ -48,6 +42,9 @@
</view> </view>
</view> </view>
<!-- </view> -->
</view> </view>
</view> </view>
...@@ -125,8 +122,7 @@ ...@@ -125,8 +122,7 @@
tableStyle() { tableStyle() {
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
const width = 150 + this.elementInfo.table.column.length * 150; const width = this.elementInfo.table.column.length * 150;
console.log('width',width)
return `width: ${width}rpx`; return `width: ${width}rpx`;
} }
}, },
...@@ -141,6 +137,8 @@ ...@@ -141,6 +137,8 @@
// that.cacheImages(item.dataIndex) // that.cacheImages(item.dataIndex)
} }
}) })
console.log(that.chartTables)
console.log(that.elementInfo.table.column)
}) })
}, },
cellClick(e) { cellClick(e) {
...@@ -293,7 +291,9 @@ $title-color: #f6f6f6; ...@@ -293,7 +291,9 @@ $title-color: #f6f6f6;
font-size: 20rpx; font-size: 20rpx;
background-color:$title-color ; background-color:$title-color ;
} }
.empty-cell {
width: 0px;
}
.content-cell { .content-cell {
display: table-cell; display: table-cell;
width: $content-width; width: $content-width;
......
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