From 0de416842994cb1bb2c69491284ca6e11a95f5a3 Mon Sep 17 00:00:00 2001 From: yachts_zh Date: Tue, 7 Jul 2020 15:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +- .../src/main/resources/application-druid.yml | 2 +- .../columns/bootstrap-table-fixed-columns.js | 76 +++++++++---------- .../templates/demo/table/fixedColumns.html | 2 + ruoyi-cloud/pom.xml | 14 ++++ .../src/main/resources/application.yml | 0 .../src/main/resources/generator.yml | 8 +- ruoyi-imark/pom.xml | 36 +++++++++ 8 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 ruoyi-cloud/pom.xml create mode 100644 ruoyi-cloud/src/main/resources/application.yml create mode 100644 ruoyi-imark/pom.xml diff --git a/pom.xml b/pom.xml index 64913ab1b..212e88264 100644 --- a/pom.xml +++ b/pom.xml @@ -213,7 +213,9 @@ ruoyi-quartz ruoyi-generator ruoyi-common - + ruoyi-imark + ruoyi-cloud + pom diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index d69c66d27..2f13bed9d 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: password + password: control # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js index 17ff1d330..56c026d65 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js @@ -28,7 +28,7 @@ '', '', ''].join('')); - + this.$fixedHeader.find('table').attr('class', this.$el.attr('class')); this.$fixedHeaderColumns = this.$fixedHeader.find('thead'); this.$tableHeader.before(this.$fixedHeader); @@ -57,7 +57,7 @@ this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody'); this.$tableBody.before(this.$rightfixedBody); if (this.options.fixedColumns) { - $('.right-fixed-table-columns').attr('style','right:0px'); + $('.right-fixed-table-columns').attr('style','right:0px;'); } } }; @@ -93,9 +93,9 @@ this.$fixedHeaderColumns.html('').append($ltr); this.$selectAll = $ltr.find('[name="btSelectAll"]'); this.$selectAll.on('click', function () { - var checked = $(this).prop('checked'); - $(".left-fixed-body-columns input[name=btSelectItem]").filter(':enabled').prop('checked', checked); - $('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected'); + var checked = $(this).prop('checked'); + $(".left-fixed-body-columns input[name=btSelectItem]").filter(':enabled').prop('checked', checked); + $('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected'); }); } }; @@ -183,21 +183,16 @@ this.$fixedHeader.width(headerWidth + 2).show(); } if (that.options.rightFixedColumns) { + headerWidth = 0; + var totalLength = $("#" + table.options.id).find('th').length; this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) { var $this = $(this), - index = i; + index = totalLength - i - 1; - if (i >= visibleFields.length - that.options.rightFixedNumber) { + if (i >= that.options.rightFixedNumber) { return false; - - - if (that.options.detailView && !that.options.cardView) { - index = i - 1; - } - that.$rightfixedBody.find('thead th[data-field="' + visibleFields[index] + '"]') - .find('.fht-cell').width($this.innerWidth() - 1); - headerWidth += $this.outerWidth(); } + headerWidth += $("#" + table.options.id).find("tr:first-child>th").eq(index).width(); }); this.$rightfixedBody.width(headerWidth - 1).show(); } @@ -213,7 +208,7 @@ this.$fixedBody.hide(); return; } - + if (!this.options.height) { top = this.$fixedHeader.height()- 1; height = height - top; @@ -221,58 +216,59 @@ this.$fixedBody.css({ width: this.$fixedHeader.width(), - height: height, + height: height - 12, top: top + 1 }).show(); - + var bsHeight = $("#" + table.options.id).find("tr").eq(1).height(); var fixedHeight = $("#" + table.options.id).parent().prev().find("tr").eq(1).height(); var resizeHeight = bsHeight > fixedHeight ? bsHeight: fixedHeight; this.$body.find('> tr').each(function (i) { - that.$fixedBody.find('tr:eq(' + i + ')').height(i == 0 ? resizeHeight - 1 : resizeHeight); + that.$fixedBody.find('tr:eq(' + i + ')').height(i == 0 ? resizeHeight - 1 : resizeHeight); + $("#" + table.options.id).find('tbody>tr:eq(' + i + ')').height(resizeHeight); var thattds = this; that.$fixedBody.find('tr:eq(' + i + ')').find('td').each(function (j) { $(this).width($($(thattds).find('td')[j]).width() + 1); }); }); - + $("#" + table.options.id).on("check.bs.table uncheck.bs.table", function (e, rows, $element) { - var index= $element.data('index'); + var index= $element.data('index'); $(this).find('.bs-checkbox').find('input[data-index="' + index + '"]').prop("checked", true); var selectFixedItem = $('.left-fixed-body-columns input[name=btSelectItem]'); var checkAll = selectFixedItem.filter(':enabled').length && selectFixedItem.filter(':enabled').length === - selectFixedItem.filter(':enabled').filter(':checked').length; + selectFixedItem.filter(':enabled').filter(':checked').length; $(".left-fixed-table-columns input[name=btSelectAll]").prop('checked', checkAll); $('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected'); - }); - + }); + $("#" + table.options.id).off('click', '.fixed-table-body').on('click', '.th-inner', function (event) { - $.each(that.$fixedHeader.find('th'), function (i, th) { - $(th).find('.sortable').removeClass('desc asc').addClass('both'); - }); + $.each(that.$fixedHeader.find('th'), function (i, th) { + $(th).find('.sortable').removeClass('desc asc').addClass('both'); + }); }); // events this.$fixedHeader.off('click', '.th-inner').on('click', '.th-inner', function (event) { - var target = $(this); - var $this = event.type === "keypress" ? $(event.currentTarget) : $(event.currentTarget).parent(), $this_ = that.$header.find('th').eq($this.index()); - - var sortOrder = ""; - if (table.options.sortName === $this.data('field')) { - sortOrder = table.options.sortOrder === 'asc' ? 'desc' : 'asc'; + var target = $(this); + var $this = event.type === "keypress" ? $(event.currentTarget) : $(event.currentTarget).parent(), $this_ = that.$header.find('th').eq($this.index()); + + var sortOrder = ""; + if (table.options.sortName === $this.data('field')) { + sortOrder = table.options.sortOrder === 'asc' ? 'desc' : 'asc'; } else { sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc'; } - table.options.sortOrder = sortOrder; - var sortName = $this.data('sortName') ? $this.data('sortName') : $this.data('field'); - if (target.parent().data().sortable) { - $.each(that.$fixedHeader.find('th'), function (i, th) { - $(th).find('.sortable').removeClass('desc asc').addClass(($(th).data('field') === sortName || $(th).data('sortName') === sortName) ? sortOrder : 'both'); - }); + table.options.sortOrder = sortOrder; + var sortName = $this.data('sortName') ? $this.data('sortName') : $this.data('field'); + if (target.parent().data().sortable) { + $.each(that.$fixedHeader.find('th'), function (i, th) { + $(th).find('.sortable').removeClass('desc asc').addClass(($(th).data('field') === sortName || $(th).data('sortName') === sortName) ? sortOrder : 'both'); + }); } }); - + this.$tableBody.on('scroll', function () { that.$fixedBody.find('table').css('top', -$(this).scrollTop()); }); diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/fixedColumns.html b/ruoyi-admin/src/main/resources/templates/demo/table/fixedColumns.html index 7fbcd6382..79d40fe91 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/fixedColumns.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/fixedColumns.html @@ -36,6 +36,8 @@ showColumns: false, fixedColumns: true, fixedNumber: 3, + rightFixedColumns: true, + rightFixedNumber: 3, columns: [{ checkbox: true }, diff --git a/ruoyi-cloud/pom.xml b/ruoyi-cloud/pom.xml new file mode 100644 index 000000000..daf0a758d --- /dev/null +++ b/ruoyi-cloud/pom.xml @@ -0,0 +1,14 @@ + + + + ruoyi + com.ruoyi + 4.3.1 + + 4.0.0 + + ruoyi-cloud + + \ No newline at end of file diff --git a/ruoyi-cloud/src/main/resources/application.yml b/ruoyi-cloud/src/main/resources/application.yml new file mode 100644 index 000000000..e69de29bb diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml index f3792cdc6..a7d49ef21 100644 --- a/ruoyi-generator/src/main/resources/generator.yml +++ b/ruoyi-generator/src/main/resources/generator.yml @@ -2,10 +2,10 @@ # 代码生成 gen: # 作者 - author: ruoyi + author: GideonYeung # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.ruoyi.system + packageName: com.ruoyi.dataentry # 自动去除表前缀,默认是false - autoRemovePre: false + autoRemovePre: true # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: sys_ \ No newline at end of file + tablePrefix: db_ \ No newline at end of file diff --git a/ruoyi-imark/pom.xml b/ruoyi-imark/pom.xml new file mode 100644 index 000000000..f7b5603b3 --- /dev/null +++ b/ruoyi-imark/pom.xml @@ -0,0 +1,36 @@ + + + + ruoyi + com.ruoyi + 4.3.1 + + 4.0.0 + + ruoyi-imark + + + + + + com.ruoyi + ruoyi-common + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-framework + + + + + \ No newline at end of file