|
|
|
@ -45,8 +45,7 @@
|
|
|
|
|
maxWidth: checkColWidth + 'rpx',
|
|
|
|
|
minHeight: minHeight[0] + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: fontSize[0] + 'rpx',
|
|
|
|
|
color: headerFtColor,
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
@ -93,27 +92,21 @@
|
|
|
|
|
maxWidth: (item.width || defaultColWidth) + 'rpx',
|
|
|
|
|
minHeight: minHeight[0] + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: fontSize[0] + 'rpx',
|
|
|
|
|
fontWeight: headerWeight ? 'bold' : 'normal',
|
|
|
|
|
color: headerFtColor,
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
|
backgroundColor: headerBgColor,
|
|
|
|
|
borderRight:
|
|
|
|
|
index === headers.length - 1 || (!showVertBorder && index !== 0)
|
|
|
|
|
? 'none'
|
|
|
|
|
: '1px solid' + borderColor,
|
|
|
|
|
borderRight: index === headers.length - 1 || (!showVertBorder && index !== 0) ? 'none' : '1px solid' + borderColor,
|
|
|
|
|
zIndex: index === 0 ? 20 : 0,
|
|
|
|
|
left:
|
|
|
|
|
index === 0 && firstLineFixed ? (enableCheck ? checkColWidth + 'rpx' : 0) : 'auto',
|
|
|
|
|
left: index === 0 && firstLineFixed ? (enableCheck ? checkColWidth + 'rpx' : 0) : 'auto',
|
|
|
|
|
position: index === 0 ? 'sticky' : 'static',
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<text
|
|
|
|
|
:style="{
|
|
|
|
|
marginLeft:
|
|
|
|
|
autoSortShow(index) && textAlign !== 'left' ? fontSize[0] * 0.65 + 'rpx' : 0,
|
|
|
|
|
marginLeft: autoSortShow(index) && textAlign !== 'left' ? fontSize[0] * 0.65 + 'rpx' : 0,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label || emptyString }}
|
|
|
|
@ -122,10 +115,7 @@
|
|
|
|
|
<text
|
|
|
|
|
class="iconfont icon-arrow-up"
|
|
|
|
|
:style="{
|
|
|
|
|
color:
|
|
|
|
|
sortWays[sortWay] === 'asc' && sortActiveKey === item.key
|
|
|
|
|
? headerFtColor
|
|
|
|
|
: RGBChange(headerFtColor, 0.7, 'light'),
|
|
|
|
|
color: sortWays[sortWay] === 'asc' && sortActiveKey === item.key ? headerFtColor : RGBChange(headerFtColor, 0.7, 'light'),
|
|
|
|
|
fontWeight: 'normal',
|
|
|
|
|
marginBottom: '-12px',
|
|
|
|
|
transform: 'scale(0.4)',
|
|
|
|
@ -134,10 +124,7 @@
|
|
|
|
|
<text
|
|
|
|
|
class="iconfont icon-arrow-down"
|
|
|
|
|
:style="{
|
|
|
|
|
color:
|
|
|
|
|
sortWays[sortWay] === 'inv' && sortActiveKey === item.key
|
|
|
|
|
? headerFtColor
|
|
|
|
|
: RGBChange(headerFtColor, 0.7, 'light'),
|
|
|
|
|
color: sortWays[sortWay] === 'inv' && sortActiveKey === item.key ? headerFtColor : RGBChange(headerFtColor, 0.7, 'light'),
|
|
|
|
|
fontWeight: 'normal',
|
|
|
|
|
transform: 'scale(0.4)',
|
|
|
|
|
}"
|
|
|
|
@ -146,12 +133,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="wyb-table-content">
|
|
|
|
|
<view
|
|
|
|
|
class="wyb-table-content-line"
|
|
|
|
|
v-for="(content, cIndex) in contentsSort"
|
|
|
|
|
:key="contentLineKey(content, cIndex)"
|
|
|
|
|
:style="{ borderTop: cIndex === 0 ? 'none' : '1px solid' + borderColor }"
|
|
|
|
|
>
|
|
|
|
|
<view class="wyb-table-content-line" v-for="(content, cIndex) in contentsSort" :key="contentLineKey(content, cIndex)" :style="{ borderTop: cIndex === 0 ? 'none' : '1px solid' + borderColor }">
|
|
|
|
|
<view
|
|
|
|
|
class="wyb-table-content-item"
|
|
|
|
|
v-if="enableCheck"
|
|
|
|
@ -159,12 +141,7 @@
|
|
|
|
|
minWidth: checkColWidth + 'rpx',
|
|
|
|
|
maxWidth: checkColWidth + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center'
|
|
|
|
|
? textAlign
|
|
|
|
|
: textAlign === 'left'
|
|
|
|
|
? 'flex-start'
|
|
|
|
|
: 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
|
|
|
|
|
minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
@ -207,12 +184,7 @@
|
|
|
|
|
minWidth: (header.width || defaultColWidth) + 'rpx',
|
|
|
|
|
maxWidth: (header.width || defaultColWidth) + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center'
|
|
|
|
|
? textAlign
|
|
|
|
|
: textAlign === 'left'
|
|
|
|
|
? 'flex-start'
|
|
|
|
|
: 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
|
|
|
|
|
textDecoration: autoTextDecoration(cIndex, hIndex),
|
|
|
|
|
color: autoContentColor(cIndex, hIndex),
|
|
|
|
@ -220,10 +192,7 @@
|
|
|
|
|
minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
|
borderBottom: cIndex === contents.length - 1 ? '1px solid' + borderColor : 'none',
|
|
|
|
|
borderRight:
|
|
|
|
|
hIndex === headers.length - 1 || (!showVertBorder && hIndex !== 0)
|
|
|
|
|
? 'none'
|
|
|
|
|
: '1px solid' + borderColor,
|
|
|
|
|
borderRight: hIndex === headers.length - 1 || (!showVertBorder && hIndex !== 0) ? 'none' : '1px solid' + borderColor,
|
|
|
|
|
zIndex: hIndex === 0 ? 20 : 0,
|
|
|
|
|
left: enableCheck ? checkColWidth + 'rpx' : 0,
|
|
|
|
|
position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static',
|
|
|
|
@ -248,12 +217,7 @@
|
|
|
|
|
minWidth: checkColWidth + 'rpx',
|
|
|
|
|
maxWidth: checkColWidth + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center'
|
|
|
|
|
? textAlign
|
|
|
|
|
: textAlign === 'left'
|
|
|
|
|
? 'flex-start'
|
|
|
|
|
: 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
|
|
|
|
|
minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
@ -274,22 +238,14 @@
|
|
|
|
|
minWidth: (header.width || defaultColWidth) + 'rpx',
|
|
|
|
|
maxWidth: (header.width || defaultColWidth) + 'rpx',
|
|
|
|
|
textAlign: textAlign,
|
|
|
|
|
justifyContent:
|
|
|
|
|
textAlign === 'center'
|
|
|
|
|
? textAlign
|
|
|
|
|
: textAlign === 'left'
|
|
|
|
|
? 'flex-start'
|
|
|
|
|
: 'flex-end',
|
|
|
|
|
justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
|
|
|
|
|
fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
|
|
|
|
|
color: contentFtColor,
|
|
|
|
|
minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
|
|
|
|
|
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
|
|
|
|
|
backgroundColor: index === 0 ? firstColBgColor : contentBgColor,
|
|
|
|
|
borderBottom: '1px solid' + borderColor,
|
|
|
|
|
borderRight:
|
|
|
|
|
index === headers.length - 1 || (!showVertBorder && index !== 0)
|
|
|
|
|
? 'none'
|
|
|
|
|
: '1px solid' + borderColor,
|
|
|
|
|
borderRight: index === headers.length - 1 || (!showVertBorder && index !== 0) ? 'none' : '1px solid' + borderColor,
|
|
|
|
|
zIndex: index === 0 ? 20 : 0,
|
|
|
|
|
left: enableCheck ? checkColWidth + 'rpx' : 0,
|
|
|
|
|
position: index === 0 && firstLineFixed ? 'sticky' : 'static',
|
|
|
|
@ -402,11 +358,7 @@ export default {
|
|
|
|
|
bottomComputed[this.computedCol[index]] = total;
|
|
|
|
|
});
|
|
|
|
|
let header = this.headers[index];
|
|
|
|
|
let result = this.computedCol.includes(header.key)
|
|
|
|
|
? bottomComputed[header.key]
|
|
|
|
|
: index === 0
|
|
|
|
|
? '总计'
|
|
|
|
|
: this.emptyString;
|
|
|
|
|
let result = this.computedCol.includes(header.key) ? bottomComputed[header.key] : index === 0 ? '总计' : this.emptyString;
|
|
|
|
|
if (this.formatCol.length !== 0) {
|
|
|
|
|
this.formatCol.forEach((item) => {
|
|
|
|
|
if (item.bottomComputedFormat) {
|
|
|
|
@ -837,10 +789,7 @@ export default {
|
|
|
|
|
// 升序
|
|
|
|
|
if (isNumber) {
|
|
|
|
|
arr.sort((a, b) => {
|
|
|
|
|
return (
|
|
|
|
|
(parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0) -
|
|
|
|
|
(parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0)
|
|
|
|
|
);
|
|
|
|
|
return (parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0) - (parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
arr.sort((a, b) => {
|
|
|
|
@ -861,10 +810,7 @@ export default {
|
|
|
|
|
// 倒序
|
|
|
|
|
if (isNumber) {
|
|
|
|
|
arr.sort((a, b) => {
|
|
|
|
|
return (
|
|
|
|
|
(parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0) -
|
|
|
|
|
(parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0)
|
|
|
|
|
);
|
|
|
|
|
return (parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0) - (parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
arr.sort((a, b) => {
|
|
|
|
@ -992,8 +938,8 @@ export default {
|
|
|
|
|
this.$emit('onCellClick', event);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onEmpty(){
|
|
|
|
|
this.event.data=[]
|
|
|
|
|
onEmpty() {
|
|
|
|
|
this.event.data = [];
|
|
|
|
|
},
|
|
|
|
|
onCheckAllTap() {
|
|
|
|
|
if (this.enableCheck === 'multiple') {
|
|
|
|
@ -1128,10 +1074,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
let rgbc = [r, g, b];
|
|
|
|
|
// 减淡或加深
|
|
|
|
|
for (var i = 0; i < 3; i++)
|
|
|
|
|
type === 'light'
|
|
|
|
|
? (rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i]))
|
|
|
|
|
: (rgbc[i] = Math.floor(rgbc[i] * (1 - level)));
|
|
|
|
|
for (var i = 0; i < 3; i++) type === 'light' ? (rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i])) : (rgbc[i] = Math.floor(rgbc[i] * (1 - level)));
|
|
|
|
|
|
|
|
|
|
if (hasAlpha) {
|
|
|
|
|
return `rgba(${rgbc[0]}, ${rgbc[1]}, ${rgbc[2]}, ${alpha})`;
|
|
|
|
|