change - 代码生产bug修改,编辑页面切换问题

main
wenjy 3 years ago
parent ee5cbc6f31
commit e28f5f32dc

@ -6,9 +6,12 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://121.36.58.109:3306/power_iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://121.36.58.109:3306/power_iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: Haiwei123456
url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Haiwei123456 password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -1,7 +1,7 @@
# 项目相关配置 # 项目相关配置
ruoyi: ruoyi:
# 名称 # 名称
name: RuoYi name: WenJY
# 版本 # 版本
version: 4.7.1 version: 4.7.1
# 版权年份 # 版权年份

@ -0,0 +1,124 @@
/**
* @author: Dennis Hernández
* @webSite: http://djhvscf.github.io/Blog
* @update zhixin wen <wenzhixin2010@gmail.com>
*/
const debounce = (func, wait) => {
let timeout = 0
return (...args) => {
const later = () => {
timeout = 0
func(...args)
}
clearTimeout(timeout)
timeout = setTimeout(later, wait)
}
}
$.extend($.fn.bootstrapTable.defaults, {
mobileResponsive: false,
minWidth: 562,
minHeight: undefined,
heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
checkOnInit: true,
columnsHidden: []
})
$.BootstrapTable = class extends $.BootstrapTable {
init (...args) {
super.init(...args)
if (!this.options.mobileResponsive || !this.options.minWidth) {
return
}
if (this.options.minWidth < 100 && this.options.resizable) {
console.warn('The minWidth when the resizable extension is active should be greater or equal than 100')
this.options.minWidth = 100
}
let old = {
width: $(window).width(),
height: $(window).height()
}
$(window).on('resize orientationchange', debounce(() => {
// reset view if height has only changed by at least the threshold.
const width = $(window).width()
const height = $(window).height()
const $activeElement = $(document.activeElement)
if ($activeElement.length && ['INPUT', 'SELECT', 'TEXTAREA'].includes($activeElement.prop('nodeName'))) {
return
}
if (
Math.abs(old.height - height) > this.options.heightThreshold ||
old.width !== width
) {
this.changeView(width, height)
old = {
width,
height
}
}
}, 200))
if (this.options.checkOnInit) {
const width = $(window).width()
const height = $(window).height()
this.changeView(width, height)
old = {
width,
height
}
}
}
conditionCardView () {
this.changeTableView(false)
this.showHideColumns(false)
}
conditionFullView () {
this.changeTableView(true)
this.showHideColumns(true)
}
changeTableView (cardViewState) {
this.options.cardView = cardViewState
this.toggleView()
}
showHideColumns (checked) {
if (this.options.columnsHidden.length > 0) {
this.columns.forEach(column => {
if (this.options.columnsHidden.includes(column.field)) {
if (column.visible !== checked) {
this._toggleColumn(this.fieldsColumnsIndex[column.field], checked, true)
}
}
})
}
}
changeView (width, height) {
if (this.options.minHeight) {
if ((width <= this.options.minWidth) && (height <= this.options.minHeight)) {
this.conditionCardView()
} else if ((width > this.options.minWidth) && (height > this.options.minHeight)) {
this.conditionFullView()
}
} else if (width <= this.options.minWidth) {
this.conditionCardView()
} else if (width > this.options.minWidth) {
this.conditionFullView()
}
this.resetView()
}
}

@ -0,0 +1 @@
$.fn.bootstrapTable.locales["zh-CN"]={formatShowSearch:function formatShowSearch(){return"隐藏/显示搜索"},formatPageGo:function formatPageGo(){return"跳转"},formatCopyRows:function formatCopyRows(){return"复制行"},formatPrint:function formatPrint(){return"打印"},formatLoadingMessage:function formatLoadingMessage(){return"正在努力地加载数据中,请稍候"},formatRecordsPerPage:function formatRecordsPerPage(pageNumber){return"每页显示 ".concat(pageNumber," 条记录")},formatShowingRows:function formatShowingRows(pageFrom,pageTo,totalRows,totalNotFiltered){if(totalNotFiltered!==undefined&&totalNotFiltered>0&&totalNotFiltered>totalRows){return"显示第 ".concat(pageFrom," 到第 ").concat(pageTo," 条记录,总共 ").concat(totalRows," 条记录(从 ").concat(totalNotFiltered," 总记录中过滤)")}return"显示第 ".concat(pageFrom," 到第 ").concat(pageTo," 条记录,总共 ").concat(totalRows," 条记录")},formatSRPaginationPreText:function formatSRPaginationPreText(){return"上一页"},formatSRPaginationPageText:function formatSRPaginationPageText(page){return"第".concat(page,"页")},formatSRPaginationNextText:function formatSRPaginationNextText(){return"下一页"},formatDetailPagination:function formatDetailPagination(totalRows){return"总共 ".concat(totalRows," 条记录")},formatClearSearch:function formatClearSearch(){return"清空过滤"},formatSearch:function formatSearch(){return"搜索"},formatNoMatches:function formatNoMatches(){return"没有找到匹配的记录"},formatPaginationSwitch:function formatPaginationSwitch(){return"隐藏/显示分页"},formatPaginationSwitchDown:function formatPaginationSwitchDown(){return"显示分页"},formatPaginationSwitchUp:function formatPaginationSwitchUp(){return"隐藏分页"},formatRefresh:function formatRefresh(){return"刷新"},formatToggle:function formatToggle(){return"切换"},formatToggleOn:function formatToggleOn(){return"显示卡片视图"},formatToggleOff:function formatToggleOff(){return"隐藏卡片视图"},formatColumns:function formatColumns(){return"列"},formatColumnsToggleAll:function formatColumnsToggleAll(){return"切换所有"},formatFullscreen:function formatFullscreen(){return"全屏"},formatAllRows:function formatAllRows(){return"所有"},formatAutoRefresh:function formatAutoRefresh(){return"自动刷新"},formatExport:function formatExport(){return"导出数据"},formatJumpTo:function formatJumpTo(){return"跳转"},formatAdvancedSearch:function formatAdvancedSearch(){return"高级搜索"},formatAdvancedCloseButton:function formatAdvancedCloseButton(){return"关闭"},formatFilterControlSwitch:function formatFilterControlSwitch(){return"隐藏/显示过滤控制"},formatFilterControlSwitchHide:function formatFilterControlSwitchHide(){return"隐藏过滤控制"},formatFilterControlSwitchShow:function formatFilterControlSwitchShow(){return"显示过滤控制"}};$.extend($.fn.bootstrapTable.defaults,$.fn.bootstrapTable.locales["zh-CN"]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -0,0 +1,180 @@
/*this is basic form validation using for validation person's basic information author:Clara Guo data:2017/07/20*/
$(document).ready(function(){
$.validator.setDefaults({
submitHandler: function(form) {
form.submit();
}
});
//手机号码验证身份证正则合并:(^\d{15}$)|(^\d{17}([0-9]|X)$)
jQuery.validator.addMethod("isPhone",function(value,element){
var length = value.length;
var phone=/^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
return this.optional(element)||(length == 11 && phone.test(value));
},"请填写正确的11位手机号");
//电话号码验证
jQuery.validator.addMethod("isTel",function(value,element){
var tel = /^(0\d{2,3}-)?\d{7,8}$/g;//区号3,4位,号码7,8位
return this.optional(element) || (tel.test(value));
},"请填写正确的座机号码");
//姓名校验
jQuery.validator.addMethod("isName",function(value,element){
var name=/^[\u4e00-\u9fa5]{2,6}$/;
return this.optional(element) || (name.test(value));
},"姓名只能用汉字,长度2-4位");
//校验用户名
jQuery.validator.addMethod("isUserName",function(value,element){
var userName=/^[a-zA-Z0-9]{2,13}$/;
return this.optional(element) || (userName).test(value);
},'请输入数字或者字母,不包含特殊字符');
//校验身份证
jQuery.validator.addMethod("isIdentity",function(value,element){
var id= /^(\d{15}$|^\d{18}$|^\d{17}(\d|X))$/;
return this.optional(element) || (id.test(value));
},"请输入正确的15或18位身份证号,末尾为大写X");
//校验出生日期
jQuery.validator.addMethod("isBirth",function(value,element){
var birth = /^(19|20)\d{2}-(1[0-2]|0?[1-9])-(0?[1-9]|[1-2][0-9]|3[0-1])$/;
return this.optional(element) || (birth).test(value);
},"出生日期格式示例2000-01-01");
//校验IP地址
jQuery.validator.addMethod("isIp",function(value,element){
var ip = /^(?:(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:1[0-9][0-9]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:2[0-4][0-9])|(?:25[0-5])|(?:1[0-9][0-9])|(?:[1-9][0-9])|(?:[0-9]))$/;
return this.optional(element) || (ip).test(value);
},"IP地址格式示例127.0.0.1");
jQuery.validator.addMethod("notEqual", function(value, element, param) {
return value != param;
}, $.validator.format("输入值不允许为{0}"));
jQuery.validator.addMethod("gt", function(value, element, param) {
return value > param;
}, $.validator.format("输入值必须大于{0}"));
//校验新旧密码是否相同
jQuery.validator.addMethod("isdiff",function(){
var p1=$("#pwdOld").val();
var p2=$("#pwdNew").val();
if(p1==p2){
return false;
}else{
return true;
}
});
//校验新密码和确认密码是否相同
jQuery.validator.addMethod("issame",function(){
var p3=$("#confirm_password").val();
var p4=$("#pwdNew").val();
if(p3==p4){
return true;
}else{
return false;
}
});
//校验基础信息表单
$("#basicInfoForm").validate({
errorElement:'span',
errorClass:'help-block error-mes',
rules:{
name:{
required:true,
isName:true
},
sex:"required",
birth:"required",
mobile:{
required:true,
isPhone:true
},
email:{
required:true,
email:true
}
},
messages:{
name:{
required:"请输入中文姓名",
isName:"姓名只能为汉字"
},
sex:{
required:"请输入性别"
},
birth:{
required:"请输入出生年月"
},
mobile:{
required:"请输入手机号",
isPhone:"请填写正确的11位手机号"
},
email:{
required:"请输入邮箱",
email:"请填写正确的邮箱格式"
}
},
errorPlacement:function(error,element){
element.next().remove();
element.closest('.gg-formGroup').append(error);
},
highlight:function(element){
$(element).closest('.gg-formGroup').addClass('has-error has-feedback');
},
success:function(label){
var el = label.closest('.gg-formGroup').find("input");
el.next().remove();
label.closest('.gg-formGroup').removeClass('has-error').addClass("has-feedback has-success");
label.remove();
},
submitHandler:function(form){
alert("保存成功!");
}
});
//校验修改密码表单
$("#modifyPwd").validate({
onfocusout: function(element) { $(element).valid()},
debug:false, //表示校验通过后是否直接提交表单
onkeyup:false, //表示按键松开时候监听验证
rules:{
pwdOld:{
required:true,
minlength:6
},
pwdNew:{
required:true,
minlength:6,
isdiff:true,
//issame:true,
},
confirm_password:{
required:true,
minlength:6,
issame:true,
}
},
messages:{
pwdOld : {
required:'必填',
minlength:$.validator.format('密码长度要大于6')
},
pwdNew:{
required:'必填',
minlength:$.validator.format('密码长度要大于6'),
isdiff:'原密码与新密码不能重复',
},
confirm_password:{
required:'必填',
minlength:$.validator.format('密码长度要大于6'),
issame:'新密码要与确认新密码一致',
}
},
errorElement:"mes",
errorClass:"gg-star",
errorPlacement: function(error, element)
{
element.closest('.gg-formGroup').append(error);
}
});
});

File diff suppressed because one or more lines are too long

@ -0,0 +1,25 @@
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語)
*/
var icon = "<i class='fa fa-times-circle'></i> ";
$.extend($.validator.messages, {
required: icon + "必填",
remote: icon + "请修正此字段",
email: icon + "请输入有效的电子邮件",
url: icon + "请输入有效的网址",
date: icon + "请输入有效的日期",
dateISO: icon + "请输入有效的日期 (YYYY-MM-DD)",
number: icon + "请输入有效的数字",
digits: icon + "只能输入数字",
creditcard: icon + "请输入有效的信用卡号码",
equalTo: icon + "你的输入不相同",
extension: icon + "请输入有效的后缀",
maxlength: $.validator.format(icon + "最多可以输入 {0} 个字符"),
minlength: $.validator.format(icon + "最少要输入 {0} 个字符"),
rangelength: $.validator.format(icon + "请输入长度在 {0} 到 {1} 之间的字符串"),
range: $.validator.format(icon + "请输入范围在 {0} 到 {1} 之间的数值"),
step: $.validator.format(icon + "请输入 {0} 的整数倍值" ),
max: $.validator.format(icon + "请输入不大于 {0} 的数值"),
min: $.validator.format(icon + "请输入不小于 {0} 的数值")
});

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>智慧物联监控平台</title>
<!-- 避免IE使用兼容模式 --> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/> <link th:href="@{favicon.ico}" rel="shortcut icon"/>

@ -286,6 +286,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/img/**", "anon"); filterChainDefinitionMap.put("/img/**", "anon");
filterChainDefinitionMap.put("/ajax/**", "anon"); filterChainDefinitionMap.put("/ajax/**", "anon");
filterChainDefinitionMap.put("/js/**", "anon"); filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/genjs/**", "anon");
filterChainDefinitionMap.put("/ruoyi/**", "anon"); filterChainDefinitionMap.put("/ruoyi/**", "anon");
filterChainDefinitionMap.put("/captcha/captchaImage**", "anon"); filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
// 退出 logout地址shiro去清除session // 退出 logout地址shiro去清除session

Loading…
Cancel
Save