|
@ -29,11 +29,6 @@ class StiReportController extends DefaultController
|
|||
return $this->render();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return $this->render();
|
||||
}
|
||||
|
||||
public function saveReport()
|
||||
{
|
||||
$gets = Request::all();
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<meta charset="utf-8">
|
||||
<title>{{$setting['title']}}</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
||||
<link href="{{mix('/assets/dist/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/vendor.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/gdoo.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<script src="{{$asset_url}}/vendor/jquery.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
|
|
|
@ -1,333 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="itemName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">类型</label>
|
||||
<select class="form-control input-sm" onchange="javascript:fnTypeChange(this.value);" id="itemType">
|
||||
<optgroup label="单行输入框">
|
||||
<option value="sys_date">当前日期,形如 1999-01-01</option>
|
||||
<option value="sys_date_cn">当前日期,形如 2009年1月1日</option>
|
||||
<option value="sys_date_cn_short3">当前日期,形如 2009年</option>
|
||||
<option value="sys_date_cn_short4">当前年份,形如 2009</option>
|
||||
<option value="sys_date_cn_short1">当前日期,形如 2009年1月</option>
|
||||
<option value="sys_date_cn_short2">当前日期,形如 1月1日</option>
|
||||
<option value="sys_time">当前时间</option>
|
||||
<option value="sys_datetime">当前日期+时间</option>
|
||||
<option value="sys_week">当前星期中的第几天,形如 星期一</option>
|
||||
<option value="sys_userid">当前用户ID</option>
|
||||
<option value="sys_user_name">当前用户姓名</option>
|
||||
<option value="sys_department_name">当前用户部门(长名称)</option>
|
||||
<option value="sys_department_short_name">当前用户部门(短名称)</option>
|
||||
<option value="sys_user_position">当前用户职位</option>
|
||||
<option value="sys_user_position_assist">当前用户辅助职位</option>
|
||||
<option value="sys_user_name_date">当前用户姓名+日期</option>
|
||||
<option value="sys_user_name_datetime">当前用户姓名+日期+时间</option>
|
||||
<option value="sys_salesman_name">当前业务员姓名</option>
|
||||
<option value="sys_salesman_id">当前业务员ID</option>
|
||||
<option value="sys_workflow_name">工作流名称</option>
|
||||
<option value="sys_process_title">工作主题</option>
|
||||
<option value="sys_process_number">工作文号</option>
|
||||
<option value="sys_rundate">流程开始日期</option>
|
||||
<option value="sys_rundatetime">流程开始日期+时间</option>
|
||||
<option value="sys_runid">流水号</option>
|
||||
<option value="sys_autonum">文号计数器</option>
|
||||
<option value="sys_ip">经办人ip地址</option>
|
||||
<option value="sys_manager1">部门主管(本部门)</option>
|
||||
<option value="sys_manager2">部门主管(上级部门)</option>
|
||||
<option value="sys_manager3">部门主管(一级部门)</option>
|
||||
<option value="sys_sql">来自sql查询语句</option>
|
||||
</optgroup>
|
||||
<optgroup label="下拉菜单">
|
||||
<option value="sys_list_dept">部门列表</option>
|
||||
<option value="sys_list_user">人员列表</option>
|
||||
<option value="sys_list_pos">角色列表</option>
|
||||
<option value="sys_list_prcsuser1">流程设置所有经办人列表</option>
|
||||
<option value="sys_list_prcsuser2">本步骤设置经办人列表</option>
|
||||
<option value="sys_list_manager1">部门主管(本部门)</option>
|
||||
<option value="sys_list_manager2">部门主管(上级部门)</option>
|
||||
<option value="sys_list_manager3">部门主管(一级部门)</option>
|
||||
<option value="sys_list_sql">来自sql查询语句的列表</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label">控件样式</label>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="itemWidth" name="width" class="form-control input-sm" type="text" value="150">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">字体</div>
|
||||
<input id="itemSize" name="font-size" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="itemSql" style="display:none;">
|
||||
|
||||
<label class="control-label">
|
||||
|
||||
SQL查询语句 ('号用`号替换)
|
||||
|
||||
<a title="SQL书写指导" onclick="fnShowGuide();" href="javascript:;">说明</a>
|
||||
|
||||
<a title="测试SQL语句" onclick="fnCheckSql(true);" href="javascript:;">测试</a>
|
||||
</label>
|
||||
|
||||
<textarea class="form-control" id="txtSql" title="如宏控件类型选择来自SQL查询语句,则填写"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><input id="hidden" name="hidden" type="checkbox"> 隐藏</label>
|
||||
</div>
|
||||
|
||||
<div id="tblwrap" style="display:none;">
|
||||
|
||||
<div class="page-header m-t-md">
|
||||
<h3>SQL书写指导<span style="position:fixed;right:20px;">
|
||||
<a href="javascript:;" title="回到控件属性页" onclick="fnShowGuide();">关闭</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="alert alert-error">
|
||||
<a class="close" data-dismiss="alert">×</a>
|
||||
<strong>注意!</strong> SQL语句中的单引号请用符号`替换(该符号在键盘TAB上方)。
|
||||
</div>
|
||||
<blockquote>
|
||||
<p>宏控件可以代替手工输入,实现根据用户指定要求进行自动取值,使得工作流的表单填写更加智能与方便,宏控件类型选择当前日期,点击【确定】,在表单上
|
||||
就生成了该控件,填写表单时就会自动填入当前日期了。另外宏控件也支持隐藏属性,对不需要在表单显示字段可以将其隐藏。宏控件支持来自SQL查询,语句,下面重点介绍一下。 </p>
|
||||
</blockquote>
|
||||
<p>来自SQL语句的宏控件,因其定义格式比较复杂,需要具备SQL语言的专业知识,并了解OA系统数据库结构,建议在技术支持人员指导下完成。</p><br/>
|
||||
<p>可以参照以下格式书写SQL语句:</p><br/>
|
||||
<strong>下拉菜单型语句如:</strong><br/><br/>
|
||||
<p>
|
||||
<code>SELECT name FROM book_category ORDER BY sort</code><br/><br/>
|
||||
该语句表示列出全部书籍的分类名,并按序号排序显示
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<strong>单行输入框语句如:</strong><br/><br/>
|
||||
<code>SELECT realname FROM common_member WHERE username = `gzzr`</code><br/><br/>
|
||||
该语句表示查询用户名为gzzr的用户的真实姓名<br/><br/>
|
||||
</p>
|
||||
<strong>目前,SQL语句中已支持以下宏变量,更加方便用户使用:</strong><br/><br/>
|
||||
<code>[sys_user_id]</code> 表示当前用户的用户ID<br/><br/>
|
||||
<code>[sys_dept_id]</code> 表示当前用户的部门ID<br/><br/>
|
||||
<code>[sys_pos_id]</code> 表示当前用户角色ID<br/><br/>
|
||||
<code>[sys_run_id]</code> 表示当前的工作流水号,可用于表单数据表的查询<br/><br/>
|
||||
<p>
|
||||
例如:<br/><br/>
|
||||
<code>SELECT realname FROM common_member WHERE uid=`[sys_user_id]`</code><br/><br/>
|
||||
此句表示查询当前用户的真实姓名
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<code>SELECT realname FROM common_member WHERE FIND_IN_SET(deptid,`[sys_dept_id]`)</code><br/><br/>
|
||||
此句表示查询当前部门所有用户的姓名
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<code>SELECT realname FROM common_membe WHERE deptid = `[sys_dept_id]` ORDER BY uid</code><br/><br/>
|
||||
此句表示查询当前部门所有用户的姓名,并按角色序号排序
|
||||
</p>
|
||||
<p>可以利用SQL语句查询系统代码设置中所设置的代码,实现下拉菜单根据代码定义动态变化:</p><br/><br/>
|
||||
例如:<br/><br/>
|
||||
<code>SELECT name FROM common_syscode WHERE number = `AREA` ORDER BY sort</code><br/><br/>
|
||||
<p>此句表示列出系统代码“地区”的全部值,“地区”的代码编号是“AREA”。</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//如果是编辑控件
|
||||
if( UE.plugins['auto'].editdom ) {
|
||||
oNode = UE.plugins['auto'].editdom;
|
||||
if( oNode.tagName == 'INPUT' ) {
|
||||
if(oNode.getAttribute('hide')=='1'){
|
||||
$G('hidden').checked = true;
|
||||
}
|
||||
}
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
$G('itemType').value = oNode.getAttribute('datafld');
|
||||
$G('txtSql').value = oNode.getAttribute('datasrc');
|
||||
var sSizeFull = oNode.style.width;
|
||||
$G('itemWidth').value = sSizeFull.substr(0, sSizeFull.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
}
|
||||
fnTypeChange( $G('itemType').value );
|
||||
}
|
||||
|
||||
function fnShowGuide() {
|
||||
$('#tblwrap').slideToggle().siblings().slideToggle();
|
||||
}
|
||||
function fnTypeChange(sV) {
|
||||
var aAllowItem = ['sys_list_dept','sys_list_user','sys_list_pos',
|
||||
'sys_list_prcsuser1','sys_list_prcsuser2','sys_list_manager1',
|
||||
'sys_list_manager2','sys_list_manager3','sys_list_sql'];
|
||||
if( sV == "sys_sql" || sV == "sys_list_sql") {
|
||||
|
||||
$('#itemSql').show();$('#itemAttr').hide();
|
||||
} else {
|
||||
$('#itemSql').hide();$('#itemAttr').show();
|
||||
//$('#itemSql').hide().siblings('tbody').show();
|
||||
}
|
||||
if($.inArray(sV,aAllowItem) == -1) {
|
||||
$('#hidden').removeAttr('disabled').parent().css('cursor', 'default');
|
||||
} else {
|
||||
$G('hidden').checked = false;
|
||||
$('#hidden').attr('disabled','disabled').parent().css('cursor', 'not-allowed');
|
||||
}
|
||||
}
|
||||
function fnCheckSql ( bCheckFlag ) {
|
||||
//检测单引号和回车
|
||||
var sExpr1 = /\n/g;
|
||||
var sExpr2 = /'/g;
|
||||
var sSql = $G("txtSql").value;
|
||||
if( sSql.match(sExpr1) || sSql.match(sExpr2) ) {
|
||||
var sMsg = "您的sql语句中存在单引号和回车,不符合要求,是否进行替换?";
|
||||
if( window.confirm(sMsg) ) {
|
||||
sSql = sSql.replace( sExpr1,"" );
|
||||
sSql = sSql.replace( sExpr2,"`" );
|
||||
$G("txtSql").innerHTML = sSql;
|
||||
} else {
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
if( bCheckFlag ) {
|
||||
var oDate = new Date();
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=testsql&time=' +oDate.getTime() + '&sql=' + sSql;
|
||||
ajax.request(sUrl, {async:false, timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
alert(xhr.responseText);
|
||||
} catch ( e ) {
|
||||
alert ( ' 测试SQL正确性时遇到问题,请联系OA管理员处理 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['auto'].editdom ) {
|
||||
delete UE.plugins['auto'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if ( $G('itemName').value == '' ) {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
} else if ( $G('itemType').value == 'sys_sql' || $G('itemType').value=='sys_list_sql' ) {
|
||||
if ( $G('txtSql').value == '' ) {
|
||||
alert('SQL查询语句不能为空');
|
||||
return false;
|
||||
} else if ( !fnCheckSql( false )) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false, timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
if ($G('itemType').value.indexOf('sys_list') < 0 ) {
|
||||
oNode = document.createElement("input");
|
||||
oNode.setAttribute('type','text');
|
||||
oNode.setAttribute('value','{auto}');
|
||||
} else {
|
||||
oNode = document.createElement("select");
|
||||
var objOption = new Option('{auto}', '');
|
||||
oNode.options[oNode.options.length] = objOption;
|
||||
}
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"",""") );
|
||||
oNode.setAttribute('name','data_'+ nItemId);
|
||||
oNode.setAttribute('class','auto');
|
||||
oNode.setAttribute('datafld',$G('itemType').value );
|
||||
oNode.setAttribute('datasrc',$G('txtSql').value );
|
||||
if( $G('hidden').checked ) {
|
||||
oNode.setAttribute('hide', '1' ) ;
|
||||
} else {
|
||||
oNode.setAttribute('hide', '0' ) ;
|
||||
}
|
||||
if( $G('itemWidth').value!="" ) {
|
||||
oNode.style.width = $G('itemWidth').value + 'px';
|
||||
}
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true;
|
||||
} catch ( e ) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
var nItemId = oNode.getAttribute('name').substr(5);
|
||||
var oNewNode = null;
|
||||
domUtils.remove(oNode,false); //删除当前控件,再创建一个新的
|
||||
if ( $G('itemType').value.indexOf('sys_list') < 0 ) {
|
||||
oNewNode = document.createElement("input");
|
||||
oNewNode.setAttribute('type','text');
|
||||
oNewNode.setAttribute('value','{auto}');
|
||||
} else {
|
||||
oNewNode = document.createElement("select");
|
||||
var objOption = new Option('{auto}', '');
|
||||
oNewNode.options[oNewNode.options.length] = objOption;
|
||||
}
|
||||
oNewNode.setAttribute('title',$G('itemName').value.replace("\"",""") );
|
||||
oNewNode.setAttribute('name','data_'+ nItemId );
|
||||
oNewNode.setAttribute('class','auto');
|
||||
oNewNode.setAttribute('datafld',$G('itemType').value );
|
||||
oNewNode.setAttribute('datasrc',$G('txtSql').value );
|
||||
if( $G('hidden').checked ) {
|
||||
oNewNode.setAttribute('hide', '1' );
|
||||
} else {
|
||||
oNewNode.setAttribute('hide', '0' );
|
||||
}
|
||||
if( $G('itemWidth').value!="" ) {
|
||||
oNewNode.style.width = $G('itemWidth').value + 'px';
|
||||
}
|
||||
editor.execCommand('insertHtml',oNewNode.outerHTML);
|
||||
delete UE.plugins['auto'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,169 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>计算控件属性</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="itemName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="itemWidth" name="width" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">宽(px)</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label">计算公式</label>
|
||||
<a class="pull-right" title="计算控件说明" onclick="fnShowGuide();">帮助</a>
|
||||
<textarea id="itemValue" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">计算精度</label>
|
||||
<input id="itemPrec" name="prec" class="form-control input-inline input-sm" type="text" value="2">
|
||||
<span class="help-inline">默认保留小数点后2位</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="tblwrap" style="display:none;">
|
||||
<div class="page-header m-t-md">
|
||||
<h3>计算控件说明<span style="position:fixed;right:20px;"><a title="回到控件属性页" onclick="fnShowGuide();">关闭</a></span></h3>
|
||||
</div>
|
||||
<div>
|
||||
<blockquote>
|
||||
<p>在日常的工作中,填写表单时,经常会存在一些计算项目,比如金额的计算,比如天数的计算,使用计算控件可以简化人员操作,提高准确性。 </p>
|
||||
<p>以下举例说明计算控件的使用方法(以日历控件计算天数为例):</p>
|
||||
</blockquote>
|
||||
<p>首先,先建立好需要参与计算的项目,如图建立好开始时间和结束时间这两个日历控件,当然了每个日历控件都有对应的输入框控件</p><br/><br/>
|
||||
<img src="helper/calc/calc1.jpg">
|
||||
<p>接下来点击计算控件按钮,新建一个计算控件,设定时需要输入计算公式,公式的规则就是四则运算规则,可以利用括号和加减乘除,公式的计算项目就是上面
|
||||
建立的单行输入框控件的名称,如图:</p><br/><br/>
|
||||
<img src="helper/calc/calc2.jpg" width="453px"><br/><br/>
|
||||
<p>上面日期差的实例实现的效果如图,而且<span class="label label-important">计算控件的输入内容是不允许修改的。</span></p><br/><br/>
|
||||
<img src="helper/calc/calc3.jpg">
|
||||
<p>计算公式支持+ - * / ^和英文括号以及特定计算函数,例如:(数值1+数值2)*数值3-ABS(数值4),其中数值1、数值2等为表单控件名称。 计算控件支持的函数计算如下: </p><br/><br/>
|
||||
<p>1、MAX(数值1,数值2,数值3...) 输出最大值,英文逗号分割; </p><br/><br/>
|
||||
<p>2、MIN(数值1,数值2,数值3...) 输出最小值,英文逗号分割; </p><br/><br/>
|
||||
<p>3、ABS(数值1) 输出绝对值; </p><br/><br/>
|
||||
<p>4、AVG(数值1,数值2,数值3) 输出平均值; </p><br/><br/>
|
||||
<p>5、RMB(数值1) 输出人民币大写形式,数值范围0~9999999999.99; </p><br/><br/>
|
||||
<p>6、DAY(日期1-日期2) 输出时间差的整数天数; </p><br/><br/>
|
||||
<p>7、HOUR(日期1-日期2) 输出时间差的小时数; </p><br/><br/>
|
||||
<p>8、DATE(日期1-日期2) 输出时间差,形如:xx天xx小时xx分xx秒; </p><br/><br/>
|
||||
<p>9、LIST(列表控件名,第几列) 计算列表控件指定列的和;</p><br/><br/>
|
||||
<p>10、LISTS(列表控件名:第几列 + 列表控件名:第几列);</p><br/><br/>
|
||||
|
||||
<p>值得说明的是LIST函数,它可以读取列表控件某列数据的和,下面以实例说明一下: </p><br/><br/>
|
||||
<p>假如设计的列表控件如下图</p><br/><br/>
|
||||
<img src="helper/calc/calc4.jpg" width="453px"><br/><br/>
|
||||
<p>我们现在用计算控件将价格这一列的数据取出来,添加计算控件,公式书写如下:</p><br/><br/>
|
||||
<img src="helper/calc/calc5.jpg" width="453px"><br/><br/>
|
||||
<p>实现效果如下:</p><br/><br/>
|
||||
<p>LIST函数主要用于列表控件数据参与条件设置的情况。 </p><br/><br/>
|
||||
<span class="label label-important">注意:参与日期计算的控件必须为日期类型或者日期+时间类型。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
var oListText;
|
||||
window.onload = function() {
|
||||
// 弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if(UE.plugins['calc'].editdom) {
|
||||
oNode = UE.plugins['calc'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
$G('itemValue').value = oNode.getAttribute('value');
|
||||
var sPrec = oNode.getAttribute('prec') ;
|
||||
if( sPrec ) {
|
||||
$G('itemPrec').value = sPrec;
|
||||
}
|
||||
var sItemWidth = oNode.style.width;
|
||||
$G('itemWidth').value = sItemWidth.substr(0, sItemWidth.length - 2);
|
||||
}
|
||||
}
|
||||
function fnShowGuide(){
|
||||
$('#tblwrap').slideToggle().siblings().slideToggle();
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['calc'].editdom ) {
|
||||
delete UE.plugins['calc'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if( $G('itemName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$('#itemName').focus();
|
||||
return false;
|
||||
} else if( $G('itemValue').value == '' ) {
|
||||
alert('请添加计算公式');
|
||||
$('#itemValue').focus();
|
||||
return false;
|
||||
}
|
||||
//检查公式
|
||||
if( $G('itemValue').value.indexOf("(")>=0 ) {
|
||||
var nNum1 = $G('itemValue').value.split("(").length - 1;
|
||||
var nNum2 = $G('itemValue').value.split(")").length - 1;
|
||||
if( nNum1!=nNum2 ) {
|
||||
alert("公式书写错误,请检查括号匹配!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("input");
|
||||
oNode.setAttribute('name', 'data_' + nItemId);
|
||||
oNode.setAttribute('title', $G('itemName').value.replace("\"",""") );
|
||||
oNode.setAttribute('class', 'calc');
|
||||
oNode.setAttribute('value',$.trim($G('itemValue').value));
|
||||
oNode.setAttribute('prec',$G('itemPrec').value);
|
||||
if( $G('itemWidth').value!="" ) {
|
||||
oNode.style.width = $G('itemWidth').value + 'px';
|
||||
}
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true ;
|
||||
} catch ( e ) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('title', $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('value',$.trim($G('itemValue').value));
|
||||
oNode.setAttribute('prec',$G('itemPrec').value);
|
||||
if( $G('itemWidth').value!="" ){
|
||||
oNode.style.width = $G('itemWidth').value + 'px';
|
||||
}
|
||||
delete UE.plugins['calc'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,334 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="txtName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">
|
||||
日历类型
|
||||
<a title="显示日历控件使用帮助" onclick="fnShowGuide();"> 帮助</a>
|
||||
</label>
|
||||
<select class="form-control input-sm" id="dateFormat" onchange="fnShowDef(this.value);">
|
||||
<option value="yyyy-MM-dd">日期,形如:2010-09-09</option>
|
||||
<option value="yyyy-MM-dd HH:mm:ss">日期,形如:2010-09-09 09:25:00</option>
|
||||
<option value="">自定义格式</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="def_format" style="display:none;">
|
||||
<label class="control-label">自定格式</label>
|
||||
<input type="text" placeholder="自定类型" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="txtWidth" name="width" class="form-control input-sm" type="text" value="150">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tblwrap" style="display:none;">
|
||||
|
||||
<div class="page-header m-t-md">
|
||||
<h3>日历控件帮助<span style="position:fixed;right:20px;"><a title="回到控件属性页" onclick="fnShowGuide();">关闭</a></span></h3>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<blockquote>
|
||||
<p>日历控件实现如下图的效果:</p>
|
||||
</blockquote>
|
||||
<img src="helper/calendar/calendar.jpg" />
|
||||
<p>另外,日历控件除了有供选择的输入格式外,还支持自定义的格式,自定义格式设置要求如下:</p><br/>
|
||||
<code>yMdHmswW</code><br/><br/>
|
||||
分别代表:年月日时分秒星期周,可以任意组合这些元素来自定义你个性化的日期格式。<br/><br/>
|
||||
日期格式表:<br/><br/>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>格式</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>y</code></td>
|
||||
<td>
|
||||
将年份表示为最多两位数字,如果年份多于两位数,则结果中仅显示两位低位数。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yy</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yyy</code></td>
|
||||
<td>
|
||||
将年份表示为三位数字。如果少于三位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yyyy</code></td>
|
||||
<td>
|
||||
将年份表示为四位数字。如果少于四位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>M</code></td>
|
||||
<td>
|
||||
将月份表示为从 1 至 12 的数字
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MM</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MMM</code></td>
|
||||
<td>
|
||||
返回月份的缩写 一月 至 十二月 (英文状态下 Jan to Dec) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MMMM</code></td>
|
||||
<td>
|
||||
返回月份的全称 一月 至 十二月 (英文状态下 January to December) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>d</code></td>
|
||||
<td>
|
||||
将月中日期表示为从 1 至 31 的数字。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>dd</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>H</code></td>
|
||||
<td>
|
||||
将小时表示为从 0 至 23 的数字。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>HH</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>m</code></td>
|
||||
<td>
|
||||
将分钟表示为从 0 至 59 的数字。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>mm</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>s</code></td>
|
||||
<td>
|
||||
将秒表示为从 0 至 59 的数字。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ss</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>w</code></td>
|
||||
<td>
|
||||
返回星期对应的数字 0 (星期天) - 6 (星期六) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>D</code></td>
|
||||
<td>
|
||||
返回星期的缩写 一 至 六 (英文状态下 Sun to Sat) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DD</code></td>
|
||||
<td>
|
||||
返回星期的全称 星期一 至 星期六 (英文状态下 Sunday to Saturday) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>W</code></td>
|
||||
<td>
|
||||
返回周对应的数字 (1 - 53) 。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>WW</code></td>
|
||||
<td>
|
||||
同上,如果小于两位数,前面补零 (01 - 53) 。
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
示例:<br/><br/>
|
||||
<table class="table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>格式字符串</th>
|
||||
<th>值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>yyyy-MM-dd HH:mm:ss</code></td>
|
||||
<td>2012-06-12 19:20:00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yy年M月</code></td>
|
||||
<td> 12年8月 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yyyyMMdd</code></td>
|
||||
<td> 20080312 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>现在是:yyyy 年M年d HH时mm分</code></td>
|
||||
<td> 现在是:2012 年8月12日 19时20分 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>H:m:s</code></td>
|
||||
<td> 19:20:0 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>y年</code></td>
|
||||
<td> 8年 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>MMMM d, yyyy</code></td>
|
||||
<td> 三月 12, 2012 </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['calendar'].editdom ){
|
||||
oNode = UE.plugins['calendar'].editdom;
|
||||
$G('txtName').value = oNode.getAttribute('title');
|
||||
var sDateFmt = oNode.getAttribute('date_format');
|
||||
if ( sDateFmt == null ) {
|
||||
$G('dateFormat').value = "yyyy-MM-dd";
|
||||
} else if ( sDateFmt == "yyyy-MM-dd" ) {
|
||||
$G('dateFormat').options[0].selected = true;
|
||||
} else if ( sDateFmt == "yyyy-MM-dd HH:mm:ss" ) {
|
||||
$G('dateFormat').options[1].selected = true;
|
||||
} else {
|
||||
$G('dateFormat').value = "";
|
||||
$G('def_format').value = sDateFmt;
|
||||
$G('def_format').style.display = "";
|
||||
}
|
||||
var sWidth = oNode.style.width;
|
||||
$G('txtWidth').value = sWidth.substr(0, sWidth.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
}
|
||||
//$('#showTips').popover({placement:'top'});
|
||||
}
|
||||
function fnShowDef(val){
|
||||
$G("def_format").style.display = val =="" ? "" : "none";
|
||||
}
|
||||
function fnShowGuide(){
|
||||
$('#tblwrap').slideToggle().siblings().slideToggle();
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['calendar'].editdom ) {
|
||||
delete UE.plugins['calendar'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if($G('txtName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('txtName').focus();
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement('input');
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('class','date');
|
||||
oNode.setAttribute('title',$G('txtName').value.replace("\"","""));
|
||||
if( $G('dateFormat').value == '' ) {
|
||||
oNode.setAttribute('date_format',$G('def_format').value);
|
||||
} else {
|
||||
oNode.setAttribute('date_format',$G('dateFormat').value);
|
||||
}
|
||||
if( $G('txtWidth').value!=''){
|
||||
oNode.style.width = $G('txtWidth').value + 'px';
|
||||
} else {
|
||||
oNode.style.width = '100px';
|
||||
}
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
} catch (e) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if( $G('txtWidth').value!=''){
|
||||
oNode.style.width = $G('txtWidth').value + 'px';
|
||||
} else {
|
||||
oNode.style.width = '100px';
|
||||
}
|
||||
oNode.setAttribute('title',$G('txtName').value.replace("\"","""));
|
||||
if( $G('dateFormat').value == '' ) {
|
||||
oNode.setAttribute('date_format',$G('def_format').value);
|
||||
} else {
|
||||
oNode.setAttribute('date_format',$G('dateFormat').value);
|
||||
}
|
||||
delete UE.plugins['calendar'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,88 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>复选框属性</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" placeholder="必填项" id="txtName" name="name" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><input id="checked_true" name="checked" type="checkbox"> 默认选中</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
if (UE.plugins['checkbox'].editdom) {
|
||||
oNode = UE.plugins['checkbox'].editdom;
|
||||
var input = $(oNode);
|
||||
$('#txtName').val(input.attr('title'));
|
||||
$('#checked_true').prop('checked', input.prop('checked'));
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if(UE.plugins['checkbox'].editdom) {
|
||||
delete UE.plugins['checkbox'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function () {
|
||||
|
||||
if ($('#txtName').val() == '') {
|
||||
alert('控件名称不能为空');
|
||||
$('#txtName').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
$.ajax({
|
||||
url: sUrl,
|
||||
async: false,
|
||||
success: function(res) {
|
||||
nItemId = res;
|
||||
oNode = document.createElement("input");
|
||||
oNode.setAttribute('title', $G('txtName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('class','checkbox checkbox-inline');
|
||||
oNode.setAttribute('type','checkbox');
|
||||
if ($G('checked_true').checked) {
|
||||
oNode.setAttribute('checked','checked');
|
||||
} else {
|
||||
oNode.checked = false;
|
||||
}
|
||||
editor.execCommand('insertHtml', oNode.outerHTML);
|
||||
}
|
||||
});
|
||||
return true
|
||||
|
||||
} else {
|
||||
oNode.setAttribute('title', $G('txtName').value.replace("\"","""));
|
||||
if ($G('checked_true').checked) {
|
||||
oNode.setAttribute('checked','checked');
|
||||
} else {
|
||||
oNode.removeAttribute('checked');
|
||||
}
|
||||
delete UE.plugins['checkbox'].editdom; //使用后清空这个对象,变回新增模式
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,77 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<link rel="stylesheet" href="../../third-party/codemirror2.15/codemirror.css">
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="../../third-party/codemirror2.15/codemirror.js"></script>
|
||||
<script type="text/javascript" src="../../../jquery.js"></script>
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
html,body {font-size: 12px;}
|
||||
body { padding-left: 20px;padding-right: 20px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>编辑层叠样式表</span> <span class="label label-important">不需要填写<style>标签</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <textarea id="cssext"></textarea> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var myCodeMirror;
|
||||
window.onload = function() {
|
||||
myCodeMirror = CodeMirror( function( elt ) {
|
||||
$G('cssext').parentNode.replaceChild(elt, $G('cssext'));
|
||||
},
|
||||
{value: $G('cssext').value,mode: "css",lineNumbers:true}
|
||||
);
|
||||
InitCss();
|
||||
}
|
||||
function InitCss(){
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getext&op=css&formid=' + parent.formid;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
if( xhr.responseText!='' ){
|
||||
myCodeMirror.setValue(xhr.responseText);
|
||||
myCodeMirror.focus();
|
||||
}
|
||||
} catch (e) {
|
||||
alert('Init error,please contact OA administrator');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
}
|
||||
dialog.onok = function () {
|
||||
var sVal = myCodeMirror.getValue();
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=extsubmit&op=css&formid=' + parent.formid + '&content=' + escape(sVal);
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
if( xhr.responseText > 0 ){
|
||||
alert('保存成功');
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
alert('save error,please contact OA administrator');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,221 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="../../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../bootstrap/bootstrap.js"></script>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
a {text-decoration: none;}
|
||||
html,body {font-size: 12px;}
|
||||
body {
|
||||
padding-left: 20px;padding-right: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tblwrap">
|
||||
<table class="table table-bordered table-striped" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th> <span> 控件名称 </span><span class="label label-important">*</span></th>
|
||||
<th> <span> 数据来源 </span> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="itemName" placeholder="必填项" type="text" size="20" />
|
||||
</td>
|
||||
<td>
|
||||
<select onchange="javascript:fnGetData(this.value);" style="width:115px;" id="datasrc">
|
||||
<option value="">选择数据来源</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3"> <span> 添加映射关系 </span> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div id="hidden" style="display:none;">
|
||||
<select id="datafield">
|
||||
</select> <i class="icon-arrow-right"></i>
|
||||
<input type="text" size="20" placeholder="映射控件名称" id="itemTitle" />
|
||||
<a href="javascript:;" onclick="fnAdd();" class="btn btn-default"><i class="icon-plus"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="tbhidden" style="display:none;">
|
||||
<tr>
|
||||
<td>@a</td>
|
||||
<td>@b</td>
|
||||
<td>@c</td>
|
||||
<td><a href="javascript:;" onclick="fnDel(this);" class="btn"><i class="icon-remove"></i></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><br/>
|
||||
<table class="table table-striped table-bordered table-condensed" style="margin-bottom:0;" id="tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> <span>数据库字段</span> </th>
|
||||
<th> <span>字段名称</span> </th>
|
||||
<th> <span>映射控件名称</span> </th>
|
||||
<th> <span>操作</span> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbl1">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- end tblwrap-->
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
//-- 获取控件属性 --
|
||||
var bEditFlag = 0;
|
||||
var gDataSrc = "";
|
||||
window.onload = function() {
|
||||
//如果是编辑控件
|
||||
if( UE.plugins['data_fetch'].editdom ) {
|
||||
oNode = UE.plugins['data_fetch'].editdom;
|
||||
bEditFlag = 1;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
var sDataSrc = oNode.getAttribute('data_table');
|
||||
fnGetData( sDataSrc );
|
||||
gDataSrc = sDataSrc;
|
||||
var sDataField = oNode.getAttribute("data_field"),
|
||||
sDataFieldName = oNode.getAttribute("data_fld_name"),
|
||||
sDataControl = oNode.getAttribute("data_control");
|
||||
var aDataField = sDataField.split("`"),
|
||||
aDataFieldName = sDataFieldName.split("`"),
|
||||
aDataControl = sDataControl.split("`");
|
||||
|
||||
var sNode = '<tr>' + $G('tbhidden').rows[0].innerHTML + '</tr>'; //复制节点
|
||||
for ( var i = 0; i < aDataField.length - 1; i++ ) {
|
||||
var sTempNode = sNode;
|
||||
var sTempNodeReplace = sTempNode.replace(/\@a/g,aDataField[i]);
|
||||
sTempNodeReplace = sTempNodeReplace.replace(/\@b/g,aDataFieldName[i]);
|
||||
sTempNodeReplace = sTempNodeReplace.replace(/\@c/g,aDataControl[i]);
|
||||
$('#tbl1').append(sTempNodeReplace);
|
||||
}
|
||||
fnInitDataSrc(sDataSrc);
|
||||
} else {
|
||||
fnInitDataSrc();
|
||||
}
|
||||
$G('itemName').focus();
|
||||
}
|
||||
/**
|
||||
* 初始化数据来源
|
||||
*/
|
||||
function fnInitDataSrc(sVal){
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getconfig&op=fetch';
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
var oJson = jQuery.parseJSON(xhr.responseText);
|
||||
var html = '';
|
||||
$.each(oJson,function(i,j){
|
||||
html += '<option value = "' + i + '">';
|
||||
html += j.workname + '</option>';
|
||||
})
|
||||
$('#datasrc').append(html);
|
||||
if(sVal){
|
||||
$G('datasrc').value = sVal;
|
||||
}
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request DataSrc TimeOut');
|
||||
}});
|
||||
}
|
||||
//获取选定数据来源的option,更新到表格内所有的下拉列表
|
||||
function fnGetData ( sVal ) {
|
||||
if( sVal!='' ) {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getdata&op=fetch&datasrc=' + sVal;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
var sOption = '<option value="">请选择表单字段</option>';
|
||||
$('#datafield').html(sOption + xhr.responseText );
|
||||
$('#hidden').show();
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
$('#datafield').html('');
|
||||
$('#hidden').hide();
|
||||
}
|
||||
}
|
||||
function fnAdd(){
|
||||
var sDataSrc = $G('datasrc').value;
|
||||
var field = $G('datafield').value;
|
||||
if( gDataSrc != sDataSrc && gDataSrc!="") {
|
||||
var sMsg = "数据来源只能选择一种,变更数据来源,您之前的映射项将被清除,是否继续?";
|
||||
if( !window.confirm( sMsg ) ) {
|
||||
return false;
|
||||
} else {
|
||||
$('#tbl1').empty();
|
||||
}
|
||||
}
|
||||
if( field == "" ) {
|
||||
alert("请选择表单字段");
|
||||
return;
|
||||
}
|
||||
if( $G('itemTitle').value == '' ) {
|
||||
alert("请填写映射控件名称");
|
||||
return;
|
||||
}
|
||||
for( var i = 1;i < $G('tbl').rows.length;i++ ) {
|
||||
var sDataField = $G('tbl').rows[i].cells[0].innerHTML;
|
||||
if( sDataField == field ) {
|
||||
alert("已经添加!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//add a row
|
||||
var sNode = '<tr>' + $G('tbhidden').rows[0].innerHTML + '</tr>'; //复制节点
|
||||
sNode = sNode.replace(/\@a/g,field);
|
||||
sNode = sNode.replace(/\@b/g,$G('datafield').options[$G('datafield').selectedIndex].text);
|
||||
sNode = sNode.replace(/\@c/g,$G('itemTitle').value);
|
||||
$('#tbl1').append(sNode);
|
||||
}
|
||||
function fnDel(obj){
|
||||
$(obj).parent().parent().remove();
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['data_fetch'].editdom ) {
|
||||
delete UE.plugins['data_fetch'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if ( $G('itemName').value == '' ) {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
var sDataSrc = $G('datasrc').value;
|
||||
var sDataField = '',sDataFieldName = '',sDataControl = '';
|
||||
//遍历数据项
|
||||
for( var i = 0;i < $G('tbl1').rows.length;i++ ) {
|
||||
var row = $G('tbl1').rows[i];
|
||||
sDataField += row.cells[0].innerHTML + "`" ;
|
||||
sDataFieldName += row.cells[1].innerHTML + "`" ;
|
||||
sDataControl += row.cells[2].innerHTML + "`" ;
|
||||
}
|
||||
|
||||
var sHtml = '<button title="' + $G('itemName').value +
|
||||
'" class="fetch" data_table="' + sDataSrc + '" data_field="' +
|
||||
sDataField + '" data_fld_name="' + sDataFieldName +
|
||||
'" data_control="' + sDataControl + '">' + $G('itemName').value + '</button>';
|
||||
if( bEditFlag == 1 ) {
|
||||
domUtils.remove(oNode,false);
|
||||
delete UE.plugins['data_fetch'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
editor.execCommand('insertHtml',sHtml);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,260 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="../../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../bootstrap/bootstrap.js"></script>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
a {text-decoration: none;}
|
||||
html,body {font-size: 12px;}
|
||||
body {
|
||||
padding-left: 20px;padding-right: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tblwrap">
|
||||
<table class="table table-bordered table-striped" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th> <span> 控件名称 </span><span class="label label-important">*</span> </th>
|
||||
<th> <span> 数据来源 </span></th>
|
||||
<th> <span> 数据选取方式 </span> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="itemName" placeholder="必填项" type="text" size="20" />
|
||||
</td>
|
||||
<td>
|
||||
<select onchange="javascript:fnGetData(this.value);" style="width:115px;" id="datasrc">
|
||||
<option value="">选择数据来源</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<label><input type="radio" name="dataType" id="dataType0" value="0" checked />弹出窗口选取</label>
|
||||
<label><input type="radio" name="dataType" id="dataType1" value="1" />根据录入项自动关联</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3"> <span> 添加映射关系 </span> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div id="hidden" style="display:none;">
|
||||
<select id="datafield">
|
||||
|
||||
</select> <i class="icon-arrow-right"></i>
|
||||
<input type="text" size="20" placeholder="映射字段名称" id="itemTitle" />
|
||||
<label style="display:inline;"> <input title="是否作为查询字段" id="isQuery" type="checkbox" />查</label>
|
||||
<a href="javascript:;" onclick="fnAdd();" class="btn btn-default"><i class="icon-plus"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="tbhidden" style="display:none;">
|
||||
<tr>
|
||||
<td>@a</td>
|
||||
<td>@b</td>
|
||||
<td>@c</td>
|
||||
<td>@d</td>
|
||||
<td> <a href="javascript:;" onclick="fnDel(this);" class="btn"><i class="icon-remove"></i></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><br/>
|
||||
<table class="table table-striped table-bordered table-condensed" style="margin-bottom:0;" id="tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> <span>数据库字段</span> </th>
|
||||
<th> <span>字段名称</span> </th>
|
||||
<th> <span>映射控件名称</span> </th>
|
||||
<th> <span>作为查询字段</span> </th>
|
||||
<th> <span>操作</span> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbl1">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- end tblwrap-->
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
//-- 获取控件属性 --
|
||||
var bEditFlag = 0;
|
||||
var gDataSrc = "";
|
||||
window.onload = function() {
|
||||
//如果是编辑控件
|
||||
if( UE.plugins['data_select'].editdom ) {
|
||||
oNode = UE.plugins['data_select'].editdom;
|
||||
bEditFlag = 1;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
var sDataSrc = oNode.getAttribute('data_table');
|
||||
gDataSrc = sDataSrc;
|
||||
var sDataType = oNode.getAttribute('data_type');
|
||||
if ( !sDataType ) {
|
||||
sDataType = '0';
|
||||
}
|
||||
$G('dataType'+sDataType.toString()).setAttribute("checked",true);
|
||||
var sDataField = oNode.getAttribute("data_field"),
|
||||
sDataFieldName = oNode.getAttribute("data_fld_name"),
|
||||
sDataControl = oNode.getAttribute("data_control");
|
||||
var aDataField = sDataField.split("`"),
|
||||
aDataFieldName = sDataFieldName.split("`"),
|
||||
aDataControl = sDataControl.split("`");
|
||||
|
||||
var sDataQuery = oNode.getAttribute("data_query");
|
||||
if( sDataQuery ) {
|
||||
var aDataQuery = sDataQuery.split("`");
|
||||
}
|
||||
var sNode = '<tr>' + $G('tbhidden').rows[0].innerHTML + '</tr>'; //复制节点
|
||||
for ( var i = 0; i < aDataField.length - 1; i++ ) {
|
||||
if( aDataQuery ) {
|
||||
var isQuery = aDataQuery[i]=='1' ? "是":"否";
|
||||
} else {
|
||||
var isQuery = "否";
|
||||
}
|
||||
var sTempNode = sNode;
|
||||
var sTempNodeReplace = sTempNode.replace(/\@a/g,aDataField[i]);
|
||||
sTempNodeReplace = sTempNodeReplace.replace(/\@b/g,aDataFieldName[i]);
|
||||
sTempNodeReplace = sTempNodeReplace.replace(/\@c/g,aDataControl[i]);
|
||||
sTempNodeReplace = sTempNodeReplace.replace(/\@d/g,isQuery);
|
||||
$('#tbl1').append(sTempNodeReplace);
|
||||
}
|
||||
fnGetData( sDataSrc );
|
||||
fnInitDataSrc( sDataSrc );
|
||||
} else {
|
||||
fnInitDataSrc ();
|
||||
}
|
||||
$G('itemName').focus();
|
||||
}
|
||||
/**
|
||||
* 初始化数据来源
|
||||
*/
|
||||
function fnInitDataSrc( sVal ){
|
||||
var d = new Date();
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getconfig&op=data×tamp='+ d.getTime();
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
var oJson = jQuery.parseJSON(xhr.responseText);
|
||||
var html = '';
|
||||
$.each(oJson,function(i,j){
|
||||
html += '<option value = "' + i + '">';
|
||||
html += j.name + '</option>';
|
||||
})
|
||||
$('#datasrc').append(html);
|
||||
if( sVal ) {
|
||||
$G('datasrc').value = sVal;
|
||||
}
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request DataSrc TimeOut');
|
||||
}});
|
||||
}
|
||||
//获取选定数据来源的option,更新到表格内所有的下拉列表
|
||||
function fnGetData ( sVal ) {
|
||||
if( sVal!='' ) {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getdata&op=data&datasrc=' + sVal;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
var sOption = '<option value="">请选择数据库字段</option>';
|
||||
$('#datafield').html(sOption + xhr.responseText );
|
||||
$('#hidden').show();
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
$('#datafield').html('');
|
||||
$('#hidden').hide();
|
||||
}
|
||||
}
|
||||
function fnAdd(){
|
||||
var sDataSrc = $G('datasrc').value;
|
||||
var field = $G('datafield').value;
|
||||
if( gDataSrc != sDataSrc && gDataSrc!="") {
|
||||
var sMsg = "数据来源只能选择一种,变更数据来源,您之前的映射项将被清除,是否继续?";
|
||||
if( !window.confirm( sMsg ) ) {
|
||||
return false;
|
||||
} else {
|
||||
$('#tbl1').empty();
|
||||
}
|
||||
}
|
||||
if( field == "" ) {
|
||||
alert("请选择数据库字段");
|
||||
return;
|
||||
}
|
||||
if( $G('itemTitle').value == '' ) {
|
||||
alert("请填写映射控件名称");
|
||||
return;
|
||||
}
|
||||
for( var i = 1;i < $G('tbl').rows.length;i++ ) {
|
||||
var sDataField = $G('tbl').rows[i].cells[0].innerHTML;
|
||||
if( sDataField == field ) {
|
||||
alert("已经添加!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var bQueryFlag = $G("isQuery").checked == true ? "1" : "0";
|
||||
var sQueryFlagDesc = bQueryFlag == "1" ? "是" : "否";
|
||||
//add a row
|
||||
var sNode = '<tr>' + $G('tbhidden').rows[0].innerHTML + '</tr>'; //复制节点
|
||||
sNode = sNode.replace(/\@a/g,field);
|
||||
sNode = sNode.replace(/\@b/g,$G('datafield').options[$G('datafield').selectedIndex].text);
|
||||
sNode = sNode.replace(/\@c/g,$G('itemTitle').value);
|
||||
sNode = sNode.replace(/\@d/g,sQueryFlagDesc);
|
||||
$('#tbl1').append(sNode);
|
||||
}
|
||||
function fnDel(obj){
|
||||
$(obj).parent().parent().remove();
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['data_select'].editdom ) {
|
||||
delete UE.plugins['data_select'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if ( $G('itemName').value == '' ) {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
var sDataSrc = $G('datasrc').value;
|
||||
var sDataType = $G('dataType0').checked == true ? 0 : 1;
|
||||
var sDataField = '',sDataFieldName = '',sDataControl = '',sDataQuery = '';
|
||||
//遍历数据项
|
||||
for( var i = 0;i < $G('tbl1').rows.length;i++ ) {
|
||||
var row = $G('tbl1').rows[i];
|
||||
sDataField += row.cells[0].innerHTML + "`" ;
|
||||
sDataFieldName += row.cells[1].innerHTML + "`" ;
|
||||
sDataControl += row.cells[2].innerHTML + "`" ;
|
||||
if(row.cells[3].innerHTML=='是') {
|
||||
var bQueryFlag = '1';
|
||||
} else {
|
||||
var bQueryFlag = '0';
|
||||
}
|
||||
sDataQuery += bQueryFlag + "`"; //查询字段
|
||||
}
|
||||
|
||||
if( sDataType=="1" && sDataQuery.replace("`","").indexOf("1") < 0 ) {
|
||||
alert("必须设置查询主键!");
|
||||
return false;
|
||||
}
|
||||
var sHtml = '<button title="' + $G('itemName').value +
|
||||
'" class="btn" data_table="' + sDataSrc + '" data_type="' + sDataType +
|
||||
'" data_field="' + sDataField + '" data_fld_name="' + sDataFieldName +
|
||||
'" data_control="' + sDataControl + '" data_query="' + sDataQuery + '">' + $G('itemName').value + '</button>';
|
||||
if( bEditFlag == 1 ) {
|
||||
domUtils.remove(oNode,false);
|
||||
delete UE.plugins['data_select'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
editor.execCommand('insertHtml',sHtml);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 237 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 28 KiB |
|
@ -1,133 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>图片上传控件</title>
|
||||
<link rel="stylesheet" href="../../../../css/app.min.css">
|
||||
<script type="text/javascript" src="../../../../js/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="itemName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="imgSize" name="width" class="form-control input-sm" type="text" value="100">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">高</div>
|
||||
<input id="imgHeight" name="height" class="form-control input-sm" type="text" value="100">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['imgupload'].editdom ){
|
||||
oNode = UE.plugins['imgupload'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
var sImgSize = oNode.style.width;
|
||||
$G('imgSize').value = sImgSize.substr(0, sImgSize.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
var sImgHeight = oNode.style.height;
|
||||
$G('imgHeight').value = sImgHeight.substr(0, sImgHeight.length - 2);
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['imgupload'].editdom ) {
|
||||
delete UE.plugins['imgupload'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if( $G('itemName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("img");
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
if( $G('imgSize').value !="" ){
|
||||
oNode.style.width = $G('imgSize').value + 'px';
|
||||
}
|
||||
if( $G('imgHeight').value != "" ) {
|
||||
oNode.style.height = $G('imgHeight').value + 'px';
|
||||
}
|
||||
var sImgWidth = $G('imgSize').value;
|
||||
if ( sImgWidth == '' ) {
|
||||
sImgWidth = '100';
|
||||
}
|
||||
var sImgHeight = $G('imgHeight').value;
|
||||
if ( sImgHeight == '' ) {
|
||||
sImgHeight = '100';
|
||||
}
|
||||
oNode.setAttribute('class','imgupload');
|
||||
oNode.setAttribute('src','./../../../../images/icon/icon-picture.png');
|
||||
oNode.setAttribute('img_width',sImgWidth);
|
||||
oNode.setAttribute('img_height',sImgHeight);
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true;
|
||||
} catch (e) {
|
||||
alert('插入控件出错,请联系OA管理员解决');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
var sImgWidth = $G('imgSize').value;
|
||||
if ( sImgWidth == '' ) {
|
||||
sImgWidth = '100';
|
||||
}
|
||||
var sImgHeight = $G('imgHeight').value;
|
||||
if ( sImgHeight == '' ) {
|
||||
sImgHeight = '100';
|
||||
}
|
||||
if( $G('imgSize').value!="" ){
|
||||
oNode.style.width = $G('imgSize').value + 'px';
|
||||
}
|
||||
if( $G('imgHeight').value!="" ) {
|
||||
oNode.style.height = $G('imgHeight').value + 'px';
|
||||
}
|
||||
oNode.setAttribute('img_width',sImgWidth);
|
||||
oNode.setAttribute('img_height',sImgHeight);
|
||||
delete UE.plugins['imgupload'].editdom; //使用后清空这个对象,变回新增模式
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,77 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<link rel="stylesheet" href="../../third-party/codemirror2.15/codemirror.css">
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="../../third-party/codemirror2.15/codemirror.js"></script>
|
||||
<script type="text/javascript" src="../../../jquery.js"></script>
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
html,body {font-size: 12px;}
|
||||
body { padding-left: 20px;padding-right: 20px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>编辑Javascript代码</span> <span class="label label-important">不需要填写<script>标签</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <textarea id="jsext"></textarea> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var myCodeMirror;
|
||||
window.onload = function() {
|
||||
myCodeMirror = CodeMirror( function( elt ) {
|
||||
$G('jsext').parentNode.replaceChild(elt, $G('jsext'));
|
||||
},
|
||||
{value: $G('jsext').value,mode: "javascript",lineNumbers:true}
|
||||
);
|
||||
InitJs();
|
||||
}
|
||||
function InitJs(){
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getext&op=script&formid=' + parent.formid;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
if( xhr.responseText!='' ){
|
||||
myCodeMirror.setValue(xhr.responseText);
|
||||
myCodeMirror.focus();
|
||||
}
|
||||
} catch (e) {
|
||||
alert('Init error,please contact OA administrator');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
}
|
||||
dialog.onok = function (){
|
||||
var sVal = myCodeMirror.getValue();
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=extsubmit&op=script&formid=' + parent.formid + '&content=' + escape(sVal);
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
if( xhr.responseText > 0 ){
|
||||
alert('保存成功');
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
alert('save error,please contact OA administrator');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>下拉菜单属性</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="listmenu.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="listName" placeholder="必填项" name="name" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="listWidth" name="width" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">高</div>
|
||||
<input id="listLines" name="height" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">行</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">默认值</label>
|
||||
<div id="listSelValue" class="form-control input-sm"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">下拉选项 <span class="text-danger">*</span></label>
|
||||
<select id="cmbText" class="form-control input-sm" multiple="multiple"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<a onclick="fnAdd();" title="新增" class="btn btn-sm btn-default">新增</a>
|
||||
<a onclick="fnModify();" title="修改" class="btn btn-sm btn-default">修改</a>
|
||||
<input class="form-control input-inline input-sm" type="text" placeholder="输入列表值" size="16" id="listText">
|
||||
<a onclick="fnMove(-1);" title="上移" class="btn btn-sm btn-default">上移</a>
|
||||
<a onclick="fnMove(1);" title="下移" class="btn btn-sm btn-default">下移</a>
|
||||
<a onclick="fnSetSelectedValue();" title="设为初始化时选定值" class="btn btn-sm btn-default">默认</a>
|
||||
<a onclick="fnDelete();" title="删除" class="btn btn-sm btn-default">删除</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
var oListText;
|
||||
window.onload = function()
|
||||
{
|
||||
oListText = $G('cmbText');
|
||||
oListText.style.width = oListText.offsetWidth;
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if(UE.plugins['listmenu'].editdom)
|
||||
{
|
||||
oNode = UE.plugins['listmenu'].editdom;
|
||||
$G('listName').value = oNode.getAttribute('title');
|
||||
$G('listSelValue').innerHTML = oNode.value;
|
||||
$G('listLines').value = oNode.getAttribute('size');
|
||||
|
||||
/*
|
||||
if (oNode.getAttribute('child') == null) {
|
||||
$G('listChild').value = '';
|
||||
} else {
|
||||
$G('listChild').value = oNode.getAttribute('child');
|
||||
}
|
||||
*/
|
||||
|
||||
var sWidthFull = oNode.style.width;
|
||||
$G('listWidth').value = sWidthFull.substr(0, sWidthFull.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
for(var i = 0 ; i < oNode.options.length; i++) {
|
||||
var sText = oNode.options[i].value;
|
||||
fnAddComboOption(oListText, sText, sText);
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function() {
|
||||
if(UE.plugins['listmenu'].editdom) {
|
||||
delete UE.plugins['listmenu'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function() {
|
||||
if($G('listName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$('#listName').focus();
|
||||
return false;
|
||||
}
|
||||
if(oListText.options.length == 0) {
|
||||
alert('请添加下拉菜单选项!');
|
||||
$('#listText').focus();
|
||||
return false;
|
||||
}
|
||||
var sSize = $G('listLines').value;
|
||||
if (sSize == null || isNaN(sSize) || sSize <= 1) {
|
||||
sSize = '';
|
||||
}
|
||||
if(!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false, timeout:60000, onsuccess:function(xhr) {
|
||||
try {
|
||||
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("select");
|
||||
oNode.setAttribute('title',$G('listName').value);
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('class','select');
|
||||
//oNode.setAttribute('child', $G('listChild').value);
|
||||
oNode.setAttribute('size',sSize);
|
||||
|
||||
if ($G('listWidth').value != '')
|
||||
{
|
||||
oNode.style.width = $G('listWidth').value+ 'px';
|
||||
//oNode.setAttribute('style','width:'+ $G('listWidth').value + 'px;');
|
||||
}
|
||||
var selectField = [];
|
||||
// Add all available options.
|
||||
for (var i = 0 ; i < oListText.options.length; i++) {
|
||||
var sText = oListText.options[i].value;
|
||||
if (sText.length == 0) {
|
||||
sText = sText;
|
||||
}
|
||||
var oOption = fnAddComboOption(oNode, sText, sText);
|
||||
if (sText == $G('listSelValue').innerHTML) {
|
||||
fnSetAttribute(oOption, 'selected', 'selected');
|
||||
oOption.selected = true;
|
||||
}
|
||||
selectField.push(sText);
|
||||
}
|
||||
oNode.setAttribute('radio_field',selectField.join('`'));
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true;
|
||||
} catch (e) {
|
||||
alert('插入控件出错,请联系管理员。');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
|
||||
} else {
|
||||
oNode.setAttribute('title', $G('listName').value);
|
||||
//oNode.setAttribute('child', $G('listChild').value);
|
||||
oNode.setAttribute('size',sSize);
|
||||
if ($G('listWidth').value != '') {
|
||||
oNode.style.width = $G('listWidth').value+ 'px';
|
||||
}
|
||||
// Remove all options.
|
||||
while (oNode.options.length > 0) {
|
||||
oNode.remove(0);
|
||||
}
|
||||
var selectField = [];
|
||||
for (var i = 0; i < $G('cmbText').options.length; i++) {
|
||||
var sText = $G('cmbText').options[i].value;
|
||||
if (sText.length == 0) {
|
||||
sText = sText ;
|
||||
}
|
||||
var oOption = fnAddComboOption(oNode, sText, sText);
|
||||
if (sText == $G('listSelValue').innerHTML) {
|
||||
fnSetAttribute(oOption, 'selected', 'selected');
|
||||
oOption.selected = true;
|
||||
}
|
||||
selectField.push(sText);
|
||||
}
|
||||
oNode.setAttribute('radio_field',selectField.join('`'));
|
||||
delete UE.plugins['listmenu'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,130 +0,0 @@
|
|||
|
||||
function fnSelect(combo) {
|
||||
var iIndex = combo.selectedIndex ;
|
||||
oListText.selectedIndex = iIndex ;
|
||||
var olistText = document.getElementById( "listText" ) ;
|
||||
olistText.value = oListText.value ;
|
||||
}
|
||||
|
||||
function fnAdd() {
|
||||
var olistText = document.getElementById( "listText" ) ;
|
||||
fnAddComboOption( oListText, olistText.value, olistText.value ) ;
|
||||
oListText.selectedIndex = oListText.options.length - 1 ;
|
||||
olistText.value = '' ;
|
||||
olistText.focus() ;
|
||||
}
|
||||
|
||||
function fnModify() {
|
||||
var iIndex = oListText.selectedIndex ;
|
||||
if ( iIndex < 0 ) return ;
|
||||
var olistText = document.getElementById( "listText" ) ;
|
||||
oListText.options[ iIndex ].innerHTML = fnHTMLEncode( olistText.value ) ;
|
||||
oListText.options[ iIndex ].value = olistText.value ;
|
||||
olistText.value = '' ;
|
||||
olistText.focus() ;
|
||||
}
|
||||
|
||||
function fnMove(steps) {
|
||||
fnChangeOptionPosition(oListText,steps);
|
||||
}
|
||||
|
||||
function fnDelete() {
|
||||
fnRemoveSelectedOptions(oListText);
|
||||
}
|
||||
|
||||
function fnSetSelectedValue() {
|
||||
var iIndex = oListText.selectedIndex;
|
||||
if (iIndex < 0) return;
|
||||
var olistText = document.getElementById("listSelValue");
|
||||
olistText.innerHTML = oListText.options[iIndex].value;
|
||||
}
|
||||
|
||||
// Moves the selected option by a number of steps (also negative)
|
||||
function fnChangeOptionPosition(combo, steps) {
|
||||
var iActualIndex = combo.selectedIndex;
|
||||
if (iActualIndex < 0) {
|
||||
return ;
|
||||
}
|
||||
var iFinalIndex = iActualIndex + steps;
|
||||
if (iFinalIndex < 0) {
|
||||
iFinalIndex = 0;
|
||||
}
|
||||
if (iFinalIndex > (combo.options.length - 1)) {
|
||||
iFinalIndex = combo.options.length - 1;
|
||||
}
|
||||
if (iActualIndex == iFinalIndex) {
|
||||
return ;
|
||||
}
|
||||
var oOption = combo.options[ iActualIndex];
|
||||
if(oOption.value=="") {
|
||||
var sText = fnHTMLDecode(oOption.value);
|
||||
} else {
|
||||
var sText = fnHTMLDecode(oOption.innerHTML);
|
||||
}
|
||||
combo.remove(iActualIndex);
|
||||
oOption = fnAddComboOption(combo, sText, sText, null, iFinalIndex);
|
||||
oOption.selected = true ;
|
||||
}
|
||||
|
||||
// Remove all selected options from a SELECT object
|
||||
function fnRemoveSelectedOptions(combo) {
|
||||
// Save the selected index
|
||||
var iSelectedIndex = combo.selectedIndex ;
|
||||
var oOptions = combo.options ;
|
||||
// Remove all selected options
|
||||
for (var i = oOptions.length - 1; i >= 0; i--) {
|
||||
if (oOptions[i].selected) combo.remove(i) ;
|
||||
}
|
||||
|
||||
// Reset the selection based on the original selected index
|
||||
if (combo.options.length > 0) {
|
||||
if (iSelectedIndex >= combo.options.length) iSelectedIndex = combo.options.length - 1;
|
||||
combo.selectedIndex = iSelectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// Add a new option to a SELECT object (combo or list)
|
||||
function fnAddComboOption(combo, optionText, optionValue, documentObject, index) {
|
||||
var oOption;
|
||||
if (documentObject) {
|
||||
oOption = documentObject.createElement("option");
|
||||
} else {
|
||||
oOption = document.createElement("option");
|
||||
}
|
||||
if (index != null) {
|
||||
combo.options.add(oOption, index);
|
||||
} else {
|
||||
combo.options.add(oOption);
|
||||
}
|
||||
oOption.innerHTML = optionText.length > 0 ? fnHTMLEncode(optionText) : ' ';
|
||||
oOption.value = optionValue;
|
||||
return oOption ;
|
||||
}
|
||||
|
||||
function fnHTMLEncode(text) {
|
||||
if (!text) {
|
||||
return '';
|
||||
}
|
||||
text = text.replace(/&/g, '&');
|
||||
text = text.replace(/</g, '<');
|
||||
text = text.replace(/>/g, '>');
|
||||
return text ;
|
||||
}
|
||||
|
||||
function fnHTMLDecode(text) {
|
||||
if (!text) {
|
||||
return '' ;
|
||||
}
|
||||
text = text.replace(/>/g, '>');
|
||||
text = text.replace(/</g, '<');
|
||||
text = text.replace(/&/g, '&');
|
||||
return text ;
|
||||
}
|
||||
|
||||
function fnSetAttribute(element, attName, attValue) {
|
||||
if (attValue == null || attValue.length == 0) {
|
||||
element.removeAttribute(attName, 0);
|
||||
} else {
|
||||
element.setAttribute(attName, attValue, 0);
|
||||
}// 0 : Case Insensitive
|
||||
}
|
|
@ -1,760 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="m-t">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="listName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">数据来源</label>
|
||||
<select class="form-control input-sm" onchange="javascript:fnGetData(this.value);" name="datasrc" id="datasrc">
|
||||
<option value="">不可用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="hidden" style="display:none;">
|
||||
<tr>
|
||||
<td>@a</td>
|
||||
<td> <input class="form-control input-sm" id="item_@a" type="text"> </td>
|
||||
<td> <input class="form-control input-sm" id="size_@a" type="text" size="1" value="10"> </td>
|
||||
<td> <label><input type="checkbox" id="sum_@a"> </label> </td>
|
||||
<td>
|
||||
<select id="coltype_@a">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> <input class="form-control input-sm span" id="colvalue_@a" type="text"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table b-a" id="tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">序号</th>
|
||||
<th align="left">表头</th>
|
||||
<th align="center">宽度</th>
|
||||
<th align="center">合计<a id="showCountTips" data-content="在该列的底部显示该列的合计数值" rel="popover"><i class="icon-info-sign"></i></a> </th>
|
||||
<th align="center"><span id="datatype">数据类型</span> <a id="showDataTypeTips" rel="popover" data-content="计算公式说明:用[1] [2] [3]等代表某列的数值。运算符支持+,-,*,/,%等。"><i class="icon-info-sign"></i></a> </th>
|
||||
<th align="left">值<a id="showValueTips" data-content="数据类型的默认值。多个值之间用英文逗号分隔。当数据类型为数据来源或日期时,默认值无效。" rel="popover"><i class="icon-info-sign"></i></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbl1">
|
||||
<tr>
|
||||
<td align="center">1</td>
|
||||
<td><input class="form-control input-sm" id="item_1" type="text"></td>
|
||||
<td><input class="form-control input-sm" id="size_1" type="text" size="2" value="10"></td>
|
||||
<td><label><input type="checkbox" id="sum_1"></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_1">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input id="colvalue_1" class="form-control input-sm" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">2</td>
|
||||
<td><input class="form-control input-sm" id="item_2" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_2" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_2" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_2">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> <input class="form-control input-sm" id="colvalue_2" type="text" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">3</td>
|
||||
<td> <input class="form-control input-sm" id="item_3" type="text" /> </td>
|
||||
<td> <input class="form-control input-sm" id="size_3" type="text" size="2" value="10" /> </td>
|
||||
<td> <label> <input type="checkbox" id="sum_3" /> </label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_3">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> <input id="colvalue_3" class="form-control input-sm" type="text" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">4</td>
|
||||
<td><input class="form-control input-sm" id="item_4" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_4" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_4" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_4">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_4" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">5</td>
|
||||
<td><input class="form-control input-sm" id="item_5" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_5" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_5" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_5">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_5" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">6</td>
|
||||
<td><input class="form-control input-sm" id="item_6" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_6" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_6" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_6">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_6" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">7</td>
|
||||
<td><input class="form-control input-sm" id="item_7" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_7" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_7" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_7">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_7" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">8</td>
|
||||
<td><input class="form-control input-sm" id="item_8" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_8" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_8" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_8">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_8" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">9</td>
|
||||
<td><input class="form-control input-sm" id="item_9" type="text" /> </td>
|
||||
<td><input class="form-control input-sm" id="size_9" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_9" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_9">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_9" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">10</td>
|
||||
<td><input class="form-control input-sm" id="item_10" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_10" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_10" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_10">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_10" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center">11</td>
|
||||
<td><input class="form-control input-sm" id="item_11" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_11" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_11" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_11">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_11" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center">12</td>
|
||||
<td><input class="form-control input-sm" id="item_12" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_12" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_12" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_12">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_12" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center">13</td>
|
||||
<td><input class="form-control input-sm" id="item_13" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_13" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_13" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_13">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_13" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center">14</td>
|
||||
<td><input class="form-control input-sm" id="item_14" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_14" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_14" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_14">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_14" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center">15</td>
|
||||
<td><input class="form-control input-sm" id="item_15" type="text" /></td>
|
||||
<td><input class="form-control input-sm" id="size_15" type="text" size="2" value="10" /></td>
|
||||
<td><label><input type="checkbox" id="sum_15" /></label></td>
|
||||
<td>
|
||||
<select class="form-control input-sm" id="coltype_15">
|
||||
<option value="text">单行文本</option>
|
||||
<option value="textarea">多行文本</option>
|
||||
<option value="select">下拉菜单</option>
|
||||
<option value="radio">单选按钮</option>
|
||||
<option value="checkbox">复选按钮</option>
|
||||
<option value="datetime">日期</option>
|
||||
<option value="calc">计算公式</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input id="colvalue_15" class="form-control input-sm" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end tblwrap-->
|
||||
<div style="display:none;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
var rows_count = 15;
|
||||
var adefaultDatatype = ['text','textarea','select','radio','checkbox','datetime','calc'];
|
||||
$('#tbl').find('select').on('change',function() {
|
||||
var oParentObj = this.parentNode;
|
||||
var nId = $(this).attr('id').substr(-1,1);
|
||||
switch ($(this).val()) {
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
case 'select':
|
||||
case 'radio':
|
||||
case 'checkbox':
|
||||
case 'calc':
|
||||
if($(oParentObj).next().find('input').val()=='') {
|
||||
$(oParentObj).next().html('<input class="form-control input-sm" id="colvalue_' + nId + '" type="text" />');
|
||||
}
|
||||
break;
|
||||
case 'datetime':
|
||||
$(oParentObj).next().find('input').val('').addClass('uneditable-input').attr('disabled','disabled');
|
||||
break;
|
||||
default:
|
||||
var checked = '';
|
||||
//暂时没有好的方法解决这个查询字段的选中状态判断,只能先放一个全局数组里判断,这个数组定义在window.onload函数里。
|
||||
if ( oNode ) {
|
||||
var sDataQuery = oNode.getAttribute('data_query');
|
||||
var aDataQuery = sDataQuery ? sDataQuery.split('`') : null;
|
||||
if (aDataQuery && aDataQuery[nId - 1] == '1'){
|
||||
checked = ' checked';
|
||||
}
|
||||
}
|
||||
var sQueryField = "<label><input type='checkbox' id = 'query_" + nId + "'" + checked + " value='1' />作为查询字段</label>";
|
||||
$(oParentObj).next().html(sQueryField)
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
//初始化数据来源
|
||||
//fnInitDataSrc();
|
||||
|
||||
window.onload = function() {
|
||||
//提示信息初始化
|
||||
//$('#showCountTips').popover({placement:'left'});
|
||||
//$('#showValueTips').popover({placement:'left'});
|
||||
//$('#showDataTypeTips').popover({placement:'left'});
|
||||
//如果是编辑控件
|
||||
if(UE.plugins['listview'].editdom)
|
||||
{
|
||||
oNode = UE.plugins['listview'].editdom;
|
||||
$G('listName').value = oNode.getAttribute('title');
|
||||
|
||||
var sLvTitle = oNode.getAttribute('lv_title'),
|
||||
sLvSize = oNode.getAttribute('lv_size'),
|
||||
sLvSum = oNode.getAttribute('lv_sum'),
|
||||
sLvColType = oNode.getAttribute('lv_coltype'),
|
||||
sLvColValue = oNode.getAttribute('lv_colvalue'),
|
||||
sDataTable = oNode.getAttribute('data_table'),
|
||||
sDataField = oNode.getAttribute('data_field'),
|
||||
sDataQuery = oNode.getAttribute('data_query');
|
||||
|
||||
var aLvTitle = sLvTitle.split('`'),
|
||||
aLvSize = sLvSize.split('`'),
|
||||
aLvSum = sLvSum ? sLvSum.split('`') : null,
|
||||
aLvColType = sLvColType ? sLvColType.split('`') : null,
|
||||
aLvColValue = sLvColValue ? sLvColValue.split('`') : null;
|
||||
|
||||
if (aLvTitle.length -1 > 15) {
|
||||
rows_count = aLvTitle.length -1;
|
||||
}
|
||||
//包含数据源的情况
|
||||
if (sDataTable) {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getdata&op=data&datasrc=' + sDataTable;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
for( var i = 1; i <= rows_count; i++ ) {
|
||||
fnAddDataSelect(i,xhr.responseText,aLvColType[i-1],(i == rows_count ? true : false));
|
||||
$('#coltype_' + i).change();
|
||||
}
|
||||
$G('datasrc').value = sDataTable;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
}
|
||||
for ( var i = 0;i < aLvTitle.length-1; i++ ) {
|
||||
if ( (i+1) > 15) {
|
||||
fnAddRows(i);
|
||||
}
|
||||
var sItem = 'item_' + (i + 1),
|
||||
sSize = 'size_' + (i + 1),
|
||||
sNum = 'sum_' + (i + 1),
|
||||
sColtype = 'coltype_' + (i + 1),
|
||||
sColValue = 'colvalue_' + (i + 1);
|
||||
$G(sItem).value = aLvTitle[i];
|
||||
$G(sSize).value = aLvSize[i];
|
||||
if ( sLvSum ) {
|
||||
$G(sNum).checked = aLvSum[i] == 1 ? true : false;
|
||||
}
|
||||
if ( sLvColType ) {
|
||||
$('#' + sColtype).val(aLvColType[i]);
|
||||
}
|
||||
if ( sLvColValue ) {
|
||||
if($.inArray(aLvColType[i],adefaultDatatype) !== -1){
|
||||
$G(sColValue).value = aLvColValue[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 初始化数据来源
|
||||
*/
|
||||
function fnInitDataSrc() {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getconfig&op=data';
|
||||
ajax.request(sUrl,{timeout:60000,onsuccess:function(xhr) {
|
||||
if( xhr!='' ) {
|
||||
var oJson = jQuery.parseJSON(xhr.responseText);
|
||||
var html = '';
|
||||
$.each(oJson,function(i,j) {
|
||||
html += '<option value = "' + i + '">';
|
||||
html += j.name + '</option>';
|
||||
})
|
||||
$('#datasrc').append(html);
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request DataSrc TimeOut');
|
||||
}});
|
||||
}
|
||||
/**
|
||||
* 增加多行
|
||||
* @param int addNum 要增加的行数
|
||||
* @global int rows_count 全局的行数
|
||||
*/
|
||||
function fnAddRows(addNum) {
|
||||
for(var i = rows_count + 1; i <= rows_count + addNum; i ++) {
|
||||
fnAddRow(i);
|
||||
}
|
||||
rows_count += addNum;
|
||||
var index = Math.ceil(rows_count/15); //取索引并显示
|
||||
fnShow(index);
|
||||
}
|
||||
/**
|
||||
* 在当前表格内增加一行
|
||||
* @param int i 索引
|
||||
*
|
||||
*/
|
||||
function fnAddRow(i) {
|
||||
var sNode = $G('hidden').rows[0].innerHTML; //复制html
|
||||
var sNodeReplace = sNode.replace(/\@a/g,i); //替换索引
|
||||
var sTr = '<tr>\n' + sNodeReplace + '\n</tr>\n';//包裹成一个完成的tr
|
||||
var index = Math.ceil(i / 15); //取索引
|
||||
if( !$G('tbl'+index)) { //不存在第index页则创建之
|
||||
var oNewTb = document.createElement('tbody');
|
||||
oNewTb.id = 'tbl'+index;
|
||||
$('#tbl').append(oNewTb.outerHTML);
|
||||
$('#tbl'+index).css('display','none');
|
||||
}
|
||||
$('#tbl'+index).append(sTr);//插入
|
||||
//如果有数据来源则加数据选择框
|
||||
if($G("datasrc").value != "") {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getdata&op=data&datasrc=' + $G("datasrc").value;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if( xhr!='' ) {
|
||||
fnAddDataSelect(i,xhr.responseText,'');
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
}
|
||||
}
|
||||
/**
|
||||
*左右滑动显示页面函数
|
||||
* @param string steps 上一页还是下一页
|
||||
*/
|
||||
function fnSlide(steps) {
|
||||
//查找当前可见的页面
|
||||
var obj = $('#tbl').find('tbody:visible');
|
||||
//取页数索引
|
||||
var index = obj.attr('id').substr(-1,1);
|
||||
if(steps > 0) {
|
||||
var nObjNext = parseInt(index) + 1;//下一页
|
||||
if( $G('tbl'+nObjNext) ) { //如果有下一页,才切换
|
||||
$('#tbl'+nObjNext).show('normal','linear').siblings('tbody').hide();
|
||||
}
|
||||
if ( !$G('tbl'+(nObjNext+1)) ){ //否则更改下一页按钮样式,给出提醒
|
||||
$('#carousel_next').addClass('disabled');
|
||||
}
|
||||
if($G('tbl'+(nObjNext-1))){ //同样更改上一页按钮的样式
|
||||
$('#carousel_prev').hasClass('disabled') ? $('#carousel_prev').removeClass('disabled') : '';
|
||||
}
|
||||
} else {
|
||||
var nObjPrev = parseInt(index) - 1; //同上
|
||||
if( $G('tbl'+nObjPrev) ) {
|
||||
$('#tbl'+nObjPrev).show('normal','linear').siblings('tbody').hide();
|
||||
}
|
||||
if ( !$G('tbl'+(nObjPrev-1)) ){
|
||||
$('#carousel_prev').addClass('disabled');
|
||||
}
|
||||
if($G('tbl'+(nObjPrev+1))){
|
||||
$('#carousel_next').hasClass('disabled') ? $('#carousel_next').removeClass('disabled') : '';
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 根据给出的索引值显示页面
|
||||
* @param int nIndex 以10行为一页,此处是代表第几页的索引
|
||||
*/
|
||||
function fnShow( nIndex ){
|
||||
if($G('tbl' + nIndex).style.display == 'block') {
|
||||
return;
|
||||
}
|
||||
if( nIndex > 1 ) {
|
||||
$('#carousel_prev').removeClass('disabled');
|
||||
$('#carousel_next').removeClass('disabled');
|
||||
}
|
||||
$('#tbl' + nIndex).show('normal','linear').siblings('tbody').hide();
|
||||
}
|
||||
/**
|
||||
* 更新选项到表格内的下拉列表
|
||||
* @param int nIndex 在表格内的索引
|
||||
* @param string 要插入的内容
|
||||
* @param string sFieldData 是否有指定值?
|
||||
* @param bool 是否高亮提醒表头,让用户知道有数据插入
|
||||
* @author mrz
|
||||
*/
|
||||
function fnAddDataSelect(nIndex,sStr,sFieldData,bFocus) {
|
||||
var sNode = $('#hidden').find('select').html();
|
||||
$('#coltype_' + nIndex).html(sNode + "<option value='' disabled>" + $G('datasrc').options[$G('datasrc').selectedIndex].text +"</option>" + sStr);
|
||||
if ( sFieldData ) {
|
||||
//$('#coltype_' + nIndex).change();
|
||||
$G('coltype_' + nIndex).value = sFieldData;
|
||||
}
|
||||
if( bFocus ){
|
||||
$G('datatype').style.background = '#F7B326';
|
||||
setTimeout("$G('datatype').style.background = 'white';",80);
|
||||
setTimeout("$G('datatype').style.background = '#F7B326'",160);
|
||||
setTimeout("$G('datatype').style.background = 'white';",240);
|
||||
setTimeout("$G('datatype').style.background = '#F7B326';",320);
|
||||
setTimeout("$G('datatype').style.background = 'white';",400);
|
||||
setTimeout("$G('datatype').style.background = '#FEF3DE';",480);
|
||||
setTimeout("$G('datatype').style.background = 'white';",560);
|
||||
}
|
||||
}
|
||||
//获取选定数据来源的option,更新到表格内所有的下拉列表
|
||||
function fnGetData (sVal) {
|
||||
if( sVal!='' ) {
|
||||
var sUrl = 'wf.php?mod=workflowsetup&do=formdesignaction&act=getdata&op=data&datasrc=' + sVal;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
if(xhr!='') {
|
||||
for(var i = 1; i <= rows_count; i++) {
|
||||
fnAddDataSelect(i,xhr.responseText,'',(i == rows_count ? true : false));
|
||||
$('#coltype_' + i).change();
|
||||
}
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
for(var i = 1; i <= rows_count; i++) {
|
||||
fnClearDataSelect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
//删除数据选择下拉框
|
||||
function fnClearDataSelect(nIndex) {
|
||||
var sNode = $('#hidden').find('select').html();
|
||||
$('#coltype_' + nIndex).html(sNode).change();
|
||||
}
|
||||
//控件说明函数,切换到帮助页面或表格页面
|
||||
dialog.onhelp = function() {
|
||||
$('#tblwrap').slideToggle().siblings().slideToggle();
|
||||
};
|
||||
dialog.oncancel = function() {
|
||||
if(UE.plugins['listview'].editdom) {
|
||||
delete UE.plugins['listview'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function () {
|
||||
// 检查控件名称
|
||||
if($G('listName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('listName').focus();
|
||||
return false;
|
||||
}
|
||||
//选择了数据来源的,检查数据类型有没有重复的字段
|
||||
if($G('datasrc').value != '') {
|
||||
var sTempStr = '';
|
||||
for (var i = 1; i <= rows_count ; i ++) {
|
||||
var sType = $G('coltype_' + i).value;
|
||||
if($.inArray(sType,adefaultDatatype) !== -1) {
|
||||
continue;
|
||||
}
|
||||
if (sTempStr.indexOf(sType+',') == -1) {
|
||||
sTempStr += sType + ',';
|
||||
} else {
|
||||
alert ('数据库字段不能重复');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var sLvTitle = '',sLvSize = '',sLvSum = '',
|
||||
sLvColType = '' , sLvColValue = '' ,sDataField = '' ,
|
||||
sQueryField = '', sDataFldName = '',nCount = 0 , oDataSrc = $G('datasrc');
|
||||
|
||||
for (var i = 1;i <= rows_count; i ++ ) {
|
||||
var oItem = $G( "item_" + i ) , oSize = $G( 'size_' + i ) ,
|
||||
oSum = $G( 'sum_'+i ) , oColType = $G('coltype_' + i) ,
|
||||
oColValue = $G('colvalue_' + i) , oQuery = $G( 'query_' + i);
|
||||
|
||||
if ( oItem.value != '') {
|
||||
sLvTitle += oItem.value + '`'; //表头
|
||||
nCount ++ ;
|
||||
if ( oSize.value != '' ) { //宽度
|
||||
sLvSize += oSize.value + '`';
|
||||
} else {
|
||||
sLvSize += '10`';
|
||||
}
|
||||
if ( oSum.checked ) { //合计
|
||||
sLvSum += '1`';
|
||||
} else {
|
||||
sLvSum += '0`';
|
||||
}
|
||||
if( oColType.value !== 'datetime' && $.inArray(oColType.value,adefaultDatatype) != -1) { //类型为时间的特别处理
|
||||
var sStr = oColValue.value;
|
||||
if ( sStr.substring ( sStr.length - 1 ) == ',') {
|
||||
sStr = sStr.substring( 0, sStr.length - 1 );
|
||||
}
|
||||
} else {
|
||||
var sStr = '';
|
||||
}
|
||||
sLvColType += oColType.value + '`';
|
||||
sLvColValue += sStr + '`';
|
||||
if ( $.inArray(oColType.value,adefaultDatatype) == -1 ) {
|
||||
sDataField += oColType.value + '`';
|
||||
sDataFldName += oColType.options[oColType.selectedIndex].text + '`';
|
||||
if (oQuery && oQuery.checked) {
|
||||
sQueryField += '1`';
|
||||
} else {
|
||||
sQueryField += '0`';
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}//end for
|
||||
if ( nCount == 0 ) {
|
||||
alert("表头项目不能为空");
|
||||
return false;
|
||||
}
|
||||
if(!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function(xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("img");
|
||||
oNode.setAttribute('title',$G('listName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
|
||||
oNode.setAttribute('lv_title',sLvTitle);
|
||||
oNode.setAttribute('lv_size',sLvSize);
|
||||
oNode.setAttribute('lv_sum',sLvSum);
|
||||
oNode.setAttribute('lv_coltype',sLvColType);
|
||||
oNode.setAttribute('lv_colvalue',sLvColValue);
|
||||
oNode.setAttribute('class','listview');
|
||||
oNode.setAttribute('src','./../../../../assets/images/icon-list.png');
|
||||
if(sDataField != "") {
|
||||
oNode.setAttribute('data_field',sDataField);
|
||||
oNode.setAttribute('data_table',oDataSrc.value);
|
||||
oNode.setAttribute('data_query',sQueryField);
|
||||
oNode.setAttribute('data_fld_name',sDataFldName);
|
||||
}
|
||||
editor.execCommand('insertHtml', oNode.outerHTML);
|
||||
return true ;
|
||||
} catch ( e ) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('title',$G('listName').value.replace("\"","""));
|
||||
oNode.setAttribute('lv_title',sLvTitle);
|
||||
oNode.setAttribute('lv_size',sLvSize);
|
||||
oNode.setAttribute('lv_sum',sLvSum);
|
||||
oNode.setAttribute('lv_coltype',sLvColType);
|
||||
oNode.setAttribute('lv_colvalue',sLvColValue);
|
||||
if( sDataField != "" ) {
|
||||
oNode.setAttribute('data_field',sDataField);
|
||||
oNode.setAttribute('data_table',oDataSrc.value);
|
||||
oNode.setAttribute('data_query',sQueryField);
|
||||
oNode.setAttribute('data_fld_name',sDataFldName);
|
||||
} else {
|
||||
oNode.removeAttribute('data_field');
|
||||
oNode.removeAttribute('data_table');
|
||||
oNode.removeAttribute('data_query');
|
||||
oNode.removeAttribute('data_fld_name');
|
||||
}
|
||||
delete UE.plugins['listview'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,122 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="../../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../bootstrap/bootstrap.js"></script>
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
html,body {font-size: 12px;}
|
||||
body { padding-left: 20px;padding-right: 20px; }
|
||||
.controls input {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>宏标记及说明</span></th>
|
||||
<th><span>操作</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:代表表单名称">#[表单]</td>
|
||||
<td><a class="btn" data="#[macro_form]" value="添加" onclick="fnAdd(this);"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:代表文号或说明">#[文号]</td>
|
||||
<td ><a class="btn" data="#[macro_run_name]" value="添加" onclick="fnAdd(this);"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:代表文号计数器">#[文号计数器]</td>
|
||||
<td ><a class="btn" data="#[macro_counter]" value="添加" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:代表流程开始时间">#[时间]</td>
|
||||
<td ><a class="btn" data="#[macro_time]" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:代表工作流水号">#[流水号]</td>
|
||||
<td ><a class="btn" data="#[macro_run_id]" value="添加" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:将列出该工作所有的会签意见,或指定步骤编号的会签意见">
|
||||
<div class="controls">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">#[会签意见</span><input title="步骤编号" placeholder="步骤编号" id="sign_no" size="4" type="text"> <input class="showTips" type="text" data-content="格式表达式说明: <br>{C}:表示意见内容<br>{Y}:表示年<br>
|
||||
{M}:表示月<br>
|
||||
{D}:表示日<br>
|
||||
{H}:表示时<br>
|
||||
{I}:表示分<br>
|
||||
{S}:表示秒<br>
|
||||
{U}:表示用户姓名<br>
|
||||
{P}:表示角色<br>
|
||||
{S}:表示步骤名称<br>
|
||||
{SD}:表示短部门<br>
|
||||
{LD}:表示长部门<br>
|
||||
{SH}:表示手写签章<br>
|
||||
例如:{C} {U} {Y}{M}{D}
|
||||
则显示样式为: xxxx 张三 20090202" rel="popover" title="格式表达式" placeholder="格式表达式" class="span2" id="style" size="13"><span class="add-on">]</span>
|
||||
<select id="signType"><option value="">按步骤实际编号</option><option value="*">按步骤设计编号</option></select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td ><a class="btn" value="添加" data="#[macro_sign" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:列出所有附件,或者第N个附加,N=1,2,3...">
|
||||
<div class="controls">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">#[附件</span><input title="步骤编号" placeholder="步骤编号" id="file_no" size="4" type="text"><span class="add-on">]</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><a class="btn" value="添加" data="#[macro_attach" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="说明:列出实际步骤超时时间">
|
||||
<div class="controls">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">#[超时</span><input title="步骤编号" placeholder="步骤编号" id="timeout_no" size="4" type="text"><span class="add-on">]</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><a class="btn" data="#[macro_timeout" value="添加" onclick="fnAdd(this)"><i class="icon icon-plus"></i></a>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
$('.showTips').popover({placement:'top'});
|
||||
}
|
||||
function fnAdd( btn ) {
|
||||
var macro = $(btn).attr('data');
|
||||
if( macro.indexOf("#[macro_attach") >= 0 || macro.indexOf("#[macro_sign") >= 0 || macro.indexOf("#[macro_timeout") >= 0 ) {
|
||||
var obj = $(btn).parent().siblings().find('input').get(0);
|
||||
if( (obj.value <= 0 || obj.value % 1 != 0 ) && obj.value != "" ) {
|
||||
alert("请输入有效数字!");
|
||||
obj.value = '';
|
||||
return false;
|
||||
}
|
||||
if( obj.id == "file_no" ) {
|
||||
macro = "#[macro_attach" + obj.value + "]";
|
||||
} else if( obj.id == "timeout_no" ) {
|
||||
if( obj.value == "" ) {
|
||||
alert("步骤号不能为空!");
|
||||
return;
|
||||
}
|
||||
macro = "#[macro_timeout" + obj.value + "]";
|
||||
} else if( obj.id == "sign_no" ) {
|
||||
macro="#[macro_sign" + obj.value + $G('signType').value + "]" + "[" + $G("style").value + "]";
|
||||
}
|
||||
obj.value = '';
|
||||
}
|
||||
editor.execCommand('insertHtml',macro);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>进度条属性</title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
html,body {font-size: 12px;}
|
||||
body {
|
||||
padding-left: 20px;padding-right: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>控件名称</span><span class="label label-important">*</span></th>
|
||||
<th><span>跨度</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="itemName" type="text" placeholder="必填项" size="20" />
|
||||
</td>
|
||||
<td>
|
||||
<input id="signType" type="text" value="5" size="2" /> %
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">进度条样式</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label><input type="radio" value="progress-info" name="progressstyle" checked /><code>表示信息</code></label>
|
||||
<div class="progress progress-info progress-striped active" style="margin:2px 0 9px 0;">
|
||||
<div class="bar" style="width: 20%"></div>
|
||||
</div>
|
||||
<label><input type="radio" value="progress-success" name="progressstyle" /><code>表示完成情况,进度等</code></label>
|
||||
<div class="progress progress-success progress-striped active" style="margin:2px 0 9px 0;">
|
||||
<div class="bar" style="width: 40%"></div>
|
||||
</div>
|
||||
<label><input type="radio" value="progress-warning" name="progressstyle" /><code>表示警告,比较重要的事项</code></label>
|
||||
<div class="progress progress-warning progress-striped active" style="margin:2px 0 9px 0;">
|
||||
<div class="bar" style="width: 60%"></div>
|
||||
</div>
|
||||
<label><input type="radio" value="progress-danger" name="progressstyle" /><code>表示危险,重要程度为最高</code></label>
|
||||
<div class="progress progress-danger progress-striped active" style="margin:2px 0 9px 0;">
|
||||
<div class="bar" style="width: 80%"></div>
|
||||
</div>
|
||||
<input type="hidden" id="style" />
|
||||
<p>进度条使用CSS3渐变/过渡/动画以实现所有效果。IE7到IE9,以及某些老版本的Firefox还不能完全支持这些特性。目前,Opera和IE还不支持动画效果。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['progressbar'].editdom ){
|
||||
oNode = UE.plugins['progressbar'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
$G('signType').value = oNode.getAttribute('sign_type');
|
||||
var sStyle = oNode.getAttribute('progressstyle');
|
||||
for ( var i = 0; i < document.getElementsByName('progressstyle').length;i++) {
|
||||
if (document.getElementsByName('progressstyle')[i].value == sStyle){
|
||||
document.getElementsByName('progressstyle')[i].checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['progressbar'].editdom ) {
|
||||
delete UE.plugins['progressbar'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
var sStyle = '';
|
||||
for ( var i = 0;i < document.getElementsByName('progressstyle').length; i ++) {
|
||||
if (document.getElementsByName('progressstyle')[i].checked){
|
||||
sStyle = document.getElementsByName('progressstyle')[i].value;
|
||||
$G('style').value = sStyle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( $G('itemName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
var nItemId = xhr.responseText;
|
||||
oNode = document.createElement("img");
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('value','0');
|
||||
oNode.setAttribute('progressstyle',$G('style').value);
|
||||
if ( $G('signType').value == '' ) {
|
||||
oNode.setAttribute('sign_type','1');
|
||||
} else {
|
||||
oNode.setAttribute('sign_type',$G('signType').value);
|
||||
}
|
||||
oNode.setAttribute('class','progressbar');
|
||||
oNode.setAttribute('className','progressbar');
|
||||
oNode.setAttribute('src','./static/image/form/progressbar.gif');
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true ;
|
||||
} catch ( e ) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('progressstyle',sStyle);
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
if ($G('signType').value == '') {
|
||||
oNode.setAttribute('sign_type','1');
|
||||
} else {
|
||||
oNode.setAttribute('sign_type',$G('signType').value);
|
||||
}
|
||||
delete UE.plugins['imgupload'].editdom; //使用后清空这个对象,变回新增模式
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,439 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-cn" class="bg-white">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>二维码控件</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../../css/app.css">
|
||||
<script type="text/javascript" src="../../../../js/app.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/jquery.qrcode.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="control-label">控件名称</label>
|
||||
<input class="form-control input-sm" type="text" id="qrcode_title">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div role="tabpanel">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#qrcode_type_text" aria-controls="qrcode_type_text" role="tab" data-toggle="tab">文本</a></li>
|
||||
<li role="presentation"><a href="#qrcode_type_tel" aria-controls="qrcode_type_tel" role="tab" data-toggle="tab">电话</a></li>
|
||||
<li role="presentation"><a href="#qrcode_type_sms" aria-controls="qrcode_type_sms" role="tab" data-toggle="tab">短信</a></li>
|
||||
<li role="presentation"><a href="#qrcode_type_mecard" aria-controls="qrcode_type_mecard" role="tab" data-toggle="tab">名片</a></li>
|
||||
<li role="presentation"><a href="#qrcode_type_wifi" aria-controls="qrcode_type_wifi" role="tab" data-toggle="tab">WIFI</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
|
||||
<div role="tabpanel" id="qrcode_type_text" class="tab-pane active">
|
||||
|
||||
<div class="wrapper">
|
||||
<textarea class="form-control" id="qrcode_text" rows="5" data-type="text"></textarea>
|
||||
<p class="qrcode-tip">推荐140字以内,手机摄像头更容易辨识。</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div role="tabpanel" id="qrcode_type_tel" class="tab-pane">
|
||||
<label for="qrcode_tel">电话号码</label>
|
||||
<input type="text" data-type="tel" id="qrcode_tel">
|
||||
</div>
|
||||
|
||||
<div role="tabpanel" id="qrcode_type_sms" class="tab-pane">
|
||||
<label for="qrcode_sms_tel">电话号码</label>
|
||||
<div><input type="text" id="qrcode_sms_tel" data-type="sms"></div>
|
||||
<label for="qrcode_sms_content">短信内容</label>
|
||||
<div><textarea id="qrcode_sms_content" data-type="sms" rows="3"></textarea></div>
|
||||
</div>
|
||||
|
||||
<div role="tabpanel" id="qrcode_type_mecard" class="tab-pane mecard">
|
||||
<div class="row">
|
||||
<div class="span6 mbs">
|
||||
<label>姓名</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_n">
|
||||
</div>
|
||||
<div class="span6 mbs">
|
||||
<label>电话</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_tel">
|
||||
</div>
|
||||
<div class="span6 mbs">
|
||||
<label>公司</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_org">
|
||||
</div>
|
||||
<div class="span6 mbs">
|
||||
<label>职位</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_til">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mbs">
|
||||
<label>邮箱</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_email">
|
||||
</div>
|
||||
<div>
|
||||
<label>地址</label>
|
||||
<input type="text" data-type="mecard" id="qrcode_mecard_adr">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div role="tabpanel" id="qrcode_type_wifi" class="tab-pane">
|
||||
<div class="mbs">
|
||||
<label>SSID</label>
|
||||
<input type="text" data-type="wifi" id="qrcode_wifi_s">
|
||||
</div>
|
||||
<div class="mbs">
|
||||
<label>密码</label>
|
||||
<input type="text" data-type="wifi" id="qrcode_wifi_p">
|
||||
</div>
|
||||
<div class="mbs">
|
||||
<label>加密类型</label>
|
||||
<select data-type="wifi" id="qrcode_wifi_t">
|
||||
<option value="WPA">WPA/WPA2</option>
|
||||
<option value="WEP">WEP</option>
|
||||
<option value="nopass">无密码</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="qrcode-preview">
|
||||
<div>
|
||||
<img src="qrcode.png">
|
||||
<p>二维码尺寸</p>
|
||||
</div>
|
||||
<div id="qrcode_preview">
|
||||
</div>
|
||||
</div>
|
||||
<div class="qrcode-size">
|
||||
<div class="qrcode-size-title">二维码尺寸</div>
|
||||
<label class="radio"><input type="radio" name="size" value="0"><var id="lang_small"></var></label>
|
||||
<label class="radio"><input type="radio" name="size" value="1" checked><var id="lang_medium"></var></label>
|
||||
<label class="radio"><input type="radio" name="size" value="2"><var id="lang_large"></var></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>控件名称</span><span class="label label-important">*</span></th>
|
||||
<th><span>保存字段(用,号分隔)</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="itemName" placeholder="必填项" type="text" size="20" />
|
||||
</td>
|
||||
<td>
|
||||
<input id="itemList" type="text" size="20" title="二维码只支持少量中文,不要加入大量文本控件及图片控件" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
-->
|
||||
|
||||
<script>
|
||||
/*
|
||||
var G = parent.G;
|
||||
(function() {
|
||||
var Qr = {
|
||||
// 获取二维码尺寸
|
||||
getSize: function(){
|
||||
var radios = document.getElementsByName("size");
|
||||
for(var i = 0, len = radios.length; i < len; i++) {
|
||||
if(radios[i].checked) {
|
||||
return radios[i].value;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 设置二维码尺寸
|
||||
setSize: function(value){
|
||||
var radios = document.getElementsByName("size");
|
||||
for(var i = 0, len = radios.length; i < len; i++) {
|
||||
if(radios[i].value === value){
|
||||
radios[i].checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取类型
|
||||
getType: function(){
|
||||
return $("#qrcode_type").find(".active").attr("data-value");
|
||||
},
|
||||
setType: function(type){
|
||||
$("#qrcode_type").find("a").each(function(){
|
||||
if($.attr(this, "data-value") === type) {
|
||||
$(this).button("toggle").tab("show");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
},
|
||||
getValue: function() {
|
||||
var value = "",
|
||||
type = this.getType(),
|
||||
objToStr = function(obj) {
|
||||
var str = "";
|
||||
for(var i in obj) {
|
||||
if(obj.hasOwnProperty(i) && obj[i] !== "") {
|
||||
str += i + ":" + obj[i] + ";"
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
switch (type) {
|
||||
case 'text':
|
||||
value = $G('qrcode_text').value;
|
||||
break;
|
||||
case 'tel':
|
||||
var tel = $.trim($G('qrcode_tel').value);
|
||||
value = tel ? "tel:" + tel : tel;
|
||||
break;
|
||||
case 'sms':
|
||||
var smsTel = $.trim($G('qrcode_sms_tel').value),
|
||||
smsContent = $.trim($G('qrcode_sms_content').value);
|
||||
value = (smsTel && smsContent) ? ( "smsto:" + smsTel + ":" + smsContent) : "";
|
||||
break;
|
||||
case 'mecard':
|
||||
var data = {
|
||||
N: $.trim($G('qrcode_mecard_n').value),
|
||||
ORG: $.trim($G('qrcode_mecard_org').value),
|
||||
TIL: $.trim($G('qrcode_mecard_til').value),
|
||||
TEL: $.trim($G('qrcode_mecard_tel').value),
|
||||
EMAIL: $.trim($G('qrcode_mecard_email').value),
|
||||
ADR: $.trim($G('qrcode_mecard_adr').value)
|
||||
}
|
||||
if(data.N && data.TEL) {
|
||||
value = "MECARD:" + objToStr(data);
|
||||
}
|
||||
break;
|
||||
case 'wifi':
|
||||
var t = $G('qrcode_wifi_t').value;
|
||||
p = t === "nopass" ? "" : $G('qrcode_wifi_p').value;
|
||||
var data = {
|
||||
S: $.trim($G('qrcode_wifi_s').value),
|
||||
T: $.trim(t),
|
||||
P: p
|
||||
}
|
||||
if(data.S) {
|
||||
value = "WIFI:" + objToStr(data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return value
|
||||
},
|
||||
setValue: function(type, value){
|
||||
var reg, result;
|
||||
if(!value){
|
||||
return false;
|
||||
}
|
||||
switch (type) {
|
||||
case 'text':
|
||||
$G('qrcode_text').value = value;
|
||||
break;
|
||||
case 'tel':
|
||||
reg = /tel:(.*)/
|
||||
$G('qrcode_tel').value = reg.exec(value)[1];
|
||||
break;
|
||||
case 'sms':
|
||||
reg = /smsto:(.*):(.*)/;
|
||||
result = reg.exec(value);
|
||||
$G('qrcode_sms_tel').value = result[1];
|
||||
$G('qrcode_sms_content').value = result[2];
|
||||
break;
|
||||
case 'mecard':
|
||||
reg = /MECARD:(.*);/;
|
||||
result = reg.exec(value)[1].split(";");
|
||||
var data = {};
|
||||
for(var i = 0; i < result.length; i++) {
|
||||
if(result[i]){
|
||||
var kv = result[i].split(":");
|
||||
data[kv[0]] = kv[1];
|
||||
}
|
||||
}
|
||||
$G('qrcode_mecard_n').value = data.N;
|
||||
$G('qrcode_mecard_tel').value = data.TEL;
|
||||
$G('qrcode_mecard_org').value = data.ORG || "";
|
||||
$G('qrcode_mecard_til').value = data.TIL || "";
|
||||
$G('qrcode_mecard_email').value = data.EMAIL || "";
|
||||
$G('qrcode_mecard_adr').value = data.ADR || "";
|
||||
|
||||
break;
|
||||
case 'wifi':
|
||||
reg = /WIFI:(.*)/
|
||||
result = reg.exec(value)[1].split(";");
|
||||
var data = {};
|
||||
for(var i = 0; i < result.length; i++) {
|
||||
if(result[i]){
|
||||
var kv = result[i].split(":");
|
||||
data[kv[0]] = kv[1];
|
||||
}
|
||||
}
|
||||
$G('qrcode_wifi_s').value = data.S;
|
||||
$G('qrcode_wifi_t').value = data.T;
|
||||
$G('qrcode_wifi_p').value = data.P || "";
|
||||
break;
|
||||
}
|
||||
return value
|
||||
},
|
||||
createPreview: function(text) {
|
||||
var $container = $("#qrcode_preview");
|
||||
text = Ibos.string.utf16to8(text);
|
||||
if($.trim(text) !== ""){
|
||||
$container.empty().qrcode({
|
||||
text: text,
|
||||
width: 148,
|
||||
height: 148,
|
||||
render: ($.browser.msie && +$.browser.version < 9) ? 'table': 'canvas'
|
||||
}).prev().hide();
|
||||
} else {
|
||||
$container.empty().prev().show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var tpl = '<ic data-id="<%=id%>" data-title="<%=title%>" data-type="qrcode" data-qrcode-type="<%=qrcodeType%>" data-value="<%=value%>" data-qrcode-size="<%=qrcodeSize%>" contenteditable="false">' +
|
||||
'<span class="fake-qrcode"><input type="hidden" /></span></ic>',
|
||||
fc = new Fc(editor, tpl),
|
||||
editing = UE.plugins['formcontrols'].editing,
|
||||
oldData;
|
||||
|
||||
if (editing) {
|
||||
oldData = fc.getControlData(editing);
|
||||
$G("qrcode_title").value = oldData.title;
|
||||
Qr.setType(oldData.qrcodeType + "");
|
||||
Qr.setSize(oldData.qrcodeSize + "");
|
||||
Qr.setValue(oldData.qrcodeType, oldData.value);
|
||||
}
|
||||
|
||||
|
||||
dialog.onok = function() {
|
||||
var data,
|
||||
title = $G("qrcode_title").value,
|
||||
value = Qr.getValue();
|
||||
|
||||
if ($.trim(title) === "") {
|
||||
alert(editor.getLang("fc.noNameTip"));
|
||||
return false;
|
||||
}
|
||||
if ($.trim(value) === "") {
|
||||
alert(editor.getLang("icqrcode.noValueTip"));
|
||||
return false;
|
||||
}
|
||||
|
||||
data = {
|
||||
title: title,
|
||||
value: value,
|
||||
qrcodeType: Qr.getType(),
|
||||
qrcodeSize: Qr.getSize()
|
||||
};
|
||||
// 标签名不能为空且不能重复,提示或自动改名
|
||||
if (editing) {
|
||||
data.id = oldData.id;
|
||||
fc.updateContorl(editing, data);
|
||||
delete UE.plugins['formcontrols'].editing
|
||||
dialog.close();
|
||||
} else {
|
||||
$('body').waitingC();
|
||||
$.get(Ibos.app.url('workflow/api/getNextItemID', {id: parent.Ibos.app.g('formid')}), function(res) {
|
||||
$('body').stopWaiting();
|
||||
if (res.isSuccess) {
|
||||
data.id = res.id;
|
||||
fc.addControl(data);
|
||||
dialog.close();
|
||||
} else {
|
||||
alert(editor.getLang("fc.addError"));
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
var timer,
|
||||
delayQrcodeCreate = function(){
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
Qr.createPreview(Qr.getValue());
|
||||
}, 500);
|
||||
}
|
||||
$("#qrcode_field").on("keyup", "input[type='text'], textarea", delayQrcodeCreate)
|
||||
.on("change", "select", delayQrcodeCreate);
|
||||
$("#qrcode_type").on("click", ">a", delayQrcodeCreate);
|
||||
|
||||
Qr.createPreview(Qr.getValue());
|
||||
})();
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['qrcode'].editdom ){
|
||||
oNode = UE.plugins['qrcode'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('value');
|
||||
$G('itemList').value = oNode.getAttribute('datafld');
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['qrcode'].editdom ) {
|
||||
delete UE.plugins['qrcode'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if( $G('itemName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("img");
|
||||
oNode.setAttribute('title','二维码控件:' + $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('value',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('class','qrcode');
|
||||
oNode.setAttribute('datafld',$G('itemList').value);
|
||||
oNode.setAttribute('className','qrcode');
|
||||
oNode.setAttribute('src','./static/image/form/qrcode.gif');
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true ;
|
||||
} catch ( e ) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('value',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('title','二维码控件:' + $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('datafld',$G('itemList').value);
|
||||
delete UE.plugins['qrcode'].editdom; //使用后清空这个对象,变回新增模式
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,131 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>单选框属性</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="radio.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="txtName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">默认值</label>
|
||||
<div id="txtSelValue" class="form-control input-sm"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">单选项目</label>
|
||||
<select id="cmbText" class="form-control input-sm" multiple="multiple"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<a title="新增" class="btn btn-sm btn-default" onclick="fnAdd();">新增</a>
|
||||
<a title="修改" class="btn btn-sm btn-default" onclick="fnModify();">修改</a>
|
||||
<input type="text" class="form-control input-inline input-sm" placeholder="输入单选框值" size="16" id="txtText">
|
||||
<a title="上移" class="btn btn-sm btn-default" onclick="fnMove(-1);">上移</a>
|
||||
<a title="下移" class="btn btn-sm btn-default" onclick="fnMove(1);">下移</a>
|
||||
<a title="设为初始化时选定值" class="btn btn-sm btn-default" onclick="fnSetSelectedValue();">默认</a>
|
||||
<a title="删除" class="btn btn-sm btn-default" onclick="fnDelete();">删除</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
var oListText;
|
||||
window.onload = function() {
|
||||
oListText = $G('cmbText') ;
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['radio'].editdom ){
|
||||
oNode = UE.plugins['radio'].editdom;
|
||||
$G('txtName').value = oNode.getAttribute('title');
|
||||
$G('txtSelValue').innerHTML = oNode.getAttribute('radio_check');
|
||||
var sDataField = oNode.getAttribute('radio_field');
|
||||
var aDataField = sDataField.split('`');
|
||||
var sLvCheck = oNode.getAttribute("radio_check");
|
||||
// Load the actual options
|
||||
for ( var i = 0 ; i < aDataField.length ; i++ ) {
|
||||
var sText = aDataField[i];
|
||||
if(aDataField[i] == "") {
|
||||
continue;
|
||||
}
|
||||
fnAddComboOption( oListText, sText, sText ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['radio'].editdom ) {
|
||||
delete UE.plugins['radio'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if($G('txtName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('txtName').focus();
|
||||
return false;
|
||||
}
|
||||
if( oListText.options.length == 0 ) {
|
||||
alert('请添加单选选项!');
|
||||
$G('txtText').focus();
|
||||
return false;
|
||||
}
|
||||
var sDataField = '',sLvCheck = '';
|
||||
for ( var i = 0 ; i < oListText.options.length ; i++ ) {
|
||||
var sText = oListText.options[i].value ;
|
||||
if ( sText.length == 0 ) sText = sText ;
|
||||
|
||||
if ( sText == $G('txtSelValue').innerHTML ) {
|
||||
sLvCheck = sText;
|
||||
}
|
||||
if( sDataField.indexOf(sText+"`") != -1 && sText != "`") {
|
||||
alert("菜单项目'"+sText+"'重复");
|
||||
return false;
|
||||
}
|
||||
sDataField += sText+"`";
|
||||
}
|
||||
if(!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function(xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement("img");
|
||||
oNode.setAttribute('title',$G('txtName').value.replace("\"","""));
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('radio_field',sDataField);
|
||||
oNode.setAttribute('radio_check',sLvCheck);
|
||||
oNode.setAttribute('class','radio');
|
||||
oNode.setAttribute('src','./../../../../assets/images/icon-circle.png');
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true;
|
||||
} catch (e) {
|
||||
alert ('插入控件出错,请联系管理员。');
|
||||
return false;
|
||||
}
|
||||
},onerror:function() {
|
||||
alert('Request TimeOut');
|
||||
}});
|
||||
} else {
|
||||
oNode.setAttribute('title',$G('txtName').value.replace("\"","""));
|
||||
oNode.setAttribute('radio_field',sDataField);
|
||||
oNode.setAttribute('radio_check',sLvCheck);
|
||||
delete UE.plugins['radio'].editdom; //使用后清空这个对象,变回新增模式
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,135 +0,0 @@
|
|||
|
||||
function fnSelect( combo ) {
|
||||
var iIndex = combo.selectedIndex ;
|
||||
oListText.selectedIndex = iIndex ;
|
||||
var oTxtText = document.getElementById( "txtText" ) ;
|
||||
oTxtText.value = oListText.value ;
|
||||
}
|
||||
|
||||
function fnAdd() {
|
||||
var oTxtText = document.getElementById( "txtText" ) ;
|
||||
if( oTxtText.value!=""){
|
||||
fnAddComboOption( oListText, oTxtText.value, oTxtText.value ) ;
|
||||
}
|
||||
oListText.selectedIndex = oListText.options.length - 1 ;
|
||||
oTxtText.value = '' ;
|
||||
oTxtText.focus() ;
|
||||
}
|
||||
|
||||
function fnModify() {
|
||||
var iIndex = oListText.selectedIndex ;
|
||||
if ( iIndex < 0 ) return ;
|
||||
var oTxtText = document.getElementById( "txtText" ) ;
|
||||
oListText.options[ iIndex ].innerHTML = fnHTMLEncode( oTxtText.value ) ;
|
||||
oListText.options[ iIndex ].value = oTxtText.value ;
|
||||
oTxtText.value = '' ;
|
||||
oTxtText.focus() ;
|
||||
}
|
||||
|
||||
function fnMove( steps ) {
|
||||
fnChangeOptionPosition( oListText, steps ) ;
|
||||
}
|
||||
|
||||
function fnDelete() {
|
||||
fnRemoveSelectedOptions( oListText ) ;
|
||||
}
|
||||
|
||||
function fnSetSelectedValue() {
|
||||
var iIndex = oListText.selectedIndex ;
|
||||
if ( iIndex < 0 ) return ;
|
||||
var oTxtText = document.getElementById( "txtSelValue" ) ;
|
||||
oTxtText.innerHTML = oListText.options[ iIndex ].value ;
|
||||
}
|
||||
|
||||
// Moves the selected option by a number of steps (also negative)
|
||||
function ChangeOptionPosition( combo, steps ) {
|
||||
var iActualIndex = combo.selectedIndex ;
|
||||
if ( iActualIndex < 0 ){
|
||||
return ;
|
||||
}
|
||||
var iFinalIndex = iActualIndex + steps ;
|
||||
if ( iFinalIndex < 0 ) {
|
||||
iFinalIndex = 0 ;
|
||||
}
|
||||
|
||||
if ( iFinalIndex > ( combo.options.length - 1 ) ) {
|
||||
iFinalIndex = combo.options.length - 1 ;
|
||||
}
|
||||
|
||||
if ( iActualIndex == iFinalIndex ) {
|
||||
return ;
|
||||
}
|
||||
|
||||
var oOption = combo.options[ iActualIndex ] ;
|
||||
var sText = fnHTMLDecode( oOption.innerHTML ) ;
|
||||
|
||||
combo.remove( iActualIndex ) ;
|
||||
|
||||
oOption = fnAddComboOption( combo, sText, sText, null, iFinalIndex ) ;
|
||||
|
||||
oOption.selected = true ;
|
||||
}
|
||||
|
||||
// Remove all selected options from a SELECT object
|
||||
function fnRemoveSelectedOptions(combo) {
|
||||
// Save the selected index
|
||||
var iSelectedIndex = combo.selectedIndex ;
|
||||
|
||||
var oOptions = combo.options ;
|
||||
|
||||
// Remove all selected options
|
||||
for ( var i = oOptions.length - 1 ; i >= 0 ; i-- ) {
|
||||
if (oOptions[i].selected) combo.remove(i) ;
|
||||
}
|
||||
|
||||
// Reset the selection based on the original selected index
|
||||
if ( combo.options.length > 0 ) {
|
||||
if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ;
|
||||
combo.selectedIndex = iSelectedIndex ;
|
||||
}
|
||||
}
|
||||
|
||||
// Add a new option to a SELECT object (combo or list)
|
||||
function fnAddComboOption( combo, optionText, optionValue, documentObject, index ) {
|
||||
var oOption ;
|
||||
|
||||
if ( documentObject ) {
|
||||
oOption = documentObject.createElement("option") ;
|
||||
} else {
|
||||
oOption = document.createElement("option") ;
|
||||
}
|
||||
|
||||
if ( index != null ) {
|
||||
combo.options.add( oOption, index ) ;
|
||||
} else {
|
||||
combo.options.add( oOption ) ;
|
||||
}
|
||||
|
||||
oOption.innerHTML = optionText.length > 0 ? fnHTMLEncode( optionText ) : ' ' ;
|
||||
oOption.value = optionValue ;
|
||||
|
||||
return oOption ;
|
||||
}
|
||||
|
||||
function fnHTMLEncode( text ) {
|
||||
if ( !text ) {
|
||||
return '' ;
|
||||
}
|
||||
text = text.replace( /&/g, '&' ) ;
|
||||
text = text.replace( /</g, '<' ) ;
|
||||
text = text.replace( />/g, '>' ) ;
|
||||
|
||||
return text ;
|
||||
}
|
||||
|
||||
|
||||
function fnHTMLDecode( text ) {
|
||||
if ( !text ) {
|
||||
return '' ;
|
||||
}
|
||||
text = text.replace( />/g, '>' ) ;
|
||||
text = text.replace( /</g, '<' ) ;
|
||||
text = text.replace( /&/g, '&' ) ;
|
||||
|
||||
return text ;
|
||||
}
|
|
@ -1,162 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>签章控件</title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap.css">
|
||||
<link rel="stylesheet" href="../../../bootstrap/bootstrap-responsive.css">
|
||||
<style type="text/css">
|
||||
*{color: #838383;margin: 0;padding: 0}
|
||||
html,body {font-size: 12px;overflow: hidden; }
|
||||
body {
|
||||
padding-left: 20px;padding-right: 20px;
|
||||
}
|
||||
label {
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table class="table table-striped table-bordered" style="margin-top:18px;margin-bottom: 0;">
|
||||
<tr>
|
||||
<th><span>控件名称</span><span class="label label-important">*</span></th>
|
||||
<th><span>控件类型</span><span class="label label-important">*</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="itemName" type="text" placeholder="必填项" size="20" />
|
||||
</td>
|
||||
<td>
|
||||
<label><input type="checkbox" id="signType1" value="1" checked />盖章</label>
|
||||
<label><input type="checkbox" id="signType2" onclick="fnSetSignColor()" value="2" checked />手写</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span>验证锁定字段 (用,号分隔)</span></th>
|
||||
<th><span>手写颜色</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<textarea id="itemList" style="width: 267px;height: 60px;" title="不填写则不验证"></textarea>
|
||||
</td>
|
||||
<td>
|
||||
<select id="signColor" style="width:150px;">
|
||||
<option style="background-color:red" value="0x0000FF">红色</option>
|
||||
<option style="background-color:green" value="0x00FF00">绿色</option>
|
||||
<option style="background-color:blue" value="0xFF0000">蓝色</option>
|
||||
<option style="background-color:black" value="0x000000">黑色</option>
|
||||
<option style="background-color:white" value="0xFFFFFF">白色</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑多行文本框还是新增
|
||||
if( UE.plugins['sign'].editdom ){
|
||||
oNode = UE.plugins['sign'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('value');
|
||||
$G('itemList').value = oNode.getAttribute('datafld');
|
||||
if( oNode.getAttribute('sign_type') != null ) {
|
||||
var aType = oNode.getAttribute('sign_type').split(",");
|
||||
for( var i = 1; i <aType.length; i++ ) {
|
||||
if( aType[i-1] == 1 ) {
|
||||
$G("signType"+i).checked = true;
|
||||
} else {
|
||||
$G("signType"+i).checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( oNode.getAttribute('sign_color') != null ) {
|
||||
$G('signColor').value = oNode.getAttribute('sign_color') ;
|
||||
}
|
||||
}
|
||||
fnSetSignColor();
|
||||
}
|
||||
function fnSetSignColor(){
|
||||
if($G('signType2').checked == true){
|
||||
$G('signColor').removeAttribute('disabled');
|
||||
} else {
|
||||
$G('signColor').setAttribute('disabled','disabled');
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['sign'].editdom ) {
|
||||
delete UE.plugins['sign'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if( $G('itemName').value == '' ){
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
if ( $G('signType1').checked == false && $G("signType2").checked == false ) {
|
||||
alert("至少选择一个类型");
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement('img');
|
||||
oNode.setAttribute('name', 'data_' + nItemId);
|
||||
oNode.setAttribute('title', '签章控件:' + $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('value', $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('class', 'sign');
|
||||
oNode.setAttribute('className', 'sign');
|
||||
oNode.setAttribute('src', './static/image/form/sign.gif');
|
||||
if($G('signType2').checked){
|
||||
oNode.setAttribute('sign_color',$G('signColor').value);
|
||||
}
|
||||
var sSignType = "";
|
||||
if( $G("signType1").checked ) {
|
||||
sSignType += "1,";
|
||||
} else {
|
||||
sSignType += "0,";
|
||||
}
|
||||
if( $G("signType2").checked ) {
|
||||
sSignType += "1,";
|
||||
} else {
|
||||
sSignType += "0,";
|
||||
}
|
||||
oNode.setAttribute('sign_type',sSignType);
|
||||
oNode.setAttribute('datafld',$G('itemList').value);
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
oNode.setAttribute('title', '签章控件:' + $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('value', $G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('datafld',$G('itemList').value);
|
||||
var sSignType = "";
|
||||
if( $G("signType1").checked ) {
|
||||
sSignType += "1,";
|
||||
} else {
|
||||
sSignType += "0,";
|
||||
}
|
||||
if( $G("signType2").checked ) {
|
||||
sSignType += "1,";
|
||||
oNode.setAttribute('sign_color',$G('signColor').value);
|
||||
} else {
|
||||
sSignType += "0,";
|
||||
oNode.removeAttribute('sign_color');
|
||||
}
|
||||
oNode.setAttribute('sign_type',sSignType);
|
||||
delete UE.plugins['sign'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,182 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>插入单行文本框</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="txtName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">默认值</label>
|
||||
<input id="txtValue" name="value" class="form-control input-sm" placeholder="无则不填" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="txtWidth" name="width" class="form-control input-sm" type="text" value="150">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">字体</div>
|
||||
<input id="txtFontSize" name="font-size" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><input id="hidden" name="hidden" type="checkbox"> 隐藏</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
var options = {};
|
||||
window.onload = function() {
|
||||
|
||||
if(UE.plugins['text'].editdom) {
|
||||
|
||||
oNode = UE.plugins['text'].editdom;
|
||||
|
||||
$G('txtName').value = oNode.getAttribute('title');
|
||||
$G('txtValue').value = oNode.getAttribute('value');
|
||||
var nHidden = oNode.getAttribute('hide');
|
||||
if (nHidden == '1') {
|
||||
$G('hidden').checked = true;
|
||||
} else {
|
||||
nHidden = '0';
|
||||
}
|
||||
var sItemId = oNode.getAttribute('name').substr(5);
|
||||
var sFontSize = oNode.style.fontSize;
|
||||
$G('txtFontSize').value = sFontSize.substr(0, sFontSize.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
var sSizeWidth = oNode.style.width;
|
||||
$G('txtWidth').value = sSizeWidth.substr(0, sSizeWidth.length - 2);
|
||||
var sSizeHeight = oNode.style.height;
|
||||
//$G('txtHeight').value = sSizeHeight.substr(0, sSizeHeight.length - 2);
|
||||
//$G('txtAlign').value = oNode.style.textAlign;
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function()
|
||||
{
|
||||
if(UE.plugins['text'].editdom) {
|
||||
delete UE.plugins['text'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function()
|
||||
{
|
||||
if($G('txtName').value == '')
|
||||
{
|
||||
alert('请输入控件名称');
|
||||
return false;
|
||||
}
|
||||
if(!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function(xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
var html = '<input class="text" type="text"';
|
||||
|
||||
html += ' title = "' + $G('txtName').value + '"';
|
||||
html += ' name = "data_' + nItemId + '"';
|
||||
html += ' value = "' + $G('txtValue').value + '"';
|
||||
if ( $G('hidden').checked ) {
|
||||
html += ' hide = "1"';
|
||||
} else {
|
||||
html += ' hide = "0"';
|
||||
}
|
||||
html += ' style = "';
|
||||
if( $G('txtFontSize').value != '') {
|
||||
html += 'font-size:' + $G('txtFontSize').value + 'px;';
|
||||
}
|
||||
|
||||
/*
|
||||
if( $G('txtAlign').value != '') {
|
||||
html += 'text-align:' + $G('txtAlign').value + ';';
|
||||
}
|
||||
*/
|
||||
|
||||
if( $G('txtWidth').value != '') {
|
||||
html += 'width:' + $G('txtWidth').value + 'px;';
|
||||
}
|
||||
|
||||
/*
|
||||
if( $G('txtHeight').value != '') {
|
||||
html += 'height:' + $G('txtHeight').value + 'px;';
|
||||
}
|
||||
*/
|
||||
html += '">';
|
||||
|
||||
// var options = UE.utils.unhtml(workflow_set_options());
|
||||
// html += ' data-options="' + options +'">';
|
||||
|
||||
editor.execCommand('insertHtml', html);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
oNode.setAttribute('title', $G('txtName').value);
|
||||
oNode.setAttribute('value', $G('txtValue').value);
|
||||
if( $G('hidden').checked ) {
|
||||
oNode.setAttribute('hide', 1);
|
||||
} else {
|
||||
oNode.setAttribute('hide', 0);
|
||||
}
|
||||
var style = '';
|
||||
if( $G('txtFontSize').value != '') {
|
||||
style += 'font-size:' + $G('txtFontSize').value + 'px;';
|
||||
}
|
||||
/*
|
||||
if( $G('txtAlign').value != '') {
|
||||
style += 'text-align:' + $G('txtAlign').value + ';';
|
||||
}*/
|
||||
if( $G('txtWidth').value != '') {
|
||||
style += 'width:' + $G('txtWidth').value + 'px;';
|
||||
}
|
||||
/*
|
||||
if( $G('txtHeight').value != '') {
|
||||
style += 'height:' + $G('txtHeight').value + 'px;';
|
||||
}*/
|
||||
oNode.setAttribute('style',style);
|
||||
//oNode.setAttribute('data-options', workflow_set_options());
|
||||
|
||||
console.log(oNode);
|
||||
|
||||
delete UE.plugins['text'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,184 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>插入多行文本框</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="areaName" placeholder="必填项" name="name" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="areaWidth" name="width" class="form-control input-sm" type="text" value="400">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">高</div>
|
||||
<input id="areaHeight" name="height" class="form-control input-sm" type="text" value="60">
|
||||
<div class="input-group-addon">行</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">字体</div>
|
||||
<input id="areaFontSize" name="font-size" class="form-control input-sm" type="text">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">默认值</label>
|
||||
<textarea class="form-control" id="areaContent" placeholder="输入框默认值"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><input id="richText" name="richText" type="checkbox"> 富文本形式</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function()
|
||||
{
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑多行文本框还是新增
|
||||
//以下这个对象定义在editor.all.js第13325行。
|
||||
if(UE.plugins['textarea'].editdom)
|
||||
{
|
||||
oNode = UE.plugins['textarea'].editdom;
|
||||
$G('areaName').value = oNode.getAttribute('title');
|
||||
$G('areaContent').value = oNode.getAttribute('value');
|
||||
var nRich = oNode.getAttribute('rich');
|
||||
if (nRich == '1') {
|
||||
$G('richText').checked = true;
|
||||
} else {
|
||||
nRich = '0';
|
||||
}
|
||||
var sFontSize = oNode.style.fontSize;
|
||||
$G('areaFontSize').value = sFontSize.substr(0, sFontSize.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
var sSizeWidth = oNode.style.width;
|
||||
$G('areaWidth').value = sSizeWidth.substr(0, sSizeWidth.length - 2);
|
||||
var sSizeHeight = oNode.style.height;
|
||||
$G('areaHeight').value = sSizeHeight.substr(0, sSizeHeight.length - 2);
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function()
|
||||
{
|
||||
if(UE.plugins['textarea'].editdom)
|
||||
{
|
||||
delete UE.plugins['textarea'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function() {
|
||||
if($G('areaName').value == '') {
|
||||
alert('请输入控件名称');
|
||||
return false;
|
||||
}
|
||||
if(!oNode) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
var html = '<textarea class="textarea" ';
|
||||
html += ' title = "' + $G('areaName').value + '"';
|
||||
html += ' name = "data_' + nItemId + '"';
|
||||
html += ' value = "' + $G('areaContent').value + '"';
|
||||
if ( $G('richText').checked ) {
|
||||
html += ' rich = "1"';
|
||||
if( $G('areaWidth').value != '' ) {
|
||||
html += ' rich_width = "' + $G('areaWidth').value + '"';
|
||||
} else {
|
||||
html += ' rich_width = ""';
|
||||
}
|
||||
if( $G('areaHeight').value != '' ) {
|
||||
html += ' rich_height = "' + $G('areaHeight').value + '"';
|
||||
} else {
|
||||
html += ' rich_height = ""';
|
||||
}
|
||||
} else {
|
||||
html += ' rich = "0"';
|
||||
}
|
||||
html += ' style = "';
|
||||
if( $G('areaFontSize').value != '' ) {
|
||||
html += 'font-size:' + $G('areaFontSize').value + 'px;';
|
||||
}
|
||||
if( $G('areaWidth').value != '' ) {
|
||||
html += 'width:' + $G('areaWidth').value + 'px;';
|
||||
}
|
||||
if( $G('areaHeight').value != '' ) {
|
||||
html += 'height:' + $G('areaHeight').value + 'px;';
|
||||
}
|
||||
html += '">';
|
||||
html += $G('areaContent').value + '</textarea>';
|
||||
editor.execCommand('insertHtml',html);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
oNode.setAttribute('title', $G('areaName').value);
|
||||
oNode.setAttribute('value',$G('areaContent').value);
|
||||
oNode.innerHTML = $G('areaContent').value;
|
||||
if( $G('richText').checked ) {
|
||||
oNode.setAttribute('rich', 1);
|
||||
} else {
|
||||
oNode.setAttribute('rich', 0);
|
||||
}
|
||||
var style = '';
|
||||
if( $G('areaFontSize').value != '' ) {
|
||||
style += 'font-size:' + $G('areaFontSize').value + 'px;';
|
||||
}
|
||||
if( $G('areaWidth').value != '' ) {
|
||||
style += 'width:' + $G('areaWidth').value + 'px;';
|
||||
if( $G('richText').checked ) {
|
||||
oNode.setAttribute('rich_width', $G('areaWidth').value);
|
||||
}
|
||||
} else {
|
||||
if( $G('richText').checked ) {
|
||||
oNode.setAttribute('rich_width', '');
|
||||
}
|
||||
}
|
||||
if( $G('areaHeight').value != '' ) {
|
||||
style += 'height:' + $G('areaHeight').value + 'px;';
|
||||
if( $G('richText').checked ) {
|
||||
oNode.setAttribute('rich_height', $G('areaHeight').value);
|
||||
}
|
||||
} else {
|
||||
if($G('richText').checked) {
|
||||
oNode.setAttribute('rich_height','');
|
||||
}
|
||||
}
|
||||
oNode.setAttribute('style',style);
|
||||
delete UE.plugins['textarea'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,144 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html class="bg-white">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>部门人员控件属性</title>
|
||||
<link rel="stylesheet" href="../../../../dist/app.min.css">
|
||||
<script type="text/javascript" src="../../../../dist/app.min.js"></script>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="m-t">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件名称 <span class="text-danger">*</span></label>
|
||||
<input type="text" id="itemName" name="name" placeholder="必填项" class="form-control input-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">类型</label>
|
||||
<select class="form-control input-sm" id="selectType">
|
||||
<option value="user" selected>选择人员</option>
|
||||
<option value="role">选择角色</option>
|
||||
<option value="department">选择部门</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">控件样式</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">宽</div>
|
||||
<input id="txtWidth" name="width" class="form-control input-sm" type="text" value="150">
|
||||
<div class="input-group-addon">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><input id="issingle" name="issingle" type="checkbox"> 单选</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var oNode = null;
|
||||
window.onload = function() {
|
||||
//弹出窗口初始化函数,这里主要是判断是编辑下拉列表还是新增
|
||||
if( UE.plugins['user'].editdom ){
|
||||
oNode = UE.plugins['user'].editdom;
|
||||
$G('itemName').value = oNode.getAttribute('title');
|
||||
$G('selectType').value = oNode.getAttribute('selecttype');
|
||||
if(oNode.getAttribute('single')=='true') {
|
||||
$G('issingle').checked = true;
|
||||
}
|
||||
var sWidth = oNode.style.width;
|
||||
$G('txtWidth').value = sWidth.substr(0, sWidth.length - 2);//这里的substr是为了去掉末尾的'px'
|
||||
var sHeight = oNode.style.height;
|
||||
$G('txtHeight').value = sHeight.substr(0, sHeight.length - 2);
|
||||
}
|
||||
}
|
||||
dialog.oncancel = function () {
|
||||
if( UE.plugins['user'].editdom ) {
|
||||
delete UE.plugins['user'].editdom;
|
||||
}
|
||||
};
|
||||
dialog.onok = function (){
|
||||
if( $G('itemName').value == '') {
|
||||
alert('控件名称不能为空');
|
||||
$G('itemName').focus();
|
||||
return false;
|
||||
}
|
||||
if( !oNode ) {
|
||||
var sUrl = parent.myform.count_item.value;
|
||||
var nItemId = null;
|
||||
ajax.request(sUrl, {async:false,timeout:60000,onsuccess:function (xhr) {
|
||||
try {
|
||||
nItemId = xhr.responseText;
|
||||
oNode = document.createElement('input');
|
||||
oNode.setAttribute('name','data_' + nItemId);
|
||||
oNode.setAttribute('class','user');
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('selecttype',$G('selectType').value);
|
||||
if( $G('txtWidth').value!=''){
|
||||
oNode.style.width = $G('txtWidth').value + 'px';
|
||||
oNode.setAttribute('user_width',$G('txtWidth').value);
|
||||
} else {
|
||||
oNode.style.width = '148px';
|
||||
oNode.setAttribute('user_width','148');
|
||||
}
|
||||
if( $G('txtHeight').value!='') {
|
||||
oNode.style.height = $G('txtHeight').value + 'px';
|
||||
oNode.setAttribute('user_height',$G('txtHeight').value);
|
||||
} else {
|
||||
oNode.style.height = '25px';
|
||||
oNode.setAttribute('user_height','25');
|
||||
}
|
||||
if($G('issingle').checked == true) {
|
||||
oNode.setAttribute('single','true');
|
||||
} else {
|
||||
oNode.setAttribute('single','false');
|
||||
}
|
||||
editor.execCommand('insertHtml',oNode.outerHTML);
|
||||
return true;
|
||||
} catch (e) {
|
||||
alert ( '插入控件出错,请联系OA管理员解决 ');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
alert('Request TimeOut');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if( $G('txtWidth').value!=''){
|
||||
oNode.style.width = $G('txtWidth').value + 'px';
|
||||
oNode.setAttribute('user_width',$G('txtWidth').value);
|
||||
} else {
|
||||
oNode.style.width = '148px';
|
||||
oNode.setAttribute('user_width','148');
|
||||
}
|
||||
if( $G('txtHeight').value!=''){
|
||||
oNode.style.height = $G('txtHeight').value + 'px';
|
||||
oNode.setAttribute('user_height',$G('txtHeight').value);
|
||||
} else {
|
||||
oNode.style.height = '25px';
|
||||
oNode.setAttribute('user_height','25');
|
||||
}
|
||||
if($G('issingle').checked==true){
|
||||
oNode.setAttribute('single','true');
|
||||
} else {
|
||||
oNode.setAttribute('single','false');
|
||||
}
|
||||
oNode.setAttribute('title',$G('itemName').value.replace("\"","""));
|
||||
oNode.setAttribute('selecttype',$G('selectType').value);
|
||||
delete UE.plugins['user'].editdom; //使用后清空这个对象,变回新增模式
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,215 +0,0 @@
|
|||
(function () {
|
||||
|
||||
var URL = window.UEDITOR_HOME_URL;
|
||||
|
||||
window.UEDITOR_CONFIG = {
|
||||
|
||||
UEDITOR_HOME_URL:URL
|
||||
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
|
||||
,toolbars:[["source","undo","redo","unlink","link","insertunorderedlist","insertorderedlist","spechars","template","bold","italic","underline","strikethrough","forecolor","backcolor","justifyleft","justifycenter","justifyright","justifyjustify","pasteplain","formatmatch","removeformat","rowspacingbottom","rowspacingtop","fontsize","fontfamily","inserttable","deletetable","mergeright","mergedown","splittorows","splittocols","splittocells","mergecells","insertcol","insertrow","deletecol","deleterow","insertparagraphbeforetable","imagecenter","imageright","imageleft","imagenone"]]
|
||||
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
|
||||
,labelMap:{
|
||||
'anchor':'','undo':''
|
||||
}
|
||||
// 禁止将div转换p
|
||||
,allowDivTransToP:false
|
||||
// 允许表格嵌套
|
||||
,disabledTableInTable:false
|
||||
|
||||
//webAppKey
|
||||
//百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能
|
||||
,webAppKey:""
|
||||
|
||||
|
||||
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
|
||||
//lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
|
||||
//,lang:'zh-cn'
|
||||
|
||||
//,langPath:URL +"lang/"
|
||||
|
||||
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
|
||||
//现有如下皮肤:default,modern,gorgeous
|
||||
//,theme:'default'
|
||||
//,themePath:URL +"themes/"
|
||||
|
||||
//若实例化编辑器的页面手动修改的domain,此处需要设置为true
|
||||
//,customDomain:false
|
||||
|
||||
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。
|
||||
//,charset:"utf-8"
|
||||
|
||||
//常用配置项目
|
||||
//,isShow : true //默认显示编辑器
|
||||
|
||||
,initialContent:'' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
|
||||
|
||||
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
|
||||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
||||
|
||||
//,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
|
||||
,iframeCssUrl:URL + '../../../assets/css/app.min.css'
|
||||
//,iframeCssUrl:URL + 'themes/app.css' //给编辑器内部引入一个css文件
|
||||
//,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
|
||||
//,focus:true //初始化时,是否让编辑器获得焦点true或false
|
||||
|
||||
//,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
|
||||
|
||||
//,fullscreen : false //是否开启初始化时即全屏,默认关闭
|
||||
|
||||
//,readonly : false /编辑器初始化结束后,编辑区域是否是只读的,默认是false
|
||||
|
||||
//,zIndex : 900 //编辑器层级的基数,默认是900
|
||||
|
||||
//,imagePopup:true //图片操作的浮层开关,默认打开
|
||||
|
||||
//,initialStyle:'body{font-size:18px}' //编辑器内部样式,可以用来改变字体等
|
||||
|
||||
//,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
|
||||
|
||||
//,pasteplain:false //是否纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
|
||||
|
||||
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
|
||||
//iframeUrlMap
|
||||
//dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
|
||||
//,iframeUrlMap:{
|
||||
// 'anchor':'~/dialogs/anchor/anchor.html',
|
||||
// }
|
||||
//insertorderedlist
|
||||
//有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
||||
// ,'insertorderedlist':{
|
||||
// 'decimal' : '' , //'1,2,3...'
|
||||
// 'lower-alpha' : '' , // 'a,b,c...'
|
||||
// 'lower-roman' : '' , //'i,ii,iii...'
|
||||
// 'upper-alpha' : '' , lang //'A,B,C'
|
||||
// 'upper-roman' : '' //'I,II,III...'
|
||||
// }
|
||||
//insertunorderedlist
|
||||
//无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
||||
//,insertunorderedlist : {
|
||||
// 'circle' : '', // '○ 小圆圈'
|
||||
// 'disc' : '', // '● 小圆点'
|
||||
// 'square' : '' //'■ 小方块'
|
||||
//}
|
||||
//fontfamily
|
||||
//字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
|
||||
//,'fontfamily':[
|
||||
// { label:'',name:'songti',val:'宋体,SimSun'},
|
||||
// { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
|
||||
// { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
|
||||
// { label:'',name:'heiti',val:'黑体, SimHei'},
|
||||
// { label:'',name:'lishu',val:'隶书, SimLi'},
|
||||
// { label:'',name:'STZhongsong',val:'华文中宋, STZhongsong'},
|
||||
// { label:'',name:'andaleMono',val:'andale mono'},
|
||||
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
|
||||
// { label:'',name:'arialBlack',val:'arial black,avant garde'},
|
||||
// { label:'',name:'comicSansMs',val:'comic sans ms'},
|
||||
// { label:'',name:'impact',val:'impact,chicago'},
|
||||
// { label:'',name:'timesNewRoman',val:'times new roman'}
|
||||
//]
|
||||
//fontsize
|
||||
//字号
|
||||
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
|
||||
//paragraph
|
||||
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
|
||||
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
|
||||
//rowspacingtop
|
||||
//段间距 值和显示的名字相同
|
||||
//,'rowspacingtop':['5', '10', '15', '20', '25']
|
||||
//rowspacingBottom
|
||||
//段间距 值和显示的名字相同
|
||||
//,'rowspacingbottom':['5', '10', '15', '20', '25']
|
||||
//lineheight
|
||||
//行内间距 值和显示的名字相同
|
||||
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
|
||||
|
||||
//customstyle
|
||||
//自定义样式,不支持国际化,此处配置值即可最后显示值
|
||||
//block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置
|
||||
//尽量使用一些常用的标签
|
||||
//参数说明
|
||||
//tag 使用的标签名字
|
||||
//label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同,
|
||||
//style 添加的样式
|
||||
//每一个对象就是一个自定义的样式
|
||||
//,'customstyle':[
|
||||
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
|
||||
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
|
||||
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
|
||||
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
|
||||
// ]
|
||||
|
||||
//右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
|
||||
// ,contextMenu:[
|
||||
// {
|
||||
// label:'', //显示的名称
|
||||
// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
|
||||
// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
|
||||
// exec:function () {
|
||||
// //this是当前编辑器的实例
|
||||
// //this.ui._dialogs['inserttableDialog'].open();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
//wordCount
|
||||
//,wordCount:1 //是否开启字数统计
|
||||
//,maximumWords:10000 //允许的最大字符数
|
||||
//字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
|
||||
//,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
|
||||
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
|
||||
//,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
|
||||
|
||||
//highlightcode
|
||||
// 代码高亮时需要加载的第三方插件的路径
|
||||
// ,highlightJsUrl:URL + "third-party/SyntaxHighlighter/shCore.js"
|
||||
// ,highlightCssUrl:URL + "third-party/SyntaxHighlighter/shCoreDefault.css"
|
||||
//elementPathEnabled
|
||||
//是否启用元素路径,默认是显示
|
||||
//,elementPathEnabled : true
|
||||
//removeFormat
|
||||
//清除格式时可以删除的标签和属性
|
||||
//removeForamtTags标签
|
||||
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
|
||||
//removeFormatAttributes属性
|
||||
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
|
||||
//undo
|
||||
//可以最多回退的次数,默认20
|
||||
//,maxUndoCount:20
|
||||
//当输入的字符数超过该值时,保存一次现场
|
||||
//,maxInputCount:1
|
||||
//autoHeightEnabled
|
||||
// 是否自动长高,默认true
|
||||
//,autoHeightEnabled:true
|
||||
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
|
||||
//,minFrameHeight:220 //编辑器拖动时最小高度,默认220
|
||||
//autoFloatEnabled
|
||||
//是否保持toolbar的位置不动,默认true
|
||||
,autoFloatEnabled:false
|
||||
//浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
|
||||
//,topOffset:30
|
||||
//indentValue
|
||||
//首行缩进距离,默认是2em
|
||||
//,indentValue:'2em'
|
||||
//pageBreakTag
|
||||
//分页标识符,默认是_baidu_page_break_tag_
|
||||
//,pageBreakTag:'_baidu_page_break_tag_'
|
||||
|
||||
//autotypeset
|
||||
// //自动排版参数
|
||||
// ,autotypeset:{
|
||||
// mergeEmptyline : true, //合并空行
|
||||
// removeClass : true, //去掉冗余的class
|
||||
// removeEmptyline : false, //去掉空行
|
||||
// textAlign : "left" , //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
|
||||
// imageBlockLine : 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
|
||||
// pasteFilter : false, //根据规则过滤没事粘贴进来的内容
|
||||
// clearFontSize : false, //去掉所有的内嵌字号,使用编辑器默认的字号
|
||||
// clearFontFamily : false, //去掉所有的内嵌字体,使用编辑器默认的字体
|
||||
// removeEmptyNode : false , // 去掉空节点
|
||||
// //可以去掉的标签
|
||||
// removeTagNames : {标签名字:1},
|
||||
// indent : false, // 行首缩进
|
||||
// indentValue : '2em' //行首缩进的大小
|
||||
// }
|
||||
|
||||
};
|
||||
})();
|
|
@ -1,220 +0,0 @@
|
|||
(function () {
|
||||
|
||||
var URL = window.UEDITOR_HOME_URL;
|
||||
var initialStyle = "html.view {background:url(/assets/images/wf_canvas_bg.png)} body.view {background:#fff;padding:10px; width:820px;margin:0 auto; font:12px/18px '微软雅黑',tahoma,Arial,Verdana,Helvetica,sans-serif;color:#333;border:1px solid #ddd;}" +
|
||||
'body.view > table {width:800px;}' +
|
||||
'body.view > table td,body.view > table th {border-bottom: 1px solid #ddd;border-left:1px solid #ddd;padding:6px;}' +
|
||||
'body.view > table th {color:#333;}' +
|
||||
'body.view > table thead th {background:#eee;color:#666;}';
|
||||
|
||||
window.UEDITOR_CONFIG = {
|
||||
|
||||
UEDITOR_HOME_URL:URL
|
||||
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
|
||||
,toolbars:[["source","undo","redo","unlink","link","insertunorderedlist","insertorderedlist","spechars","template","bold","italic","underline","strikethrough","forecolor","backcolor","justifyleft","justifycenter","justifyright","justifyjustify","pasteplain","formatmatch","removeformat","rowspacingbottom","rowspacingtop","fontsize","fontfamily","inserttable","deletetable","mergeright","mergedown","splittorows","splittocols","splittocells","mergecells","insertcol","insertrow","deletecol","deleterow","insertparagraphbeforetable","imagecenter","imageright","imageleft","imagenone"]]
|
||||
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
|
||||
,labelMap:{
|
||||
'anchor':'','undo':''
|
||||
}
|
||||
// 禁止将div转换p
|
||||
,allowDivTransToP:false
|
||||
// 允许表格嵌套
|
||||
,disabledTableInTable:false
|
||||
|
||||
//webAppKey
|
||||
//百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能
|
||||
,webAppKey:""
|
||||
|
||||
|
||||
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
|
||||
//lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
|
||||
//,lang:'zh-cn'
|
||||
|
||||
//,langPath:URL +"lang/"
|
||||
|
||||
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
|
||||
//现有如下皮肤:default,modern,gorgeous
|
||||
//,theme:'default'
|
||||
//,themePath:URL +"themes/"
|
||||
|
||||
//若实例化编辑器的页面手动修改的domain,此处需要设置为true
|
||||
//,customDomain:false
|
||||
|
||||
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。
|
||||
//,charset:"utf-8"
|
||||
|
||||
//常用配置项目
|
||||
//,isShow : true //默认显示编辑器
|
||||
|
||||
,initialContent:'' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
|
||||
|
||||
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
|
||||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
||||
|
||||
//,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
|
||||
,iframeCssUrl:URL + '../../../assets/dist/app.min.css'
|
||||
//,iframeCssUrl:URL + 'themes/app.css' //给编辑器内部引入一个css文件
|
||||
//,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
|
||||
//,focus:true //初始化时,是否让编辑器获得焦点true或false
|
||||
|
||||
//,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
|
||||
|
||||
//,fullscreen : false //是否开启初始化时即全屏,默认关闭
|
||||
|
||||
//,readonly : false /编辑器初始化结束后,编辑区域是否是只读的,默认是false
|
||||
|
||||
//,zIndex : 900 //编辑器层级的基数,默认是900
|
||||
|
||||
//,imagePopup:true //图片操作的浮层开关,默认打开
|
||||
|
||||
,initialStyle:initialStyle //编辑器内部样式,可以用来改变字体等
|
||||
|
||||
//,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
|
||||
|
||||
//,pasteplain:false //是否纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
|
||||
|
||||
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
|
||||
//iframeUrlMap
|
||||
//dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
|
||||
//,iframeUrlMap:{
|
||||
// 'anchor':'~/dialogs/anchor/anchor.html',
|
||||
// }
|
||||
//insertorderedlist
|
||||
//有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
||||
// ,'insertorderedlist':{
|
||||
// 'decimal' : '' , //'1,2,3...'
|
||||
// 'lower-alpha' : '' , // 'a,b,c...'
|
||||
// 'lower-roman' : '' , //'i,ii,iii...'
|
||||
// 'upper-alpha' : '' , lang //'A,B,C'
|
||||
// 'upper-roman' : '' //'I,II,III...'
|
||||
// }
|
||||
//insertunorderedlist
|
||||
//无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
||||
//,insertunorderedlist : {
|
||||
// 'circle' : '', // '○ 小圆圈'
|
||||
// 'disc' : '', // '● 小圆点'
|
||||
// 'square' : '' //'■ 小方块'
|
||||
//}
|
||||
//fontfamily
|
||||
//字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
|
||||
//,'fontfamily':[
|
||||
// { label:'',name:'songti',val:'宋体,SimSun'},
|
||||
// { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
|
||||
// { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
|
||||
// { label:'',name:'heiti',val:'黑体, SimHei'},
|
||||
// { label:'',name:'lishu',val:'隶书, SimLi'},
|
||||
// { label:'',name:'STZhongsong',val:'华文中宋, STZhongsong'},
|
||||
// { label:'',name:'andaleMono',val:'andale mono'},
|
||||
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
|
||||
// { label:'',name:'arialBlack',val:'arial black,avant garde'},
|
||||
// { label:'',name:'comicSansMs',val:'comic sans ms'},
|
||||
// { label:'',name:'impact',val:'impact,chicago'},
|
||||
// { label:'',name:'timesNewRoman',val:'times new roman'}
|
||||
//]
|
||||
//fontsize
|
||||
//字号
|
||||
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
|
||||
//paragraph
|
||||
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
|
||||
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
|
||||
//rowspacingtop
|
||||
//段间距 值和显示的名字相同
|
||||
//,'rowspacingtop':['5', '10', '15', '20', '25']
|
||||
//rowspacingBottom
|
||||
//段间距 值和显示的名字相同
|
||||
//,'rowspacingbottom':['5', '10', '15', '20', '25']
|
||||
//lineheight
|
||||
//行内间距 值和显示的名字相同
|
||||
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
|
||||
|
||||
//customstyle
|
||||
//自定义样式,不支持国际化,此处配置值即可最后显示值
|
||||
//block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置
|
||||
//尽量使用一些常用的标签
|
||||
//参数说明
|
||||
//tag 使用的标签名字
|
||||
//label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同,
|
||||
//style 添加的样式
|
||||
//每一个对象就是一个自定义的样式
|
||||
//,'customstyle':[
|
||||
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
|
||||
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
|
||||
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
|
||||
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
|
||||
// ]
|
||||
|
||||
//右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
|
||||
// ,contextMenu:[
|
||||
// {
|
||||
// label:'', //显示的名称
|
||||
// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
|
||||
// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
|
||||
// exec:function () {
|
||||
// //this是当前编辑器的实例
|
||||
// //this.ui._dialogs['inserttableDialog'].open();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
//wordCount
|
||||
//,wordCount:1 //是否开启字数统计
|
||||
//,maximumWords:10000 //允许的最大字符数
|
||||
//字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
|
||||
//,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
|
||||
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
|
||||
//,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
|
||||
|
||||
//highlightcode
|
||||
// 代码高亮时需要加载的第三方插件的路径
|
||||
// ,highlightJsUrl:URL + "third-party/SyntaxHighlighter/shCore.js"
|
||||
// ,highlightCssUrl:URL + "third-party/SyntaxHighlighter/shCoreDefault.css"
|
||||
//elementPathEnabled
|
||||
//是否启用元素路径,默认是显示
|
||||
//,elementPathEnabled : true
|
||||
//removeFormat
|
||||
//清除格式时可以删除的标签和属性
|
||||
//removeForamtTags标签
|
||||
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
|
||||
//removeFormatAttributes属性
|
||||
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
|
||||
//undo
|
||||
//可以最多回退的次数,默认20
|
||||
//,maxUndoCount:20
|
||||
//当输入的字符数超过该值时,保存一次现场
|
||||
//,maxInputCount:1
|
||||
//autoHeightEnabled
|
||||
// 是否自动长高,默认true
|
||||
//,autoHeightEnabled:true
|
||||
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
|
||||
//,minFrameHeight:220 //编辑器拖动时最小高度,默认220
|
||||
//autoFloatEnabled
|
||||
//是否保持toolbar的位置不动,默认true
|
||||
,autoFloatEnabled:false
|
||||
//浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
|
||||
//,topOffset:30
|
||||
//indentValue
|
||||
//首行缩进距离,默认是2em
|
||||
//,indentValue:'2em'
|
||||
//pageBreakTag
|
||||
//分页标识符,默认是_baidu_page_break_tag_
|
||||
//,pageBreakTag:'_baidu_page_break_tag_'
|
||||
|
||||
//autotypeset
|
||||
// //自动排版参数
|
||||
// ,autotypeset:{
|
||||
// mergeEmptyline : true, //合并空行
|
||||
// removeClass : true, //去掉冗余的class
|
||||
// removeEmptyline : false, //去掉空行
|
||||
// textAlign : "left" , //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
|
||||
// imageBlockLine : 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
|
||||
// pasteFilter : false, //根据规则过滤没事粘贴进来的内容
|
||||
// clearFontSize : false, //去掉所有的内嵌字号,使用编辑器默认的字号
|
||||
// clearFontFamily : false, //去掉所有的内嵌字体,使用编辑器默认的字体
|
||||
// removeEmptyNode : false , // 去掉空节点
|
||||
// //可以去掉的标签
|
||||
// removeTagNames : {标签名字:1},
|
||||
// indent : false, // 行首缩进
|
||||
// indentValue : '2em' //行首缩进的大小
|
||||
// }
|
||||
|
||||
};
|
||||
})();
|
After Width: | Height: | Size: 5.9 KiB |
|
@ -4,7 +4,8 @@
|
|||
<meta charset="utf-8">
|
||||
<title>{{$setting['title']}}</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
||||
<link href="{{mix('/assets/dist/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/vendor.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/gdoo.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<script src="{{$asset_url}}/vendor/jquery.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>信息提示</title>
|
||||
<link href="<?php echo mix('/assets/dist/app.min.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo mix('/assets/dist/vendor.min.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo mix('/assets/dist/gdoo.min.css'); ?>" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
.window {
|
||||
font: 12px 'Lucida Grande', Verdana, sans-serif;
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
@include('layouts/mobile/header')
|
||||
|
||||
<div class="content m-n">
|
||||
|
||||
@if(Session::has('message'))
|
||||
<div class="m-sm alert alert-success alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{{Session::pull('message')}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(Session::has('error'))
|
||||
<div class="m-sm alert alert-warning alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{{Session::pull('error')}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($errors->has())
|
||||
<div class="m-sm alert alert-warning alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
@foreach($errors->all() as $message)
|
||||
<div>{{$message}}</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="content-body">
|
||||
{{$content}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>{{$setting['title']}}</title>
|
||||
<link type="text/css" href="{{mix('/assets/dist/app.min.css')}}" rel="stylesheet" />
|
||||
|
||||
<script type="text/javascript" src="{{$public_url}}/common?v={{time()}}"></script>
|
||||
<script type="text/javascript" src="{{mix('/assets/dist/app.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{$asset_url}}/vendor/datepicker/datepicker.js"></script>
|
||||
</head>
|
||||
<body>
|
|
@ -3,10 +3,11 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{$setting['title']}}</title>
|
||||
<link rel="stylesheet" href="{{mix('/assets/dist/app.min.css')}}" type="text/css" />
|
||||
<script src="{{$public_url}}/common?v={{time()}}"></script>
|
||||
<script src="{{mix('/assets/dist/app.min.js')}}"></script>
|
||||
<script src="{{$asset_url}}/vendor/datepicker/datepicker.js"></script>
|
||||
<link href="{{mix('/assets/dist/vendor.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/gdoo.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="{{mix('/assets/dist/vendor.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{$public_url}}/common?s={{time()}}"></script>
|
||||
<script type="text/javascript" src="{{mix('/assets/dist/gdoo.min.js')}}"></script>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: -webkit-linear-gradient(right, #198fb4, #0b6fab);
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{$setting['print_title']}}{{$form['template']['name']}}</title>
|
||||
<link rel="stylesheet" href="{{$asset_url}}/dist/app.min.css" type="text/css" />
|
||||
<link href="{{mix('/assets/dist/vendor.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/gdoo.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
.table {
|
||||
border: 1px solid #000;
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{$setting['title']}}</title>
|
||||
<link rel="stylesheet" href="{{mix('/assets/dist/app.min.css')}}" type="text/css" />
|
||||
<script src="{{$public_url}}/common?v={{time()}}"></script>
|
||||
<script src="{{mix('/assets/dist/app.min.js')}}"></script>
|
||||
<script src="{{$asset_url}}/vendor/datepicker/datepicker.js"></script>
|
||||
<link href="{{mix('/assets/dist/vendor.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<link href="{{mix('/assets/dist/gdoo.min.css')}}" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="{{mix('/assets/dist/vendor.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{$public_url}}/common?s={{time()}}"></script>
|
||||
<script type="text/javascript" src="{{mix('/assets/dist/gdoo.min.js')}}"></script>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: -webkit-linear-gradient(right, #198fb4, #0b6fab);
|
||||
|
|