Browse Source

提交修改table树导致不兼容问题修复

v4
chenrui 2 years ago
parent
commit
f4063a9df4
  1. 3
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-table-tree.js
  2. 112
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/index.js
  3. 10
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/js/common.js
  4. 706
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/js/ry-ui.js
  5. 4
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/resetPwd.html

3
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-table-tree.js

@ -6,7 +6,6 @@
"use strict"; "use strict";
$.fn.bootstrapTreeTable = function(options, param) { $.fn.bootstrapTreeTable = function(options, param) {
debugger
var target = $(this).data('bootstrap.tree.table'); var target = $(this).data('bootstrap.tree.table');
target = target ? target : $(this); target = target ? target : $(this);
// 如果是调用方法 // 如果是调用方法
@ -204,7 +203,6 @@
}; };
// 加载完数据后渲染表格 // 加载完数据后渲染表格
var renderTable = function(data) { var renderTable = function(data) {
debugger
var list, totalPage = 0, currPage = 0; var list, totalPage = 0, currPage = 0;
if (options.pagination) { if (options.pagination) {
list = data.rows; // 数据 list = data.rows; // 数据
@ -684,7 +682,6 @@
}; };
// 注册小图标点击事件--展开缩起 // 注册小图标点击事件--展开缩起
var registerExpanderEvent = function() { var registerExpanderEvent = function() {
debugger
target.find("tbody").find("tr").find(".treetable-expander").unbind(); target.find("tbody").find("tr").find(".treetable-expander").unbind();
target.find("tbody").find("tr").find(".treetable-expander").click(function() { target.find("tbody").find("tr").find(".treetable-expander").click(function() {
var _isExpanded = $(this).hasClass(options.expanderExpandedClass); var _isExpanded = $(this).hasClass(options.expanderExpandedClass);

112
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/index.js

@ -41,14 +41,14 @@ $(function() {
}); });
$(window).bind("load resize", $(window).bind("load resize",
function() { function() {
if ($(this).width() < 769) { if ($(this).width() < 769) {
$('body').addClass('mini-navbar'); $('body').addClass('mini-navbar');
$('.navbar-static-side').fadeIn(); $('.navbar-static-side').fadeIn();
$(".sidebar-collapse .logo").addClass("hide"); $(".sidebar-collapse .logo").addClass("hide");
$(".slimScrollDiv").css({ "overflow":"hidden" }) $(".slimScrollDiv").css({ "overflow":"hidden" })
} }
}); });
function NavToggle() { function NavToggle() {
$('.navbar-minimalize').trigger('click'); $('.navbar-minimalize').trigger('click');
@ -59,16 +59,16 @@ function SmoothlyMenu() {
$('#side-menu').hide(); $('#side-menu').hide();
$(".sidebar-collapse .logo").removeClass("hide"); $(".sidebar-collapse .logo").removeClass("hide");
setTimeout(function() { setTimeout(function() {
$('#side-menu').fadeIn(500); $('#side-menu').fadeIn(500);
}, },
100); 100);
} else if ($('body').hasClass('fixed-sidebar')) { } else if ($('body').hasClass('fixed-sidebar')) {
$('#side-menu').hide(); $('#side-menu').hide();
$(".sidebar-collapse .logo").addClass("hide"); $(".sidebar-collapse .logo").addClass("hide");
setTimeout(function() { setTimeout(function() {
$('#side-menu').fadeIn(500); $('#side-menu').fadeIn(500);
}, },
300); 300);
} else { } else {
$('#side-menu').removeAttr('style'); $('#side-menu').removeAttr('style');
} }
@ -105,7 +105,7 @@ $(function() {
//滚动到指定选项卡 //滚动到指定选项卡
function scrollToTab(element) { function scrollToTab(element) {
var marginLeftVal = calSumWidth($(element).prevAll()), var marginLeftVal = calSumWidth($(element).prevAll()),
marginRightVal = calSumWidth($(element).nextAll()); marginRightVal = calSumWidth($(element).nextAll());
// 可视区域非tab宽度 // 可视区域非tab宽度
var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs")); var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs"));
//可视区域tab宽度 //可视区域tab宽度
@ -127,9 +127,9 @@ $(function() {
scrollVal = marginLeftVal - $(element).prev().outerWidth(true); scrollVal = marginLeftVal - $(element).prev().outerWidth(true);
} }
$('.page-tabs-content').animate({ $('.page-tabs-content').animate({
marginLeft: 0 - scrollVal + 'px' marginLeft: 0 - scrollVal + 'px'
}, },
"fast"); "fast");
} }
//查看左侧隐藏的选项卡 //查看左侧隐藏的选项卡
@ -160,9 +160,9 @@ $(function() {
} }
} }
$('.page-tabs-content').animate({ $('.page-tabs-content').animate({
marginLeft: 0 - scrollVal + 'px' marginLeft: 0 - scrollVal + 'px'
}, },
"fast"); "fast");
} }
//查看右侧隐藏的选项卡 //查看右侧隐藏的选项卡
@ -191,9 +191,9 @@ $(function() {
scrollVal = calSumWidth($(tabElement).prevAll()); scrollVal = calSumWidth($(tabElement).prevAll());
if (scrollVal > 0) { if (scrollVal > 0) {
$('.page-tabs-content').animate({ $('.page-tabs-content').animate({
marginLeft: 0 - scrollVal + 'px' marginLeft: 0 - scrollVal + 'px'
}, },
"fast"); "fast");
} }
} }
} }
@ -208,9 +208,9 @@ $(function() {
function menuItem() { function menuItem() {
// 获取标识数据 // 获取标识数据
var dataUrl = $(this).attr('href'), var dataUrl = $(this).attr('href'),
dataIndex = $(this).data('index'), dataIndex = $(this).data('index'),
menuName = $.trim($(this).text()), menuName = $.trim($(this).text()),
flag = true; flag = true;
$(".nav ul li, .nav li").removeClass("selected"); $(".nav ul li, .nav li").removeClass("selected");
$(this).parent("li").addClass("selected"); $(this).parent("li").addClass("selected");
setIframeUrl($(this).attr("href")); setIframeUrl($(this).attr("href"));
@ -245,8 +245,8 @@ $(function() {
$.modal.loading("数据加载中,请稍后..."); $.modal.loading("数据加载中,请稍后...");
$('.mainContent iframe:visible').load(function () { $('.mainContent iframe:visible').on("load",function () {
$.modal.closeLoading(); $.modal.closeLoading();
}); });
// 添加选项卡 // 添加选项卡
@ -257,10 +257,10 @@ $(function() {
} }
function menuBlank() { function menuBlank() {
// 新窗口打开外网以http://开头,如http://ruoyi.vip // 新窗口打开外网以http://开头,如http://ruoyi.vip
var dataUrl = $(this).attr('href'); var dataUrl = $(this).attr('href');
window.open(dataUrl); window.open(dataUrl);
return false; return false;
} }
$('.menuItem').on('click', menuItem); $('.menuItem').on('click', menuItem);
@ -291,9 +291,9 @@ $(function() {
var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left')); var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left'));
if (marginLeftVal < 0) { if (marginLeftVal < 0) {
$('.page-tabs-content').animate({ $('.page-tabs-content').animate({
marginLeft: (marginLeftVal + currentWidth) + 'px' marginLeft: (marginLeftVal + currentWidth) + 'px'
}, },
"fast"); "fast");
} }
// 移除当前选项卡 // 移除当前选项卡
@ -331,14 +331,14 @@ $(function() {
}); });
if($.common.isNotEmpty(panelUrl)){ if($.common.isNotEmpty(panelUrl)){
$('.menuTab[data-id="' + panelUrl + '"]').addClass('active').siblings('.menuTab').removeClass('active'); $('.menuTab[data-id="' + panelUrl + '"]').addClass('active').siblings('.menuTab').removeClass('active');
$('.mainContent .RuoYi_iframe').each(function() { $('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == panelUrl) { if ($(this).data('id') == panelUrl) {
$(this).show().siblings('.RuoYi_iframe').hide(); $(this).show().siblings('.RuoYi_iframe').hide();
return false; return false;
} }
}); });
} }
} }
} }
// 当前元素不处于活动状态 // 当前元素不处于活动状态
@ -387,22 +387,22 @@ $(function() {
// 刷新iframe // 刷新iframe
function refreshTab() { function refreshTab() {
var currentId = $('.page-tabs-content').find('.active').attr('data-id'); var currentId = $('.page-tabs-content').find('.active').attr('data-id');
var target = $('.RuoYi_iframe[data-id="' + currentId + '"]'); var target = $('.RuoYi_iframe[data-id="' + currentId + '"]');
var url = target.attr('src'); var url = target.attr('src');
target.attr('src', url).ready(); target.attr('src', url).ready();
} }
// 页签全屏 // 页签全屏
function fullScreenTab() { function fullScreenTab() {
var currentId = $('.page-tabs-content').find('.active').attr('data-id'); var currentId = $('.page-tabs-content').find('.active').attr('data-id');
var target = $('.RuoYi_iframe[data-id="' + currentId + '"]'); var target = $('.RuoYi_iframe[data-id="' + currentId + '"]');
target.fullScreen(true); target.fullScreen(true);
} }
// 关闭当前选项卡 // 关闭当前选项卡
function tabCloseCurrent() { function tabCloseCurrent() {
$('.page-tabs-content').find('.active i').trigger("click"); $('.page-tabs-content').find('.active i').trigger("click");
} }
//关闭其他选项卡 //关闭其他选项卡
@ -416,7 +416,7 @@ $(function() {
// 关闭全部选项卡 // 关闭全部选项卡
function tabCloseAll() { function tabCloseAll() {
$('.page-tabs-content').children("[data-id]").not(":first").each(function() { $('.page-tabs-content').children("[data-id]").not(":first").each(function() {
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove(); $('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').remove();
$(this).remove(); $(this).remove();
}); });
@ -430,7 +430,7 @@ $(function() {
// 全屏显示 // 全屏显示
$('#fullScreen').on('click', function () { $('#fullScreen').on('click', function () {
$(document).toggleFullScreen(); $(document).toggleFullScreen();
}); });
// 页签刷新按钮 // 页签刷新按钮
@ -464,8 +464,8 @@ $(function() {
// 关闭全屏 // 关闭全屏
$('#ax_close_max').click(function(){ $('#ax_close_max').click(function(){
$('#content-main').toggleClass('max'); $('#content-main').toggleClass('max');
$('#ax_close_max').hide(); $('#ax_close_max').hide();
}); });
// 双击选项卡全屏显示 // 双击选项卡全屏显示
@ -476,13 +476,13 @@ $(function() {
// 设置锚点 // 设置锚点
function setIframeUrl(href) { function setIframeUrl(href) {
if($.common.equals("history", mode)) { if($.common.equals("history", mode)) {
storage.set('publicPath', href); storage.set('publicPath', href);
} else { } else {
var nowUrl = window.location.href; var nowUrl = window.location.href;
var newUrl = nowUrl.substring(0, nowUrl.indexOf("#")); var newUrl = nowUrl.substring(0, nowUrl.indexOf("#"));
window.location.href = newUrl + "#" + href; window.location.href = newUrl + "#" + href;
} }
} }
$(window).keydown(function(event) { $(window).keydown(function(event) {
@ -764,7 +764,7 @@ var initUtil={
$.modal.loading("数据加载中,请稍后..."); $.modal.loading("数据加载中,请稍后...");
$('.mainContent iframe:visible').load(function () { $('.mainContent iframe:visible').on("load",function () {
$.modal.closeLoading(); $.modal.closeLoading();
}); });

10
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/js/common.js

@ -264,6 +264,16 @@ var storage = {
} }
}; };
// 返回当前激活的Tab页面关联的iframe的Windows对象
function activeWindow() {
var topWindow = $(window.parent.document);
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id');
if (!currentId) {
return window.parent;
}
return $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
}
/** 设置全局ajax处理 */ /** 设置全局ajax处理 */
$.ajaxSetup({ $.ajaxSetup({
complete: function(XMLHttpRequest, textStatus) { complete: function(XMLHttpRequest, textStatus) {

706
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/ruoyi/js/ry-ui.js

File diff suppressed because it is too large

4
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/resetPwd.html

@ -10,7 +10,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">登录名称:</label> <label class="col-sm-3 control-label">登录名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" readonly="true" name="secretName" th:value="${user.loginName}"/> <input class="form-control" type="text" readonly="true" name="secretName" id="userName" th:value="${user.loginName}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -37,11 +37,13 @@
function submitHandler() { function submitHandler() {
var password = $("#password").val(); var password = $("#password").val();
var userName = $("#userName").val();
if(!checkPwd(password)){ if(!checkPwd(password)){
return; return;
} }
$("#password").val(Encrypt(password)); $("#password").val(Encrypt(password));
$("#userName").val(Encrypt(userName));
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize()); $.operate.save(ctx + "system/user/resetPwd", $('#form-user-resetPwd').serialize());
} }

Loading…
Cancel
Save