diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java index 589a8c9838215473405d1c60e9f15a654aae3be5..eebfe68033c8b37cbcf569ce2d1c91590b6519cc 100644 --- a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java @@ -30,6 +30,16 @@ public interface SysEveUserDao { public List> queryDeskTopsMenuByUserId(Map userMation) throws Exception; public List> queryAllMenuByUserId(Map userMation) throws Exception; + + public int editUserInstallThemeColor(Map map) throws Exception; + + public int editUserInstallWinBgPic(Map map) throws Exception; + + public int editUserInstallWinLockBgPic(Map map) throws Exception; + + public int editUserInstallWinStartMenuSize(Map map) throws Exception; + + public int editUserInstallWinTaskPosition(Map map) throws Exception; diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinThemeColorDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinThemeColorDao.java index 094938f08920626dd9abd9b144389440a30d6701..845b319bab7aeac5b54c521da856352eece8dd9e 100644 --- a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinThemeColorDao.java +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinThemeColorDao.java @@ -20,4 +20,6 @@ public interface SysEveWinThemeColorDao { public int editSysEveWinThemeColorMationById(Map map) throws Exception; + public List> querySysEveWinThemeColorListToShow(Map map) throws Exception; + } diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java index 716c7aaca1fcc99fd4b06a9b9e068bad115e1f07..7733a96c0c7800339f3e5b088aa84dada2f09bc6 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java @@ -28,6 +28,16 @@ public interface SysEveUserService { public void queryDeskTopMenuBySession(InputObject inputObject, OutputObject outputObject) throws Exception; public void queryAllMenuBySession(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editUserInstallThemeColor(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editUserInstallWinBgPic(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editUserInstallWinLockBgPic(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editUserInstallWinStartMenuSize(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editUserInstallWinTaskPosition(InputObject inputObject, OutputObject outputObject) throws Exception; diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinThemeColorService.java b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinThemeColorService.java index 25c4748307ca3b29b231014b71f26025ce715022..aeb18b13b6331ff7bfa27c23787d6b5cba04501a 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinThemeColorService.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinThemeColorService.java @@ -15,4 +15,6 @@ public interface SysEveWinThemeColorService { public void editSysEveWinThemeColorMationById(InputObject inputObject, OutputObject outputObject) throws Exception; + public void querySysEveWinThemeColorListToShow(InputObject inputObject, OutputObject outputObject) throws Exception; + } diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java index eab581d26380af704a7ab310de0f5c9c18e77df8..c4d84fbcb48abdf703f1a4a4662cfaec0f0cdcf4 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java @@ -281,6 +281,116 @@ public class SysEveUserServiceImpl implements SysEveUserService{ List> deskTops = inputObject.getLogAllMenuParams(); outputObject.setBeans(deskTops); } + + /** + * + * @Title: editUserInstallThemeColor + * @Description: 自定义设置主题颜色 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editUserInstallThemeColor(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("userId", user.get("id")); + //修改reids中的用户信息 + user.put("winThemeColor", map.get("themeColor")); + jedisClient.set("userMation:" + user.get("id").toString(), JSON.toJSONString(user)); + jedisClient.expire("userMation:" + user.get("id").toString(), 1800);//时间为30分钟 + sysEveUserDao.editUserInstallThemeColor(map); + } + + /** + * + * @Title: editUserInstallWinBgPic + * @Description: 自定义设置win背景图片 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editUserInstallWinBgPic(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("userId", user.get("id")); + //修改reids中的用户信息 + user.put("winBgPicUrl", map.get("winBgPicUrl")); + jedisClient.set("userMation:" + user.get("id").toString(), JSON.toJSONString(user)); + jedisClient.expire("userMation:" + user.get("id").toString(), 1800);//时间为30分钟 + sysEveUserDao.editUserInstallWinBgPic(map); + } + + /** + * + * @Title: editUserInstallWinLockBgPic + * @Description: 自定义设置win锁屏背景图片 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editUserInstallWinLockBgPic(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("userId", user.get("id")); + //修改reids中的用户信息 + user.put("winLockBgPicUrl", map.get("winLockBgPicUrl")); + jedisClient.set("userMation:" + user.get("id").toString(), JSON.toJSONString(user)); + jedisClient.expire("userMation:" + user.get("id").toString(), 1800);//时间为30分钟 + sysEveUserDao.editUserInstallWinLockBgPic(map); + } + + /** + * + * @Title: editUserInstallWinStartMenuSize + * @Description: 自定义设置win开始菜单尺寸 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editUserInstallWinStartMenuSize(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("userId", user.get("id")); + //修改reids中的用户信息 + user.put("winStartMenuSize", map.get("winStartMenuSize")); + jedisClient.set("userMation:" + user.get("id").toString(), JSON.toJSONString(user)); + jedisClient.expire("userMation:" + user.get("id").toString(), 1800);//时间为30分钟 + sysEveUserDao.editUserInstallWinStartMenuSize(map); + } + + /** + * + * @Title: editUserInstallWinTaskPosition + * @Description: 自定义设置win任务栏在屏幕的位置 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editUserInstallWinTaskPosition(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("userId", user.get("id")); + //修改reids中的用户信息 + user.put("winTaskPosition", map.get("winTaskPosition")); + jedisClient.set("userMation:" + user.get("id").toString(), JSON.toJSONString(user)); + jedisClient.expire("userMation:" + user.get("id").toString(), 1800);//时间为30分钟 + sysEveUserDao.editUserInstallWinTaskPosition(map); + } diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinThemeColorServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinThemeColorServiceImpl.java index 35ad4262995ed59259fcea99a5c9b57e4a4821eb..8e52bf9445eb9fde0da60c1da715f24fb983d717 100644 --- a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinThemeColorServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinThemeColorServiceImpl.java @@ -118,5 +118,25 @@ public class SysEveWinThemeColorServiceImpl implements SysEveWinThemeColorServic outputObject.setreturnMessage("该win系统主题颜色名称已存在,不可进行二次保存"); } } + + /** + * + * @Title: querySysEveWinThemeColorListToShow + * @Description: 获取win系统主题颜色列表供展示 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void querySysEveWinThemeColorListToShow(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + List> beans = sysEveWinThemeColorDao.querySysEveWinThemeColorListToShow(map); + if(beans != null && !beans.isEmpty()){ + outputObject.setBeans(beans); + outputObject.settotal(beans.size()); + } + } } diff --git a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java index 1e57900ad6e03e8b8cd5503a1132e46dd9172cbe..f87a2d4be730a3d2a2bf91257072395999f061b8 100644 --- a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java +++ b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java @@ -207,4 +207,84 @@ public class SysEveUserController { sysEveUserService.queryAllMenuBySession(inputObject, outputObject); } + /** + * + * @Title: editUserInstallThemeColor + * @Description: 自定义设置主题颜色 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveUserController/editUserInstallThemeColor") + @ResponseBody + public void editUserInstallThemeColor(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveUserService.editUserInstallThemeColor(inputObject, outputObject); + } + + /** + * + * @Title: editUserInstallWinBgPic + * @Description: 自定义设置win背景图片 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveUserController/editUserInstallWinBgPic") + @ResponseBody + public void editUserInstallWinBgPic(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveUserService.editUserInstallWinBgPic(inputObject, outputObject); + } + + /** + * + * @Title: editUserInstallWinLockBgPic + * @Description: 自定义设置win锁屏背景图片 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveUserController/editUserInstallWinLockBgPic") + @ResponseBody + public void editUserInstallWinLockBgPic(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveUserService.editUserInstallWinLockBgPic(inputObject, outputObject); + } + + /** + * + * @Title: editUserInstallWinStartMenuSize + * @Description: 自定义设置win开始菜单尺寸 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveUserController/editUserInstallWinStartMenuSize") + @ResponseBody + public void editUserInstallWinStartMenuSize(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveUserService.editUserInstallWinStartMenuSize(inputObject, outputObject); + } + + /** + * + * @Title: editUserInstallWinTaskPosition + * @Description: 自定义设置win任务栏在屏幕的位置 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveUserController/editUserInstallWinTaskPosition") + @ResponseBody + public void editUserInstallWinTaskPosition(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveUserService.editUserInstallWinTaskPosition(inputObject, outputObject); + } + } diff --git a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinThemeColorController.java b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinThemeColorController.java index 02762fad7c801a522f03a7541121c591a160b942..b66e1c1bf6131ac21040ad048ddb5b4177852705 100644 --- a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinThemeColorController.java +++ b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinThemeColorController.java @@ -94,4 +94,20 @@ public class SysEveWinThemeColorController { sysEveWinThemeColorService.editSysEveWinThemeColorMationById(inputObject, outputObject); } + /** + * + * @Title: querySysEveWinThemeColorListToShow + * @Description: 获取win系统主题颜色列表供展示 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveWinThemeColorController/querySysEveWinThemeColorListToShow") + @ResponseBody + public void querySysEveWinThemeColorListToShow(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveWinThemeColorService.querySysEveWinThemeColorListToShow(inputObject, outputObject); + } + } diff --git a/skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml b/skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml index 6d308125dd12a9634e7ed8d5a9403e22faa48b97..9fd9442df3efe5944d00e66eb4785ddf1b9b237b 100644 --- a/skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml @@ -87,7 +87,10 @@ a.`password`, a.user_lock userLock, b.win_bg_pic_url winBgPicUrl, - b.win_lock_bg_pic_url winLockBgPicUrl + b.win_lock_bg_pic_url winLockBgPicUrl, + b.win_theme_color winThemeColor, + b.win_start_menu_size winStartMenuSize, + b.win_task_position winTaskPosition FROM sys_eve_user a LEFT JOIN sys_eve_user_install b ON a.id = b.user_id @@ -171,4 +174,44 @@ ORDER BY c.order_num ASC + + UPDATE sys_eve_user_install + + win_theme_color = #{themeColor} + + WHERE user_id = #{userId} + + + + UPDATE sys_eve_user_install + + win_bg_pic_url = #{winBgPicUrl} + + WHERE user_id = #{userId} + + + + UPDATE sys_eve_user_install + + win_lock_bg_pic_url = #{winLockBgPicUrl} + + WHERE user_id = #{userId} + + + + UPDATE sys_eve_user_install + + win_start_menu_size = #{winStartMenuSize} + + WHERE user_id = #{userId} + + + + UPDATE sys_eve_user_install + + win_task_position = #{winTaskPosition} + + WHERE user_id = #{userId} + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/dbmapper/SysEveWinThemeColorMapper.xml b/skyeye-web/src/main/resources/dbmapper/SysEveWinThemeColorMapper.xml index 3328d8a6e2db70eb19a0ce7e26426471ad4fa500..da641b5a6f66e6414e35894f421131af59a12984 100644 --- a/skyeye-web/src/main/resources/dbmapper/SysEveWinThemeColorMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/SysEveWinThemeColorMapper.xml @@ -70,4 +70,13 @@ WHERE id = #{id} + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index a5534849b577c813b7b90d3b773a3f1f67655c03..bb1793ebf1c57e3ecb5bed7fac76aa7fdbd81c50 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -135,6 +135,22 @@ + + + + + + + + + + + + + + + + @@ -225,6 +241,8 @@ + + diff --git a/skyeye-web/src/main/webapp/assets/lib/winui/winui.js b/skyeye-web/src/main/webapp/assets/lib/winui/winui.js index 97159211349ec474b2997ef6c41beab063dc611e..d75662e6c8b0319a31b14d4054b023f0c7fbc858 100644 --- a/skyeye-web/src/main/webapp/assets/lib/winui/winui.js +++ b/skyeye-web/src/main/webapp/assets/lib/winui/winui.js @@ -4,10 +4,9 @@ ; !function () { "use strict"; - var THIS = 'winui-this', SHOW = 'layui-show', MOVE = '.layui-layer-title', MOD_NAME = 'winui', taskbarHeight = 40 - + var THIS = 'winui-this', SHOW = 'layui-show', MOVE = '.layui-layer-title', MOD_NAME = 'winui', taskbarHeight = 40, //获取winui路径 - , getPath = function () { + getPath = function () { var doc = document; var jsPath = doc.currentScript ? doc.currentScript.src : function () { var js = doc.scripts, last = js.length - 1, src; @@ -20,40 +19,37 @@ return src || js[last].src; }(); return jsPath.substring(0, jsPath.lastIndexOf('/') + 1); - }() + }(), //判断变量是否是Dom对象 - , isDom = (typeof HTMLElement === 'object') ? function (obj) { + isDom = (typeof HTMLElement === 'object') ? function (obj) { return obj instanceof HTMLElement; } : function (obj) { return (obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string'); - } + }, //判断变量是否是Jq对象 - , isJquery = function (obj) { + isJquery = function (obj) { return obj instanceof $; } layui.define(['jquery', 'layer', 'element', 'form'], function (exports) { - var $ = layui.jquery, form = layui.form - + var $ = layui.jquery, form = layui.form, //开始磁贴 - , tile = { + tile = { data: null, setData: function (options) { common.setData(this, '/json/tile-item.json', options); } - } - + }, //任务栏 - , taskItem = { + taskItem = { on: function (eventname, callback) { call.on('taskItem(' + eventname + ')', callback); } - } - + }, //tab - , tab = { + tab = { init: function () { //Tab单击事件 common.resetClick('.winui-tab-nav li', function () { @@ -77,7 +73,7 @@ var Winui = function () { this.v = '1.0.0'; //版本号 this.path = getPath; - this.settings = layui.data('winui').settings || { + this.settings = { color: 31, taskbarMode: 'bottom', bgSrc: '../assets/winbgpic/default.jpg', @@ -91,36 +87,36 @@ required: [ /[\S]+/ , '必填项不能为空' - ] - , phone: [ + ], + phone: [ /^1\d{10}$/ , '请输入正确的手机号' - ] - , email: [ + ], + email: [ /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ , '邮箱格式不正确' - ] - , url: [ + ], + url: [ /(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/ , '链接格式不正确' - ] - , number: [ + ], + number: [ /^\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]))*$/ , '日期格式不正确' - ] - , identity: [ + ], + identity: [ /(^\d{15}$)|(^\d{17}(x|X|\d)$)/ , '请输入正确的身份证号' - ] - , double: [//验证小数点后两位,一般用于金钱验证 + ], + double: [//验证小数点后两位,一般用于金钱验证 /^[0-9]+(.[0-9]{1,2})?$/ , '请输入正确正数,小数点后最多两位' - ] - , postcode: [ + ], + postcode: [ /^\d{6}$/ , '请输入正确邮编' ] @@ -148,10 +144,10 @@ this.settings[key] = settings[key]; } return this; - } + }, //初始化 - , init: function (options, callback) { + init: function (options, callback) { var othis = this; var configs = othis.configs, settings = othis.settings, @@ -229,14 +225,12 @@ //初始化完毕回调 if (typeof callback === 'function') callback.call(othis); - } + }, //重置主题色 - , resetColor: function (color) { + resetColor: function (color) { if (color) { this.settings.color = color; - //缓存数据 - layui.data('winui', { key: 'settings', value: this.settings }); } this.renderColor(); //重置所有iframe的颜色 @@ -246,35 +240,33 @@ window.frames[i].winui.renderColor(); } } - } + }, //渲染主题色 - , renderColor: function () { + renderColor: function () { if (this.settings.color) { if ($('body').attr('class')) { $('body').attr('class', $('body').attr('class').replace(/\bwinui-color.*?\b/g, '').replace(/(^\s*)|(\s*$)/g, "")); } $('body').addClass('winui-color' + this.settings.color); } - } + }, //重置任务栏模式 - , resetTaskbar: function (taskbarMode) { + resetTaskbar: function (taskbarMode) { if (taskbarMode) { if (this.settings.taskbarMode === taskbarMode) return; this.settings.taskbarMode = taskbarMode; - //缓存数据 - layui.data('winui', { key: 'settings', value: this.settings }); } this.renderTaskbar(); if (taskbarMode) { this.taskbarChange(); } - } + }, //渲染任务栏模式 - , renderTaskbar: function () { + renderTaskbar: function () { if ($('body').attr('class')) { $('body').attr('class', $('body').attr('class').replace(/\btaskbarIn.*?\b/g, '').replace(/(^\s*)|(\s*$)/g, "")); } @@ -292,25 +284,23 @@ default: $('body').addClass('taskbarInBottom'); } - } + }, //重置开始菜单尺寸 - , resetStartSize: function (startSize) { + resetStartSize: function (startSize) { if (startSize) { if (this.settings.startSize === startSize) return; this.settings.startSize = startSize; - //缓存数据 - layui.data('winui', { key: 'settings', value: this.settings }); $('.preview-start').removeClass('xs sm lg'); $('.preview-start').addClass(startSize); } this.renderStartSize(); - } + }, //渲染开始菜单尺寸 - , renderStartSize: function () { + renderStartSize: function () { if ($('.winui-start').attr('class')) { $('.winui-start').attr('class', $('.winui-start').attr('class').replace(/\winui-start-size.*?\b/g, '').replace(/(^\s*)|(\s*$)/g, "")); //去掉winui-start-size的class后去除两边空格 } @@ -323,36 +313,32 @@ break; default: } - } + }, //重置背景图 - , resetBg: function (bgSrc) { + resetBg: function (bgSrc) { if (bgSrc) { this.settings.bgSrc = bgSrc; - //缓存数据 - layui.data('winui', { key: 'settings', value: this.settings }); } this.renderBg(); - } + }, //渲染背景图 - , renderBg: function () { + renderBg: function () { var bgSrc = this.settings.bgSrc; if (bgSrc) $('body').css('background-image', 'url(' + bgSrc + ')'); - } + }, //重置锁屏图 - , resetLockBg: function (bgSrc) { + resetLockBg: function (bgSrc) { if (bgSrc) { this.settings.lockBgSrc = bgSrc; - //缓存数据 - layui.data('winui', { key: 'settings', value: this.settings }); } - } + }, //全屏 - , fullScreen: function (element) { + fullScreen: function (element) { // 判断各种浏览器,找到正确的方法 var requestMethod = element.requestFullScreen || //W3C element.webkitRequestFullScreen || //Chrome等 @@ -367,10 +353,10 @@ wscript.SendKeys("{F11}"); } } - } + }, //退出全屏 - , exitFullScreen: function () { + exitFullScreen: function () { // 判断各种浏览器,找到正确的方法 var exitMethod = document.exitFullscreen || //W3C document.mozCancelFullScreen || //Chrome等 @@ -385,23 +371,23 @@ wscript.SendKeys("{F11}"); } } - } + }, //隐藏开始菜单 - , hideStartMenu: function () { + hideStartMenu: function () { $('.winui-start').addClass('layui-hide'); - } + }, //返回GUID - , guid: function () { + guid: function () { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); - } + }, //验证表单 - , verifyForm: function (button) { + verifyForm: function (button) { var button = $(button), stop = null, device = layui.device(), @@ -431,10 +417,10 @@ if (stop) return stop; }); return !stop; - } + }, //显示系统时间 - , sysTime: function (selector, formatStr) { + sysTime: function (selector, formatStr) { return setInterval(function () { //获取系统时间。 var dateTime = new Date(); @@ -477,15 +463,15 @@ //将时间显示到指定的位置,时间格式形如:19:18:02 $(selector).html(str); }, 1000); - } + }, //停止显示时间 - , stopSysTime: function (obj) { + stopSysTime: function (obj) { window.clearInterval(obj); - } + }, //任务栏自适应 - , taskAuto: function () { + taskAuto: function () { var res = true; $('.winui-taskbar-task').each(function () { var thisWidth = parseInt($(this).prop('scrollWidth')); @@ -498,10 +484,10 @@ } }); return res; - } + }, //任务栏改变 - , taskbarChange: function () { + taskbarChange: function () { //根据任务栏模式调整位置 switch (this.settings.taskbarMode) { case 'top': @@ -520,15 +506,15 @@ break; default: } - } + }, //获取Winui设置 - , getSetting: function (settingKey) { + getSetting: function (settingKey) { return this.settings[settingKey]; - } + }, //锁屏 - , lockScreen: function (callback) { + lockScreen: function (callback) { var self = this; $('.winui-taskbar').css('zIndex', '0'); $.get(winui.path + '../../../tpl/index/lockscreen.html', {}, function (content) { @@ -838,13 +824,9 @@ //阻止冒泡 $('.sp').off('click mousedown').on('click mousedown', call.sp); - window.winui = new Winui(); - winui.tab.init(); - exports('winui', {}); - delete layui.winui; }); }(window); diff --git a/skyeye-web/src/main/webapp/js/index/index.js b/skyeye-web/src/main/webapp/js/index/index.js index bbe858bf5025977ef396ae2bca0a7ed478f663da..a437cd061c58d222e0ce0a1a8fd9f194ec4d0f52 100644 --- a/skyeye-web/src/main/webapp/js/index/index.js +++ b/skyeye-web/src/main/webapp/js/index/index.js @@ -59,13 +59,13 @@ }); winui.config({ - settings: layui.data('winui').settings || { - color: 32, - taskbarMode: 'bottom', - startSize: 'sm', + settings: { + color: json.bean.winThemeColor, + taskbarMode: json.bean.winTaskPosition, + startSize: json.bean.winStartMenuSize, bgSrc: json.bean.winBgPicUrl, lockBgSrc: json.bean.winLockBgPicUrl - }, //如果本地配置为空则给默认值 + }, desktop: {//桌面菜单栏 options: { url: reqBasePath + 'login004', diff --git a/skyeye-web/src/main/webapp/js/systheme/systheme.js b/skyeye-web/src/main/webapp/js/systheme/systheme.js index f700ca8af23c2b6d196ad15aade069fb38815475..f2c921deb3c71ea078d39f1d3851e86475abd2da 100644 --- a/skyeye-web/src/main/webapp/js/systheme/systheme.js +++ b/skyeye-web/src/main/webapp/js/systheme/systheme.js @@ -45,8 +45,14 @@ layui.config({ }, options: {'click .bgPicItem':function(index, row){ var bgSrc = row.picUrl; - $('.background-preview').css('background-image', 'url(' + bgSrc + ')'); - winui.resetBg(bgSrc); + AjaxPostUtil.request({url:reqBasePath + "sys025", params:{winBgPicUrl: bgSrc}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + $('.background-preview').css('background-image', 'url(' + bgSrc + ')'); + winui.resetBg(bgSrc); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); } }, ajaxSendAfter:function(json){ @@ -65,12 +71,42 @@ layui.config({ }, options: {'click .lockBgPicItem':function(index, row){ var bgSrc = row.picUrl; - $('.lockscreen-preview').css('background-image', 'url(' + bgSrc + ')'); - winui.resetLockBg(bgSrc); + AjaxPostUtil.request({url:reqBasePath + "sys026", params:{winLockBgPicUrl: bgSrc}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + $('.lockscreen-preview').css('background-image', 'url(' + bgSrc + ')'); + winui.resetLockBg(bgSrc); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); } }, ajaxSendAfter:function(json){ initCustomLockBackGroundPic(); + //初始化主题色 + showGrid({ + id: "color-choose", + url: reqBasePath + "sysevewinthemecolor006", + params: {}, + pagination: false, + template: getFileContent('tpl/systheme/color-choose.tpl'), + ajaxSendLoadBefore: function(hdb){ + }, + ajaxSendAfter:function(json){ + //颜色选择 + $('.color-choose>div').on('click', function () { + var color = Number($(this)[0].classList[0].replace('theme-color-', '')); + AjaxPostUtil.request({url:reqBasePath + "sys024", params:{themeColor: color}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + winui.resetColor(color); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + + }); + } + }); } }); } @@ -109,8 +145,14 @@ layui.config({ }); }, 'click .bgPicItem1':function(index, row){ var bgSrc = row.picUrl; - $('.background-preview').css('background-image', 'url(' + bgSrc + ')'); - winui.resetBg(bgSrc); + AjaxPostUtil.request({url:reqBasePath + "sys025", params:{winBgPicUrl: bgSrc}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + $('.background-preview').css('background-image', 'url(' + bgSrc + ')'); + winui.resetBg(bgSrc); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); } }, ajaxSendAfter:function(json){ @@ -145,8 +187,14 @@ layui.config({ }); }, 'click .lockBgPicItem1':function(index, row){ var bgSrc = row.picUrl; - $('.lockscreen-preview').css('background-image', 'url(' + bgSrc + ')'); - winui.resetLockBg(bgSrc); + AjaxPostUtil.request({url:reqBasePath + "sys026", params:{winLockBgPicUrl: bgSrc}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + $('.lockscreen-preview').css('background-image', 'url(' + bgSrc + ')'); + winui.resetLockBg(bgSrc); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); } }, ajaxSendAfter:function(json){ @@ -206,49 +254,25 @@ layui.config({ } }); - //颜色选择 - $('.color-choose>div').on('click', function () { - var color = Number($(this)[0].classList[0].replace('theme-color-', '')); - winui.resetColor(color); - }); - - form.on('switch(toggleTransparent)', function (data) { - if (data.elem.checked) { - $(data.elem).siblings('span').text('开'); - } else { - $(data.elem).siblings('span').text('关'); - } - layer.msg(unfinished); - }); - - form.on('switch(toggleTaskbar)', function (data) { - if (data.elem.checked) { - $(data.elem).siblings('span').text('开'); - } else { - $(data.elem).siblings('span').text('关'); - } - }); //任务栏位置 form.on('radio(taskPosition)', function (data) { - switch (data.value) { - case 'top': - winui.resetTaskbar(data.value); - break; - case 'bottom': - winui.resetTaskbar(data.value); - break; - case 'left': - winui.window.msg(unfinished); - break; - case 'right': - winui.window.msg(unfinished); - break; - default: - } + AjaxPostUtil.request({url:reqBasePath + "sys028", params:{winTaskPosition: data.value}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + winui.resetTaskbar(data.value); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); }); //开始菜单尺寸 form.on('radio(startSize)', function (data) { - winui.resetStartSize(data.value); + AjaxPostUtil.request({url:reqBasePath + "sys027", params:{winStartMenuSize: data.value}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + winui.resetStartSize(data.value); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); }); }); }); \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/systheme/color-choose.tpl b/skyeye-web/src/main/webapp/tpl/systheme/color-choose.tpl new file mode 100644 index 0000000000000000000000000000000000000000..aa0bb8303a859372bfb70bec6f75c2c2154daf03 --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/systheme/color-choose.tpl @@ -0,0 +1,3 @@ +{{#each rows}} +
+{{/each}} \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/systheme/systheme.html b/skyeye-web/src/main/webapp/tpl/systheme/systheme.html index f29af981912d12f8c0d10bf061638a8ae252a811..3930cbb08e8d5c0d346e0f42f9f1837defad2904 100644 --- a/skyeye-web/src/main/webapp/tpl/systheme/systheme.html +++ b/skyeye-web/src/main/webapp/tpl/systheme/systheme.html @@ -1,7 +1,6 @@  -
主题
@@ -22,9 +21,7 @@

预览

-
- -
+

示例文本 @@ -44,9 +41,7 @@

预览

-
- -
+

示例文本 @@ -54,56 +49,7 @@

主题色

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

显示"开始"菜单、任务栏和操作中心颜色(未实现)

-
- -
-

显示标题栏颜色(未实现)

-
- -
+
@@ -124,9 +70,7 @@

预览

-
- -
+

示例文本