|
|
|
@ -173,7 +173,7 @@
|
|
|
|
|
<!-- 勾选合计行 --> |
|
|
|
|
<div class="selection-total-row" v-show="shownm && isHaveSelection"> |
|
|
|
|
<span>勾选合计:</span> |
|
|
|
|
<span v-for="item in selectCount"> |
|
|
|
|
<span v-for="item in selectCount" :key="item.label"> |
|
|
|
|
<span style="margin: 0 5px">{{ item.label + ':' }}</span> |
|
|
|
|
<el-text type="success">{{ item.value }}</el-text> |
|
|
|
|
</span> |
|
|
|
@ -339,10 +339,15 @@ let selectarr = ref([]);
|
|
|
|
|
/** 设置每行颜色 */ |
|
|
|
|
const tableRowClassName = ({ row, rowIndex }: { row: TableDataType; rowIndex: number }) => { |
|
|
|
|
let sfcheck = false; |
|
|
|
|
selectarr.value.map(item => { |
|
|
|
|
if (item == row) { |
|
|
|
|
selectarr.value.forEach((val, index) => { |
|
|
|
|
if (val == row) { |
|
|
|
|
sfcheck = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectCount.value.forEach(item => { |
|
|
|
|
if (index === 0) item.value = 0; |
|
|
|
|
item.value = computeNumber(item.value, '+', Number(val[item.prop] || 0)).result; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
if (sfcheck) { |
|
|
|
|
return 'table-SelectedRow-bgcolor'; |
|
|
|
@ -479,16 +484,17 @@ function timechange(value, column: TableColumnType) {
|
|
|
|
|
} |
|
|
|
|
const handleSelectionChange = (param: TableDataType[]) => { |
|
|
|
|
// 重置数据 |
|
|
|
|
selectCount.value.forEach(item => { |
|
|
|
|
item.value = 0; |
|
|
|
|
}); |
|
|
|
|
// selectCount.value.forEach(item => { |
|
|
|
|
// item.value = 0; |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
selectarr.value = param; |
|
|
|
|
selectarr.value.forEach(val => { |
|
|
|
|
selectCount.value.forEach( |
|
|
|
|
item => (item.value = computeNumber(item.value, '+', Number(val[item.prop] || 0)).result) |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
// selectarr.value.forEach((val, index) => { |
|
|
|
|
// selectCount.value.forEach(item => { |
|
|
|
|
// if (index === 0) item.value = 0; |
|
|
|
|
// item.value = computeNumber(item.value, '+', Number(val[item.prop] || 0)).result; |
|
|
|
|
// }); |
|
|
|
|
// }); |
|
|
|
|
emit('selection', param); |
|
|
|
|
}; |
|
|
|
|
function inputclear(value, column: TableColumnType) { |
|
|
|
|