From 531f9d752700cf620dbb0f3a1d392e4ccba7489c Mon Sep 17 00:00:00 2001 From: wzqgit <568275241@qq.com> Date: Thu, 25 Feb 2021 01:01:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=201.=E7=97=85=E6=A1=88=E7=A4=BA=E8=B8=AA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=89=8D=E4=B8=A4=E5=88=97=202.=E5=BD=92?= =?UTF-8?q?=E6=A1=A3=E6=8A=A4=E5=A3=AB=E5=8C=BB=E7=94=9F=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=E5=BC=BA=E5=88=B6=E5=8B=BE=E9=80=89=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E7=97=85=E5=8E=86=E6=98=AF=E5=90=A6=E5=85=A8=E9=83=A8=E6=97=A0?= =?UTF-8?q?=E7=BA=B8=E5=8C=96=E6=97=A0=E6=89=AB=E6=8F=8F=E4=BB=B6=203.?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=97=85=E6=A1=88=E5=B0=81=E5=AD=98=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=8F=8A=E7=97=85=E6=A1=88=E5=B0=81=E5=AD=98?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=204.?= =?UTF-8?q?=E7=97=85=E6=A1=88=E5=AE=A4=E9=80=80=E5=9B=9E=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8E=E8=87=AA=EF=BC=8C=E9=80=80=E5=9B=9E?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A8=A1=E6=80=81=E6=A1=86=E5=8F=96=E6=B6=88?= =?UTF-8?q?=20=E2=80=94=E2=80=94=E2=80=94=E2=80=942021.02.25=20=E7=8E=8B?= =?UTF-8?q?=E6=B3=BD=E9=92=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/emr/controller/storageController.java | 4 +- .../com/emr/dao/Archive_MasterMapper.java | 2 +- .../ipml/Archive_MasterServiceImpl.java | 2 +- .../resources/mapper/Archive_MasterMapper.xml | 3 +- .../mapper/Emr_Fault_DetailMapper.xml | 66 +++++ .../views/beHospitaledDir/beHospList.jsp | 136 +++++----- .../views/lastVerifyDir/lastVerifyList.jsp | 9 + .../MedicalRecordStorage.jsp | 13 +- .../MedicalRecordStorageLog.jsp | 3 +- .../WEB-INF/views/pdfDir/pdfLastDir.jsp | 2 +- .../unfileMedicalDir/unfileMedicalList.jsp | 13 +- .../bootstrap-table-fixed-columns.css | 27 ++ .../bootstrap-table-fixed-columns.js | 242 ++++++++++++++++++ 13 files changed, 441 insertions(+), 81 deletions(-) create mode 100644 src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css create mode 100644 src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js diff --git a/src/main/java/com/emr/controller/storageController.java b/src/main/java/com/emr/controller/storageController.java index bb95245..280832a 100644 --- a/src/main/java/com/emr/controller/storageController.java +++ b/src/main/java/com/emr/controller/storageController.java @@ -129,7 +129,7 @@ public class storageController { archiveMasterFollowing.setFollowingContent("病案封存"); archiveMasterFollowing.setFollowingType("11"); archiveMasterFollowing.setHandleTime(nowTime); - // archiveMasterFollowing.setHandleId(); + archiveMasterFollowing.setHandleId(username); archiveMasterFollowing.setHandleName(handleName); archiveMasterFollowing.setRemark(emrFaultDetail.getRecallReason()); bol = archiveMasterFollowingService.insertSelective(archiveMasterFollowing); @@ -138,7 +138,7 @@ public class storageController { archiveMasterFollowing.setFollowingContent("病案取消封存"); archiveMasterFollowing.setFollowingType("12"); archiveMasterFollowing.setHandleTime(nowTime); - // archiveMasterFollowing.setHandleId(); + archiveMasterFollowing.setHandleId(username); archiveMasterFollowing.setHandleName(handleName); archiveMasterFollowing.setRemark(emrFaultDetail.getRecallReason()); bol = archiveMasterFollowingService.insertSelective(archiveMasterFollowing); diff --git a/src/main/java/com/emr/dao/Archive_MasterMapper.java b/src/main/java/com/emr/dao/Archive_MasterMapper.java index 2fb0b9d..3bd7e3a 100644 --- a/src/main/java/com/emr/dao/Archive_MasterMapper.java +++ b/src/main/java/com/emr/dao/Archive_MasterMapper.java @@ -48,5 +48,5 @@ public interface Archive_MasterMapper { List selectOverdue(Archive_Master_Vo record); //封存日志 - List selectByFollowinglog(Archive_Master_Vo record); + List selectByFollowinglog(Archive_Master_Vo record); } \ No newline at end of file diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 01e4cb8..2ed85b3 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -390,7 +390,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { @Override public OffsetLimitPage selectByFollowinglog(Archive_Master_Vo record, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); - List list = archiveMasterMapper.selectByFollowinglog(record); + List list = archiveMasterMapper.selectByFollowinglog(record); return new OffsetLimitPage((Page) list); } diff --git a/src/main/resources/mapper/Archive_MasterMapper.xml b/src/main/resources/mapper/Archive_MasterMapper.xml index 2ac18aa..e3056fe 100644 --- a/src/main/resources/mapper/Archive_MasterMapper.xml +++ b/src/main/resources/mapper/Archive_MasterMapper.xml @@ -1179,7 +1179,7 @@ - select m.INP_NO,m.VISIT_ID,m.name,m.sex,f.handle_name,f.handle_time, m.archiveState ,f.following_content from Archive_Master m INNER JOIN Archive_Master_Following f on m.ID=f.master_id where 1=1 AND f.following_type in('11','12') @@ -1213,5 +1213,6 @@ and f.handle_time <= #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + ORDER BY f.handle_time desc \ No newline at end of file diff --git a/src/main/resources/mapper/Emr_Fault_DetailMapper.xml b/src/main/resources/mapper/Emr_Fault_DetailMapper.xml index 05129e7..96527cd 100644 --- a/src/main/resources/mapper/Emr_Fault_DetailMapper.xml +++ b/src/main/resources/mapper/Emr_Fault_DetailMapper.xml @@ -448,4 +448,70 @@ archive_state=#{archiveState,jdbcType=NVARCHAR} where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp index 94b34d0..eedfc41 100644 --- a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp +++ b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp @@ -2130,47 +2130,45 @@ toastr.warning("病案不存在!"); return; } - var lockinfo=$("#wzxText").val(); - var content=$("#doctorText").val(); - var isScanedChk=0; - if($('#isScanedChk').is(':checked')){ - isScanedChk="1"; - } - - - - if(lockinfo=="完整"){ - $.ajax({ - url: "${path}/beHosp/cmtDoctorOrNurs", - type: "POST", - data: {cmtDoctor: doctorFlag, id: id,lockinfo:lockinfo,content:content,isscaned:isScanedChk}, - success: function (result) { - $("#doctorModal").modal('hide'); - if (result == "成功") { - $("#table").bootstrapTable("refresh"); - toastr.success("归档医生提交成功!"); - } else { - toastr.error("归档医生提交失败!"); + var lockinfo = $("#wzxText").val(); + var content = $("#doctorText").val(); + var isScanedChk = 0; + if ($('.isScanedChk').is(':checked')) { + isScanedChk = "1"; + } + if($('.isScanedChk').is(':checked')){ + if (lockinfo == "完整") { + $.ajax({ + url: "${path}/beHosp/cmtDoctorOrNurs", + type: "POST", + data: {cmtDoctor: doctorFlag, id: id,lockinfo:lockinfo,content:content,isscaned:isScanedChk}, + success: function (result) { + $("#doctorModal").modal('hide'); + if (result == "成功") { + $("#table").bootstrapTable("refresh"); + toastr.success("归档医生提交成功!"); + } else { + toastr.error("归档医生提交失败!"); + } } - } - }); - }else{ - - //如果缺失病案首页或入院记录则无法强制提交 - if(lockinfo.indexOf("病案首页")!=-1||lockinfo.indexOf("入院记录")!=-1){ - alert("缺失病案首页或入院记录,无法强制提交!"); - }else{ - $("#flagStaff").val(0); - //弹窗提示是否强制性 - $("#WzRsult2").html(lockinfo); - $('#WZModal2').modal({ - backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。 - keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。 - show: true//弹出对话框 }); - } + } else { + //如果缺失病案首页或入院记录则无法强制提交 + if (lockinfo.indexOf("病案首页") != -1 || lockinfo.indexOf("入院记录") != -1) { + alert("缺失病案首页或入院记录,无法强制提交!"); + } else { + $("#flagStaff").val(0); + //弹窗提示是否强制性 + $("#WzRsult2").html(lockinfo); + $('#WZModal2').modal({ + backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。 + keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。 + show: true//弹出对话框 + }); + } + }}else { + toastr.error("必填项未选择!归档医生提交失败!"); } - }); //护士提交 @@ -2178,40 +2176,44 @@ //审核信息保存 var nursFlag = 1; var id = $("#archiveId").val(); - if (id=="" || id==null) { + if (id == "" || id == null) { toastr.warning("病案不存在!"); return; } - var lockinfo=$("#wzx2Text").val(); - var content=$("#nures2Text").val(); - var isScanedChk2=0; - if($('#isScanedChk2').is(':checked')){ - isScanedChk2="1"; + var lockinfo = $("#wzx2Text").val(); + var content = $("#nures2Text").val(); + var isScanedChk2 = 0; + if ($('.isScanedChk2').is(':checked')) { + isScanedChk2 = "1"; } - if(lockinfo=="完整"){ - $.ajax({ - url: "${path}/beHosp/cmtDoctorOrNurs", - type: "POST", - data: {cmtNurse: nursFlag, id: id,lockinfo:lockinfo,content:content,isscaned:isScanedChk2}, - success: function (result) { - $("#nursModal").modal('hide'); - if (result == "成功") { - $("#table").bootstrapTable("refresh"); - toastr.success("归档护士提交成功!"); - } else { - toastr.error("归档护士提交失败!"); + if($('.isScanedChk2').is(':checked')){ + if (lockinfo == "完整") { + $.ajax({ + url: "${path}/beHosp/cmtDoctorOrNurs", + type: "POST", + data: {cmtNurse: nursFlag, id: id, lockinfo: lockinfo, content: content, isscaned: isScanedChk2}, + success: function (result) { + $("#nursModal").modal('hide'); + if (result == "成功") { + $("#table").bootstrapTable("refresh"); + toastr.success("归档护士提交成功!"); + } else { + toastr.error("归档护士提交失败!"); + } } - } - }); - }else{ - $("#flagStaff").val(1); - //弹窗提示是否强制性 - $("#WzRsult2").html(lockinfo); - $('#WZModal2').modal({ - backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。 - keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。 - show: true//弹出对话框 - }); + }); + } else { + $("#flagStaff").val(1); + //弹窗提示是否强制性 + $("#WzRsult2").html(lockinfo); + $('#WZModal2').modal({ + backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。 + keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。 + show: true//弹出对话框 + }); + } + }else { + toastr.error("必填项未选择!归档护士提交失败!"); } }); diff --git a/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp b/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp index 93ee831..5c14135 100644 --- a/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp +++ b/src/main/webapp/WEB-INF/views/lastVerifyDir/lastVerifyList.jsp @@ -16,6 +16,8 @@ <%@include file="../../jspf/comm.jspf" %> <%@include file="../../jspf/ztreeCommom.jsp" %> + + @@ -1822,6 +1830,7 @@ // sortOrder: "asc", // fixedColumns: true,//固定列 // fixedNumber:3,//固定前两列 + // rightFixedRow:1, // fixedRightNumber:32, // addNum:70, toolbar: '#toolbar',//指定工具栏 diff --git a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp index 1058691..9244d84 100644 --- a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp +++ b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp @@ -373,7 +373,7 @@ align: 'center', valign: 'middle', //sortable: true, - // visible: false, + visible: false, formatter: function (value, row, index) { return index + 1; } @@ -400,7 +400,7 @@ { title: '姓名', field: 'name', - align: 'left', + align: 'center', valign: 'middle', }, { @@ -414,11 +414,12 @@ field: 'idNo', align: 'left', valign: 'middle', + visible: false }, { title: '入院科室', field: 'deptAdmissionTo', - align: 'left', + align: 'center', valign: 'middle', }, { @@ -429,7 +430,7 @@ { title: '出院科室', field: 'deptName', - align: 'left', + align: 'center', valign: 'middle', }, { @@ -488,10 +489,10 @@ if (index != null && index != "" && index.indexOf("recall") != -1) { if (row.archivestate == "已封存" || row.archivestate == "已归档") { if(row.archivestate=="已封存"){ - return ''; + return ''; //return '' + ''; }else{ - return ''; + return ''; } } else { return ''; diff --git a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorageLog.jsp b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorageLog.jsp index 60e9b69..7af26d8 100644 --- a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorageLog.jsp +++ b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorageLog.jsp @@ -247,7 +247,7 @@ align: 'center', valign: 'middle', //sortable: true, - // visible: false, + visible: false, formatter: function (value, row, index) { return index + 1; } @@ -268,6 +268,7 @@ { title: '姓名', field: 'name', + align: 'center', valign: 'middle', }, { diff --git a/src/main/webapp/WEB-INF/views/pdfDir/pdfLastDir.jsp b/src/main/webapp/WEB-INF/views/pdfDir/pdfLastDir.jsp index f6bdc5c..62037fb 100644 --- a/src/main/webapp/WEB-INF/views/pdfDir/pdfLastDir.jsp +++ b/src/main/webapp/WEB-INF/views/pdfDir/pdfLastDir.jsp @@ -1054,7 +1054,7 @@ success: function (result) { if (result == 1) { //关闭modal - // $('#lastBackModal').modal('hide'); //手动关闭 + $('#lastBackModal').modal('hide'); //手动关闭 //$('#firstModal').modal('hide'); //手动关闭 toastr.success("退回成功!"); //刷新 diff --git a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp index b7ac2da..ce71be1 100644 --- a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp +++ b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp @@ -15,7 +15,8 @@ <%@include file="../../jspf/comm.jspf" %> <%@ include file="../../jspf/ztreeCommom.jsp" %> - + + @@ -1784,6 +1792,9 @@ sidePagination: 'server', // 设置为服务器端分页 客户端:client search: false, showColumns: true, + fixedColumns: true,//固定列 + fixedNumber:3,//固定前两列 + rightFixedRow:1, // sortable: true, // sortOrder: "asc", toolbar: '#toolbar',//指定工具栏 diff --git a/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css b/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css new file mode 100644 index 0000000..40855f9 --- /dev/null +++ b/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css @@ -0,0 +1,27 @@ +.fixed-table-header-columns, +.fixed-table-body-columns { + position: absolute; + background-color: #fff; + display: none; + box-sizing: border-box; + overflow: hidden; +} + +.fixed-table-header-columns .table, +.fixed-table-body-columns .table { + border-right: 1px solid #ddd; +} + +.fixed-table-header-columns .table.table-no-bordered, +.fixed-table-body-columns .table.table-no-bordered { + border-right: 1px solid transparent; +} + +.fixed-table-body-columns table { + position: absolute; + animation: none; +} + +.bootstrap-table .table-hover > tbody > tr.hover > td{ + background-color: #f5f5f5; +} \ No newline at end of file diff --git a/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js b/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js new file mode 100644 index 0000000..546a7ac --- /dev/null +++ b/src/main/webapp/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js @@ -0,0 +1,242 @@ +/** + * @author zhixin wen + * @version: v1.0.1 + * Modificated 16.08.16 by Aleksej Tokarev (Loecha) + * - Sorting Problem solved + * - Recalculated Size of fixed Columns + */ + +(function ($) { + 'use strict'; + + $.extend($.fn.bootstrapTable.defaults, { + fixedColumns: false, + fixedNumber: 1 + }); + + var BootstrapTable = $.fn.bootstrapTable.Constructor, + _initHeader = BootstrapTable.prototype.initHeader, + _initBody = BootstrapTable.prototype.initBody, + _resetView = BootstrapTable.prototype.resetView, + _getCaret = BootstrapTable.prototype.getCaret; // Add: Aleksej + + BootstrapTable.prototype.initFixedColumns = function () { + this.$fixedHeader = $([ + '
', + '', + '', + '
', + '
'].join('')); + + this.timeoutHeaderColumns_ = 0; + this.$fixedHeader.find('table').attr('class', this.$el.attr('class')); + this.$fixedHeaderColumns = this.$fixedHeader.find('thead'); + this.$tableHeader.before(this.$fixedHeader); + + this.$fixedBody = $([ + '
', + '', + '', + '
', + '
'].join('')); + + this.timeoutBodyColumns_ = 0; + this.$fixedBody.find('table').attr('class', this.$el.attr('class')); + this.$fixedBodyColumns = this.$fixedBody.find('tbody'); + this.$tableBody.before(this.$fixedBody); + }; + + BootstrapTable.prototype.initHeader = function () { + _initHeader.apply(this, Array.prototype.slice.apply(arguments)); + + if (!this.options.fixedColumns) { + return; + } + + this.initFixedColumns(); + + var that = this, $trs = this.$header.find('tr').clone(true); //Fix: Aleksej "clone()" mit "clone(true)" ersetzt + $trs.each(function () { + // This causes layout problems: + //$(this).find('th:gt(' + (that.options.fixedNumber -1) + ')').remove(); // Fix: Aleksej "-1" hinnzugef�gt. Denn immer eine Spalte Mehr geblieben ist + $(this).find('th:gt(' + that.options.fixedNumber + ')').remove(); + }); + this.$fixedHeaderColumns.html('').append($trs); + }; + + BootstrapTable.prototype.initBody = function () { + _initBody.apply(this, Array.prototype.slice.apply(arguments)); + + if (!this.options.fixedColumns) { + return; + } + + var that = this, + rowspan = 0; + + this.$fixedBodyColumns.html(''); + this.$body.find('> tr[data-index]').each(function () { + var $tr = $(this).clone(), + $tds = $tr.find('td'); + + var dataIndex = $tr.attr("data-index"); + $tr = $(""); + $tr.attr("data-index", dataIndex); + + var end = that.options.fixedNumber; + if (rowspan > 0) { + --end; + --rowspan; + } + for (var i = 0; i < end; i++) { + $tr.append($tds.eq(i).clone()); + } + that.$fixedBodyColumns.append($tr); + + if ($tds.eq(0).attr('rowspan')){ + rowspan = $tds.eq(0).attr('rowspan') - 1; + } + }); + }; + + BootstrapTable.prototype.resetView = function () { + _resetView.apply(this, Array.prototype.slice.apply(arguments)); + + if (!this.options.fixedColumns) { + return; + } + + clearTimeout(this.timeoutHeaderColumns_); + this.timeoutHeaderColumns_ = setTimeout($.proxy(this.fitHeaderColumns, this), this.$el.is(':hidden') ? 100 : 0); + + clearTimeout(this.timeoutBodyColumns_); + this.timeoutBodyColumns_ = setTimeout($.proxy(this.fitBodyColumns, this), this.$el.is(':hidden') ? 100 : 0); + }; + + BootstrapTable.prototype.fitHeaderColumns = function () { + var that = this, + visibleFields = this.getVisibleFields(), + headerWidth = 0; + + this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) { + var $this = $(this), + index = i; + + if (i >= that.options.fixedNumber) { + return false; + } + + if (that.options.detailView && !that.options.cardView) { + index = i - 1; + } + + var $th = that.$fixedHeader.find('th[data-field="' + visibleFields[index] + '"]'); + $th.find('.fht-cell').width($this.innerWidth()); + headerWidth += $this.outerWidth(); + + $th.data('fix-pos', index); + }); + this.$fixedHeader.width(headerWidth + 1).show(); + + // fix click event + this.$fixedHeader.delegate("tr th", 'click', function() { + $(this).parents(".fixed-table-container").find(".fixed-table-body table thead tr th:eq("+$(this).data("fix-pos")+") .sortable").click(); + }) + }; + + /** + * Add: Aleksej + * Hook f�r getCaret. Aktualisieren Header bei Fixed-Columns wenn diese sortiert wurden + * @method getCaret + * @for BootstrapTable + */ + BootstrapTable.prototype.getCaret = function () { + var result = _getCaret.apply(this, arguments); + + if (this.options.fixedColumns && this.$fixedHeaderColumns instanceof jQuery) { + var that = this, $th; + + $.each(this.$fixedHeaderColumns.find('th'), function (i, th) { + $th = $(th); + $th.find('.sortable').removeClass('desc asc').addClass($th.data('field') === that.options.sortName ? that.options.sortOrder : 'both'); + }); + } + + return result; + }; + + /** + * Add: Aleksej, zum berechnen von Scrollbar-Gr��e + * @method calcScrollBarSize + * @return Number + */ + BootstrapTable.prototype.calcScrollBarSize = function () { + // Es ist egal, ob H�he oder Breite + var tmpWidth = 100, + $container = $('
').css({ + width : tmpWidth, + overflow : 'scroll', + visibility : 'hidden'} + ).appendTo('body'), + widthWithScroll = $('
').css({ + width: '100%' + }).appendTo($container).outerWidth(); + + $container.remove(); + return tmpWidth - widthWithScroll; + }; + + BootstrapTable.prototype.fitBodyColumns = function () { + var that = this, + borderHeight = (parseInt(this.$el.css('border-bottom-width')) + parseInt(this.$el.css('border-top-width'))), // Add. Aleksej + top = this.$fixedHeader.outerHeight() + borderHeight, // Fix. Aleksej "-2" mit "+ borderHeight" ersetzt + // the fixed height should reduce the scorll-x height + height = this.$tableBody.height() - this.calcScrollBarSize(); // Fix. Aleksej "-14" mit "- this.calcScrollBarSize()" ersetzt + + if (!this.$body.find('> tr[data-index]').length) { + this.$fixedBody.hide(); + return; + } + + if (!this.options.height) { + top = this.$fixedHeader.height(); + height = height - top; + } + + this.$fixedBody.css({ + width: this.$fixedHeader.width(), + height: height-69, + top: top + }).show(); + + this.$body.find('> tr').each(function (i) { + that.$fixedBody.find('tr:eq(' + i + ')').height($(this).height()); + }); + + // events + this.$tableBody.on('scroll', function () { + that.$fixedBody.find('table').css('top', -$(this).scrollTop()); + }); + this.$body.find('> tr[data-index]').off('hover').hover(function () { + var index = $(this).data('index'); + that.$fixedBody.find('tr[data-index="' + index + '"]').addClass('hover'); + }, function () { + var index = $(this).data('index'); + that.$fixedBody.find('tr[data-index="' + index + '"]').removeClass('hover'); + }); + this.$fixedBody.find('tr[data-index]').off('hover').hover(function () { + var index = $(this).data('index'); + that.$body.find('tr[data-index="' + index + '"]').addClass('hover'); + }, function () { + var index = $(this).data('index'); + that.$body.find('> tr[data-index="' + index + '"]').removeClass('hover'); + }); + + // fix td width bug + var $first_tr = that.$body.find('tr:eq(0)'); + that.$fixedBody.find('tr:eq(0)').find("td").each(function(index) { + $(this).width($first_tr.find("td:eq("+index+")").width()) + }); + }; + +})(jQuery);