From 59d74eeea7fd3a4f5aeac77ed83ca623837e08a9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 25 Mar 2020 12:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=8FeditFull=E6=89=93=E5=BC=80?= =?UTF-8?q?=E9=80=82=E9=85=8D=E8=A1=A8=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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 fd7ca161..e970adf6 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 @@ -214,10 +214,15 @@ var table = { // 图片预览事件 $(optionsIds).off("click").on("click", '.img-circle', function() { var src = $(this).attr('src'); - var target = $(this).data('target'); - var height = $(this).data('height'); var width = $(this).data('width'); if($.common.equals("self", target)) { + var height = $(this).data('height'); + var width = $(this).data('width'); + // 如果是移动端,就使用自适应大小弹窗 + if ($.common.isMobile()) { + width = 'auto'; + height = 'auto'; + } layer.open({ title: false, type: 1, @@ -1031,8 +1036,17 @@ var table = { if ($.common.isNotEmpty(id)) { url = table.options.updateUrl.replace("{id}", id); } else { - var row = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); - url = table.options.updateUrl.replace("{id}", row); + if(table.options.type == table_type.bootstrapTreeTable) { + var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0]; + if ($.common.isEmpty(row)) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]); + } else { + var row = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); + url = table.options.updateUrl.replace("{id}", row); + } } $.modal.openFull("修改" + table.options.modalName, url); },