提交 76c16f5a 编写于 作者: doc_wei's avatar doc_wei

ue编辑器相关代码优化

上级 3754a9dd
......@@ -56,12 +56,14 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { //删除
del(data, obj);
}else if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'details') { //详情
if (layEvent === 'del') { // 删除
del(data, obj);
} else if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'details') { // 详情
details(data);
} else if (layEvent === 'sysPic') { // 图片
systemCommonUtil.showPicImg(fileBasePath + data.logo);
}
});
......
......@@ -48,21 +48,7 @@ layui.config({
ajaxSendAfter:function(json){
//回显内容
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 800,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
ue.addListener("ready", function () {
ue.setContent(json.bean.content);
});
......
......@@ -14,22 +14,8 @@ layui.config({
$("#forumTitle").html(getFileContent("tpl/forumshow/commontitle.tpl"));
//菜单
$("body").append(getFileContent("tpl/forumshow/commonmenu.tpl"));
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 800,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
$('#tagId').tagEditor({
initialTags: [],
......
......@@ -13,29 +13,15 @@ layui.config({
eleTree = layui.eleTree;
initTypeId();
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
// 初始化类型
function initTypeId(){
var el5;
el5 = eleTree.render({
elem: '.ele5',
url: "knowledgetype008?loginPCIp=",
url: reqBasePath + "knowledgetype008?loginPCIp=",
defaultExpandAll: true,
expandOnClickNode: false,
highlightCurrent: true
......
......@@ -16,7 +16,7 @@ layui.config({
var el5;
el5 = eleTree.render({
elem: '.ele5',
url: "knowledgetype008?loginPCIp=",
url: reqBasePath + "knowledgetype008?loginPCIp=",
defaultExpandAll: true,
expandOnClickNode: false,
highlightCurrent: true
......@@ -46,21 +46,8 @@ layui.config({
initType();
$("#typeId").val(json.bean.typeName);
$("#typeId").attr("typeId", json.bean.typeId);
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
ue.addListener("ready", function () {
ue.setContent(json.bean.content);
});
......
......@@ -12,21 +12,7 @@ layui.config({
// 表格的序号
var rowNum = 1;
var taxRateTemplate = $("#taxRateTemplate").html();
var ue = UE.getEditor('container', {
// 初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
matchingLanguage();
form.render();
......
......@@ -24,21 +24,7 @@ layui.config({
},
ajaxSendAfter:function(json){
ue = UE.getEditor('container', {
// 初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
ue = ueEditorUtil.initEditor('container');
ue.addListener("ready", function () {
ue.setContent(json.bean.companyDesc);
});
......
......@@ -12,21 +12,7 @@ layui.config({
form = layui.form;
var selOption = getFileContent('tpl/template/select-option.tpl');
var ue = UE.getEditor('content',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 10000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('content');
taskTypeSelect();
......
......@@ -29,21 +29,7 @@ layui.config({
$(".typeOne").removeClass("layui-hide");
}
ue = UE.getEditor('content',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 10000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
ue = ueEditorUtil.initEditor('content');
ue.addListener("ready", function () {
ue.setContent(json.bean.content);
});
......
......@@ -47,26 +47,8 @@ layui.config({
});
$("#businessEnclosureUpload").html(str);
ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 100000
});
planUe = UE.getEditor('planContainer',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
ue = ueEditorUtil.initEditor('container');
planUe = ueEditorUtil.initEditor('planContainer');
ue.addListener("ready", function () {
if(!isNull(json.bean.projectContent))
ue.setContent(json.bean.projectContent);
......
......@@ -42,21 +42,7 @@ layui.config({
trigger: 'click'
});
ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 800,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
ue = ueEditorUtil.initEditor('container');
ue.addListener("ready", function () {
ue.setContent(json.bean.businessContent);
});
......
......@@ -20,21 +20,7 @@ layui.config({
laydate = layui.laydate;
var selOption = getFileContent('tpl/template/select-option.tpl');
var ue = UE.getEditor('taskInstructions',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 10000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('taskInstructions');
if(parent.isSplitTask == true){
var parentId = parent.rowId;
......
......@@ -43,21 +43,7 @@ layui.config({
$(".typeOne").removeClass("layui-hide");
}
ue = UE.getEditor('taskInstructions',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 10000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
ue = ueEditorUtil.initEditor('taskInstructions');
ue.addListener("ready", function () {
ue.setContent(json.bean.taskInstructions);
});
......
......@@ -33,22 +33,8 @@ layui.config({
content = json.bean.taskInstructions;
$("#taskInstructionsShowBox").attr("src", "taskinstructionsshow.html");
var ue = UE.getEditor('executionResult',{
//初始化高度
initialFrameHeight: 400,
maximumWords: 10000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('executionResult');
ue.addListener("ready", function () {
if(!isNull(json.bean.executionResult))
ue.setContent(json.bean.executionResult);
......
......@@ -11,21 +11,7 @@ layui.config({
var $ = layui.$,
form = layui.form;
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
//初始化学校
showGrid({
......
......@@ -107,22 +107,8 @@ layui.config({
}
});
}
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight: 700,
maximumWords: 100000
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
};
var ue = ueEditorUtil.initEditor('container');
ue.addListener("ready", function () {
ue.setContent(json.bean.content);
});
......
......@@ -130,15 +130,7 @@ layui.config({
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'userPhoto') { //头像预览
layer.open({
type:1,
title:false,
closeBtn:0,
skin: 'demo-class',
shadeClose:true,
content:'<img src="' + systemCommonUtil.getFilePath(data.userPhoto) + '" style="max-height:600px;max-width:100%;">',
scrollbar:false
});
systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.userPhoto));
}else if (layEvent === 'details') { //员工详情
details(data);
}else if (layEvent === 'leave'){ //离职
......
......@@ -302,13 +302,14 @@ layui.define(["jquery","laytpl"], function (exports) {
data = JSON.stringify(data);
}
$.extend(options.headers, getRequestHeaders());
$.ajax({
type: options.method || 'get'
,url: reqBasePath + options.url
,url: options.url
,contentType: options.contentType
,data: data
,dataType: 'json'
,headers: options.headers || {}
,headers: options.headers
,success: function(res){
// response接口支持多级子项的方式,即"a.b"为res.a.b
var fn=function (responseMsg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册