当前位置:   article > 正文

【JEECGBOOT】列表展示金额合计,并复选框禁止选择_jeecg的常见案例里的表格合计news代码

jeecg的常见案例里的表格合计news代码

目录

1、方法代码

2、列表代码

3、参考资料

4、代码文件


1、方法代码

  1. computed: {
  2. rowSelection() {
  3. const _this = this
  4. const { selectedRowKeys } = this
  5. return {
  6. selectedRowKeys,
  7. onChange: (selectedRowKeys, selectionRows) => {
  8. this.selectedRowKeys = selectedRowKeys;
  9. this.selectionRows = selectionRows;
  10. },
  11. getCheckboxProps: (record) => ({
  12. props: {
  13. // 全部默认禁止选中
  14. // disabled: true,
  15. // 某几项默认禁止选中(R: 当state等于1时)
  16. disabled: record.id=='合计',
  17. // 某几项默认选中(R: 当state等于1时)
  18. // defaultChecked: record.state == 1,
  19. },
  20. }),
  21. }
  22. },
  23. },

 

2、列表代码

  1. <!-- table区域-begin -->
  2. <div>
  3. <a-table
  4. ref="table"
  5. size="middle"
  6. bordered
  7. rowKey="id"
  8. :columns="columns"
  9. :dataSource="dataSource"
  10. :pagination="ipagination"
  11. :loading="loading"
  12. :rowSelection="rowSelection"
  13. @change="handleTableChange">
  14. <span slot="action_rowIndex" slot-scope="text, record, index">
  15. <span v-if="record.id=='合计'">
  16. 合计
  17. </span>
  18. <span v-else>
  19. <span v-if="ipagination.current=='1'">{{parseInt(index)}}</span>
  20. <span v-else>{{parseInt(index)+1}}</span>
  21. </span>
  22. </span>
  23. </a-table>
  24. </div>
  25. <!-- table区域-end -->

3、参考资料

1、antDesignForVue 符合条件的表格复选框禁止选中
https://blog.csdn.net/bbsyi/article/details/108992302

4、代码文件

说明:后端查询记录后,在计算合计时,合计记录的id赋值为“合计”,可实现该效果。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/459287
推荐阅读
相关标签
  

闽ICP备14008679号