更新部分代码

This commit is contained in:
yachts_zh 2020-07-07 15:38:21 +08:00
parent c52ba00f4f
commit 0de4168429
8 changed files with 96 additions and 46 deletions

View File

@ -213,7 +213,9 @@
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
</modules>
<module>ruoyi-imark</module>
<module>ruoyi-cloud</module>
</modules>
<packaging>pom</packaging>

View File

@ -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:
# 从数据源开关/默认关闭

View File

@ -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();
}
@ -221,7 +216,7 @@
this.$fixedBody.css({
width: this.$fixedHeader.width(),
height: height,
height: height - 12,
top: top + 1
}).show();
@ -229,7 +224,8 @@
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);
@ -237,39 +233,39 @@
});
$("#" + 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 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 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');
});
}
});

View File

@ -36,6 +36,8 @@
showColumns: false,
fixedColumns: true,
fixedNumber: 3,
rightFixedColumns: true,
rightFixedNumber: 3,
columns: [{
checkbox: true
},

14
ruoyi-cloud/pom.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-cloud</artifactId>
</project>

View File

@ -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_
tablePrefix: db_

36
ruoyi-imark/pom.xml Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-imark</artifactId>
<dependencies>
<!--通用模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
</dependencies>
</project>