From 4ea4df910c6beeb564bdb5b37c5162484d3ad83d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 21 Apr 2019 13:23:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=A0=91=E6=8C=87=E5=AE=9A=E5=88=97=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ajax/libs/bootstrap-treetable/bootstrap-treetable.js | 9 +++++++++ ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js index efdf97f7..400c1492 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js @@ -384,6 +384,15 @@ _ipt.prop('checked', true); target.find("tbody").find("tr").removeClass("treetable-selected"); $(this).addClass("treetable-selected"); + } else if (_ipt.attr("type") == "checkbox") { + if (_ipt.prop('checked')) { + _ipt.prop('checked', true); + target.find("tbody").find("tr").removeClass("treetable-selected"); + $(this).addClass("treetable-selected"); + } else { + _ipt.prop('checked', false); + target.find("tbody").find("tr").removeClass("treetable-selected"); + } } else { if (_ipt.prop('checked')) { _ipt.prop('checked', false); diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 418e5e46..60ec4d3e 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -387,6 +387,13 @@ refresh: function() { $._treeTable.bootstrapTreeTable('refresh'); }, + // 查询表格树指定列值 + selectColumns: function(column) { + var rows = $.map($('#' + $.table._option.id).bootstrapTreeTable('getSelections'), function (row) { + return row[column]; + }); + return $.common.uniqueFn(rows); + }, }, // 表单封装处理 form: {