/*
|
* 设计器私有的配置说明
|
* 一
|
* UE.leipiFormDesignUrl 插件路径
|
*
|
* 二
|
*UE.getEditor('myFormDesign',{
|
* toolleipi:true,//是否显示,设计器的清单 tool
|
*/
|
UE.leipiFormDesignUrl = 'formdesign';
|
/**
|
* 文本框
|
* @command textfield
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'textfield');
|
* ```
|
*/
|
|
|
var strFullPath = window.document.location.href;
|
var strPath = window.document.location.pathname;
|
var pos = strFullPath.indexOf(strPath);
|
var prePath = strFullPath.substring(0, pos);
|
var postPath = strPath.substring(0, strPath.substr(1).indexOf('/') + 1);
|
var rootUrl = prePath + postPath;
|
|
var formId = $("#txtFormId").val();
|
var postUrl = "config/form/editFormColumn?formId=" + formId;
|
UE.plugins['text'] = function () {
|
|
var me = this, thePlugins = 'text';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Text",
|
name: thePlugins,
|
editor: this,
|
title: '文本框',
|
cssRules: "width:800px;height:620px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该文本框控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>文本框: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
/**
|
* 单选框组
|
* @command radios
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'radio');
|
* ```
|
*/
|
UE.plugins['radios'] = function () {
|
var me = this, thePlugins = 'radios';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Radios",
|
name: thePlugins,
|
editor: this,
|
title: '单选框组',
|
cssRules: "width:800px;height:520px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该单选框组控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/span/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>单选框组: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
var elInput = el.getElementsByTagName("input");
|
var rEl = elInput.length > 0 ? elInput[0] : el;
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(rEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
/**
|
* 复选框组
|
* @command checkboxs
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'checkboxs');
|
* ```
|
*/
|
UE.plugins['checkboxs'] = function () {
|
var me = this, thePlugins = 'checkboxs';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Checkboxs",
|
name: thePlugins,
|
editor: this,
|
title: '复选框组',
|
cssRules: "width:800px;height:520px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该复选框组控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/span/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>复选框组: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
var elInput = el.getElementsByTagName("input");
|
var rEl = elInput.length > 0 ? elInput[0] : el;
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(rEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
/**
|
* 多行文本框
|
* @command textarea
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'textarea');
|
* ```
|
*/
|
UE.plugins['textarea'] = function () {
|
var me = this, thePlugins = 'textarea';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=TextArea",
|
name: thePlugins,
|
editor: this,
|
title: '多行文本框',
|
cssRules: "width:800px;height:500px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该多行文本框控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
if (/textarea/ig.test(el.tagName)) {
|
var html = popup.formatHtml(
|
'<nobr>多行文本框: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
/**
|
* 下拉菜单
|
* @command select
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'select');
|
* ```
|
*/
|
UE.plugins['select'] = function () {
|
var me = this, thePlugins = 'select';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Select",
|
name: thePlugins,
|
editor: this,
|
title: '下拉菜单',
|
cssRules: "width:800px;height:520px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该下拉菜单控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/select|span/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>下拉菜单: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
if (el.tagName == 'SPAN') {
|
var elInput = el.getElementsByTagName("select");
|
el = elInput.length > 0 ? elInput[0] : el;
|
}
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
|
};
|
|
/**
|
* 列表控件
|
* @command listctrl
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'listctrl');
|
* ```
|
*/
|
UE.plugins['listctrl'] = function () {
|
var me = this, thePlugins = 'listctrl';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=ListCtrl",
|
name: thePlugins,
|
editor: this,
|
title: '列表控件',
|
cssRules: "width:1200px;height:520px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该列表控件控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>列表控件: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
|
UE.plugins['error'] = function () {
|
var me = this, thePlugins = 'error';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Error",
|
name: thePlugins,
|
editor: this,
|
title: '异常提示',
|
cssRules: "width:400px;height:130px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
};
|
|
UE.plugins['leipi_template'] = function () {
|
var me = this, thePlugins = 'leipi_template';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Template",
|
name: thePlugins,
|
editor: this,
|
title: '表单模板',
|
cssRules: "width:640px;height:380px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
};
|
|
/**
|
* 日期时间
|
* @command datetime
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'datetime');
|
* ```
|
*/
|
UE.plugins['datetime'] = function () {
|
var me = this, thePlugins = 'datetime';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=DateTime",
|
name: thePlugins,
|
editor: this,
|
title: '日期时间框',
|
cssRules: "width:800px;height:400px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该日期时间框控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>日期时间框: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
/**
|
* 人员选择
|
* @command person
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'person');
|
* ```
|
*/
|
UE.plugins['person'] = function () {
|
var me = this, thePlugins = 'person';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Person",
|
name: thePlugins,
|
editor: this,
|
title: '人员选择框',
|
cssRules: "width:900px;height:560px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该人员选择框控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>人员选择框: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
|
/**
|
* 上传文件
|
* @command upload
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'upload');
|
* ```
|
*/
|
UE.plugins['upload'] = function () {
|
var me = this, thePlugins = 'upload';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Upload",
|
name: thePlugins,
|
editor: this,
|
title: '上传文件框',
|
cssRules: "width:600px;height:300px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该上传文件框控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>上传文件框: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
/**
|
* 资源选择
|
* @command resource
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'resource');
|
* ```
|
*/
|
UE.plugins['resource'] = function () {
|
var me = this, thePlugins = 'resource';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Resource",
|
name: thePlugins,
|
editor: this,
|
title: '资源选择',
|
cssRules: "width:800px;height:600px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该资源选择控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>资源选择: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
/**
|
* 流水号
|
* @command serial
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'serial');
|
* ```
|
*/
|
UE.plugins['serial'] = function () {
|
var me = this, thePlugins = 'serial';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Serial",
|
name: thePlugins,
|
editor: this,
|
title: '流水号',
|
cssRules: "width:600px;height:320px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该流水号控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>流水号: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
/**
|
* 公式字段
|
* @command formula
|
* @method execCommand
|
* @param { String } cmd 命令字符串
|
* @example
|
* ```javascript
|
* editor.execCommand( 'formula');
|
* ```
|
*/
|
UE.plugins['formula'] = function () {
|
var me = this, thePlugins = 'formula';
|
me.commands[thePlugins] = {
|
execCommand: function () {
|
var dialog = new UE.ui.Dialog({
|
iframeUrl: postUrl + "&type=Formula",
|
name: thePlugins,
|
editor: this,
|
title: '公式字段',
|
cssRules: "width:600px;height:350px;",
|
buttons: [
|
{
|
className: 'edui-okbutton',
|
label: '确定',
|
onclick: function () {
|
dialog.close(true);
|
}
|
},
|
{
|
className: 'edui-cancelbutton',
|
label: '取消',
|
onclick: function () {
|
dialog.close(false);
|
}
|
}]
|
});
|
dialog.render();
|
dialog.open();
|
}
|
};
|
|
var popup = new baidu.editor.ui.Popup({
|
editor: this,
|
content: '',
|
className: 'edui-bubble',
|
_edittext: function () {
|
baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
|
me.execCommand(thePlugins);
|
this.hide();
|
},
|
_delete: function () {
|
if (window.confirm('确认删除该公式字段控件吗?')) {
|
baidu.editor.dom.domUtils.remove(this.anchorEl, false);
|
}
|
this.hide();
|
}
|
});
|
popup.render();
|
me.addListener('mouseover', function (t, evt) {
|
evt = evt || window.event;
|
var el = evt.target || evt.srcElement;
|
var leipiPlugins = el.getAttribute('leipiplugins');
|
if (/input/ig.test(el.tagName) && leipiPlugins == thePlugins) {
|
var html = popup.formatHtml(
|
'<nobr>公式字段: <span onclick=$$._edittext() class="edui-clickable pt-color-success"><i class="fa fa-pencil" title="编辑"></i>编辑</span><span onclick=$$._delete() class="edui-clickable pt-color-danger"><i class="fa fa-trash-o" title="删除"></i>删除</span></nobr>');
|
if (html) {
|
popup.getDom('content').innerHTML = html;
|
popup.anchorEl = el;
|
popup.showAnchor(popup.anchorEl);
|
} else {
|
popup.hide();
|
}
|
}
|
});
|
};
|
|
UE.registerUI('button_text', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('text');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "输入框",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -4px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
alert('dd');
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_textarea', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('textarea');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "多行输入框",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -27px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_select', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('select');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "下拉选择",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -50px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_radios', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('radios');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "单选框组",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -73px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_checkboxs', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('checkboxs');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "复选框组",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -96px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
|
UE.registerUI('button_listctrl', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('listctrl');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "列表控件",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -142px -135px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
UE.registerUI('button_datetime', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('datetime');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "日期时间框",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -161px -20px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_person', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('person');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "人员选择",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -97px -171px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_upload', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('upload');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "文件上传",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -190px -136px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_resource', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('resource');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "资源选择",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -214px -136px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_serial', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('serial');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "流水号",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -237px -136px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_formula', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
editor.execCommand('formula');
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "公式字段",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -621px 0px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
return btn;
|
});
|
|
UE.registerUI('button_template', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
try {
|
leipiFormDesign.exec('leipi_template');
|
//leipiFormDesign.fnCheckForm('save');
|
} catch (e) {
|
alert('打开模板异常');
|
}
|
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "表单模板",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -339px -40px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
//因为你是添加button,所以需要返回这个button
|
return btn;
|
});
|
UE.registerUI('button_preview', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
try {
|
leipiFormDesign.fnReview();
|
} catch (e) {
|
alert('leipiFormDesign.fnReview 预览异常');
|
}
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "预览",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -420px -19px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
//因为你是添加button,所以需要返回这个button
|
return btn;
|
});
|
|
UE.registerUI('button_save', function (editor, uiName) {
|
if (!this.options.toolleipi) {
|
return false;
|
}
|
//注册按钮执行时的command命令,使用命令默认就会带有回退操作
|
editor.registerCommand(uiName, {
|
execCommand: function () {
|
try {
|
leipiFormDesign.fnCheckForm('save');
|
} catch (e) {
|
//alert(e);
|
//alert('leipiFormDesign.fnCheckForm("save") 保存异常');
|
}
|
|
}
|
});
|
//创建一个button
|
var btn = new UE.ui.Button({
|
//按钮的名字
|
name: uiName,
|
//提示
|
title: "保存表单",
|
//需要添加的额外样式,指定icon图标,这里默认使用一个重复的icon
|
cssRules: 'background-position: -481px -20px;',
|
//点击时执行的命令
|
onclick: function () {
|
//这里可以不用执行命令,做你自己的操作也可
|
editor.execCommand(uiName);
|
}
|
});
|
|
//因为你是添加button,所以需要返回这个button
|
return btn;
|
});
|