ソースを参照

手机端增加强密码验证功能

中职版本
liangkun 4年前
コミット
cc899e5122
14個のファイルの変更114行の追加2210行の削除
  1. +8
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js
  2. +12
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js
  3. +13
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html
  4. +32
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js
  5. +0
    -414
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910
  6. +0
    -465
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038
  7. +0
    -465
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336
  8. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html
  9. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js
  10. +0
    -838
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824
  11. +13
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js
  12. +16
    -5
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs
  13. +13
    -7
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs
  14. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config

+ 8
- 8
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js ファイルの表示

@@ -1,15 +1,15 @@
var config = {
webapi: 'http://localhost:8088/',
web: "http://localhost:8087/"//web地址,用于配置logo
};
//var config = {
// webapi: 'http://localhost:8088/',
// web: "http://localhost:8087/"//web地址,用于配置logo
//};
//var config = {
// webapi: 'http://112.230.201.53:31173/',
// web:"http://112.230.201.53/:8081/"//web地址,用于配置logo
//};
//var config = {
// webapi: 'http://localhost:31173/',
// web: "http://localhost:20472/"//web地址,用于配置logo
//};
var config = {
webapi: 'http://localhost:31173/',
web: "http://localhost:20472/"//web地址,用于配置logo
};


//var config = {


+ 12
- 3
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/login/login.js ファイルの表示

@@ -5,7 +5,6 @@
var path = config.webapi;
learun.http.get(path + "Learun/EducationalAdministration/EmpRegister/registerbutton",
{}, (res) => {
console.log(res);
if (res.info == "True") {
var button = $page.find('#RegisterBtn');
button.show();
@@ -22,15 +21,20 @@
$page.find('#loginBtn').on('tap', function () {
var account = $('#account').val();
var password = $('#password').val();
var up = true;
if (account === "") {
learun.layer.warning('用户名不能为空!', function () { }, '提示', '关闭');
} else if (password === "") {
learun.layer.warning('密码不能为空!', function () { }, '提示', '关闭');
} else {
var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/;
if (!reg.test(password)) {
up = false;
}
var data = {
username: account,
password: $.md5(password)
password: $.md5(password),
up: up
};
var postdata = {
token: '',
@@ -56,6 +60,11 @@
learun.storage.set('userinfo', res.data);
$('#account').val('');
$('#password').val('');
if (res.data.pwd === true) {
learun.storage.set('pwd', true);
} else {
learun.storage.set('pwd', false);
}
learun.tab.go('workspace');
if (learun.storage.get("Ip") != null && learun.storage.get("ACIp") != "") {
//Ip上网


+ 13
- 2
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.html ファイルの表示

@@ -13,8 +13,19 @@
</div>
</div>

<div class="lr-list" style="margin-top:15px;">
<div class="lr-list-item" style="color:red;text-align:center;" id="savepassword">
<div class="lr-list" style="margin-top: 15px;">
<div id="strongpwd" style="display: none;">
您的密码不满足强度要求,请您先修改密码后再执行系统其他操作!
</div>
<div>
新密码必须8-20位同时包含1.[大小写字母]、2[数字]、3[特殊符号!@@#$%^&*]
</div>
<div class="lr-list-item" style="color: red; text-align: center;" id="savepassword">
保存
</div>
</div>
<div class="lr-list" style="margin-top:15px;display: none;" id="strongpwdout" >
<div class="lr-list-item" style="color:red;text-align:center;" id="outloginbtn">
退出
</div>
</div>

+ 32
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/my/modifypassword/modifypassword.js ファイルの表示

@@ -1,12 +1,24 @@
(function () {
var userinfo = null;
var page = {
isScroll: true,
init: function ($page) {
userinfo = learun.storage.get('userinfo');
//主被动修改密码判断
if (learun.storage.get('pwd')===true) {
$page.find('#strongpwd').css("display", "block");
$page.find('#strongpwdout').css("display", "block");
}
$page.find('#savepassword').on('tap', function () {
if (!$('#modifypasswordform').lrformValid()) {
return false;
}
var formdata = $('#modifypasswordform').lrformGet();
var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/;
if (!reg.test(formdata.newpassword)) {
learun.layer.toast('密码不满足强度要求');
return false;
}
if (formdata.newpassword1 === formdata.newpassword) {

var req = {
@@ -20,6 +32,7 @@
if (data) {// 表单数据保存成功,发起流程
learun.layer.toast(info);
learun.storage.set('logininfo', null);
learun.storage.set('pwd', false);
learun.nav.go({ path: 'login', isBack: false, isHead: false });
}
return false;
@@ -29,6 +42,25 @@
learun.layer.toast('二次输入密码不同');
}
});
$page.find('#outloginbtn').on('tap', function () {
learun.layer.confirm('确定要退出账号?', function (_index) {
if (_index === '1') {
learun.isOutLogin = true;
if (learun.storage.get("Ip") != null && learun.storage.get("ACIp") != "") {
//Ip上网
sendToAc(learun.storage.get("ACIp"), 'logout', learun.storage.get("Ip"), userinfo.baseinfo.account, '');
}
if (learun.storage.get("Ip") != null && learun.storage.get("ACIp2") != "") {
//Ip上网
sendToAc(learun.storage.get("ACIp2"), 'logout', learun.storage.get("Ip"), userinfo.baseinfo.account, '');
}
learun.storage.set('logininfo', null);
learun.nav.go({ path: 'login', isBack: false, isHead: false });
}

}, '', ['取消', '退出']);
});
}
};
return page;

+ 0
- 414
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.26696.2.2019-09-23.15-42-49.7910 ファイルの表示

@@ -1,414 +0,0 @@
<script type="text/javascript">
(function ($, learun) {
learun.nav.data["workspace"].jsObj = (function () {

var custmerform = {};
var $scroll = '';

// 统计数据
function target(data, $desktop) {
if (data.length > 0) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">统计数据</div>\
<div class="lr-content lr-flex-content">\
</div>\
</div>';
$desktop.append(_html);
var $content = $desktop.find('.lr-flex-content');
$.each(data, function (_index, _item) {
var _itemHtml = '\
<div class="targetItem">\
<div class="name">'+ _item.F_Name + '</div>\
<div class="number" data-number="'+ _item.F_Id + '" ></div>\
</div>';
$content.append(_itemHtml);
// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'Target', id: _item.F_Id }, function (data) {
if (data) {
$('[data-number="' + data.Id + '"]').text(data.value);
}
});

});

}
}
// 列表数据
function list(data, $desktop) {
if (data.length > 0) {
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content" data-desktop="'+ _item.F_Id + '" ></div>\
</div>';
$desktop.append(_html);
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'list', id: _item.F_Id }, function (data) {
if (data) {
var $list = $('[data-desktop="' + data.Id + '"]');
$.each(data.value, function (_j, _jitem) {
var _itemHtml = '\
<div class="lr-list-item lr-dtlist-item">\
<div class="lr-ellipsis">'+ _jitem.f_title + '</div>\
<div class="date">'+ learun.date.format(_jitem.f_time, 'yyyy-MM-dd') + '</div>\
</div>';
var _$itemHtml = $(_itemHtml);
_$itemHtml[0].item = _jitem;
$list.append(_$itemHtml);
});
$list.find('.lr-dtlist-item').on('tap', function () {
var item = $(this)[0].item;
learun.nav.go({ path: 'workspace/listdetaile', title: '详情', param: item, type: 'right' });
});

$list = null;
}
});
});
}
}
var chartMap = {};
// 图表数据
function chart(data, $desktop) {

if (data.length > 0) {
chartMap = {};
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content lr-chart-content">\
<div class="lr-chart-container" id="'+ _item.F_Id + '" data-desktop="' + _item.F_Type + '" ></div>\
</div>\
</div>';

$desktop.append(_html);
chartMap[_item.F_Id] = echarts.init(document.getElementById(_item.F_Id));

// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'chart', id: _item.F_Id }, function (data) {
if (data) {
var type = $('#' + data.Id).attr('data-desktop');
var legendData = [];
var valueData = [];
$.each(data.value, function (_index, _item) {
legendData.push(_item.name);
valueData.push(_item.value);
});

var option = {};
switch (type) {
case '0'://饼图
option.tooltip = {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
};

option.legend = {
orient: 'vertical',
left: 'left',
data: legendData
};
option.series = [{
name: '占比',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data: data.value
}];
option.color = ['#df4d4b', '#304552', '#52bbc8', 'rgb(224,134,105)', '#8dd5b4', '#5eb57d', '#d78d2f'];
break;
case '1'://折线图
case '2'://柱状图
option = {
grid: {
top: '20px',
bottom: '10px',
left: '15px',
right: '15px',
containLabel: true
},
xAxis: {
type: 'category',
data: legendData
},
yAxis: {
type: 'value'
},
series: [{
data: valueData,
type: type === '1' ? 'line' : 'bar'
}]
};
break;
}
chartMap[data.Id].setOption(option);
}
});
});
}
}

function refreshDeskTop(self) {
learun.clientdata.get('desktop', {
callback: function (data) {
var $desktop = $('#lr_desktop_msg_content');
$desktop.html('');
var logininfo = learun.storage.get('userinfo');
if (logininfo.baseinfo.Description == "系统管理员") {
target(data.target || [], $desktop);
chart(data.chart || [], $desktop);
}
list(data.list || [], $desktop);

if (self) {
self.refresh(true);
self.endPulldownToRefresh();
}
}
});
}

var page = {
init: function ($page) {
var _html = '';
// _html += '<div class="scanner">';
// _html += '<i class="iconfont icon-scan"></i>';
// _html += '</div>';

_html += '\
<div class="searchBox">\
<i class="iconfont icon-search"></i>\
<div class="search" >搜索应用</div>\
</div>';


_html += '<div class="message">';
_html += '<i class="iconfont icon-mail"></i>';
_html += '<span class="red"></span>';
_html += '</div>';
$page.parent().find('.f-page-header').addClass('lr-workspace-header').html(_html).css("paddingLeft", "14px");
// 点击搜索框
$page.parent().find('.searchBox').on('tap', function () {
learun.nav.go({ path: 'workspace/search', title: '', isBack: true, isHead: true });
});
// 点击消息图标
$page.parent().find('.message').on('tap', function () {
learun.nav.go({ path: 'message', title: '消息', isBack: true, isHead: true, type: 'right' });
});
// 注册扫描
$page.parent().find('.scanner').on('tap', function () {
learun.code.scan(function (res) {
if (res.status === 'success') {
learun.layer.toast(res.msg);
}
else {
learun.layer.toast('扫描失败:' + res.msg);
}
});
});
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});

// 基础数据初始化
learun.clientdata.init();
refreshDeskTop();

$scroll = $page.find('#lr_desktop_msg').pullRefresh({
down: {
height: 30,
contentinit: '下拉可以刷新',
contentdown: '下拉可以刷新',
contentover: '松开立即刷新',
contentrefresh: '正在刷新...',
callback: function () {
refreshDeskTop(this);
}
}
});

// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;
$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div><i class="'+ item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
// 注册更多功能按钮
$page.find('#lr_more_app').on('tap', function () {
learun.nav.go({ path: 'workspace/modulelist', title: "", type: 'right' });
});
// 点击功能按钮
$page.delegate('.appitem2', 'tap', function () {
var $this = $(this);
var item = $this[0].item;
if (item.F_IsSystem === 1) {// 代码开发功能
learun.nav.go({ path: item.F_Url, title: item.F_Name, isBack: true, isHead: true, type: 'right' });
}
else {// 自定义表单开发功能
learun.nav.go({ path: 'custmerform', title: item.F_Name, param: { formSchemeId: item.F_FormId, girdScheme: item.F_Scheme }, isBack: true, isHead: true, type: 'right' });
}
return false;
});
},
reload: function ($page, pageinfo) {
if (learun.isOutLogin) {// 如果是重新登录的情况刷新下桌面数据
learun.isOutLogin = false;
refreshDeskTop();
learun.clientdata.clear('module');
learun.myModule.states = -1;
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').after('<div class="banner"></div>').remove();
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});
}
// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;
$appbox.find(".appitem2").remove();
$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div><i class="'+ item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
$.each(chartMap, function (id, obj) {
obj.resize();
});
}
};
return page;
})();
})(window.jQuery, window.lrmui);</script>
<div class="lr-workspace-page">
<div class="head">
<div class="banner"></div>
<!--<div class="news222">
<span class="left"><img src="images/notification.png" alt=""></span>
<span class="middle">年中全新升级,数字化智慧校园</span>
<span class="right">更多</span>
</div>-->
</div>
<div class="appbox">
<div class="appitem" id="lr_more_app">
<div style="background-color:#CCC"><i class="iconfont icon-cascades"></i></div>
<span>更多</span>
</div>
</div>
<div class="lr-desktop-msg" id="lr_desktop_msg">
<div id="lr_desktop_msg_content" style="padding-top:10px;">
</div>
</div>
</div>

+ 0
- 465
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-09.14-19-29.6038 ファイルの表示

@@ -1,465 +0,0 @@
<script type="text/javascript">
(function ($, learun) {
learun.nav.data["workspace"].jsObj = (function () {

var custmerform = {};
var $scroll = '';

// 统计数据
function target(data, $desktop) {
if (data.length > 0) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">统计数据</div>\
<div class="lr-content lr-flex-content">\
</div>\
</div>';
$desktop.append(_html);
var $content = $desktop.find('.lr-flex-content');
$.each(data, function (_index, _item) {
var _itemHtml = '\
<div class="targetItem">\
<div class="name">'+ _item.F_Name + '</div>\
<div class="number" data-number="'+ _item.F_Id + '" ></div>\
</div>';
$content.append(_itemHtml);
// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'Target', id: _item.F_Id }, function (data) {
if (data) {
$('[data-number="' + data.Id + '"]').text(data.value);
}
});

});

}
}
// 列表数据
function list(data, $desktop) {
if (data.length > 0) {
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content" data-desktop="'+ _item.F_Id + '" ></div>\
</div>';
$desktop.append(_html);

learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'list', id: _item.F_Id }, function (data) {
if (data) {
var $list = $('[data-desktop="' + data.Id + '"]');
//待办
if (_item.F_Name == '待办事项') {
$list.prev().on('tap',
function () {
learun.nav.go({
path: 'nworkflow/myflow',
title: '待办事项',
param: '',
type: 'right'
});
});
}
else {
$list.prev().on('tap',
function () {
learun.nav.go({
path: 'LR_OAModule/Notice',
title: '查看详情',
param: (_item.F_Url.indexOf('=') != -1 ? _item.F_Url.substr(_item.F_Url.indexOf('=')+ 1):''),
type: 'right'
});
});
}
$.each(data.value, function (_j, _jitem) {
var _itemHtml = '\
<div class="lr-list-item lr-dtlist-item">\
<div class="lr-ellipsis">'+ _jitem.f_title + '</div>\
<div class="date">'+ learun.date.format(_jitem.f_time, 'yyyy-MM-dd') + '</div>\
</div>';
var _$itemHtml = $(_itemHtml);
_$itemHtml[0].item = _jitem;
$list.append(_$itemHtml);
});
$list.find('.lr-dtlist-item').on('tap', function () {
var item = $(this)[0].item;
if (item.f_processname == undefined || item.f_processname == null || item.f_processname == '')
learun.nav.go({ path: 'workspace/listdetaile', title: '详情', param: item, type: 'right' });
else
learun.nav.go({ path: 'nworkflow/audit', title: item.f_processname, type: 'right', param: { processId: item.f_processid, taskId: item.f_id } });
});

$list = null;
}
});
});
}
}
var chartMap = {};
// 图表数据
function chart(data, $desktop) {

if (data.length > 0) {
chartMap = {};
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content lr-chart-content">\
<div class="lr-chart-container" id="'+ _item.F_Id + '" data-desktop="' + _item.F_Type + '" ></div>\
</div>\
</div>';

$desktop.append(_html);
chartMap[_item.F_Id] = echarts.init(document.getElementById(_item.F_Id));

// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'chart', id: _item.F_Id }, function (data) {
if (data) {
var type = $('#' + data.Id).attr('data-desktop');
var legendData = [];
var valueData = [];
$.each(data.value, function (_index, _item) {
legendData.push(_item.name);
valueData.push(_item.value);
});

var option = {};
switch (type) {
case '0'://饼图
option.tooltip = {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
};

option.legend = {
orient: 'vertical',
left: 'left',
data: legendData
};
option.series = [{
name: '占比',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data: data.value
}];
option.color = ['#df4d4b', '#304552', '#52bbc8', 'rgb(224,134,105)', '#8dd5b4', '#5eb57d', '#d78d2f'];
break;
case '1'://折线图
case '2'://柱状图
option = {
grid: {
top: '20px',
bottom: '10px',
left: '15px',
right: '15px',
containLabel: true
},
xAxis: {
type: 'category',
data: legendData
},
yAxis: {
type: 'value'
},
series: [{
data: valueData,
type: type === '1' ? 'line' : 'bar'
}]
};
break;
}
chartMap[data.Id].setOption(option);
}
});
});
}
}

function refreshDeskTop(self) {
learun.clientdata.get('desktop', {
callback: function (data) {
var $desktop = $('#lr_desktop_msg_content');
$desktop.html('');
var logininfo = learun.storage.get('userinfo');
//if (logininfo.baseinfo.Description != "学生") {
// target(data.target || [], $desktop);
// chart(data.chart || [], $desktop);
//}
list(data.list || [], $desktop);

if (self) {
self.refresh(true);
self.endPulldownToRefresh();
}
}
});
}

var page = {
init: function ($page) {
var _html = '';
// _html += '<div class="scanner">';
// _html += '<i class="iconfont icon-scan"></i>';
// _html += '</div>';

_html += '\
<div class="searchBox">\
<i class="iconfont icon-search"></i>\
<div class="search" >搜索应用</div>\
</div>';


_html += '<div class="message">';
_html += '<i class="iconfont icon-mail"></i>';
_html += '<span class="red"></span>';
_html += '</div>';
$page.parent().find('.f-page-header').addClass('lr-workspace-header').html(_html).css("paddingLeft", "14px");
// 点击搜索框
$page.parent().find('.searchBox').on('tap', function () {
learun.nav.go({ path: 'workspace/search', title: '', isBack: true, isHead: true });
});
// 点击消息图标
$page.parent().find('.message').on('tap', function () {
learun.nav.go({ path: 'message', title: '消息', isBack: true, isHead: true, type: 'right' });
});
// 注册扫描
$page.parent().find('.scanner').on('tap', function () {
learun.code.scan(function (res) {
if (res.status === 'success') {
learun.layer.toast(res.msg);
}
else {
learun.layer.toast('扫描失败:' + res.msg);
}
});
});
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});

// 基础数据初始化
learun.clientdata.init();
refreshDeskTop();

$scroll = $page.find('#lr_desktop_msg').pullRefresh({
down: {
height: 30,
contentinit: '下拉可以刷新',
contentdown: '下拉可以刷新',
contentover: '松开立即刷新',
contentrefresh: '正在刷新...',
callback: function () {
refreshDeskTop(this);
}
}
});

// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;

$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {

var Tips = ''; //审批 提示脚标
if (item.F_Id == '49b3860f-a2ec-4677-b863-fb611604c477') {
var tipCount = 0;
learun.httpgetnosy(config.webapi + "learun/adms/desktop/data", { type: 'list', id: '33d50f1a-a64d-4b86-a6d4-2d937226de95' }, function (data) {
if (data) {
tipCount = data.value.length;
}
});
Tips = '<span style="position: absolute;top: -4px;right: -3px;width: 20px;height: 20px;background: #f86c61;border-radius: 50%;line-height: 20px;color: #fff;font-size: 12px;">' + tipCount + '</span>';
}
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div style="position:relative;">'+ Tips + '<i class="' + item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
// 注册更多功能按钮
$page.find('#lr_more_app').on('tap', function () {
learun.nav.go({ path: 'workspace/modulelist', title: "", type: 'right' });
});
// 点击功能按钮
$page.delegate('.appitem2', 'tap', function () {
var $this = $(this);
var item = $this[0].item;
if (item.F_IsSystem === 1) {// 代码开发功能
learun.nav.go({ path: item.F_Url, title: item.F_Name, isBack: true, isHead: true, type: 'right' });
}
else {// 自定义表单开发功能

learun.nav.go({ path: 'custmerform', title: item.F_Name, param: { formSchemeId: item.F_FormId, girdScheme: item.F_Scheme }, isBack: true, isHead: true, type: 'right' });
}
return false;
});
},
reload: function ($page, pageinfo) {
if (learun.isOutLogin) {// 如果是重新登录的情况刷新下桌面数据
learun.isOutLogin = false;
refreshDeskTop();
learun.clientdata.clear('module');
learun.myModule.states = -1;
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').after('<div class="banner"></div>').remove();
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});
}
// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;
$appbox.find(".appitem2").remove();
$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {

var Tips = ''; //审批 提示脚标
if (item.F_Id == '49b3860f-a2ec-4677-b863-fb611604c477') {
var tipCount = 0;
learun.httpgetnosy(config.webapi + "learun/adms/desktop/data", { type: 'list', id: '33d50f1a-a64d-4b86-a6d4-2d937226de95' }, function (data) {
if (data) {
tipCount = data.value.length;
}
});
Tips = '<span style="position: absolute;top: -4px;right: -3px;width: 20px;height: 20px;background: #f86c61;border-radius: 50%;line-height: 20px;color: #fff;font-size: 12px;">' + tipCount + '</span>';
}
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div style="position: relative;">'+ Tips + '<i class="' + item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
$.each(chartMap, function (id, obj) {
obj.resize();
});
}
};
return page;
})();
})(window.jQuery, window.lrmui);</script>
<div class="lr-workspace-page">
<div class="head">
<div class="banner"></div>
<!--<div class="news222">
<span class="left"><img src="images/notification.png" alt=""></span>
<span class="middle">年中全新升级,数字化智慧校园</span>
<span class="right">更多</span>
</div>-->
</div>
<div class="appbox">
<div class="appitem" id="lr_more_app">
<div style="background-color:#CCC"><i class="iconfont icon-cascades"></i></div>
<span>更多</span>
</div>
</div>
<div class="lr-desktop-msg" id="lr_desktop_msg">
<div id="lr_desktop_msg_content" style="padding-top:10px;">
</div>
</div>
</div>

+ 0
- 465
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/_sgbak/workspace.html.49721.13.2020-01-15.16-31-23.1336 ファイルの表示

@@ -1,465 +0,0 @@
<script type="text/javascript">
(function ($, learun) {
learun.nav.data["workspace"].jsObj = (function () {

var custmerform = {};
var $scroll = '';

// 统计数据
function target(data, $desktop) {
if (data.length > 0) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">统计数据</div>\
<div class="lr-content lr-flex-content">\
</div>\
</div>';
$desktop.append(_html);
var $content = $desktop.find('.lr-flex-content');
$.each(data, function (_index, _item) {
var _itemHtml = '\
<div class="targetItem">\
<div class="name">'+ _item.F_Name + '</div>\
<div class="number" data-number="'+ _item.F_Id + '" ></div>\
</div>';
$content.append(_itemHtml);
// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'Target', id: _item.F_Id }, function (data) {
if (data) {
$('[data-number="' + data.Id + '"]').text(data.value);
}
});

});

}
}
// 列表数据
function list(data, $desktop) {
if (data.length > 0) {
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content" data-desktop="'+ _item.F_Id + '" ></div>\
</div>';
$desktop.append(_html);

learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'list', id: _item.F_Id }, function (data) {
if (data) {
var $list = $('[data-desktop="' + data.Id + '"]');
//待办
if (_item.F_Name == '待办事项') {
$list.prev().on('tap',
function () {
learun.nav.go({
path: 'nworkflow/myflow',
title: '待办事项',
param: '',
type: 'right'
});
});
}
else {
$list.prev().on('tap',
function () {
learun.nav.go({
path: 'LR_OAModule/Notice',
title: '查看详情',
param: (_item.F_Url.indexOf('=') != -1 ? _item.F_Url.substr(_item.F_Url.indexOf('=')+ 1):''),
type: 'right'
});
});
}
$.each(data.value, function (_j, _jitem) {
var _itemHtml = '\
<div class="lr-list-item lr-dtlist-item">\
<div class="lr-ellipsis">'+ _jitem.f_title + '</div>\
<div class="date">'+ learun.date.format(_jitem.f_time, 'yyyy-MM-dd') + '</div>\
</div>';
var _$itemHtml = $(_itemHtml);
_$itemHtml[0].item = _jitem;
$list.append(_$itemHtml);
});
$list.find('.lr-dtlist-item').on('tap', function () {
var item = $(this)[0].item;
if (item.f_processname == undefined || item.f_processname == null || item.f_processname == '')
learun.nav.go({ path: 'workspace/listdetaile', title: '详情', param: item, type: 'right' });
else
learun.nav.go({ path: 'nworkflow/audit', title: item.f_processname, type: 'right', param: { processId: item.f_processid, taskId: item.f_id } });
});

$list = null;
}
});
});
}
}
var chartMap = {};
// 图表数据
function chart(data, $desktop) {

if (data.length > 0) {
chartMap = {};
$.each(data, function (_index, _item) {
var _html = '\
<div class="lr-black-panel">\
<div class="lr-title">'+ _item.F_Name + '</div>\
<div class="lr-content lr-chart-content">\
<div class="lr-chart-container" id="'+ _item.F_Id + '" data-desktop="' + _item.F_Type + '" ></div>\
</div>\
</div>';

$desktop.append(_html);
chartMap[_item.F_Id] = echarts.init(document.getElementById(_item.F_Id));

// 获取后台数据
learun.httpget(config.webapi + "learun/adms/desktop/data", { type: 'chart', id: _item.F_Id }, function (data) {
if (data) {
var type = $('#' + data.Id).attr('data-desktop');
var legendData = [];
var valueData = [];
$.each(data.value, function (_index, _item) {
legendData.push(_item.name);
valueData.push(_item.value);
});

var option = {};
switch (type) {
case '0'://饼图
option.tooltip = {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
};

option.legend = {
orient: 'vertical',
left: 'left',
data: legendData
};
option.series = [{
name: '占比',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data: data.value
}];
option.color = ['#df4d4b', '#304552', '#52bbc8', 'rgb(224,134,105)', '#8dd5b4', '#5eb57d', '#d78d2f'];
break;
case '1'://折线图
case '2'://柱状图
option = {
grid: {
top: '20px',
bottom: '10px',
left: '15px',
right: '15px',
containLabel: true
},
xAxis: {
type: 'category',
data: legendData
},
yAxis: {
type: 'value'
},
series: [{
data: valueData,
type: type === '1' ? 'line' : 'bar'
}]
};
break;
}
chartMap[data.Id].setOption(option);
}
});
});
}
}

function refreshDeskTop(self) {
learun.clientdata.get('desktop', {
callback: function (data) {
var $desktop = $('#lr_desktop_msg_content');
$desktop.html('');
var logininfo = learun.storage.get('userinfo');
//if (logininfo.baseinfo.Description != "学生") {
// target(data.target || [], $desktop);
// chart(data.chart || [], $desktop);
//}
list(data.list || [], $desktop);

if (self) {
self.refresh(true);
self.endPulldownToRefresh();
}
}
});
}

var page = {
init: function ($page) {
var _html = '';
// _html += '<div class="scanner">';
// _html += '<i class="iconfont icon-scan"></i>';
// _html += '</div>';

_html += '\
<div class="searchBox">\
<i class="iconfont icon-search"></i>\
<div class="search" >搜索应用</div>\
</div>';


_html += '<div class="message">';
_html += '<i class="iconfont icon-mail"></i>';
_html += '<span class="red"></span>';
_html += '</div>';
$page.parent().find('.f-page-header').addClass('lr-workspace-header').html(_html).css("paddingLeft", "14px");
// 点击搜索框
$page.parent().find('.searchBox').on('tap', function () {
learun.nav.go({ path: 'workspace/search', title: '', isBack: true, isHead: true });
});
// 点击消息图标
$page.parent().find('.message').on('tap', function () {
learun.nav.go({ path: 'message', title: '消息', isBack: true, isHead: true, type: 'right' });
});
// 注册扫描
$page.parent().find('.scanner').on('tap', function () {
learun.code.scan(function (res) {
if (res.status === 'success') {
learun.layer.toast(res.msg);
}
else {
learun.layer.toast('扫描失败:' + res.msg);
}
});
});
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});

// 基础数据初始化
learun.clientdata.init();
refreshDeskTop();

$scroll = $page.find('#lr_desktop_msg').pullRefresh({
down: {
height: 30,
contentinit: '下拉可以刷新',
contentdown: '下拉可以刷新',
contentover: '松开立即刷新',
contentrefresh: '正在刷新...',
callback: function () {
refreshDeskTop(this);
}
}
});

// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;

$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {

var Tips = ''; //审批 提示脚标
if (item.F_Id == '49b3860f-a2ec-4677-b863-fb611604c477') {
var tipCount = 0;
learun.httpgetnosy(config.webapi + "learun/adms/desktop/data", { type: 'list', id: '33d50f1a-a64d-4b86-a6d4-2d937226de95' }, function (data) {
if (data) {
tipCount = data.value.length;
}
});
Tips = '<span style="position: absolute;top: -4px;right: -3px;width: 20px;height: 20px;background: #f86c61;border-radius: 50%;line-height: 20px;color: #fff;font-size: 12px;">' + tipCount + '</span>';
}
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div style="position:relative;">'+ Tips + '<i class="' + item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
// 注册更多功能按钮
$page.find('#lr_more_app').on('tap', function () {
learun.nav.go({ path: 'workspace/modulelist', title: "", type: 'right' });
});
// 点击功能按钮
$page.delegate('.appitem2', 'tap', function () {
var $this = $(this);
var item = $this[0].item;
if (item.F_IsSystem === 1) {// 代码开发功能
learun.nav.go({ path: item.F_Url, title: item.F_Name, isBack: true, isHead: true, type: 'right' });
}
else {// 自定义表单开发功能

learun.nav.go({ path: 'custmerform', title: item.F_Name, param: { formSchemeId: item.F_FormId, girdScheme: item.F_Scheme }, isBack: true, isHead: true, type: 'right' });
}
return false;
});
},
reload: function ($page, pageinfo) {
if (learun.isOutLogin) {// 如果是重新登录的情况刷新下桌面数据
learun.isOutLogin = false;
refreshDeskTop();
learun.clientdata.clear('module');
learun.myModule.states = -1;
// 图片加载
learun.httpget(config.webapi + "learun/adms/desktop/imgid", null, function (data) {
if (data) {
var _list = [];
$.each(data, function (_index, _item) {
_list.push(config.webapi + "learun/adms/desktop/img?data=" + _item);
});
$page.find('.banner').after('<div class="banner"></div>').remove();
$page.find('.banner').slider({ data: _list, indicator: true, interval: 10000 });
}
});
}
// 加载功能列表
learun.clientdata.get('module', {
callback: function (data) {
learun.myModule.get(data, function (myModules) {
var mylen = parseInt((myModules.length + 1) / 4) + ((myModules.length + 1) % 4 > 0 ? 1 : 0);
switch (mylen) {
case 1:
$page.find('.lr-workspace-page').css('padding-top', '210px');
break;
case 2:
$page.find('.lr-workspace-page').css('padding-top', '290px');
break;
case 3:
$page.find('.lr-workspace-page').css('padding-top', '370px');
break;
}

var map = {};
$.each(data, function (_index, _item) {
map[_item.F_Id] = _item;
});
var $appbox = $page.find('.appbox');
var $last = null;
$appbox.find(".appitem2").remove();
$.each(myModules, function (_index, _id) {
var item = map[_id];
if (item) {

var Tips = ''; //审批 提示脚标
if (item.F_Id == '49b3860f-a2ec-4677-b863-fb611604c477') {
var tipCount = 0;
learun.httpgetnosy(config.webapi + "learun/adms/desktop/data", { type: 'list', id: '33d50f1a-a64d-4b86-a6d4-2d937226de95' }, function (data) {
if (data) {
tipCount = data.value.length;
}
});
Tips = '<span style="position: absolute;top: -4px;right: -3px;width: 20px;height: 20px;background: #f86c61;border-radius: 50%;line-height: 20px;color: #fff;font-size: 12px;">' + tipCount + '</span>';
}
var _html = '\
<div class="appitem appitem2" data-value="'+ item.F_Id + '">\
<div style="position: relative;">'+ Tips + '<i class="' + item.F_Icon + '"></i></div>\
<span>'+ item.F_Name + '</span>\
</div>';
var _$html = $(_html);
_$html[0].item = item;
if ($last === null) {
$appbox.prepend(_$html);
}
else {
$last.after(_$html);
}
$last = _$html;

}
});
$last = null;
});
}
});
$.each(chartMap, function (id, obj) {
obj.resize();
});
}
};
return page;
})();
})(window.jQuery, window.lrmui);</script>
<div class="lr-workspace-page">
<div class="head">
<div class="banner"></div>
<!--<div class="news222">
<span class="left"><img src="images/notification.png" alt=""></span>
<span class="middle">年中全新升级,数字化智慧校园</span>
<span class="right">更多</span>
</div>-->
</div>
<div class="appbox">
<div class="appitem" id="lr_more_app">
<div style="background-color:#CCC"><i class="iconfont icon-cascades"></i></div>
<span>更多</span>
</div>
</div>
<div class="lr-desktop-msg" id="lr_desktop_msg">
<div id="lr_desktop_msg_content" style="padding-top:10px;">
</div>
</div>
</div>

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.html ファイルの表示

@@ -217,6 +217,10 @@

var page = {
init: function ($page) {
//主被动修改密码判断
if (learun.storage.get('pwd') === true) {
learun.nav.go({ path: 'my/modifypassword', isBack: false, isHead: true, title:'修改密码' });
}
var _html = '';
// _html += '<div class="scanner">';
// _html += '<i class="iconfont icon-scan"></i>';


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/workspace/workspace.js ファイルの表示

@@ -6,6 +6,7 @@

var page = {
init: function ($page) {
var _html = '';
_html += '<div class="scanner">';
_html += '<i class="iconfont icon-scan"></i>';


+ 0
- 838
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/_sgbak/learun-custmerform.js.26692.2.2020-08-04.14-24-39.5824 ファイルの表示

@@ -1,838 +0,0 @@
/*
* 版 本 Learun-ADMS V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2017 北京泉江科技有限公司
* 创建人:数字化智慧校园-前端开发组
* 日 期:2018.7.12
* 描 述:数字化智慧校园移动端框架(ADMS) 自定义表单
*/

(function ($, learun, window) {
// 加载自定义表单模板
learun.custmerform = {
loadScheme: function (schemeIds, callback) {// formIds表单主键集合,callback回调函数
if (learun.type(schemeIds) === 'string') {
schemeIds = [schemeIds];
}

var req = [];
var scheme = {};
$.each(schemeIds, function (_index, _item) {
var formId = 'lrform' + _item;
var formScheme = learun.storage.get(formId);// 从缓存中获取表单模板数据
if (!formScheme) {
req.push({ id: _item, ver: "" });
}
else {
scheme[_item] = JSON.parse(formScheme.content);
req.push({ id: _item, ver: formScheme.ver });
}
});
// 加载自定义表单模板
learun.httpget(config.webapi + "learun/adms/form/scheme", req, (data) => {
if (data) {
$.each(data, function (_index, _item) {
scheme[_index] = JSON.parse(_item.F_Scheme);
var formScheme = { ver: _item.F_Id, content: _item.F_Scheme };
learun.storage.set('lrform' + _index,formScheme);
});
}
callback(scheme);
});
}
};
// 自定义表单初始化
$.fn.custmerform = function (formScheme) {
var $this = $(this);
$this.scroll();
var $container = $this.find('.f-scroll');

$.each(formScheme, function (_id, _scheme) {
custmerformRender($container, _scheme.data, _id);
});
$this = null;
$container = null;
};
// 获取自定义表单数据
$.fn.custmerformGet = function () {
var res = {};
var validateflag = true;
$(this).find('.lrcomponts').each(function () {
var $this = $(this);
var schemeInfoId = $this.attr('data-id');
var _componts = $this[0].componts;
res[schemeInfoId] = res[schemeInfoId] || {};
// 遍历自定义表单控件
$.each(_componts, function (_index, _item) {
var _fn = componts[_item.type].get;
if (_fn) {
var compontData = _fn(_item, $this);
if (compontData.isHad) {
if (_item.verify) {
var checkfn = window.fui.validator['is' + _item.verify];
var r = checkfn(compontData.value);
if (!r.code) {
validateflag = false;
window.fui.dialog({ msg: r.msg });
return false;
}
}
res[schemeInfoId][_item.id] = compontData.value;
}
}
});
$this = null;
if (!validateflag) {
return false;
}
});
if (!validateflag) {
return null;
}
return res;
};
// 设置自定义表单数据
$.fn.custmerformSet = function (data) {
var $this = $(this);
function set($this, data) {
if ($this.find('.lrcomponts').length > 0) {
$this.find('.lrcomponts').each(function () {
var $this = $(this);
var schemeInfoId = $this.attr('data-id');
var _componts = $this[0].componts;
var _data = {};
$.each(data[schemeInfoId] || [], function (_index, _item) {
$.each(_item[0] || [], function (_id, _jitem) {
_data[_index.toLowerCase() + _id] = _jitem;
});
});
// 遍历自定义表单控件
$.each(_componts, function (_index, _item) {
var _fn = componts[_item.type].set;
if (_fn) {
if (_item.table && _item.field) {
_fn(_item, _data[(_item.table + _item.field).toLowerCase()], $this);
}
else if (_item.table){// 表格
_fn(_item, data[schemeInfoId][_item.table], $this);
}
}
});
$this = null;
});
}
else {
setTimeout(function () {
set($this, data);
}, 100);
}
}
set($this, data);
};

function getFontHtml(verify) {
var res = "";
switch (verify) {
case "NotNull":
case "Num":
case "Email":
case "EnglishStr":
case "Phone":
case "Fax":
case "Mobile":
case "MobileOrPhone":
case "Uri":
res = '<font face="宋体">*</font>';
break;
}
return res;
}
function loadCheck(data, text, value, compontId) {
var $row = $('#' + compontId);
if ($row.length === 0) {
setTimeout(function () {
loadCheck(data, text, value, compontId);
}, 100);
}
else {
var $Last = $row;
$.each(data, function (_index, _item) {
$div = $('<div class="lr-form-row" data-name="' + compontId + '" data-value="' + _item[value] + '" ><label>' + _item[text] + '</label><div class="checkbox" ></div></div>');
$Last.after($div);
$div.find('.checkbox').lrswitch();
$Last = $div;
$div = null;
});
if ($Last) {
$Last.after('<div class="lr-form-row lr-form-row-title" style="min-height:6px;" ></div>');
$Last = null;
}
}
$row = null;
}
function organizeRegister1(_compont) {
if ($('#' + _compont.relation).length > 0) {
$('#' + _compont.relation).on('change', { myId: _compont.id }, function (e) {
e = e || window.event;
var myId = e.data.myId;
var value = $(this).lrselectGet();
$('#' + myId).lrselectUpdate({
companyId: value,
needPre: value === '' ? true : false
});
});
}
else {
setTimeout(function () { organizeRegister1(_compont); }, 100);
}
}
function organizeRegister2(_compont) {
if ($('#' + _compont.relation).length > 0) {
$('#' + _compont.relation).on('change', { myId: _compont.id }, function (e) {
e = e || window.event;
var myId = e.data.myId;
var value = $(this).lrselectGet();
$('#' + myId).lrselectUpdate({
departmentId: value,
needPre: value === '' ? true : false
});
});
}
else {
setTimeout(function () { organizeRegister2(_compont); }, 100);
}
}

function loadGridComponts(compont) {
}
function loadGridButton(compont) {// 编辑表格增加按钮
var $row = $('#' + compont.id);
if ($row.length === 0) {
setTimeout(function () {
loadGridButton(compont);
}, 100);
}
else {
var $btn = $('<div class="lr-form-row lr-edit-grid-btn" ><i class="iconfont icon-add1" ></i>增加' + (compont.title || '') + '</div>');
$btn[0].compont = compont;

$btn.on('tap', { compont: compont }, function (e) {
e = e || window.event;
});

$row.after($btn);
}
$row = null;
}

// 渲染自定义表单
function custmerformRender($container, scheme, schemeInfoId) {
var loaddataComponts = [];
$.each(scheme, function (_index, _item) {
var $list = $('<div class="lr-form-container lrcomponts" data-id="' + schemeInfoId + '" ></div>');
$list[0].componts = _item.componts;
$.each(_item.componts, function (_jindex, _jitem) {
var $row = $('<div class="lr-form-row"><label>' + _jitem.title + '</label></div>');
if (componts[_jitem.type].render($row, _jitem)) {
$list.append($row);
$row.prepend(getFontHtml(_jitem.verify));
}
});
$container.append($list);
});

$container = null;
}

var componts = {
label: {
render: function ($row, compont) {
$row.addClass('lr-form-row-title');
return true;
}
},
html: {
render: function ($row, compont) {
return false;
}
},
text: {
render: function ($row, compont) {
var $compont = $('<input id="' + compont.id + '" type="text" />');
$row.append($compont);
$compont.val(compont.dfvalue || '');

$compont = null;
$row = null;
if (compont.isHide === '1') {
return false;
}

return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.val();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).val(value || '');
}
},
textarea: {
render: function ($row, compont) {
$row.addClass('lr-form-row-multi');
var $compont = $('<textarea id="' + compont.id + '" ' + 'style="height: ' + compont.height + 'px;" ></textarea>');
$compont.text(compont.dfvalue || '');
$row.append($compont);
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.val();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).val(value || '');
}
},
texteditor: {
render: function ($row, compont) {
$row.addClass('lr-form-row-multi');
var $compont = $('<textarea id="' + compont.id + '" ' + 'style="height: ' + compont.height + 'px;" ></textarea>');
$compont.text(compont.dfvalue || '');
$row.append($compont);
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.val();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).val(value || '');
}
},
radio: {
render: function ($row, compont) {// 单选改用和下拉一致
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
if (compont.dataSource === '0') {
$compont.lrpickerex({
code: compont.itemCode,
type: 'dataItem'
});
} else {
var vlist = compont.dataSourceId.split(',');
$compont.lrpickerex({
code: vlist[0],
type: 'sourceData',
ivalue: vlist[2],
itext: vlist[1]
});
}

$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrpickerGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).lrpickerSet(value);
}
},
checkbox: {
render: function ($row, compont) {
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
if (compont.dataSource === '0') {
$compont.lrcheckboxex({
code: compont.itemCode,
type: 'dataItem'
});
} else {
var vlist = compont.dataSourceId.split(',');
$compont.lrcheckboxex({
code: vlist[0],
type: 'sourceData',
ivalue: vlist[2],
itext: vlist[1]
});
}

$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrcheckboxGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).lrcheckboxSet(value);
}
},
select: {
render: function ($row, compont) {//
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
if (compont.dataSource === '0') {
$compont.lrpickerex({
code: compont.itemCode,
type: 'dataItem'
});
} else {
var vlist = compont.dataSourceId.split(',');
$compont.lrpickerex({
code: vlist[0],
type: 'sourceData',
ivalue: vlist[2],
itext: vlist[1]
});
}

$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrpickerGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).lrpickerSet(value);
}
},
datetime: {
render: function ($row, compont) {//
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
if (compont.dateformat === '0') {
$compont.lrdate({
type: 'date'
});
}
else {
$compont.lrdate();
}
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrdateGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
if (compont.dateformat === '0') {
value = learun.date.format(value, 'yyyy-MM-dd');
}
else {
value = learun.date.format(value, 'yyyy-MM-dd hh:mm');
}

$container.find('#' + compont.id).lrdateSet(value);
}
},
datetimerange: {
render: function ($row, compont) {//
var $compont = $('<input id="' + compont.id + '" type="text" />');
function register(_compont) {
if ($('#' + _compont.startTime).length > 0 && $('#' + _compont.endTime).length > 0) {
$('#' + _compont.startTime).on('change', { myId: _compont.id, end: _compont.endTime }, function (e) {
e = e || window.event;
var end = e.data.end;
var myId = e.data.myId;
var st = $(this).lrdateGet();
var et = $('#' + end).lrdateGet();
if (!!st && !!et) {
var diff = learun.date.parse(st).DateDiff('d', et) + 1;
$('#' + myId).val(diff);
}
});
$('#' + _compont.endTime).on('change', { myId: _compont.id, begin: _compont.startTime }, function (e) {
e = e || window.event;
var begin = e.data.begin;
var myId = e.data.myId;

var st = $('#' + begin).lrdateGet();
var et = $(this).lrdateGet();
if (!!st && !!et) {
var diff = learun.date.parse(st).DateDiff('d', et) + 1;
$('#' + myId).val(diff);
}
});
}
else {
setTimeout(function () {
register(_compont);
}, 100);
}
}
if (!!compont.startTime && compont.endTime) {
register(compont);
}
$row.append($compont);
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.val();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).val(value);
}
},
encode: {
render: function ($row, compont) {
var $compont = $('<input id="' + compont.id + '" type="text" readonly />');
compont.isInit = false;
learun.getRuleCode(compont.rulecode, function (data) {
if (!compont.isInit) {
compont.isInit = true;
$('#' + compont.id).val(data);
}
});
$row.append($compont);
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.val();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
compont.isInit = true;
$container.find('#' + compont.id).val(value);
}
},
organize: {
render: function ($row, compont) {
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
switch (compont.dataType) {
case "company"://公司
$compont.lrselect();
break;
case "department"://部门
$compont.lrselect({
type: 'department',
needPre: compont.relation === '' ? false : true
});
organizeRegister1(compont);
break;
case "user"://用户
$compont.lrselect({
type: 'user',
needPre: compont.relation === '' ? false : true
});
organizeRegister2(compont);
break;
}
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrselectGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).lrselectSet(value);
}
},
currentInfo: {
render: function ($row, compont) {
var $compont = $('<input id="' + compont.id + '" readonly type="text" />');
var userinfo = learun.storage.get('userinfo');
switch (compont.dataType) {
case 'company':
compont.value = userinfo.baseinfo.companyId;
if (compont.isHide !== '1') {
learun.clientdata.get('company', {
key: compont.value,
compont: compont,
callback: function (item, _op) {
if (!_op.compont.isEdit) {
$(_op.compont.id).val(item.name);
}
}
});
}
break;
case 'department':
compont.value = userinfo.baseinfo.departmentId;
if (compont.isHide !== '1') {
learun.clientdata.get('department', {
key: compont.value,
compont: compont,
callback: function (item, _op) {
if (!_op.compont.isEdit) {
$(_op.compont.id).val(item.name);
}
}
});
}
break;
case 'user':
$compont.val(userinfo.baseinfo.realName);
compont.value = userinfo.baseinfo.userId;
break;
case 'time':
compont.value = learun.date.format(new Date(), 'yyyy-MM-dd hh:mm:ss');
$compont.val(compont.value);
break;
case 'guid':
compont.value = learun.guid();
$compont.val(compont.value);
break;
}
if (compont.isHide === '1') {
$compont = null;
$row = null;
return false;
}
else {
$row.append($compont);
$compont = null;
$row = null;
}
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = compont.value;
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
if (value) {
var organization = learun.storage.get('organization');
compont.isEdit = true;
switch (compont.dataType) {
case 'company':
compont.value = value;
if (compont.isHide !== '1') {
learun.clientdata.get('company', {
key: compont.value,
compont: compont,
callback: function (item, _op) {
$container.find('#' + _op.compont.id).val(item.name || '');
}
});
}
break;
case 'department':
compont.value = value;
if (compont.isHide !== '1') {
learun.clientdata.get('department', {
key: compont.value,
compont: compont,
callback: function (item, _op) {
$container.find('#' + _op.compont.id).val(item.name || '');
}
});
}
break;
case 'user':
compont.value = value;
if (compont.isHide !== '1') {
learun.clientdata.get('user', {
key: compont.value,
compont: compont,
callback: function (item, _op) {
$container.find('#' + _op.compont.id).val(item.name || '');
}
});
}
break;
case 'time':
compont.value = value;
if (compont.isHide !== '1') {
$container.find('#' + compont.id).val(value);
}
break;
case 'guid':
compont.value = value;
if (compont.isHide !== '1') {
$container.find('#' + compont.id).val(value);
}
break;
}
}
}
},
guid: {
render: function ($row, compont) {
compont.value = learun.guid();
$row.remove();
return false;
},
get: function (compont) {
var res = {};
res.isHad = true;
res.value = compont.value;
return res;
},
set: function (compont, value) {
compont.value = value;
}
},
upload: {
render: function ($row, compont) {
$row.addClass('lr-form-row-multi');
var $compont = $('<div id="' + compont.id + '" ></div>');
$row.append($compont);
$compont.lrImagepicker();
$compont = null;
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.imagepickerGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).imagepickerSet(value);
}
},
girdtable: {
render: function ($row, compont) {
var gridCompont = [];
$.each(compont.fieldsData, function (_index, _item) {
if (_item.field) {
switch (_item.type) {
case 'radio':
case 'select':
case 'checkbox':
if (_item.dataSource === '0') {
_item.code = _item.itemCode;
_item.datatype = 'dataItem';
}
else {
_item.code = _item.dataSourceId;
_item.ivalue = _item.saveField;
_item.itext = _item.showField;
_item.datatype = 'sourceData';
}
break;
case 'layer':
if (_item.dataSource === '0') {
_item.code = _item.itemCode;
_item.datatype = 'dataItem';
}
else {
_item.code = _item.dataSourceId;
_item.datatype = 'sourceData';
}
break;
}

gridCompont.push(_item);
}
});
$row.attr('id', compont.id);
$row.lrgrid({
title: compont.title,
componts: gridCompont,
isToLowerCase: true
});
$row = null;
return true;
},
get: function (compont, $container) {
var res = {};
var $compont = $container.find('#' + compont.id);
res.isHad = $compont.length > 0 ? true : false;
if (res.isHad) {
res.value = $compont.lrgridGet();
}
$compont = null;
return res;
},
set: function (compont, value, $container) {
$container.find('#' + compont.id).lrgridSet(value);
}
}
};

})(window.jQuery, window.lrmui, window);


+ 13
- 3
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/weixinlogin.js ファイルの表示

@@ -29,6 +29,7 @@
$(".login-content").show();
$("#accountopenid").val(res.data.openid);
$("#loginBtn").on("click", function () {
var up = true;
var account = $('#account').val();
var password = $('#password').val();
if (account === "") {
@@ -36,10 +37,15 @@
} else if (password === "") {
learun.layer.warning('密码不能为空!', function () { }, '提示', '关闭');
} else {
var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/;
if (!reg.test(password)) {
up = false;
}
var data = {
username: account,
password: $.md5(password),
openid: $("#accountopenid").val()
openid: $("#accountopenid").val(),
up: up
};
var postdata = {
token: '',
@@ -55,7 +61,6 @@
return;
}
if (res.code === 200) {
console.log(res);
var logininfo = {
account: account,
token: res.data.baseinfo.token,
@@ -65,6 +70,12 @@
learun.storage.set('userinfo', res.data);
$('#account').val('');
$('#password').val('');
if (res.data.pwd === true) {
learun.storage.set('pwd', true);
learun.layer.warning("绑定失败!您的密码不满足强度要求,请您先修改密码后再执行系统其他操作");
} else {
learun.storage.set('pwd', false);
}
location.href = "http://" + window.location.host;
} else {
learun.layer.warning(res.info, function () { }, '提示', '关闭');
@@ -74,7 +85,6 @@
});
}
} else {
console.log(res.info);
learun.layer.warning(res.info);
location.href = "http://" + window.location.host;
}


+ 16
- 5
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs ファイルの表示

@@ -5,6 +5,7 @@ using Learun.Util;
using Learun.Util.Operat;
using Nancy;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;

namespace Learun.Application.WebApi
@@ -33,7 +34,7 @@ namespace Learun.Application.WebApi
Get["/img"] = GetImg;
Get["/imgfordc"] = GetImgForDC;
Get["/saveMap"] = GetSaveClassMap;
}
private UserIBLL userIBLL = new UserBLL();
private PostIBLL postIBLL = new PostBLL();
@@ -41,7 +42,7 @@ namespace Learun.Application.WebApi
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
CdMajorIBLL majorIbll = new CdMajorBLL();


/// <summary>
/// 登录接口
@@ -100,13 +101,18 @@ namespace Learun.Application.WebApi
res.userInfo.majorno = majorinfo.ID ?? "";
}
}


//是否强密码验证
bool pwd = false;
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false)
{
pwd = true;
}
var jsonData = new
{
baseinfo = res.userInfo,
post = postIBLL.GetListByPostIds(res.userInfo.postIds),
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds)
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds),
pwd= pwd
};
return Success(jsonData);
}
@@ -365,6 +371,11 @@ namespace Learun.Application.WebApi
/// 密码
/// </summary>
public string password { get; set; }
/// <summary>
/// 是否强密码
/// </summary>
public bool up { get; set; }

/// <summary>
/// 设备号
/// </summary>


+ 13
- 7
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs ファイルの表示

@@ -204,10 +204,6 @@ namespace Learun.Application.WebApi.Modules
logEntity.F_ExecuteResult = 1;
logEntity.F_ExecuteResultJson = "登录成功";
logEntity.WriteLog();

//保存用户设备号
userIbll.UpdateWeixinOpenId(userEntity.F_UserId, loginModel.openid);

OperatorResult res = OperatorHelper.Instance.IsOnLine(token, req.loginMark);
res.userInfo.password = null;
res.userInfo.secretkey = null;
@@ -222,13 +218,23 @@ namespace Learun.Application.WebApi.Modules
}

}


//是否强密码验证
bool pwd = false;
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && loginModel.up == false)
{
pwd = true;
}
else
{
//保存用户设备号
userIbll.UpdateWeixinOpenId(userEntity.F_UserId, loginModel.openid);
}
var jsonData = new
{
baseinfo = res.userInfo,
post = postIBLL.GetListByPostIds(res.userInfo.postIds),
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds)
role = roleIBLL.GetListByRoleIds(res.userInfo.roleIds),
pwd = pwd
};
return Success(jsonData);
}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config ファイルの表示

@@ -96,6 +96,8 @@
<!-- 深信服ACIp -->
<add key="ACIp" value="192.168.90.2"/>
<add key="ACIp2" value="192.168.200.252"/>
<!-- 是否强制验证强密码 -->
<add key="verifypwd" value="true"/>
<!--疫情防控组角色Id-->
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" />
</appSettings>

読み込み中…
キャンセル
保存