大提交一版
This commit is contained in:
@@ -6,22 +6,48 @@ export default {
|
||||
return {
|
||||
tableData: [],
|
||||
columns: [
|
||||
{label: "课区", prop: "groupName",width:50,align:'center'},
|
||||
{label: "课长", prop: "supervisorName",width:50,align:'center'},
|
||||
{label: "销售额", prop: "saleAmt",width:60},
|
||||
{label: "外卖销售额", prop: "deliverySaleAmt",width:60},
|
||||
{label: "有效订单数", prop: "validOrderNum",width:60},
|
||||
{label: "客单价", prop: "customerUnitPrice",width:58},
|
||||
{label: "蛋糕销售额", prop: "cakeSaleAmt",width:60},
|
||||
{label: "西点销售额", prop: "westSaleAmt",width:60},
|
||||
{label: "现烤销售额", prop: "bakeSaleAmt",width:60},
|
||||
{label: "现烤损货比", prop: "lossAmtRate",width:60},
|
||||
{label: "环比(目标完成比)",prop: "targetRate"},
|
||||
]
|
||||
{label: "课区", prop: "groupName", width: 50, align: 'center'},
|
||||
{label: "课长", prop: "supervisorName", width: 60, align: 'center'},
|
||||
{label: "销售额", prop: "saleAmt", width: 60, align: 'right'},
|
||||
{label: "外卖销售额", prop: "deliverySaleAmt", width: 60, align: 'right'},
|
||||
{label: "有效订单数", prop: "validOrderNum", width: 60, align: 'right'},
|
||||
{label: "客单价", prop: "customerUnitPrice", width: 58, align: 'right'},
|
||||
{label: "蛋糕销售额", prop: "cakeSaleAmt", width: 60, align: 'right'},
|
||||
{label: "西点销售额", prop: "westSaleAmt", width: 60, align: 'right'},
|
||||
{label: "现烤销售额", prop: "bakeSaleAmt", width: 60, align: 'right'},
|
||||
{label: "现烤损货比", prop: "lossAmtRate", width: 60, align: 'right'},
|
||||
{label: "环比(目标完成比)", prop: "targetRate", align: 'right'},
|
||||
],
|
||||
summary: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
search: v => v.$marketBoard.search
|
||||
search: v => v.$marketBoard.search,
|
||||
tableConfig: v => {
|
||||
return {
|
||||
headerBGC: 'rgba(13, 48, 99, 0.6)',
|
||||
oddRowBGC: window.evenRowBGC(), evenRowBGC: "transparent",
|
||||
header: v.columns.map(e => e.label),
|
||||
columnWidth: v.columns.map(e => e.width || "0;flex:1;min-width:0;"),
|
||||
align: v.columns.map(e => e.align || "left"),
|
||||
data: v.tableData.map(e => v.columns.map(column => e[column.prop])),
|
||||
}
|
||||
},
|
||||
summaryRow: v => v.columns.map((column, i) => {
|
||||
const isNumber = v => /^-?\d+(\.\d+)?%?$/.test(v)
|
||||
const style = {textAlign: column.align}
|
||||
if (column.width > 0) {
|
||||
style.width = `${column.width}px`
|
||||
} else {
|
||||
style.flex = 1
|
||||
style.minWidth = 0
|
||||
}
|
||||
return {
|
||||
style,
|
||||
value: isNumber(v.summary[column.prop]) ? v.summary[column.prop] :
|
||||
i == 0 ? v.summary.groupName : ""
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getTableData() {
|
||||
@@ -30,14 +56,15 @@ export default {
|
||||
...this.search, limit: 999
|
||||
})).then(res => {
|
||||
if (res?.data) {
|
||||
this.summary = res.data.total
|
||||
this.tableData = res.data?.page?.records || []
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
watch: {
|
||||
search: {
|
||||
immediate:true,deep:true,handler(){
|
||||
immediate: true, deep: true, handler() {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
@@ -47,9 +74,10 @@ export default {
|
||||
|
||||
<template>
|
||||
<section class="AppGroupMonitorTable">
|
||||
<el-table :data="tableData" size="mini" header-cell-class-name="tableHeader" cell-class-name="tableCell" max-height="440px" show-summary stripe>
|
||||
<table-column v-for="(column,i) in columns" :key="i" :column="column"/>
|
||||
</el-table>
|
||||
<dv-scroll-board :config="tableConfig" @click=""/>
|
||||
<div class="summary flex">
|
||||
<div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -59,64 +87,7 @@ export default {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .tableHeader {
|
||||
background: rgba(13, 48, 99, 0.6) !important;
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table tr {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table {
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table .el-table__footer-wrapper tr {
|
||||
background: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%);
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table .el-table__footer-wrapper .is-leaf {
|
||||
color: #66FFFF;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table:before {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .tableCell {
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table tr.el-table__row--striped {
|
||||
--odd-bg: #09265B;
|
||||
background-color: #081F48;
|
||||
background-image: linear-gradient(
|
||||
-45deg, var(--odd-bg) 0, var(--odd-bg) 10%, transparent 10%, transparent 50%,
|
||||
var(--odd-bg) 50%, var(--odd-bg) 60%, transparent 60%, transparent);
|
||||
background-size: 10px 10px;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table tr.el-table__row--striped .tableCell {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-table tr:hover > .tableCell {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .subTitle {
|
||||
line-height: 20px;
|
||||
width: fit-content;
|
||||
margin: 24px auto 12px;
|
||||
background-image: url("http://10.0.97.209/img/kengee/kengee5.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 2px;
|
||||
background-position: center bottom;
|
||||
.AppGroupMonitorTable .dv-scroll-board {
|
||||
height: calc(100% - 30px) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user