提交 878c1915 编写于 作者: Skyeye云's avatar Skyeye云

桌面图标锐化展示,前端值校验修改

上级 fd486b19
...@@ -46,22 +46,22 @@ activiti.database.username=root ...@@ -46,22 +46,22 @@ activiti.database.username=root
activiti.database.password=123456 activiti.database.password=123456
#redis 1连接信息 #redis 1连接信息
redis.ip1=192.168.1.140 redis.ip1=192.168.0.140
redis.host1=9000 redis.host1=9000
#redis 2连接信息 #redis 2连接信息
redis.ip2=192.168.1.140 redis.ip2=192.168.0.140
redis.host2=9001 redis.host2=9001
#redis 3连接信息 #redis 3连接信息
redis.ip3=192.168.1.140 redis.ip3=192.168.0.140
redis.host3=9002 redis.host3=9002
#redis 4连接信息 #redis 4连接信息
redis.ip4=192.168.1.140 redis.ip4=192.168.0.140
redis.host4=9003 redis.host4=9003
#redis 5连接信息 #redis 5连接信息
redis.ip5=192.168.1.140 redis.ip5=192.168.0.140
redis.host5=9004 redis.host5=9004
#redis 6连接信息 #redis 6连接信息
redis.ip6=192.168.1.140 redis.ip6=192.168.0.140
redis.host6=9005 redis.host6=9005
redis.commandTimeout=1000 redis.commandTimeout=1000
......
...@@ -275,6 +275,7 @@ button{ ...@@ -275,6 +275,7 @@ button{
line-height: 70px; line-height: 70px;
width: 50px; width: 50px;
margin-left: 9px; margin-left: 9px;
border-radius: 5px;
} }
.winui-desktop-item > .winui-icon-img { .winui-desktop-item > .winui-icon-img {
...@@ -2484,6 +2485,7 @@ body .layer-ext-winconfirm { ...@@ -2484,6 +2485,7 @@ body .layer-ext-winconfirm {
padding: 0px 4px 6px 4px; padding: 0px 4px 6px 4px;
position: relative; position: relative;
background-color: rgba(255, 255, 255, 0.19); background-color: rgba(255, 255, 255, 0.19);
border-radius: 5px;
} }
.icon-drawer-icon{ .icon-drawer-icon{
...@@ -2493,6 +2495,7 @@ body .layer-ext-winconfirm { ...@@ -2493,6 +2495,7 @@ body .layer-ext-winconfirm {
margin-top: 3px; margin-top: 3px;
margin-left: 1px; margin-left: 1px;
line-height: 17px; line-height: 17px;
border-radius: 3px;
} }
.title-icon{ .title-icon{
......
...@@ -87,40 +87,48 @@ ...@@ -87,40 +87,48 @@
this.event = {}; //自定义事件 this.event = {}; //自定义事件
this.verify = { this.verify = {
required: [ required: [
/[\S]+/ /[\S]+/,
, '必填项不能为空' '必填项不能为空'
], ],
phone: [ phone: [
/^1\d{10}$/ /(^$)|^1\d{10}$/,
, '请输入正确的手机号' '请输入正确的手机号'
],
tel: [
/(^$)|^0\d{2,3}-?\d{7,8}$/,
'请输入正确的电话号'
], ],
email: [ email: [
/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ /(^$)|^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,
, '邮箱格式不正确' '邮箱格式不正确'
], ],
url: [ url: [
/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/ /(^$)|(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,
, '链接格式不正确' '链接格式不正确'
], ],
number: [ number: [
/^\d+$/ /(^$)|^\d+$/,
, '只能填写数字' '只能填写数字'
], ],
date: [ date: [
/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/ /(^$)|^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,
, '日期格式不正确' '日期格式不正确'
], ],
identity: [ identity: [
/(^\d{15}$)|(^\d{17}(x|X|\d)$)/ /(^$)|(^\d{15}$)|(^\d{17}(x|X|\d)$)/,
, '请输入正确的身份证号' '请输入正确的身份证号'
], ],
double: [//验证小数点后两位,一般用于金钱验证 double: [//验证小数点后两位,一般用于金钱验证
/^[0-9]+(.[0-9]{1,2})?$/ /(^$)|^[0-9]+(.[0-9]{1,2})?$/,
, '请输入正确正数,小数点后最多两位' '请输入正确正数,小数点后最多两位'
], ],
postcode: [ postcode: [
/^\d{6}$/ /(^$)|^\d{6}$/,
, '请输入正确邮编' '请输入正确邮编'
],
money: [
/(^$)|^0{1}([.]\d{1,2})?$|^[1-9]\d*([.]{1}[0-9]{1,2})?$/,
'请输入正确的金额, 可保留小数点后两位'
] ]
}; //表单验证 }; //表单验证
...@@ -414,6 +422,10 @@ ...@@ -414,6 +422,10 @@
elem = button.parents('.layui-form'), elem = button.parents('.layui-form'),
verifyElem = elem.find('*[win-verify]'),//获取需要校验的元素 verifyElem = elem.find('*[win-verify]'),//获取需要校验的元素
that = this; that = this;
//请求遮罩层
$("body").find(".mask-req-str").remove();
var maskReqStr = '<div class="mask-req-str"><div class="cent"><i class="fa fa-spin fa-spinner fa-fw"></i><br><br><font>数据请求中</font></div></div>';
$("body").append(maskReqStr);
layui.each(verifyElem, function (index, item) { layui.each(verifyElem, function (index, item) {
var othis = $(this), ver = othis.attr('win-verify').split('|'); var othis = $(this), ver = othis.attr('win-verify').split('|');
var tips = '', value = othis.val(); var tips = '', value = othis.val();
...@@ -422,14 +434,16 @@ ...@@ -422,14 +434,16 @@
var isFn = typeof that.verify[thisVer] === 'function'; var isFn = typeof that.verify[thisVer] === 'function';
if (that.verify[thisVer] && (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) { if (that.verify[thisVer] && (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) {
layer.msg(tips || that.verify[thisVer][1], { layer.msg(tips || that.verify[thisVer][1], {
icon: 5 icon: 5,
, shift: 6 shift: 6
}); });
//非移动设备自动定位焦点 //非移动设备自动定位焦点
if (!device.android && !device.ios) { if (!device.android && !device.ios) {
item.focus(); item.focus();
} }
othis.addClass(DANGER); othis.addClass(DANGER);
//移除请求遮罩层
$("body").find(".mask-req-str").remove();
return stop = true; return stop = true;
} }
}); });
...@@ -493,14 +507,16 @@ ...@@ -493,14 +507,16 @@
taskAuto: function () { taskAuto: function () {
var res = true; var res = true;
$('.winui-taskbar-task').each(function () { $('.winui-taskbar-task').each(function () {
var thisWidth = parseInt($(this).prop('scrollWidth')); if($(this).css("display") === 'block'){//判断当前操作的是哪个任务窗口
var childWidth = parseInt($(this).children().length * 165); var thisWidth = parseInt($(this).prop('scrollWidth'));
//响应式 var childWidth = parseInt($(this).children().length * 165);
if (thisWidth - 165 < childWidth) { //响应式
layer.msg('任务栏装不下啦', { zIndex: layer.zIndex }); if (thisWidth - 165 < childWidth) {
res = false; layer.msg('任务栏装不下啦', { zIndex: layer.zIndex });
return false; res = false;
} return false;
}
}
}); });
return res; return res;
}, },
...@@ -535,7 +551,6 @@ ...@@ -535,7 +551,6 @@
//锁屏 //锁屏
lockScreen: function (callback) { lockScreen: function (callback) {
var self = this; var self = this;
$('.winui-taskbar').css('zIndex', '0');
$.get(winui.path + '../../../tpl/index/lockscreen.html', {}, function (content) { $.get(winui.path + '../../../tpl/index/lockscreen.html', {}, function (content) {
layer.open({ layer.open({
id: 'winui-lockscreen', id: 'winui-lockscreen',
...@@ -591,12 +606,18 @@ ...@@ -591,12 +606,18 @@
} }
$(document).on('mouseup', docMouseup); $(document).on('mouseup', docMouseup);
$(document).on('keydown', docKeydown); $(document).on('keydown', docKeydown);
$('.winui-taskbar').css('z-index', '0');
$('.talk-mabal .layui-layer-close').click();
$('.talk-btn').hide();
//解锁点击 //解锁点击
form.on('submit(unlock)', function (data) { form.on('submit(unlock)', function (data) {
try { try {
if (typeof callback === 'function' && callback.call(this, data.field.password)) { if (typeof callback === 'function' && callback.call(this, data.field.password)) {
layer.close(layerindex); layer.close(layerindex);
window.localStorage.setItem("lockscreen", false); window.localStorage.setItem("lockscreen", false);
$('.winui-taskbar').css('z-index', '99980000');
$('.talk-btn').show();
} }
} catch (e) { } catch (e) {
console.error(e); console.error(e);
...@@ -647,7 +668,7 @@ ...@@ -647,7 +668,7 @@
//添加任务项(返回添加的任务项dom) //添加任务项(返回添加的任务项dom)
, addTaskItem: function (id, title) { , addTaskItem: function (id, title) {
var taskItem = $('<li win-id="' + id + '" class="winui-task-item">' + title + '</li>'); var taskItem = $('<li win-id="' + id + '" class="winui-task-item">' + title + '</li>');
$('.winui-taskbar-task').append(taskItem); $('.winui-taskbar-task:visible').append(taskItem);
return taskItem; return taskItem;
} }
...@@ -716,9 +737,9 @@ ...@@ -716,9 +737,9 @@
//定位桌面应用 //定位桌面应用
, locaApp: function () { , locaApp: function () {
//计算一竖排能容纳几个应用 //计算一竖排能容纳几个应用
var appHeight = 96; var appHeight = 103;
var appWidth = 90; var appWidth = 90;
var maxCount = parseInt($('.winui-desktop').height() / 93); var maxCount = parseInt($('.winui-desktop').height() / 100);
var oldTemp = 0; var oldTemp = 0;
var rowspan = 0; var rowspan = 0;
var colspan = 0; var colspan = 0;
...@@ -772,7 +793,52 @@ ...@@ -772,7 +793,52 @@
} }
} }
}); });
} },
//图片url获取主题色
imgUrlToThemeColor: function(url, cb, light) {
if(!light) {
light = 1.0
}
var img = new Image;
img.src = url;
img.crossOrigin = 'anonymous'; //跨域声明(只在chrome和firefox有效——吗?)
img.onload = function() {
try {
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctxt = canvas.getContext('2d');
ctxt.drawImage(img, 0, 0);
var data = ctxt.getImageData(0, 0, img.width, img.height).data; //读取整张图片的像素。
var r = 0,
g = 0,
b = 0,
a = 0;
var red, green, blue, alpha;
var pixel = img.width * img.height;
for(var i = 0, len = data.length; i < len; i += 4) {
red = data[i];
r += red; //红色色深
green = data[i + 1];
g += green; //绿色色深
blue = data[i + 2];
b += blue; //蓝色色深
alpha = data[i + 3];
a += alpha; //透明度
}
r = parseInt(r / pixel * light);
g = parseInt(g / pixel * light);
b = parseInt(b / pixel * light);
a = 1; //a/pixel/255;
var color = "rgba(" + r + "," + g + "," + b + "," + a + ")";
if(cb) {
cb(color);
}
} catch(e) {
console.warn(e)
}
};
},
}; };
//基础事件 //基础事件
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册