Browse Source

查找渲染问题

master
qb 1 year ago
parent
commit
7bcca25b75
  1. 28
      src/components/tablecmt/tablecmt.vue

28
src/components/tablecmt/tablecmt.vue

@ -171,13 +171,13 @@
</el-table-column>
</el-table>
<!-- 勾选合计行 -->
<!-- <div class="selection-total-row" v-show="shownm && isHaveSelection">
<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>
</div> -->
</div>
</div>
</template>
@ -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';
@ -483,11 +488,12 @@ const handleSelectionChange = (param: TableDataType[]) => {
// 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 = param;
// 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);
};
@ -528,7 +534,7 @@ const getSummaries = (param: any) => {
newarr[index] = null;
}
});
// selectCount.value = _arr;
selectCount.value = _arr;
// console.log(columns)
return newarr;
};

Loading…
Cancel
Save