Browse Source

流程表单打印标题居中

大厂分支
zhichao lei 4 years ago
parent
commit
4528be5aac
5 changed files with 416 additions and 259 deletions
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js
  2. +206
    -84
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js
  3. +137
    -122
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formdesigner.css
  4. +0
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formdesigner.js
  5. +72
    -50
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js View File

@@ -158,7 +158,7 @@
e.appendTo("body");
d = e[0].contentWindow.document
}
d.write("<title></title><style>@page{size: auto;margin: 0mm;}html{background-color: #FFFFFF;margin: 0px;}body{border: solid 1px blue;margin: 10mm 15mm 10mm 15mm;}</style >");
d.write("<title></title><style>@page{size: auto;margin: 0mm;}html{background-color: #FFFFFF;margin: 0px;}body{border: solid 1px blue;margin: 100mm;}</style >");
d.write("<link type='text/css' rel='stylesheet' href='" + top.$.rootUrl + "/Content/jquery/plugin/jqprint/jqprint.css' />");
var $table = a('<table></table>');
var num = 24;


+ 206
- 84
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formcomponts.js View File

@@ -67,7 +67,14 @@
_html += '<div class="lr-component-title">所占行比例</div>';
_html += '<div class="lr-component-control"><div id="lr_component_proportion"></div></div>';
$html.html(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
// 标题设置
$html.find('#lr_component_title').val(dfop.title);
$html.find('#lr_component_title').on('input propertychange', function () {
@@ -114,8 +121,9 @@
},
renderTable: function (compont, $row) {
$row.find('.lr-form-item-title').remove();
$row.append("<span>" + compont.title + "<span>");
$row.css({ 'padding': '0', 'line-height': '38px', 'text-align': 'center', 'font-size': '20px', 'font-weight': 'bold', 'color': '#333' });
$row.attr('com-id', compont.id)
$row.append("<div>" + compont.title + "</div>");
$row.find('div').css({ 'padding': '0', 'line-height': '38px', 'text-align': 'center', 'font-size': '20px', 'font-weight': 'bold', 'color': '#333' });
}
},
html: {//文本标题
@@ -129,7 +137,7 @@
type: "html",
proportion: '1',
};
$component.html(getComponentRowHtml({ name: "富文本", text: "富文本" }));
$component.html(getComponentRowHtml({ name: "富文本" , text: "富文本" }));
},
property: function ($component) {
var dfop = $component[0].dfop;
@@ -142,7 +150,14 @@
_html += '<div class="lr-component-title">所占行比例</div>';
_html += '<div class="lr-component-control"><div id="lr_component_proportion"></div></div>';
$html.html(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
// 标题设置
$html.find('#lr_component_title').val(htmlDecode(dfop.title));
$html.find('#lr_component_title').on('input propertychange', function () {
@@ -188,6 +203,7 @@
},
renderTable: function (compont, $row) {
$row.find('.lr-form-item-title').remove();
$row.attr('com-id', compont.id)
$row.html(htmlDecode(compont.title));
}
},
@@ -220,6 +236,14 @@
_html += '<div class="lr-component-control"><input id="lr_component_dfvalue" type="text" class="form-control" placeholder="无则不填"/></div>';

$html.append(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$('#lr_component_isHide').lrselect({
placeholder: false,
data: [{ id: '0', text: '否' }, { id: '1', text: '是' }],
@@ -286,7 +310,14 @@
_html += '<div class="lr-component-control"><input id="lr_component_dfvalue" type="text" class="form-control" placeholder="无则不填"/></div>';

$html.append(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$html.find('#lr_component_height').val(dfop.height);
$html.find('#lr_component_height').on('input propertychange', function () {
var value = $(this).val();
@@ -341,7 +372,14 @@
_html += '<div class="lr-component-control"><input id="lr_component_dfvalue" type="text" class="form-control" placeholder="无则不填"/></div>';

$html.append(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$html.find('#lr_component_height').val(dfop.height);
$html.find('#lr_component_height').on('input propertychange', function () {
var value = $(this).val();
@@ -410,6 +448,14 @@
_html += '<div class="lr-component-control"><div id="lr_component_dfvalue"></div></div>';

$html.append(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
setDatasource(dfop);
},
renderTable: function (compont, $row) {//使用表单的时候渲染成table
@@ -487,7 +533,7 @@

dataSource: '0', // 0数据字典1数据源
dataSourceId: '',
itemCode: '',
itemCode:'',
dfvalue: '' // 默认值
};
$component.html(getComponentRowHtml({ name: $component[0].dfop.title, text: "多选项" }));
@@ -510,6 +556,14 @@
_html += '<div class="lr-component-control"><div id="lr_component_dfvalue"></div></div>';

$html.append(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
setDatasource(dfop);
},
renderTable: function (compont, $row) {//使用表单的时候渲染成table
@@ -589,7 +643,7 @@

dataSource: '0', // 0数据字典1数据源
dataSourceId: '',
itemCode: '',
itemCode:'',
dfvalue: '' // 默认值
};
$component.html(getComponentRowHtml({ name: $component[0].dfop.title, text: "下拉框" }));
@@ -611,6 +665,14 @@
_html += '<div class="lr-component-control"><div id="lr_component_dfvalue"></div></div>';

$html.append(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
setDatasource(dfop);
},
renderTable: function (compont, $row) {//使用表单的时候渲染成table
@@ -686,6 +748,14 @@
_html += '<div class="lr-component-control"><div id="lr_component_dfvalue"></div></div>';

$html.append(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$('#lr_component_dateformat').lrselect({
data: [{ id: '0', text: '仅日期' }, { id: '1', text: '日期和时间' }],
value: 'id',
@@ -930,9 +1000,16 @@

_html += '<div class="lr-component-title lrrelation">单位组织控件级联-上一级</div>';
_html += '<div class="lr-component-control lrrelation"><div id="lr_component_relation"></div></div>';
$html.append(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
/*上一级联*/
var organizes = [];
var $parent = $component.parent();
@@ -947,11 +1024,11 @@
data: organizes,
value: 'id',
text: 'text',
select: function (item, type) {
select: function (item,type) {
if (!!item) {
dfop.relation = item.id;
}
else if (type !== 'refresh') {
else if (type !== 'refresh'){
dfop.relation = '';
}
}
@@ -1071,7 +1148,7 @@
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
param: {}
});
}
}
break;
case "company"://公司
$compont.lrCompanySelect({});
@@ -1138,7 +1215,14 @@
_html += '<div class="lr-component-control"><div id="lr_component_dataType"></div></div>';

$html.append(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$('#lr_component_isHide').lrselect({
placeholder: false,
data: [{ id: '0', text: '否' }, { id: '1', text: '是' }],
@@ -1155,7 +1239,7 @@
});
$('#lr_component_isHide').lrselectSet(dfop.isHide);
$('#lr_component_dataType').lrselect({
data: [{ id: 'company', text: '当前公司' }, { id: 'department', text: '当前部门' }, { id: 'user', text: '当前用户' }, { id: 'time', text: '当前时间' }, { id: 'role', text: '当前角色' }],
data: [{ id: 'company', text: '当前公司' }, { id: 'department', text: '当前部门' }, { id: 'user', text: '当前用户' }, { id: 'time', text: '当前时间' }],
value: 'id',
text: 'text',
placeholder: false,
@@ -1167,68 +1251,85 @@
renderTable: function (compont, $row) {
var $compont = $('<input id="' + compont.id + '" readonly type="text" class="form-control lr-currentInfo lr-currentInfo-' + compont.dataType + '" />');
var loginInfo = learun.clientdata.get(['userinfo']);
switch (compont.dataType) {
case 'company':
$compont[0].lrvalue = loginInfo.companyId;
learun.clientdata.getAsync('company', {
key: loginInfo.companyId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
$compont.val(_data.name);
}

}
});
break;
case 'department':
$compont[0].lrvalue = loginInfo.departmentId;
learun.clientdata.getAsync('department', {
key: loginInfo.departmentId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
if (compont._userId != undefined && loginInfo.userId != compont._userId) {
learun.clientdata.getAsync('user', {
key: compont._userId,
callback: function (_data) {
switch (compont.dataType) {
case 'company':
$compont[0].lrvalue = _data.companyId;
learun.clientdata.getAsync('company', {
key: _data.companyId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
$compont.val(_data.name);
}

}
});
break;
case 'department':
$compont[0].lrvalue = _data.departmentId;
learun.clientdata.getAsync('department', {
key: _data.departmentId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
$compont.val(_data.name);
}
}
});
break;
case 'user':
$compont.val(_data.name);
}
$compont[0].lrvalue = compont._userId;
break;
case 'time':
$compont[0].lrvalue = learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss');
$compont.val($compont[0].lrvalue);
break;
}
});
break;
case 'user':
$compont.val(loginInfo.realName);
$compont[0].lrvalue = loginInfo.userId;
break;
case 'role':
$compont.val(loginInfo.roleName);
$compont[0].lrvalue = loginInfo.roleName;
break;
case 'time':
$compont[0].lrvalue = learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss');
$compont.val($compont[0].lrvalue);
break;
}
if (compont.isHide == '1') {
$row.hide();
}
});
}
else {

$row.append($compont);
return $compont;
},
renderQuery: function (compont, $row) {
var $compont = $('<div id="' + compont.id + '"></div>');
$row.append($compont);
switch (compont.dataType) {
case 'company':
$compont[0].lrvalue = loginInfo.companyId;
learun.clientdata.getAsync('company', {
key: loginInfo.companyId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
$compont.val(_data.name);
}

switch (compont.dataType) {
case 'company':
$compont.lrCompanySelect({ type: 'multiple' })
break;
case 'department':
$compont.lrDepartmentSelect();
break;
case 'user':
$compont.lrUserSelect({ type: '1' })
break;
case 'role':
$compont.lrPostSelect({ type: 'treemultiple' });
break;
}
});
break;
case 'department':
$compont[0].lrvalue = loginInfo.departmentId;
learun.clientdata.getAsync('department', {
key: loginInfo.departmentId,
callback: function (_data) {
if ($compont.attr('data-flag') != "1") {
$compont.val(_data.name);
}
}
});
break;
case 'user':
$compont.val(loginInfo.realName);
$compont[0].lrvalue = loginInfo.userId;
break;
case 'time':
$compont[0].lrvalue = learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss');
$compont.val($compont[0].lrvalue);
break;
}
}

if (compont.isHide == '1') {
$row.hide();
}
@@ -1338,6 +1439,14 @@
_html += '<div class="lr-component-control" style="text-align: center;padding-top: 10px;" ><a id="lr_fieldsData_set" class="btn btn-primary btn-block">设置表格字段</a></div>';

$html.html(_html);
// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
$('#lr_component_table').lrselect({
data: designerDfop.dbTable,
value: 'name',
@@ -1491,7 +1600,7 @@
var $compont = $('<div id="' + compont.id + '"></div>');
$row.append($compont);
compont.hideData = [];
var headData = toGirdheadData(compont.fieldsData, compont.hideData, $compont);
if (!!compont.preloadDb && !!compont.preloadTable) {
$compont.jfGrid({
@@ -1526,6 +1635,10 @@
isAutoHeight: (compont.minheight == 0 ? true : false),
height: compont.minheight
});
if (headData.length == 0) {
$compont.hide();
}
//console.log(headData,'test')
}
}
}
@@ -1579,7 +1692,14 @@
_html += '<div class="lr-component-title">所占行比例</div>';
_html += '<div class="lr-component-control"><div id="lr_component_proportion"></div></div>';
$html.html(_html);

// 设置多语言
$html.find('.lr-component-title').each(function () {
var $this = $(this);
var text = $this.text();
top.learun.language.get(text, function (_text) {
$this.text(_text);
});
});
var _field = dfop.field;

// 绑定字段
@@ -1628,7 +1748,8 @@
}
}
});
if (!!designerDfop.dbTable && designerDfop.dbTable.length > 0) {
if (!!designerDfop.dbTable && designerDfop.dbTable.length > 0)
{
$('#lr_component_table').lrselectSet(dfop.table || designerDfop.dbTable[0].name);
}
// 标题设置
@@ -1695,7 +1816,7 @@
};
// 数据字典选择初始化、数据源选择初始化
function setDatasource(dfop) {
$('#lr_component_dfvalue').lrselect({
$('#lr_component_dfvalue').lrselect({
allowSearch: true,
select: function (item) {
if (!!item) {
@@ -1716,7 +1837,7 @@
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetClassifyTree',
type: 'tree',
value: 'value',
value:'value',
select: function (item) {
if (!!item) {
if (dfop.dataSourceId != item.id) {
@@ -1762,7 +1883,7 @@
vlist[1] = item.value;
dfop.dataSourceId = String(vlist);
if (vlist[2] != '') {
learun.clientdata.getAllAsync('sourceData', {
code: vlist[0],
callback: function (dataes) {
@@ -1816,12 +1937,12 @@
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetList',
value: 'F_Code',
text: 'F_Name',
title: 'F_Name',
title:'F_Name',
select: function (item) {
if (item) {
if (dfop.dataSourceId != '') {
var vlist = dfop.dataSourceId.split(',');
if (vlist.length < 3 || vlist[0] != item.F_Code) {
if (vlist.length <3 || vlist[0] != item.F_Code) {
vlist[1] = '';
vlist[2] = '';
dfop.dataSourceId = item.F_Code + ',,';
@@ -1833,7 +1954,7 @@
dfop.dfvalue = '';
}
//$('#lr_component_dfvalue').lrselectRefresh({ url: '', data: [] });

//获取字段数据
learun.httpAsync('GET', top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataColName', { code: item.F_Code }, function (data) {
@@ -1853,7 +1974,7 @@
data: fieldData,
placeholder: false
});
$('#lr_component_dataSourceId2').lrselectSet(vlist[2] || fieldData[0].value);
$('#lr_component_dataSourceId2').lrselectSet(vlist[2] ||fieldData[0].value);
});
}
else {
@@ -1878,7 +1999,7 @@
$('#lr_component_dataItemCode').lrselectSet(dfop.itemCode);
}
else {
var valuelist = dfop.dataSourceId.split(',');
var valuelist = dfop.dataSourceId.split(',');
$('#lr_component_dataSourceId').lrselectSet(valuelist[0]);
}

@@ -2035,7 +2156,7 @@
delete pIds[item['id']];
}
}
});
for (var id in pIds) {
_fn(resdata, id);
@@ -2057,7 +2178,8 @@
return resdata;
}
// html编码
function htmlEncode(text) {
function htmlEncode(text)
{
text = text || "";
text = text.replace(/%/g, "{@bai@}");
text = text.replace(/ /g, "{@kong@}");


+ 137
- 122
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formdesigner.css View File

@@ -11,9 +11,10 @@
-ms-user-select: none;
-khtml-user-select: none;
user-select: none;
padding:0 0px 0 260px;
padding: 0 0px 0 260px;
overflow: hidden;
}

.lr-custmerform-designer-layout-left {
position: absolute;
top: 0;
@@ -21,12 +22,12 @@
height: 100%;
width: 260px;
border-right: 1px solid #ddd;
overflow:visible;
overflow: visible;
}

.lr-custmerform-designer-layout-left .lr-scroll-box {
height: 320px;
overflow:visible;
overflow: visible;
}

.lr-custmerform-designer-layout-left .lr-scroll-vertical {
@@ -34,41 +35,44 @@
}

.lr-custmerform-designer-layout-right {
position:absolute;
top:0;
right:-240px;
height:100%;
width:240px;
border-left:1px solid #ddd;
background-color:#fff;
padding:6px 6px 0 6px;
position: absolute;
top: 0;
right: -240px;
height: 100%;
width: 240px;
border-left: 1px solid #ddd;
background-color: #fff;
padding: 6px 6px 0 6px;
}

.lr-custmerform-designer-layout-center {
position:relative;
height:100%;
width:100%;
padding:0 0 31px 0;
}
.lr-custmerform-designer-layout-center.hasTab {
padding-top:44px;
position: relative;
height: 100%;
width: 100%;
padding: 0 0 31px 0;
}

.lr-custmerform-designer-layout-center.hasTab {
padding-top: 44px;
}

.lr-custmerform-designer-layout-header {
position:absolute;
top:0;
left:0;
width:100%;
height:44px;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 44px;
padding: 5px 5px 0 5px;
display:none;
display: none;
}
.lr-custmerform-designer-tabs .lr-scroll-box{

.lr-custmerform-designer-tabs .lr-scroll-box {
border-bottom: 1px solid #ddd;
white-space: nowrap;
overflow:visible;
overflow: visible;
}
.lr-custmerform-designer-tabs .lr-scroll-box > div {

.lr-custmerform-designer-tabs .lr-scroll-box > div {
moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
@@ -83,10 +87,11 @@
border-radius: 4px 4px 0 0;
display: inline-block;
}
.lr-custmerform-designer-tabs .lr-scroll-box > div:hover {
background-color: #eee;
border-color: #eee #eee #ccc;
}

.lr-custmerform-designer-tabs .lr-scroll-box > div:hover {
background-color: #eee;
border-color: #eee #eee #ccc;
}

.lr-custmerform-designer-tabs .lr-scroll-box > div.active {
color: #555;
@@ -112,39 +117,42 @@


.lr-custmerform-designer-layout-footer {
position:absolute;
bottom:0;
left:0;
height:31px;
width:100%;
border-top:1px solid #ddd;
position: absolute;
bottom: 0;
left: 0;
height: 31px;
width: 100%;
border-top: 1px solid #ddd;
z-index: 3;
background-color:#fff;
background-color: #fff;
}

.lr-custmerform-designer-layout-footer-item {
position:relative;
float:left;
height:100%;
width:100px;
text-align:center;
color:#666;
cursor:pointer;
border-right:1px solid #ddd;
line-height:30px;
}
.lr-custmerform-designer-layout-footer-item:hover {
background-color: #eee;
}
.lr-custmerform-designer-layout-footer-item i {
width:17px;
position: relative;
float: left;
height: 100%;
width: 100px;
text-align: center;
color: #666;
cursor: pointer;
border-right: 1px solid #ddd;
line-height: 30px;
}

.lr-custmerform-designer-layout-footer-item:hover {
background-color: #eee;
}

.lr-custmerform-designer-layout-footer-item i {
width: 17px;
}

.lr-custmerform-designer-layout-center-bg {
position:absolute;
top:44px;
left:0;
width:100%;
overflow-x:hidden;
position: absolute;
top: 44px;
left: 0;
width: 100%;
overflow-x: hidden;
}

.lr-custmerform-designer-layout-tabedit {
@@ -164,6 +172,7 @@
height: 100%;
z-index: 1;
}

.lr-custmerform-designer-layout-area .lr-scroll-box {
position: relative;
min-height: 100%;
@@ -171,62 +180,66 @@
z-index: 1;
padding: 8px;
}

.ui-state-highlight {
position:relative;
width:100%;
height:39px;
line-height:37px;
margin:1px 0 2px 0;
background: #FAFAE9!important;
border: 2px dotted #d5d5d5;
text-align:center;
color: #9f9f9f;
float:left;
position: relative;
width: 100%;
height: 39px;
line-height: 37px;
margin: 1px 0 2px 0;
background: #FAFAE9 !important;
border: 2px dotted #d5d5d5;
text-align: center;
color: #9f9f9f;
float: left;
}

.lr-compont-item {
position: relative;
height:40px!important;
line-height:38px;
height: 40px !important;
line-height: 38px;
border-top: 1px solid #eeecec;
border-bottom: 1px solid #eeecec;
overflow: hidden;
cursor: move;
margin-top: -1px;
padding-left:110px;
float:left;
padding-left: 110px;
float: left;
border-right: 1px solid #eeecec;
}


.lr-compont-title {
position:absolute;
top:0;
left:0;
width:110px;
height:100%;
padding-left:10px;
background-color:#f5f5f5;
position: absolute;
top: 0;
left: 0;
width: 110px;
height: 100%;
padding-left: 10px;
background-color: #f5f5f5;
}
.lr-compont-item.active .lr-compont-title{
background-color:#3498DB;
color:#fff;

.lr-compont-item.active .lr-compont-title {
background-color: #3498DB;
color: #fff;
}

.lr-compont-remove {
position:absolute;
top:0;
right:4px;
z-index:1;
cursor:pointer;
color:#cf5c60;
display:none;
position: absolute;
top: 0;
right: 4px;
z-index: 1;
cursor: pointer;
color: #cf5c60;
display: none;
}

.lr-compont-item.active .lr-compont-remove {
display:block;
display: block;
}

.lr-compont-value {
padding-left:10px;
padding-left: 10px;
color: #9f9f9f;
}

@@ -234,7 +247,7 @@

/*表单设计组件*/
.lr-custmerform-component {
position:relative;
position: relative;
width: 107px;
height: 30px;
line-height: 28px;
@@ -242,46 +255,48 @@
border-radius: 5px;
cursor: pointer;
box-shadow: 2px 1px 1px 1px rgba(0,0,0,.05);
z-index:2;
margin:12px 0 0 15px;
float:left;
}
.lr-custmerform-component i {
padding-left: 10px;
width:28px;
color: #2c3849;
opacity: .9;
z-index: 2;
margin: 12px 0 0 15px;
float: left;
}

.lr-custmerform-component i {
padding-left: 10px;
width: 28px;
color: #2c3849;
opacity: .9;
}

.lr-custmerform-designer-layout-left .lr-custmerform-component {
margin:10px 0 0 15px;
margin: 10px 0 0 15px;
}


.lr-custmerform-designer-layout-left .lr-custmerform-component:hover {
color: #333;
background-color: #e6e6e6;
}

.lr-custmerform-designer-layout-left .lr-custmerform-component:hover {
color: #333;
background-color: #e6e6e6;
}


/*组件属性设置*/
.lr-component-tips{
.lr-component-tips {
color: #9f9f9f;
padding-bottom: 5px;
}
.lr-component-tips i
{
padding-right: 5px;
padding-left: 2px;
}
.lr-component-title
{
.lr-component-tips i {
padding-right: 5px;
padding-left: 2px;
}
.lr-component-title {
height: 28px;
line-height: 28px;
}
.lr-component-title .help
{
color: #9f9f9f;
cursor: help;
padding-left: 5px;
}
.lr-component-title .help {
color: #9f9f9f;
cursor: help;
padding-left: 5px;
}

+ 0
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formdesigner.js View File

@@ -111,7 +111,6 @@
row.id = learun.newGuid();
row.text = '新建选项卡';
row.componts = [];
console.log(dfop.data);
$.lrCustmerFormDesigner.renderTabs($self);
},
onMinusRow: function (row, rows) {
@@ -467,7 +466,6 @@
}
}
else {
console.log(dfop.data[i].componts[j].type);
if (dfop.data[i].componts[j].type == 'gridtable' || dfop.data[i].componts[j].type == 'girdtable') {
if (table == '') {
learun.alert.error('【表格项】请绑定数据表!');


+ 72
- 50
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js View File

@@ -61,25 +61,30 @@
for (var i = 0; i < iLen; i++) {
var $content = $('<div class="lr-form-wrap"></div>');
$container.append($content);
var authorizeField = learun.frameTab.currentIframe().lrForm;//测试表单权限

for (var j = 0, jLen = data[i].componts.length; j < jLen; j++) {
var compont = data[i].componts[j];
if (!!compont.table && !!compont.field) {
//console.log('bool', compont.id in authorizeField)
compontsMap[compont.table + compont.field.toLowerCase()] = compont.id;
}

var $row = $('<div class="col-xs-' + (12 / parseInt(compont.proportion)) + ' lr-form-item" ></div>');
var $title = $(' <div class="lr-form-item-title">' + compont.title + getFontHtml(compont.verify) + '</div>');
if (compont.title != '') {
$row.append($title);
}
$content.append($row);
var $compont = $.lrFormComponents[compont.type].renderTable(compont, $row);
if (!!$compont && !!compont.verify && compont.verify != "") {
$compont.attr('isvalid', 'yes').attr('checkexpession', compont.verify);
}
if (compont.type == 'girdtable') {
girdCompontMap[compont.table] = compont;
}
//验证表单字段权限
// if (compont.id in authorizeField || compont.type == 'guid') {
var $row = $('<div class="col-xs-' + (12 / parseInt(compont.proportion)) + ' lr-form-item" ></div>');
var $title = $(' <div class="lr-form-item-title">' + compont.title + getFontHtml(compont.verify) + '</div>');
if (compont.title != '') {
$row.append($title);
}
$content.append($row);
var $compont = $.lrFormComponents[compont.type].renderTable(compont, $row);
if (!!$compont && !!compont.verify && compont.verify != "") {
$compont.attr('isvalid', 'yes').attr('checkexpession', compont.verify);
}
if (compont.type == 'girdtable') {
girdCompontMap[compont.table] = compont;
}
// }
}


@@ -92,8 +97,8 @@
}
}

$('.lr-form-wrap').lrscroll();
//$('.lr-form-wrap').lrscroll();
$('.lr-form-wrap').css({ 'overflow': 'auto' });//换回原生滚动条
return girdCompontMap;
};

@@ -246,51 +251,68 @@
$obj.val(learun.formatDate(value, 'yyyy-MM-dd hh:mm'));
}

break;
case "lr-Uploader":
$obj.lrUploaderSet(value);
break;
default:
if ($obj.hasClass('lr-currentInfo-user')) {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('user', {
key: value,
callback: function (item, op) {
op.obj.attr('data-flag', '1');
op.obj.val(item.name);
},
obj: $obj
});
if (value != null && value != 'null') {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('user', {
key: value,
callback: function (item, op) {
op.obj.attr('data-flag', '1');
op.obj.val(item.name);
},
obj: $obj
});
}

}
else if ($obj.hasClass('lr-currentInfo-company')) {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('company', {
key: value,
callback: function (_data, op) {
op.obj.attr('data-flag', '1');
op.obj.val(_data.name);
},
obj: $obj
});
if (value != null && value != 'null') {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('company', {
key: value,
callback: function (_data, op) {
op.obj.attr('data-flag', '1');
op.obj.val(_data.name);
},
obj: $obj
});
}

}
else if ($obj.hasClass('lr-currentInfo-department')) {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('department', {
key: value,
callback: function (item, op) {
op.obj.attr('data-flag','1');
op.obj.val(item.name);
},
obj: $obj
});
if (value != null && value != 'null') {
$obj[0].lrvalue = value;
$obj.val('');
learun.clientdata.getAsync('department', {
key: value,
callback: function (item, op) {
op.obj.attr('data-flag', '1');
op.obj.val(item.name);
},
obj: $obj
});
}

}
else if ($obj.hasClass('lr-currentInfo-guid')) {
$obj[0].lrvalue = value;
$obj.val(value);
if (value != null && value != 'null') {
$obj[0].lrvalue = value;
$obj.val(value);
}
}
else if ($obj.hasClass('lr-currentInfo-time')) {
if (value != null && value != 'null') {
$obj[0].lrvalue = value;
$obj.val(value);
}
}
else if ($obj.hasClass('edui-default')) {
ueSet($obj[0].ue, value);
@@ -306,7 +328,7 @@
};

function ueSet(ue, content) {
ue.ready(function() {
ue.ready(function () {
ue.setContent(content);
});
}


Loading…
Cancel
Save