赞
踩
目录
- computed: {
- rowSelection() {
- const _this = this
- const { selectedRowKeys } = this
- return {
- selectedRowKeys,
- onChange: (selectedRowKeys, selectionRows) => {
- this.selectedRowKeys = selectedRowKeys;
- this.selectionRows = selectionRows;
- },
- getCheckboxProps: (record) => ({
- props: {
- // 全部默认禁止选中
- // disabled: true,
- // 某几项默认禁止选中(R: 当state等于1时)
- disabled: record.id=='合计',
- // 某几项默认选中(R: 当state等于1时)
- // defaultChecked: record.state == 1,
- },
- }),
- }
- },
- },

- <!-- table区域-begin -->
- <div>
- <a-table
- ref="table"
- size="middle"
- bordered
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- :rowSelection="rowSelection"
- @change="handleTableChange">
-
- <span slot="action_rowIndex" slot-scope="text, record, index">
- <span v-if="record.id=='合计'">
- 合计
- </span>
- <span v-else>
- <span v-if="ipagination.current=='1'">{{parseInt(index)}}</span>
- <span v-else>{{parseInt(index)+1}}</span>
- </span>
- </span>
- </a-table>
- </div>
- <!-- table区域-end -->

1、antDesignForVue 符合条件的表格复选框禁止选中
https://blog.csdn.net/bbsyi/article/details/108992302
说明:后端查询记录后,在计算合计时,合计记录的id赋值为“合计”,可实现该效果。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。