From 02710f6140a98d6b5d1765d8c43ce282c7a229b4 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 13 Dec 2021 11:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BD=91=E4=B8=8A=E5=8A=9E?= =?UTF-8?q?=E4=BA=8B=E5=A4=A7=E5=8E=85JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/js/DragSSO/aLeft.js | 22 ++ .../Content/js/DragSSO/inSecHead.js | 302 ++++++++++++++++ .../Content/js/DragSSO/index.js | 245 +++++++++++++ .../Content/js/DragSSO/index2.js | 227 ++++++++++++ .../Content/js/DragSSO/index3.js | 338 ++++++++++++++++++ .../Content/js/DragSSO/indexData.js | 91 +++++ .../Content/js/DragSSO/main.js | 144 ++++++++ .../Content/js/DragSSO/sortable.js | 59 +++ .../Learun.Application.Web.csproj | 8 + 9 files changed, 1436 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/aLeft.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/inSecHead.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index2.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index3.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/aLeft.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/aLeft.js new file mode 100644 index 000000000..44b33f8b5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/aLeft.js @@ -0,0 +1,22 @@ +var inSec3Row = $('.inSec3Row'); +$(window).load(function() { + //左侧tab切换 + $('.inSec1Tab').on('click', '.inSec1TabBox', function() { + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active'); + $('.indSec1Box .inSec1Box').removeClass('active').eq(ind).addClass('active'); + }) + //左侧菜单显示隐藏 + $('.index_sec1').on('click', '.inSecLeftCon', function() { + var ind = $(this).index(); + var parents = $(this).parents('.index_sec1'); + parents.addClass('active').find('.inSec1TabBox').removeClass('active').eq(ind).addClass('active').end().end().find('.inSec1Box').removeClass('active').eq(ind).addClass('active'); + $('.indexSec3Box').css('paddingLeft', '510px') + }).on('click', '.aLeft', function() { + var parents = $(this).parents('.index_sec1'); + parents.removeClass('active'); + $('.indexSec3Box').css('paddingLeft', '0') + }) +}) + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/inSecHead.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/inSecHead.js new file mode 100644 index 000000000..ba7ca308d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/inSecHead.js @@ -0,0 +1,302 @@ +$(document).ready(function () { + + //桌面切换 + $('.inSec3Head').on('click', '.inSec3HeadTab', function () { + if ($(this).hasClass('active')) return; + var ind = $(this).attr('ind'); + $('.inSec3Row.active').sortable("destroy"); + $(this).addClass('active').siblings('.inSec3HeadTab').removeClass('active'); + $('.inSec3Row').css('display', 'none').removeClass('active').siblings('.inSec3Row[ind="' + ind + '"]').fadeIn().addClass('active'); + sortableInit(); + }); + //桌面设置弹框中的事件 + $('.desktopSetBox').on('click', '.faR', function () {//点击默认桌面-恢复标识,显示恢复提示 + $(this).parents('.deskSetLi').addClass('active') + }).on('click', '.deskSetClose', function () {//点击提示中关闭标识,不显示恢复提示 + $(this).parents('.deskSetLi').removeClass('active'); + }).on('click', '.deskSetTrue', function () {//点击提示中确定标识,添加桌面或者重置桌面 + var parents = $(this).parents('.deskSetLi'); + if (parents.hasClass('deskSetLiNew')) { + var inputs = parents.find('input'); + desktopNew(inputs.val()); + inputs.val('新建桌面'); + } else { + var txt = $(this).parent().attr('txt'); + parents.removeClass('active'); + var desktopId = parents.attr('desktopId'); + var defaultFlag = parents.attr('defaultFlag'); + if (defaultFlag != 1) { + var ind = parents.attr('ind'); + desktopDel(ind, desktopId); + } else { + //ajax默认桌面的恢复操作 + if (desktopId != "" && desktopId != undefined) { + $.ajax({ + url: "/SSOSystem/RestoreDefaultDesktop", + headers: { __RequestVerificationToken: $.lrToken }, + data: { desktopId: desktopId }, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + layer.msg('恢复成功!'); + //操作成功后执行的代码开始 + location.reload(); + //操作成功后执行的代码结束 + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + } + } + } + }).on('click', '.deskNameTxt', function () { + $(this).siblings('.deskNameInput').addClass('active').find('input').focus(); + }).on('blur', '.deskSetList input', function () { //桌面名称表单失去焦点时 + var parents = $(this).parents('.deskSetLi'); + var ind = parents.attr('ind'); + var txt = $(this).val(); + if (txt.length == 0) { + layer.msg('桌面不能为空!'); + $(this).focus(); + return; + } + //ajax桌面的修改名称操作 + var desktopId = parents.attr('desktopId'); + if (desktopId != "" && desktopId != undefined) { + $.ajax({ + url: "/SSOSystem/ModifyDesktop", + headers: { __RequestVerificationToken: $.lrToken }, + data: { desktopId: desktopId, desktopName: txt }, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + layer.msg('桌面名称修改成功!'); + //操作成功后执行的代码开始 + parents.find('.deskNameInput').removeClass('active').siblings('.deskNameTxt').find('b').html(txt); + $('.inSec3HeadTab[ind="' + ind + '"] .inSec3HeadTabTxt').html(txt); + //操作成功后执行的代码结束 + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + } + }).on('input', '.deskNameInput input', function () { //监听桌面名称表单input事件 + var txt = $(this).val(); + var len = txt.length; + if (len >= 8) { + len = 8; + $(this).val(txt.substring(0, 8)) + } + $(this).siblings('span').html(len + '/8') + }).on('click', '.deskSetLiNew .deskName', function () { + $(this).parents('.deskSetLi').addClass('active'); + }).on('click', '.desktopSet > img', function () {//点击桌面设置弹框右上角关闭按钮 + $('.desktopSetBox').removeClass('active'); + }).on('click', '.deskSetBtn', function () {//点击桌面设置弹框的完成按钮 + $('.desktopSetBox').removeClass('active'); + }); + //点击桌面栏-设置按钮,显示桌面设置弹框 + $('.inSec3Setting').on('click', function () { + deskNum(); + $('.desktopSetBox').addClass('active'); + }); + //监听layer添加桌面弹框中表单的input事件 + $(document).on('input', '.layerInput input', function () { + var txt = $(this).val(); + var len = txt.length; + if (len >= 8) { + len = 8; + txt = txt.substring(0, 8); + } + if (len == 0) { + txt = '新建桌面'; + } + $(this).val(txt); + }); + //点击桌面栏-添加按钮,显示layer添加桌面弹框 + $('.inSec3HeadAdd').on('click', function () { + var _this = $(this); + layer.open({ + type: 1, + title: '命名桌面', + btnAlign: 'c', + content: htmlLayer, + area: ['300px', 'auto'], + btn: ['保存', '取消'], + yes: function (index, layero) { + //按钮【按钮一】的回调 + desktopNew($('.layerInput input').val()); + layer.close(index); + }, + btn2: function (index, layero) { + //按钮【按钮二】的回调 + //return false 开启该代码可禁止点击该按钮关闭 + } + }) + + }); + //桌面设置弹框中桌面的排序 + //$('.deskSetList').sortable({ + // opacity: 0.8, + // containment: '.deskSetList', + // handle: '.fa-navicon', + // // helper: 'clone', + // // scroll: false, + // cursor: "move", + // stop: function(event, ui) { + // //当排序停止时触发该事件。 + // var ind = $('.inSec3HeadTab.active').attr('ind'); + // $('.inSec3HeadTabBox').html(''); + // $('.deskSetList .deskSetLi').each(function(i, n){ + // var num = $(this).attr('ind'); + // var txt = $(n).find('input').val(); + // var className = $(n).find('.deskNameTxt span').length? 'newlyBuild' : ''; + // var active = num == ind? 'active' : ''; + // var html = '
'+ + // '
'+ txt +'
'+ + // '
'+ + // '
'; + // $('.inSec3HeadTabBox').append(html) + // }) + // }, + //}); + +}); +$(window).load(function () { + cardData() +}); + +//新建桌面 +function desktopNew(name) { + var ind = getRandomNum(); + //ajax自建桌面新增操作,操作成功后执行下面代码,需要返回Id值并绑定到htmlT的desktopId中; + var modelCode = $('#ModelCode').val(); + var userId = $('#UserId').val(); + if (userId != "" && userId != undefined && modelCode != "" && modelCode != undefined && name != "" && name != undefined && ind != "" && ind != undefined) { + $.ajax({ + url: "/SSOSystem/AddDesktop", + headers: { __RequestVerificationToken: $.lrToken }, + data: { userId: userId, modelCode: modelCode, desktopName: name, desktopCode: ind }, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + layer.msg('添加桌面成功!'); + if (res.data != null) { + //操作成功后执行代码开始 + var htmlC = '
' + noCard + '
'; + var htmlT = '
' + + '
' + name + '
' + + '
' + + '
'; + var deskSetLi = '
' + + '' + + '
' + + '
' + name + '
' + + '
' + + '' + + '4/8' + + '
' + + '
' + + '' + + '
' + + '确认删除该桌面?' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '
' + + '
'; + $('.deskSetLiNew').removeClass('active').find('.deskNameInput').removeClass('active'); + $('.inSec3Row.active').sortable("destroy"); + $('.inSec3RowBox').append(htmlC).find('.inSec3Row').css('display', 'none').removeClass('active').last().addClass('active').fadeIn(); + $('.inSec3HeadTabBox').append(htmlT).find('.inSec3HeadTab').removeClass('active').last().addClass('active'); + $('.deskSetList').append(deskSetLi); + sortableInit(); + deskNum(); + //最多新建3个桌面 + if (($('.inSec3HeadTab').length + 1) > desktopNum) { + $('.inSec3HeadAdd').css('display', 'none').next().css('display', 'none'); + $('.deskSetLiNew').css('display', 'none'); + } + //操作成功后执行代码结束 + } + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + } + +} +//删除桌面 +function desktopDel(ind, desktopId) { + //ajax自建桌面的删除操作 + if (desktopId != "" && desktopId != undefined) { + $.ajax({ + url: "/SSOSystem/DeleteDesktop", + headers: { __RequestVerificationToken: $.lrToken }, + data: { desktopId: desktopId }, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + layer.msg('删除该桌面成功!'); + //操作成功后执行代码开始 + $('.deskSetLi[ind="' + ind + '"]').remove(); + $('.inSec3HeadTab[ind="' + ind + '"]').next().remove().end().remove(); + var inSec3Row = $('.inSec3Row[ind="' + ind + '"]'); + if (inSec3Row.hasClass('active')) { + $('.inSec3Row.active').sortable("destroy"); + inSec3Row.remove(); + $('.inSec3Row').eq(0).addClass('active').fadeIn(); + $('.inSec3HeadTab').eq(0).addClass('active'); + sortableInit() + } else { + inSec3Row.remove(); + } + deskNum(); + $('.inSec3HeadAdd').css('display', 'inline-block').next().css('display', 'inline-block'); + $('.deskSetLiNew').css('display', 'block'); + //操作成功后执行代码结束 + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + } + +} +//初始化桌面设置 +function deskNum() { + $('.deskSetInfo span').eq(0).html($('.newlyBuild').length); +} +//获取随机数 +function getRandomNum() { + var now = new Date(); + var result = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + now.getMilliseconds(); + return result; +} +//console.log(getRandomNum()); \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index.js new file mode 100644 index 000000000..83fc0745c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index.js @@ -0,0 +1,245 @@ +var inSec3Row = $('.inSec3Row'); + +layui.use('form', function() { + layer = layui.layer; + let form = layui.form; + + // form.render() + //监听select选择 专业总览 + form.on('select', function(data) { + //console.log(data); + }); +}); +// console.log(11) + +$(window).load(function() { + cardData() + //监测页面变化 + resizes() + setTimeout(function() { + resizes() + }, 0) + + //右侧菜单显示隐藏 + $('.index_sec2').on('click', '.inSecLeftCon', function() { + var ind = $(this).index(); + var parents = $(this).parents('.index_sec2'); + if(ind == 3){ + parents.find('.inSec2TabBox').removeClass('active').eq(1).addClass('active').end().end().find('.inSec2Con').removeClass('active').eq(1).addClass('active').end().end().find('.inSec2Con') + }else{ + parents.find('.inSec2TabBox').removeClass('active').eq(0).addClass('active').end().end().find('.inSec2Con').removeClass('active').eq(0).addClass('active').end().end().find('.inSec2Llist li').removeClass('active').eq(ind).addClass('active').end().end().find('.inSec3WorkBox').css('display', 'none').eq(ind).fadeIn(); + } + + parents.addClass('active') + $('.indexSec3Box').css('paddingRight', '445px') + }).on('click', '.aRight', function() { + var parents = $(this).parents('.index_sec2'); + parents.removeClass('active'); + $('.indexSec3Box').css('paddingRight', '0') + }) + //右侧tab切换 + $('.inSec2Tab').on('click', '.inSec2TabBox', function() { + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active'); + $('.indexSec2Box .inSec2Con').removeClass('active').eq(ind).addClass('active'); + }) + //办公事项 + $('.inSec3Con').on('click', '.workList li', function() { + if ($(this).hasClass('active')) return; + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active').parents('.inSec3Con').find('.inSec3WorkBox').css( + 'display', 'none').eq(ind).fadeIn(); + }) + + //任务 + $('.inSec2Con').on('click', '.inSec2Llist li', function() { + if ($(this).hasClass('active')) return; + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active').parents('.inSec2Con').find('.inSec3WorkBox').css( + 'display', 'none').eq(ind).fadeIn(); + }).on('click', '.indexSec2Li i', function(e) { + //消息移除 + //阻止默认浏览器动作(W3C) + if (e && e.preventDefault) { + e.preventDefault(); + } else { //IE中阻止函数器默认动作的方式 + window.e.returnValue = false; + } + e.stopPropagation(); + var parents = $(this).parents('.indexSec2Li'); + parents.animate({opacity: 0.2, left: '80%'}, 300, function(){ + parents.remove() + }) + }) + + + //办公业务流量 + //serviceEchart() + //专业总览 + //majorEchart() +}).resize(function() { + resizes() +}) + +function resizes() { + +} + + + +//专业总览 +//function majorEchart() { +// var myChart5 = echarts.init(document.getElementById('major')); + +// option = { +// tooltip: { +// trigger: 'item', +// formatter: '{b} : {c}' +// }, +// series: [{ +// name: '专业学生', +// type: 'pie', +// radius: [60, 75], +// center: ['50%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#6C5CEA', '#57C5F5', '#E7C900', '#FF9C95', '#59D078', '#C97FEF', '#ECBD02', '#DF59B8', '#F6685E', +// '#00E7B9', '#7A74F1', '#4A9ADE', '#33F0E5', '#ECBD02', '#DF59B8' +// ], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '物理', +// }, +// { +// value: 5, +// name: '数学', +// }, +// { +// value: 15, +// name: '化学', +// }, +// { +// value: 15, +// name: '历史', +// }, +// { +// value: 5, +// name: '医学', +// }, +// { +// value: 15, +// name: '计算机', +// }, +// { +// value: 15, +// name: '矿业', +// } +// ] +// }, { +// name: '班级总数', +// type: 'pie', +// radius: [50, 65], +// center: ['17%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#59D078', '#57C5F5', '#E7C900'], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '班级总数', +// }] +// }, { +// name: '专业教室', +// type: 'pie', +// radius: [50, 65], +// center: ['83%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#3E49E2', '#677BF5', '#67A0F5', '#E7C900'], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '教室1', +// }, { +// value: 5, +// name: '教室2', +// }, { +// value: 20, +// name: '教室3', +// }, { +// value: 30, +// name: '教室4', +// }] +// }, ] +// }; + +// // 使用刚指定的配置项和数据显示图表。 +// myChart5.setOption(option); +// window.addEventListener("resize", function() { +// myChart5.resize(); +// }); +//} + + +//办公业务流量 +//function serviceEchart() { +// // 基于准备好的dom,初始化echarts实例 +// myChart2 = echarts.init(document.getElementById('serviceEchart')); + +// option = { +// tooltip: { +// trigger: 'axis' +// }, +// color: ['#CB0005', '#EF9116', '#466AD2', '#7408A6', '#0CB5C4', '#DEBC03', '#0BB56C', '#CB1FA1'], +// legend: { +// data: ['语文'], +// icon: "circle", +// itemWidth: 7, +// right: '40px', +// top: '20px' +// }, +// grid: { +// left: '3%', +// right: '3%', +// bottom: '3%', +// top: '23%', +// containLabel: true +// }, +// xAxis: { +// type: 'category', +// name: '星期', +// boundaryGap: false, +// data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], +// formatter: function(params) { +// console.log(params) +// // return params[0].name + ' : ' + params[0].value + ' 小时'; +// }, +// }, +// yAxis: { +// type: 'value', +// name: '办公量', +// }, +// series: [{ +// name: '办公量', +// type: 'line', +// stack: '总量', +// // lineStyle: { +// // color: '#000' +// // }, +// data: [120, 132, 101, 134, 90, 230, 210] +// }] +// }; + +// // 使用刚指定的配置项和数据显示图表。 +// myChart2.setOption(option); +// window.addEventListener("resize", function() { +// myChart2.resize(); +// }); +//} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index2.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index2.js new file mode 100644 index 000000000..2ef5cf17c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index2.js @@ -0,0 +1,227 @@ +var inSec3Row = $('.inSec3Row'); +var layer = null; +layui.use('form', function() { + layer = layui.layer; + let form = layui.form; + + // form.render() + //监听select选择 专业总览 + form.on('select', function(data) { + //console.log(data); + }); +}); +$(window).load(function() { + //监测页面变化 + resizes() + setTimeout(function() { + resizes() + }, 0) + //导航栏 + $(".headModeList li").eq(0).removeClass("active"); + $(".headModeList li").eq(1).addClass("active"); + $(".headModeList li").eq(2).removeClass("active"); + $(".headModeTxt").find('span').html($(".headModeList li").eq(1).find('a').html()); + + //右侧菜单显示隐藏 + $('.index_sec2').on('click', '.inSecLeftCon', function() { + var ind = $(this).index(); + var parents = $(this).parents('.index_sec2'); + if(ind == 3){ + parents.find('.inSec2TabBox').removeClass('active').eq(1).addClass('active').end().end().find('.inSec2Con').removeClass('active').eq(1).addClass('active').end().end().find('.inSec2Con') + }else{ + parents.find('.inSec2TabBox').removeClass('active').eq(0).addClass('active').end().end().find('.inSec2Con').removeClass('active').eq(0).addClass('active').end().end().find('.inSec2Llist li').removeClass('active').eq(ind).addClass('active').end().end().find('.inSec3WorkBox').css('display', 'none').eq(ind).fadeIn(); + } + + parents.addClass('active') + $('.indexSec3Box').css('paddingRight', '445px') + }).on('click', '.aRight', function() { + var parents = $(this).parents('.index_sec2'); + parents.removeClass('active'); + $('.indexSec3Box').css('paddingRight', '0') + }) + //右侧tab切换 + $('.inSec2Tab').on('click', '.inSec2TabBox', function() { + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active'); + $('.indexSec2Box .inSec2Con').removeClass('active').eq(ind).addClass('active'); + }) + //办公事项 + $('.inSec3Con').on('click', '.workList li', function() { + if ($(this).hasClass('active')) return; + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active').parents('.inSec3Con').find('.inSec3WorkBox').css( + 'display', 'none').eq(ind).fadeIn(); + }) + + + + //办公业务流量 + //serviceEchart() + //专业总览 + //majorEchart() +}).resize(function() { + resizes() +}) + +function resizes() { + +} + + + +//专业总览 +//function majorEchart() { +// var myChart5 = echarts.init(document.getElementById('major')); + +// option = { +// tooltip: { +// trigger: 'item', +// formatter: '{b} : {c}' +// }, +// series: [{ +// name: '专业学生', +// type: 'pie', +// radius: [60, 75], +// center: ['50%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#6C5CEA', '#57C5F5', '#E7C900', '#FF9C95', '#59D078', '#C97FEF', '#ECBD02', '#DF59B8', '#F6685E', +// '#00E7B9', '#7A74F1', '#4A9ADE', '#33F0E5', '#ECBD02', '#DF59B8' +// ], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '物理', +// }, +// { +// value: 5, +// name: '数学', +// }, +// { +// value: 15, +// name: '化学', +// }, +// { +// value: 15, +// name: '历史', +// }, +// { +// value: 5, +// name: '医学', +// }, +// { +// value: 15, +// name: '计算机', +// }, +// { +// value: 15, +// name: '矿业', +// } +// ] +// }, { +// name: '班级总数', +// type: 'pie', +// radius: [50, 65], +// center: ['17%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#59D078', '#57C5F5', '#E7C900'], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '班级总数', +// }] +// }, { +// name: '专业教室', +// type: 'pie', +// radius: [50, 65], +// center: ['83%', '50%'], +// label: { +// // show: true +// show: false +// }, +// color: ['#3E49E2', '#677BF5', '#67A0F5', '#E7C900'], +// // hoverAnimation: false, +// data: [{ +// value: 10, +// name: '教室1', +// }, { +// value: 5, +// name: '教室2', +// }, { +// value: 20, +// name: '教室3', +// }, { +// value: 30, +// name: '教室4', +// }] +// }, ] +// }; + +// // 使用刚指定的配置项和数据显示图表。 +// myChart5.setOption(option); +// window.addEventListener("resize", function() { +// myChart5.resize(); +// }); +//} + + +//办公业务流量 +//function serviceEchart() { +// // 基于准备好的dom,初始化echarts实例 +// myChart2 = echarts.init(document.getElementById('serviceEchart')); + +// option = { +// tooltip: { +// trigger: 'axis' +// }, +// color: ['#CB0005', '#EF9116', '#466AD2', '#7408A6', '#0CB5C4', '#DEBC03', '#0BB56C', '#CB1FA1'], +// legend: { +// data: ['语文'], +// icon: "circle", +// itemWidth: 7, +// right: '40px', +// top: '20px' +// }, +// grid: { +// left: '3%', +// right: '3%', +// bottom: '3%', +// top: '23%', +// containLabel: true +// }, +// xAxis: { +// type: 'category', +// name: '星期', +// boundaryGap: false, +// data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], +// formatter: function(params) { +// console.log(params) +// // return params[0].name + ' : ' + params[0].value + ' 小时'; +// }, +// }, +// yAxis: { +// type: 'value', +// name: '办公量', +// }, +// series: [{ +// name: '办公量', +// type: 'line', +// stack: '总量', +// // lineStyle: { +// // color: '#000' +// // }, +// data: [120, 132, 101, 134, 90, 230, 210] +// }] +// }; + +// // 使用刚指定的配置项和数据显示图表。 +// myChart2.setOption(option); +// window.addEventListener("resize", function() { +// myChart2.resize(); +// }); +//} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index3.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index3.js new file mode 100644 index 000000000..a7d46d77d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/index3.js @@ -0,0 +1,338 @@ +$(window).load(function () { + //导航栏 + $(".headModeList li").eq(0).removeClass("active"); + $(".headModeList li").eq(1).removeClass("active"); + $(".headModeList li").eq(2).addClass("active"); + $(".headModeTxt").find('span').html($(".headModeList li").eq(2).find('a').html()); + + //学生到课率预警 + var toClassNum = 20; + var toClassBl = $('.toClassBl') + if (toClassNum < 60) { + toClassBl.addClass('green').height(toClassNum + '%') + } else if (toClassNum >= 60 && toClassNum < 80) { + toClassBl.addClass('blue').height(toClassNum + '%') + } else if (toClassNum >= 80) { + toClassBl.addClass('red').height(toClassNum + '%') + } + //专业总览 + majorEchart() + + //课程总览 + classEchart() + + //教师年龄比例 + ageEchart() + + //教师学历比例 + eduEchart() + + // 学生成绩预警 + achWarnEchart() + + // 学生逃课预警 + skipEchart() + + var layer = null; + layui.use('form', function() { + layer = layui.layer; + let form = layui.form; + + // form.render() + //监听select选择 专业总览 + form.on('select', function(data) { + console.log(data); + }); + }); + + +}); + +//教师学历比例 +function eduEchart() { + var myChart6 = echarts.init(document.getElementById('education')); + option = { + tooltip: { + formatter: function(n) { //"{a}
{b} : {d}({c}%)" + //console.log(n) + return n.name + '
' + n.value + '人' + '(' + n.percent + '%)' + } + }, + // calculable: true, + series: [{ + name: '教师学历比例', + type: 'funnel', + width: '100%', + height: '80%', + x: '0%', + y: '10%', + sort: 'ascending', + label: { + // show: false, + position: 'center' + }, + labelLine: { + show: false, + }, + color: ['#F6685E', '#ECBD02', '#67A0F5', '#198BE3', '#F6685E', '#DEBC03', '#0BB56C', '#CB1FA1'], + data: TeacherByHighestRecord + }] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart6.setOption(option); + window.addEventListener("resize", function() { + myChart6.resize(); + }); +} + +// 教师年龄比例 +function ageEchart() { + var myChart6 = echarts.init(document.getElementById('age')); + + option = { + tooltip: { + trigger: 'item', + formatter: '{b} : {c}人 ({d}%)' + }, + legend: { + // orient: 'vertical', + textStyle: { //图例文字的样式 + color: '#424242', + fontSize: 10 + }, + left: 0, + bottom: 0, + itemWidth: 8, + itemHeight: 8, + data: ['20~30岁', '30~40岁', '40~50岁', '50~60岁', '60岁以上'] + }, + color: ['#00E7B9', '#7486F1', '#FCF13E', '#ECBD02', '#F6685E', '#DEBC03', '#0BB56C', '#CB1FA1'], + series: [{ + name: '教师年龄比例', + type: 'pie', + radius: [30, 50], + center: ['55%', '50%'], + label: { + show: true + }, + roseType: 'radius', + data: TeacherByAge + }] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart6.setOption(option); + window.addEventListener("resize", function() { + myChart6.resize(); + }); +} + + +//课程总览 +function classEchart() { + // 基于准备好的dom,初始化echarts实例 + var myChart3 = echarts.init(document.getElementById('class')); + + option = { + tooltip: { + trigger: 'item', + formatter: '{b} : {c}' + }, + + series: [{ + name: '课程分类', + type: 'pie', + radius: [42, 57], + center: ['50%', '50%'], + hoverAnimation: false, + zlevel: 2, + color: ['#59D078', '#8F66E1'], + data: LessonBySort + }, + { + name: '课程类型', + type: 'pie', + radius: [70, 85], + center: ['50%', '50%'], + hoverAnimation: false, + color: ['#ECBD02', '#00E7B9'], + data: LessonByType + } + ] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart3.setOption(option); + window.addEventListener("resize", function() { + myChart3.resize(); + }); +} + +//专业总览 +function majorEchart() { + var myChart5 = echarts.init(document.getElementById('major')); + + option = { + tooltip: { + trigger: 'item', + formatter: '{b} : {c}' + }, + series: [{ + name: '专业学生', + type: 'pie', + radius: [60, 75], + center: ['50%', '50%'], + label: { + // show: true + show: false + }, + color: ['#6C5CEA', '#57C5F5', '#E7C900', '#FF9C95', '#59D078', '#C97FEF', '#ECBD02', '#DF59B8', '#F6685E', + '#00E7B9', '#7A74F1', '#4A9ADE', '#33F0E5', '#ECBD02', '#DF59B8' + ], + // hoverAnimation: false, + data: StuByMajor + }, { + name: '班级总数', + type: 'pie', + radius: [50, 65], + center: ['17%', '50%'], + label: { + // show: true + show: false + }, + color: ['#59D078', '#57C5F5', '#E7C900'], + // hoverAnimation: false, + data: [{ + value: ClassInfoTotalNum, + name: '班级总数', + }] + }, { + name: '专业教室', + type: 'pie', + radius: [50, 65], + center: ['83%', '50%'], + label: { + // show: true + show: false + }, + color: ['#3E49E2', '#677BF5', '#67A0F5', '#E7C900'], + // hoverAnimation: false, + data: [{ + value: ClassRoomTotalNum, + name: '教室总数', + }] + }, ] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart5.setOption(option); + window.addEventListener("resize", function() { + myChart5.resize(); + }); +} + +// 学生逃课预警 +function skipEchart() { + // 基于准备好的dom,初始化echarts实例 + var myChart8 = echarts.init(document.getElementById('skipClass')); + + option = { + tooltip: { + formatter: '{a} : {c}%' + }, + series: [{ + name: '学生逃课预警', + type: 'gauge', + radius: "70%", + center: ["50%", "50%"], + axisLine: { + show: true, + lineStyle: { + color: [ //表盘颜色 + [0.6, "#0AB56B"], //0-50%处的颜色 + [0.8, "#64CDFE"], //51%-70%处的颜色 + [1, "#E44E4E"], //70%-90%处的颜色 + ], + width: 15 //表盘宽度 + } + }, + splitLine: { + show: false, + }, + axisLabel: { + show: true, + formatter: function(v) { + // console.log(v) + switch (v + '') { + case '30': + return '低'; + case '70': + return '中'; + case '90': + return '高'; + } + }, + distance: -50 //文字离表盘的距离 + }, + axisTick: { + show: false, + }, + detail: { + formatter: "{score|{value}%}", + offsetCenter: [0, "80%"], + height: 30, + rich: { + score: { + fontSize: 16 + } + } + }, + data: [{ + value: 5, + name: '', + label: { + textStyle: { + fontSize: 12 + } + } + }] + }] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart8.setOption(option); + window.addEventListener("resize", function() { + myChart8.resize(); + }); +} + +// 学生成绩预警 +function achWarnEchart() { + var myChart5 = echarts.init(document.getElementById('achWarn')); + + option = { + tooltip: { + trigger: 'item', + formatter: '{b} : {c}人({d}%)' + }, + color: ['#EB5858', '#FB8383', '#FDACAC', '#FECACA', '#FFE2E2', '#DEBC03', '#0BB56C', '#CB1FA1'], + series: [{ + name: '全校', + type: 'pie', + radius: [50, 60], + center: ['50%', '50%'], + label: { + // show: false + }, + hoverAnimation: false, + data: StuScoreByMajor + }] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart5.setOption(option); + window.addEventListener("resize", function() { + myChart5.resize(); + }); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js new file mode 100644 index 000000000..82dfdc1b3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js @@ -0,0 +1,91 @@ +var layer = null; +var inSec3TabArr = [2, 3, 4]; +//inSec3TabArr.splice($.inArray(ind,inSec3TabArr),1); +//最多新建3个桌面 2个默认桌面 +var desktopNum = 5; +//没有卡片 +var noCard = '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
从左侧选择需要的应用卡片
' + + '
' + + '
' + + '
' + + '
'; +//没有数据 +var noHtml = '
' + + '
' + + '
暂时没有数据
' + + '
'; +// + +//添加桌面 +var htmlLayer = '
'; +// 拖拽 排序 初始化 +function sortableInit() { + $('.inSec3Row.active').sortable({ + opacity: 0.8, + containment: '.inSec3Row.active', + handle: '.inSecT', + helper: 'clone', + scroll: false, + cursor: "move", + stop: function (event, ui) { + //当排序停止时触发该事件。 + serializes() + }, + }); + cardData() +} + +//当排序停止时触发该事件。 +function serializes() { + var gg = $(".inSec3Row.active").sortable("serialize", { + key: "sort" + }); + //console.log(gg);//sort=1&sort=2&sort=3&sort=4&sort=5&sort=6&sort=7&sort=8&sort=9&sort=10&sort=11&sort=12&sort=13 + var result = gg.replace(/sort=/g, "").replace(/&/g, ","); + //console.log(result); + //ajax提交用户排序 + var desktopId = $('.inSec3HeadTabBox').find('.inSec3HeadTab.active').attr('desktopId'); + var modelCode = $('#ModelCode').val(); + var userId = $('#UserId').val(); + if (userId != "" && userId != undefined && desktopId != "" && desktopId != undefined && modelCode != "") { + $.ajax({ + url: "/SSOSystem/SaveCardSort", + headers: { __RequestVerificationToken: $.lrToken }, + data: { userId: userId, modelCode: modelCode, desktopId: desktopId, cardSort: result }, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + layer.msg('操作成功!'); + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + } + + +} +//初始化可用卡片 +function cardData() { + $('.inSec1Drag .fa').removeClass('fa-minus').addClass('fa-plus'); + $('.inSec3Row.active > div').each(function (i, n) { + var id = $(n).attr('id'); + if (id == 'noHtml') return + id = id.split('_')[1]; + $('#' + id).find('.fa').removeClass('fa-plus').addClass('fa-minus'); + }) +} + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js new file mode 100644 index 000000000..0e3fe997f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/main.js @@ -0,0 +1,144 @@ +// JavaScript Document localStorage +var skinLink = $('#skinLink'); +var skins = localStorage.getItem('skinLink'); +skins ? skinLink.attr('href', '/Content/css/DragSSO/' + skins + '.css') : ''; +$(document).ready(function () { + if (skins) { + skinLink.attr('href', '/Content/css/DragSSO/' + skins + '.css'); + $('.skins[skin="' + skins + '"]').addClass('active').siblings().removeClass('active'); + } + var qrCodeBox = $('.qrCodeBox'); + var loginForm = $('#loginForm'); + //var qrcode = new QRCode(document.getElementById("qrCode"), { + // width: 200, + // height: 200 + //}); + //makeCode('http://192.168.1.126:8081/Login/Index'); + // header search + $(document).on('click', function () { + $('.skinBox').removeClass('active'); + }).on('click', '.headSearch', function () { + $('body').addClass('active'); + }).on('click', '.headSearchImg', function () { + if ($('body').hasClass('active')) { + var keyword = $('#headSearchInput').val(); + if ($.trim(keyword) != "") { + $.each($('.search').find('.searchLi'), function (i, item) { + if ($(item).children('.searchLiTxt').html().indexOf(keyword) != -1) { + $(item).show(); + } else { + $(item).hide(); + } + }); + } else { + $('.search').find('.searchLi').show(); + } + } + }).on('click', '.searchTopList li', function () { + if ($(this).hasClass('active')) return; + $(this).addClass('active').siblings().removeClass('active'); + }).on('click', '.headSearchClose', function (e) { + //阻止默认浏览器动作(W3C) + if (e && e.preventDefault) { + e.preventDefault(); + } else { //IE中阻止函数器默认动作的方式 + window.e.returnValue = false; + } + e.stopPropagation(); + $('body').removeClass('active'); + //清空搜索 + if ($.trim($('#headSearchInput').val()) != "") { + setTimeout(function () { + $('#headSearchInput').val(''); + $('.search').find('.searchLi').show(); + }, 50); + } + }).on('click', '.signOut', function () { //退出登录 + //ajax退出操作 + layer.msg('退出中...', { + icon: 16 + , shade: 0.01 + }); + $.ajax({ + url: "/Login/OutLogin", + headers: { __RequestVerificationToken: $.lrToken }, + data: {}, + type: "post", + dataType: "json", + success: function (res) { + if (res.code == 200) { + location.href = "/SSOSystem/DragModelOne"; + } + else if (res.code == 400) { + layer.msg(res.info); + } + else if (res.code == 500) { + layer.msg('服务端异常,请联系管理员'); + } + } + }); + }).on('click', '.inSec1List2 .fa', function () { + //是否收藏 + if ($(this).hasClass('fa-heart')) { + $(this).removeClass('fa-heart').addClass('fa-heart-o'); + } else { + $(this).removeClass('fa-heart-o').addClass('fa-heart'); + } + }); + //登录 + $('.loginTab > div').click(function () { + var ind = $(this).index(); + $(this).addClass('active').siblings().removeClass('active'); + if (ind == 0) { + qrCodeBox.css('display', 'none'); + loginForm.stop().fadeIn(); + } else { + loginForm.css('display', 'none'); + qrCodeBox.stop().fadeIn(); + } + }) + //皮肤点击 + var skinT = null; + $('.skinBox').on('click', 'img', function (e) { + //阻止默认浏览器动作(W3C) + if (e && e.preventDefault) { + e.preventDefault(); + } else { //IE中阻止函数器默认动作的方式 + window.e.returnValue = false; + } + e.stopPropagation(); + var parents = $(this).parent(); + if (parents.hasClass('active')) { + parents.removeClass('active'); + } else { + parents.addClass('active'); + } + + }).hover(function () { + clearTimeout(skinT) + }, function () { + var _this = $(this); + skinT = setTimeout(function () { + _this.removeClass('active'); + }, 2000) + }).on('click', '.skins', function (e) { + //阻止默认浏览器动作(W3C) + if (e && e.preventDefault) { + e.preventDefault(); + } else { //IE中阻止函数器默认动作的方式 + window.e.returnValue = false; + } + e.stopPropagation(); + $(this).addClass('active').siblings().removeClass('active'); + var skin = $(this).attr('skin'); + localStorage.setItem('skinLink', skin); + skinLink.attr('href', '/Content/css/DragSSO/' + skin + '.css'); + }).on('click', '.skinT img', function () { + $('.skinBox').removeClass('active'); + }) + + function makeCode(urls) { + qrcode.makeCode(urls); + } +}) + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js new file mode 100644 index 000000000..ea1893ac4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js @@ -0,0 +1,59 @@ +$(document).ready(function(){ + //添加排序 + $('.inSec1Drag').on('click', '.fa-minus', function() { + //删除 + $(this).removeClass('fa-minus').addClass('fa-plus'); + var id = '#' + $('.inSec3Row.active').attr('ind') + '_' + $(this).parent().attr('id'); + // console.log($('.inSec3Row').find(id)) + $('.inSec3Row.active').find(id).remove(); + layer.msg('删除成功!'); + if($('.inSec3Row.active > div').length == 0){ + $('.inSec3Row.active').html(noCard) + } + serializes() + }).on('click', '.fa-plus', function() { + var noHtmls = $('.inSec3Row.active #noHtml'); + if(noHtmls.length){ + noHtmls.remove() + } + //添加 + $(this).removeClass('fa-plus').addClass('fa-minus'); + //点击卡片,增加相同的卡片块 + var id = 'id_' + $(this).parent().attr('id'); + var html = '
' + + '
' + + '
' + + '办公事项' + id + '' + + '' + + '
' + + '
'+ noHtml +'
' + + '
' + + '
'; + $('.inSec3Row.active').append(html); + layer.msg('添加成功!'); + serializes() + }) + // 拖拽 排序 + sortableInit() + + //添加拖拽 拖拽开始 + // $(".inSec1Drag div").draggable({ + // connectToSortable: ".inSec3Row", + // addClasses: false, + // iframeFix: '.inSec1List2', + // helper: "clone", + // revert: "invalid", + // zIndex: 99999, + // addClasses: 'active', + // scroll: false + // }); + // 禁用 draggable。 + // $( ".kk" ).draggable( "disable" ); + // 启用 draggable。 + // $( ".kk" ).draggable( "enable" ); + //sortable刷新 refresh() + + + +}) + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index a31255752..6714c3fed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -2934,6 +2934,14 @@ + + + + + + + +